From c24509087b1193c18ee4c87487b0fc4bf8ee0918 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期一, 22 七月 2024 18:40:26 +0800
Subject: [PATCH] 工单更新

---
 src/api/tigerapi/model/router.ts                                    |   16 +++
 src/assets/icons/workorder.svg                                      |    1 
 src/api/tigerapi/mes/router.ts                                      |   37 +++++++
 src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts |    4 
 src/api/tigerapi/mes/mesApi.ts                                      |    4 
 src/views/tigerprojects/system/lowcode/composition/index.vue        |   13 +
 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts       |   85 +++++++++--------
 src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts   |  111 +++++++++++++--------
 src/views/tigerprojects/system/lowcode/high/index.vue               |    4 
 src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts       |    8 +
 10 files changed, 189 insertions(+), 94 deletions(-)

diff --git a/src/api/tigerapi/mes/mesApi.ts b/src/api/tigerapi/mes/mesApi.ts
index 82d1432..910f124 100644
--- a/src/api/tigerapi/mes/mesApi.ts
+++ b/src/api/tigerapi/mes/mesApi.ts
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-04-27 15:54:50
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-21 17:19:54
+ * @LastEditTime: 2024-07-22 15:43:28
  */
 export enum mesApi {
   GetRoute = '/MES/GetRoute',
@@ -18,8 +18,10 @@
   DeleteMesWs = '/MES/DeleteMesWs',
   SaveRouteNodePost = '/MES/SaveRouteNodePost',
   GetRoutePTree = '/MES/GetRoutePTree',
+  GetWoPTree = '/MES/GetWoPTree',
   RouteToProd = '/MES/RouteToProd',
   RouteToCust = '/MES/RouteToCust',
   SaveMesBatchWo = '/MES/SaveMesBatchWo',
   SP_MES_PROD2WO = '/MES/SP_MES_PROD2WO',
+  SP_MES_WO2CUST = '/MES/SP_MES_WO2CUST',
 }
diff --git a/src/api/tigerapi/mes/router.ts b/src/api/tigerapi/mes/router.ts
index 416f7f1..ff8fc1f 100644
--- a/src/api/tigerapi/mes/router.ts
+++ b/src/api/tigerapi/mes/router.ts
@@ -1,7 +1,7 @@
 import { ApiAction, ApiActionPage } from '../../model/baseModel';
 import { Api, genAction, genActionPage } from '../system';
 import { defHttp } from '/@/utils/http/axios';
-import { MES_ROUTE, MES_ROUTE_NODE_POST, RouteData, V_MES_ROUTE_PTREE } from '../model/router';
+import { MES_ROUTE, MES_ROUTE_NODE_POST, RouteData, V_MES_ROUTE_PTREE, V_MES_WO_PTREE } from '../model/router';
 import { mesApi } from './mesApi';
 import { useUserStore } from '/@/store/modules/user';
 import { RoutePageListGetResultModel, RoutelistPageParams } from '../model/mesModel';
@@ -142,6 +142,25 @@
 }
 
 /**
+ * @description: 鑾峰彇宸ュ崟宸ヨ壓璺嚎鏍戝舰鏁版嵁
+ * @param {string} params
+ * @return {*}
+ */
+export async function GetWoPTree(params: {}) {
+  const data = await defHttp.get<V_MES_WO_PTREE[]>(
+    {
+      url: mesApi.GetWoPTree,
+      params: params,
+    },
+    {
+      errorMessageMode: 'none',
+      isTransformResponse: false,
+    },
+  );
+  return data;
+}
+
+/**
  * @description: 娣诲姞宸ヨ壓绾垮埌浜у搧
  * @param {*} params
  * @return {*}
@@ -188,3 +207,19 @@
   );
   return data;
 };
+
+/**
+ * @description: 娣诲姞宸ヨ壓绾垮埌宸ュ崟鐨勫鎴�
+ * @param {*} params
+ * @return {*}
+ */
+export const SP_MES_WO2CUST = async (params: {}) => {
+  const data = await defHttp.get(
+    { url: mesApi.SP_MES_WO2CUST, params: params },
+    {
+      errorMessageMode: 'none',
+      isTransformResponse: false,
+    },
+  );
+  return data;
+};
diff --git a/src/api/tigerapi/model/router.ts b/src/api/tigerapi/model/router.ts
index 377a3c4..94ab168 100644
--- a/src/api/tigerapi/model/router.ts
+++ b/src/api/tigerapi/model/router.ts
@@ -176,5 +176,21 @@
 	seq: number;
 }
 
