From 969725647117eb7ca148b2e8cfa9ec8b5eb432fa Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 22 十月 2024 11:04:10 +0800
Subject: [PATCH] 工艺缓存优化

---
 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts |  112 +++++++++++++++++++++++++++----------------------------
 1 files changed, 55 insertions(+), 57 deletions(-)

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 319c207..bd2cc87 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-08-13 15:49:49
+ * @LastEditTime: 2024-10-22 11:01:43
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -22,6 +22,7 @@
 import { useForm } from '/@/components/Form/index';
 import { SP_MES_PROD2WO } from '/@/api/tigerapi/mes/router';
 import { cloneDeep } from 'lodash-es';
+import { useProdRouteStore } from '/@/store/modules/prodRoute';
 
 const { t } = useI18n();
 const { createErrorModal } = useMessage();
@@ -66,6 +67,10 @@
           x.onClick = handleRelease.bind(null, args, params);
           x.tooltip = '涓嬪彂';
         }
+        // if (x.name == 'handleTemplate') {
+        //   x.onClick = handleTemplate.bind(null, args, params);
+        //   x.tooltip = '妯℃澘缁存姢';
+        // }
       });
       return data;
     },
@@ -88,6 +93,14 @@
           showActionButtonGroup: false,
         }),
         prodinfo: useForm({
+          labelWidth: 120,
+          schemas: prodCfgformSchema,
+          actionColOptions: {
+            span: 24,
+          },
+          showActionButtonGroup: false,
+        }),
+        tmpinfo: useForm({
           labelWidth: 120,
           schemas: prodCfgformSchema,
           actionColOptions: {
@@ -300,8 +313,7 @@
         try {
           const form = param.values['forminfo'];
           const wo = param.values['mValues'];
-          wo.ROUTE_CODE = form.ROUTE_CODE;
-          wo.STATUS = 2;
+          wo.STATUS = wo.STATUS == 3?wo.STATUS: 2;
           let input: SaveWoBatchInput = {
             Wo: wo,
             WoBatch: {
@@ -337,6 +349,7 @@
               ACT_END_TIME: wo.ACT_END_TIME,
               BATCH_NO: '',
             },
+            IfToCust: form.IfToCust
           };
           SaveMesBatchWo(input).then((action) => {
             resolve(action);
@@ -384,34 +397,6 @@
    * @return {*}
    */
   function handleConfig(args, params: Recordable) {
-    // 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,
@@ -423,7 +408,7 @@
       OtherTableName: ['BAS_PKG_DTL', 'ItemCode'], /* 鑷畾涔夋樉绀哄垪琛ㄧ殑琛ㄥ悕锛岃窡涓婇潰澧炲垹鏀圭殑琛ㄥ悕涓�鑷达紝鏈夊涓氨鏀惧垪琛ㄤ腑 */
       dense: true,
       pageTitle: `宸ュ崟宸ヨ壓缁戝畾`,
-      pageContent: `杩欓噷鏄鐞嗗伐鍗曠殑宸ヨ壓缁戝畾锛屼竴涓伐鍗曞彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛,
+      pageContent: `杩欓噷鏄鐞嗗伐鍗曠殑宸ヨ壓缁戝畾锛屼竴涓伐鍗曞彲浠ョ粦瀹氫竴涓伐鑹鸿矾绾匡紝骞跺彲浠ヤ繚瀛樹负瀹㈡埛涓撶敤鐨勫伐鑹鸿矾绾縛,
       SessionName: 'WoRouteBinding_update',
       ifSave: false,
       rotType: 'Wo'
@@ -431,6 +416,9 @@
     // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
     sessionStorage.removeItem(`${id.SessionName}_params`);
     sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id)));
+    /* 璁剧疆鏍囧織锛屼互鏍规嵁缂撳瓨鏁版嵁鍙栨暟鎹� */
+    const useProdRoute = useProdRouteStore();
+    useProdRoute.setChangeToCPPage(true);
     go(`/WoRouteBinding/CP/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`);
   }
 
@@ -494,34 +482,44 @@
       },
     },
     {
-      label: '宸ヨ壓璺嚎',
-      field: 'ROUTE_CODE',
-      component: 'Input',
-      required: true,
+      field: 'IfToCust',
+      component: 'Switch',
+      label: '鏄惁淇濆瓨宸ヨ壓璺嚎鍒板鎴�',
+      defaultValue: true,
       colProps: {
-        span: 22,
+        span: 8,
       },
+      labelWidth: 200,
     },
-    {
-      field: 'add',
-      component: 'Input',
-      label: '1',
-      colSlot: 'add',
-      defaultValue: 'MES_ROUTE',
-      colProps: {
-        span: 1,
-      },
-    },
-    {
-      field: 'set',
-      component: 'Input',
-      label: '1',
-      colSlot: 'set',
-      defaultValue: 'MES_ROUTE',
-      colProps: {
-        span: 1,
-      },
-    },
+    // {
+    //   label: '宸ヨ壓璺嚎',
+    //   field: 'ROUTE_CODE',
+    //   component: 'Input',
+    //   required: true,
+    //   colProps: {
+    //     span: 22,
+    //   },
+    // },
+    // {
+    //   field: 'add',
+    //   component: 'Input',
+    //   label: '1',
+    //   colSlot: 'add',
+    //   defaultValue: 'MES_ROUTE',
+    //   colProps: {
+    //     span: 1,
+    //   },
+    // },
+    // {
+    //   field: 'set',
+    //   component: 'Input',
+    //   label: '1',
+    //   colSlot: 'set',
+    //   defaultValue: 'MES_ROUTE',
+    //   colProps: {
+    //     span: 1,
+    //   },
+    // },
   ];
 
   const woCfgformSchema: FormSchema[] = [

--
Gitblit v1.9.3