|
|
|
@ -156,11 +156,12 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="type=='show'">
|
|
|
|
<div v-if="type=='show'">
|
|
|
|
<el-divider>执行情况</el-divider>
|
|
|
|
<el-divider>执行情况</el-divider>
|
|
|
|
<!-- 所有人的执行情况 -->
|
|
|
|
<!-- 所有人的执行情况 -->
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="url_type!=5">
|
|
|
|
<div v-if="url_type!=5">
|
|
|
|
<xy-table :list="showform.mission_distribute" stripe :table-item="distributeTable" :isPage='false'>
|
|
|
|
<xy-table :list="showform_mission_distribute" row-key="id" :default-expand-all="false" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" stripe :table-item="distributeTable" :isPage='false'>
|
|
|
|
<template v-slot:accept_admin_name>
|
|
|
|
<template v-slot:accept_admin_name>
|
|
|
|
<el-table-column align='left' label="执行人" width="140" header-align="center">
|
|
|
|
<el-table-column align='left' label="执行人" width="180" header-align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<!-- 有组别的 -->
|
|
|
|
<!-- 有组别的 -->
|
|
|
|
<div v-if="scope.row.mission_group_id">
|
|
|
|
<div v-if="scope.row.mission_group_id">
|
|
|
|
@ -496,7 +497,8 @@
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
logList: [],
|
|
|
|
logList: [],
|
|
|
|
// 任务人查看
|
|
|
|
// 任务人查看
|
|
|
|
my_mission_distribute: [],
|
|
|
|
my_mission_distribute: [],
|
|
|
|
|
|
|
|
showform_mission_distribute:[],
|
|
|
|
distributeTable: [{
|
|
|
|
distributeTable: [{
|
|
|
|
label: '执行人',
|
|
|
|
label: '执行人',
|
|
|
|
prop: 'accept_admin_name',
|
|
|
|
prop: 'accept_admin_name',
|
|
|
|
@ -658,8 +660,9 @@
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.my_mission_distribute = md
|
|
|
|
this.my_mission_distribute = this.convertToTree(md)
|
|
|
|
console.log(this.my_mission_distribute)
|
|
|
|
console.log(this.my_mission_distribute)
|
|
|
|
|
|
|
|
|
|
|
|
this.pictureList = []
|
|
|
|
this.pictureList = []
|
|
|
|
for (var f of res.files) {
|
|
|
|
for (var f of res.files) {
|
|
|
|
this.pictureList.push({
|
|
|
|
this.pictureList.push({
|
|
|
|
@ -668,11 +671,57 @@
|
|
|
|
name: f.original_name
|
|
|
|
name: f.original_name
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.showform = res
|
|
|
|
this.showform = res
|
|
|
|
|
|
|
|
this.showform_mission_distribute = this.convertToTree(res.mission_distribute)
|
|
|
|
|
|
|
|
console.log("this.showform.mission_distribute",this.showform_mission_distribute)
|
|
|
|
this.is_what_unitType = res.unit_type_detail ? res.unit_type_detail.value : ''
|
|
|
|
this.is_what_unitType = res.unit_type_detail ? res.unit_type_detail.value : ''
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 更改为树形结构
|
|
|
|
|
|
|
|
convertToTree(arr) {
|
|
|
|
|
|
|
|
const map = {};
|
|
|
|
|
|
|
|
const carryType2Map = {};
|
|
|
|
|
|
|
|
const roots = [];
|
|
|
|
|
|
|
|
const used = new Set();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 首次遍历,将每个对象存入 map 中,并记录 carry_type === 2 的对象
|
|
|
|
|
|
|
|
arr.forEach(item => {
|
|
|
|
|
|
|
|
if (!map[item.accept_admin_id]) {
|
|
|
|
|
|
|
|
map[item.accept_admin_id] = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const newItem = { ...item, children: [] };
|
|
|
|
|
|
|
|
map[item.accept_admin_id].push(newItem);
|
|
|
|
|
|
|
|
if (item.carry_type === 2) {
|
|
|
|
|
|
|
|
carryType2Map[item.accept_admin_id] = newItem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 第二次遍历,构建父子关系
|
|
|
|
|
|
|
|
arr.forEach(item => {
|
|
|
|
|
|
|
|
const current = map[item.accept_admin_id].find(i => i.id === item.id);
|
|
|
|
|
|
|
|
if (item.from_user_id!== null) {
|
|
|
|
|
|
|
|
const parentList = map[item.from_user_id];
|
|
|
|
|
|
|
|
if (parentList) {
|
|
|
|
|
|
|
|
const parent = carryType2Map[item.from_user_id];
|
|
|
|
|
|
|
|
if (parent) {
|
|
|
|
|
|
|
|
parent.children.push(current);
|
|
|
|
|
|
|
|
used.add(current.id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将未作为子元素的项添加到 roots 中
|
|
|
|
|
|
|
|
Object.values(map).forEach(items => {
|
|
|
|
|
|
|
|
items.forEach(item => {
|
|
|
|
|
|
|
|
if (!used.has(item.id)) {
|
|
|
|
|
|
|
|
roots.push(item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return roots;
|
|
|
|
|
|
|
|
},
|
|
|
|
async getUnitTypeList() {
|
|
|
|
async getUnitTypeList() {
|
|
|
|
const res = await getparameteritem('unitTypeList')
|
|
|
|
const res = await getparameteritem('unitTypeList')
|
|
|
|
this.unitTypeList = res.detail
|
|
|
|
this.unitTypeList = res.detail
|
|
|
|
@ -699,7 +748,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
this.showform = {}
|
|
|
|
this.showform = {}
|
|
|
|
this.isEditor = false
|
|
|
|
this.isEditor = false
|
|
|
|
this.my_mission_distribute = []
|
|
|
|
this.my_mission_distribute = []
|
|
|
|
|
|
|
|
this.showform_mission_distribute = []
|
|
|
|
this.pictureList = []
|
|
|
|
this.pictureList = []
|
|
|
|
this.is_what_unitType = ''
|
|
|
|
this.is_what_unitType = ''
|
|
|
|
this.url_type = ''
|
|
|
|
this.url_type = ''
|
|
|
|
|