From e4994fccfb49ebfb108ba62cbd82aea4e004f6d8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 15 十月 2026 10:02:46 +0800
Subject: [PATCH] fix(mes/qc): 不合格品处理单的不合格物料改查 MDM 物料

---
 src/views/mes/qc/ipqc/data.ts |   79 ++++++++++++++++++++++++++++++++-------
 1 files changed, 64 insertions(+), 15 deletions(-)

diff --git a/src/views/mes/qc/ipqc/data.ts b/src/views/mes/qc/ipqc/data.ts
index e61d03e..4cf2854 100644
--- a/src/views/mes/qc/ipqc/data.ts
+++ b/src/views/mes/qc/ipqc/data.ts
@@ -1,4 +1,4 @@
-import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
+锘縤mport type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { MesQcIpqcApi } from '#/api/mes/qc/ipqc';
 import type { MesQcIpqcLineApi } from '#/api/mes/qc/ipqc/line';
@@ -10,13 +10,15 @@
   MesAutoCodeRuleCode,
   MesProTaskStatusEnum,
   MesProWorkOrderStatusEnum,
-} from '..\..\..\..\packages\constants\src';
-import { getDictOptions } from '..\..\..\..\packages\effects\hooks\src';
+} 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 { 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';
@@ -151,20 +153,21 @@
     },
     {
       fieldName: 'workOrderId',
-      label: '鐢熶骇宸ュ崟',
+      label: '鐢熶骇璁㈠崟',
       component: markRaw(ProWorkOrderSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇宸ュ崟',
+        allowClear: true,
+        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟锛堥�夊~锛�',
         status: MesProWorkOrderStatusEnum.CONFIRMED,
-        // 宸ュ崟鍙樻洿鏃舵竻绌虹敓浜т换鍔�
+        // 璁㈠崟鍙樻洿鏃舵竻绌虹敓浜т换鍔�
         onChange: () => formApi?.setFieldValue('taskId', undefined),
       },
-      rules: 'selectRequired',
       dependencies: {
         triggerFields: ['sourceDocId'],
         componentProps: (values) => ({
+          allowClear: true,
           disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨鐢熶骇宸ュ崟',
+          placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟锛堥�夊~锛�',
           status: MesProWorkOrderStatusEnum.CONFIRMED,
           onChange: () => formApi?.setFieldValue('taskId', undefined),
         }),
@@ -175,14 +178,15 @@
       label: '宸ヤ綅',
       component: markRaw(MdWorkstationSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨宸ヤ綅',
+        allowClear: true,
+        placeholder: '璇烽�夋嫨宸ヤ綅锛堥�夊~锛�',
       },
-      rules: 'selectRequired',
       dependencies: {
         triggerFields: ['sourceDocId'],
         componentProps: (values) => ({
+          allowClear: true,
           disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨宸ヤ綅',
+          placeholder: '璇烽�夋嫨宸ヤ綅锛堥�夊~锛�',
         }),
       },
     },
@@ -202,6 +206,36 @@
           statuses: [MesProTaskStatusEnum.PREPARE],
           workOrderId: values.workOrderId,
           workstationId: values.workstationId,
+        }),
+      },
+    },
+    {
+      fieldName: 'templateId',
+      label: '璐ㄦ鏂规',
+      component: 'ApiSelect',
+      componentProps: {
+        api: getTemplateItemOptionList,
+        autoSelect: 'first',
+        labelField: 'templateName',
+        valueField: 'templateId',
+        placeholder: '璇烽�夋嫨璐ㄦ鏂规',
+      },
+      rules: 'selectRequired',
+      dependencies: {
+        triggerFields: ['workOrderId', 'taskId'],
+        componentProps: (values) => ({
+          api: getTemplateItemOptionList,
+          autoSelect: 'first',
+          labelField: 'templateName',
+          valueField: 'templateId',
+          disabled: formType !== 'create',
+          // 鏈�夌敓浜ц鍗�/鐢熶骇浠诲姟鏃讹紝鍚庣鎸夈�岃繃绋嬫楠屻�嶇绫昏繑鍥炲叏閮ㄥ惎鐢ㄦ柟妗堬紙涓嶅啀瑕佹眰鍏堥�夌敓浜ц鍗曪級
+          params: {
+            qcType: 2,
+            ...(values.workOrderId ? { workOrderId: values.workOrderId } : {}),
+            ...(values.taskId ? { taskId: values.taskId } : {}),
+          },
+          placeholder: '璇烽�夋嫨璐ㄦ鏂规',
         }),
       },
     },
@@ -250,6 +284,7 @@
         precision: 2,
       },
       rules: 'required',
+      help: '涓嶅悎鏍煎搧鏁伴噺澶т簬0鏃讹紝淇濆瓨鍚庡皢鑷姩鐢熸垚涓嶅悎鏍煎鐞嗗崟',
     },
     {
       fieldName: 'laborScrapQuantity',
@@ -328,7 +363,7 @@
       componentProps: {
         format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨妫�娴嬫棩鏈�',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
       },
       rules: 'required',
     },
@@ -379,10 +414,10 @@
     },
     {
       fieldName: 'workOrderId',
-      label: '鐢熶骇宸ュ崟',
+      label: '鐢熶骇璁㈠崟',
       component: markRaw(ProWorkOrderSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇宸ュ崟',
+        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
       },
     },
     {
@@ -401,6 +436,14 @@
         allowClear: true,
         options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
         placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
+      },
+    },
+    {
+      fieldName: 'inspectDate',
+      label: '妫�娴嬫棩鏈�',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
       },
     },
   ];
@@ -431,7 +474,7 @@
     },
     {
       field: 'workOrderCode',
-      title: '鐢熶骇宸ュ崟缂栧彿',
+      title: '鐢熶骇璁㈠崟缂栧彿',
       width: 140,
     },
     {
@@ -469,6 +512,12 @@
       },
     },
     {
+      field: 'indicatorResultSummary',
+      title: '妫�娴嬬粨鏋滐紙妫�楠岄」锛�',
+      minWidth: 200,
+      showOverflow: 'tooltip',
+    },
+    {
       field: 'inspectDate',
       title: '妫�娴嬫棩鏈�',
       width: 120,

--
Gitblit v1.9.3