From f063fdb79367d4c51a6da1541ff55833d2c49a38 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 22 九月 2026 17:37:49 +0800
Subject: [PATCH] feat(mes): 更新IPQC过程检验功能

---
 src/views/mes/qc/ipqc/data.ts |  113 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 56 insertions(+), 57 deletions(-)

diff --git a/src/views/mes/qc/ipqc/data.ts b/src/views/mes/qc/ipqc/data.ts
index d035a14..afb351c 100644
--- a/src/views/mes/qc/ipqc/data.ts
+++ b/src/views/mes/qc/ipqc/data.ts
@@ -5,22 +5,16 @@
 
 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';
 
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import { getTemplateItemOptionList } from '#/api/mes/qc/template/item';
 import { getSimpleUserList } from '#/api/system/user';
-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 { getRangePickerDefaultProps } from '#/utils';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
 
 /** 琛ㄥ崟绫诲瀷 */
 export type FormType = 'create' | 'detail' | 'update';
@@ -150,58 +144,53 @@
       },
     },
     {
-      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: '璇烽�夋嫨宸ヤ綅',
+        maxlength: 100,
+        placeholder: '璇疯緭鍏ユ壒鍙�',
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'templateId',
+      label: '璐ㄦ鏂规',
+      component: 'ApiSelect',
+      componentProps: {
+        api: getTemplateItemOptionList,
+        autoSelect: 'first',
+        labelField: 'templateName',
+        valueField: 'templateId',
+        placeholder: '璇烽�夋嫨璐ㄦ鏂规',
       },
       rules: 'selectRequired',
       dependencies: {
-        triggerFields: ['sourceDocId'],
+        triggerFields: ['itemId'],
         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,
+          api: getTemplateItemOptionList,
+          autoSelect: 'first',
+          labelField: 'templateName',
+          valueField: 'templateId',
+          disabled: formType !== 'create' || !values.itemId,
+          params: values.itemId ? { itemId: values.itemId, qcType: 2 } : {},
+          placeholder: values.itemId ? '璇烽�夋嫨璐ㄦ鏂规' : '璇峰厛閫夋嫨浜у搧鐗╂枡',
         }),
       },
     },
@@ -250,6 +239,7 @@
         precision: 2,
       },
       rules: 'required',
+      help: '涓嶅悎鏍煎搧鏁伴噺澶т簬0鏃讹紝淇濆瓨鍚庡皢鑷姩鐢熸垚涓嶅悎鏍煎鐞嗗崟',
     },
     {
       fieldName: 'laborScrapQuantity',
@@ -328,7 +318,7 @@
       componentProps: {
         format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨妫�娴嬫棩鏈�',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
       },
       rules: 'required',
     },
@@ -378,17 +368,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: '璇烽�夋嫨浜у搧鐗╂枡',
       },
@@ -401,6 +392,14 @@
         allowClear: true,
         options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
         placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
+      },
+    },
+    {
+      fieldName: 'inspectDate',
+      label: '妫�娴嬫棩鏈�',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
       },
     },
   ];
@@ -430,11 +429,6 @@
       },
     },
     {
-      field: 'workOrderCode',
-      title: '鐢熶骇璁㈠崟缂栧彿',
-      width: 140,
-    },
-    {
       field: 'itemCode',
       title: '浜у搧鐗╂枡缂栫爜',
       width: 130,
@@ -450,6 +444,11 @@
       width: 130,
     },
     {
+      field: 'batchCode',
+      title: '鎵瑰彿',
+      width: 140,
+    },
+    {
       field: 'unitName',
       title: '鍗曚綅',
       width: 80,

--
Gitblit v1.9.3