From 0558f330f7e3781b91d00ed4a12e60d9fa469d87 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 17 九月 2026 13:11:12 +0800
Subject: [PATCH] feat(mes): 增加质检指标层级结构与多批次录入功能
---
src/views/mes/qc/indicator/data.ts | 95 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 insertions(+), 0 deletions(-)
diff --git a/src/views/mes/qc/indicator/data.ts b/src/views/mes/qc/indicator/data.ts
index a20cc84..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,6 +259,19 @@
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,
@@ -194,6 +283,12 @@
width: 140,
},
{
+ field: 'unitText',
+ title: '鍗曚綅',
+ width: 80,
+ formatter: ({ cellValue }) => cellValue || '-',
+ },
+ {
field: 'resultType',
title: '缁撴灉鍊肩被鍨�',
width: 120,
--
Gitblit v1.9.3