|
|
|
|
@ -4,539 +4,160 @@
|
|
|
|
|
<lx-header icon="md-apps" :text="textName" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
|
|
|
|
<slot>
|
|
|
|
|
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
|
|
|
|
|
<Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.status"
|
|
|
|
|
<!-- <Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.status"
|
|
|
|
|
placeholder="计划状态">
|
|
|
|
|
<Option v-for="item in statusList" :value="item.id">{{item.value}}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<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="关键字搜索" />
|
|
|
|
|
|
|
|
|
|
<!-- <Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.plan_id" placeholder="专项任务">
|
|
|
|
|
<Option v-for="item in missionList" :value="item.id">{{item.name}}</Option>
|
|
|
|
|
</Select> -->
|
|
|
|
|
|
|
|
|
|
<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="关键字搜索" />
|
|
|
|
|
<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="importPlan()">导入</Button> -->
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</lx-header>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tablewrap">
|
|
|
|
|
<div class="tablemonth">
|
|
|
|
|
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
|
|
<div style="margin: 15px 0;"></div>
|
|
|
|
|
<el-checkbox-group v-model="selectMonth" @change="changeMonth">
|
|
|
|
|
<el-checkbox v-for="item in allMonths" :label="item"></el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="tablecontent">
|
|
|
|
|
<xy-table :list="currentTableList"
|
|
|
|
|
:total="total"
|
|
|
|
|
:span-method="spanMethod"
|
|
|
|
|
row-key="rowindex"
|
|
|
|
|
: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"
|
|
|
|
|
:isPage='false'>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' label="操作" width="200" 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> -->
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editUnit(scope.row,1)">新增年度任务</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="showPlan(scope.row.id)">新增专项任务</Button> -->
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editUnit(scope.row,4)">新增专项任务</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editorPlan(scope.row.id,'editor')">编辑年度计划</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tablewrap">
|
|
|
|
|
<div class="tablemonth">
|
|
|
|
|
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
|
|
<div style="margin: 15px 0;"></div>
|
|
|
|
|
<el-checkbox-group v-model="selectMonth" @change="changeMonth">
|
|
|
|
|
<el-checkbox v-for="item in allMonths" :label="item"></el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<addPlan ref='addPlan' @refresh='getList'></addPlan>
|
|
|
|
|
<div class="tablecontent">
|
|
|
|
|
<xy-table :list="list" :total="total" row-key="rowindex" stripe @cell-dblclick="cellClicks"
|
|
|
|
|
@pageSizeChange="e => {select.page_size = e,getList()}" @pageIndexChange="e => {select.page = e,getList()}"
|
|
|
|
|
:table-item="table">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' label="操作" width="200" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editUnit(scope.row,1)">发布任务</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
|
|
|
|
|
@click="editorPlan(scope.row.id,'editor')">编辑计划</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<addPlan ref='addPlan' @refresh='getList'></addPlan>
|
|
|
|
|
<addUnit ref='addUnit' @refresh="getList"></addUnit>
|
|
|
|
|
<showPlan ref='showPlan'></showPlan>
|
|
|
|
|
<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 addPlan from '../list/components/addPlan.vue'
|
|
|
|
|
import addUnit from '../list/components/addUnit.vue'
|
|
|
|
|
import showPlan from '../list/components/showPlan.vue'
|
|
|
|
|
import imports from '@/components/imports/imports'
|
|
|
|
|
import showPlan from '../list/components/showPlan.vue'
|
|
|
|
|
import {
|
|
|
|
|
listplan,
|
|
|
|
|
del
|
|
|
|
|
} from '@/api/task/plan.js'
|
|
|
|
|
import {
|
|
|
|
|
getMergeCells,
|
|
|
|
|
groupBy
|
|
|
|
|
} from '@/utils/contactTable.js'
|
|
|
|
|
} from '@/api/task/plan.js'
|
|
|
|
|
import state from '@/store/modules/user.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addPlan,
|
|
|
|
|
showPlan,
|
|
|
|
|
addUnit,
|
|
|
|
|
imports
|
|
|
|
|
showPlan,
|
|
|
|
|
addUnit
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
textName: '',
|
|
|
|
|
stateObj:{},
|
|
|
|
|
textName: '',
|
|
|
|
|
stateObj: {},
|
|
|
|
|
select: {
|
|
|
|
|
keyword: '',
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
status: '',
|
|
|
|
|
page_size: 10,
|
|
|
|
|
// is_myself_audit:0,
|
|
|
|
|
year: '',
|
|
|
|
|
plan_type: '',
|
|
|
|
|
sort_name: '',
|
|
|
|
|
sort_type: ''
|
|
|
|
|
},
|
|
|
|
|
sectionList:[],
|
|
|
|
|
sort_type: '',
|
|
|
|
|
main_admin_id:1,
|
|
|
|
|
month:''
|
|
|
|
|
},
|
|
|
|
|
isIndeterminate: true,
|
|
|
|
|
checkAll: false,
|
|
|
|
|
selectMonth: [],
|
|
|
|
|
allMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
|
|
|
|
total: 0,
|
|
|
|
|
statusList: [{
|
|
|
|
|
id:0,
|
|
|
|
|
value:'未完成',
|
|
|
|
|
type:'danger'
|
|
|
|
|
},{
|
|
|
|
|
id:1,
|
|
|
|
|
value:'未开展',
|
|
|
|
|
type:'info'
|
|
|
|
|
},{
|
|
|
|
|
id:2,
|
|
|
|
|
value:'开展中',
|
|
|
|
|
type:''
|
|
|
|
|
},{
|
|
|
|
|
id:3,
|
|
|
|
|
value:'已完成',
|
|
|
|
|
type:'success'
|
|
|
|
|
}],
|
|
|
|
|
auditStatusList:[{
|
|
|
|
|
id:0,
|
|
|
|
|
value:'待审核',
|
|
|
|
|
type:'warning'
|
|
|
|
|
},{
|
|
|
|
|
id:4,
|
|
|
|
|
value:'待开展',
|
|
|
|
|
type:'info'
|
|
|
|
|
},{
|
|
|
|
|
id:1,
|
|
|
|
|
value:'开展中',
|
|
|
|
|
type:''
|
|
|
|
|
},{
|
|
|
|
|
id:2,
|
|
|
|
|
value:'未完成',
|
|
|
|
|
type:'danger'
|
|
|
|
|
},{
|
|
|
|
|
id:3,
|
|
|
|
|
value:'已完成',
|
|
|
|
|
type:'success'
|
|
|
|
|
},{
|
|
|
|
|
id:5,
|
|
|
|
|
value:'审核不通过',
|
|
|
|
|
type:'warning'
|
|
|
|
|
}],
|
|
|
|
|
currentTable:'',
|
|
|
|
|
currentTableList:[],
|
|
|
|
|
isIndeterminate:true,
|
|
|
|
|
checkAll:false,
|
|
|
|
|
selectMonth:[],
|
|
|
|
|
allMonths : ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
|
|
|
|
|
|
|
|
|
table: [
|
|
|
|
|
{
|
|
|
|
|
label: "工作项目",
|
|
|
|
|
prop: 'menu',
|
|
|
|
|
width: 120,
|
|
|
|
|
},{
|
|
|
|
|
label: "性质级别",
|
|
|
|
|
prop: 'level',
|
|
|
|
|
width: 120,
|
|
|
|
|
},{
|
|
|
|
|
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"}}>
|
|
|
|
|
// {
|
|
|
|
|
// row.start_date.map((item,index)=>{
|
|
|
|
|
// return(<span>{
|
|
|
|
|
// index===row.start_date.length-1?
|
|
|
|
|
// item
|
|
|
|
|
// :item+"、"
|
|
|
|
|
// }</span>)
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// </div>)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// label: "计划名称",
|
|
|
|
|
// prop: 'name',
|
|
|
|
|
// align: 'left'
|
|
|
|
|
// // width:200
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// label: "类型",
|
|
|
|
|
// prop: 'type_detail.value',
|
|
|
|
|
// width: 180,
|
|
|
|
|
// customFn:(row)=>{
|
|
|
|
|
// return(<div style={{"display": "flex","flex-wrap": "wrap","justify-content": "center"}}>
|
|
|
|
|
// {
|
|
|
|
|
// row.type_detail.map((item,index)=>{
|
|
|
|
|
// return(<span>{
|
|
|
|
|
// index===row.type_detail.length-1?
|
|
|
|
|
// item.value
|
|
|
|
|
// :item.value+"、"
|
|
|
|
|
// }</span>)
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// </div>)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
label: "状态",
|
|
|
|
|
prop: 'status',
|
|
|
|
|
width: 120,
|
|
|
|
|
align:'left',
|
|
|
|
|
customFn:(row)=>{
|
|
|
|
|
return(<div>
|
|
|
|
|
{
|
|
|
|
|
this.statusList.map(item=>{
|
|
|
|
|
if(item.id==row.status){
|
|
|
|
|
return(<el-tag type={item.type}>{item.value}</el-tag>)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</div>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// label: "参与对象",
|
|
|
|
|
// prop: '_names',
|
|
|
|
|
// width: 240,
|
|
|
|
|
// align: 'left',
|
|
|
|
|
// customFn:row=>{
|
|
|
|
|
// return(<div style={{"display": "flex","flex-wrap": "wrap"}}>
|
|
|
|
|
// {
|
|
|
|
|
// row._names?
|
|
|
|
|
// row._names.map(item=>{
|
|
|
|
|
// return(<div>
|
|
|
|
|
// {
|
|
|
|
|
// item.admin_details?
|
|
|
|
|
// // 组别
|
|
|
|
|
// <div style={{"display": "flex"}}><div>{item.name}:</div>
|
|
|
|
|
// <div style={{"display": "flex","flex-wrap": "wrap"}}>{
|
|
|
|
|
// item.admin_details.length>0?
|
|
|
|
|
// item.admin_details.map(detail=>{
|
|
|
|
|
// return(
|
|
|
|
|
// <el-tag style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
|
|
|
|
|
// )
|
|
|
|
|
// })
|
|
|
|
|
// :''
|
|
|
|
|
// }
|
|
|
|
|
// {
|
|
|
|
|
// item.dep_details.length>0?
|
|
|
|
|
// item.dep_details.map(detail=>{
|
|
|
|
|
// return(
|
|
|
|
|
// <el-tag style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
|
|
|
|
|
// )
|
|
|
|
|
// })
|
|
|
|
|
// :''
|
|
|
|
|
// }
|
|
|
|
|
// </div>
|
|
|
|
|
// </div>
|
|
|
|
|
// :
|
|
|
|
|
// // 其他
|
|
|
|
|
// <el-tag style={{'margin':'0 5px 5px 0'}}>{item.name}</el-tag>
|
|
|
|
|
// }
|
|
|
|
|
// </div>)
|
|
|
|
|
// }):''
|
|
|
|
|
// }</div>)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// label: "结束日期",
|
|
|
|
|
// prop: 'end_date',
|
|
|
|
|
// width: 120,
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
label: "任务数量",
|
|
|
|
|
prop: 'mission',
|
|
|
|
|
width: 120,
|
|
|
|
|
align:'left',
|
|
|
|
|
formatter:(cell,data,value,index)=>{
|
|
|
|
|
return value?(value.length===0?'--':value.length):'--'
|
|
|
|
|
}
|
|
|
|
|
list: [],
|
|
|
|
|
table: [{
|
|
|
|
|
label: "计划名称",
|
|
|
|
|
prop: 'name',
|
|
|
|
|
align:'left'
|
|
|
|
|
}, {
|
|
|
|
|
label: "任务要求及内容",
|
|
|
|
|
prop: 'content',
|
|
|
|
|
// width: 120,
|
|
|
|
|
align: 'left'
|
|
|
|
|
}, {
|
|
|
|
|
label: "审核人",
|
|
|
|
|
prop: 'admin.name',
|
|
|
|
|
label: "责任人",
|
|
|
|
|
prop: 'main_admin.name',
|
|
|
|
|
width: 120,
|
|
|
|
|
}],
|
|
|
|
|
list: [],
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
// 获取所有单元格合并数据
|
|
|
|
|
spanArr() {
|
|
|
|
|
for(var k in this.currentTableList){
|
|
|
|
|
if (!this.currentTableList.length) return []
|
|
|
|
|
const mergeCols = ['menu','level'] // 需要合并的列(字段)
|
|
|
|
|
const data = groupBy(this.currentTableList, 'id')
|
|
|
|
|
// console.log("data",data)
|
|
|
|
|
return getMergeCells(data, this.table, mergeCols)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// this.getUserId()
|
|
|
|
|
// this.getLeads()
|
|
|
|
|
created() {
|
|
|
|
|
// this.getUserId()
|
|
|
|
|
// this.getLeads()
|
|
|
|
|
this.stateObj = state.state
|
|
|
|
|
this.select.year = (new Date()).getFullYear() + ''
|
|
|
|
|
let currentMonth = this.allMonths[(new Date()).getMonth()]
|
|
|
|
|
console.log("this.stateObj",this.stateObj)
|
|
|
|
|
if(this.stateObj.is_guiji){
|
|
|
|
|
this.select.main_admin_id = 0
|
|
|
|
|
}
|
|
|
|
|
this.select.year = (new Date()).getFullYear() + ''
|
|
|
|
|
let currentMonth = this.allMonths[(new Date()).getMonth()]
|
|
|
|
|
this.selectMonth.push(currentMonth)
|
|
|
|
|
this.select.month = this.selectMonth.join(',')
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
spanMethod({
|
|
|
|
|
row,
|
|
|
|
|
colomn,
|
|
|
|
|
rowIndex,
|
|
|
|
|
columnIndex
|
|
|
|
|
}) {
|
|
|
|
|
return this.spanArr[rowIndex][columnIndex]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getList() {
|
|
|
|
|
const res = await listplan({
|
|
|
|
|
...this.select
|
|
|
|
|
})
|
|
|
|
|
// 处理参于人员选择
|
|
|
|
|
for(var r of res.data){
|
|
|
|
|
var _names = []
|
|
|
|
|
// 只有人员
|
|
|
|
|
if(r.accept_admin_ids&&r.accept_admin_ids.length>0){
|
|
|
|
|
r.accept_admin.map(item=>{
|
|
|
|
|
let hasDetail = item.detail?true:false
|
|
|
|
|
_names.push({
|
|
|
|
|
'name':item.name
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
r._names = _names
|
|
|
|
|
}
|
|
|
|
|
// 部门
|
|
|
|
|
if(r.accept_department_ids&&r.accept_department_ids.length>0){
|
|
|
|
|
r.accept_department.map(item=>{
|
|
|
|
|
let hasDetail = item.detail?true:false
|
|
|
|
|
_names.push({
|
|
|
|
|
'name':item.name,
|
|
|
|
|
'hasDetail':hasDetail
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
r._names = _names
|
|
|
|
|
}
|
|
|
|
|
// 组别
|
|
|
|
|
if(r.groups&&r.groups.length>0){
|
|
|
|
|
let ab = this.contactGroup(r.groups)
|
|
|
|
|
r._names = ab
|
|
|
|
|
// for(var g of r.groups){
|
|
|
|
|
// for(var de of g.details){
|
|
|
|
|
// if(g.type==1){
|
|
|
|
|
// let is_index = 0
|
|
|
|
|
// for(var a of r.grounp_admin_detail){
|
|
|
|
|
// if(de.name===a.admin?.name){
|
|
|
|
|
// if(a.detail){
|
|
|
|
|
// is_index++
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// de.hasDetail=is_index>0?true:false
|
|
|
|
|
// }
|
|
|
|
|
// if(g.type==2){
|
|
|
|
|
// let is_index = 0
|
|
|
|
|
// for(var dp of r.grounp_department_detail){
|
|
|
|
|
// if(de.name===dp.department.name){
|
|
|
|
|
// if(dp.detail){
|
|
|
|
|
// is_index++
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// de.hasDetail=is_index>0?true:false
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.list = res.data
|
|
|
|
|
// this.currentTableList = this.groupByMonth(this.list)
|
|
|
|
|
// let data = this.groupByMonth(this.list)
|
|
|
|
|
// let data3 = []
|
|
|
|
|
// let monthObj = this.sortByMonth()
|
|
|
|
|
// Object.entries(data).forEach(([key, value]) => {
|
|
|
|
|
// value.forEach((item,index) => {
|
|
|
|
|
// let item1 = this.deepCloneObject(item)
|
|
|
|
|
// item1.monthName = key;
|
|
|
|
|
// data3.push({
|
|
|
|
|
// rowindex:key+index,
|
|
|
|
|
// monthIndex:monthObj[key],
|
|
|
|
|
// ...item1
|
|
|
|
|
// })
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
this.currentTableList = this.filterBySelectedMonths(this.list,this.selectMonth)
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
},
|
|
|
|
|
handleCheckAllChange(val) {
|
|
|
|
|
this.selectMonth = val ? this.allMonths : [];
|
|
|
|
|
this.isIndeterminate = false;
|
|
|
|
|
let _arr = []
|
|
|
|
|
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
|
|
|
|
|
this.currentTableList = _arr
|
|
|
|
|
},
|
|
|
|
|
changeMonth(e){
|
|
|
|
|
let checkedCount = e.length;
|
|
|
|
|
this.checkAll = checkedCount === this.allMonths.length;
|
|
|
|
|
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allMonths.length;
|
|
|
|
|
},
|
|
|
|
|
handleCheckAllChange(val) {
|
|
|
|
|
this.selectMonth = val ? this.allMonths : [];
|
|
|
|
|
this.isIndeterminate = false;
|
|
|
|
|
let _arr = []
|
|
|
|
|
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
|
|
|
|
|
this.currentTableList = _arr
|
|
|
|
|
},
|
|
|
|
|
filterBySelectedMonths(arr, selectMonth) {
|
|
|
|
|
if (!selectMonth || selectMonth.length === 0) {
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ensure selectMonth is an array even if it's a single value
|
|
|
|
|
if (!Array.isArray(selectMonth)) {
|
|
|
|
|
selectMonth = [selectMonth];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return arr.filter(obj => {
|
|
|
|
|
// Check if there's at least one common month between obj.month and selectMonth
|
|
|
|
|
return obj.start_date.some(month => selectMonth.includes(month));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deepCloneObject(obj) {
|
|
|
|
|
let clone = {};
|
|
|
|
|
Object.keys(obj).forEach((key) => {
|
|
|
|
|
if (obj[key] instanceof Array) {
|
|
|
|
|
clone[key] = this.deepCloneArray(obj[key]);
|
|
|
|
|
} else if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
|
|
|
clone[key] = this.deepCloneObject(obj[key]);
|
|
|
|
|
} else {
|
|
|
|
|
clone[key] = obj[key];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return clone;
|
|
|
|
|
},
|
|
|
|
|
deepCloneArray(arr) {
|
|
|
|
|
let clone = [];
|
|
|
|
|
arr.forEach((item, index) => {
|
|
|
|
|
if (Array.isArray(item)) {
|
|
|
|
|
clone[index] = this.deepCloneArray(item);
|
|
|
|
|
} else if (typeof item === 'object' && item !== null) {
|
|
|
|
|
clone[index] = this.deepCloneObject(item);
|
|
|
|
|
} else {
|
|
|
|
|
clone[index] = item;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return clone;
|
|
|
|
|
},
|
|
|
|
|
groupByMonth(originalArray) {
|
|
|
|
|
const groupedArrays = {};
|
|
|
|
|
originalArray.forEach(obj => {
|
|
|
|
|
obj.start_date.forEach(month => {
|
|
|
|
|
if (!groupedArrays[month]) {
|
|
|
|
|
groupedArrays[month] = [];
|
|
|
|
|
}
|
|
|
|
|
groupedArrays[month].push(obj);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return groupedArrays;
|
|
|
|
|
},
|
|
|
|
|
sortByMonth(){
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const currentMonth = now.getMonth(); // 获取当前月份(0-11,其中0代表一月)
|
|
|
|
|
const allMonths = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
|
|
|
|
|
const decemberAndPrevious = allMonths.slice(currentMonth);
|
|
|
|
|
const monthArr = [...decemberAndPrevious, ...allMonths.slice(0, currentMonth)]
|
|
|
|
|
const monthObj = {}
|
|
|
|
|
monthArr.map((item,index)=>{
|
|
|
|
|
monthObj[item] = index
|
|
|
|
|
})
|
|
|
|
|
return monthObj
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
this.select.month = this.selectMonth.join(',')
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
changeMonth(e) {
|
|
|
|
|
let checkedCount = e.length;
|
|
|
|
|
this.checkAll = checkedCount === this.allMonths.length;
|
|
|
|
|
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allMonths.length;
|
|
|
|
|
this.select.month = this.selectMonth.join(',')
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
changeYear(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
this.select.year = e
|
|
|
|
|
},
|
|
|
|
|
selectionChange(e){
|
|
|
|
|
let arr = []
|
|
|
|
|
if(e.length>0){
|
|
|
|
|
for(var k of e){
|
|
|
|
|
arr.push(k.id)
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
arr = []
|
|
|
|
|
}
|
|
|
|
|
this.sectionList = arr
|
|
|
|
|
editUnit(row,type){
|
|
|
|
|
this.$refs.addUnit.type="add"
|
|
|
|
|
this.$refs.addUnit.setoutLineId(row.out_line_id)
|
|
|
|
|
this.$refs.addUnit.setMissionPlanId(row.id)
|
|
|
|
|
|
|
|
|
|
this.$refs.addUnit.setType(type)
|
|
|
|
|
this.$refs.addUnit.setNameContent(row.name,row.content)
|
|
|
|
|
this.$refs.addUnit.setMenuLevel(row.menu,row.level,row.menu_id,row.level_id)
|
|
|
|
|
this.$refs.addUnit.setMainId(row.main_department_id,row.main_admin_id)
|
|
|
|
|
this.$refs.addUnit.isShow = true
|
|
|
|
|
},
|
|
|
|
|
chooseEditorPlan(){
|
|
|
|
|
if(this.sectionList.length>0){
|
|
|
|
|
if(this.sectionList.length==1){
|
|
|
|
|
this.editorPlan(this.sectionList[0],'editor')
|
|
|
|
|
}else{
|
|
|
|
|
this.$Message.warning('每次只能编辑一条年度计划任务');
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.$Message.warning('请选择需要编辑的年度计划任务');
|
|
|
|
|
}
|
|
|
|
|
toUrlUnit(e){
|
|
|
|
|
this.$router.push('/task/list/unit_1')
|
|
|
|
|
},
|
|
|
|
|
editorPlan(id, type) {
|
|
|
|
|
if (type == 'add') {
|
|
|
|
|
@ -546,120 +167,71 @@
|
|
|
|
|
this.$refs.addPlan.type = type
|
|
|
|
|
this.$refs.addPlan.isShow = true
|
|
|
|
|
},
|
|
|
|
|
cellClicks(e){
|
|
|
|
|
this.$refs.showPlan.id = e.row.id
|
|
|
|
|
this.$refs.showPlan.isShow = true
|
|
|
|
|
|
|
|
|
|
cellClicks(e) {
|
|
|
|
|
this.$refs.showPlan.id = e.row.id
|
|
|
|
|
this.$refs.showPlan.isShow = true
|
|
|
|
|
},
|
|
|
|
|
showPlan(id) {
|
|
|
|
|
this.$refs.showPlan.id = id
|
|
|
|
|
this.$refs.showPlan.isShow = true
|
|
|
|
|
},
|
|
|
|
|
editUnit(row,type){
|
|
|
|
|
this.$refs.addUnit.plan_id = row.id
|
|
|
|
|
this.$refs.addUnit.setType(type)
|
|
|
|
|
this.$refs.addUnit.setNameContent(row.out_line_content,row.content)
|
|
|
|
|
this.$refs.addUnit.setMenuLevel(row.menu,row.level)
|
|
|
|
|
this.$refs.addUnit.isShow = true
|
|
|
|
|
},
|
|
|
|
|
deleteList(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
if (id) {
|
|
|
|
|
del(id).then(response => {
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
that.getList();
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
importPlan(){
|
|
|
|
|
this.$refs.imports.show()
|
|
|
|
|
},
|
|
|
|
|
contactGroup(arr) {
|
|
|
|
|
let tempArr = [],
|
|
|
|
|
newArr = []
|
|
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
|
|
if (tempArr.indexOf(arr[i].name) === -1) {
|
|
|
|
|
if(arr[i].type===1){
|
|
|
|
|
newArr.push({
|
|
|
|
|
type: arr[i].type,
|
|
|
|
|
name: arr[i]['name'],
|
|
|
|
|
admin_details: arr[i].details,
|
|
|
|
|
dep_details: []
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
newArr.push({
|
|
|
|
|
type: arr[i].type,
|
|
|
|
|
name: arr[i]['name'],
|
|
|
|
|
admin_details:[],
|
|
|
|
|
dep_details: arr[i].details
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tempArr.push(arr[i].name);
|
|
|
|
|
} else {
|
|
|
|
|
for (let j = 0; j < newArr.length; j++) {
|
|
|
|
|
if (newArr[j].name == arr[i].name) {
|
|
|
|
|
if(arr[i].type===1){
|
|
|
|
|
newArr[j].admin_details.push(...arr[i].details)
|
|
|
|
|
}else{
|
|
|
|
|
newArr[j].dep_details.push(
|
|
|
|
|
...arr[i].details
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return newArr
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.tablewrap{
|
|
|
|
|
display:flex;
|
|
|
|
|
}
|
|
|
|
|
.tablemonth{
|
|
|
|
|
width:10%;
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
margin-right:1%;
|
|
|
|
|
}
|
|
|
|
|
.tablecontent{
|
|
|
|
|
width:89%
|
|
|
|
|
}
|
|
|
|
|
/deep/ .v-table .el-table__body .monthName{
|
|
|
|
|
vertical-align: top!important;
|
|
|
|
|
<style scoped>
|
|
|
|
|
.tablewrap {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tablemonth {
|
|
|
|
|
width: 10%;
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
margin-right: 1%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tablecontent {
|
|
|
|
|
width: 89%
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/ .v-table .el-table__body .monthName {
|
|
|
|
|
vertical-align: top !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/ .el-icon-circle-close {
|
|
|
|
|
color: #fff
|
|
|
|
|
}
|
|
|
|
|
.expandrow{
|
|
|
|
|
display: flex;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
padding-left:50px;
|
|
|
|
|
padding-bottom: 9px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
.expandrow p{
|
|
|
|
|
margin-right:20px;
|
|
|
|
|
}
|
|
|
|
|
.expandrow p span:first-child{
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-table .cell.el-tooltip {
|
|
|
|
|
white-space: normal !important;
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-collapse-item__header{
|
|
|
|
|
padding-left: 30px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
|
|
|
|
.expandrow {
|
|
|
|
|
display: flex;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
padding-left: 50px;
|
|
|
|
|
padding-bottom: 9px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expandrow p {
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expandrow p span:first-child {
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-table .cell.el-tooltip {
|
|
|
|
|
white-space: normal !important;
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-collapse-item__header {
|
|
|
|
|
padding-left: 30px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* /deep/ .el-table__body tr.el-table__row--striped td {
|
|
|
|
|
background-color: #C0C4CC!important;
|
|
|
|
|
} */
|
|
|
|
|
|