From ddc35c1d91e28509ceb86a50d8b10874936976aa Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 22 九月 2026 12:58:27 +0800
Subject: [PATCH] feat(mes): 优化质检模块功能并新增出货检验检测结果枚举

---
 src/views/mes/qc/ipqc/data.ts |  101 ++++++++++++++++----------------------------------
 1 files changed, 32 insertions(+), 69 deletions(-)

diff --git a/src/views/mes/qc/ipqc/data.ts b/src/views/mes/qc/ipqc/data.ts
index 78363f1..0a6c7a9 100644
--- a/src/views/mes/qc/ipqc/data.ts
+++ b/src/views/mes/qc/ipqc/data.ts
@@ -5,12 +5,7 @@
 
 import { h, markRaw } from 'vue';
 
-import {
-  DICT_TYPE,
-  MesAutoCodeRuleCode,
-  MesProTaskStatusEnum,
-  MesProWorkOrderStatusEnum,
-} from '@vben/constants';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
 import { Button } from 'ant-design-vue';
@@ -19,10 +14,7 @@
 import { getTemplateItemOptionList } from '#/api/mes/qc/template/item';
 import { getSimpleUserList } from '#/api/system/user';
 import { getRangePickerDefaultProps } from '#/utils';
-import { MdItemSelect } from '#/views/mes/md/item/components';
-import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
-import { ProTaskSelect } from '#/views/mes/pro/task/components';
-import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
 
 /** 琛ㄥ崟绫诲瀷 */
 export type FormType = 'create' | 'detail' | 'update';
@@ -152,60 +144,31 @@
       },
     },
     {
-      fieldName: 'workOrderId',
-      label: '鐢熶骇璁㈠崟',
-      component: markRaw(ProWorkOrderSelect),
+      fieldName: 'itemId',
+      label: '浜у搧鐗╂枡',
+      component: markRaw(MdmItemSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
-        status: MesProWorkOrderStatusEnum.CONFIRMED,
-        // 璁㈠崟鍙樻洿鏃舵竻绌虹敓浜т换鍔�
-        onChange: () => formApi?.setFieldValue('taskId', undefined),
+        placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
       },
       rules: 'selectRequired',
       dependencies: {
         triggerFields: ['sourceDocId'],
         componentProps: (values) => ({
           disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
-          status: MesProWorkOrderStatusEnum.CONFIRMED,
-          onChange: () => formApi?.setFieldValue('taskId', undefined),
+          placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
         }),
       },
     },
     {
-      fieldName: 'workstationId',
-      label: '宸ヤ綅',
-      component: markRaw(MdWorkstationSelect),
+      fieldName: 'batchCode',
+      label: '鎵瑰彿',
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨宸ヤ綅',
+        allowClear: true,
+        maxlength: 100,
+        placeholder: '璇疯緭鍏ユ壒鍙�',
       },
-      rules: 'selectRequired',
-      dependencies: {
-        triggerFields: ['sourceDocId'],
-        componentProps: (values) => ({
-          disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨宸ヤ綅',
-        }),
-      },
-    },
-    {
-      fieldName: 'taskId',
-      label: '鐢熶骇浠诲姟',
-      component: markRaw(ProTaskSelect),
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇浠诲姟',
-        statuses: [MesProTaskStatusEnum.PREPARE],
-      },
-      dependencies: {
-        triggerFields: ['sourceDocId', 'workOrderId', 'workstationId'],
-        componentProps: (values) => ({
-          disabled: !!values.sourceDocId || !values.workOrderId,
-          placeholder: '璇烽�夋嫨鐢熶骇浠诲姟',
-          statuses: [MesProTaskStatusEnum.PREPARE],
-          workOrderId: values.workOrderId,
-          workstationId: values.workstationId,
-        }),
-      },
+      rules: 'required',
     },
     {
       fieldName: 'templateId',
@@ -220,23 +183,22 @@
       },
       rules: 'selectRequired',
       dependencies: {
-        triggerFields: ['workOrderId', 'taskId'],
+        triggerFields: ['itemId'],
         componentProps: (values) => ({
           api: getTemplateItemOptionList,
           autoSelect: 'first',
           labelField: 'templateName',
           valueField: 'templateId',
-          disabled: formType !== 'create' || !values.workOrderId,
-          params: values.workOrderId
+          disabled: formType !== 'create' || !values.itemId,
+          params: values.itemId
             ? {
                 qcType: 2,
-                workOrderId: values.workOrderId,
-                taskId: values.taskId,
+                itemId: values.itemId,
               }
             : {},
-          placeholder: values.workOrderId
+          placeholder: values.itemId
             ? '璇烽�夋嫨璐ㄦ鏂规'
-            : '璇峰厛閫夋嫨鐢熶骇璁㈠崟',
+            : '璇峰厛閫夋嫨浜у搧鐗╂枡',
         }),
       },
     },
@@ -465,17 +427,18 @@
       },
     },
     {
-      fieldName: 'workOrderId',
-      label: '鐢熶骇璁㈠崟',
-      component: markRaw(ProWorkOrderSelect),
+      fieldName: 'batchCode',
+      label: '鎵瑰彿',
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
+        allowClear: true,
+        placeholder: '璇疯緭鍏ユ壒鍙�',
       },
     },
     {
       fieldName: 'itemId',
       label: '浜у搧鐗╂枡',
-      component: markRaw(MdItemSelect),
+      component: markRaw(MdmItemSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
       },
@@ -525,11 +488,6 @@
       },
     },
     {
-      field: 'workOrderCode',
-      title: '鐢熶骇璁㈠崟缂栧彿',
-      width: 140,
-    },
-    {
       field: 'itemCode',
       title: '浜у搧鐗╂枡缂栫爜',
       width: 130,
@@ -543,6 +501,11 @@
       field: 'itemSpecification',
       title: '瑙勬牸鍨嬪彿',
       width: 130,
+    },
+    {
+      field: 'batchCode',
+      title: '鎵瑰彿',
+      width: 140,
     },
     {
       field: 'unitName',
@@ -585,7 +548,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 180,
+      width: 420,
       fixed: 'right',
       slots: { default: 'actions' },
     },

--
Gitblit v1.9.3