From 1bd1061c60c286e3b2216a67090c4976c9c7b35f Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 18 四月 2026 17:50:29 +0800
Subject: [PATCH] 出入库扫码
---
src/pages/inventoryManagement/scanOut/scanOut.fields.ts | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/src/pages/inventoryManagement/scanOut/scanOut.fields.ts b/src/pages/inventoryManagement/scanOut/scanOut.fields.ts
index 3e1fd49..6aabc56 100644
--- a/src/pages/inventoryManagement/scanOut/scanOut.fields.ts
+++ b/src/pages/inventoryManagement/scanOut/scanOut.fields.ts
@@ -1,6 +1,19 @@
import { computed, type Ref } from "vue";
import { CONTRACT_KIND, type ContractKind } from "./scanOut.constants";
+const outboundQuantityRows = [
+ { label: "宸插嚭搴撴暟閲�", key: "shippedQuantity" },
+ { label: "涓嶅悎鏍煎嚭搴撴暟閲�", key: "unqualifiedShippedQuantity" },
+ { label: "涓嶅悎鏍煎叆搴撴暟閲�", key: "unqualifiedStockedQuantity" },
+ { label: "鍓╀綑鍑哄簱鏁伴噺", key: "remainingShippedQuantity" },
+] as const;
+
+const inboundQuantityRows = [
+ { label: "宸插叆搴撴暟閲�", key: "stockedQuantity" },
+ { label: "涓嶅悎鏍煎叆搴撴暟閲�", key: "unqualifiedStockedQuantity" },
+ { label: "鍓╀綑鍏ュ簱鏁伴噺", key: "remainingQuantity" },
+] as const;
+
export const detailFieldRowsSales = [
{ label: "妤煎眰缂栧彿", key: "floorCode" },
{ label: "浜у搧澶х被", key: "productCategory" },
@@ -20,7 +33,6 @@
{ label: "鍙戣揣杞︾墝", key: "shippingCarNumber" },
{ label: "鍙戣揣鏃ユ湡", key: "shippingDate" },
{ label: "鏁伴噺", key: "quantity" },
- { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
{ label: "绋庣巼(%)", key: "taxRate" },
{ label: "鍚◣鍗曚环(鍏�)", key: "taxInclusiveUnitPrice" },
{ label: "鍚◣鎬讳环(鍏�)", key: "taxInclusiveTotalPrice" },
@@ -33,7 +45,6 @@
{ label: "鍗曚綅", key: "unit" },
{ label: "鏁伴噺", key: "quantity" },
{ label: "鍙敤鏁伴噺", key: "availableQuality" },
- { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
{ label: "閫�璐ф暟閲�", key: "returnQuality" },
{ label: "绋庣巼(%)", key: "taxRate" },
{ label: "鍚◣鍗曚环(鍏�)", key: "taxInclusiveUnitPrice" },
@@ -46,7 +57,6 @@
{ label: "浜у搧澶х被", key: "productCategory" },
{ label: "瑙勬牸鍨嬪彿", key: "specificationModel" },
{ label: "鏁伴噺", key: "quantity" },
- { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
{ label: "浜у搧鐘舵��", key: "approveStatus" },
{ label: "鍏ュ簱鐘舵��", key: "productStockStatus" },
] as const;
@@ -57,22 +67,23 @@
{ label: "鍗曚綅", key: "unit" },
{ label: "鏁伴噺", key: "quantity" },
{ label: "鍙敤鏁伴噺", key: "availableQuality" },
- { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
] as const;
type FieldRow = { label: string; key: string };
+type ScanScene = "outbound" | "inbound";
-export function useScanOutFieldRows(contractKindRef: Ref<ContractKind>) {
+export function useScanOutFieldRows(contractKindRef: Ref<ContractKind>, scene: ScanScene = "outbound") {
+ const quantityRows = scene === "inbound" ? inboundQuantityRows : outboundQuantityRows;
const fieldRowsByContractKind = {
[CONTRACT_KIND.sales]: {
- detail: detailFieldRowsSales,
- summary: summaryFieldRowsSales,
+ detail: [...detailFieldRowsSales, ...quantityRows],
+ summary: [...summaryFieldRowsSales, ...quantityRows],
},
[CONTRACT_KIND.purchase]: {
- detail: detailFieldRowsPurchase,
- summary: summaryFieldRowsPurchase,
+ detail: [...detailFieldRowsPurchase, ...quantityRows],
+ summary: [...summaryFieldRowsPurchase, ...quantityRows],
},
- } as const satisfies Record<ContractKind, { detail: readonly FieldRow[]; summary: readonly FieldRow[] }>;
+ } satisfies Record<ContractKind, { detail: readonly FieldRow[]; summary: readonly FieldRow[] }>;
const currentContractFieldRows = computed(() => fieldRowsByContractKind[contractKindRef.value]);
--
Gitblit v1.9.3