master
lion 2 years ago
parent d8e9014934
commit 2bb2afba26

@ -181,6 +181,23 @@
</div>
</div>
</el-col>
<el-col :span="24">
<div ref="lxTable" stripe class="table-tree">
<div style="padding: 15px;background-color: #fff;padding-bottom:5px;" class="form-sub-title">
<el-link icon='el-icon-user-solid' type="primary" style="font-size:18px">科室任务统计</el-link>
</div>
<div style="height:450px;background-color: #fff;padding: 15px;padding-top:0">
<div style="height:450px">
<xy-table :list="depList" :showIndex="false" stripe :isPage="false" :height="'423px'" :table-item="depTable">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</div>
</div>
</el-col>
</el-row>
<showPlan ref='showPlan'></showPlan>
@ -429,7 +446,48 @@ export default {
}
},
],
depList:[],
depTable:[{
prop:'dep',
label:'月份/科室',
},{
prop:'yiyue',
label:'一月',
},{
prop:'eryue',
label:'二月',
},{
prop:'sanyue',
label:'三月',
},{
prop:'siyue',
label:'四月',
},{
prop:'wuyue',
label:'五月',
},{
prop:'liuyue',
label:'六月',
},{
prop:'qiyue',
label:'七月',
},{
prop:'bayue',
label:'八月',
},{
prop:'jiuyue',
label:'九月',
},{
prop:'shiyue',
label:'十月',
},{
prop:'shiyiyue',
label:'十一月',
},{
prop:'shieryue',
label:'十二月',
}],
icon1: require('@/assets/index/icon1.png'),
icon2: require('@/assets/index/icon2.png'),
icon3: require('@/assets/index/icon3.png'),
@ -817,6 +875,10 @@ export default {
let x_dep = []
for(var d of res.department){
x_dep.push(d.name)
this.depList.push({
dep:d.name,
// yiyue:(d.mission.total+d.mission_plan.total) +'/' + (d.mission.no_end+d.mission_plan.no_end)
})
all_dep.push({
value:d.mission.total+d.mission_plan.total,
plan:d.mission_plan.total,

@ -2,6 +2,26 @@
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '发起任务' : '编辑任务'" :form="form"
:rules='rules' @submit="submit">
<template v-slot:menu>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>工作项目
</div>
<div class="xy-table-item-content">
<el-input v-model="form.menu" placeholder="请输入工作项目" clearable style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:level>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>性质级别
</div>
<div class="xy-table-item-content">
<el-input v-model="form.level" placeholder="请输入性质级别" clearable style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:unit_type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -74,7 +94,7 @@
</div>
</div> -->
</template>
<template v-slot:mission_plan_id v-if="hasPlanId">
<!-- <template v-slot:mission_plan_id v-if="hasPlanId">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>关联计划
@ -86,7 +106,7 @@
</el-select>
</div>
</div>
</template>
</template> -->
<!-- <template v-slot:audit_status>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -469,12 +489,13 @@ import elSelectTree from '@/components/selectTree'
leads_list:{},
form: {
type: 4,
menu:'',
level:'',
unit_type:'',
start_date: '',
name: '',
end_date: '',
mission_level:0,
mission_plan_id:'',
lefts:'',
name7: 2,
audit_status:4,
@ -496,7 +517,10 @@ import elSelectTree from '@/components/selectTree'
accept_admin_ids: [],
accept_department_ids: [],
mission_groups: [],
mission_level:0,
mission_plan_id:'',
out_line_id:'',
},
mission_groups_list: [{
name: '',
@ -560,6 +584,16 @@ import elSelectTree from '@/components/selectTree'
this.form.name = name?name:''
this.form.content = content?content:''
},
setMenuLevel(menu,level){
this.form.menu = menu?menu:''
this.form.level = level?level:''
},
setType(type){
this.form.type = type?type:4
},
setoutLineId(id){
this.form.out_line_id = id?id:''
},
async getLeads(){
// const res = await leads()
this.leads_list = state.state.leads_list.departmen
@ -731,13 +765,13 @@ import elSelectTree from '@/components/selectTree'
const res = await get(this.id)
this.form = {
type: res?.type,
menu:res?.menu,
level:res?.level,
unit_type: res?.unit_type,
start_date: res?.start_date,
name: res?.name,
end_date: res?.end_date,
mission_level:0,
mission_plan_id:res?.mission_plan_id,
lefts:'',
@ -765,7 +799,10 @@ import elSelectTree from '@/components/selectTree'
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
mission_groups: res?.groups,
mission_groups: res?.groups,
mission_level:0,
mission_plan_id:res?.mission_plan_id,
out_line_id:res?.out_line_id
}
this.userdatabefore.map(item=>{
res.accept_admin_ids.map(item1=>{
@ -826,7 +863,7 @@ import elSelectTree from '@/components/selectTree'
this.$refs.dialog.submit()
},
submit() {
console.log("this.form.type",this.pictureList)
console.log("this.form",this.form)
// return
let _files = []
@ -972,12 +1009,12 @@ import elSelectTree from '@/components/selectTree'
if(newVal){
this.form.mission_plan_id = newVal
this.hasPlanId = true
this.form.type=1
// this.form.type=1
this.form.mission_level = 0
}else{
this.form.mission_plan_id = ''
this.hasPlanId = true
this.form.type=4
// this.form.type=4
}
}
},

@ -124,8 +124,8 @@
</template>
<template v-slot:missionlist>
<el-divider>任务情况</el-divider>
<Button :disabled="hasLocked" type="primary" style='margin-right:5px;margin-bottom:5px;'
@click="editorUnit('add')">发布任务</Button>
<!-- <Button :disabled="hasLocked" type="primary" style='margin-right:5px;margin-bottom:5px;'
@click="editorUnit('add')">发布任务</Button> -->
<xy-table
:list="mission_log"
stripe
@ -285,7 +285,15 @@
// fixed:'left',
width:200,
align:'left',
}, {
},{
label: "任务级别",
prop: 'type',
// fixed:'left',
width:200,
formatter: (cell, data, value, index) => {
return value===4?'专项专题任务':'年度计划任务'
}
}, {
label: "状态",
prop: 'audit_status',
width: 80,
@ -373,13 +381,14 @@
this.stateObj = state.state
},
methods: {
editorUnit(type, plan_id) {
editorUnit(type, unit_id) {
this.$refs.addUnit.type = type
if(type==='editor'){
this.$refs.addUnit.id=plan_id
this.$refs.addUnit.id=unit_id
}else{
this.$refs.addUnit.plan_id = this.id
this.$refs.addUnit.setNameContent(this.showform.level,this.showform.content)
this.$refs.addUnit.setNameContent(this.showform.out_line_content,this.showform.content)
this.$refs.addUnit.setMenuLevel(this.showform.menu,this.showform.level)
}
this.$refs.addUnit.isShow = true

@ -18,15 +18,23 @@
<xy-table :list="mission_log" :table-item="missionLogTable" :showIndex='false' :isPage='false'
:span-method="spanMethod">
<template v-slot:btns>
<el-table-column align='center' label="操作" fixed="right" width="100" header-align="center">
<el-table-column align='center' label="操作" fixed="right" width="200" header-align="center">
<template slot-scope="scope">
<div>
<!-- <div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editorPlan(scope.row,'add')">计划</Button>
@click="editorPlan(scope.row,'add')">添加年度计划大纲</Button>
</div> -->
<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="editUnit(scope.row,4)">添加专项专题任务</Button>
</div>
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editorOutline(scope.row.id,'editor')">编辑</Button>
@click="editorOutline(scope.row.id,'editor')">编辑大纲</Button>
</div>
<!-- <div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@ -34,7 +42,7 @@
</div> -->
<div>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteList(scope.row.id)">
<Button type="primary" style="margin-right:5px;margin-bottom:5px;" size="small">删除</Button>
<Button type="primary" style="margin-right:5px;margin-bottom:5px;" size="small">删除大纲</Button>
</Poptip>
</div>
@ -43,7 +51,9 @@
</template>
</xy-table>
<addOutline ref="addOutline" @refresh="getList"></addOutline>
<addPlan ref="addPlan" @refresh="getList"></addPlan>
<addPlan ref="addPlan" @refresh="getList"></addPlan>
<addUnit ref="addUnit" @refresh="getList"></addUnit>
</div>
</template>
@ -60,11 +70,13 @@
groupBy
} from '@/utils/contactTable.js'
import addOutline from '../list/components/addOutline.vue'
import addPlan from '../list/components/addPlan.vue'
import addPlan from '../list/components/addPlan.vue'
import addUnit from '../list/components/addUnit.vue'
export default {
components: {
addOutline,
addPlan
addPlan,
addUnit
},
data() {
return {
@ -217,7 +229,14 @@
this.$refs.addPlan.setMenuLevel(row.menu,row.level,row.id,row.content,row.flow)
this.$refs.addPlan.type = type
this.$refs.addPlan.isShow = true
}
},
editUnit(row,type){
this.$refs.addUnit.setoutLineId(row.id)
this.$refs.addUnit.setType(type)
this.$refs.addUnit.setNameContent(row.content,row.flow)
this.$refs.addUnit.setMenuLevel(row.menu,row.level)
this.$refs.addUnit.isShow = true
},
},
watch: {}

@ -790,6 +790,15 @@
}
.tablecontent{
width:89%
}
/deep/ .tablemonth .el-checkbox{
width:100%;
}
/deep/ .tablemonth .el-checkbox__input{
vertical-align: top!important;
}
/deep/ .tablemonth .el-checkbox__label {
text-wrap:wrap;
}
/deep/ .v-table .el-table__body .missionName{
vertical-align: top!important;

@ -17,7 +17,7 @@
</Select> -->
<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="editorPlan('','add')"></Button> -->
<!-- <Button type="primary" style='margin-left: 10px;'
@click="chooseEditorPlan()">编辑</Button> -->
<!-- <Button type="primary" style='margin-left: 10px;'
@ -50,15 +50,23 @@
:defaultExpandAll="false"
:isPage='false'>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="100" header-align="center">
<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="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>
@click="editorPlan(scope.row.id,'editor')">编辑年度计划</Button>
</div>
</template>
</el-table-column>
@ -416,7 +424,6 @@
// });
// });
this.currentTableList = this.filterBySelectedMonths(this.list,this.selectMonth)
console.log("this.currentTableList",this.currentTableList)
this.total = res.total
},
@ -546,6 +553,13 @@
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;

@ -0,0 +1,765 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" :text="type_name" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<el-select class='height32' style="width: 150px;margin-right: 10px;" filterable clearable v-model="select.unit_type" placeholder="任务类型">
<el-option
v-for="item in unitTypeList"
:key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
<el-select class='height32' style="width: 150px;margin-right: 10px;" filterable clearable v-model="select.audit_status" placeholder="任务状态">
<el-option
v-for="item in selectAuditStatusList"
:key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
<el-date-picker @change="changeDate" v-model="select.dateRange" type="daterange"
:picker-options="pickerOptions" value-format="yyyy-MM-dd" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right">
</el-date-picker>
<Input v-model="select.keyword" style="width: 150px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList" style="margin-right: 10px;">查询</Button>
<!-- <Button v-if="path_type!=5" type="primary" style="margin-right: 10px;"
@click="editorUnit('','add')">添加</Button> -->
<!-- <Button type="primary" v-if="path_type!=5" style='margin-right:10px' @click="chooseEditorUnit()"></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">
<div>{{selectMonth.join('、')}}共有{{currentTableList.length}}项任务{{auditStatus2.length}}项未完成</div>
<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;' size="small" @click="backPlan(scope.row)"></Button>
</div>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%">
<span>请确认是否将该任务归档到<span style="color:red">安全生产标准化台账管理</span></span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
<addUnit ref='addUnit' @refresh='getList'></addUnit>
<showPatrol ref='showPatrol'></showPatrol>
<addPatrol ref='addPatrol' @refresh='getList'></addPatrol>
<checkUnit ref='checkUnit' @refresh='getList'></checkUnit>
<answerQuestion @refresh='getList' ref='answerQuestion'></answerQuestion>
</div>
</template>
<script>
import addUnit from '../list/components/addUnit.vue'
import showPatrol from '../list/components/showPatrol.vue'
import addPatrol from '../list/components/addPatrol.vue'
import checkUnit from '../list/components/checkUnit.vue'
import answerQuestion from '../list/components/answerQuestion.vue'
import {
listunit,
del
} from '@/api/task/unit.js'
import {
getparameteritem
} from "@/api/system/dictionary.js";
import state from '@/store/modules/user.js'
import {contactGroup} from './js/index.js'
import {
getMergeCells,
groupBy
} from '@/utils/contactTable.js'
export default {
components: {
addUnit,
showPatrol,
addPatrol,
checkUnit,
answerQuestion
},
data() {
return {
type_name: '',
path_type:4,
dialogVisible:false,
stateObj:{},
typeName: [{
type: 1,
name: '年度计划任务'
},{
type: 4,
name: '专项专题任务'
}, {
type: 5,
name: '我的任务'
}],
select: {
keyword: '',
page: 1,
page_size: 9999,
myself: 0,
myself_department: 0,
type: 1,
unit_type: '',
audit_status:'',
dueDate:[],
start_date:'',
end_date:'',
sort_name:'start_date',
sort_type:'DESC'
},
total: 0,
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
selectAuditStatusList:[{
id:4,
value:'待开展',
type:'info'
},{
id:1,
value:'开展中',
type:''
},{
id:2,
value:'未完成',
type:'danger'
},{
id:3,
value:'已完成',
type:'success'
}],
auditStatusList:[{
id:4,
value:'待开展',
type:'info'
},{
id:1,
value:'开展中',
type:''
},{
id:2,
value:'未完成',
type:'danger'
},{
id:3,
value:'已完成',
type:'success'
}],
unitTypeList: [],
askList:[],
list: [],
sectionList:[],
currentTableList:[],
auditStatus2:[],
isIndeterminate:true,
checkAll:false,
selectMonth:[],
allMonths : ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
table: [{
label: "工作项目",
prop: 'menu',
// fixed:'left',
align:'center',
width:180,
fixed:'left'
},{
label: "性质级别",
prop: 'level',
// fixed:'left',
align:'left',
width:180,
fixed:'left'
},{
label: "任务名称",
prop: 'name',
// fixed:'left',
align:'left',
width:300,
},{
label: "任务说明",
prop: 'content',
width: 200,
align:'center',
},{
label: "开始日期",
prop: 'start_date',
width: 120,
align:'center'
}, {
label: "结束日期",
prop: 'end_date',
width: 120,
align:'center'
},
{
label: "状态",
prop: 'audit_status',
width: 120,
align:'center',
customFn:(row)=>{
return(<div>
{
this.auditStatusList.map(item=>{
if(item.id==row.audit_status){
return(<el-tag type={item.type}>{item.value}</el-tag>)
}
})
}
</div>)
}
},
// {
// label: "",
// prop: 'unit_type_detail.value',
// width: 120,
// align:'center',
// }
{
label: "参与对象",
prop: '_names',
width: 360,
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 type={detail.hasDetail?'':'info'} style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
)
})
:''
}
{
item.dep_details.length>0?
item.dep_details.map(detail=>{
return(
<el-tag type={detail.hasDetail?'':'info'} style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
)
})
:''
}
</div>
</div>
:
//
<el-tag type={item.hasDetail?'':'info'} style={{'margin':'0 5px 5px 0'}}>{item.name}</el-tag>
}
</div>)
}):''
}</div>)
}
},{
label: "创建人",
prop: 'admin.name',
width: 120,
align: 'center',
},{
label: "创建时间",
prop: 'created_at',
width: 120,
align: 'center',
formatter: (cell, data, value, index) => {
return value?value.substring(0,11):''
}
}],
}
},
computed: {
//
spanArr() {
for(var k in this.currentTableList){
if (!this.currentTableList.length) return []
const mergeCols = ['menu','level'] //
const data = this.groupBy(this.currentTableList, 'menu')
return getMergeCells(data, this.table, mergeCols)
}
}
},
created() {
this.getLeads()
this.stateObj = state.state
let currentMonth = this.allMonths[(new Date()).getMonth()]
// this.selectMonth = this.allMonths
this.selectMonth.push(currentMonth)
this.path_type = 1
this.getUnitTypeList()
this.getList()
},
watch: {},
methods: {
async getLeads(){
// await this.$store.dispatch("user/getLeads")
},
backPlan(row){
this.dialogVisible = true
},
async getUnitTypeList(){
const res = await getparameteritem('unitTypeList')
this.unitTypeList = res.detail
},
//
openMyMission(remark,e){
switch(remark){
case '检查':
this.addPatrol(e)
break;
case '学习':
this.openStudy(e)
break;
case '答题':
this.openAnswers(e)
break;
case '培训':
this.openTrain(e)
break;
case '资料收集':
this.openUploads(e)
break;
}
},
addPatrol(scope){
this.$refs['addPatrol'].login_id=this.stateObj.login_id
this.$refs['addPatrol'].department_id = this.stateObj.department_id
this.$refs['addPatrol'].mission_id=scope.id
this.$refs['addPatrol'].isShow=true
this.$refs['addPatrol'].type='add'
},
openAnswers(scope){
this.$refs['answerQuestion'].mission_id=scope.id
this.$refs['answerQuestion'].askList = scope.ask
this.$refs['answerQuestion'].isShow=true
},
showPatrol(id, type) {
this.$refs.showPatrol.id = id
this.$refs.showPatrol.type = type
this.$refs.showPatrol.isShow = true
},
openTrain(e){
this.$refs.checkUnit.id = e.id
this.$refs.checkUnit.type = 'train'
this.$refs.checkUnit.isShow = true
},
openUploads(e){
this.$refs.checkUnit.id = e.id
this.$refs.checkUnit.type = 'uploads'
this.$refs.checkUnit.isShow = true
},
openStudy(e){
this.$refs.checkUnit.id = e.id
this.$refs.checkUnit.type = 'study'
this.$refs.checkUnit.isShow = true
},
//
selectionChange(e){
let arr = []
if(e.length>0){
for(var k of e){
arr.push(k.id)
}
}else{
arr = []
}
this.sectionList = arr
},
chooseEditorUnit(){
if(this.sectionList.length>0){
if(this.sectionList.length==1){
this.editorUnit(this.sectionList[0],'editor')
}else{
this.$Message.warning('每次只能编辑一条任务');
}
}else{
this.$Message.warning('请选择需要编辑的任务');
}
},
editorUnit(id, type) {
if(id){
this.$refs.addUnit.id = id
}
this.$refs.addUnit.type = type
this.$refs.addUnit.unitTypeList = this.unitTypeList
this.$refs.addUnit.department_id = this.stateObj.department_id
this.$refs.addUnit.isShow = true
},
//
cellClicks(e){
this.$refs.checkUnit.id = e.row.id
this.$refs.checkUnit.type = 'show'
this.$refs.checkUnit.isShow = true
},
checkUnits(id,type){
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.isShow = true
},
changeDate(e){
if(e){
this.select.start_date = e[0];
this.select.end_date = e[1];
}else{
this.select.start_date = "";
this.select.end_date = "";
}
},
spanMethod({
row,
colomn,
rowIndex,
columnIndex
}) {
return this.spanArr[rowIndex][columnIndex]
},
groupBy(arr, prop) {
return arr.sort((a, b) => {
if (a[prop] < b[prop]) {
return 1;
}
if (a[prop] > b[prop]) {
return -1;
}
return 0;
});
},
async getList() {
let res = await listunit({
...this.select
})
const allMonths = this.allMonths
let monthObj = this.sortByMonth()
//
//
for(var r of res.data){
if(r.start_date){
let dateArr = r.start_date.split("-")
r.monthName = allMonths[parseInt(dateArr[1])-1]
let _index = monthObj[r.monthName]<10?"0"+monthObj[r.monthName]:monthObj[r.monthName]
r.monthIndex = parseInt(dateArr[0])+""+_index
}
var _names = []
//
if(r.accept_admin_ids&&r.accept_admin_ids.length>0){
r.accept_admin_detail.map(item=>{
let hasDetail = item.detail?true:false
_names.push({
'name':item.admin?.name,
'hasDetail':hasDetail
})
})
r._names = _names
}
//
if(r.accept_department_ids&&r.accept_department_ids.length>0){
r.accept_department_detail.map(item=>{
let hasDetail = item.detail?true:false
_names.push({
'name':item.department?.name,
'hasDetail':hasDetail
})
})
r._names = _names
}
//
if(r.groups&&r.groups.length>0){
let ab = contactGroup(r.groups)
// ab.map(item=>{
// item.admin_details.map(a=>{
// r.grounp_admin_detail.map(g=>{
// if(a.name===g.admin.name){
// a.hasDetail = g.detail?true:false
// }
// })
// })
// item.dep_details.map(a=>{
// r.grounp_department_detail.map(g=>{
// if(a.name===g.department.name){
// a.hasDetail = g.detail?true:false
// }
// })
// })
// })
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
// }
// }
// }
// // groups
// r.groups.map((item,index)=>{
// _names.push({
// group_name:item.name,
// details:item.details
// })
// })
// r._names = _names
}
}
this.list = res.data
let _arr = []
let _arr2 = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
_arr2 = _arr.filter(item=>item.audit_status===2)
this.auditStatus2= _arr2
this.total = res.total
},
handleCheckAllChange(val) {
this.selectMonth = val ? this.allMonths : [];
this.isIndeterminate = false;
let _arr = []
let _arr2 = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
_arr2 = _arr.filter(item=>item.audit_status===2)
this.auditStatus2= _arr2
},
changeMonth(e){
let checkedCount = e.length;
this.checkAll = checkedCount === this.allMonths.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allMonths.length;
let _arr = []
let _arr2 = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
_arr2 = _arr.filter(item=>item.audit_status===2)
this.auditStatus2= _arr2
},
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();
const currentMonth = now.getMonth(); // 0-110
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
},
},
}
</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;
}
/deep/ .el-icon-circle-close {
color: #fff
}
.expenditem {
display: flex;
font-size: 14px;
padding: 10px;
border-bottom: 1px solid #EBEEF5;
padding-left: 110px;
font-size: 16px;
}
.expenditem>div {
margin-right: 15px;
min-width: 200px;
}
.expenditem>div span.label {
color: #97a8be
}
/deep/ .el-table__expanded-cell .expenditem:last-child {
border-bottom: none;
}
/deep/ .ivu-page {
text-align: right;
padding: 15px;
}
/deep/ .el-range-editor.el-input__inner{
height: 32px;
line-height: 32px;
width: 250px;
margin-right:10px;
}
/deep/ .el-date-editor .el-range__icon,/deep/ .el-date-editor .el-range-separator,/deep/ .el-date-editor .el-range__close-icon{
line-height: 25px;
}
/deep/ .height32 .el-input__inner{
height:32px;
}
/deep/ .height32 .el-select__caret.el-input__icon.el-icon-arrow-up{
line-height: 32px;
}
/deep/ .height32 .el-select__caret.el-input__icon.el-icon-circle-close{
line-height: 32px;
}
</style>

