From efcc2e97beb8c3b05f422fe7efafa059447473de Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 01 八月 2024 17:23:58 +0800
Subject: [PATCH] 产品绑定工艺路线更新

---
 src/api/tigerapi/model/router.ts                                    |    1 
 src/views/tigerprojects/system/lowcode/high/baseForm.vue            |    5 
 src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts |   49 +++++++--
 src/views/tigerprojects/mes/eng/route/typings/v-form-component.ts   |    2 
 src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue  |  149 ++++++++++++++++++-----------
 src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts   |   24 ++++
 src/views/tigerprojects/system/lowcode/normal/mainTable.vue         |   10 +
 src/views/tigerprojects/system/lowcode/composition/Config.vue       |    4 
 src/views/tigerprojects/mes/eng/route/index.vue                     |    5 +
 9 files changed, 173 insertions(+), 76 deletions(-)

diff --git a/src/api/tigerapi/model/router.ts b/src/api/tigerapi/model/router.ts
index 94ab168..05cb5bf 100644
--- a/src/api/tigerapi/model/router.ts
+++ b/src/api/tigerapi/model/router.ts
@@ -39,6 +39,7 @@
   IS_FIRST_NODE: string;
   IS_CALC_FPY: string;
   CAN_SKIP: string;
+  ALLOW_DFT_IN: string;
   IS_INPUT: string;
   IS_OUTPUT: string;
   OPTION_1: string;
diff --git a/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue b/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue
index a51a9eb..8e21adc 100644
--- a/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue
+++ b/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-18 15:09:48
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-23 21:00:06
+ * @LastEditTime: 2024-08-01 11:18:39
 -->
 <!--
  * @Description: 琛ㄥ崟椤瑰睘鎬э紝鎺т欢灞炴�ч潰鏉�
@@ -13,20 +13,47 @@
   <div class="properties-content">
     <Form class="properties-body" label-align="left" layout="vertical">
       <FormItem label="宸ヨ壓璺嚎缂栫爜" name="宸ヨ壓璺嚎缂栫爜">
-        <Input :style="{ width: '100%' }" v-model:value="mesRoute.ROT_CODE" :min="0" :step="1" :readonly="true" />
+        <Input
+          :style="{ width: '100%' }"
+          v-model:value="mesRoute.ROT_CODE"
+          :min="0"
+          :step="1"
+          :readonly="true"
+        />
       </FormItem>
       <FormItem label="鑺傜偣鍚嶇О" name="鑺傜偣鍚嶇О">
-        <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentItem.NODE_NAME" :min="0" :step="1" />
+        <Input
+          :style="{ width: '100%' }"
+          v-model:value="routeConfig.currentItem.NODE_NAME"
+          :min="0"
+          :step="1"
+        />
       </FormItem>
       <FormItem label="宸ユ" name="宸ユ">
-        <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentItem.SEGMENT" :min="0" :step="1" />
+        <Input
+          :style="{ width: '100%' }"
+          v-model:value="routeConfig.currentItem.SEGMENT"
+          :min="0"
+          :step="1"
+        />
       </FormItem>
       <FormItem label="宸ュ簭缂栫爜" name="宸ュ簭缂栫爜">
-        <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentItem.GPH_TYPE" :min="0" :step="1" />
+        <Input
+          :style="{ width: '100%' }"
+          v-model:value="routeConfig.currentItem.GPH_TYPE"
+          :min="0"
+          :step="1"
+        />
       </FormItem>
       <FormItem label="鏄惁鍚敤" name="鏄惁鍚敤">
-        <Select ref="select" v-model:value="routeConfig.currentItem.IS_ACTIVE" style="width: 120px"
-          :options="options1" />
+        <Switch v-model:checked="routeConfig.isActive" />
+      </FormItem>
+      <FormItem label="鏄惁鍏佽璺崇珯" name="鏄惁鍏佽璺崇珯">
+        <Switch v-model:checked="routeConfig.canSkip" />
+      </FormItem>
+      
+      <FormItem label="鏄惁鍏佽涓嶈壇鍝佽繘绔�(Y/N)" name="鏄惁鍏佽涓嶈壇鍝佽繘绔�(Y/N)">
+        <Switch v-model:checked="routeConfig.allowDftIn" />
       </FormItem>
       <!-- <FormItem label="鏄惁璁$畻鐩撮�氱巼" name="鏄惁璁$畻鐩撮�氱巼">
         <Switch v-model:checked="routeConfig.isCalcFpy" />
