feat: 出库/借库记录记录并展示库位快照(DB加列+后端写入+记录页展示)

This commit is contained in:
yueli
2026-09-04 11:42:44 +08:00
parent 8e561836eb
commit 1527d552d4
6 changed files with 26 additions and 1 deletions

View File

@ -278,6 +278,8 @@ class OutboundService:
quantity=quantity,
unit_price=unit_price,
outbound_time=current_time,
# [新增] 记录出库时的库位快照
warehouse_location=getattr(stock_record, 'warehouse_location', None),
**common_data
)
db.session.add(new_record)
@ -647,7 +649,9 @@ class OutboundService:
'quantity': qty,
'unit_price': price,
'subtotal': subtotal,
'batch_sn': batch_sn
'batch_sn': batch_sn,
# [新增] 出库时的库位快照(展示用)
'warehouse_location': getattr(d, 'warehouse_location', None) or ''
})
# 4. 排序输出

View File

@ -152,6 +152,8 @@ class TransService:
borrow_signature=signature,
remark=remark,
expected_return_time=expected_return_time,
# [新增] 记录借出时的库位快照
location=getattr(stock, 'warehouse_location', None),
status='borrowed',
is_returned=False
)