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 @@