@@ -44,57 +71,65 @@
   </div>
 </template>
 <script lang="ts" setup>
-import { Select, Switch, Input, Form, FormItem } from 'ant-design-vue';
-import { useRouteDesignState } from '../hooks/useRouteDesignState';
-import { SelectTypes } from 'ant-design-vue/es/select';
-import { ref, watch } from 'vue';
-import { isNullOrUnDef } from '/@/utils/is';
+  import { Select, Switch, Input, Form, FormItem } from 'ant-design-vue';
+  import { useRouteDesignState } from '../hooks/useRouteDesignState';
+  import { SelectTypes } from 'ant-design-vue/es/select';
+  import { ref, watch } from 'vue';
+  import { isNullOrUnDef } from '/@/utils/is';
 
-const { routeConfig, mesRoute } = useRouteDesignState();
-const emit = defineEmits(['changeNodeName']);
-const options1 = ref<SelectTypes['options']>([
-  {
-    value: 'Y',
-    label: '鍚敤',
-  },
-  {
-    value: 'N',
-    label: '涓嶅惎鐢�',
-  },
-]);
+  const { routeConfig, mesRoute } = useRouteDesignState();
+  const emit = defineEmits(['changeNodeName']);
+  const options1 = ref<SelectTypes['options']>([
+    {
+      value: 'Y',
+      label: '鍚敤',
+    },
+    {
+      value: 'N',
+      label: '涓嶅惎鐢�',
+    },
+  ]);
 
