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