From f5aa2f481bd9011251e295ad5cf5925cfdaaa313 Mon Sep 17 00:00:00 2001 From: yueli Date: Mon, 31 Aug 2026 14:53:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(scan):=20=E5=87=BA=E5=BA=93/=E5=80=9F?= =?UTF-8?q?=E5=BA=93=E6=89=AB=E7=A0=81=E5=A2=9E=E5=8A=A0=E6=9C=AA=E6=89=AB?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 扫码进度条旁新增「未扫清单 (N)」按钮(有未扫满物料时显示) - 弹窗列出计划中未扫满的物料:名称/规格/计划数量/已扫数量/待扫数量 - 提供「去扫码」快捷跳转,方便补扫漏掉的物料 - 未扫满 = 计划数量 > 已扫数量(含完全未扫和扫了一部分的情况) --- inventory-web/src/views/outbound/create.vue | 63 +++++++++++++++++++ .../src/views/transaction/borrow.vue | 63 +++++++++++++++++++ 2 files changed, 126 insertions(+) diff --git a/inventory-web/src/views/outbound/create.vue b/inventory-web/src/views/outbound/create.vue index 8976842..2865522 100644 --- a/inventory-web/src/views/outbound/create.vue +++ b/inventory-web/src/views/outbound/create.vue @@ -80,6 +80,13 @@ 扫码进度 {{ scanScannedTypes }}/{{ scanTotalTypes }} 种 {{ scanScannedQty }}/{{ scanTotalQty }} 件 + + 未扫清单 ({{ unscannedCount }}) + + + + + + + + + + + + + + + + + + + + + const scanScannedTypes = computed(() => cartItems.value.length) const scanTotalTypes = computed(() => plannedItems.value.length) +// ★ 未扫清单:计划中还没扫满的物料 +const unscannedList = computed(() => { + return plannedItems.value.map(plan => { + const planQty = Number(plan.quantity) || 0 + // 已扫数量(按名称+规格匹配) + const scannedQty = cartItems.value + .filter(ci => { + const ciName = (ci.name || '').trim() + const ciSpec = (ci.spec_model || ci.standard || '').trim() + return ciName === (plan.name || '').trim() && + ciSpec === (plan.spec_model || '').trim() + }) + .reduce((sum, ci) => sum + (Number(ci.out_quantity) || 0), 0) + return { + name: plan.name || '', + spec: plan.spec_model || '', + planQty, + scannedQty, + remaining: Math.max(0, planQty - scannedQty) + } + }).filter(item => item.remaining > 0) // 只保留未扫满的 +}) +const unscannedCount = computed(() => unscannedList.value.length) +const showUnscannedDialog = ref(false) + // ★ 加载已审批通过的申请单 const loadApprovalRequests = async () => { requestsLoading.value = true diff --git a/inventory-web/src/views/transaction/borrow.vue b/inventory-web/src/views/transaction/borrow.vue index 3b1e2ca..dbb0613 100644 --- a/inventory-web/src/views/transaction/borrow.vue +++ b/inventory-web/src/views/transaction/borrow.vue @@ -71,6 +71,13 @@ 扫码进度 {{ scanScannedTypes }}/{{ scanTotalTypes }} 种 {{ scanScannedQty }}/{{ scanTotalQty }} 件 + + 未扫清单 ({{ unscannedCount }}) + + + + + + + + + + + + + + + + + + + + + const scanScannedTypes = computed(() => cartItems.value.length) const scanTotalTypes = computed(() => plannedItems.value.length) +// ★ 未扫清单:计划中还没扫满的物料 +const unscannedList = computed(() => { + return plannedItems.value.map(plan => { + const planQty = Number(plan.quantity) || 0 + // 已扫数量(按名称+规格匹配) + const scannedQty = cartItems.value + .filter(ci => { + const ciName = (ci.name || '').trim() + const ciSpec = (ci.spec_model || ci.standard || '').trim() + return ciName === (plan.name || '').trim() && + ciSpec === (plan.spec_model || '').trim() + }) + .reduce((sum, ci) => sum + (Number(ci.out_quantity) || 0), 0) + return { + name: plan.name || '', + spec: plan.spec_model || '', + planQty, + scannedQty, + remaining: Math.max(0, planQty - scannedQty) + } + }).filter(item => item.remaining > 0) // 只保留未扫满的 +}) +const unscannedCount = computed(() => unscannedList.value.length) +const showUnscannedDialog = ref(false) + // ★ 加载已通过审批的借库申请单列表 const loadApprovalRequests = async () => { requestsLoading.value = true