feat(qms): 完善质检检测模板和检测类型功能,首检=0, 专检=1, 自检=2, 互检=3, 原材料检=4, 抽检=5, 成品检=6, 入库检=7,出库检=8。产品检测:首检、专检、互检、抽检、成品检测;原材料检测:原材料检测;入库检测:入库检;

- 首检=0, 专检=1, 自检=2, 互检=3, 原材料检=4, 抽检=5, 成品检=6, 入库检=7,出库检=8。产品检测:首检、专检、互检、抽检、成品检测;原材料检测:原材料检测;入库检测:入库检;
- 添加检测类型参数处理逻辑,支持产品检、原材料检、入库检的不同类型映射
- 新增qcInspectionType和qcInspectionTypes查询参数用于检测类型过滤
- 在质检模板列表中新增是否通用模板列显示
- 实现通用模板的表单字段禁用逻辑,通用模板时不绑定具体物料、工序或工位
- 添加通用模板创建表单字段和业务逻辑说明提醒
- 更新API类型定义,添加isDefault字段和检测类型相关查询参数
- 修复重置查询时检测类型参数的初始化问题
master
zangch@mesnac.com 3 weeks ago
parent 82fbc0715e
commit 5939de1a99

@ -337,6 +337,16 @@ export interface QcInspectionMainQuery extends PageQuery {
*/
inspectionType?: number | string;
/**
*
*/
qcInspectionType?: string;
/**
*
*/
qcInspectionTypes?: string[];
/**
* 0/1
*/

@ -64,8 +64,12 @@ export interface QcInspectionTemplateVO {
*/
description: string;
/**
* 0/1
*/
isDefault: string;
/**
*
*/
@ -150,8 +154,11 @@ export interface QcInspectionTemplateForm extends BaseEntity {
*/
description?: string;
/**
* 0/1
*/
isDefault?: string;
/**
*
*/
@ -236,6 +243,10 @@ export interface QcInspectionTemplateQuery extends PageQuery {
*/
description?: string;
/**
* 0/1
*/
isDefault?: string;
/**
*

@ -635,17 +635,25 @@ const inspectionResultDialog = reactive<DialogOption>({
});
//inspectionType = 1 2 3
/**
* 路由参数处理
* - inspectionType=1 产品检测首检=0, 专检=1, 互检=3, 抽检=5, 成品检=6
* - inspectionType=2 原材料检测原材料检=4
* - inspectionType=3 入库检测入库检=7
*/
const inspectionType = ref();
const getInspectionType = async () => {
const route = useRoute();
inspectionType.value = route.query.inspectionType;
if (inspectionType.value == 2){
queryParams.value.inspectionType = '2';
} else if (inspectionType.value == 3){
queryParams.value.inspectionType = '3';
if (inspectionType.value == '2') {
// =4
queryParams.value.qcInspectionType = '4';
} else if (inspectionType.value == '3') {
// =7
queryParams.value.qcInspectionType = '7';
} else {
queryParams.value.inspectionType = '1';
// =0, =1, =3, =5, =6
queryParams.value.qcInspectionTypes = ['0', '1', '3', '5', '6'];
}
};
@ -749,6 +757,8 @@ const data = reactive<PageData<QcInspectionMainForm, QcInspectionMainQuery>>({
result: undefined,
workshop: undefined,
inspectionType: undefined,
qcInspectionType: undefined,
qcInspectionTypes: undefined,
status: undefined,
inspector: undefined,
shift: undefined,
@ -877,8 +887,12 @@ const handleQuery = () => {
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
dateRange.value = [];
//
queryParams.value.qcInspectionType = undefined;
queryParams.value.qcInspectionTypes = undefined;
getInspectionType();
handleQuery();
}
/** 重置子表搜索 */

@ -66,6 +66,12 @@
<el-table-column label="供应商编码" align="center" prop="supplierCode" v-if="columns[10].visible"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" v-if="columns[11].visible"/>
<el-table-column label="模板说明" align="center" prop="description" v-if="columns[12].visible"/>
<el-table-column label="是否通用模板" align="center" prop="isDefault" v-if="columns[13].visible">
<template #default="scope">
<el-tag v-if="scope.row.isDefault === '1'" type="success"></el-tag>
<el-tag v-else type="info"></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
@ -163,7 +169,7 @@
<el-input v-model="form.templateName" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请点击检索物料" @click="handleMaterialAdd" readonly>
<el-input v-model="form.materialName" placeholder="请点击检索物料" @click="handleMaterialAdd" readonly :disabled="form.isDefault === '1'">
<template #append>
<el-icon class="el-input__icon">
<search />
@ -183,7 +189,7 @@
<el-input v-model="form.stationName" placeholder="请输入工位名称" />
</el-form-item> -->
<el-form-item label="工位名称" prop="stationName">
<el-select v-model="selectedStaionId" placeholder="请选择工位" filterable clearable @change="handleBaseStationInfoChange" style="width: 100%;">
<el-select v-model="selectedStaionId" placeholder="请选择工位" filterable clearable @change="handleBaseStationInfoChange" style="width: 100%;" :disabled="form.isDefault === '1'">
<el-option v-for="item in baseStationInfoList" :key="item.stationId" :label="item.stationName" :value="item.stationId" />
</el-select>
</el-form-item>
@ -194,7 +200,7 @@
<el-input v-model="form.processName" placeholder="请输入工序名称" />
</el-form-item> -->
<el-form-item label="工序名称" prop="processName">
<el-select v-model="selectedProcessId" placeholder="请选择工序" filterable clearable @change="handleBaseProcessInfoChange" style="width: 100%;">
<el-select v-model="selectedProcessId" placeholder="请选择工序" filterable clearable @change="handleBaseProcessInfoChange" style="width: 100%;" :disabled="form.isDefault === '1'">
<el-option v-for="item in baseProcessInfoList" :key="item.processId" :label="item.processName" :value="item.processId" />
</el-select>
</el-form-item>
@ -212,6 +218,15 @@
<el-form-item label="模板说明" prop="description">
<el-input v-model="form.description" placeholder="请输入模板说明" />
</el-form-item>
<el-form-item label="是否通用模板" prop="isDefault">
<el-radio-group v-model="form.isDefault">
<el-radio value="0"></el-radio>
<el-radio value="1"></el-radio>
</el-radio-group>
<div style="color: #909399; font-size: 12px; margin-top: 4px;">
通用模板不绑定具体物料工序或工位
</div>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
@ -456,6 +471,7 @@ const columns = ref<FieldOption[]>([
{ key: 10, label: `供应商编码`, visible: true },
{ key: 11, label: `供应商名称`, visible: true },
{ key: 12, label: `模板说明`, visible: true },
{ key: 13, label: `是否通用模板`, visible: true },
]);
const initFormData: QcInspectionTemplateForm = {
@ -472,6 +488,7 @@ const initFormData: QcInspectionTemplateForm = {
supplierCode: undefined,
supplierName: undefined,
description: undefined,
isDefault: '0',
}
const initTemplateItemFormData: QcTemplateItemForm = {
@ -512,6 +529,7 @@ const data = reactive<PageData<QcInspectionTemplateForm, QcInspectionTemplateQue
supplierCode: undefined,
supplierName: undefined,
description: undefined,
isDefault: undefined,
params: {
}
},
@ -1023,6 +1041,32 @@ const filteredQcInspectionItemList = computed(() => {
});
//
watch(() => form.value.isDefault, (newVal) => {
if (newVal === '1') {
//
form.value.materialCode = '';
form.value.materialName = '';
form.value.stationCode = '';
form.value.stationName = '';
form.value.processCode = '';
form.value.processName = '';
selectedMaterialId.value = null;
selectedStaionId.value = null;
selectedProcessId.value = null;
//
ElMessageBox.alert(
'通用模板只与检测类型绑定,不绑定具体物料、工序或工位。\n勾选后该模板将作为该检测类型的兜底模板只有在其他所有模板都不匹配时才会被使用。',
'业务逻辑说明',
{
confirmButtonText: '我知道了',
type: 'info'
}
);
}
});
onMounted(() => {
getList();
getInspectionTypeList();

Loading…
Cancel
Save