review(mes):qc-template 的实现代码
parent
50be43d9e2
commit
5f010acc5f
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 质检方案类型
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @AI:unit 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,
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue