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/api/mes/qc/indicatorresult/index.ts | 85 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 82 insertions(+), 3 deletions(-)
diff --git a/src/api/mes/qc/indicatorresult/index.ts b/src/api/mes/qc/indicatorresult/index.ts
index dfa8a7f..6cc37f8 100644
--- a/src/api/mes/qc/indicatorresult/index.ts
+++ b/src/api/mes/qc/indicatorresult/index.ts
@@ -3,18 +3,35 @@
import { requestClient } from '#/api/request';
export namespace MesQcIndicatorResultApi {
- /** MES 妫�楠岀粨鏋滄槑缁� */
+ /** 骞宠娴嬮噺鎵规鏄庣粏锛堝悓涓�鎸囨爣鐨勪竴娆℃祴閲忥級 */
+ export interface Measure {
+ detailId?: number; // 鏄庣粏缂栧彿
+ resultId?: number; // 鍏宠仈妫�楠岀粨鏋� ID
+ measureNo?: number; // 娴嬮噺鎵规鍙凤紙浠� 1 寮�濮嬶級
+ value?: string; // 妫�娴嬪��
+ remark?: string; // 澶囨敞
+ }
+
+ /** MES 妫�楠岀粨鏋滄槑缁嗭紙鏍戝舰锛氬垎缁勯」涓嬫寕瀛愰」锛涘钩琛屾祴閲忔斁鍏� measures锛� */
export interface IndicatorResultDetail {
- id?: number; // 缂栧彿
+ id?: number; // 缂栧彿锛堢涓�鎵规槑缁� ID锛屽吋瀹规棫瀛楁锛�
resultId?: number; // 鍏宠仈妫�楠岀粨鏋� ID
indicatorId?: number; // 妫�娴嬫寚鏍� ID
- value?: string; // 妫�娴嬪�硷紙缁熶竴瀛樹负瀛楃涓诧級
+ value?: string; // 妫�娴嬪�硷紙绗竴鎵癸紝鍏煎鏃у瓧娈碉級
valueNumber?: number; // UI 鏁板�肩粦瀹氾紙鎻愪氦鍓嶈浆瀛楃涓诧級
+ measureNo?: number; // 娴嬮噺鎵规鍙凤紙鎻愪氦鐢紝榛樿 1锛�
remark?: string; // 澶囨敞
// 鍏宠仈鏌ヨ瀛楁锛堟潵鑷� indicator锛�
indicatorName?: string; // 妫�娴嬫寚鏍囧悕绉�
valueType?: number; // 璐ㄦ鍊肩被鍨�
valueSpecification?: string; // 鍊煎睘鎬�
+ parentId?: number; // 鐖舵寚鏍囩紪鍙凤紙0=椤剁骇锛�
+ itemType?: number; // 鏉$洰绫诲瀷锛�1=褰曞叆椤癸紝2=鍒嗙粍椤�
+ formulaText?: string; // 鍏紡灞曠ず鏂囨湰
+ unitText?: string; // 鍗曚綅鏂囨湰
+ sortOrder?: number; // 鍚岀骇鎺掑簭鍙�
+ measures?: Measure[]; // 骞宠娴嬮噺鎵规鍒楄〃锛堟寜 measureNo 鍗囧簭锛�
+ children?: IndicatorResultDetail[]; // 瀛愰」鍒楄〃锛堝垎缁勯」涓嬫寕锛�
}
/** MES 妫�楠岀粨鏋� */
@@ -71,3 +88,65 @@
export function deleteIndicatorResult(id: number) {
return requestClient.delete(`/mes/qc/indicator-result/delete?id=${id}`);
}
+
+// ==================== 妫�楠屾姤鍛婂崟锛堟墦鍗版暟鎹級 ====================
+
+export namespace MesQcReportApi {
+ /** 鎶ュ憡娴嬮噺鍊� */
+ export interface ReportMeasure {
+ measureNo?: number; // 娴嬮噺鎵规鍙�
+ value?: string; // 妫�娴嬪��
+ remark?: string; // 澶囨敞
+ }
+
+ /** 鎶ュ憡妫�楠岄」锛堟爲褰級 */
+ export interface ReportItem {
+ indicatorId?: number;
+ indicatorCode?: string;
+ indicatorName?: string;
+ parentId?: number;
+ itemType?: number; // 1=褰曞叆椤癸紝2=鍒嗙粍椤�
+ formulaText?: string;
+ unitText?: string;
+ sortOrder?: number;
+ checkMethod?: string; // 妫�娴嬫柟娉�
+ standardValue?: string; // 鏍囧噯鍊�
+ thresholdMin?: string; // 闃堝�间笅闄�
+ thresholdMax?: string; // 闃堝�间笂闄�
+ measures?: ReportMeasure[];
+ children?: ReportItem[];
+ }
+
+ /** 妫�楠屾姤鍛婂崟 */
+ export interface QcReport {
+ qcType?: number;
+ docCode?: string;
+ docName?: string;
+ itemCode?: string;
+ itemName?: string;
+ itemSpecification?: string;
+ batchNo?: string;
+ samplingLocation?: string;
+ certificateNo?: string;
+ executeStandard?: string;
+ samplingTime?: Date;
+ batchQuantity?: number;
+ checkResult?: number;
+ inspectorUserId?: number;
+ inspectorName?: string;
+ auditUserId?: number;
+ auditName?: string;
+ approveUserId?: number;
+ approveName?: string;
+ remark?: string;
+ measureNos?: number[]; // 鍒楀ご锛氭祴閲忔壒娆″彿鍒楄〃
+ items?: ReportItem[];
+ }
+}
+
+/** 鏌ヨ妫�楠屾姤鍛婂崟鏁版嵁锛堟墦鍗扮敤锛� */
+export function getQcReport(qcId: number, qcType: number, resultId?: number) {
+ return requestClient.get<MesQcReportApi.QcReport>('/mes/qc/indicator-result/report', {
+ params: { qcId, qcType, resultId },
+ });
+}
--
Gitblit v1.9.3