From f2dd52706be5ff3f993965b2b04e2afb78177b47 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 23 Feb 2026 15:55:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes):=20=E6=96=B0=E5=A2=9E=E5=BE=85?= =?UTF-8?q?=E6=A3=80=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8=E9=A1=B5=20+=20Iq?= =?UTF-8?q?cForm=20=E6=94=AF=E6=8C=81=E9=A2=84=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 pendinginspect/index.vue 待检任务列表页 - 新增 api/mes/qc/pendinginspect/index.ts API 定义 - 搜索栏:来源单据编号、产品物料(MdItemSelect)、检验类型 - 表格列:来源单据编号、检验类型/名称、物料编码/名称、规格型号、待检数量、单位 - IQC 行显示"创建检验单"按钮,打开 IqcForm 并预填来源数据 - IqcForm.vue: open() 增加 prefillData 参数,isFromPendingTask 控制来源字段只读 - 新增菜单 SQL(mes_qc_pending_inspect.sql) - 新增待检任务测试数据(mes_wm_arrival_notice.sql id=100~102) --- src/api/mes/qc/pendinginspect/index.ts | 28 ++++ src/views/mes/qc/iqc/IqcForm.vue | 27 +++- src/views/mes/qc/pendinginspect/index.vue | 156 ++++++++++++++++++++++ 3 files changed, 208 insertions(+), 3 deletions(-) create mode 100644 src/api/mes/qc/pendinginspect/index.ts create mode 100644 src/views/mes/qc/pendinginspect/index.vue diff --git a/src/api/mes/qc/pendinginspect/index.ts b/src/api/mes/qc/pendinginspect/index.ts new file mode 100644 index 000000000..787e1b4cf --- /dev/null +++ b/src/api/mes/qc/pendinginspect/index.ts @@ -0,0 +1,28 @@ +import request from '@/config/axios' + +// MES 待检任务 VO +export interface QcPendingInspectVO { + sourceDocId: number + sourceDocType: number + sourceDocCode: string + sourceLineId: number + qcType: number + qcTypeName: string + itemId: number + itemCode: string + itemName: string + specification: string + unitName: string + quantityToCheck: number + vendorId: number + vendorName: string + recordTime: string +} + +// MES 待检任务 API +export const QcPendingInspectApi = { + // 查询待检任务分页 + getPendingInspectPage: async (params: any) => { + return await request.get({ url: '/mes/qc/pending-inspect/page', params }) + } +} diff --git a/src/views/mes/qc/iqc/IqcForm.vue b/src/views/mes/qc/iqc/IqcForm.vue index 8162afc9a..48d90e648 100644 --- a/src/views/mes/qc/iqc/IqcForm.vue +++ b/src/views/mes/qc/iqc/IqcForm.vue @@ -37,12 +37,22 @@ - + - + @@ -62,6 +72,7 @@ :precision="2" placeholder="请输入" class="!w-1/1" + :disabled="isFromPendingTask" /> @@ -95,6 +106,7 @@ value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择来料日期" class="!w-1/1" + :disabled="isFromPendingTask" /> @@ -228,6 +240,11 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加 const formType = ref('') // 表单的类型:create - 新增;update - 修改 const activeTab = ref('line') // 当前激活的标签页 +/** 是否来自待检任务(有预填的来源单据信息) */ +const isFromPendingTask = computed( + () => formType.value === 'create' && formData.value.sourceDocId != null +) + const formData = ref({ id: undefined as number | undefined, code: undefined, @@ -274,7 +291,8 @@ const generateCode = () => { } /** 打开弹窗 */ -const open = async (type: string, id?: number) => { +// TODO @AI:Partial 是不是可以不用?变量是不是可以叫 data; +const open = async (type: string, id?: number, prefillData?: Partial) => { dialogVisible.value = true dialogTitle.value = t('action.' + type) formType.value = type @@ -288,6 +306,9 @@ const open = async (type: string, id?: number) => { } finally { formLoading.value = false } + } else if (prefillData) { + // 预填模式:来自待检任务(pending inspect) + Object.assign(formData.value, prefillData) } } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 diff --git a/src/views/mes/qc/pendinginspect/index.vue b/src/views/mes/qc/pendinginspect/index.vue new file mode 100644 index 000000000..7aef5d5f7 --- /dev/null +++ b/src/views/mes/qc/pendinginspect/index.vue @@ -0,0 +1,156 @@ + + + +