review(mes):qc-template 的实现代码

pull/871/MERGE
YunaiV 2026-02-18 22:48:56 +08:00
parent 50be43d9e2
commit 5f010acc5f
4 changed files with 32 additions and 11 deletions

View File

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

View File

@ -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 质检方案类型
}

View File

@ -9,7 +9,6 @@
v-loading="formLoading"
>
<el-form-item label="质检指标" prop="indicatorId">
<!-- TODO @AI检测项item-select 方式检测工具 -->
<el-select
v-model="formData.indicatorId"
placeholder="请选择质检指标"
@ -40,9 +39,21 @@
class="!w-1/1"
/>
</el-form-item>
<el-form-item label="单位" prop="unit">
<!-- TODO @AIunit api 查询下 -->
<el-input v-model="formData.unit" placeholder="请输入单位" />
<el-form-item label="单位" prop="unitMeasureId">
<el-select
v-model="formData.unitMeasureId"
placeholder="请选择计量单位"
filterable
clearable
class="!w-1/1"
>
<el-option
v-for="unit in unitMeasureList"
:key="unit.id"
:label="unit.name"
:value="unit.id"
/>
</el-select>
</el-form-item>
<el-form-item label="误差上限" prop="thresholdMax">
<el-input-number
@ -77,6 +88,7 @@
<script setup lang="ts">
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<QcIndicatorVO[]>([])
/** 计量单位精简列表 */
const unitMeasureList = ref<MdUnitMeasureVO[]>([])
/** 打开弹窗 */
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,

View File

@ -14,7 +14,7 @@
<el-option
v-for="item in itemList"
:key="item.id"
:label="item.code + ' - ' + item.name"
:label="item.code + ' - ' + item.name + (item.specification ? '' + item.specification + '' : '')"
:value="item.id"
/>
</el-select>