From 1313347c853c02ab1033bc67818ac995f9acc815 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 5 Apr 2026 10:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(mes):=20=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E8=BF=BD=E6=BA=AF=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E6=A0=87=E8=AE=B0=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 SQL 查询以过滤已删除的记录,确保批次追溯时只返回有效数据。同时,增加了集成测试用例以验证新逻辑的正确性。 --- .../mes/qc/batchtrace/BatchTraceDetailList.vue | 18 ++++++++++-------- src/views/mes/qc/batchtrace/index.vue | 6 +++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/views/mes/qc/batchtrace/BatchTraceDetailList.vue b/src/views/mes/qc/batchtrace/BatchTraceDetailList.vue index ce68a7ecc..8c227d027 100644 --- a/src/views/mes/qc/batchtrace/BatchTraceDetailList.vue +++ b/src/views/mes/qc/batchtrace/BatchTraceDetailList.vue @@ -25,14 +25,6 @@ const props = defineProps<{ const loading = ref(true) // 列表的加载中 const batchList = ref([]) // 列表的数据 -watch( - () => props.batchCode, - (val) => { - if (val) { - getList() - } - } -) /** 查询列表 */ const getList = async () => { if (!props.batchCode) { @@ -49,6 +41,16 @@ const getList = async () => { } } +/** 监听批次编号变化 */ +watch( + () => props.batchCode, + (val) => { + if (val) { + getList() + } + } +) + /** 初始化 */ onMounted(() => { getList() diff --git a/src/views/mes/qc/batchtrace/index.vue b/src/views/mes/qc/batchtrace/index.vue index 84befd1a9..0119c8895 100644 --- a/src/views/mes/qc/batchtrace/index.vue +++ b/src/views/mes/qc/batchtrace/index.vue @@ -101,9 +101,8 @@ import BatchTraceDetail from './BatchTraceDetail.vue' defineOptions({ name: 'BatchTrace' }) const loading = ref(true) // 列表的加载中 -const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 -const queryFormRef = ref() // 搜索的表单 +const total = ref(0) // 列表的总页数 const queryParams = reactive({ pageNo: 1, pageSize: 10, @@ -114,6 +113,8 @@ const queryParams = reactive({ salesOrderCode: undefined, purchaseOrderCode: undefined }) +const queryFormRef = ref() // 搜索的表单 +const detailRef = ref() // 详情弹窗 /** 查询列表 */ const getList = async () => { @@ -140,7 +141,6 @@ const resetQuery = () => { } /** 批次追溯按钮操作 */ -const detailRef = ref() const openDetail = (row: BatchVO) => { detailRef.value.open(row) }