From bfeb397c4ab6939165108b81189269edbb17f105 Mon Sep 17 00:00:00 2001 From: DXC Date: Tue, 16 Jun 2026 13:38:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=80=9F=E5=BA=93=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E5=87=BA=E5=BA=93):=20items=20=E5=AD=97=E6=AE=B5=E5=90=8D=20st?= =?UTF-8?q?ock=5Fid=20=E2=86=92=20id=20=E4=BF=AE=E5=A4=8D=20400=20+=20disp?= =?UTF-8?q?atch=5Fborrow=20docstring=20=E8=A1=A5=E5=85=A8=20sku=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-backend/app/api/v1/transactions.py | 9 ++++++++- inventory-web/src/views/transaction/borrow.vue | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/inventory-backend/app/api/v1/transactions.py b/inventory-backend/app/api/v1/transactions.py index 44c795c..15735e8 100644 --- a/inventory-backend/app/api/v1/transactions.py +++ b/inventory-backend/app/api/v1/transactions.py @@ -281,7 +281,14 @@ def dispatch_borrow(): 执行借库扣减 请求体: { approval_id: int, // 关联的审批单ID - items: [...], // 扫码选中的库存物品(含 id, source_table, out_quantity) + items: [ // 扫码选中的库存物品 + { + id: int, // 库存主键(按 source_table 路由到 StockBuy/StockSemi/StockProduct) + source_table: str, // 'stock_buy' | 'stock_semi' | 'stock_product' + sku: str, // 用于按 (source_table, sku) 与审批单做超额交叉校验 + out_quantity: float + } + ], borrower_name: str, signature_path: str, remark: str, diff --git a/inventory-web/src/views/transaction/borrow.vue b/inventory-web/src/views/transaction/borrow.vue index 857850c..7e8ee1e 100644 --- a/inventory-web/src/views/transaction/borrow.vue +++ b/inventory-web/src/views/transaction/borrow.vue @@ -556,7 +556,7 @@ const submitForm = async () => { if (isNaN(safeQty) || safeQty <= 0) safeQty = 1 return { - stock_id: item.id || 0, + id: item.id || 0, source_table: item.source_table || '', sku: item.sku ? String(item.sku) : (item.barcode ? String(item.barcode) : 'NO_SKU'), barcode: item.barcode ? String(item.barcode) : '',