From e7a066d9c5f9e915d3e271fafef1d8d3835dd490 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 19 Feb 2026 12:41:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes):=20=E9=87=8D=E6=9E=84=E8=B4=A8?= =?UTF-8?q?=E6=A3=80=E6=96=B9=E6=A1=88=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E7=BB=B4=E6=8A=A4=E7=A7=BB=E5=85=A5=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - api/mes/qc/template/ 拆分为 index.ts / indicator.ts / item.ts 三个文件 - TemplateForm.vue:Dialog 宽度改为 900px,编辑模式下新增 el-tabs, 内嵌检测指标项(TemplateIndicatorList)和产品关联(TemplateItemList)子表 - index.vue:移除底部子表区域及 currentRow/activeTab 逻辑,简化为纯列表页; 检测种类搜索字段由 types 改为 type(单选) - TemplateIndicatorList/Form、TemplateItemList/Form:更新 import 路径至拆分后的 API 文件 - 清理所有 TODO @AI 注释 --- src/api/mes/qc/template/index.ts | 97 ------------------- src/api/mes/qc/template/indicator.ts | 51 ++++++++++ src/api/mes/qc/template/item.ts | 48 +++++++++ src/utils/dict.ts | 2 + src/views/mes/qc/template/TemplateForm.vue | 25 ++++- .../mes/qc/template/TemplateIndicatorForm.vue | 15 ++- .../mes/qc/template/TemplateIndicatorList.vue | 10 +- .../mes/qc/template/TemplateItemForm.vue | 10 +- .../mes/qc/template/TemplateItemList.vue | 8 +- src/views/mes/qc/template/index.vue | 49 +--------- 10 files changed, 155 insertions(+), 160 deletions(-) create mode 100644 src/api/mes/qc/template/indicator.ts create mode 100644 src/api/mes/qc/template/item.ts diff --git a/src/api/mes/qc/template/index.ts b/src/api/mes/qc/template/index.ts index 4ff11713e..9de9877cf 100644 --- a/src/api/mes/qc/template/index.ts +++ b/src/api/mes/qc/template/index.ts @@ -10,51 +10,8 @@ export interface QcTemplateVO { remark: string // 备注 } -// MES 质检方案-检测指标项 VO -// TODO @AI:拆成多个,参考别的 api ts; -export interface QcTemplateIndicatorVO { - id: number // 编号 - templateId: number // 质检方案ID - indicatorId: number // 质检指标ID - checkMethod: string // 检测方法 - standardValue: number // 标准值 - unitMeasureId: number // 计量单位ID - thresholdMax: number // 误差上限 - thresholdMin: number // 误差下限 - docUrl: string // 说明图URL - remark: string // 备注 - // JOIN mes_qc_indicator - indicatorCode: string // 检测项编码 - indicatorName: string // 检测项名称 - indicatorType: string // 检测项类型(字典 mes_index_type) - indicatorTool: string // 检测工具 - // JOIN mes_md_unit_measure - unitMeasureName: string // 计量单位名称 -} - -// MES 质检方案-产品关联 VO -// TODO @AI:拆成多个,参考别的 api ts; -export interface QcTemplateItemVO { - id: number // 编号 - templateId: number // 质检方案ID - itemId: number // 产品物料ID - quantityCheck: number // 最低检测数 - quantityUnqualified: number // 最大不合格数 - criticalRate: number // 最大致命缺陷率(%) - majorRate: number // 最大严重缺陷率(%) - minorRate: number // 最大轻微缺陷率(%) - remark: string // 备注 - // JOIN mes_md_item - itemCode: string // 物料编码 - itemName: string // 物料名称 - specification: string // 规格型号 - unitMeasureName: string // 计量单位名称 -} - // MES 质检方案 API export const QcTemplateApi = { - // ========== 质检方案主表 ========== - // 查询质检方案分页 getTemplatePage: async (params: any) => { return await request.get({ url: `/mes/qc/template/page`, params }) @@ -88,59 +45,5 @@ export const QcTemplateApi = { // 导出质检方案 Excel exportTemplate: async (params: any) => { return await request.download({ url: `/mes/qc/template/export-excel`, params }) - }, - - // ========== 质检方案-检测指标项 ========== - - // 查询检测指标项分页 - getTemplateIndicatorPage: async (params: any) => { - return await request.get({ url: `/mes/qc/template/indicator/page`, params }) - }, - - // 查询检测指标项详情 - getTemplateIndicator: async (id: number) => { - return await request.get({ url: `/mes/qc/template/indicator/get?id=` + id }) - }, - - // 新增检测指标项 - createTemplateIndicator: async (data: QcTemplateIndicatorVO) => { - return await request.post({ url: `/mes/qc/template/indicator/create`, data }) - }, - - // 修改检测指标项 - updateTemplateIndicator: async (data: QcTemplateIndicatorVO) => { - return await request.put({ url: `/mes/qc/template/indicator/update`, data }) - }, - - // 删除检测指标项 - deleteTemplateIndicator: async (id: number) => { - return await request.delete({ url: `/mes/qc/template/indicator/delete?id=` + id }) - }, - - // ========== 质检方案-产品关联 ========== - - // 查询产品关联分页 - getTemplateItemPage: async (params: any) => { - return await request.get({ url: `/mes/qc/template/item/page`, params }) - }, - - // 查询产品关联详情 - getTemplateItem: async (id: number) => { - return await request.get({ url: `/mes/qc/template/item/get?id=` + id }) - }, - - // 新增产品关联 - createTemplateItem: async (data: QcTemplateItemVO) => { - return await request.post({ url: `/mes/qc/template/item/create`, data }) - }, - - // 修改产品关联 - updateTemplateItem: async (data: QcTemplateItemVO) => { - return await request.put({ url: `/mes/qc/template/item/update`, data }) - }, - - // 删除产品关联 - deleteTemplateItem: async (id: number) => { - return await request.delete({ url: `/mes/qc/template/item/delete?id=` + id }) } } diff --git a/src/api/mes/qc/template/indicator.ts b/src/api/mes/qc/template/indicator.ts new file mode 100644 index 000000000..9d9dbdf31 --- /dev/null +++ b/src/api/mes/qc/template/indicator.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +// TODO @AI:indicator/index.ts 迁移过去; +// MES 质检方案-检测指标项 VO +export interface QcTemplateIndicatorVO { + id: number // 编号 + templateId: number // 质检方案ID + indicatorId: number // 质检指标ID + checkMethod: string // 检测方法 + standardValue: number // 标准值 + unitMeasureId: number // 计量单位ID + thresholdMax: number // 误差上限 + thresholdMin: number // 误差下限 + docUrl: string // 说明图URL + remark: string // 备注 + // JOIN mes_qc_indicator + indicatorCode: string // 检测项编码 + indicatorName: string // 检测项名称 + indicatorType: string // 检测项类型(字典 mes_index_type) + indicatorTool: string // 检测工具 + // JOIN mes_md_unit_measure + unitMeasureName: string // 计量单位名称 +} + +// MES 质检方案-检测指标项 API +export const QcTemplateIndicatorApi = { + // 查询检测指标项分页 + getTemplateIndicatorPage: async (params: any) => { + return await request.get({ url: `/mes/qc/template/indicator/page`, params }) + }, + + // 查询检测指标项详情 + getTemplateIndicator: async (id: number) => { + return await request.get({ url: `/mes/qc/template/indicator/get?id=` + id }) + }, + + // 新增检测指标项 + createTemplateIndicator: async (data: QcTemplateIndicatorVO) => { + return await request.post({ url: `/mes/qc/template/indicator/create`, data }) + }, + + // 修改检测指标项 + updateTemplateIndicator: async (data: QcTemplateIndicatorVO) => { + return await request.put({ url: `/mes/qc/template/indicator/update`, data }) + }, + + // 删除检测指标项 + deleteTemplateIndicator: async (id: number) => { + return await request.delete({ url: `/mes/qc/template/indicator/delete?id=` + id }) + } +} diff --git a/src/api/mes/qc/template/item.ts b/src/api/mes/qc/template/item.ts new file mode 100644 index 000000000..211b925b6 --- /dev/null +++ b/src/api/mes/qc/template/item.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +// TODO @AI:item/index.ts 迁移过去; +// MES 质检方案-产品关联 VO +export interface QcTemplateItemVO { + id: number // 编号 + templateId: number // 质检方案ID + itemId: number // 产品物料ID + quantityCheck: number // 最低检测数 + quantityUnqualified: number // 最大不合格数 + criticalRate: number // 最大致命缺陷率(%) + majorRate: number // 最大严重缺陷率(%) + minorRate: number // 最大轻微缺陷率(%) + remark: string // 备注 + // JOIN mes_md_item + itemCode: string // 物料编码 + itemName: string // 物料名称 + specification: string // 规格型号 + unitMeasureName: string // 计量单位名称 +} + +// MES 质检方案-产品关联 API +export const QcTemplateItemApi = { + // 查询产品关联分页 + getTemplateItemPage: async (params: any) => { + return await request.get({ url: `/mes/qc/template/item/page`, params }) + }, + + // 查询产品关联详情 + getTemplateItem: async (id: number) => { + return await request.get({ url: `/mes/qc/template/item/get?id=` + id }) + }, + + // 新增产品关联 + createTemplateItem: async (data: QcTemplateItemVO) => { + return await request.post({ url: `/mes/qc/template/item/create`, data }) + }, + + // 修改产品关联 + updateTemplateItem: async (data: QcTemplateItemVO) => { + return await request.put({ url: `/mes/qc/template/item/update`, data }) + }, + + // 删除产品关联 + deleteTemplateItem: async (id: number) => { + return await request.delete({ url: `/mes/qc/template/item/delete?id=` + id }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 6341e65d4..469d227ae 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -270,4 +270,6 @@ export enum DICT_TYPE { MES_PRO_WORK_ORDER_SOURCE_TYPE = 'mes_pro_work_order_source_type', // MES 工单来源类型 MES_PRO_WORK_ORDER_TYPE = 'mes_pro_work_order_type', // MES 工单类型 MES_QC_TYPE = 'mes_qc_type', // MES 质检方案类型 + MES_PRO_LINK_TYPE = 'mes_pro_link_type', // MES 工序关系类型 + MES_TIME_UNIT_TYPE = 'mes_time_unit_type', // MES 时间单位 } diff --git a/src/views/mes/qc/template/TemplateForm.vue b/src/views/mes/qc/template/TemplateForm.vue index 5f9f8c93d..0cc55ea96 100644 --- a/src/views/mes/qc/template/TemplateForm.vue +++ b/src/views/mes/qc/template/TemplateForm.vue @@ -1,6 +1,7 @@