Browse Source

改派进来默认选中表单入参加上

xiaowang-featrue
mk 10 months ago
parent
commit
722e4bc980
  1. 33
      src/views/modules/shequzhili/event/cpts/process-form-assign.vue

33
src/views/modules/shequzhili/event/cpts/process-form-assign.vue

@ -88,7 +88,6 @@ export default {
assignDeptNames: []
},
orgOptions: [],
orgOptionsCopy: [],
orgOptionProps: {
multiple: true,
value: 'agencyId',
@ -189,12 +188,12 @@ export default {
},
//西
findParentPath(data, agencyIds) {
let paths = [];
let obj = {paths:[],arr:[]};
function findPathRecursive(agencyId, node, path) {
;
if (node.agencyId === agencyId) {
path.push(agencyId);
paths.push(path.slice()); // Make a copy of the path array before pushing
obj.paths.push(path.slice());
obj.arr.push({value:node.agencyId,label:node.agencyName,level:node.level}) // Make a copy of the path array before pushing
return true;
}
if (node.subAgencyList) {
@ -210,8 +209,7 @@ export default {
agencyIds.forEach(agencyId => {
findPathRecursive(agencyId, data, []);
});
console.log(paths,"paths");
return paths;
return obj;
},
handelInputContent(val) {
this.$EventBus.$emit('handelInputEventContent', { type: 'opinion', value: val })
@ -229,13 +227,13 @@ export default {
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
console.log(data,"sdfljsldf");
this.orgOptions = []
this.orgOptions.push(data)
this.orgOptionsCopy.push(data)
var paths1 = this.findParentPath(this.orgOptions[0],this.eventDetailCopy.currentProcessDeptIds);
console.log(paths1,"dslsdfjlsd");
this.agencyIdArray=paths1
this.agencyIdArray = paths1.paths;
this.formData.assignDeptIds = paths1.arr.map(item=>item.value);
this.formData.assignDeptNames = paths1.arr.map(item=>item.label);
this.formData.levels = paths1.arr.map(item=>item.level)
} else {
this.$message.error(msg)
}
@ -324,6 +322,21 @@ export default {
});
},
resetData() {
this.formData = {
operationType: "5", //[0: 5 6]
handlingReq:'',//
transferAdvice:'',//
createdTime: '',
contactTime:'',
timeLimit:'',//
deptId:'', //
deptName:'',
sendMsg:1,
status:'assigned',
levels: [],
assignDeptIds: [],
assignDeptNames: []
}
this.agencyIdArray = []
},
beforeUpload(file) {

Loading…
Cancel
Save