+export interface V_MES_WO_PTREE {
+	pid: string;
+	tid: string;
+	id: string;
+	wo: string;
+	prod: string;
+	cust: string;
+	code: string;
+	name: string;
+	type: string;
+	seq: number;
+}
+
+
+
+
 
 
diff --git a/src/assets/icons/workorder.svg b/src/assets/icons/workorder.svg
new file mode 100644
index 0000000..1c3a811
--- /dev/null
+++ b/src/assets/icons/workorder.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1721640411878" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8771" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M706.977994 121.958004 511.913993 121.958004l0-12.213002c0-60.892995-48.679993-109.745003-109.745003-109.745003l-24.426004 0c-60.892995 0-109.745003 48.679993-109.745003 109.745003l0 12.213002L146.211994 121.958004c-26.834201 0-48.679993 22.017806-48.679993 48.679993l0 804.509995c0 26.834201 22.017806 48.679993 48.679993 48.679993l731.403998 0c26.834201 0 48.679993-22.017806 48.679993-48.679993L926.295985 317.022006 706.977994 121.958004zM731.403998 214.501596l119.377793 102.348396-119.377793 0L731.403998 214.501596zM317.022006 109.745003c0-34.058794 26.834201-60.892995 60.892995-60.892995l24.426004 0c34.058794 0 60.892995 26.834201 60.892995 60.892995l0 12.213002-146.211994 0L317.022006 109.745003 317.022006 109.745003zM853.189988 975.320007c-17.029397 0-667.930791 0-682.724005 0-14.621199 0-24.426004-4.816395-24.426004-24.426004 0-19.437594 0-746.025197 0-755.830002 0-9.804804 9.804804-24.426004 24.426004-24.426004 4.816395 0 43.863598 0 97.532001 0l0 304.809004c0 60.892995 48.679993 109.745003 109.745003 109.745003l24.426004 0c60.892995 0 109.745003-48.679993 109.745003-109.745003l0-158.424996c0-14.621199-9.804804-24.426004-24.426004-24.426004s-24.426004 9.804804-24.426004 24.426004l0 158.424996c0 34.058794-26.834201 60.892995-60.892995 60.892995l-24.426004 0c-34.058794 0-60.892995-26.834201-60.892995-60.892995L316.849992 170.637998l146.211994 0 48.679993 0c95.123803 0 170.637998 0 170.637998 0l0 195.064001 195.064001 0c0.172014 112.1532 0.172014 570.570805 0.172014 585.192004C877.615992 967.9234 870.219385 975.320007 853.189988 975.320007z" fill="#EA8010" p-id="8772"></path></svg>
\ No newline at end of file
diff --git a/src/views/tigerprojects/system/lowcode/composition/index.vue b/src/views/tigerprojects/system/lowcode/composition/index.vue
index 1b49c52..5422a86 100644
--- a/src/views/tigerprojects/system/lowcode/composition/index.vue
+++ b/src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-18 23:30:30
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-21 18:03:22
+ * @LastEditTime: 2024-07-22 16:25:39
 -->
 <template>
   <PageWrapper
@@ -99,8 +99,12 @@
   const go = useGo();
   const route = useRoute();
   const { setTitle } = useTabs();
