From 47c84d31046f31f3d0ba45afbfaa8a1d09c2707d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 21 Feb 2026 22:40:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(mes):=20=E8=B4=A8=E6=A3=80=E6=8C=87?= =?UTF-8?q?=E6=A0=87=20resultType=20=E6=94=B9=E4=B8=BA=20number=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8CresultSpec=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=B8=BA=20resultSpecification=EF=BC=8Cresult=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E9=87=8D=E5=91=BD=E5=90=8D=E4=B8=BA=20indica?= =?UTF-8?q?torresult?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. indicator/index.ts:resultType 从 string 改为 number,resultSpec 重命名为 resultSpecification 2. IndicatorForm.vue:getStrDictOptions 改为 getIntDictOptions,条件判断改为数字比较(4=DICT, 5=FILE) 3. indicator/index.vue:结果值类型筛选下拉改用 getIntDictOptions 4. qc/result 目录整体重命名为 qc/indicatorresult(views + api),更新 IqcForm.vue 的引用路径 --- src/api/mes/qc/indicator/index.ts | 4 +- src/api/mes/qc/indicatorresult/index.ts | 82 ++++++++ src/utils/dict.ts | 1 + src/views/mes/qc/indicator/IndicatorForm.vue | 42 ++-- src/views/mes/qc/indicator/index.vue | 4 +- .../mes/qc/indicatorresult/ResultForm.vue | 179 ++++++++++++++++++ .../mes/qc/indicatorresult/ResultList.vue | 110 +++++++++++ src/views/mes/qc/iqc/IqcForm.vue | 2 +- src/views/mes/qc/iqc/index.vue | 17 +- src/views/mes/utils/constants.ts | 6 + 10 files changed, 410 insertions(+), 37 deletions(-) create mode 100644 src/api/mes/qc/indicatorresult/index.ts create mode 100644 src/views/mes/qc/indicatorresult/ResultForm.vue create mode 100644 src/views/mes/qc/indicatorresult/ResultList.vue diff --git a/src/api/mes/qc/indicator/index.ts b/src/api/mes/qc/indicator/index.ts index b1c666431..bfe3b099f 100644 --- a/src/api/mes/qc/indicator/index.ts +++ b/src/api/mes/qc/indicator/index.ts @@ -7,8 +7,8 @@ export interface QcIndicatorVO { name: string // 检测项名称 type: string // 检测项类型 tool: string // 检测工具 - resultType: string // 结果值类型 - resultSpec: string // 结果值属性 + resultType: number // 结果值类型 + resultSpecification: string // 结果值属性 remark: string // 备注 } diff --git a/src/api/mes/qc/indicatorresult/index.ts b/src/api/mes/qc/indicatorresult/index.ts new file mode 100644 index 000000000..4a0cb3957 --- /dev/null +++ b/src/api/mes/qc/indicatorresult/index.ts @@ -0,0 +1,82 @@ +import request from '@/config/axios' + +// MES 检验结果 VO +export interface QcResultVO { + id: number // 编号 + code: string // 样品编号 + qcId: number // 关联质检单ID + qcType: number // 质检类型 + itemId: number // 产品物料ID + sn: string // 物资SN + remark: string // 备注 + createTime: Date // 创建时间 + // 关联查询字段 + qcCode: string // 质检单编号 + qcName: string // 质检单名称 + itemCode: string // 产品物料编码 + itemName: string // 产品物料名称 + itemSpecification: string // 规格型号 + unitName: string // 单位名称 + // 子表 + items: QcResultDetailVO[] // 检验结果明细列表 +} + +// MES 检验结果明细 VO +export interface QcResultDetailVO { + id: number // 编号 + resultId: number // 关联检验结果ID + indicatorId: number // 检测指标ID + toolId: number // 检测工具ID + unitMeasureId: number // 计量单位ID + valueType: number // 质检值类型 + valueSpecification: string // 值属性 + valueFloat: number // 浮点值 + valueInteger: number // 整数值 + valueText: string // 文字值 + valueDict: string // 字典项值 + valueFile: string // 文件值 + remark: string // 备注 + // 关联查询字段 + indicatorCode: string // 检测指标编码 + indicatorName: string // 检测指标名称 + indicatorType: string // 检测指标类型 + toolName: string // 检测工具名称 + checkMethod: string // 检测方法 + standardValue: number // 标准值 + unitMeasureName: string // 计量单位名称 + maxThreshold: number // 误差上限 + minThreshold: number // 误差下限 +} + +// MES 检验结果 API +export const QcResultApi = { + // 查询检验结果分页 + getResultPage: async (params: any) => { + return await request.get({ url: `/mes/qc/result/page`, params }) + }, + + // 查询检验结果详情(含明细) + getResult: async (id: number) => { + return await request.get({ url: `/mes/qc/result/get?id=` + id }) + }, + + // 新增检验结果 + createResult: async (data: any) => { + return await request.post({ url: `/mes/qc/result/create`, data }) + }, + + // 修改检验结果 + updateResult: async (data: any) => { + return await request.put({ url: `/mes/qc/result/update`, data }) + }, + + // 删除检验结果 + deleteResult: async (id: number) => { + return await request.delete({ url: `/mes/qc/result/delete?id=` + id }) + }, + + // 获取空值检测项模板(新建结果时用) + getDetailTemplate: async (qcId: number, qcType: number) => { + return await request.get({ url: `/mes/qc/result/detail-template`, params: { qcId, qcType } }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 0552870fb..10e90f0ae 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -277,6 +277,7 @@ export enum DICT_TYPE { MES_QC_IQC_STATUS = 'mes_qc_iqc_status', // MES 检验单状态 MES_QC_CHECK_RESULT = 'mes_qc_check_result', // MES 检测结果 MES_QC_SOURCE_DOC_TYPE = 'mes_qc_source_doc_type', // MES 来源单据类型 + MES_IPQC_TYPE = 'mes_ipqc_type', // MES IPQC 检验类型 MES_DV_CYCLE_TYPE = 'mes_dv_cycle_type', // MES 点检保养周期类型 MES_DV_CHECK_PLAN_STATUS = 'mes_dv_check_plan_status', // MES 点检保养方案状态 MES_MAINTEN_RECORD_STATUS = 'mes_mainten_record_status', // MES 保养记录状态 diff --git a/src/views/mes/qc/indicator/IndicatorForm.vue b/src/views/mes/qc/indicator/IndicatorForm.vue index e2dd795cb..059d3d836 100644 --- a/src/views/mes/qc/indicator/IndicatorForm.vue +++ b/src/views/mes/qc/indicator/IndicatorForm.vue @@ -11,9 +11,7 @@ @@ -21,12 +19,8 @@ - + + + - - + + 图片/照片 文件 + + - + @@ -84,7 +80,7 @@ diff --git a/src/views/mes/qc/indicatorresult/ResultList.vue b/src/views/mes/qc/indicatorresult/ResultList.vue new file mode 100644 index 000000000..f20c773a0 --- /dev/null +++ b/src/views/mes/qc/indicatorresult/ResultList.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/views/mes/qc/iqc/IqcForm.vue b/src/views/mes/qc/iqc/IqcForm.vue index f77416e77..d248fe106 100644 --- a/src/views/mes/qc/iqc/IqcForm.vue +++ b/src/views/mes/qc/iqc/IqcForm.vue @@ -214,7 +214,7 @@ import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue' import UserSelect from '@/views/system/user/components/UserSelect.vue' import QcTemplateSelect from '@/views/mes/qc/template/components/QcTemplateSelect.vue' import IqcLineList from './IqcLineList.vue' -import ResultList from '@/views/mes/qc/result/ResultList.vue' +import ResultList from '@/views/mes/qc/indicatorresult/ResultList.vue' import { MesQcTypeEnum } from '@/views/mes/utils/constants' defineOptions({ name: 'IqcForm' }) diff --git a/src/views/mes/qc/iqc/index.vue b/src/views/mes/qc/iqc/index.vue index 80142f7b8..f33035b98 100644 --- a/src/views/mes/qc/iqc/index.vue +++ b/src/views/mes/qc/iqc/index.vue @@ -169,7 +169,7 @@ > 完成 - +