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 indicatorId: number // 质检指标ID
checkMethod: string // 检测方法 checkMethod: string // 检测方法
standardValue: number // 标准值 standardValue: number // 标准值
unit: string // 单位 unitMeasureId: number // 计量单位ID
thresholdMax: number // 误差上限 thresholdMax: number // 误差上限
thresholdMin: number // 误差下限 thresholdMin: number // 误差下限
docUrl: string // 说明图URL docUrl: string // 说明图URL
@ -28,6 +28,8 @@ export interface QcTemplateIndicatorVO {
indicatorName: string // 检测项名称 indicatorName: string // 检测项名称
indicatorType: string // 检测项类型(字典 mes_index_type indicatorType: string // 检测项类型(字典 mes_index_type
indicatorTool: string // 检测工具 indicatorTool: string // 检测工具
// JOIN mes_md_unit_measure
unitMeasureName: string // 计量单位名称
} }
// MES 质检方案-产品关联 VO // MES 质检方案-产品关联 VO

View File

@ -268,5 +268,6 @@ export enum DICT_TYPE {
MES_DEFECT_LEVEL = 'mes_defect_level', // MES 缺陷等级 MES_DEFECT_LEVEL = 'mes_defect_level', // MES 缺陷等级
MES_PRO_WORK_ORDER_STATUS = 'mes_pro_work_order_status', // 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_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" v-loading="formLoading"
> >
<el-form-item label="质检指标" prop="indicatorId"> <el-form-item label="质检指标" prop="indicatorId">
<!-- TODO @AI检测项item-select 方式检测工具 -->
<el-select <el-select
v-model="formData.indicatorId" v-model="formData.indicatorId"
placeholder="请选择质检指标" placeholder="请选择质检指标"
@ -40,9 +39,21 @@
class="!w-1/1" class="!w-1/1"
/> />
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unitMeasureId">
<!-- TODO @AIunit api 查询下 --> <el-select
<el-input v-model="formData.unit" placeholder="请输入单位" /> 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>
<el-form-item label="误差上限" prop="thresholdMax"> <el-form-item label="误差上限" prop="thresholdMax">
<el-input-number <el-input-number
@ -77,6 +88,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { QcTemplateApi, QcTemplateIndicatorVO } from '@/api/mes/qc/template' import { QcTemplateApi, QcTemplateIndicatorVO } from '@/api/mes/qc/template'
import { QcIndicatorApi, QcIndicatorVO } from '@/api/mes/qc/indicator' import { QcIndicatorApi, QcIndicatorVO } from '@/api/mes/qc/indicator'
import { MdUnitMeasureApi, MdUnitMeasureVO } from '@/api/mes/md/unitmeasure'
defineOptions({ name: 'TemplateIndicatorForm' }) defineOptions({ name: 'TemplateIndicatorForm' })
@ -93,7 +105,7 @@ const formData = ref({
indicatorId: undefined, indicatorId: undefined,
checkMethod: undefined, checkMethod: undefined,
standardValue: undefined, standardValue: undefined,
unit: undefined, unitMeasureId: undefined,
thresholdMax: undefined, thresholdMax: undefined,
thresholdMin: undefined, thresholdMin: undefined,
docUrl: undefined, docUrl: undefined,
@ -106,6 +118,8 @@ const formRef = ref()
/** 质检指标精简列表 */ /** 质检指标精简列表 */
const indicatorList = ref<QcIndicatorVO[]>([]) const indicatorList = ref<QcIndicatorVO[]>([])
/** 计量单位精简列表 */
const unitMeasureList = ref<MdUnitMeasureVO[]>([])
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number, templateId?: number) => { 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 formType.value = type
resetForm() resetForm()
formData.value.templateId = templateId formData.value.templateId = templateId
// //
indicatorList.value = await QcIndicatorApi.getIndicatorSimpleList() // TODO @AI
;[indicatorList.value, unitMeasureList.value] = await Promise.all([
QcIndicatorApi.getIndicatorSimpleList(),
MdUnitMeasureApi.getUnitMeasureSimpleList()
])
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
@ -156,7 +174,7 @@ const resetForm = () => {
indicatorId: undefined, indicatorId: undefined,
checkMethod: undefined, checkMethod: undefined,
standardValue: undefined, standardValue: undefined,
unit: undefined, unitMeasureId: undefined,
thresholdMax: undefined, thresholdMax: undefined,
thresholdMin: undefined, thresholdMin: undefined,
docUrl: undefined, docUrl: undefined,

View File

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