|
|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
placeholder="计划状态">
|
|
|
|
|
<Option v-for="item in statusList" :value="item.id">{{item.value}}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<DatePicker style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
|
|
|
|
|
<DatePicker v-model="select.year" style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
|
|
|
|
|
type="year" @on-change="changeYear"></DatePicker>
|
|
|
|
|
<Input v-model="select.keyword" clearable style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
|
|
|
|
|
|
|
|
|
|
@ -18,29 +18,41 @@
|
|
|
|
|
|
|
|
|
|
<Button type="primary" @click="getList">查询</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px;" @click="editorPlan('','add')">添加</Button>
|
|
|
|
|
<Button type="primary" style='margin-left: 10px;'
|
|
|
|
|
@click="chooseEditorPlan()">编辑</Button>
|
|
|
|
|
<!-- <Button type="primary" style='margin-left: 10px;'
|
|
|
|
|
@click="chooseEditorPlan()">编辑</Button> -->
|
|
|
|
|
<!-- <Button type="primary" style='margin-left: 10px;'
|
|
|
|
|
@click="importPlan()">导入</Button> -->
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</lx-header>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- @cell-click="cellClicks" -->
|
|
|
|
|
<!-- @cell-click="cellClicks" -->
|
|
|
|
|
<!-- :span-method="spanMethod" -->
|
|
|
|
|
<!-- :showIndex='false' -->
|
|
|
|
|
<xy-table :list="list"
|
|
|
|
|
:total="total"
|
|
|
|
|
:span-method="spanMethod"
|
|
|
|
|
:showIndex='false'
|
|
|
|
|
stripe
|
|
|
|
|
@cell-dblclick="cellClicks"
|
|
|
|
|
@selection-change='selectionChange'
|
|
|
|
|
@pageSizeChange="e => {select.page_size = e,getList()}"
|
|
|
|
|
@pageIndexChange="e => {select.page = e,getList()}"
|
|
|
|
|
:table-item="table"
|
|
|
|
|
:defaultExpandAll="false">
|
|
|
|
|
:defaultExpandAll="false"
|
|
|
|
|
|
|
|
|
|
:isPage='false'>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' label="操作" width="100" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="showPlan(scope.row.id)">查看/添加</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editorPlan(scope.row.id,'editor')">编辑</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editorUnit('add',scope.row.id)">发起任务</Button> -->
|
|
|
|
|
@ -50,24 +62,31 @@
|
|
|
|
|
</xy-table>
|
|
|
|
|
<addPlan ref='addPlan' @refresh='getList'></addPlan>
|
|
|
|
|
<showPlan ref='showPlan'></showPlan>
|
|
|
|
|
<addUnit ref='addUnit' @refresh='getList'></addUnit>
|
|
|
|
|
<addUnit ref='addUnit' @refresh='getList'></addUnit>
|
|
|
|
|
<imports ref="imports" :tableName="'mission_plans'" :formInfo="table"></imports>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import addPlan from '../list/components/addPlan.vue'
|
|
|
|
|
import addUnit from '../list/components/addUnit.vue'
|
|
|
|
|
import showPlan from '../list/components/showPlan.vue'
|
|
|
|
|
import showPlan from '../list/components/showPlan.vue'
|
|
|
|
|
import imports from '@/components/imports/imports'
|
|
|
|
|
import {
|
|
|
|
|
listplan,
|
|
|
|
|
del
|
|
|
|
|
} from '@/api/task/plan.js'
|
|
|
|
|
import {
|
|
|
|
|
getMergeCells,
|
|
|
|
|
groupBy
|
|
|
|
|
} from '@/utils/contactTable.js'
|
|
|
|
|
import state from '@/store/modules/user.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addPlan,
|
|
|
|
|
showPlan,
|
|
|
|
|
addUnit
|
|
|
|
|
addUnit,
|
|
|
|
|
imports
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
@ -76,13 +95,13 @@
|
|
|
|
|
select: {
|
|
|
|
|
keyword: '',
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
status: '',
|
|
|
|
|
// is_myself_audit:0,
|
|
|
|
|
year: new Date().getFullYear(),
|
|
|
|
|
year: '',
|
|
|
|
|
plan_type: '',
|
|
|
|
|
sort_name: 'start_date',
|
|
|
|
|
sort_type: 'DESC'
|
|
|
|
|
sort_name: '',
|
|
|
|
|
sort_type: ''
|
|
|
|
|
},
|
|
|
|
|
sectionList:[],
|
|
|
|
|
total: 0,
|
|
|
|
|
@ -128,55 +147,57 @@
|
|
|
|
|
value:'审核不通过',
|
|
|
|
|
type:'warning'
|
|
|
|
|
}],
|
|
|
|
|
table: [{
|
|
|
|
|
type:'selection',
|
|
|
|
|
width:50,
|
|
|
|
|
selectable:(row,index)=>{
|
|
|
|
|
if(this.stateObj.login_id==row.admin_id||this.stateObj.is_guiji||this.stateObj.is_chuzhang||this.stateObj.is_admin){
|
|
|
|
|
return true
|
|
|
|
|
}else{
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type:'expand',
|
|
|
|
|
width:50,
|
|
|
|
|
expandFn:(row)=>{
|
|
|
|
|
table: [
|
|
|
|
|
// {
|
|
|
|
|
// type:'selection',
|
|
|
|
|
// width:50,
|
|
|
|
|
// selectable:(row,index)=>{
|
|
|
|
|
// if(this.stateObj.login_id==row.admin_id||this.stateObj.is_guiji||this.stateObj.is_chuzhang||this.stateObj.is_admin){
|
|
|
|
|
// return true
|
|
|
|
|
// }else{
|
|
|
|
|
// return false
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// type:'expand',
|
|
|
|
|
// width:50,
|
|
|
|
|
// expandFn:(row)=>{
|
|
|
|
|
|
|
|
|
|
return(<div style={{"border-bottom": "1px solid #EBEEF5"}}>
|
|
|
|
|
{
|
|
|
|
|
row.row.mission.length>0?
|
|
|
|
|
row.row.mission.map((item,index)=>{
|
|
|
|
|
return(<div class='expandrow'>
|
|
|
|
|
<p>{index+1}、<span>任务名称:</span><span>{item.name}</span></p>
|
|
|
|
|
<p><span>状态:</span><span>{
|
|
|
|
|
this.auditStatusList.map(status=>{
|
|
|
|
|
if(item.audit_status===status.id){
|
|
|
|
|
return status.value
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// return(<div style={{"border-bottom": "1px solid #EBEEF5"}}>
|
|
|
|
|
// {
|
|
|
|
|
// row.row.mission.length>0?
|
|
|
|
|
// row.row.mission.map((item,index)=>{
|
|
|
|
|
// return(<div class='expandrow'>
|
|
|
|
|
// <p>{index+1}、<span>任务名称:</span><span>{item.name}</span></p>
|
|
|
|
|
// <p><span>状态:</span><span>{
|
|
|
|
|
// this.auditStatusList.map(status=>{
|
|
|
|
|
// if(item.audit_status===status.id){
|
|
|
|
|
// return status.value
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}</span></p>
|
|
|
|
|
<p><span>开始日期:</span><span>{item.start_date}</span></p>
|
|
|
|
|
<p><span>结束日期:</span><span>{item.end_date}</span></p>
|
|
|
|
|
<p><span>任务类型:</span><span>{item.unit_type_detail?item.unit_type_detail.value:''}</span></p>
|
|
|
|
|
<p><span>创建人:</span><span>{item.admin?item.admin.name:''}</span></p>
|
|
|
|
|
<p><span>创建科室:</span><span>{item.department?item.department.name:''}</span></p>
|
|
|
|
|
<p><span>创建时间:</span><span>{item.created_at.substring(0,11)}</span></p>
|
|
|
|
|
</div>)
|
|
|
|
|
})
|
|
|
|
|
// }</span></p>
|
|
|
|
|
// <p><span>开始日期:</span><span>{item.start_date}</span></p>
|
|
|
|
|
// <p><span>结束日期:</span><span>{item.end_date}</span></p>
|
|
|
|
|
// <p><span>任务类型:</span><span>{item.unit_type_detail?item.unit_type_detail.value:''}</span></p>
|
|
|
|
|
// <p><span>创建人:</span><span>{item.admin?item.admin.name:''}</span></p>
|
|
|
|
|
// <p><span>创建科室:</span><span>{item.department?item.department.name:''}</span></p>
|
|
|
|
|
// <p><span>创建时间:</span><span>{item.created_at.substring(0,11)}</span></p>
|
|
|
|
|
// </div>)
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
:<div class='expandrow'>暂无任务</div>
|
|
|
|
|
}</div>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// :<div class='expandrow'>暂无任务</div>
|
|
|
|
|
// }</div>)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// label: "年份",
|
|
|
|
|
// prop: 'year',
|
|
|
|
|
// width: 80,
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
label: "年份",
|
|
|
|
|
prop: 'year',
|
|
|
|
|
width: 120,
|
|
|
|
|
},{
|
|
|
|
|
label: "工作项目",
|
|
|
|
|
prop: 'menu',
|
|
|
|
|
width: 120,
|
|
|
|
|
@ -184,10 +205,17 @@
|
|
|
|
|
label: "性质级别",
|
|
|
|
|
prop: 'level',
|
|
|
|
|
width: 120,
|
|
|
|
|
},{
|
|
|
|
|
label: "月份",
|
|
|
|
|
prop: 'start_date',
|
|
|
|
|
},{
|
|
|
|
|
label: "主要内容",
|
|
|
|
|
prop: 'out_line_content',
|
|
|
|
|
// width: 120,
|
|
|
|
|
align:'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "月份",
|
|
|
|
|
prop: 'start_date',
|
|
|
|
|
width: 180,
|
|
|
|
|
align:'left',
|
|
|
|
|
customFn:(row)=>{
|
|
|
|
|
return(<div style={{"display": "flex","flex-wrap": "wrap","justify-content": "center"}}>
|
|
|
|
|
{
|
|
|
|
|
@ -200,14 +228,15 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</div>)
|
|
|
|
|
}
|
|
|
|
|
},{
|
|
|
|
|
label: "计划名称",
|
|
|
|
|
prop: 'name',
|
|
|
|
|
align: 'left'
|
|
|
|
|
// width:200
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// label: "计划名称",
|
|
|
|
|
// prop: 'name',
|
|
|
|
|
// align: 'left'
|
|
|
|
|
// // width:200
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// label: "类型",
|
|
|
|
|
// prop: 'type_detail.value',
|
|
|
|
|
// width: 180,
|
|
|
|
|
@ -229,6 +258,7 @@
|
|
|
|
|
label: "状态",
|
|
|
|
|
prop: 'status',
|
|
|
|
|
width: 120,
|
|
|
|
|
align:'left',
|
|
|
|
|
customFn:(row)=>{
|
|
|
|
|
return(<div>
|
|
|
|
|
{
|
|
|
|
|
@ -294,6 +324,7 @@
|
|
|
|
|
label: "任务数量",
|
|
|
|
|
prop: 'mission',
|
|
|
|
|
width: 120,
|
|
|
|
|
align:'left',
|
|
|
|
|
formatter:(cell,data,value,index)=>{
|
|
|
|
|
return value?(value.length===0?'--':value.length):'--'
|
|
|
|
|
}
|
|
|
|
|
@ -304,11 +335,21 @@
|
|
|
|
|
}],
|
|
|
|
|
list: [],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
// 获取所有单元格合并数据
|
|
|
|
|
spanArr() {
|
|
|
|
|
if (!this.list.length) return []
|
|
|
|
|
const mergeCols = ['menu','level'] // 需要合并的列(字段)
|
|
|
|
|
const data = groupBy(this.list, 'menu')
|
|
|
|
|
return getMergeCells(data, this.table, mergeCols)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// this.getUserId()
|
|
|
|
|
// this.getLeads()
|
|
|
|
|
this.stateObj = state.state
|
|
|
|
|
this.select.year = (new Date()).getFullYear() + ''
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -376,6 +417,15 @@
|
|
|
|
|
}
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
},
|
|
|
|
|
spanMethod({
|
|
|
|
|
row,
|
|
|
|
|
colomn,
|
|
|
|
|
rowIndex,
|
|
|
|
|
columnIndex
|
|
|
|
|
}) {
|
|
|
|
|
|
|
|
|
|
return this.spanArr[rowIndex][columnIndex]
|
|
|
|
|
},
|
|
|
|
|
changeYear(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
@ -431,6 +481,9 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
importPlan(){
|
|
|
|
|
this.$refs.imports.show()
|
|
|
|
|
},
|
|
|
|
|
contactGroup(arr) {
|
|
|
|
|
let tempArr = [],
|
|
|
|
|
newArr = []
|
|
|
|
|
@ -491,6 +544,10 @@
|
|
|
|
|
.expandrow p span:first-child{
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-table .cell.el-tooltip {
|
|
|
|
|
white-space: normal !important;
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
}
|
|
|
|
|
/* /deep/ .el-table__body tr.el-table__row--striped td {
|
|
|
|
|
background-color: #C0C4CC!important;
|
|
|
|
|
|