| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | convertToTreeData(data, parent,index,parentId) { |
| | | const tempJson = data.find(f => |
| | | f.index_no === index |
| | | ) |
| | | this.$store.state.noTakeList .push(tempJson.id) |
| | | parent.children = { |
| | | "id": tempJson.id, |
| | | "parentId": parentId, |
| | | "name": "审批人", |
| | | "type": "APPROVAL", |
| | | "props": |
| | | { |
| | | "assignedType": "ASSIGN_USER", |
| | | "nobody": { |
| | | "handler": "TO_PASS", |
| | | "assignedUser": [] |
| | | }, |
| | | "refuse": { |
| | | "type": "TO_END", |
| | | "target": "" |
| | | }, |
| | | "assignedUser": [{"id": tempJson.board_id||tempJson.rule_code, "name": tempJson.name,"type":tempJson.board_id!=null?"group":"staff"}], |
| | | "approvalGroup":tempJson.board_id!=null?{"id":tempJson.board_id,"name":tempJson.name}:"", |
| | | "staffGroup":tempJson.board_id!=null?"":{"id":tempJson.rule_code,"name":tempJson.name}, |
| | | } |
| | | } |
| | | //节点数组的大小 大于当前循环的 说明还有子项 继续循环 |
| | | if (data.length >index) { |
| | | let getChildren = this.convertToTreeData(data, parent.children, index+1,parent.children.id) |
| | | parent.children=getChildren |
| | | } |
| | | return parent; |
| | | }, |
| | | |
| | | getProcessInfo() { |
| | | this.loading = true; |
| | | let param = {"id": this.processInstanceId} |
| | |
| | | getFlowDetail(param){ |
| | | getFlowDetail(param).then(rsp => { |
| | | let form = rsp.data.data; |
| | | form.process =this.convertToTreeData(form.steps, { |
| | | form.process =this.$Utils.convertToTreeData(form.steps, { |
| | | "id": form.id, "parentId": null, |
| | | "type": "ROOT", |
| | | "name": "发起人", |