|
|
|
|
@ -32,55 +32,68 @@
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
<xy-table
|
|
|
|
|
:list="list"
|
|
|
|
|
:total="total"
|
|
|
|
|
stripe
|
|
|
|
|
:span-method="spanMethod"
|
|
|
|
|
:showIndex='false'
|
|
|
|
|
:isPage="false"
|
|
|
|
|
@cell-dblclick='cellClicks'
|
|
|
|
|
@selection-change='selectionChange'
|
|
|
|
|
@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="100" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template v-if="path_type!=5">
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="checkUnits(scope.row.id,'show')">查看</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="editorUnit(scope.row.id,'editor')">编辑</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button v-if="scope.row.audit_admin_id==stateObj.login_id&&scope.row.audit_status==0" style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')">审核</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div v-for="item in unitTypeList">
|
|
|
|
|
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openMyMission(item.value,scope.row)">{{item.remark}}</Button>
|
|
|
|
|
<!-- <Button v-if="scope.row.unit_type==item.id" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openAsks(scope.row)">开始答题</Button>
|
|
|
|
|
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'">开展任务</Button>
|
|
|
|
|
-->
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="editorUnit(scope.row.id,'editor')">分发</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tablecontent">
|
|
|
|
|
<xy-table
|
|
|
|
|
:list="currentTableList"
|
|
|
|
|
:total="total"
|
|
|
|
|
stripe
|
|
|
|
|
:span-method="spanMethod"
|
|
|
|
|
:showIndex='false'
|
|
|
|
|
:isPage="false"
|
|
|
|
|
@cell-dblclick='cellClicks'
|
|
|
|
|
@selection-change='selectionChange'
|
|
|
|
|
@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' fixed="right" label="操作" width="100" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template v-if="path_type!=5">
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="checkUnits(scope.row.id,'show')">查看</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="editorUnit(scope.row.id,'editor')">编辑</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button v-if="scope.row.audit_admin_id==stateObj.login_id&&scope.row.audit_status==0" style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')">审核</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div v-for="item in unitTypeList">
|
|
|
|
|
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openMyMission(item.value,scope.row)">{{item.remark}}</Button>
|
|
|
|
|
<!-- <Button v-if="scope.row.unit_type==item.id" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openAsks(scope.row)">开始答题</Button>
|
|
|
|
|
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'">开展任务</Button>
|
|
|
|
|
-->
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- <Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="editorUnit(scope.row.id,'editor')">分发</Button> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small" @click="checkUnits(scope.row.id,'show')">查看</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<div>
|
|
|
|
|
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small" @click="checkUnits(scope.row.id,'show')">查看</Button>
|
|
|
|
|
<Button style='margin-right:5px;margin-bottom:5px;' size="small" @click="backPlan(scope.row)">归档</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<div>
|
|
|
|
|
<Button style='margin-right:5px;margin-bottom:5px;' size="small" @click="backPlan(scope.row)">归档</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="提示"
|
|
|
|
|
@ -227,16 +240,21 @@
|
|
|
|
|
unitTypeList: [],
|
|
|
|
|
askList:[],
|
|
|
|
|
list: [],
|
|
|
|
|
sectionList:[],
|
|
|
|
|
table: [{
|
|
|
|
|
label: "月份",
|
|
|
|
|
prop: 'monthName',
|
|
|
|
|
// fixed:'left',
|
|
|
|
|
},{
|
|
|
|
|
|
|
|
|
|
sectionList:[],
|
|
|
|
|
currentTableList:[],
|
|
|
|
|
isIndeterminate:true,
|
|
|
|
|
checkAll:false,
|
|
|
|
|
selectMonth:[],
|
|
|
|
|
allMonths : ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
|
|
|
|
|
|
|
|
|
table: [{
|
|
|
|
|
label: "任务名称",
|
|
|
|
|
prop: 'name',
|
|
|
|
|
// fixed:'left',
|
|
|
|
|
align:'left',
|
|
|
|
|
align:'left',
|
|
|
|
|
width:300,
|
|
|
|
|
fixed:'left'
|
|
|
|
|
}, {
|
|
|
|
|
label: "状态",
|
|
|
|
|
prop: 'audit_status',
|
|
|
|
|
@ -338,10 +356,10 @@
|
|
|
|
|
computed: {
|
|
|
|
|
// 获取所有单元格合并数据
|
|
|
|
|
spanArr() {
|
|
|
|
|
for(var k in this.list){
|
|
|
|
|
if (!this.list.length) return []
|
|
|
|
|
for(var k in this.currentTableList){
|
|
|
|
|
if (!this.currentTableList.length) return []
|
|
|
|
|
const mergeCols = ['monthName'] // 需要合并的列(字段)
|
|
|
|
|
const data = this.groupBy(this.list, 'monthIndex')
|
|
|
|
|
const data = this.groupBy(this.currentTableList, 'monthIndex')
|
|
|
|
|
console.log("data",data)
|
|
|
|
|
return getMergeCells(data, this.table, mergeCols)
|
|
|
|
|
}
|
|
|
|
|
@ -350,7 +368,8 @@
|
|
|
|
|
created() {
|
|
|
|
|
this.getLeads()
|
|
|
|
|
this.stateObj = state.state
|
|
|
|
|
console.log("state111",this.stateObj)
|
|
|
|
|
let currentMonth = this.allMonths[(new Date()).getMonth()]
|
|
|
|
|
// this.selectMonth.push(currentMonth)
|
|
|
|
|
if (this.$route.path) {
|
|
|
|
|
let path = this.$route.path.split("_")
|
|
|
|
|
this.select.type = path[1]
|
|
|
|
|
@ -360,11 +379,13 @@
|
|
|
|
|
this.select.myself = 1
|
|
|
|
|
this.type_name = '我的任务'
|
|
|
|
|
this.path_type = path[1]
|
|
|
|
|
this.selectMonth.push(currentMonth)
|
|
|
|
|
}
|
|
|
|
|
if(path[1]==4){
|
|
|
|
|
this.select.type = 4
|
|
|
|
|
this.type_name = '专项专题任务'
|
|
|
|
|
this.path_type = path[1]
|
|
|
|
|
this.selectMonth = this.allMonths
|
|
|
|
|
// this.table.unshift({
|
|
|
|
|
// type:'selection',
|
|
|
|
|
// selectable:(row,index)=>{
|
|
|
|
|
@ -387,8 +408,7 @@
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.getUnitTypeList()
|
|
|
|
|
|
|
|
|
|
this.getUnitTypeList()
|
|
|
|
|
this.getList()
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
@ -530,12 +550,13 @@
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getList() {
|
|
|
|
|
let res = await listunit({
|
|
|
|
|
...this.select
|
|
|
|
|
})
|
|
|
|
|
const allMonths = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
|
|
|
|
|
const allMonths = this.allMonths
|
|
|
|
|
let monthObj = this.sortByMonth()
|
|
|
|
|
|
|
|
|
|
// 判断小组中是否有人提交了检查
|
|
|
|
|
@ -631,10 +652,43 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.currentTableList = this.filterBySelectedMonths(this.list,this.selectMonth)
|
|
|
|
|
console.log("this.currentTableList",this.currentTableList)
|
|
|
|
|
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;
|
|
|
|
|
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));
|
|
|
|
|
return selectMonth.some(selected => obj.monthName.includes(selected));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
sortByMonth(){
|
|
|
|
|
const now = new Date();
|
|
|
|
|
@ -654,6 +708,18 @@
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.tablewrap{
|
|
|
|
|
display:flex;
|
|
|
|
|
}
|
|
|
|
|
.tablemonth{
|
|
|
|
|
width:10%;
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
margin-right:1%
|
|
|
|
|
}
|
|
|
|
|
.tablecontent{
|
|
|
|
|
width:89%
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-table .cell.el-tooltip {
|
|
|
|
|
white-space: normal !important;
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|