From ea7ed4e30392e7f23925c0085d40df29fc1aac2b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 13 八月 2024 21:04:06 +0800
Subject: [PATCH] 产品、工单绑定工艺路线更新

---
 src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue   |    4 +++-
 src/views/components/RouteViewModal.vue                             |    9 ++++++---
 src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts |    4 ++--
 src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts   |    4 ++--
 src/views/tigerprojects/mes/eng/route/index.vue                     |   24 ++++++++++++++++++++----
 5 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/src/views/components/RouteViewModal.vue b/src/views/components/RouteViewModal.vue
index 22dbb02..f514f9c 100644
--- a/src/views/components/RouteViewModal.vue
+++ b/src/views/components/RouteViewModal.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-18 15:09:48
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-04 16:34:13
+ * @LastEditTime: 2024-08-13 20:38:51
 -->
 <template>
   <BasicModal
@@ -16,7 +16,7 @@
     :width="width"
   >
     <!-- 杩欓噷宓屽叆router-view鏉ュ睍绀鸿矾鐢遍〉闈� -->
-    <Route_View :rotId="rotId" :rotType="rotType" />
+    <Route_View :rotId="rotId" :rotType="rotType" :prodCode="prodCode" :custCode="custCode" />
   </BasicModal>
 </template>
 <script lang="ts" setup>
@@ -32,6 +32,8 @@
   const width = ref('');
   const rotId = ref('');
   const rotType = ref('');
+  const prodCode = ref('');
+  const custCode = ref('');
   const submitFn = ref('');
   const slotName = ref('');
 
@@ -39,9 +41,10 @@
     setModalProps({ confirmLoading: false, cancelText: '鍏抽棴', showOkBtn: false });
     rotId.value = data?.rotId;
     rotType.value = data?.rotType;
+    prodCode.value = data?.prodCode;
+    custCode.value = data?.custCode;
     slotName.value = data?.slotName;
     submitFn.value = data?.submitFn; //'rvSubmit'
-
   });
 
   onMounted(() => {});
diff --git a/src/views/tigerprojects/mes/eng/route/index.vue b/src/views/tigerprojects/mes/eng/route/index.vue
index c7e85c1..8d3522d 100644
--- a/src/views/tigerprojects/mes/eng/route/index.vue
+++ b/src/views/tigerprojects/mes/eng/route/index.vue
@@ -109,13 +109,17 @@
   provide<Ref<IRouteConfig>>('routeConfig', routeConfig as unknown as Ref<IRouteConfig>);
   provide<Ref<MES_ROUTE>>('mesRoute', currRoute);
   const selectnode = ref({} as node);
-  const currRotId = ref(route.params?.id);
+  const currRotId = ref('');
+  const prodCode = ref('');
+  const custCode = ref('');
   const colSlots = ref<any>([]);
   const crudColSlots = ref<any>([]);
   const entityName = ref<any>('MES_POSITION');
   const props = defineProps({
     rotId: { type: String, default: '' },
     rotType: { type: String, default: 'Route' },
+    prodCode: { type: String, default: '' },
+    custCode: { type: String, default: '' },
   });
   const IsOperation = ref(false);
   const title = ref('');
@@ -123,10 +127,10 @@
   let _num = 1;
   let _numEdge = 1;
   watch(
-    () => props.rotId,
+    [() => props.rotId,()=> props.prodCode, () => props.custCode],
     (v) => {
-      if (!isNullOrEmpty(v) && v !== currRotId.value) {
-        currRotId.value = v;
+      if (!isNullOrEmpty(v[0]) && v[0] !== currRotId.value) {
+        currRotId.value = v[0];
         if (!isNullOrUnDef(unref(currlf))) {
           unref(currlf).render({});
           routeData.value = {
@@ -135,6 +139,12 @@
           };
           init(currlf);
         }
+      }
+      if (!isNullOrEmpty(v[1]) && v[1] !== prodCode.value) {
+        prodCode.value = v[1];
+      }
+      if (!isNullOrEmpty(v[2]) && v[2] !== custCode.value) {
+        custCode.value = v[2];
       }
     },
     { deep: true },
@@ -166,6 +176,12 @@
       if (!isNullOrEmpty(currRotId.value) && isNullOrEmpty(props.rotId)) {
         setTitle('璁捐锛氬伐鑹鸿矾绾�-' + currRoute.value.ROT_CODE);
       }
+      if(!isNullOrEmpty(prodCode.value)){
+        currRoute.value.PROD_CODE = !isNullOrEmpty(currRoute.value.PROD_CODE)?currRoute.value.PROD_CODE: prodCode.value;
+      }
+      if(!isNullOrEmpty(custCode.value)){
+        currRoute.value.CUST_CODE = !isNullOrEmpty(currRoute.value.CUST_CODE)?currRoute.value.CUST_CODE: custCode.value;
+      }
       _data.Data.nodes.forEach((n) => {
         n.node.properties = JSON.parse(n.node.properties);
         n['node']['text']['value'] = n.NODE_NAME;
diff --git a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
index b5cef7c..fdd4661 100644
--- a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
+++ b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-20 12:13:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-01 19:26:30
+ * @LastEditTime: 2024-08-13 20:29:17
 -->
 <template>
   <Card :title="GetTitle(props.configType)['navTitle']">
@@ -17,6 +17,7 @@
           useModalData[item.action][1].openModal,
           openRvModal,
           selectedNodes,
+          keyCode
         )
       "
     >
@@ -68,6 +69,7 @@
     configType: { type: String },
     nodes: { type: Array as PropType<any[]> },
   });
+  const keyCode = ref(objParams.value['CODE']);
   const custImport = ref<any[]>([]);
   const EntityCustFunction = ref([
     {
diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
index 4706492..99b8b85 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-09 01:14:01
+ * @LastEditTime: 2024-08-13 20:27:09
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -644,7 +644,7 @@
           });
           break;
         case 'editRoute':
-          args[1](true, { rotId: args[2][0].id, slotName: '' });
+          args[1](true, { rotId: args[2][0].id, slotName: '', prodCode:args[3],custCode:args[2][0].cust });
           break;
       }
     },
diff --git a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
index 92ff1d9..04b3481 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-13 16:05:42
+ * @LastEditTime: 2024-08-13 20:53:26
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -658,7 +658,7 @@
           SP_MES_WO2CUST({ wo: args[2][0]['wo'] });
           break;
         case 'editRoute':
-          args[1](true, { rotId: args[2][0].wo, slotName: '', rotType: 'Wo' });
+          args[1](true, { rotId: args[2][0].wo, slotName: '', rotType: 'Wo', prodCode:args[3],custCode:args[2][0].cust });
           break;
       }
     },

--
Gitblit v1.9.3