@ -23,8 +23,8 @@
<Input v-model="select.keyword" style="width: 150px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList" style="margin-right: 10px;">查询</Button>
<Button v-if="path_type!=5" type="primary" style="margin-right: 10px;"
@click="editorUnit('','add')">添加</Button>
<!-- <Button v-if="path_type!=5" type="primary" style="margin-right: 10px;"
@click="editorUnit('','add')">添加</Button> -->
<!-- <Button type="primary" v-if="path_type!=5" style='margin-right:10px' @click="chooseEditorUnit()"></Button> -->
</div>
@ -42,6 +42,7 @@
</div>
<div class="tablecontent">
<div>{{selectMonth.join('、')}}共有{{currentTableList.length}}项任务{{auditStatus2.length}}项未完成</div>
<xy-table
:list="currentTableList"
:total="total"
@ -243,18 +244,29 @@
sectionList:[],
currentTableList:[],
auditStatus2:[],
isIndeterminate:true,
checkAll:false,
selectMonth:[],
allMonths : ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
table: [{
label: "工作项目",
prop: 'menu',
// fixed:'left',
width:120,
align:'left',
},{
label: "性质级别",
prop: 'level',
// fixed:'left',
width:120,
align:'left',
},{
label: "任务名称",
prop: 'name',
// fixed:'left',
align:'left',
width:300,
fixed:'left'
align:'left',
}, {
label: "状态",
prop: 'audit_status',
@ -358,9 +370,8 @@
spanArr() {
for(var k in this.currentTableList){
if (!this.currentTableList.length) return []
const mergeCols = ['monthName'] //
const data = this.groupBy(this.currentTableList, 'monthIndex')
console.log("data",data)
const mergeCols = ['menu','level'] //
const data = this.groupBy(this.currentTableList, 'menu')
return getMergeCells(data, this.table, mergeCols)
}
}
@ -385,7 +396,8 @@
this.select.type = 4
this.type_name = '专项专题任务'
this.path_type = path[1]
this.selectMonth = this.allMonths
// this.selectMonth = this.allMonths
this.selectMonth.push(currentMonth)
// this.table.unshift({
// type:'selection',
// selectable:(row,index)=>{
@ -567,7 +579,6 @@
r.monthName = allMonths[parseInt(dateArr[1])-1]
let _index = monthObj[r.monthName]<10?"0"+monthObj[r.monthName]:monthObj[r.monthName]
r.monthIndex = parseInt(dateArr[0])+""+_index
console.log(r.monthName,r.monthIndex)
}
@ -653,8 +664,12 @@
}
this.list = res.data
this.currentTableList = this.filterBySelectedMonths(this.list,this.selectMonth)
console.log("this.currentTableList",this.currentTableList)
let _arr = []
let _arr2 = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
_arr2 = _arr.filter(item=>item.audit_status===2)
this.auditStatus2= _arr2
this.total = res.total
@ -663,16 +678,22 @@
this.selectMonth = val ? this.allMonths : [];
this.isIndeterminate = false;
let _arr = []
let _arr2 = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
_arr2 = _arr.filter(item=>item.audit_status===2)
this.auditStatus2= _arr2
},
changeMonth(e){
let checkedCount = e.length;
this.checkAll = checkedCount === this.allMonths.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allMonths.length;
let _arr = []
let _arr2 = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
_arr2 = _arr.filter(item=>item.audit_status===2)
this.auditStatus2= _arr2
},
filterBySelectedMonths(arr, selectMonth) {
if (!selectMonth || selectMonth.length === 0) {

Loading…
Cancel
Save