zhiyong.zhou
2024-03-04 ba614829f008504d2316ba0916db8f3c9af0b563
src/views/workspace/process/ProcessInstanceTabs.vue
@@ -1,8 +1,6 @@
<template>
  <div class="process-view">
    <div class="process-view__tabs" v-loading="loading">
    <process-diagram-viewer />
    </div>
@@ -19,13 +17,11 @@
    return {
      loading: false,
      processInstanceId: "",
      taskId: "",
      formData: {},
      currentNode: {},
      processInfo: "",
    };
  },
  methods: {
    convertToTreeData(data, parent,index,parentId) {
      const tempJson = data.find(f =>
@@ -54,6 +50,7 @@
              "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
@@ -63,15 +60,12 @@
    getProcessInfo() {
      this.loading = true;
      let param = {"id": this.processInstanceId}
      //let param = {"id": "74d84fb9188f4ce4b93e95f301ebbc1b"}
      //根据业务id获取当前审批流步骤
      getWorkSetpsByBusinessId(param).then(rsp => {
        let workSetps=rsp.data.data
        console.log("workSetps", workSetps)
        if(workSetps.length>0){
          let index=-1;
          let resultProcess;
          debugger
          let noApprovalArr=workSetps.filter(item=>item.end_time===null);
          ////如果所有节点都没审批 那么就取index_no=1的id为当前运行的节点
          if(noApprovalArr.length===workSetps.length){
@@ -152,7 +146,6 @@
  },
  beforeMount() {
    this.processInstanceId = this.$route.query.processInstanceId;
    this.taskId = this.$route.query.taskId;
  },
  mounted() {
    this.getProcessInfo();