-  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
-  const entityName = ref(objParams.value.Name);
+  // const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
+  const routeParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
+  // 浠巗essionStorage涓鍙栧弬鏁板苟杞崲鍥炲璞�
+  const savedParams = sessionStorage.getItem(`${routeParams.value.sName}_params`);
+  const objParams = savedParams ? ref(JSON.parse(decodeURI(savedParams))) : ref({});
+  const entityName = ref(routeParams.value.Name);
   const useModalData = ref({}); //琛ㄥ崟涓彃妲芥覆鏌撴寜閽墦寮�妯℃�佹useModal鏂规硶
   const useFormData = ref({});
   const cType = ref('');
@@ -110,6 +114,7 @@
   const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense);
   const pageTitle = ref(objParams.value.pageTitle);
   const pageContent = ref(objParams.value.pageContent);
+  const colSlots = ref<any>(objParams.value.colSlots);
   const selectedNodes = ref([]);
   const isMounted = ref(false);
   const showNav = ref(false);
@@ -134,7 +139,7 @@
     if (!isNullOrUnDef(custImport.value)) {
       const [{ GetHomeUrl }] = custImport.value['default']();
       // 鏈緥鐨勬晥鏋滄椂鐐瑰嚮杩斿洖濮嬬粓璺宠浆鍒拌处鍙峰垪琛ㄩ〉锛屽疄闄呭簲鐢ㄦ椂鍙繑鍥炰笂涓�椤�
-      go(GetHomeUrl(entityName.value));
+      go(GetHomeUrl({colSlots:colSlots.value}));
     }
   }
 
diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
index 432efb1..d412c34 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-22 02:58:01
+ * @LastEditTime: 2024-07-22 16:38:10
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -259,18 +259,6 @@
           openRvModal(true, { rotId: selectVals.value['ROUTE_CODE'], slotName: slotName });
           break;
         case 'setRot':
-          const id = {
-            ID: params['record'].ID,
-            Name: 'WoRouteBinding',
-            CODE: params['record'].ITEM_CODE,
-            Title: `宸ュ崟[${params['record'].ITEM_CODE}]宸ヨ壓缁戝畾`,
-            colSlots: [] /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
-            crudColSlots: [] /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
-            dense: true,
-            pageTitle: `宸ュ崟宸ヨ壓缁戝畾`,
-            pageContent: `杩欓噷鏄鐞嗗伐鍗曠殑宸ヨ壓缁戝畾锛屼竴涓伐鍗曞彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛,
-          };
-          go(`/WoRouteBinding/CP/${encodeURI(JSON.stringify(id))}`);
           break;
       }
     },
@@ -407,34 +395,51 @@
    * @return {*}
    */
   function handleConfig(args, params: Recordable) {
-    const openCustModal = args[7];
-    // rotSchema.value = getFormSchema('rotinfo');
-    params['routeData'].value = {
-      nodes: [],
-      edges: [],
+    // const openCustModal = args[7];
+    // // rotSchema.value = getFormSchema('rotinfo');
+    // params['routeData'].value = {
+    //   nodes: [],
+    //   edges: [],
+    // };
+    // initRoute(params['currlf'], params['record'].ROUTE_CODE, params['routeData'], params['currlf']);
+    // getEntity({
+    //   sqlcmd: `ROT_CODE = '${params['record'].ROUTE_CODE}'`,
+    //   entityName: 'MES_ROUTE',
+    //   order: '',
+    // }).then((rot) => {
+    //   params['selectVals'].value['ROUTE_CODE'] = params['record'].ROUTE_CODE;
+    //   params['selectVals'].value['ROT_ID'] =
+    //     !isNullOrEmpty(rot.Data) && !isNullOrEmpty(rot.Data.Items) ? rot.Data.Items[0].ID : '';
+    //   openCustModal(true, {
+    //     isUpdate: true,
+    //     ctype: 'BIZ_MES_WO_Config',
+    //     title: '宸ヨ壓閰嶇疆',
+    //     width: '1200px',
+    //     formEl: params['useFormData'].value, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы
+    //     formElName: ['woinfo', 'prodinfo', 'rotinfo'], //琛ㄥ崟鎻掓Ы鍚嶇О锛屾敮鎸佸涓〃鍗�
+    //     RowKey: '',
+    //     fnName: 'SaveCofig', //淇濆瓨鏂规硶鍚�
+    //     others: params['routeData'].value,
+    //     values: { ...params['record'], ...params['selectVals'].value }, //琛ㄥ崟璁板綍
+    //   });
+    // });
+    const go = args[5];
+    const id = {
+      ID: params['record'].ID,
+      Name: 'WoRouteBinding',
+      CODE: params['record'].ORDER_NO,
+      Title: `宸ュ崟[${params['record'].ORDER_NO}]宸ヨ壓缁戝畾`,
+      colSlots: params['colSlots'].value, /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */
+      crudColSlots: [] /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
+      dense: true,
+      pageTitle: `宸ュ崟宸ヨ壓缁戝畾`,
+      pageContent: `杩欓噷鏄鐞嗗伐鍗曠殑宸ヨ壓缁戝畾锛屼竴涓伐鍗曞彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛,
+      SessionName: 'WoRouteBinding_update',
     };