-watch(
-  [
-    () => routeConfig.isCalcFpy,
-    () => routeConfig.canSkip,
-    () => routeConfig.isInput,
-    () => routeConfig.isOutput,
-    () => routeConfig.currentItem,
-  ],
-  (newVal, oldVal) => {
-    routeConfig.routeData.nodes.forEach((r) => {
-      if (r.ID == routeConfig.currentItem.ID) {
-        if (oldVal[0] != newVal[0] && !isNullOrUnDef(oldVal[0])) {
-          r.IS_CALC_FPY = newVal[0] ? 'Y' : 'N';
+  watch(
+    [
+      () => routeConfig['isCalcFpy'],
+      () => routeConfig['canSkip'],
+      () => routeConfig['isInput'],
+      () => routeConfig['isOutput'],
+      () => routeConfig['allowDftIn'],
+      () => routeConfig['isActive'],
+      () => routeConfig['currentItem'],
+    ],
+    (newVal, oldVal) => {
+      routeConfig['routeData'].nodes.forEach((r) => {
+        if (r.ID == routeConfig['currentItem'].ID) {
+          if (oldVal[0] != newVal[0] && !isNullOrUnDef(oldVal[0])) {
+            r.IS_CALC_FPY = newVal[0] ? 'Y' : 'N';
+          }
+          if (oldVal[1] != newVal[1] && !isNullOrUnDef(oldVal[1])) {
+            r.CAN_SKIP = newVal[1] ? 'Y' : 'N';
+          }
+          if (oldVal[2] != newVal[2] && !isNullOrUnDef(oldVal[2])) {
+            r.IS_INPUT = newVal[2] ? 'Y' : 'N';
+          }
+          if (oldVal[3] != newVal[3] && !isNullOrUnDef(oldVal[3])) {
+            r.IS_OUTPUT = newVal[3] ? 'Y' : 'N';
+          }
+          if (oldVal[4] != newVal[4] && !isNullOrUnDef(oldVal[4])) {
+            r.ALLOW_DFT_IN = newVal[4] ? 'Y' : 'N';
+          }
+          if (oldVal[5] != newVal[5] && !isNullOrUnDef(oldVal[5])) {
+            r.IS_ACTIVE = newVal[5] ? 'Y' : 'N';
+          }
+          // r.IS_ACTIVE = newVal[4].IS_ACTIVE;
+          r.SEGMENT = newVal[6].SEGMENT;
+          if (r.NODE_NAME != newVal[6].NODE_NAME) {
+            r.NODE_NAME = newVal[6].NODE_NAME;
+            emit('changeNodeName', { id: r.ID, val: r.NODE_NAME });
+          }
         }
-        if (oldVal[1] != newVal[1] && !isNullOrUnDef(oldVal[1])) {
-          r.CAN_SKIP = newVal[1] ? 'Y' : 'N';
-        }
-        if (oldVal[2] != newVal[2] && !isNullOrUnDef(oldVal[2])) {
-          r.IS_INPUT = newVal[2] ? 'Y' : 'N';
-        }
-        if (oldVal[3] != newVal[3] && !isNullOrUnDef(oldVal[3])) {
-          r.IS_OUTPUT = newVal[3] ? 'Y' : 'N';
-        }
-        r.IS_ACTIVE = newVal[4].IS_ACTIVE;
-        r.SEGMENT = newVal[4].SEGMENT;
-        if (r.NODE_NAME != newVal[4].NODE_NAME) {
-          r.NODE_NAME = newVal[4].NODE_NAME;
-          emit('changeNodeName', { id: r.ID, val: r.NODE_NAME });
-        }
-      }
-    });
-  },
-  { deep: true, immediate: true },
-);
+      });
+    },
+    { deep: true, immediate: true },
+  );
 </script>
diff --git a/src/views/tigerprojects/mes/eng/route/index.vue b/src/views/tigerprojects/mes/eng/route/index.vue
index 4040672..5d67837 100644
--- a/src/views/tigerprojects/mes/eng/route/index.vue
+++ b/src/views/tigerprojects/mes/eng/route/index.vue
@@ -279,6 +279,7 @@
               GPH_TEXT: n.text.value,
               IS_ACTIVE: nd.IS_ACTIVE,
               IS_CALC_FPY: nd.IS_CALC_FPY,
+              ALLOW_DFT_IN: nd.ALLOW_DFT_IN,
               CAN_SKIP: nd.CAN_SKIP,
               REMARK: nd.REMARK,
               AUTH_ORG: useUserStore().getUserInfo.orgCode,
@@ -445,6 +446,7 @@
         AUTH_PROD: '',
         AUTH_WH: '',
         IS_FIRST_NODE: '',
+        ALLOW_DFT_IN: '',
         IS_INPUT: '',
         IS_OUTPUT: '',
         OPTION_1: '',
@@ -569,6 +571,7 @@
         IS_CALC_FPY: _node.IS_CALC_FPY,
         CAN_SKIP: _node.CAN_SKIP,
         IS_INPUT: _node.IS_INPUT,
+        ALLOW_DFT_IN: _node.ALLOW_DFT_IN,
         IS_OUTPUT: _node.IS_OUTPUT,
         REMARK: _node.REMARK,
       };
@@ -576,6 +579,8 @@
       nodeModel.updateText(_node.NODE_NAME);
       routeConfig.isCalcFpy = _node.IS_CALC_FPY == 'Y';
       routeConfig.canSkip = _node.CAN_SKIP == 'Y';
