From 5939de1a998b9e16f5a57b0d59745d537a498998 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Wed, 14 Jan 2026 18:14:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(qms):=20=E5=AE=8C=E5=96=84=E8=B4=A8?= =?UTF-8?q?=E6=A3=80=E6=A3=80=E6=B5=8B=E6=A8=A1=E6=9D=BF=E5=92=8C=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E7=B1=BB=E5=9E=8B=E5=8A=9F=E8=83=BD,=E9=A6=96?= =?UTF-8?q?=E6=A3=80=3D0,=20=E4=B8=93=E6=A3=80=3D1,=20=E8=87=AA=E6=A3=80?= =?UTF-8?q?=3D2,=20=E4=BA=92=E6=A3=80=3D3,=20=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E6=A3=80=3D4,=20=E6=8A=BD=E6=A3=80=3D5,=20=E6=88=90=E5=93=81?= =?UTF-8?q?=E6=A3=80=3D6,=20=E5=85=A5=E5=BA=93=E6=A3=80=3D7=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=A3=80=3D8=E3=80=82=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=EF=BC=9A=E9=A6=96=E6=A3=80=E3=80=81=E4=B8=93?= =?UTF-8?q?=E6=A3=80=E3=80=81=E4=BA=92=E6=A3=80=E3=80=81=E6=8A=BD=E6=A3=80?= =?UTF-8?q?=E3=80=81=E6=88=90=E5=93=81=E6=A3=80=E6=B5=8B=EF=BC=9B=E5=8E=9F?= =?UTF-8?q?=E6=9D=90=E6=96=99=E6=A3=80=E6=B5=8B=EF=BC=9A=E5=8E=9F=E6=9D=90?= =?UTF-8?q?=E6=96=99=E6=A3=80=E6=B5=8B=EF=BC=9B=E5=85=A5=E5=BA=93=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=EF=BC=9A=E5=85=A5=E5=BA=93=E6=A3=80=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 首检=0, 专检=1, 自检=2, 互检=3, 原材料检=4, 抽检=5, 成品检=6, 入库检=7,出库检=8。产品检测:首检、专检、互检、抽检、成品检测;原材料检测:原材料检测;入库检测:入库检; - 添加检测类型参数处理逻辑,支持产品检、原材料检、入库检的不同类型映射 - 新增qcInspectionType和qcInspectionTypes查询参数用于检测类型过滤 - 在质检模板列表中新增是否通用模板列显示 - 实现通用模板的表单字段禁用逻辑,通用模板时不绑定具体物料、工序或工位 - 添加通用模板创建表单字段和业务逻辑说明提醒 - 更新API类型定义,添加isDefault字段和检测类型相关查询参数 - 修复重置查询时检测类型参数的初始化问题 --- src/api/qms/QcInspectionMain/types.ts | 10 ++++ src/api/qms/qcInspectionTemplate/types.ts | 15 +++++- src/views/qms/QcInspectionMain/index.vue | 28 ++++++++--- src/views/qms/qcInspectionTemplate/index.vue | 50 ++++++++++++++++++-- 4 files changed, 91 insertions(+), 12 deletions(-) diff --git a/src/api/qms/QcInspectionMain/types.ts b/src/api/qms/QcInspectionMain/types.ts index 0d645ee..26b0836 100644 --- a/src/api/qms/QcInspectionMain/types.ts +++ b/src/api/qms/QcInspectionMain/types.ts @@ -337,6 +337,16 @@ export interface QcInspectionMainQuery extends PageQuery { */ inspectionType?: number | string; + /** + * 检测类型字典(单值查询) + */ + qcInspectionType?: string; + + /** + * 检测类型字典列表(多值查询,用于产品检等需要查询多个类型的场景) + */ + qcInspectionTypes?: string[]; + /** * 单据状态(0未处理/1完成) */ diff --git a/src/api/qms/qcInspectionTemplate/types.ts b/src/api/qms/qcInspectionTemplate/types.ts index 78a14de..c3f93f3 100644 --- a/src/api/qms/qcInspectionTemplate/types.ts +++ b/src/api/qms/qcInspectionTemplate/types.ts @@ -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; /** * 关联检测类型表 diff --git a/src/views/qms/QcInspectionMain/index.vue b/src/views/qms/QcInspectionMain/index.vue index 5e5e344..acc9933 100644 --- a/src/views/qms/QcInspectionMain/index.vue +++ b/src/views/qms/QcInspectionMain/index.vue @@ -635,17 +635,25 @@ const inspectionResultDialog = reactive({ }); -//路由: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>({ 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(); } /** 重置子表搜索 */ diff --git a/src/views/qms/qcInspectionTemplate/index.vue b/src/views/qms/qcInspectionTemplate/index.vue index 59996f6..1672cb9 100644 --- a/src/views/qms/qcInspectionTemplate/index.vue +++ b/src/views/qms/qcInspectionTemplate/index.vue @@ -66,6 +66,12 @@ + + +