-    initRoute(params['currlf'], params['record'].ROUTE_CODE, params['routeData'], params['currlf']);
-    getEntity({
-      sqlcmd: `ROT_CODE = '${params['record'].ROUTE_CODE}'`,
-      entityName: 'MES_ROUTE',
-      order: '',
-    }).then((rot) => {
-      params['selectVals'].value['ROUTE_CODE'] = params['record'].ROUTE_CODE;
-      params['selectVals'].value['ROT_ID'] =
-        !isNullOrEmpty(rot.Data) && !isNullOrEmpty(rot.Data.Items) ? rot.Data.Items[0].ID : '';
-      openCustModal(true, {
-        isUpdate: true,
-        ctype: 'BIZ_MES_WO_Config',
-        title: '宸ヨ壓閰嶇疆',
-        width: '1200px',
-        formEl: params['useFormData'].value, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы
-        formElName: ['woinfo', 'prodinfo', 'rotinfo'], //琛ㄥ崟鎻掓Ы鍚嶇О锛屾敮鎸佸涓〃鍗�
-        RowKey: '',
-        fnName: 'SaveCofig', //淇濆瓨鏂规硶鍚�
-        others: params['routeData'].value,
-        values: { ...params['record'], ...params['selectVals'].value }, //琛ㄥ崟璁板綍
-      });
-    });
+    // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
+    sessionStorage.removeItem(`${id.SessionName}_params`);
+    sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id)));
+    go(`/WoRouteBinding/CP/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`);
   }
 
   /**
diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
index e4f26ae..3923c62 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-07-21 18:26:07
+ * @LastEditTime: 2024-07-22 18:21:59
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -197,6 +197,8 @@
           entityName = 'MES_PROD_OPER';
           break;
       }
+      values.AUTH_ORG = useUserStore().getUserInfo.orgCode;
+      values.AUTH_PROD = useUserStore().getUserInfo.prodCode;
       SaveEntity(values, true, entityName).then((action) => {
         if (action.IsSuccessed) {
           emit('success');
diff --git a/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts b/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts
index b639ceb..ff02c43 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-20 21:28:51
+ * @LastEditTime: 2024-07-22 17:51:57
  */
 
 import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -72,8 +72,12 @@
       dense: true,
       pageTitle: `浜у搧宸ヨ壓缁戝畾`,
       pageContent: `杩欓噷鏄鐞嗕骇鍝佺殑宸ヨ壓缁戝畾锛屼竴涓骇鍝佸彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛,
+      SessionName: 'ProdRouteBinding_update',
     };
-    go(`/ProdRouteBinding/CP/${encodeURI(JSON.stringify(id))}`);
+    // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
+    sessionStorage.removeItem(`${id.SessionName}_params`);
+    sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id)));
+    go(`/ProdRouteBinding/CP/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`);
     // let obj = JSON.stringify(id);
     // push({
     //   path: '/ProdRouteBinding',
diff --git a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
index e4f26ae..942ade7 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
@@ -4,11 +4,11 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-21 18:26:07
+ * @LastEditTime: 2024-07-22 18:38:48
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
-import { GetRoutePTree, RouteToCust, RouteToProd } from '/@/api/tigerapi/mes/router';
+import { GetRoutePTree, GetWoPTree, RouteToCust, RouteToProd, SP_MES_PROD2WO, SP_MES_WO2CUST } from '/@/api/tigerapi/mes/router';
 import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system';
 import { useLocale } from '/@/locales/useLocale';
 import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
@@ -46,8 +46,8 @@
     CreateIcon: (params: Recordable<any>) => {
       let icon = '';
       switch (params['type']) {
-        case 'Product':
-          icon = 'similar-product|svg';
+        case 'WorkOrder':
+          icon = 'workorder|svg';
           break;
         case 'Route':
           icon = 'route|svg';
@@ -68,17 +68,17 @@
      * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl
      * @return {*}
      */
-    GetHomeUrl: () => {
-      return `/V_BAS_PROD/LC/${encodeURI(JSON.stringify({ ID: 'V_BAS_PROD', colSlots: [], crudColSlots: [] }))}`;
+    GetHomeUrl: (params: {}) => {
+      return `/BIZ_MES_WO/LC/${encodeURI(JSON.stringify({ ID: 'BIZ_MES_WO', colSlots: params['colSlots'], crudColSlots: [] }))}`;
     },
     /**
      * @description: 鑾峰彇鏍戝舰鏁版嵁
      * @param {string} type
      * @return {*}
      */
-    fetchTreeData: async (type: string, itemCode: string) => {
+    fetchTreeData: async (type: string, wo: string) => {
       let data = { title: '', treeData: [] as any[], fieldNames: {} };
-      let prodTreeData = await GetRoutePTree({prodCode: itemCode, orgCode: useUserStore().getUserInfo.orgCode});
+      let prodTreeData = await GetWoPTree({wo: wo});
       // let uniqueArr = prodTreeData.reduce((acc, current) => {
       //   if (!acc.some((x) => x.pid == current.pid && x.id == current.id && x.seq == current.seq && x.type == current.type)) {
       //     acc.push(current);
@@ -86,7 +86,18 @@
       //   return acc;
       // }, [] as V_MES_ROUTE_PTREE[]);
       data.treeData = convertToTree(prodTreeData, 'pid', 'tid', 'root');
-      data.title = '宸ヨ壓璺嚎';
+      if(data.treeData.length == 0){
+        data.treeData.push({
+          pid: 'root',
+          tid: '',
+          id: '',
+          wo: wo,
+          prod: '',
+          name: wo,
+          type: 'WorkOrder'
+        });
+      }
+      data.title = '宸ュ崟宸ヨ壓璺嚎';
       data.fieldNames = { key: 'tid', title: 'name' };
       return data;
     },
@@ -126,10 +137,7 @@
     }) => {
       let sqlcmd = ' 1=1 ';
       if (!isNullOrEmpty(params['objParams'].value['CODE'])) {
-        sqlcmd += `And PROD_CODE = '${params['objParams'].value['CODE']}'`;
-      }
-      if (!isNullOrEmpty(params['selectedNodes'].value[0].cust)) {
-        sqlcmd += `And CUST_CODE = '${params['selectedNodes'].value[0].cust}'`;
+        sqlcmd += `And WORK_ORDER = '${params['objParams'].value['CODE']}'`;
       }
       if (!isNullOrEmpty(params['selectedNodes'].value[0].id)) {
         sqlcmd +=
@@ -140,7 +148,7 @@
       getEntity({
         sqlcmd: sqlcmd,
         entityName:
-          params['selectedNodes'].value[0].type == 'Action' ? 'MES_PROD_ACTION' : 'MES_PROD_OPER',
+          params['selectedNodes'].value[0].type == 'Action' ? 'MES_WO_ACTION' : 'MES_WO_OPER',
         order: '',
       }).then((res) => {
         params['resetFields']();
@@ -159,9 +167,10 @@
             PKG_CODE: res.Data.Items[0].PKG_CODE,
             ACT_CODE: res.Data.Items[0].ACT_CODE,
             REMARK: res.Data.Items[0].REMARK,
-            PROD_CODE: params['objParams'].value['CODE'],
+            WORK_ORDER: params['objParams'].value['CODE'],
             ACT_TYPE: res.Data.Items[0].ACT_TYPE,
             CUST_CODE: params['selectedNodes'].value[0].cust,
+            PROD_CODE: params['selectedNodes'].value[0].prod,
           });
         }
         if (params['selectedNodes'].value[0].type == 'Node') {
@@ -177,8 +186,9 @@
             IS_INPUT: res.Data.Items[0].IS_INPUT,
             IS_OUTPUT: res.Data.Items[0].IS_OUTPUT,
             REMARK: res.Data.Items[0].REMARK,
-            PROD_CODE: params['objParams'].value['CODE'],
+            WORK_ORDER: params['objParams'].value['CODE'],
             CUST_CODE: params['selectedNodes'].value[0].cust,
+            PROD_CODE: params['selectedNodes'].value[0].prod,
           });
         }
       });
@@ -191,12 +201,14 @@
       let entityName = '';
       switch (type) {
         case 'Action':
-          entityName = 'MES_PROD_ACTION';
+          entityName = 'MES_WO_ACTION';
           break;
         case 'Node':
-          entityName = 'MES_PROD_OPER';
+          entityName = 'MES_WO_OPER';
           break;
       }
+      values.AUTH_ORG = useUserStore().getUserInfo.orgCode;
+      values.AUTH_PROD = useUserStore().getUserInfo.prodCode;
       SaveEntity(values, true, entityName).then((action) => {
         if (action.IsSuccessed) {
           emit('success');
@@ -269,7 +281,7 @@
           var i;
           for (i = 0; i < codes.length; i++) {
             if (d.which == 'addRoute') {
-              RouteToProd({ rotId: codes[i], prodCode: args[1]['CODE'] });
+              SP_MES_PROD2WO({ rotId: codes[i], wo: args[1]['CODE'] });
             }
           }
 
@@ -279,15 +291,11 @@
           if (isNullOrEmpty(args[1]['CODE'])) {
             createErrorModal({
               title: t('sys.api.errorTip'),
-              content: '浜у搧涓虹┖锛屼笉鑳芥坊鍔犲伐鑹鸿矾绾匡紝璇风偣鍑诲乏渚ч�夋嫨浜у搧',
+              content: '宸ュ崟涓虹┖锛屼笉鑳芥坊鍔犲伐鑹鸿矾绾匡紝璇风偣鍑诲乏渚ч�夋嫨宸ュ崟',
             });
             return;
           }
-          let rotIds = d.ROT_ID.split(',');
-          var i;
-          for (i = 0; i < rotIds.length; i++) {
-            RouteToCust({ rotId: rotIds[i], prodCode: args[1]['CODE'], custCode: d.CUST_CODE });
-          }
+          SP_MES_WO2CUST({ wo: args[1]['CODE']});
 
           args[2]();
           break;
@@ -331,7 +339,7 @@
       if (isNullOrUnDef(selectedNodes)) {
         return result;
       }
-      if (selectedNodes.value[0].type == 'Product' || selectedNodes.value[0].type == 'Route') {
+      if (selectedNodes.value[0].type == 'WorkOrder' || selectedNodes.value[0].type == 'Route') {
         result.showNav = true;
         result.showConfig = false;
       }
@@ -348,7 +356,7 @@
     GetNavItems: (type: string) => {
       let item: NavItem[] = [];
       switch (type) {
-        case 'Product':
+        case 'WorkOrder':
           item = [
             {
               title: '娣诲姞浜у搧宸ヨ壓璺嚎',
@@ -358,14 +366,14 @@
               action: 'addRoute',
               isStep: false,
             },
-            {
-              title: '娣诲姞瀹㈡埛宸ヨ壓璺嚎',
-              icon: 'add_customer|svg',
-              color: '#bf0c2c',
-              url: '/addCustomer',
-              action: 'addCustomer',
-              isStep: true,
-            },
+            // {
+            //   title: '娣诲姞瀹㈡埛宸ヨ壓璺嚎',
+            //   icon: 'add_customer|svg',
+            //   color: '#bf0c2c',
+            //   url: '/addCustomer',
+            //   action: 'addCustomer',
+            //   isStep: true,
+            // },
           ];
           break;
         case 'Route':
@@ -427,9 +435,14 @@
           });
           break;
         case 'addCustomer':
-          args[0](true, {
-            title: '璇峰畬鎴愪互涓嬫楠�',
-          });
+          if (isNullOrEmpty(args[2][0]['wo'])) {
+            createErrorModal({
+              title: t('sys.api.errorTip'),
+              content: '宸ュ崟涓虹┖锛屼笉鑳芥坊鍔犲伐鑹鸿矾绾匡紝璇风偣鍑诲乏渚ч�夋嫨宸ュ崟',
+            });
+            return;
+          }
+          SP_MES_WO2CUST({ wo: args[2][0]['wo']});
           break;
         case 'editRoute':
           args[1](true, { rotId: args[2][0].id, slotName: '' });
@@ -649,13 +662,19 @@
    */
   const actionFormShema: FormSchema[] = [
     {
-      field: 'PROD_CODE',
-      label: '浜у搧缂栫爜',
+      field: 'WORK_ORDER',
+      label: '宸ュ崟鍙�',
       component: 'Input',
       dynamicDisabled: ({ values }) => {
         return true;
       },
       colProps: { span: 12 },
+    },
+    {
+      field: 'PROD_CODE',
+      label: 'PROD_CODE',
+      component: 'Input',
+      show: false,
     },
     {
       field: 'ID',
@@ -704,7 +723,7 @@
       defaultValue: 0,
       componentProps: {
         api: GetEnum,
-        params: { name: 'MES_PROD_ACTION+ACT_TYPEs' },
+        params: { name: 'MES_WO_ACTION+ACT_TYPEs' },
         resultField: 'Data',
         labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
         valueField: 'Value',
@@ -845,8 +864,8 @@
    */
   const nodeFormShema: FormSchema[] = [
     {
-      field: 'PROD_CODE',
-      label: '浜у搧缂栫爜',
+      field: 'WORK_ORDER',
+      label: '宸ュ崟鍙�',
       component: 'Input',
       dynamicDisabled: ({ values }) => {
         return true;
@@ -854,6 +873,12 @@
       colProps: { span: 12 },
     },
     {
+      field: 'PROD_CODE',
+      label: 'PROD_CODE',
+      component: 'Input',
+      show: false,
+    },
+    {
       field: 'ID',
       label: 'ID',
       component: 'Input',
diff --git a/src/views/tigerprojects/system/lowcode/high/index.vue b/src/views/tigerprojects/system/lowcode/high/index.vue
index 2abbdca..c8e89c7 100644
--- a/src/views/tigerprojects/system/lowcode/high/index.vue
+++ b/src/views/tigerprojects/system/lowcode/high/index.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-18 15:09:48
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-21 18:04:06
+ * @LastEditTime: 2024-07-22 16:02:35
 -->
 <!--
  *                        _oo0oo_
@@ -139,10 +139,10 @@
   }
   const currentTab = getCurrentTab();
   const routeParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
-  const entityName = ref(routeParams.value.Name);
   // 浠巗essionStorage涓鍙栧弬鏁板苟杞崲鍥炲璞�
   const savedParams = sessionStorage.getItem(`${routeParams.value.sName}_params`);
   const objParams = savedParams ? ref(JSON.parse(decodeURI(savedParams))) : ref({});
+  const entityName = ref(routeParams.value.Name);
   const titleInfo = ref({}); //getTitle(objParams.value.Name);
   const isAllUpdate = ref(objParams.value.CODE != '0');
   const globSetting = useGlobSetting();

--
Gitblit v1.9.3