| | |
| | | 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 检验结果 */ |
| | |
| | | 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 }, |
| | | }); |
| | | } |