From 54bd2e89b8689e9aa8ab6edcda003da46065cb19 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 04 八月 2024 18:44:55 +0800
Subject: [PATCH] 工单工艺路线编辑

---
 src/api/tigerapi/model/router.ts                                    |   14 +
 src/api/tigerapi/mes/router.ts                                      |   67 ++++
 src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts   |    3 
 src/api/tigerapi/mes/mesApi.ts                                      |    7 
 src/views/tigerprojects/system/lowcode/data.ts                      |    8 
 src/views/tigerprojects/mes/eng/route/components/PostProps.vue      |   40 +-
 src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts   |    4 
 src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts       |    4 
 src/views/tigerprojects/system/lowcode/composition/Config.vue       |   10 
 src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts    |    4 
 src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue        |    4 
 src/views/tigerprojects/mes/eng/route/index.vue                     |   57 ++++
 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts   |    4 
 src/views/tigerprojects/system/lowcode/high/dtl.vue                 |    4 
 src/views/components/RouteViewModal.vue                             |    7 
 src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts |   51 ++-
 src/views/tigerprojects/system/lowcode/detail/detail.vue            |    6 
 src/views/tigerprojects/mes/eng/route/typings/v-form-component.ts   |    1 
 src/views/tigerprojects/system/lowcode/composition/index.vue        |   20 +
 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts       |    7 
 src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts   |  438 +++++++++++++++++++++++++++------
 21 files changed, 607 insertions(+), 153 deletions(-)

