From 3f3817a39238b262155cd5ec76fa351bb344602d Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 01 一月 2025 21:33:57 +0800
Subject: [PATCH] 打印工单流程卡

---
 src/views/tigerprojects/mes/eng/route/index.vue |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/views/tigerprojects/mes/eng/route/index.vue b/src/views/tigerprojects/mes/eng/route/index.vue
index 03adab4..3d8a93c 100644
--- a/src/views/tigerprojects/mes/eng/route/index.vue
+++ b/src/views/tigerprojects/mes/eng/route/index.vue
@@ -359,8 +359,8 @@
             if (unref(lf).getNodeIncomingNode(n.id).length == 0) {
               node.IS_FIRST_NODE = 'Y';
               nd.IS_FIRST_NODE = 'Y';
-              node.IS_INPUT = 'Y'; 
-              nd.IS_INPUT = 'Y'; 
+              node.IS_INPUT = 'Y';
+              nd.IS_INPUT = 'Y';
             }
             currRotData.nodes.push(node);
           }
@@ -427,20 +427,34 @@
       });
     } else {
       var hasError = false;
+      let msg = '';
       unref(lf)
         .getGraphData()
         .nodes.forEach((n) => {
+          /* 鍒ゆ柇鏄惁鏈塏ode鏈繛鎺� */
           if (
             unref(lf).getNodeIncomingEdge(n.id).length == 0 &&
             unref(lf).getNodeOutgoingEdge(n.id).length == 0
           ) {
             hasError = true;
+            msg = '鏈夎妭鐐规湭杩炵嚎锛岃閲嶆柊璁捐宸ヨ壓璺嚎鍐嶄繚瀛樻暟鎹紒';
+          }
+          if (
+            unref(lf)
+              .getNodeOutgoingNode(n.id)
+              .some((q) => q.properties.operType == 'End') &&
+            unref(lf)
+              .getNodeOutgoingNode(n.id)
+              .some((q) => q.properties.operType != 'End' && q.properties.operType != 'Action')
+          ) {
+            hasError = true;
+            msg = '瀹屽伐鑺傜偣涓嶆槸鍞竴鐨勬渶鍚庤妭鐐癸紝璇烽噸鏂拌璁″伐鑹鸿矾绾垮啀淇濆瓨鏁版嵁锛�';
           }
         });
       if (hasError) {
         createErrorModal({
           title: t('璀﹀憡'),
-          content: t('鏈夎妭鐐规湭杩炵嚎锛岃閲嶆柊璁捐宸ヨ壓璺嚎鍐嶄繚瀛樻暟鎹紒'),
+          content: t(msg),
           getContainer: () => document.body,
         });
       } else {
@@ -718,7 +732,12 @@
           getContainer: () => document.body,
         });
       } else {
-        if (unref(lf).getNodeIncomingNode(data.nodeModel.id).length == 0) {
+        if (
+          unref(lf).getNodeIncomingNode(data.nodeModel.id).length == 0 &&
+          unref(lf)
+            .getNodeOutgoingNode(data.nodeModel.id)
+            .some((q) => q.properties.operType == 'Node')
+        ) {
           lf.graphModel.deleteEdgeById(data.edgeModel.id);
           createErrorModal({
             title: t('璀﹀憡'),

--
Gitblit v1.9.3