+      routeConfig.isActive = _node.IS_ACTIVE == 'Y';
+      routeConfig.allowDftIn = _node.ALLOW_DFT_IN == 'Y';
       routeConfig.isInput = _node.IS_INPUT == 'Y';
       routeConfig.isOutput = _node.IS_OUTPUT == 'Y';
       setTimeout(() => {
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 f57a0eb..304a954 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
@@ -45,6 +45,8 @@
   activeKey?: PropsTabKey;
   isCalcFpy?: boolean;
   canSkip?: boolean;
+  allowDftIn?: boolean;
+  isActive?: boolean;
   isInput?: boolean;
   isOutput?: boolean;
   schemas?: Array<any>;
diff --git a/src/views/tigerprojects/system/lowcode/composition/Config.vue b/src/views/tigerprojects/system/lowcode/composition/Config.vue
index b517eca..77b00c2 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-07-23 20:48:29
+ * @LastEditTime: 2024-08-01 17:11:03
 -->
 <template>
   <Card :title="GetTitle(props.configType)['configTitle']">
@@ -79,7 +79,7 @@
 
   let formSchema: FormSchema[] = GetCrudForm(props.configType);
   const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
-    labelWidth: 120,
+    labelWidth: 145,
     schemas: formSchema,
     actionColOptions: {
       offset: 8,
diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
index cdd4631..71f97eb 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-24 00:04:04
+ * @LastEditTime: 2024-08-01 17:17:09
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -178,6 +178,7 @@
             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,
             PROD_CODE: params['objParams'].value['CODE'],
             CUST_CODE: params['selectedNodes'].value[0].cust,
@@ -261,6 +262,7 @@
           value = {
             pkgRULE_CODE: d.values['val'],
           };
+          break;
         case 'addRoute':
           if (isNullOrEmpty(args[1]['CODE'])) {
             createErrorModal({
@@ -778,7 +780,7 @@
       field: 'RULE_CODE',
       label: '鎵爜楠岃瘉',
       component: 'Input',
-      colProps: { span: 10 },
+      colProps: { span: 11 },
       ifShow: ({ values }) => isScan(values.ACT_TYPE),
     },
     {
@@ -786,14 +788,14 @@
       label: '1',
       defaultValue: '',
       component: 'Input',
-      colProps: { span: 2, pull: 1 },
+      colProps: { span: 1, pull: 1 },
       ifShow: ({ values }) => isScan(values.ACT_TYPE),
       colSlot: 'scanadd',
     },
     {
       field: 'ITEM_CODE',
       label: '缁勮涓婃枡',
-      colProps: { span: 10 },
+      colProps: { span: 11 },
       component: 'Input',
       ifShow: ({ values }) => isAssy(values.ACT_TYPE),
     },
@@ -802,14 +804,14 @@
       label: '1',
       defaultValue: '',
       component: 'Input',
-      colProps: { span: 2, pull: 1 },
+      colProps: { span: 1, pull: 1 },
       ifShow: ({ values }) => isAssy(values.ACT_TYPE),
       colSlot: 'assyadd',
     },
     {
       field: 'TEST_CODE',
       label: '浜у搧娴嬭瘯',
-      colProps: { span: 10 },
+      colProps: { span: 11 },
       component: 'Input',
       ifShow: ({ values }) => isTest(values.ACT_TYPE),
     },
@@ -818,14 +820,14 @@
       label: '1',
       defaultValue: '',
       component: 'Input',
-      colProps: { span: 2, pull: 1 },
+      colProps: { span: 1, pull: 1 },
       ifShow: ({ values }) => isTest(values.ACT_TYPE),
       colSlot: 'testadd',
     },
     {
       field: 'SAPL_CODE',
       label: '浜у搧鎶芥',
-      colProps: { span: 10 },
+      colProps: { span: 11 },
       component: 'Input',
       ifShow: ({ values }) => isAudit(values.ACT_TYPE),
     },
@@ -834,14 +836,14 @@
       label: '1',
       defaultValue: '',
       component: 'Input',
-      colProps: { span: 2, pull: 1 },
+      colProps: { span: 1, pull: 1 },
       ifShow: ({ values }) => isAudit(values.ACT_TYPE),
       colSlot: 'auditadd',
     },
     {
       field: 'LABEL_CODE',
       label: '鏍囩鎵撳嵃',
-      colProps: { span: 10 },
+      colProps: { span: 11 },
       component: 'Input',
       ifShow: ({ values }) => isPrint(values.ACT_TYPE),
     },
@@ -850,14 +852,14 @@
       label: '1',
       defaultValue: '',
       component: 'Input',
-      colProps: { span: 2, pull: 1 },
+      colProps: { span: 1, pull: 1 },
       ifShow: ({ values }) => isPrint(values.ACT_TYPE),
       colSlot: 'printadd',
     },
     {
       field: 'pkgRULE_CODE',
       label: '鍖呰瑙勫垯',
-      colProps: { span: 10 },
+      colProps: { span: 11 },
       component: 'Input',
       ifShow: ({ values }) => isPackage(values.ACT_TYPE),
     },
@@ -866,7 +868,7 @@
       label: '1',
       defaultValue: '',
       component: 'Input',
-      colProps: { span: 2, pull: 1 },
+      colProps: { span: 1, pull: 1 },
       ifShow: ({ values }) => isPackage(values.ACT_TYPE),
       colSlot: 'pkgadd',
     },
