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

Loading…
Cancel
Save