Kaynağa Gözat

1.优化对节点是否需要业务操作的判断

GouGengquan 3 hafta önce
ebeveyn
işleme
72a0f569d9
3 değiştirilmiş dosya ile 89 ekleme ve 56 silme
  1. 5 0
      src/api/workFlowNodeInstance.js
  2. 1 1
      src/utils/request.js
  3. 83 55
      src/views/home/todo.vue

+ 5 - 0
src/api/workFlowNodeInstance.js

@@ -3,4 +3,9 @@ import request from '@/utils/request'
 // 获取当前节点实例
 export function currentNode(params) {
     return request.post(`workFlowNodeInstance/current`, params)
+}
+
+// 根据实例节点id获取节点下是否有需要业务操作的任务
+export function checkHasBusinessHandle(params) {
+    return request.get(`workFlowNodeInstance/checkHasBusinessHandle/${params}`)
 }

+ 1 - 1
src/utils/request.js

@@ -49,7 +49,7 @@ service.interceptors.response.use(
         showNotify(
           {
             type: 'danger',
-            message: '当前节点需要业务操作, 请在电脑端处理节点'
+            message: res.msg
           }
         );
       } else {

+ 83 - 55
src/views/home/todo.vue

@@ -101,6 +101,7 @@ import { showDialog } from 'vant';
 import { getPersonalTodoList } from '@/api/personal';
 import { getMajorTodoList } from '@/api/major';
 import { getAssetsTodoList } from '@/api/assets';
+import { checkHasBusinessHandle } from '@/api/workFlowNodeInstance';
 
 export default {
   data() {
@@ -276,16 +277,23 @@ export default {
         case 'LETTER_OUT':
           showDialog({
             message: '当前节点需要业务操作, 请在电脑端处理节点',
-          }).then(() => {
-            // on close
           });
           break;
         default:
-          this.$router.push(
-            `/index/personal/todoDetail?id=${row.businessId}&currentNodeCode=${row.nodeCode}&orderId=${row.orderId}&doWorkflow=${true}&isOnline=${row.isOnline}&handlerName=${
-              row.handlerName
-            }&nodeTime=${row.nodeCreated}`
-          );
+          checkHasBusinessHandle(row.currentNodeId).then((res) => {
+            // 跳转钱判断节点是否需要业务操作
+            if (!res.data) {
+              this.$router.push(
+                `/index/personal/todoDetail?id=${row.businessId}&currentNodeCode=${row.nodeCode}&orderId=${row.orderId}&doWorkflow=${true}&isOnline=${row.isOnline}&handlerName=${
+                  row.handlerName
+                }&nodeTime=${row.nodeCreated}`
+              );
+            } else {
+              showDialog({
+                message: '当前节点需要业务操作, 请在电脑端处理节点',
+              });
+            }
+          });
           break;
       }
     },
@@ -317,31 +325,40 @@ export default {
           });
           break;
         default:
-          if (reportNo && statementNo) {
-            this.$router.push(
-              `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&reportNo=${reportNo}&statementNo=${row.statementNo}&doWorkflow=${true}&currentNodeId=${
-                row.currentNodeId
-              }&currentNodeCode=${row.nodeCode}&taskCreated=${row.taskCreated}&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
-            );
-          } else if (!reportNo && statementNo) {
-            this.$router.push(
-              `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&statementNo=${row.statementNo}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${
-                row.nodeCode
-              }&taskCreated=${row.taskCreated}&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
-            );
-          } else if (reportNo && !statementNo) {
-            this.$router.push(
-              `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&reportNo=${reportNo}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${
-                row.nodeCode
-              }&taskCreated=${row.taskCreated}&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
-            );
-          } else {
-            this.$router.push(
-              `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${row.nodeCode}&taskCreated=${
-                row.taskCreated
-              }&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
-            );
-          }
+          checkHasBusinessHandle(row.currentNodeId).then((res) => {
+            // 跳转钱判断节点是否需要业务操作
+            if (!res.data) {
+              if (reportNo && statementNo) {
+                this.$router.push(
+                  `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&reportNo=${reportNo}&statementNo=${row.statementNo}&doWorkflow=${true}&currentNodeId=${
+                    row.currentNodeId
+                  }&currentNodeCode=${row.nodeCode}&taskCreated=${row.taskCreated}&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
+                );
+              } else if (!reportNo && statementNo) {
+                this.$router.push(
+                  `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&statementNo=${row.statementNo}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${
+                    row.nodeCode
+                  }&taskCreated=${row.taskCreated}&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
+                );
+              } else if (reportNo && !statementNo) {
+                this.$router.push(
+                  `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&reportNo=${reportNo}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${
+                    row.nodeCode
+                  }&taskCreated=${row.taskCreated}&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
+                );
+              } else {
+                this.$router.push(
+                  `/index/major/todoDetail?id=${row.businessId}&orderId=${row.orderId}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${row.nodeCode}&taskCreated=${
+                    row.taskCreated
+                  }&projectName=${row.productionName == null ? row.orderName : row.productionName}&principal=${row.principal}`
+                );
+              }
+            } else {
+              showDialog({
+                message: '当前节点需要业务操作, 请在电脑端处理节点',
+              });
+            }
+          });
           break;
       }
     },
@@ -363,29 +380,40 @@ export default {
           });
           break;
         default:
-          if (row.statementNo && row.reportNo) {
-            this.$router.push(
-              `/index/assets/todoDetail?assetsId=${row.assetsId}&statementNo=${row.statementNo}&reportNo=${row.reportNo}&currentNodeCode=${row.currentNodeCode}&handlerName=${
-                row.handlerName
-              }&projectName=${row.reportName || row.statementName || row.name}`
-            );
-          } else if (row.statementNo && !row.reportNo) {
-            this.$router.push(
-              `/index/assets/todoDetail?assetsId=${row.assetsId}&statementNo=${row.statementNo}&currentNodeCode=${row.currentNodeCode}&handlerName=${row.handlerName}&projectName=${
-                row.reportName || row.statementName || row.name
-              }`
-            );
-          } else if (!row.statementNo && row.reportNo) {
-            this.$router.push(
-              `/index/assets/todoDetail?assetsId=${row.assetsId}&reportNo=${row.reportNo}&currentNodeCode=${row.currentNodeCode}&handlerName=${row.handlerName}&projectName=${
-                row.reportName || row.statementName || row.name
-              }`
-            );
-          } else {
-            this.$router.push(
-              `/index/assets/todoDetail?assetsId=${row.assetsId}&currentNodeCode=${row.currentNodeCode}&handlerName=${row.handlerName}&projectName=${row.reportName || row.statementName || row.name}`
-            );
-          }
+          checkHasBusinessHandle(row.currentNodeId).then((res) => {
+            // 跳转钱判断节点是否需要业务操作
+            if (!res.data) {
+              if (row.statementNo && row.reportNo) {
+                this.$router.push(
+                  `/index/assets/todoDetail?assetsId=${row.assetsId}&statementNo=${row.statementNo}&reportNo=${row.reportNo}&currentNodeCode=${row.currentNodeCode}&handlerName=${
+                    row.handlerName
+                  }&projectName=${row.reportName || row.statementName || row.name}`
+                );
+              } else if (row.statementNo && !row.reportNo) {
+                this.$router.push(
+                  `/index/assets/todoDetail?assetsId=${row.assetsId}&statementNo=${row.statementNo}&currentNodeCode=${row.currentNodeCode}&handlerName=${row.handlerName}&projectName=${
+                    row.reportName || row.statementName || row.name
+                  }`
+                );
+              } else if (!row.statementNo && row.reportNo) {
+                this.$router.push(
+                  `/index/assets/todoDetail?assetsId=${row.assetsId}&reportNo=${row.reportNo}&currentNodeCode=${row.currentNodeCode}&handlerName=${row.handlerName}&projectName=${
+                    row.reportName || row.statementName || row.name
+                  }`
+                );
+              } else {
+                this.$router.push(
+                  `/index/assets/todoDetail?assetsId=${row.assetsId}&currentNodeCode=${row.currentNodeCode}&handlerName=${row.handlerName}&projectName=${
+                    row.reportName || row.statementName || row.name
+                  }`
+                );
+              }
+            } else {
+              showDialog({
+                message: '当前节点需要业务操作, 请在电脑端处理节点',
+              });
+            }
+          });
           break;
       }
     },