yangbifan 2 anni fa
parent
commit
17f25cec60

+ 3 - 1
src/assets/js/url.js

@@ -21,7 +21,9 @@ const urls = {
         getCommentsByProcessIds:ctxForm + '/getCommentsByProcessId/',
         getReadList:ctxForm+'/complateReadTask',
         getLastName:ctxForm+'/lastMan',
-        getNewTransferTask:ctxForm+"/process/transferTaskMuti/"
+        getNewTransferTask:ctxForm+"/process/transferTaskMuti/",
+        getQueryMultiTaskId:ctxForm + "/queryMultiTaskId",
+        getComplateLastMan:ctxForm + "/complateLastMan"
     },
     distribute: {
         sendMsg: ctx + '/api/distribute/create', //创建分发

+ 131 - 39
src/components/workflow.vue

@@ -155,6 +155,7 @@ export default {
       treeCopyList: [],
       demand: "",
       nextDealManList: "",
+      isLastManStatus: false,
     };
   },
   props: {
@@ -187,58 +188,126 @@ export default {
         this.demand = res.data;
       });
     },
-    submitWork() {
-      //生成需求决策编号
-      if (this.clicknextName === "起草人发送") {
-        this.getDemand();
+    async getLastManList(e) {
+      let _this = this;
+      let obj = {
+        url: _this.$url.formList.getComplateLastMan, //开始工作流接口
+        data: e,
+        // status: "form",
+        headers: {
+          "Content-Type": "application/json",
+        },
+      };
+
+      let res = await this.common.httpPost(obj, success);
+      function success(data) {
+        console.log(data);
       }
-      if (!this.list.taskId) {
-        this.$message.error("请先保存表单后处理");
-        return false;
+    },
+    async nextWorks(lists, list) {
+      let _this = this;
+      let obj = {
+        url: _this.$url.formList.nextWork, //下一步工作流接口
+        data: lists,
+        status: "form",
+      };
+      await this.common.httpPost(obj, success);
+      function success(data) {
+        console.log(_this.nodes);
+        let updateList = {
+          taskId: data.taskid,
+          id: _this.list.id,
+          resourceId: _this.nodes.currentShape[0].resourceId,
+        };
+         list.taskid = data.taskid
+        _this.setUpdate(updateList);
+        _this.getLastManList(list);
+        
       }
-      if (this.TransferStatus === true) {
-        if (this.backThree.length > 0) {
-          this.nextWork();
-        } else {
-          this.$message.error("请选择候选人");
-          return false;
-        }
-      } else {
+    },
+    submitWork() {
+      //多人会签处理环节
+      if (this.manyPeopleStatus == true) {
         let list = {
           userId: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员id
+          taskid: this.list.taskId, //表单标识
+          procinstid: this.list.processId,
+          taskName: this.clicknextName, //流程节点
+          userCode: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员code
+          content: this.textarea, //意见内容
+        };
+        let lists = {
+          userId: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员id
           taskId: this.list.taskId, //表单标识
           taskName: this.clicknextName, //流程节点
           userCode: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员code
           content: this.textarea, //意见内容
-          // resolution: this.nodes.currentShape[0].condition.resolution, //流程图线节点
-          // nextDealMan: this.backThree[0].loginNoStr || '', //下一步处理人
         };
-        if (this.treeCopyList.length) {
-          //抄送
-          list.copyman = this.treeCopyList[0].loginNoStrCopy;
+        if (this.manyPeopleStatus == true) {
+          list.lastmanList = this.nextDealManList;
         }
         if (this.nodes.currentShape) {
-          list.resolution = this.nodes.currentShape[0].condition.resolution;
-          list.approve = this.nodes.currentShape[0].condition.approve;
+          lists.resolution = this.nodes.currentShape[0].condition.resolution;
+          lists.approve = this.nodes.currentShape[0].condition.approve;
+        }
+        if (this.backThree.length > 0) {
+          lists.nextDealMan = "admin";
         }
-        if (this.clicknextName === "") {
-          this.$message.error("请选择流程节点");
+        this.nextWorks(lists, list);
+      } else {
+        //生成需求决策编号
+        if (this.clicknextName === "起草人发送") {
+          this.getDemand();
+        }
+        if (!this.list.taskId) {
+          this.$message.error("请先保存表单后处理");
           return false;
         }
-        if (this.backThree.length > 0) {
-          if (this.manyPeopleStatus == true) {
-            list.nextDealManList = this.nextDealManList;
+        if (this.TransferStatus === true) {
+          if (this.backThree.length > 0) {
+            this.nextWork();
           } else {
-            list.nextDealMan = this.backThree[0].loginNoStr;
+            this.$message.error("请选择候选人");
+            return false;
           }
         } else {
-          if (this.clicknextName === "流程结束") {
-          } else {
-            this.$message.error("请选择候选人");
+          let list = {
+            userId: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员id
+            taskId: this.list.taskId, //表单标识
+            taskName: this.clicknextName, //流程节点
+            userCode: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员code
+            content: this.textarea, //意见内容
+            // resolution: this.nodes.currentShape[0].condition.resolution, //流程图线节点
+            // nextDealMan: this.backThree[0].loginNoStr || '', //下一步处理人
+          };
+          if (this.treeCopyList.length) {
+            //抄送
+            list.copyman = this.treeCopyList[0].loginNoStrCopy;
+          }
+          if (this.nodes.currentShape) {
+            list.resolution = this.nodes.currentShape[0].condition.resolution;
+            list.approve = this.nodes.currentShape[0].condition.approve;
+          }
+          if (this.clicknextName === "") {
+            this.$message.error("请选择流程节点");
             return false;
           }
+          if (this.backThree.length > 0) {
+            if (this.manyPeopleStatus == true) {
+              list.nextDealManList = this.nextDealManList;
+            } else {
+              list.nextDealMan = this.backThree[0].loginNoStr;
+            }
+          } else {
+            if (this.clicknextName === "流程结束") {
+            } else {
+              ror("请选择候选人");
+              return false;
+            }
+            this.$message.er;
+          }
+          this.nextWork(list);
         }
-        this.nextWork(list);
       }
     },
     async nextWork(list) {
@@ -319,6 +388,28 @@ export default {
         // }
       });
     },
+    async getqueryMultiTaskId() {
+      let list = {
+        procinstid: this.list.processId,
+        userId: JSON.parse(window.sessionStorage.userInfo).loginNo,
+        // procinstid:this.fromList.processId
+
+        // taskId:e.taskId
+      };
+      let _this = this;
+      let obj = {
+        url: this.$url.formList.getQueryMultiTaskId, //流程追踪接口
+        data: list,
+        headers: {
+          "Content-Type": "application/json",
+        },
+      };
+      let res = await this.common.httpPost(obj, success);
+      function success(data) {
+        console.log(data);
+        _this.list.taskId = data.taskid;
+      }
+    },
     //查询路径接口
     getNextPath(e, status) {
       let list = {
@@ -344,13 +435,14 @@ export default {
         if (status === 1) {
           //第一次进入取路径
           this.initialList = res.data.body;
-          // if (res.data.body.nextShapes[0].multi !== null) {
-          //   if (res.data.body.nextShapes[0].multi.multi === "true") {
-          //     this.manyPeopleStatus = true; //转派按钮生效
-          //   } else {
-          //     this.manyPeopleStatus = false;
-          //   }
-          // }
+          if (res.data.body.nextShapes[0].multi !== null) {
+            if (res.data.body.nextShapes[0].multi.multi === "true") {
+              this.getqueryMultiTaskId();
+              // this.isLastManStatus = true;
+            } else {
+              // this.isLastManStatus = false;
+            }
+          }
           if (res.data.body.nextShapes[0].loop !== null) {
             if (res.data.body.nextShapes[0].loop.loop === "true") {
               this.transferStatus = true; //转派按钮生效

+ 72 - 11
src/components/workflowEntrance.vue

@@ -10,7 +10,7 @@
 
               <div class="flex-path-list">
                 <div @click="getTreeLists()">转派</div>
-                <div @click="clickTransfer(2)">结束</div>
+                <div @click="getclose()">结束</div>
                 <!-- <div
                   v-for="(item, index) in node.nextShapes"
                   :key="index"
@@ -96,7 +96,9 @@
     </div>
     <div class="flex-footer-botton">
       <div class="flex-button">
-        <el-button type="primary" @click="getnewtransfertask()">提交</el-button>
+        <el-button type="primary" @click="getnewtransfertask(1)"
+          >提交</el-button
+        >
       </div>
     </div>
     <el-dialog
@@ -153,6 +155,7 @@ export default {
       editStatus: false, //修改控制显示字段
       treeCopyList: [],
       demand: "",
+      close: "",
     };
   },
   props: {
@@ -164,29 +167,77 @@ export default {
     requestForm: {
       type: Object,
     },
+    lastManList: {
+      type: Object,
+    },
   },
   created() {
     this.getNextPath(this.list.resourceId, 1);
     this.getMetirialType();
   },
   methods: {
+    getclose() {
+      this.close = "1";
+    },
+    // async getqueryMultiTaskId() {
+    //   let list = {
+    //     procinstid: this.list.processId,
+    //     userId: JSON.parse(window.sessionStorage.userInfo).loginNo,
+    //     // procinstid:this.fromList.processId
 
+    //     // taskId:e.taskId
+    //   };
+    //   let _this = this;
+    //   let obj = {
+    //     url: this.$url.formList.getQueryMultiTaskId, //流程追踪接口
+    //     data: list,
+    //     headers: {
+    //       "Content-Type": "application/json",
+    //     },
+    //   };
+    //   let res = await this.common.httpPost(obj, success);
+    //   function success(data) {
+    //     console.log(data);
+    //     _this.list.taskId = data.taskid;
+    //   }
+    // },
     //新转派接口
     async getnewtransfertask() {
       let _this = this;
       let list = {
-        userId: JSON.parse(window.sessionStorage.userInfo).loginNo,
-        taskId: _this.list.taskId,
-        content: _this.textarea,
-      };
-      let obj = {
-        url: _this.$url.formList.getNewTransferTask + _this.list.taskId, //下一步工作流接口
-        status: "form",
-        data: list,
-      };
+        userId: "",
+        userId: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员id
+        taskid: this.list.taskId, //表单标识
+        procinstid: this.list.processId,
+        // taskName: this.clicknextName, //流程节点
+        userCode: JSON.parse(window.sessionStorage.userInfo).loginNo, //人员code
+        content: this.textarea, //意见内容
+      }; 
+      let obj = {};
+      if (this.close == "1") {
+        console.log(JSON.parse(window.sessionStorage.userInfo).loginNo);
+        (list.userId = JSON.parse(window.sessionStorage.userInfo).loginNo),
+          (obj.url = _this.$url.formList.getComplateLastMan), //下一步工作流接口
+          (obj.data = list)
+
+      } else {
+        (list.userId = _this.backThree[0].loginNoStr(
+          (obj.url = _this.$url.formList.getNewTransferTask + _this.list.taskId)
+        )), //下一步工作流接口
+          (obj.status = "form"),
+          (obj.data = list);
+      }
+
       await _this.common.httpPost(obj, success);
       function success(data) {
         console.log("[ data ] >", data);
+        let list = {
+          taskId: data.taskid,
+          id: _this.list.id,
+          // resourceId: _this.nodes.currentShape[0].resourceId,
+          // taskName: _this.nodes.nextShapes[0].properties.name,
+        };
+        _this.setUpdate(list);
       }
     },
     //生成需求决策编号接口
@@ -374,6 +425,13 @@ export default {
         if (status === 1) {
           //第一次进入取路径
           this.initialList = res.data.body;
+          console.log(this.initialList);
+          if (
+            this.initialList.nextShapes[0].multi?.multi &&
+            res.data.body.nextShapes[0].multi.multi === "true"
+          ) {
+            // this.getqueryMultiTaskId();
+          }
           // this.getTreeLists(this.initialList)
           // if (
           //   this.initialList.nextShapes[0].multi?.multi &&
@@ -461,6 +519,9 @@ export default {
       });
     },
     //转派按钮方法
+    a() {
+      this.clickGetTree([], "");
+    },
     clickTransfer(e) {
       if (e == 1) {
         // this.TransferStatus = true;

+ 3 - 3
src/pages/main/leader/components/form.vue

@@ -112,16 +112,16 @@ export default {
     },
   },
   created() {
-    console.log(this.list);
+
     // this.columnbackgroundStyle()
   },
   mounted() {
-    console.log(this.list);
+
   },
   methods: {
     columnbackgroundStyle({ row, column, rowIndex, columnIndex }) {
       // console.log(row);
-      // console.log(column);
+      console.log(column);
       // console.log(rowIndex);
       // console.log(columnIndex);
       if (column.type == "default") {

+ 15 - 7
src/pages/main/leader/demand/demandHomes.vue

@@ -98,6 +98,7 @@
         <WorkflowEntrance
           :list="fromList"
           v-else
+          :lastManList='lastManList'
           @beforeClose="beforeClose"
           :requestForm="requestForm"
         />
@@ -185,12 +186,12 @@ export default {
         // nextDealMan:'',
         title: "title",
         businessKey: "288",
-        processDefinitionKey: "scsjdc_pro_process",
+        processDefinitionKey: "request_form_process",
       },
       requestForm: {
-        fresourceId: "d3f1793f-2f20-11ed-a6ed-02427ba2d388", // 本地环境
+       fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
         // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
-        processDefinitionKey: "scsjdc_pro_process",
+        processDefinitionKey: "request_form_process",
       },
       treeList: [], //候选人列表
       treeCopyList: [], //抄送人列表
@@ -744,6 +745,7 @@ export default {
       clickTaskName: "",
       seachLists: {},
       timeList: {},
+      lastManList:[]
     };
   },
   created() {
@@ -785,8 +787,11 @@ export default {
   methods: {
     //是否最后一个人
     async getLastName() {
+      console.log( this.fromList);
       let list = {
-        taskid: this.fromList.taskId,
+        procinstid: this.fromList.processId,
+        taskid:this.fromList.taskId
+
         // taskId:e.taskId
       };
       let _this = this;
@@ -802,7 +807,8 @@ export default {
       let res = await this.common.httpPost(obj, success);
       function success(data) {
         _this.isWorkflowStatus = data.lastMan == false ? false : true;
-        console.log(_this.isWorkflowStatus);
+        _this.lastManList = data
+        // console.log(_this.isWorkflowStatus);
       }
     },
     //添加面包屑
@@ -1280,6 +1286,7 @@ export default {
     },
     //处理按钮,开始工作流接口
     clickHandles() {
+      console.log(this.fromList);
       this.getNextPath(this.fromList.resourceId || "");
     },
 
@@ -1336,12 +1343,12 @@ export default {
 
       let res = await this.common.httpPost(obj, success);
       function success(data) {
-        _this.fromList.taskId = data.data;
+        _this.fromList.processId = data.data;
         _this.taskId = data.data;
         let list = {
           id: e,
           // taskId:_this.formId,
-          processId: _this.fromList.taskId,
+          processId: _this.fromList.processId,
           // resourceId: _this.nextPath.currentShape[0].resourceId,
         };
         _this.setUpdate(list);
@@ -1360,6 +1367,7 @@ export default {
       }).then((res) => {
         this.fromList.taskId = res.data.body.taskId;
         this.fromList.taskName = res.data.body.taskName;
+        this.fromList.processId = res.data.body.processId;
         if (res.data.body.taskName === "起草") {
           this.isSync = res.data.body.isSync;
         } else {