任务跟踪 树形显示人

master
lion 6 months ago
parent 6b30bda447
commit 954f2bfbcf

@ -2,6 +2,6 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = http://192.168.60.99:9001/
VUE_APP_BASE_API = ''
VUE_APP_OUT_URL = 'http://192.168.60.24'
#VUE_APP_BASE_API = 'http://192.168.60.99:8001/'

@ -4,6 +4,6 @@ NODE_ENV = production
ENV = 'staging'
# base api
#VUE_APP_BASE_API = '/stage-api'
VUE_APP_BASE_API = 'http://192.168.60.99:8001/'
#VUE_APP_BASE_API = 'http://192.168.60.99:8001/'
VUE_APP_BASE_API = ''

@ -129,12 +129,12 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>责任人(科室)
</div>
<div class="xy-table-item-content" style="width:400px">
<el-select style="width:48%;margin-right:2%" :disabled="form.main_department_id&&!stateObj.is_chuzhang?true:false" v-model="form.main_department_id" @change="changeDeptOptions"
<el-select style="width:48%;margin-right:2%" :disabled="((form.main_department_id&&!stateObj.is_chuzhang)&&!stateObj.is_guiji)?true:false" v-model="form.main_department_id" @change="changeDeptOptions"
placeholder="请选择部门">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<el-select style="width:48%;" :disabled="form.main_admin_id&&!stateObj.is_chuzhang?true:false" v-model="form.main_admin_id" placeholder="请选择部门人员">
<el-select style="width:48%;" :disabled="((form.main_admin_id&&!stateObj.is_chuzhang)&&!stateObj.is_guiji)?true:false" v-model="form.main_admin_id" placeholder="请选择部门人员">
<el-option v-for="item in userOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>

@ -156,11 +156,12 @@
</div>
<div v-if="type=='show'">
<el-divider>执行情况</el-divider>
<!-- 所有人的执行情况 -->
<!-- 所有人的执行情况 -->
<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>
<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">
<!-- 有组别的 -->
<div v-if="scope.row.mission_group_id">
@ -496,7 +497,8 @@
}],
logList: [],
//
my_mission_distribute: [],
my_mission_distribute: [],
showform_mission_distribute:[],
distributeTable: [{
label: '执行人',
prop: 'accept_admin_name',
@ -658,8 +660,9 @@
// }
}
})
this.my_mission_distribute = md
console.log(this.my_mission_distribute)
this.my_mission_distribute = this.convertToTree(md)
console.log(this.my_mission_distribute)
this.pictureList = []
for (var f of res.files) {
this.pictureList.push({
@ -668,11 +671,57 @@
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 : ''
},
//
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() {
const res = await getparameteritem('unitTypeList')
this.unitTypeList = res.detail
@ -699,7 +748,8 @@
this.showform = {}
this.isEditor = false
this.my_mission_distribute = []
this.my_mission_distribute = []
this.showform_mission_distribute = []
this.pictureList = []
this.is_what_unitType = ''
this.url_type = ''

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/h-河道处项目/a-安全生产/safety-manage-service/public/admin',
outputDir: '/Users/mac/Documents/朗业/2024/h-河道处项目/a-安全生产/safety-manage-service/public/admin_test',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,

Loading…
Cancel
Save