@@ -138,7 +150,7 @@
select:{
keyword:'',
page:1,
- page_size:9999,
+ page_size:10,
status:'',
myself:0,
mission_id:'',
@@ -147,6 +159,7 @@
ask_id:'',
sort_name:'date',
sort_type:"DESC",
+ // pid:0
// myself_update:0
},
sectionList:[],
@@ -219,7 +232,8 @@
table:[{
label:"任务名称",
prop:'missionName',
- // width:180
+ // width:180,
+ align:'left'
},{
label:"状态",
prop:'status',
@@ -547,33 +561,58 @@
// console.log("currentTableList",this.currentTableList)
this.total = res.total
},
- handleCheckAllChange(val) {
- if(val){
- let _sm = []
- this.missionList.map(item=>{
- _sm.push(item.id)
- })
- this.selectMission = _sm
- this.select.mission_id = this.selectMission.join(',')
- this.getList()
- }else{
- this.selectMission = []
- this.select.mission_id = ''
- }
- this.isIndeterminate = false;
+ handleCheckAllChange() {
+ // let _checkAll = this.checkAll ? false : true
+ // console.log("_checkAll",_checkAll)
+ // this.checkAll = _checkAll
+ console.log("this.checkAll",this.checkAll)
+ this.select.page=1
+ if(this.checkAll){
+ let _sm = []
+ this.missionList.map(item=>{
+ _sm.push(item.id)
+ if(item.pid_details_count>0){
+ item.pid_details.map(p=>{
+ _sm.push(p.id)
+ })
+ }
+ })
+ this.selectMission = _sm
+ this.select.mission_id = ''
+ this.$refs.missiontree.setCheckedKeys(_sm);
+ this.getList()
+ }else{
+ this.selectMission = []
+ this.select.mission_id = ''
+ this.$refs.missiontree.setCheckedKeys([]);
+ this.getList()
+ }
+
+ this.isIndeterminate = true;
// let _arr = []
// _arr = this.filterBySelectedMonths(this.list,this.selectMission)
// this.currentTableList = _arr
},
- changeMonth(e){
- let checkedCount = e.length;
- this.checkAll = checkedCount === this.missionList.length;
- this.isIndeterminate = checkedCount > 0 && checkedCount < this.missionList.length;
- this.select.mission_id = this.selectMission.join(',')
- this.getList()
- // let _arr = []
- // _arr = this.filterBySelectedMonths(this.list,this.selectMission)
- // this.currentTableList = _arr
+ changeMonth(data, checked, indeterminate){
+ console.log(data, checked, indeterminate);
+ // if(!this.checkAll){
+ if(checked){
+ if(this.selectMission.indexOf(data.id)==-1){
+ this.selectMission.push(data.id)
+ }
+ }else{
+ this.selectMission.map((item,index)=>{
+ if(item===data.id){
+ this.selectMission.splice(index,1)
+ }
+ })
+ }
+ this.select.mission_id = this.selectMission.join(',')
+ this.select.page=1
+ this.getList()
+
+
+ console.log("this.selectMission",this.selectMission)
},
filterBySelectedMonths(arr, selectMission) {
if (!selectMission || selectMission.length === 0) {
@@ -599,7 +638,8 @@
page:1,
page_size:999,
unit_type:k.id,
- year:this.year
+ year:this.year,
+ pid:0
})
this.missionList = res1.data
@@ -783,23 +823,30 @@
}
},
- deleteList(){
+ deleteList(id){
var that = this;
- if (this.sectionList.length>0) {
- let arr = []
- this.sectionList.map(item=>{
- arr.push(item.id)
- })
- del(arr.join(',')).then(response => {
- this.$Message.success('操作成功');
- that.getList();
- }).catch(error => {
- console.log(error)
- reject(error)
- })
- }else{
- this.$Message.warning('请选择要删除的数据');
- }
+ del(id).then(response => {
+ this.$Message.success('操作成功');
+ that.getList();
+ }).catch(error => {
+ console.log(error)
+ reject(error)
+ })
+ // if (this.sectionList.length>0) {
+ // let arr = []
+ // this.sectionList.map(item=>{
+ // arr.push(item.id)
+ // })
+ // del(arr.join(',')).then(response => {
+ // this.$Message.success('操作成功');
+ // that.getList();
+ // }).catch(error => {
+ // console.log(error)
+ // reject(error)
+ // })
+ // }else{
+ // this.$Message.warning('请选择要删除的数据');
+ // }
}
},
watch:{}
@@ -811,16 +858,27 @@
display:flex;
}
.tablemonth{
- width:10%;
+ width:15%;
background: #fff;
padding: 20px;
margin-right:1%;
}
.tablecontent{
- width:89%
+ width:84%
+ }
+ /deep/ .el-tree-node{
+ white-space: normal;
+ }
+ /deep/ .el-tree-node__content{
+ height: auto;
+ align-items: start;
+ }
+ /deep/ .el-table .cell.el-tooltip{
+ white-space: normal;
}
/deep/ .tablemonth .el-checkbox{
- width:100%;
+ /* width:100%; */
+ padding: 4px 0;
}
/deep/ .tablemonth .el-checkbox__input{
vertical-align: top!important;
@@ -828,8 +886,12 @@
/deep/ .tablemonth .el-checkbox__label {
text-wrap:wrap;
}
- /deep/ .v-table .el-table__body .missionName{
- vertical-align: top!important;
+ /deep/ .el-tree-node__label{
+ /* text-wrap:wrap; */
+ }
+ /deep/ .v-table .el-table__body .missionName>div{
+ /* white */
+ /* vertical-align: top!important; */
}
/deep/ .el-icon-circle-close{
color:#fff
diff --git a/src/views/task/list/unit.vue b/src/views/task/list/unit.vue
index 51ad05d..6fc9222 100644
--- a/src/views/task/list/unit.vue
+++ b/src/views/task/list/unit.vue
@@ -4,8 +4,18 @@
-
+
+
+
@@ -16,10 +26,16 @@
-
-
+
+
+
+
+
+
@@ -45,20 +61,22 @@
共有{{total}}项任务,共{{auditStatus1}}项未完成
-
{select.page_size = e,getList()}" @pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
-
-
-
+ @click="editorUnit(scope.row.id,'editor')">编辑任务
+
+
+
+
+
+
+ v-if="(scope.row.accept_department_ids && scope.row.accept_department_ids.length>0 && stateObj.is_manger
+ && !(scope.row.audit_status==3||scope.row.audit_status==5)) || scope.row.main_admin_id==stateObj.login_id
+ ">
+ @click="editorUnit(scope.row.id,'pid')">创建任务
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @click="openMyMission(item.value,scope.row)">执行任务
@@ -125,7 +177,9 @@
del,
unDoTotal
} from '@/api/task/unit.js'
-
+ import {
+ listdept
+ } from "@/api/system/department.js"
import {
getparameteritem
} from "@/api/system/dictionary.js";
@@ -152,6 +206,7 @@
path_type: 4,
dialogVisible: false,
stateObj: {},
+ deptOptions:[],
treeProps:{children: 'pid_details', hasChildren: 'hasChildren' },
typeName: [{
type: 1,
@@ -162,7 +217,9 @@
}, {
type: 5,
name: '我的任务'
- }],
+ }],
+ myMonth:'',
+ isMyPage:true,
select: {
keyword: '',
page: 1,
@@ -179,7 +236,8 @@
sort_type: 'DESC',
year: new Date().getFullYear(),
month: '',
- pid:0,
+ pid:0,
+ main_department_id:''
},
total: 0,
pickerOptions: {
@@ -293,12 +351,12 @@
}],
table: [
- // {
- // label: "id",
- // prop: 'id',
- // // fixed:'left',
- // align: 'left',
- // },
+ {
+ label: "",
+ prop: 'pindex',
+ // fixed:'left',
+ width:80
+ },
{
label: "任务名称",
prop: 'name',
@@ -311,6 +369,12 @@
minWidth: 200,
align: 'left',
}, {
+ label: "任务类型",
+ prop: 'unit_type_detail.value',
+ width: 120,
+ align: 'center'
+ },
+ {
label: "开始日期",
prop: 'start_date',
width: 120,
@@ -349,7 +413,8 @@
computed: {
},
created() {
- this.getLeads()
+ this.getLeads()
+ this.loadDeptOptions()
this.stateObj = state.state
let currentMonth = (new Date()).getMonth() + 1 < 10 ? "0" + ((new Date()).getMonth() + 1) : (new Date())
.getMonth() + 1
@@ -361,19 +426,20 @@
this.select.type = path[1]
this.path_type = path[1]
if (path[1] == 5) {
- this.showSelectMonth = true
+ this.showSelectMonth = false
this.select.type = ''
this.select.myself = 1
+ // this.select.pid = 0
+ // if(!this.stateObj.is_manger){
+ this.isMyPage = false
+ this.select.page_size = 999
this.select.pid = ''
- this.treeProps = {children: 'nochildren', hasChildren: 'hasChildren' }
+ this.treeProps = {children: 'mychildren', hasChildren: 'hasChildren' }
+ // }
this.type_name = '我的任务'
- this.path_type = path[1]
- // this.table = this.table.slice(2)
- // this.table.map((item, index) => {
- // if (item.prop === '_names') {
- // this.table.splice(index, 1)
- // }
- // })
+ this.path_type = path[1]
+ this.select.month = ''
+
}
if (path[1] == 4) {
this.selectMonth = []
@@ -384,6 +450,7 @@
this.select.type = 4
this.type_name = '专项专题任务'
this.path_type = path[1]
+
this.table.unshift({
label: "任务类别",
prop: 'mission_type',
@@ -393,8 +460,10 @@
}
if (path[1] == 1) {
this.showSelectMonth = true
- this.select.type = 1
- this.type_name = '年度计划任务'
+ this.select.type = 1
+ // this.select.pid = ''
+ // this.treeProps = {children: 'nochildren', hasChildren: 'hasChildren' }
+ this.type_name = '任务跟踪'
this.path_type = path[1]
}
}
@@ -404,11 +473,29 @@
},
watch: {},
- methods: {
+ methods: {
+ loadDeptOptions() {
+ listdept().
+ then((res) => {
+ this.deptOptions = res;
+ }).catch(error => {
+ console.log(error)
+ reject(error)
+ })
+ },
changeYear(e) {
if (e) {
this.select.year = e
}
+ },
+ changeMyMonth(e){
+ console.log(e)
+ if(e){
+ this.select.month = e
+ // this.select.month = e.join(",")
+ }else{
+ this.select.month = ''
+ }
},
async getLeads() {
// await this.$store.dispatch("user/getLeads")
@@ -537,36 +624,67 @@
})
// 我的任务中 选择accept_department_ids部门的,只有选择到的科室负责人能看到 is_manger = true
// 且具体执行人为空
+ // 责任人看到所有
let spliceIndex = []
let _arr = []
res.data.map((r,index)=>{
+ console.log("r.rowKey",r.rowKey)
let doAdmins = r.do_admin_ids ? r.do_admin_ids : []
if(this.path_type == 5 && r.accept_department_ids.length > 0){
+ console.log("id",r.id)
let isDepartment = r.accept_department_ids.indexOf(this.stateObj.department_id)!=-1 ? true : false
let isDomains = doAdmins.indexOf(this.stateObj.login_id)!=-1 ? true : false
- if(doAdmins.length==0){
- if(!(isDepartment && this.stateObj.is_manger)){
- spliceIndex.push(index)
- }
- }else{
- if(!((isDepartment && this.stateObj.is_manger)||isDomains)){
- spliceIndex.push(index)
+ let isMainId = r.main_admin_id==this.stateObj.login_id?true:false
+ if(!isMainId){
+ if(doAdmins.length==0){
+ if(!(isDepartment && this.stateObj.is_manger)){
+ spliceIndex.push(index)
+ }
+ }else{
+ if(!((isDepartment && this.stateObj.is_manger)||isDomains)){
+ spliceIndex.push(index)
+ }
}
}
}
})
if(this.path_type == 5){
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
- _arr = newArr
- this.list = _arr
+ _arr = this.buildTree(newArr)
+
}else{
- this.list = res.data
+ _arr = res.data
}
+ _arr.map((r,index)=>{
+ r.pindex = index+1
+ })
+ this.list = _arr
+
console.log("spliceIndex",spliceIndex)
this.total = res.total
+ },
+
+ buildTree(items) {
+ const tree = [];
+ const map = {};
+
+ items.forEach(item => {
+ map[item.id] = item;
+ });
+
+ items.forEach(item => {
+ const parent = map[item.pid];
+ if (parent) {
+ (parent.mychildren || (parent.mychildren = [])).push(item);
+ } else {
+ tree.push(item);
+ }
+ });
+
+ return tree;
},
handleCheckAllChange(val) {
if (val) {
@@ -657,7 +775,12 @@
width: 250px;
margin-right: 10px;
}
-
+ /deep/ .height32 .el-input__icon.el-icon-date{
+ line-height: 32px;
+ }
+ /deep/ .height32.el-date-editor--month .el-input__icon{
+ line-height: 32px;
+ }
/deep/ .el-date-editor .el-range__icon,
/deep/ .el-date-editor .el-range-separator,
/deep/ .el-date-editor .el-range__close-icon {