@@ -1041,6 +1043,27 @@
       },
     },
     {
+      field: 'ALLOW_DFT_IN',
+      label: '鏄惁鍏佽涓嶈壇鍝佽繘绔�',
+      required: true,
+      component: 'Select',
+      colProps: { span: 12 },
+      componentProps: {
+        options: [
+          {
+            label: '鏄�',
+            value: 'Y',
+            key: 'Y',
+          },
+          {
+            label: '鍚�',
+            value: 'N',
+            key: 'N',
+          },
+        ],
+      },
+    },
+    {
       field: 'REMARK',
       label: '澶囨敞',
       component: 'Input',
diff --git a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
index 0ee7fd2..71679d6 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-07-24 20:03:25
+ * @LastEditTime: 2024-08-01 11:25:16
  */
 
 import { Ref, h, ref, render, unref } from 'vue';
@@ -196,6 +196,7 @@
             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,
@@ -1095,6 +1096,27 @@
       },
     },
     {
+      field: 'ALLOW_DFT_IN',
+      label: '鏄惁鍏佽涓嶈壇鍝佽繘绔�',
+      required: true,
+      component: 'Select',
+      colProps: { span: 12 },
+      componentProps: {
+        options: [
+          {
+            label: '鏄�',
+            value: 'Y',
+            key: 'Y',
+          },
+          {
+            label: '鍚�',
+            value: 'N',
+            key: 'N',
+          },
+        ],
+      },
+    },
+    {
       field: 'REMARK',
       label: '澶囨敞',
       component: 'Input',
diff --git a/src/views/tigerprojects/system/lowcode/high/baseForm.vue b/src/views/tigerprojects/system/lowcode/high/baseForm.vue
index b3d62bb..41edb84 100644
--- a/src/views/tigerprojects/system/lowcode/high/baseForm.vue
+++ b/src/views/tigerprojects/system/lowcode/high/baseForm.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-23 17:21:29
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-31 11:19:14
+ * @LastEditTime: 2024-08-01 10:40:57
 -->
 <template>
   <a-card
@@ -35,6 +35,7 @@
   import { getEntity } from '/@/api/tigerapi/system';
   import { isNullOrEmpty } from '/@/utils/is';
   import { useI18n } from '/@/hooks/web/useI18n';
+import { isFunction } from 'xe-utils';
   
   const { t } = useI18n();
   const props = defineProps({
@@ -50,7 +51,7 @@
     BaseForm: GetBaseForm(props.entityName),
   });
   const colSlots = ref<any[]>(objParams.value['colSlotsInHigh']);
-  const useModals = ref<any>(GetUseModals());
+  const useModals = GetUseModals && isFunction(GetUseModals)? ref<any>(GetUseModals()): ref<any>({});
 
   //寮瑰嚭妗嗘垨楂樼骇椤甸潰澶氳〃鍗曠粨鏋�
   useFormData.value = {
diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
index ffe2338..4f52623 100644
--- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
+++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -191,7 +191,15 @@
     bordered: true,
     canResize: true,
     showIndexColumn: false,
-    actionColumn: ActionColumn, //鑷畾涔夋搷浣滃垪
+    actionColumn: ActionColumn
+      ? ActionColumn
+      : {
+          width: 120,
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+          fixed: 'right',
+        }, //鑷畾涔夋搷浣滃垪
   });
 
   watch(

--
Gitblit v1.9.3