diff --git a/src/api/mes/qc/template/index.ts b/src/api/mes/qc/template/index.ts index 560c55bbf..4ff11713e 100644 --- a/src/api/mes/qc/template/index.ts +++ b/src/api/mes/qc/template/index.ts @@ -18,7 +18,7 @@ export interface QcTemplateIndicatorVO { indicatorId: number // 质检指标ID checkMethod: string // 检测方法 standardValue: number // 标准值 - unit: string // 单位 + unitMeasureId: number // 计量单位ID thresholdMax: number // 误差上限 thresholdMin: number // 误差下限 docUrl: string // 说明图URL @@ -28,6 +28,8 @@ export interface QcTemplateIndicatorVO { indicatorName: string // 检测项名称 indicatorType: string // 检测项类型(字典 mes_index_type) indicatorTool: string // 检测工具 + // JOIN mes_md_unit_measure + unitMeasureName: string // 计量单位名称 } // MES 质检方案-产品关联 VO diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 7d8caecf0..6341e65d4 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -268,5 +268,6 @@ export enum DICT_TYPE { MES_DEFECT_LEVEL = 'mes_defect_level', // MES 缺陷等级 MES_PRO_WORK_ORDER_STATUS = 'mes_pro_work_order_status', // MES 生产工单状态 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_PRO_WORK_ORDER_TYPE = 'mes_pro_work_order_type', // MES 工单类型 + MES_QC_TYPE = 'mes_qc_type', // MES 质检方案类型 } diff --git a/src/views/mes/qc/template/TemplateIndicatorForm.vue b/src/views/mes/qc/template/TemplateIndicatorForm.vue index 4ab88042d..616882f68 100644 --- a/src/views/mes/qc/template/TemplateIndicatorForm.vue +++ b/src/views/mes/qc/template/TemplateIndicatorForm.vue @@ -9,7 +9,6 @@ v-loading="formLoading" > - - - - + + + + import { QcTemplateApi, QcTemplateIndicatorVO } from '@/api/mes/qc/template' import { QcIndicatorApi, QcIndicatorVO } from '@/api/mes/qc/indicator' +import { MdUnitMeasureApi, MdUnitMeasureVO } from '@/api/mes/md/unitmeasure' defineOptions({ name: 'TemplateIndicatorForm' }) @@ -93,7 +105,7 @@ const formData = ref({ indicatorId: undefined, checkMethod: undefined, standardValue: undefined, - unit: undefined, + unitMeasureId: undefined, thresholdMax: undefined, thresholdMin: undefined, docUrl: undefined, @@ -106,6 +118,8 @@ const formRef = ref() /** 质检指标精简列表 */ const indicatorList = ref([]) +/** 计量单位精简列表 */ +const unitMeasureList = ref([]) /** 打开弹窗 */ const open = async (type: string, id?: number, templateId?: number) => { @@ -114,8 +128,12 @@ const open = async (type: string, id?: number, templateId?: number) => { formType.value = type resetForm() formData.value.templateId = templateId - // 加载质检指标列表 - indicatorList.value = await QcIndicatorApi.getIndicatorSimpleList() + // 并行加载下拉数据 + // TODO @AI:串行加载; + ;[indicatorList.value, unitMeasureList.value] = await Promise.all([ + QcIndicatorApi.getIndicatorSimpleList(), + MdUnitMeasureApi.getUnitMeasureSimpleList() + ]) if (id) { formLoading.value = true try { @@ -156,7 +174,7 @@ const resetForm = () => { indicatorId: undefined, checkMethod: undefined, standardValue: undefined, - unit: undefined, + unitMeasureId: undefined, thresholdMax: undefined, thresholdMin: undefined, docUrl: undefined, diff --git a/src/views/mes/qc/template/TemplateItemForm.vue b/src/views/mes/qc/template/TemplateItemForm.vue index 7b9ffc81c..de705399e 100644 --- a/src/views/mes/qc/template/TemplateItemForm.vue +++ b/src/views/mes/qc/template/TemplateItemForm.vue @@ -14,7 +14,7 @@