diff --git a/src/api/tigerapi/mes/mesApi.ts b/src/api/tigerapi/mes/mesApi.ts
index 80d8944..7f736f3 100644
--- a/src/api/tigerapi/mes/mesApi.ts
+++ b/src/api/tigerapi/mes/mesApi.ts
@@ -4,11 +4,15 @@
  * @version: 
  * @Date: 2024-04-27 15:54:50
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-29 21:17:12
+ * @LastEditTime: 2024-08-04 18:03:42
  */
 export enum mesApi {
   GetRoute = '/MES/GetRoute',
   GetRouteData = '/MES/GetRouteData',
+  GetWoRouteData = '/MES/GetWoRouteData',
+  SaveRouteNodePost = '/MES/SaveRouteNodePost',
+  SaveWoRouteNodePost = '/MES/SaveWoRouteNodePost',
+  SaveWoRouteData = '/MES/SaveWoRouteData',
   SaveRouteData = '/MES/SaveRouteData',
   SaveRoute = '/MES/SaveRoute',
   DeleteRoute = '/MES/DeleteRoute',
@@ -16,7 +20,6 @@
   DeleteMesWo = '/MES/DeleteMesWo',
   SaveMesWs = '/MES/SaveMesWs',
   DeleteMesWs = '/MES/DeleteMesWs',
-  SaveRouteNodePost = '/MES/SaveRouteNodePost',
   GetRoutePTree = '/MES/GetRoutePTree',
   GetWoPTree = '/MES/GetWoPTree',
   RouteToProd = '/MES/RouteToProd',
diff --git a/src/api/tigerapi/mes/router.ts b/src/api/tigerapi/mes/router.ts
index bb072e0..a0b388f 100644
--- a/src/api/tigerapi/mes/router.ts
+++ b/src/api/tigerapi/mes/router.ts
@@ -5,10 +5,11 @@
 import { mesApi } from './mesApi';
 import { useUserStore } from '/@/store/modules/user';
 import { DelProdRotInput, DelWoRotInput, RoutePageListGetResultModel, RoutelistPageParams } from '../model/mesModel';
-import { StringLiteral } from 'typescript';
 
-/*
- * 鑾峰彇宸ヨ壓璺嚎鍒楄〃
+/**
+ * @description: 鑾峰彇宸ヨ壓璺嚎鍒楄〃
+ * @param {string} route_code
+ * @return {*}
  */
 export function getRouteData(route_code: string) {
   const params = genAction('', route_code);
@@ -29,6 +30,29 @@
 }
 
 /**
+ * @description: 鑾峰彇宸ュ崟宸ヨ壓璺嚎鍒楄〃
+ * @param {string} route_code
+ * @return {*}
+ */
+export function getWoRouteData(route_code: string) {
+  const params = genAction('', route_code);
+  return getWoRotApi(params);
+}
+async function getWoRotApi(params: ApiAction<string>) {
+  const data = await defHttp.post<ApiAction<RouteData>>(
+    {
+      url: mesApi.GetWoRouteData,
+      params,
+    },
+    {
+      errorMessageMode: 'modal',
+      isTransformResponse: false,
+    },
+  );
+  return data;
+}
+
+/**
  * @description: 淇濆瓨宸ヨ壓璺嚎
  * @param {RouteData} params
  * @return {*}
@@ -36,6 +60,22 @@
 export const SaveRouteData = async (params: RouteData) => {
   const data = await defHttp.post(
     { url: mesApi.SaveRouteData, params: genAction('', params) },
+    {
+      errorMessageMode: 'none',
+      isTransformResponse: false,
+    },
+  );
+  return data;
+};
+
+/**
+ * @description: 淇濆瓨宸ュ崟宸ヨ壓璺嚎
+ * @param {RouteData} params
+ * @return {*}
+ */
+export const SaveWoRouteData = async (params: RouteData) => {
+  const data = await defHttp.post(
+    { url: mesApi.SaveWoRouteData, params: genAction('', params) },
     {
       errorMessageMode: 'none',
       isTransformResponse: false,
@@ -143,6 +183,11 @@
     },
   );
 
+/**
+ * @description: 淇濆瓨宸ヨ壓璺嚎鐨勫矖浣嶈祫婧�
+ * @param {MES_ROUTE_NODE_POST} params
+ * @return {*}
+ */  
 export const SaveRouteNodePost = async (params: MES_ROUTE_NODE_POST[]) => {
   const data = await defHttp.post(
     { url: mesApi.SaveRouteNodePost, params: genAction('MES_ROUTE_NODE_POST', params) },
@@ -155,6 +200,22 @@
 };
 
 /**
+ * @description: 淇濆瓨宸ュ崟宸ヨ壓璺嚎鐨勫矖浣嶈祫婧�
+ * @param {MES_ROUTE_NODE_POST} params
+ * @return {*}
+ */  
+export const SaveWoRouteNodePost = async (params: MES_ROUTE_NODE_POST[]) => {
+  const data = await defHttp.post(
+    { url: mesApi.SaveWoRouteNodePost, params: genAction('MES_WO_NODE_POST', params) },
+    {
+      errorMessageMode: 'none',
+      isTransformResponse: false,
+    },
+  );
+  return data;
+};
+
+/**
  * @description: 鑾峰彇浜у搧宸ヨ壓璺嚎鏍戝舰鏁版嵁
  * @param {string} params
  * @return {*}
diff --git a/src/api/tigerapi/model/router.ts b/src/api/tigerapi/model/router.ts
index 05cb5bf..0477bb5 100644
--- a/src/api/tigerapi/model/router.ts
+++ b/src/api/tigerapi/model/router.ts
@@ -1,3 +1,5 @@
+import { BIZ_MES_WO } from "./mesModel";
+
 export interface MES_ROUTE {
   ID: string;
   CREATE_TIME: Date;
@@ -12,6 +14,9 @@
   ROT_NAME: string;
   ROT_TYPE: number;
   ROT_VER: number;
+  WORK_ORDER: string;
+  PROD_CODE: string;
+  CUST_CODE: string;
   IS_ACTIVE: string;
   REMARK: string;
 }
@@ -28,6 +33,9 @@
   AUTH_WH: string;
   NODE_NAME: string;
   ROT_ID: string;
+  WORK_ORDER: string;
+  PROD_CODE: string;
+  CUST_CODE: string;
   SEGMENT: string;
   OPER_CODE: string;
   GPH_TYPE: string;
@@ -63,6 +71,9 @@
   AUTH_WH: string;
   EDGE_NAME: string;
   ROT_ID: string;
+  WORK_ORDER: string;
+  PROD_CODE: string;
+  CUST_CODE: string;
   SRC_NODE: string;
   TGT_NODE: string;
   GPH_TYPE: string;
@@ -94,6 +105,9 @@
   AUTH_WH: string;
   ACT_NAME: string;
   ROT_ID: string;
+  WORK_ORDER: string;
+  PROD_CODE: string;
+  CUST_CODE: string;
   NODE_ID: string;
   ACT_CODE: string;
   ACT_TYPE: number;
diff --git a/src/views/components/RouteViewModal.vue b/src/views/components/RouteViewModal.vue
index 67ad86e..22dbb02 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-07-03 21:00:23
+ * @LastEditTime: 2024-08-04 16:34:13
 -->
 <template>
   <BasicModal
@@ -16,7 +16,7 @@
     :width="width"
   >
     <!-- 杩欓噷宓屽叆router-view鏉ュ睍绀鸿矾鐢遍〉闈� -->
-    <Route_View :rotId="rotId" />
+    <Route_View :rotId="rotId" :rotType="rotType" />
   </BasicModal>
 </template>
 <script lang="ts" setup>
@@ -31,14 +31,17 @@
   const title = ref('');
   const width = ref('');
   const rotId = ref('');
+  const rotType = ref('');
   const submitFn = ref('');
   const slotName = ref('');
 
   const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
     setModalProps({ confirmLoading: false, cancelText: '鍏抽棴', showOkBtn: false });
     rotId.value = data?.rotId;
+    rotType.value = data?.rotType;
     slotName.value = data?.slotName;
     submitFn.value = data?.submitFn; //'rvSubmit'
+
   });
 
   onMounted(() => {});
diff --git a/src/views/tigerprojects/mes/eng/route/components/PostProps.vue b/src/views/tigerprojects/mes/eng/route/components/PostProps.vue
index 9574d2e..c766dae 100644
--- a/src/views/tigerprojects/mes/eng/route/components/PostProps.vue
+++ b/src/views/tigerprojects/mes/eng/route/components/PostProps.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-11 21:07:04
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-26 08:48:12
+ * @LastEditTime: 2024-08-04 18:34:26
 -->
 <!--
  * @Description: 鍙充晶灞炴�ч潰鏉挎帶浠� 琛ㄥ崟灞炴�ч潰鏉�
@@ -28,6 +28,7 @@
                 placement: 'left',
                 confirm: handleDelete.bind(null, record),
               },
+              name: '',
             },
           ]"
         />
@@ -45,15 +46,10 @@
   import { useModal } from '/@/components/Modal';
   import GeneralModal from '/@/views/components/GeneralModal.vue';
   import { useI18n } from '/@/hooks/web/useI18n';
-  import {
-    DeleteEntity,
-    DeleteWhere,
-    SaveEntity,
-    getEntity,
-    getListByPage,
-  } from '/@/api/tigerapi/system';
+  import { DeleteWhere, getListByPage } from '/@/api/tigerapi/system';
   import { useRouteDesignState } from '../hooks/useRouteDesignState';
-  import { SaveRouteNodePost } from '/@/api/tigerapi/mes/router';
+  import { SaveRouteNodePost, SaveWoRouteNodePost } from '/@/api/tigerapi/mes/router';
+  import { WORD_BREAK } from 'html2canvas/dist/types/css/property-descriptors/word-break';
 
   const { t } = useI18n();
   const { routeConfig, mesRoute } = useRouteDesignState();
@@ -81,7 +77,9 @@
   const [registerTable, { reload }] = useTable({
     title: '鍒楄〃',
     api: getListByPage,
-    searchInfo: { TABLE_NAME: 'V_MES_ROUTE_NODE_POST', NODE_ID: routeConfig.currentItem.ID },
+    searchInfo: routeConfig['isWorkOrder']
+      ? { TABLE_NAME: 'V_MES_WO_NODE_POST', NODE_ID: routeConfig['currentItem'].ID }
+      : { TABLE_NAME: 'V_MES_ROUTE_NODE_POST', NODE_ID: routeConfig['currentItem'].ID },
     columns,
     useSearchForm: false,
     showTableSetting: false,
@@ -164,9 +162,10 @@
    * @return {*}
    */
   function handleDelete(record: Recordable) {
+    let entityName = routeConfig['isWorkOrder'] ? 'MES_WO_NODE_POST' : 'MES_ROUTE_NODE_POST';
     DeleteWhere(
       `POST_CODE = '${record.POST_CODE}' And NODE_ID = '${record.NODE_ID}'`,
-      'MES_ROUTE_NODE_POST',
+      entityName,
     ).then((res) => {
       reload();
     });
@@ -183,10 +182,21 @@
     let eintity: any[] = [];
     var i;
     for (i = 0; i < codes.length; i++) {
-      eintity.push({ NODE_ID: routeConfig.currentItem.ID, POST_CODE: codes[i], REMARK: '' });
+      eintity.push({
+        NODE_ID: routeConfig['currentItem'].ID,
+        POST_CODE: codes[i],
+        REMARK: '',
+        WORK_ORDER: routeConfig['currentItem'].WORK_ORDER,
+      });
     }
-    SaveRouteNodePost(eintity).then((res) => {
-      reload();
-    });
+    if (routeConfig['isWorkOrder']) {
+      SaveWoRouteNodePost(eintity).then((res) => {
+        reload();
+      });
+    } else {
+      SaveRouteNodePost(eintity).then((res) => {
+        reload();
+      });
+    }
   }
 </script>
diff --git a/src/views/tigerprojects/mes/eng/route/index.vue b/src/views/tigerprojects/mes/eng/route/index.vue
index 5d67837..c7e85c1 100644
--- a/src/views/tigerprojects/mes/eng/route/index.vue
+++ b/src/views/tigerprojects/mes/eng/route/index.vue
@@ -47,7 +47,12 @@
 <script lang="ts" setup>
   import { FlowChart } from '/@/components/FlowChart';
   import { PageWrapper } from '/@/components/Page';
-  import { SaveRouteData, getRouteData } from '/@/api/tigerapi/mes/router';
+  import {
+    SaveRouteData,
+    SaveWoRouteData,
+    getRouteData,
+    getWoRouteData,
+  } from '/@/api/tigerapi/mes/router';
   import { useModal } from '/@/components/Modal';
   import RouteModal from './RouteModal.vue';
   import { onMounted, ref, unref, Ref, provide, reactive, nextTick, watch } from 'vue';
@@ -94,6 +99,7 @@
     currentAct: {} as MES_ROUTE_NODE_ACT,
     routeData: {} as RouteData,
     activeKey: 1,
+    isWorkOrder: false,
   });
   const currRoute = ref({} as MES_ROUTE);
   const routeData = ref({
@@ -109,6 +115,7 @@
   const entityName = ref<any>('MES_POSITION');
   const props = defineProps({
     rotId: { type: String, default: '' },
+    rotType: { type: String, default: 'Route' },
   });
   const IsOperation = ref(false);
   const title = ref('');
@@ -118,7 +125,7 @@
   watch(
     () => props.rotId,
     (v) => {
-      if (v !== currRotId.value) {
+      if (!isNullOrEmpty(v) && v !== currRotId.value) {
         currRotId.value = v;
         if (!isNullOrUnDef(unref(currlf))) {
           unref(currlf).render({});
@@ -145,7 +152,11 @@
   async function init(lf) {
     currlf.value = unref(lf);
     //閫氳繃宸ヨ壓璺嚎ID鑾峰彇鍥惧舰鏁版嵁锛屽苟娓叉煋
-    var _data = await getRouteData(currRotId.value);
+    routeConfig.isWorkOrder = props.rotType == 'Wo';
+    var _data =
+      props.rotType == 'Route'
+        ? await getRouteData(currRotId.value)
+        : await getWoRouteData(currRotId.value);
     console.log('缁勪欢宸叉寕杞�', _data);
     //宸ヨ壓璺嚎鍏ㄤ俊鎭紝鍖呮嫭Node銆丒dge鍜孉ct
     routeConfig.routeData = _data.Data;
@@ -174,6 +185,11 @@
     }
   }
 
+  /**
+   * @description: 鑾峰彇宸ヨ壓璺嚎鍥炬暟鎹�
+   * @param {*} lf
+   * @return {*}
+   */
   const GetRotData = (lf) => {
     var currRotData: RouteData = {
       route: {
@@ -192,6 +208,9 @@
         AUTH_ORG: useUserStore().getUserInfo.orgCode,
         AUTH_PROD: '',
         AUTH_WH: '',
+        WORK_ORDER: currRoute.value.WORK_ORDER,
+        PROD_CODE: currRoute.value.PROD_CODE,
+        CUST_CODE: currRoute.value.CUST_CODE,
       },
       nodes: [],
       edges: [],
@@ -244,6 +263,9 @@
               // DO_IF_FAIL: a.DO_IF_FAIL,
               node: {} as node,
               IS_ACTIVE: a.IS_ACTIVE,
+              WORK_ORDER: a.WORK_ORDER,
+              PROD_CODE: a.PROD_CODE,
+              CUST_CODE: a.CUST_CODE,
             };
             var pnode = [n];
             while (pnode[0].properties.operType == 'Action') {
@@ -294,6 +316,9 @@
               OPTION_4: '',
               OPTION_5: '',
               node: {} as node,
+              WORK_ORDER: nd.WORK_ORDER,
+              PROD_CODE: nd.PROD_CODE,
+              CUST_CODE: nd.CUST_CODE,
             };
             nd.GPH_TYPE = n.type;
             nd.GPH_PROP = JSON.stringify(n.properties);
@@ -342,6 +367,9 @@
         OPTION_4: '',
         OPTION_5: '',
         edge: {} as edge,
+        WORK_ORDER: routeConfig.routeData.route.WORK_ORDER,
+        PROD_CODE: routeConfig.routeData.route.PROD_CODE,
+        CUST_CODE: routeConfig.routeData.route.CUST_CODE,
       };
       routeConfig.routeData.edges.push(edge);
       currRotData.edges.push(edge);
@@ -355,7 +383,10 @@
    */
   async function handleSave(lf) {
     console.log('handleSave', unref(lf).getGraphData().nodes[0]);
-    if (isNullOrEmpty(currRoute.value.ROT_CODE)) {
+    if (
+      isNullOrEmpty(currRoute.value.ROT_CODE) ||
+      (props.rotType == 'Wo' && isNullOrEmpty(currRoute.value.WORK_ORDER))
+    ) {
       createErrorModal({
         title: t('鏈�夋嫨'),
         content: t('鏈�夋嫨宸ヨ壓璺嚎鎴栬�呮柊澧炲伐鑹鸿矾绾�'),
@@ -380,7 +411,10 @@
           getContainer: () => document.body,
         });
       } else {
-        var action = await SaveRouteData(GetRotData(lf));
+        var action =
+          props.rotType == 'Wo'
+            ? await SaveWoRouteData(GetRotData(lf))
+            : await SaveRouteData(GetRotData(lf));
         if (action.IsSuccessed) {
           await refreshPage();
         }
@@ -455,6 +489,9 @@
         OPTION_4: '',
         OPTION_5: '',
         node: {} as node,
+        WORK_ORDER: currRoute.value.WORK_ORDER,
+        PROD_CODE: currRoute.value.PROD_CODE,
+        CUST_CODE: currRoute.value.CUST_CODE,
       };
       routeConfig.routeData.nodes.push(_node);
       _num++;
@@ -504,6 +541,9 @@
           OPTION_5: '',
           REMARK: '',
           node: {} as node,
+          WORK_ORDER: currRoute.value.WORK_ORDER,
+          PROD_CODE: currRoute.value.PROD_CODE,
+          CUST_CODE: currRoute.value.CUST_CODE,
         };
         routeConfig.routeData.acts.push(_act);
         _numEdge++;
@@ -542,6 +582,9 @@
         OPTION_5: '',
         REMARK: '',
         node: {} as node,
+        WORK_ORDER: currRoute.value.WORK_ORDER,
+        PROD_CODE: currRoute.value.PROD_CODE,
+        CUST_CODE: currRoute.value.CUST_CODE,
       };
       const actModel = lf.getNodeModelById(selectnode.value.id);
       actModel.updateText(routeConfig.currentAct?.ACT_NAME);
@@ -574,6 +617,10 @@
         ALLOW_DFT_IN: _node.ALLOW_DFT_IN,
         IS_OUTPUT: _node.IS_OUTPUT,
         REMARK: _node.REMARK,
+        WORK_ORDER: currRoute.value.WORK_ORDER,
+        PROD_CODE: currRoute.value.PROD_CODE,
+        CUST_CODE: currRoute.value.CUST_CODE,
+        node: {} as node,
       };
       const nodeModel = lf.getNodeModelById(selectnode.value.id);
       nodeModel.updateText(_node.NODE_NAME);
diff --git a/src/views/tigerprojects/mes/eng/route/typings/v-form-component.ts b/src/views/tigerprojects/mes/eng/route/typings/v-form-component.ts
index 304a954..fa5af61 100644
--- a/src/views/tigerprojects/mes/eng/route/typings/v-form-component.ts
+++ b/src/views/tigerprojects/mes/eng/route/typings/v-form-component.ts
@@ -50,6 +50,7 @@
   isInput?: boolean;
   isOutput?: boolean;
   schemas?: Array<any>;
+  isWorkOrder?: boolean;
 }
 
 /**
diff --git a/src/views/tigerprojects/system/lowcode/composition/Config.vue b/src/views/tigerprojects/system/lowcode/composition/Config.vue
index ca5a0f6..3228b16 100644
--- a/src/views/tigerprojects/system/lowcode/composition/Config.vue
+++ b/src/views/tigerprojects/system/lowcode/composition/Config.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-24 23:44:31
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-04 01:21:43
+ * @LastEditTime: 2024-08-04 15:33:56
 -->
 <template>
   <Card :title="GetTitle(props.configType)['configTitle']">
@@ -134,6 +134,7 @@
             if (showOtherTable.value) {
               showOtherTable.value = false;
               data.value['Table'] = result['Table'];
+              data.value['Action'] = result['Action']
               setTimeout(() => {
                 showOtherTable.value = true;
               }, 10);
@@ -160,7 +161,9 @@
     const nodes = selectedNodes.value;
     nodeChange({ useForms, objParams, selectedNodes: nodes }).then((result) => {
       showOtherTable.value = result.isShow;
+      data.value['Action'] = result['Action'];
       if (showOtherTable.value) {
+        data.value['Table'] = result['Table'];
         useTables.value['Table'][1].setProps({
           dataSource: [],
         });
@@ -196,7 +199,7 @@
       isUpdate: true,
       entityName: objParams.value['OtherTableName'],
       formJson: GetCrudForm(props.OtherTableName),
-      ifSave: true,
+      ifSave: objParams.value['ifSave'],
       // cType,
       // dtlSlots,
       // formSchemas,
@@ -229,7 +232,6 @@
           values: d,
           data: data,
         },
-        useTables,
       ).then(() => {
         /* 鏄剧ず鍏朵粬琛ㄦ牸 */
         if (showOtherTable.value) {
@@ -240,6 +242,8 @@
           useTables.value = GetUseTables(data, emit);
           setTimeout(() => {
             useTables.value['Table'][1].reload();
+            useForms.value['Action'][1].resetFields();
+            useForms.value['Action'][1].setFieldsValue(data.value['Action'][0]);
           }, 10);
         }
       });
diff --git a/src/views/tigerprojects/system/lowcode/composition/index.vue b/src/views/tigerprojects/system/lowcode/composition/index.vue
index 481b5ea..4724e35 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-08-04 00:14:39
+ * @LastEditTime: 2024-08-04 17:50:50
 -->
 <template>
   <PageWrapper
@@ -29,7 +29,12 @@
             </div>
           </template>
         </CarGridNav>
-        <Config v-if="showConfig" :configType="configType" :OtherTableName="OtherTableName" @success="configSuccess" />
+        <Config
+          v-if="showConfig"
+          :configType="configType"
+          :OtherTableName="OtherTableName"
+          @success="configSuccess"
+        />
       </div>
     </Suspense>
     <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable">
@@ -165,12 +170,12 @@
 
   const currlf = ref(null) as Ref<LogicFlow | null>;
   /**
-   * @description: 宸ヨ壓璺嚎鍒濆鍖�
+   * @description: 宸ヨ壓璺嚎鍒濆鍖栵紝鐗规畩椤甸潰鑷畾涔夊唴瀹�
    * @param {*} lf
    * @return {*}
    */
   async function init(lf, rotId) {
-    initRoute(lf, rotId, routeData, currlf);
+    initRoute(lf, rotId, routeData, currlf, objParams.value.rotType);
   }
 
   /**
@@ -189,8 +194,13 @@
       nodes: [],
       edges: [],
     };
+    /* 鑷畾涔夊唴瀹癸紝鍙湁鏄剧ず宸ヨ壓璺嚎鐨勭粍鍚堥〉闈細杩涙潵 */
     if (e.nodes[0].type == 'Route') {
-      initRoute(currlf, e.nodes[0].code, routeData, currlf);
+      let _rotId = e.nodes[0].code;
+      if (objParams.value.rotType == 'Wo') {
+        _rotId = e.nodes[0].wo;
+      }
+      initRoute(currlf, _rotId, routeData, currlf, objParams.value.rotType);
     }
   }
 
diff --git a/src/views/tigerprojects/system/lowcode/data.ts b/src/views/tigerprojects/system/lowcode/data.ts
index fb22e6e..6e77912 100644
--- a/src/views/tigerprojects/system/lowcode/data.ts
+++ b/src/views/tigerprojects/system/lowcode/data.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-02 17:52:35
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-03 23:48:01
+ * @LastEditTime: 2024-08-04 17:43:44
  */
 
 import { ActionItem, FormSchema, PopConfirm } from '/@/components/Table';
@@ -13,7 +13,7 @@
 import { woCustFn, woformSchema } from '/@/views/components/bizMesWo';
 import { useModal } from '/@/components/Modal';
 import { Ref, unref } from 'vue';
-import { getRouteData } from '/@/api/tigerapi/mes/router';
+import { getRouteData, getWoRouteData } from '/@/api/tigerapi/mes/router';
 import { buildUUID } from '/@/utils/uuid';
 import { useUserStore } from '/@/store/modules/user';
 import { formatToDateTime } from '/@/utils/dateUtil';
@@ -154,10 +154,10 @@
  * @param {*} lf
  * @return {*}
  */
-export async function initRoute(lf, rotId, routeData, currlf) {
+export async function initRoute(lf, rotId, routeData, currlf, rotType) {
   currlf.value = unref(lf);
   //閫氳繃宸ヨ壓璺嚎ID鑾峰彇鍥惧舰鏁版嵁锛屽苟娓叉煋
-  var _data = await getRouteData(rotId);
+  var _data = rotType == 'Wo'?await getWoRouteData(rotId): await getRouteData(rotId);
   console.log('缁勪欢宸叉寕杞�', _data);
   if (_data.Data != null) {
     _data.Data.nodes.forEach((n) => {
diff --git a/src/views/tigerprojects/system/lowcode/detail/detail.vue b/src/views/tigerprojects/system/lowcode/detail/detail.vue
index 8450b62..e6c3c57 100644
--- a/src/views/tigerprojects/system/lowcode/detail/detail.vue
+++ b/src/views/tigerprojects/system/lowcode/detail/detail.vue
@@ -175,7 +175,7 @@
     const params = {
       record,
       isUpdate: true,
-      ifSave: true,
+      ifSave: objParams.value['ifSave'],
       entityName: props.entityName,
       formJson: GetCrudForm(), //getFormSchema(`${entityName.value}_Crud`),
       cType,
@@ -217,7 +217,7 @@
     if (isNullOrUnDef(custImport.value['default'])) {
       openDrawer(true, {
         isUpdate: false,
-        ifSave: true,
+        ifSave: objParams.value['ifSave'],
         entityName: props.entityName,
         formJson: _cruds, //getFormSchema(`${entityName.value}_Crud`),
         crudColSlots: colSlots.value,
@@ -242,7 +242,7 @@
         case 'drawer':
           openDrawer(true, {
             isUpdate: false,
-            ifSave: true,
+            ifSave: objParams.value['ifSave'],
             entityName: props.entityName,
             formJson: _cruds, //getFormSchema(`${entityName.value}_Crud`),
             crudColSlots: colSlots.value,
diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
index e49286b..6a403b8 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-28 12:46:53
+ * @LastEditTime: 2024-08-04 14:20:02
  */
 
 import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -41,6 +41,7 @@
           Title: '鏂板涓嶈壇浠g爜缁�',
           // pCode: 'DFTG_CODE',
           IsID: false,
+          ifSave: false,
           drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE', type: 'one', keyName: 'BAS_DEFECT' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
         },
       };
@@ -127,6 +128,7 @@
       Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`,
       pCode: 'DFTG_CODE',
       IsID: false,
+      ifSave: false,
       drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE', type: 'one', keyName: 'BAS_DEFECT' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
     };
     // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
index 3bd9e58..2bf2f66 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-04 00:44:17
+ * @LastEditTime: 2024-08-04 14:20:29
  */
 
 import { DeleteLabelTemplate } from '/@/api/tigerapi/mes/label';
@@ -175,6 +175,7 @@
       Title: `缂栬緫妯℃澘${params['record']['LABEL_CODE']}鐨勫彉閲廯,
       pCode: 'LABEL_CODE',
       IsID: true,
+      ifSave: false,
       colSlots: params['colSlots'].value, //['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
       colSlotsInHigh: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
       drawers: [
diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
index 7520e65..33acb6e 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-28 17:28:46
+ * @LastEditTime: 2024-08-04 14:20:37
  */
 
 import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -43,6 +43,7 @@
           Title: '鏂板涓嶈壇鍘熷洜缁�',
           pCode: 'RSNG_CODE',
           IsID: false,
+          ifSave: false,
           drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one', keyName: 'BAS_REASON' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
         },
       };
@@ -118,6 +119,7 @@
       Title: `缂栬緫涓嶈壇鍘熷洜缁勶細${params['record']['RSNG_CODE']}`,
       pCode: 'RSNG_CODE',
       IsID: false,
+      ifSave: false,
       drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one', keyName: 'BAS_REASON' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
     };
     // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
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 dda5d59..244cb1e 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-25 21:46:26
+ * @LastEditTime: 2024-08-04 15:49:53
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -418,11 +418,14 @@
       CODE: params['record'].ORDER_NO,
       Title: `宸ュ崟[${params['record'].ORDER_NO}]宸ヨ壓缁戝畾`,
       colSlots: params['colSlots'].value, /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */
-      crudColSlots: [] /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
+      crudColSlots:  ['BAS_LABEL_TEMP1add']  /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
       dense: true,
       pageTitle: `宸ュ崟宸ヨ壓缁戝畾`,
       pageContent: `杩欓噷鏄鐞嗗伐鍗曠殑宸ヨ壓缁戝畾锛屼竴涓伐鍗曞彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛,
       SessionName: 'WoRouteBinding_update',
+      OtherTableName: 'BAS_PKG_DTL',
+      ifSave: false,
+      rotType: 'Wo'
     };
     // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
     sessionStorage.removeItem(`${id.SessionName}_params`);
diff --git a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts
index 6f351bd..46e054c 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-20 21:27:46
+ * @LastEditTime: 2024-08-04 14:21:03
  */
 
 import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -41,6 +41,7 @@
           Title: '鏂板鐝埗', //鏍囬
           pCode: 'SFTS_CODE', //涓讳俊鎭叧閿瓧娈礐ODE
           IsID: false, //鏄惁甯﹁繃鍘讳晶杈规鐨勬槸ID锛宖alse灏辨槸CODE锛宼rue鏄疘D
+          ifSave: false,
           drawers: [
             { name: 'MES_SHIFT', code: 'SFTS_CODE', type: 'one', keyName: 'MES_SHIFT', order: 'SFT_CODE' },
             {
@@ -136,6 +137,7 @@
       Title: `缂栬緫鐝埗锛�${params['record']['SFTS_CODE']}`, //鏍囬
       // pCode: 'SFTS_CODE', //涓讳俊鎭叧閿瓧娈礐ODE锛岄珮绾ц〃鍗曠敤涓嬮潰drawers閲岀殑code
       IsID: false, //鏄惁甯﹁繃鍘讳晶杈规鐨勬槸ID锛宖alse灏辨槸CODE锛宼rue鏄疘D
+      ifSave: false,
       drawers: [
         { name: 'MES_SHIFT', code: 'SFTS_CODE', type: 'one', keyName: 'MES_SHIFT', order: 'SFT_CODE' }, //type: one-琛ㄧず闇�瑕乧ode: 'SFTS_CODE'鍙鍞竴鍊�
         { name: 'MES_SHIFT_PRD', code: 'SFT_CODE', type: 'all', keyName: 'MES_SHIFT', order: 'SFT_CODE,SEQ' }, //type: all-琛ㄧず闇�瑕乧ode: 'SFT_CODE'鎵�鏈夌殑鍊硷紝keyName锛氳〃绀洪渶瑕佹墍鏈夊�肩殑code鐨勫疄浣撳悕
diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
index 9b9144c..a7b11ff 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-04 01:13:27
+ * @LastEditTime: 2024-08-04 15:42:50
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -14,12 +14,7 @@
   RouteToCust,
   RouteToProd,
 } from '/@/api/tigerapi/mes/router';
-import {
-  GetEnum,
-  SaveEntity,
-  convertToTree,
-  getEntity,
-} from '/@/api/tigerapi/system';
+import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system';
 import { useLocale } from '/@/locales/useLocale';
 import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
 import { useI18n } from '/@/hooks/web/useI18n';
@@ -121,7 +116,7 @@
           break;
         case 'BAS_PKG_DTL':
           form = crudForms[type];
-        break;
+          break;
       }
       return form;
     },
@@ -183,6 +178,7 @@
               PROD_CODE: params['objParams'].value['CODE'],
               ACT_TYPE: res.Data.Items[0].ACT_TYPE,
               CUST_CODE: params['selectedNodes'][0].cust,
+              OPTION_1: res.Data.Items[0].OPTION_1,
             });
             result['isShow'] = isNullOrEmpty(res.Data.Items[0].PKG_CODE) ? false : true;
             const ents = await getEntity({
@@ -190,7 +186,14 @@
               entityName: 'V_BAS_PKG_DTL',
               order: '',
             });
-            result['Table'] = ents.Data.Items;
+            result['Table'] = isNullOrEmpty(res.Data.Items[0].OPTION_1)
+              ? ents.Data.Items
+              : JSON.parse(res.Data.Items[0].OPTION_1);
+            /* 濡傛灉OPTION_1瀛楁涓虹┖灏辨妸鍖呰淇℃伅杞琂SON瀛樺埌OPTION_1瀛楁 */
+            res.Data.Items[0].OPTION_1 = isNullOrEmpty(res.Data.Items[0].OPTION_1)
+              ? JSON.stringify(ents.Data.Items)
+              : res.Data.Items[0].OPTION_1;
+            result['Action'] = res.Data.Items;
           }
           if (params['selectedNodes'][0].type == 'Node') {
             resetFieldsNode();
@@ -637,15 +640,20 @@
      * @param {array} args
      * @return {*}
      */
-    CustFunc: async (param: CustModalParams, ...args) => {
-      if (param.ctype == 'BAS_PKG_DTL') {
-        let useTables = args[0];
-        const ents = await getEntity({
-          sqlcmd: `PKG_RULE_ID ='${param.values['PKG_RULE_ID']}'`,
-          entityName: 'V_BAS_PKG_DTL',
-          order: '',
+    CustFunc: async (param: CustModalParams) => {
+      if (param['ctype'] == 'BAS_PKG_DTL') {
+        // const ents = await getEntity({
+        //   sqlcmd: `PKG_RULE_ID ='${param.values['PKG_RULE_ID']}'`,
+        //   entityName: 'V_BAS_PKG_DTL',
+        //   order: '',
+        // });
+        // param.data.value['Table'] = ents.Data.Items;
+        param.data.value['Table'].map((x) => {
+          if (x.PKG_CODE == param.values['PKG_CODE']) {
+            x.LABEL_CODE = param.values['LABEL_CODE'];
+          }
         });
-        param.data.value['Table'] = ents.Data.Items;
+        param.data.value['Action'][0]['OPTION_1'] = JSON.stringify(param.data.value['Table']);
       }
     },
     /**
@@ -1102,6 +1110,13 @@
       component: 'Input',
       colProps: { span: 12 },
     },
+    {
+      field: 'OPTION_1',
+      label: '琛屼负閫夐」1',
+      component: 'Input',
+      colProps: { span: 12 },
+      show: false,
+    },
   ];
 
   /**
@@ -1300,7 +1315,7 @@
       colProps: { span: 12 },
     },
   ];
-  
+
   const crudForms = {
     BAS_PKG_DTL: [
       {
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 d684738..73265d0 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-08-04 00:28:41
+ * @LastEditTime: 2024-08-04 17:45:27
  */
 
 import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -74,6 +74,8 @@
       pageContent: `杩欓噷鏄鐞嗕骇鍝佺殑宸ヨ壓缁戝畾锛屼竴涓骇鍝佸彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛,
       SessionName: 'ProdRouteBinding_update',
       OtherTableName: 'BAS_PKG_DTL',
+      ifSave: false,
+      rotType: 'Route'
     };
     // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
     sessionStorage.removeItem(`${id.SessionName}_params`);
diff --git a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
index 0d84b3d..b729596 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
@@ -4,16 +4,13 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-08-01 19:46:42
+ * @LastEditTime: 2024-08-04 16:44:05
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
 import {
   DeleteWoRoute,
-  GetRoutePTree,
   GetWoPTree,
-  RouteToCust,
-  RouteToProd,
   SP_MES_PROD2WO,
   SP_MES_WO2CUST,
 } from '/@/api/tigerapi/mes/router';
@@ -24,13 +21,13 @@
 import { NavItem } from '/@/api/tigerapi/model/basModel';
 import { useMessage } from '/@/hooks/web/useMessage';
 import { useModal } from '/@/components/Modal';
-import { FormSchema } from '/@/components/Table';
-import { initRoute } from '../data';
+import { BasicColumn, FormSchema, useTable } from '/@/components/Table';
 import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
 import { useUserStore } from '/@/store/modules/user';
 import { EventDataNode } from 'ant-design-vue/lib/tree';
 import { ContextMenuItem } from '/@/components/TigerTree';
 import { UpdateWoStatus } from '/@/api/tigerapi/mes/wo';
+import { useForm } from '/@/components/Form';
 
 const { t } = useI18n();
 const { createErrorModal } = useMessage();
@@ -126,6 +123,9 @@
         case 'Node':
           form = nodeFormShema;
           break;
+        case 'BAS_PKG_DTL':
+          form = crudForms[type];
+          break;
       }
       return form;
     },
@@ -137,74 +137,162 @@
       return ['scanadd', 'assyadd', 'testadd', 'auditadd', 'printadd', 'pkgadd'];
     },
     /**
+     * @description: 鑾峰彇琛ㄦ牸use鍒楄〃
+     * @param {string} type
+     * @param {array} args
+     * @return {*}
+     */
+    GetUseTables: (data: Ref<{}>, ...args) => {
+      return {
+        Table: useTable({
+          title: '鍒楄〃淇℃伅',
+          // api: getListByPage,
+          // searchInfo: { TABLE_NAME: 'V_BAS_PKG_DTL' },
+          dataSource: data.value['Table'],
+          columns: GetBaseColumns('', args[0], data),
+          maxHeight: 520,
+          useSearchForm: false,
+          showTableSetting: false,
+          bordered: true,
+          canResize: true,
+          showIndexColumn: false,
+          // rowSelection: {
+          //   type: 'radio', //'checkbox'
+          // },
+          actionColumn: {
+            width: 100,
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+            slots: { customRender: 'action' },
+            fixed: 'right',
+          }, //鑷畾涔夋搷浣滃垪
+        }),
+      };
+    },
+    GetUseForm: () => {
+      return {
+        Action: useForm({
+          labelWidth: 145,
+          schemas: methods.GetCrudForm('Action'),
+          actionColOptions: {
+            offset: 8,
+            span: 24,
+          },
+          wrapperCol: {
+            span: 15,
+          },
+          showActionButtonGroup: true,
+          submitButtonOptions: {
+            text: '淇濆瓨',
+          },
+        }),
+        Node: useForm({
+          labelWidth: 145,
+          schemas: methods.GetCrudForm('Node'),
+          actionColOptions: {
+            offset: 8,
+            span: 24,
+          },
+          wrapperCol: {
+            span: 15,
+          },
+          showActionButtonGroup: true,
+          submitButtonOptions: {
+            text: '淇濆瓨',
+          },
+        }),
+      };
+    },
+    /**
      * @description: 鍒囨崲鑺傜偣鏃朵簨浠舵柟娉�
      * @return {*}
      */
-    nodeChange: (params: {
-      resetFields: any;
-      setFieldsValue: any;
-      objParams: Ref<any>;
-      selectedNodes: Ref<any[]>;
-    }) => {
-      let sqlcmd = ' 1=1 ';
-      if (!isNullOrEmpty(params['objParams'].value['CODE'])) {
-        sqlcmd += `And WORK_ORDER = '${params['objParams'].value['CODE']}'`;
-      }
-      if (!isNullOrEmpty(params['selectedNodes'].value[0].id)) {
-        sqlcmd +=
-          params['selectedNodes'].value[0].type == 'Action'
-            ? `And ACT_ID = '${params['selectedNodes'].value[0].id}'`
-            : `And NODE_ID = '${params['selectedNodes'].value[0].id}'`;
-      }
-      getEntity({
-        sqlcmd: sqlcmd,
-        entityName:
-          params['selectedNodes'].value[0].type == 'Action' ? 'MES_WO_ACTION' : 'MES_WO_OPER',
-        order: '',
-      }).then((res) => {
-        params['resetFields']();
-        if (params['selectedNodes'].value[0].type == 'Action') {
-          params['setFieldsValue']({
-            ID: res.Data.Items[0].ID,
-            ACT_ID: res.Data.Items[0].ACT_ID,
-            ROT_ID: res.Data.Items[0].ROT_ID,
-            NODE_ID: res.Data.Items[0].NODE_ID,
-            IS_ACTIVE: res.Data.Items[0].IS_ACTIVE,
-            ITEM_CODE: res.Data.Items[0].ITEM_CODE,
-            RULE_CODE: res.Data.Items[0].RULE_CODE,
-            TEST_CODE: res.Data.Items[0].TEST_CODE,
-            SAPL_CODE: res.Data.Items[0].SAPL_CODE,
-            LABEL_CODE: res.Data.Items[0].LABEL_CODE,
-            PKG_CODE: res.Data.Items[0].PKG_CODE,
-            ACT_CODE: res.Data.Items[0].ACT_CODE,
-            REMARK: res.Data.Items[0].REMARK,
-            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,
-          });
+    nodeChange: (params: { useForms: Ref<any>; objParams: Ref<any>; selectedNodes: any[] }) =>
+      new Promise<any>(async (resolve, reject) => {
+        let result = {};
+        let sqlcmd = ' 1=1 ';
+        if (!isNullOrEmpty(params['objParams'].value['CODE'])) {
+          sqlcmd += `And WORK_ORDER = '${params['objParams'].value['CODE']}'`;
         }
-        if (params['selectedNodes'].value[0].type == 'Node') {
-          params['setFieldsValue']({
-            ID: res.Data.Items[0].ID,
-            OPER_CODE: res.Data.Items[0].OPER_CODE,
-            ROT_ID: res.Data.Items[0].ROT_ID,
-            NODE_ID: res.Data.Items[0].NODE_ID,
-            NODE_NAME: res.Data.Items[0].NODE_NAME,
-            IS_ACTIVE: res.Data.Items[0].IS_ACTIVE,
-            IS_CALC_FPY: res.Data.Items[0].IS_CALC_FPY,
-            CAN_SKIP: res.Data.Items[0].CAN_SKIP,
-            IS_INPUT: res.Data.Items[0].IS_INPUT,
-            IS_OUTPUT: res.Data.Items[0].IS_OUTPUT,
-            ALLOW_DFT_IN: res.Data.Items[0].ALLOW_DFT_IN,
-            REMARK: res.Data.Items[0].REMARK,
-            WORK_ORDER: params['objParams'].value['CODE'],
-            CUST_CODE: params['selectedNodes'].value[0].cust,
-            PROD_CODE: params['selectedNodes'].value[0].prod,
-          });
+        if (!isNullOrEmpty(params['selectedNodes'][0].id)) {
+          sqlcmd +=
+            params['selectedNodes'][0].type == 'Action'
+              ? `And ACT_ID = '${params['selectedNodes'][0].id}'`
+              : `And NODE_ID = '${params['selectedNodes'][0].id}'`;
         }
-      });
-    },
+        try {
+          const res = await getEntity({
+            sqlcmd: sqlcmd,
+            entityName:
+              params['selectedNodes'][0].type == 'Action' ? 'MES_WO_ACTION' : 'MES_WO_OPER',
+            order: '',
+          });
+          const setFieldsValue = params['useForms'].value['Action'][1]['setFieldsValue'];
+          const setFieldsValueNode = params['useForms'].value['Node'][1]['setFieldsValue'];
+          const resetFields = params['useForms'].value['Action'][1]['resetFields'];
+          const resetFieldsNode = params['useForms'].value['Node'][1]['resetFields'];
+          if (params['selectedNodes'][0].type == 'Action') {
+            resetFields();
+            setFieldsValue({
+              ID: res.Data.Items[0].ID,
+              ACT_ID: res.Data.Items[0].ACT_ID,
+              ROT_ID: res.Data.Items[0].ROT_ID,
+              NODE_ID: res.Data.Items[0].NODE_ID,
+              IS_ACTIVE: res.Data.Items[0].IS_ACTIVE,
+              ITEM_CODE: res.Data.Items[0].ITEM_CODE,
+              RULE_CODE: res.Data.Items[0].RULE_CODE,
+              TEST_CODE: res.Data.Items[0].TEST_CODE,
+              SAPL_CODE: res.Data.Items[0].SAPL_CODE,
+              LABEL_CODE: res.Data.Items[0].LABEL_CODE,
+              PKG_CODE: res.Data.Items[0].PKG_CODE,
+              ACT_CODE: res.Data.Items[0].ACT_CODE,
+              REMARK: res.Data.Items[0].REMARK,
+              WORK_ORDER: params['objParams'].value['CODE'],
+              ACT_TYPE: res.Data.Items[0].ACT_TYPE,
+              CUST_CODE: params['selectedNodes'][0].cust,
+              PROD_CODE: params['selectedNodes'][0].prod,
+              OPTION_1: res.Data.Items[0].OPTION_1,
+            });
+            result['isShow'] = isNullOrEmpty(res.Data.Items[0].PKG_CODE) ? false : true;
+            const ents = await getEntity({
+              sqlcmd: `RULE_CODE ='${res.Data.Items[0].PKG_CODE}'`,
+              entityName: 'V_BAS_PKG_DTL',
+              order: '',
+            });
+            result['Table'] = isNullOrEmpty(res.Data.Items[0].OPTION_1)
+              ? ents.Data.Items
+              : JSON.parse(res.Data.Items[0].OPTION_1);
+            /* 濡傛灉OPTION_1瀛楁涓虹┖灏辨妸鍖呰淇℃伅杞琂SON瀛樺埌OPTION_1瀛楁 */
+            res.Data.Items[0].OPTION_1 = isNullOrEmpty(res.Data.Items[0].OPTION_1)
+              ? JSON.stringify(ents.Data.Items)
+              : res.Data.Items[0].OPTION_1;
+            result['Action'] = res.Data.Items;
+          }
+          if (params['selectedNodes'][0].type == 'Node') {
+            resetFieldsNode();
+            setFieldsValueNode({
+              ID: res.Data.Items[0].ID,
+              OPER_CODE: res.Data.Items[0].OPER_CODE,
+              ROT_ID: res.Data.Items[0].ROT_ID,
+              NODE_ID: res.Data.Items[0].NODE_ID,
+              NODE_NAME: res.Data.Items[0].NODE_NAME,
+              IS_ACTIVE: res.Data.Items[0].IS_ACTIVE,
+              IS_CALC_FPY: res.Data.Items[0].IS_CALC_FPY,
+              CAN_SKIP: res.Data.Items[0].CAN_SKIP,
+              IS_INPUT: res.Data.Items[0].IS_INPUT,
+              IS_OUTPUT: res.Data.Items[0].IS_OUTPUT,
+              ALLOW_DFT_IN: res.Data.Items[0].ALLOW_DFT_IN,
+              REMARK: res.Data.Items[0].REMARK,
+              WORK_ORDER: params['objParams'].value['CODE'],
+              CUST_CODE: params['selectedNodes'][0].cust,
+              PROD_CODE: params['selectedNodes'][0].prod,
+            });
+          }
+          resolve(result);
+        } catch (e) {
+          reject(e);
+        }
+      }),
     /**
      * @description: 鑷畾涔夋彁浜ゆ柟娉�
      * @return {*}
@@ -259,27 +347,45 @@
      * @param {*} u
      * @return {*}
      */
-    GetSelectSuccess: (d, u, ...args) => {
+    GetSelectSuccess: async (d, u, ...args) => {
       let value = {};
       switch (args[0]) {
         case 'scanadd':
           value = {
-            RULE_CODE: d.values['val'],
+            value: {
+              RULE_CODE: d.values['val'],
+            },
+            isShow: false,
           };
           break;
         case 'assyadd':
           value = {
-            ITEM_CODE: d.values['val'],
+            value: {
+              ITEM_CODE: d.values['val'],
+            },
+            isShow: false,
           };
           break;
         case 'printadd':
           value = {
-            LABEL_CODE: d.values['val'],
+            value: {
+              LABEL_CODE: d.values['val'],
+            },
+            isShow: false,
           };
           break;
         case 'pkgadd':
+          const ents = await getEntity({
+            sqlcmd: `RULE_CODE ='${d.values['val']}'`,
+            entityName: 'V_BAS_PKG_DTL',
+            order: '',
+          });
           value = {
-            PKG_CODE: d.values['val'],
+            value: {
+              PKG_CODE: d.values['val'],
+            },
+            isShow: true,
+            data: ents.Data.Items,
           };
           break;
         case 'addRoute':
@@ -363,6 +469,7 @@
       return {
         configTitle: type == 'Action' ? '琛屼负閰嶇疆' : '宸ュ簭閰嶇疆',
         navTitle: type == 'Product' ? '娣诲姞宸ヨ壓璺嚎' : '宸ヨ壓璺嚎缁存姢',
+        tableTitle: type == 'Action' ? '鍖呰灞傜骇鍒楄〃' : '',
       };
     },
     /**
@@ -376,6 +483,7 @@
         showNav: false,
         type: selectedNodes.value[0].type,
         nodes: selectedNodes.value,
+        showOtherTable: false,
       };
       if (isNullOrUnDef(selectedNodes)) {
         return result;
@@ -383,10 +491,16 @@
       if (selectedNodes.value[0].type == 'WorkOrder' || selectedNodes.value[0].type == 'Route') {
         result.showNav = true;
         result.showConfig = false;
+        result.showOtherTable = false;
       }
       if (selectedNodes.value[0].type == 'Action' || selectedNodes.value[0].type == 'Node') {
         result.showNav = false;
         result.showConfig = true;
+        if (selectedNodes.value[0].type == 'Action') {
+          result.showOtherTable = true;
+        } else {
+          result.showOtherTable = false;
+        }
       }
       return result;
     },
@@ -486,7 +600,7 @@
           SP_MES_WO2CUST({ wo: args[2][0]['wo'] });
           break;
         case 'editRoute':
-          args[1](true, { rotId: args[2][0].code, slotName: '' });
+          args[1](true, { rotId: args[2][0].wo, slotName: '', rotType: 'Wo' });
           break;
       }
     },
@@ -541,13 +655,13 @@
      * @param {array} args
      * @return {*}
      */
-    CustFunc: (param: CustModalParams) => {
-      if (param.cType == 'Route') {
-        // initRoute(args[0], args[1]);
-      }
-    },
-    GetUseForm: () => {
-      return {};
+    CustFunc: async (param: CustModalParams) => {
+      param.data.value['Table'].map((x) => {
+        if (x.PKG_CODE == param.values['PKG_CODE']) {
+          x.LABEL_CODE = param.values['LABEL_CODE'];
+        }
+      });
+      param.data.value['Action'][0]['OPTION_1'] = JSON.stringify(param.data.value['Table']);
     },
     /**
      * @description: 鑾峰彇鍙抽敭鑿滃崟鍒楄〃
@@ -588,6 +702,63 @@
 
   /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
 
+  let columns: BasicColumn[] = [];
+  /**
+   * @description: 鑾峰彇琛ㄦ牸瀛楁Json
+   * @param {string} type
+   * @return {*}
+   */
+  function GetBaseColumns(type: string, emit, data: Ref<{}>) {
+    columns = [
+      {
+        dataIndex: 'PKG_RULE_ID',
+        title: '鍖呰瑙勫垯ID',
+        ifShow: false,
+        sorter: true,
+        resizable: true,
+      },
+      {
+        dataIndex: 'PKG_CODE',
+        title: '鍖呰缂栫爜',
+        ifShow: false,
+        sorter: true,
+        resizable: true,
+        customRender: () => {},
+      },
+      {
+        dataIndex: 'PKG_NAME',
+        title: '鍖呰鍚嶇О',
+        ifShow: true,
+        sorter: true,
+        resizable: true,
+        customRender: () => {},
+      },
+      {
+        dataIndex: 'PKG_QTY',
+        title: '鍖呰鏁伴噺',
+        ifShow: true,
+        sorter: true,
+        resizable: true,
+        customRender: () => {},
+      },
+      {
+        dataIndex: 'PKG_LEVEL',
+        title: '鍖呰灞傜骇',
+        ifShow: true,
+        sorter: true,
+        resizable: true,
+        customRender: () => {},
+      },
+      {
+        dataIndex: 'LABEL_CODE',
+        title: '鏍囩妯℃澘缂栫爜',
+        ifShow: true,
+        sorter: true,
+        resizable: true,
+      },
+    ];
+    return columns;
+  }
   /**
    * @description: 寮瑰嚭閫夋嫨妗�-鐗╂枡閫夋嫨妗嗛厤缃�
    * @return {*}
@@ -932,6 +1103,13 @@
       component: 'Input',
       colProps: { span: 12 },
     },
+    {
+      field: 'OPTION_1',
+      label: '琛屼负閫夐」1',
+      component: 'Input',
+      colProps: { span: 12 },
+      show: false,
+    },
   ];
 
   /**
@@ -1131,6 +1309,102 @@
     },
   ];
 
+  const crudForms = {
+    BAS_PKG_DTL: [
+      {
+        label: '鍖呰瑙勫垯ID',
+        field: 'PKG_RULE_ID',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      {
+        label: '鍖呰灞傜骇',
+        field: 'PKG_LEVEL',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      {
+        field: 'PKG_CODE',
+        label: '鍖呰/杞藉叿缂栫爜',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      {
+        label: '鍖呰鏁伴噺',
+        field: 'PKG_QTY',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      {
+        field: 'LABEL_CODE',
+        label: '妯℃澘缂栫爜',
+        component: 'Input',
+        show: true,
+        required: true,
+        colProps: {
+          span: 22,
+        },
+      },
+      {
+        field: 'BAS_LABEL_TEMP1PSelect_0', //鎸変綆浠g爜閰嶇疆鐨勮鍒欙紝瀹炰綋鍚�+搴忓彿+PSelect_0锛屽簭鍙风敤鏉ュ尯鍒嗗涓殑鏃跺�欙紝PSelect_0杩欐槸涓浐瀹氬悗缂�
+        label: '1',
+        defaultValue: 'BAS_LABEL_TEMP',
+        component: 'Input',
+        colProps: { span: 2 },
+        colSlot: 'BAS_LABEL_TEMP1add', //鎸変綆浠g爜閰嶇疆鐨勮鍒欙紝瀹炰綋鍚�+搴忓彿+add锛屽簭鍙风敤鏉ュ尯鍒嗗涓殑鏃跺�欙紝add杩欐槸涓浐瀹氬悗缂�
+      },
+      {
+        label: '鍖呰鍚嶇О',
+        field: 'PKG_NAME',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        show: false,
+      },
+      {
+        label: '澶囨敞',
+        field: 'REMARK',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      {
+        label: 'ID',
+        field: 'ID',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        show: false,
+      },
+    ] as FormSchema[],
+  };
+
   return [methods];
 }
 
diff --git a/src/views/tigerprojects/system/lowcode/high/dtl.vue b/src/views/tigerprojects/system/lowcode/high/dtl.vue
index e24c518..7c5966d 100644
--- a/src/views/tigerprojects/system/lowcode/high/dtl.vue
+++ b/src/views/tigerprojects/system/lowcode/high/dtl.vue
@@ -174,7 +174,7 @@
     const params = {
       record,
       isUpdate: true,
-      ifSave: false,
+      ifSave: objParams.value['ifSave'],
       entityName: props.entityName,
       formJson: [], //getFormSchema(`${entityName.value}_Crud`),
       cType,
@@ -272,7 +272,7 @@
       }
       useDrawers[index][item['name']][1].openDrawer(true, {
         isUpdate: false,
-        ifSave: false,
+        ifSave: objParams.value['ifSave'],
         entityName: item['name'], //props.entityName,
         // formJson: GetCrudForm(item, data), //鑾峰彇澧炲垹鏀硅〃鍗曞瓧娈�
         crudColSlots: props.crudColSlots,
diff --git a/src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue b/src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue
index 5b5074d..c31175e 100644
--- a/src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue
+++ b/src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue
@@ -232,7 +232,7 @@
     const params = {
       record,
       isUpdate: true,
-      ifSave: false,
+      ifSave: objParams.value['ifSave'],
       entityName: props.entityName,
       formJson: [], //getFormSchema(`${entityName.value}_Crud`),
       cType,
@@ -296,7 +296,7 @@
       }
       useDrawers[index][item['name']][1].openDrawer(true, {
         isUpdate: false,
-        ifSave: flase,
+        ifSave: objParams.value['ifSave'],
         entityName: item['name'], //props.entityName,
         // formJson: GetCrudForm(item, data), //鑾峰彇澧炲垹鏀硅〃鍗曞瓧娈�
         crudColSlots: props.crudColSlots,

--
Gitblit v1.9.3