From d841a8ea6dc2f7fdedbf0ea2b1e539842f5f3e37 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 12 十月 2026 19:45:36 +0800
Subject: [PATCH] 宁夏-九鸿 1.发版配置文件修改

---
 src/views/mes/qc/indicator/data.ts |  105 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 97 insertions(+), 8 deletions(-)

diff --git a/src/views/mes/qc/indicator/data.ts b/src/views/mes/qc/indicator/data.ts
index a34234a..32c409e 100644
--- a/src/views/mes/qc/indicator/data.ts
+++ b/src/views/mes/qc/indicator/data.ts
@@ -7,12 +7,14 @@
 import {
   DICT_TYPE,
   MesAutoCodeRuleCode,
+  MesQcIndicatorItemType,
   MesQcResultValueType,
 } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
 import { Button } from 'ant-design-vue';
 
+import { getIndicatorList } from '#/api/mes/qc/indicator';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
 
 import { QcIndicatorResultSpecificationInput } from './components';
@@ -63,6 +65,42 @@
       rules: 'required',
     },
     {
+      fieldName: 'itemType',
+      label: '鏉$洰绫诲瀷',
+      component: 'RadioGroup',
+      defaultValue: MesQcIndicatorItemType.RECORD,
+      componentProps: {
+        options: [
+          { label: '褰曞叆椤�', value: MesQcIndicatorItemType.RECORD },
+          { label: '鍒嗙粍椤�', value: MesQcIndicatorItemType.GROUP },
+        ],
+        optionType: 'button',
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'parentId',
+      label: '鎵�灞炲垎缁�',
+      component: 'ApiSelect',
+      componentProps: {
+        allowClear: true,
+        api: async () => {
+          const list = await getIndicatorList();
+          // 浠呭彲閫夋嫨鍒嗙粍椤逛綔涓虹埗绾э紝涓斿垎缁勯」鏈韩涓嶅彲鍐嶆寕鐖剁骇锛堜粎涓ょ骇锛�
+          return list
+            .filter((i) => i.itemType === MesQcIndicatorItemType.GROUP)
+            .map((i) => ({ label: i.name, value: i.id }));
+        },
+        placeholder: '涓嶉�夊垯涓洪《绾ч」',
+      },
+      dependencies: {
+        triggerFields: ['itemType'],
+        // 鍒嗙粍椤瑰繀椤讳负椤剁骇锛岄殣钘忓苟娓呯┖涓婄骇
+        show: (values) => values.itemType !== MesQcIndicatorItemType.GROUP,
+        if: (values) => values.itemType !== MesQcIndicatorItemType.GROUP,
+      },
+    },
+    {
       fieldName: 'type',
       label: '妫�娴嬮」绫诲瀷',
       component: 'Select',
@@ -74,12 +112,45 @@
       rules: 'required',
     },
     {
+      fieldName: 'formulaText',
+      label: '鍏紡鏂囨湰',
+      component: 'Input',
+      componentProps: {
+        maxlength: 500,
+        placeholder: '濡� w3 = c 脳 V 脳 0.06005 / m 脳 100%锛堜粎灞曠ず锛屼笉鍙備笌璁$畻锛�',
+      },
+      dependencies: {
+        triggerFields: ['itemType'],
+        if: (values) => values.itemType === MesQcIndicatorItemType.GROUP,
+      },
+    },
+    {
       fieldName: 'tool',
       label: '妫�娴嬪伐鍏�',
       component: 'Input',
       componentProps: {
         maxlength: 100,
         placeholder: '璇疯緭鍏ユ娴嬪伐鍏�',
+      },
+    },
+    {
+      fieldName: 'unitText',
+      label: '鍗曚綅鏂囨湰',
+      component: 'Input',
+      componentProps: {
+        maxlength: 50,
+        placeholder: '濡� %銆乬銆佹棤锛屼粎灞曠ず涓嶅弬涓庤绠�',
+      },
+    },
+    {
+      fieldName: 'sortOrder',
+      label: '鎺掑簭鍙�',
+      component: 'InputNumber',
+      defaultValue: 0,
+      componentProps: {
+        min: 0,
+        precision: 0,
+        placeholder: '鍚岀骇鎺掑簭锛屾暟瀛楀皬鐨勫湪鍓�',
       },
     },
     {
@@ -95,6 +166,11 @@
         placeholder: '璇烽�夋嫨缁撴灉鍊肩被鍨�',
       },
       rules: 'required',
+      dependencies: {
+        triggerFields: ['itemType'],
+        // 鍒嗙粍椤逛笉褰曞叆缁撴灉鍊硷紝闅愯棌骞惰烦杩囨牎楠�
+        if: (values) => values.itemType !== MesQcIndicatorItemType.GROUP,
+      },
     },
     {
       fieldName: 'resultSpecification',
@@ -183,18 +259,34 @@
       minWidth: 160,
     },
     {
+      field: 'itemType',
+      title: '鏉$洰绫诲瀷',
+      width: 90,
+      formatter: ({ cellValue }) =>
+        cellValue === MesQcIndicatorItemType.GROUP ? '鍒嗙粍椤�' : '褰曞叆椤�',
+    },
+    {
+      field: 'parentName',
+      title: '鎵�灞炲垎缁�',
+      width: 120,
+      formatter: ({ cellValue }) => cellValue || '-',
+    },
+    {
       field: 'type',
       title: '妫�娴嬮」绫诲瀷',
       width: 120,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MES_INDICATOR_TYPE },
-      },
+      slots: { default: 'type' },
     },
     {
       field: 'tool',
       title: '妫�娴嬪伐鍏�',
       width: 140,
+    },
+    {
+      field: 'unitText',
+      title: '鍗曚綅',
+      width: 80,
+      formatter: ({ cellValue }) => cellValue || '-',
     },
     {
       field: 'resultType',
@@ -273,10 +365,7 @@
       field: 'type',
       title: '妫�娴嬮」绫诲瀷',
       width: 120,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MES_INDICATOR_TYPE },
-      },
+      slots: { default: 'type' },
     },
     {
       field: 'tool',

--
Gitblit v1.9.3