fix(backend): 出入库列表 Preload(Items) 供手机端卡片显示品项数

List 之前未 preload items,手机端 MCard sub 行拿不到 items.length。
入库进价对 operator 本就可见(客户端无条件展示+待定价逻辑依赖 costPrice),
故 stock_in 不加脱敏;stock_out 侧成本敏感,List 已有 stripStockOutCost 兜底,安全。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
This commit is contained in:
wangjia
2026-07-18 07:53:53 +08:00
parent fcd8733679
commit f6e326794e
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ func (h *StockInHandler) List(c *gin.Context) {
query.Count(&total)
orders := make([]model.StockInOrder, 0)
query.Preload("Warehouse", "shop_id = ?", shopID).
// 列表卡片需要 items.length 显示品项数(手机端 MCard sub 行)
query.Preload("Items").
Preload("Warehouse", "shop_id = ?", shopID).
Preload("Partner", "shop_id = ?", shopID).
Preload("Operator", "shop_id = ?", shopID).
Preload("Reviewer", "shop_id = ?", shopID).
+3 -1
View File
@@ -87,7 +87,9 @@ func (h *StockOutHandler) List(c *gin.Context) {
query.Count(&total)
orders := make([]model.StockOutOrder, 0)
query.Preload("Warehouse", "shop_id = ?", shopID).
// 列表卡片需要 items.length 显示品项数(手机端 MCard sub 行)
query.Preload("Items").
Preload("Warehouse", "shop_id = ?", shopID).
Preload("Partner", "shop_id = ?", shopID).
Preload("Operator", "shop_id = ?", shopID).
Preload("Reviewer", "shop_id = ?", shopID).