From 85fc703b5ce3d9840154f2b1b6f2a8efb1423f38 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 18 四月 2026 15:17:55 +0800
Subject: [PATCH] 新增销售和采购订单扫码出库功能的前端页面支持,优化API接口以处理合格和不合格出库情况

---
 src/pages/inventoryManagement/scanOut/scanOut.fields.ts    |   84 ++++++++++++++++++++++++++++++++++++++++++
 src/pages/inventoryManagement/scanOut/scanOut.constants.ts |   14 +++++++
 2 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/src/pages/inventoryManagement/scanOut/scanOut.constants.ts b/src/pages/inventoryManagement/scanOut/scanOut.constants.ts
new file mode 100644
index 0000000..33d843c
--- /dev/null
+++ b/src/pages/inventoryManagement/scanOut/scanOut.constants.ts
@@ -0,0 +1,14 @@
+export const QUALITY_TYPE = {
+  qualified: "qualified",
+  unqualified: "unqualified",
+} as const;
+
+export type QualityType = (typeof QUALITY_TYPE)[keyof typeof QUALITY_TYPE];
+
+export const CONTRACT_KIND = {
+  sales: "sales",
+  purchase: "purchase",
+} as const;
+
+export type ContractKind = (typeof CONTRACT_KIND)[keyof typeof CONTRACT_KIND];
+
diff --git a/src/pages/inventoryManagement/scanOut/scanOut.fields.ts b/src/pages/inventoryManagement/scanOut/scanOut.fields.ts
new file mode 100644
index 0000000..3e1fd49
--- /dev/null
+++ b/src/pages/inventoryManagement/scanOut/scanOut.fields.ts
@@ -0,0 +1,84 @@
+import { computed, type Ref } from "vue";
+import { CONTRACT_KIND, type ContractKind } from "./scanOut.constants";
+
+export const detailFieldRowsSales = [
+  { label: "妤煎眰缂栧彿", key: "floorCode" },
+  { label: "浜у搧澶х被", key: "productCategory" },
+  { label: "瑙勬牸鍨嬪彿", key: "specificationModel" },
+  { label: "鍘氬害", key: "thickness" },
+  { label: "瀹�(mm)", key: "width" },
+  { label: "楂�(mm)", key: "height" },
+  { label: "鍛ㄩ暱(cm)", key: "perimeter" },
+  { label: "鎬婚潰绉�(m虏)", key: "actualTotalArea" },
+  { label: "鍔犲伐瑕佹眰", key: "processRequirement" },
+  { label: "澶囨敞", key: "remark" },
+  { label: "閲嶇", key: "heavyBox" },
+  { label: "浜у搧鐘舵��", key: "approveStatus" },
+  { label: "鍏ュ簱鐘舵��", key: "productStockStatus" },
+  { label: "蹇�掑叕鍙�", key: "expressCompany" },
+  { label: "蹇�掑崟鍙�", key: "expressNumber" },
+  { label: "鍙戣揣杞︾墝", key: "shippingCarNumber" },
+  { label: "鍙戣揣鏃ユ湡", key: "shippingDate" },
+  { label: "鏁伴噺", key: "quantity" },
+  { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
+  { label: "绋庣巼(%)", key: "taxRate" },
+  { label: "鍚◣鍗曚环(鍏�)", key: "taxInclusiveUnitPrice" },
+  { label: "鍚◣鎬讳环(鍏�)", key: "taxInclusiveTotalPrice" },
+  { label: "涓嶅惈绋庢�讳环(鍏�)", key: "taxExclusiveTotalPrice" },
+] as const;
+
+export const detailFieldRowsPurchase = [
+  { label: "浜у搧澶х被", key: "productCategory" },
+  { label: "瑙勬牸鍨嬪彿", key: "specificationModel" },
+  { label: "鍗曚綅", key: "unit" },
+  { label: "鏁伴噺", key: "quantity" },
+  { label: "鍙敤鏁伴噺", key: "availableQuality" },
+  { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
+  { label: "閫�璐ф暟閲�", key: "returnQuality" },
+  { label: "绋庣巼(%)", key: "taxRate" },
+  { label: "鍚◣鍗曚环(鍏�)", key: "taxInclusiveUnitPrice" },
+  { label: "鍚◣鎬讳环(鍏�)", key: "taxInclusiveTotalPrice" },
+  { label: "涓嶅惈绋庢�讳环(鍏�)", key: "taxExclusiveTotalPrice" },
+] as const;
+
+export const summaryFieldRowsSales = [
+  { label: "妤煎眰缂栧彿", key: "floorCode" },
+  { label: "浜у搧澶х被", key: "productCategory" },
+  { label: "瑙勬牸鍨嬪彿", key: "specificationModel" },
+  { label: "鏁伴噺", key: "quantity" },
+  { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
+  { label: "浜у搧鐘舵��", key: "approveStatus" },
+  { label: "鍏ュ簱鐘舵��", key: "productStockStatus" },
+] as const;
+
+export const summaryFieldRowsPurchase = [
+  { label: "浜у搧澶х被", key: "productCategory" },
+  { label: "瑙勬牸鍨嬪彿", key: "specificationModel" },
+  { label: "鍗曚綅", key: "unit" },
+  { label: "鏁伴噺", key: "quantity" },
+  { label: "鍙敤鏁伴噺", key: "availableQuality" },
+  { label: "鍓╀綑鏁伴噺", key: "remainingQuantity" },
+] as const;
+
+type FieldRow = { label: string; key: string };
+
+export function useScanOutFieldRows(contractKindRef: Ref<ContractKind>) {
+  const fieldRowsByContractKind = {
+    [CONTRACT_KIND.sales]: {
+      detail: detailFieldRowsSales,
+      summary: summaryFieldRowsSales,
+    },
+    [CONTRACT_KIND.purchase]: {
+      detail: detailFieldRowsPurchase,
+      summary: summaryFieldRowsPurchase,
+    },
+  } as const satisfies Record<ContractKind, { detail: readonly FieldRow[]; summary: readonly FieldRow[] }>;
+
+  const currentContractFieldRows = computed(() => fieldRowsByContractKind[contractKindRef.value]);
+
+  const detailFieldRows = computed(() => currentContractFieldRows.value.detail);
+  const summaryFieldRows = computed(() => currentContractFieldRows.value.summary);
+
+  return { detailFieldRows, summaryFieldRows };
+}
+

--
Gitblit v1.9.3