From a2d9fcb259621829bf4ec9680b5dbeac95ab5805 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 15 十月 2026 16:19:54 +0800
Subject: [PATCH] fix(crm): 销售目标达成分析默认查当前季度

---
 src/views/mes/qc/ipqc/data.ts |   89 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 75 insertions(+), 14 deletions(-)

diff --git a/src/views/mes/qc/ipqc/data.ts b/src/views/mes/qc/ipqc/data.ts
index e61d03e..a6a4399 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';
@@ -9,14 +9,15 @@
   DICT_TYPE,
   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 { getDateRangePickerDefaultProps } 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,12 +152,11 @@
     },
     {
       fieldName: 'workOrderId',
-      label: '鐢熶骇宸ュ崟',
+      label: '鐢熶骇璁㈠崟',
       component: markRaw(ProWorkOrderSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇宸ュ崟',
-        status: MesProWorkOrderStatusEnum.CONFIRMED,
-        // 宸ュ崟鍙樻洿鏃舵竻绌虹敓浜т换鍔�
+        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
+        // 璁㈠崟鍙樻洿鏃舵竻绌虹敓浜т换鍔�
         onChange: () => formApi?.setFieldValue('taskId', undefined),
       },
       rules: 'selectRequired',
@@ -164,8 +164,7 @@
         triggerFields: ['sourceDocId'],
         componentProps: (values) => ({
           disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨鐢熶骇宸ュ崟',
-          status: MesProWorkOrderStatusEnum.CONFIRMED,
+          placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
           onChange: () => formApi?.setFieldValue('taskId', undefined),
         }),
       },
@@ -202,6 +201,39 @@
           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' || !values.workOrderId,
+          params: values.workOrderId
+            ? {
+                qcType: 2,
+                workOrderId: values.workOrderId,
+                taskId: values.taskId,
+              }
+            : {},
+          placeholder: values.workOrderId
+            ? '璇烽�夋嫨璐ㄦ鏂规'
+            : '璇峰厛閫夋嫨鐢熶骇璁㈠崟',
         }),
       },
     },
@@ -250,6 +282,7 @@
         precision: 2,
       },
       rules: 'required',
+      help: '涓嶅悎鏍煎搧鏁伴噺澶т簬0鏃讹紝淇濆瓨鍚庡皢鑷姩鐢熸垚涓嶅悎鏍煎鐞嗗崟',
     },
     {
       fieldName: 'laborScrapQuantity',
@@ -328,7 +361,7 @@
       componentProps: {
         format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨妫�娴嬫棩鏈�',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
       },
       rules: 'required',
     },
@@ -379,10 +412,10 @@
     },
     {
       fieldName: 'workOrderId',
-      label: '鐢熶骇宸ュ崟',
+      label: '鐢熶骇璁㈠崟',
       component: markRaw(ProWorkOrderSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇宸ュ崟',
+        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
       },
     },
     {
@@ -401,6 +434,28 @@
         allowClear: true,
         options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
         placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
+      },
+    },
+    {
+      fieldName: 'inspectorUserId',
+      label: '妫�娴嬩汉鍛�',
+      component: 'ApiSelect',
+      componentProps: {
+        allowClear: true,
+        api: getSimpleUserList,
+        labelField: 'nickname',
+        placeholder: '璇烽�夋嫨妫�娴嬩汉鍛�',
+        showSearch: true,
+        optionFilterProp: 'label',
+        valueField: 'id',
+      },
+    },
+    {
+      fieldName: 'inspectDate',
+      label: '妫�娴嬫棩鏈�',
+      component: 'RangePicker',
+      componentProps: {
+        ...getDateRangePickerDefaultProps(),
       },
     },
   ];
@@ -431,7 +486,7 @@
     },
     {
       field: 'workOrderCode',
-      title: '鐢熶骇宸ュ崟缂栧彿',
+      title: '鐢熶骇璁㈠崟缂栧彿',
       width: 140,
     },
     {
@@ -469,6 +524,12 @@
       },
     },
     {
+      field: 'indicatorResultSummary',
+      title: '妫�娴嬬粨鏋滐紙妫�楠岄」锛�',
+      minWidth: 200,
+      showOverflow: 'tooltip',
+    },
+    {
       field: 'inspectDate',
       title: '妫�娴嬫棩鏈�',
       width: 120,

--
Gitblit v1.9.3