From 7e020a04b331fc470b84fa9430b62522b0b65700 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Tue, 14 Jul 2026 09:40:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(client):=20=E5=BA=93=E5=AD=98=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=8A=BD=E5=B1=89=E5=A2=9E=E5=8A=A0=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E4=B8=8E=E6=89=B9=E6=AC=A1=E5=8F=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=A1=8C=EF=BC=88=E4=B8=A4=E7=AB=AF=EF=BC=8C=E5=8E=9F=E5=9E=8B?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../inventory/inventory_list_screen.dart | 2 ++ client/lib/widgets/product_editor_drawer.dart | 17 +++++++++++++++++ design/prototype/screens/m-inventory.html | 6 +++--- design/prototype/screens/product-editor.js | 5 ++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/client/lib/screens/inventory/inventory_list_screen.dart b/client/lib/screens/inventory/inventory_list_screen.dart index 56cd0bd..2c3b5c9 100644 --- a/client/lib/screens/inventory/inventory_list_screen.dart +++ b/client/lib/screens/inventory/inventory_list_screen.dart @@ -129,6 +129,8 @@ class _InventoryListScreenState extends ConsumerState { status: _statusOf(item), inventoryId: item.id, inventoryStatus: item.status, + supplier: item.supplierName.isEmpty ? null : item.supplierName, + batchNo: item.batchNo.isEmpty ? null : item.batchNo, onStatusChanged: () => ref.read(inventoryListProvider.notifier).reload(), ); diff --git a/client/lib/widgets/product_editor_drawer.dart b/client/lib/widgets/product_editor_drawer.dart index 377248e..55cbed9 100644 --- a/client/lib/widgets/product_editor_drawer.dart +++ b/client/lib/widgets/product_editor_drawer.dart @@ -46,6 +46,8 @@ Future showProductEditorDrawer( String? status, // 在售 / 库存 / 已售(三态显示标签) int? inventoryId, // 库存行 id:非空时状态行显示挂售 switch String? inventoryStatus, // stock / on_sale / sold(switch 初始态) + String? supplier, // 供应商(生产日期行后,非空才显示,2026-07-14) + String? batchNo, // 批次号(生产日期行后,非空才显示,2026-07-14) VoidCallback? onStatusChanged, // switch 切换成功后回调(列表刷新) }) { // 窄屏:底部 sheet 形态(原型 m-inventory openItem 内嵌公开页编辑) @@ -64,6 +66,8 @@ Future showProductEditorDrawer( status: status, inventoryId: inventoryId, inventoryStatus: inventoryStatus, + supplier: supplier, + batchNo: batchNo, onStatusChanged: onStatusChanged), ), ); @@ -94,6 +98,8 @@ Future showProductEditorDrawer( status: status, inventoryId: inventoryId, inventoryStatus: inventoryStatus, + supplier: supplier, + batchNo: batchNo, onStatusChanged: onStatusChanged), ), ), @@ -119,6 +125,8 @@ class _ProductEditorDrawer extends ConsumerStatefulWidget { final String? status; final int? inventoryId; final String? inventoryStatus; + final String? supplier; + final String? batchNo; final VoidCallback? onStatusChanged; const _ProductEditorDrawer({ required this.productId, @@ -128,6 +136,8 @@ class _ProductEditorDrawer extends ConsumerStatefulWidget { this.status, this.inventoryId, this.inventoryStatus, + this.supplier, + this.batchNo, this.onStatusChanged, }); @@ -397,6 +407,13 @@ class _ProductEditorDrawerState extends ConsumerState<_ProductEditorDrawer> { if ((p.productionDate ?? '').isNotEmpty) { rows.add(('生产日期', b(p.productionDate!, mono: true))); } + // 批次号/供应商行(生产日期后,非空才渲染,2026-07-14) + if ((widget.batchNo ?? '').isNotEmpty) { + rows.add(('批次号', b(widget.batchNo!, mono: true))); + } + if ((widget.supplier ?? '').isNotEmpty) { + rows.add(('供应商', b(widget.supplier!))); + } if (widget.qty != null) { rows.add(( '当前库存', diff --git a/design/prototype/screens/m-inventory.html b/design/prototype/screens/m-inventory.html index 00828a2..e685082 100644 --- a/design/prototype/screens/m-inventory.html +++ b/design/prototype/screens/m-inventory.html @@ -89,13 +89,13 @@ function drawFilterSheet(){ } function mfTgl(k,v){ state[k].has(v)?state[k].delete(v):state[k].add(v); drawFilterSheet(); render(); } function openFilterSheet(){ drawFilterSheet(); } -// 详情 sheet 行序对齐真实商品抽屉(编码/系列/规格/生产日期/当前库存/成本×2/状态); -// 成本两行仅管理员可见(2026-07-06),原型=管理员形态;生产日期行 2026-07-10。 +// 详情 sheet 行序对齐真实商品抽屉(编码/系列/规格/生产日期/批次号/供应商/当前库存/成本×2/状态); +// 成本两行仅管理员可见(2026-07-06),原型=管理员形态;生产日期行 2026-07-10;批次号/供应商行 2026-07-14。 function openItem(idx){ const it=ITEMS[idx]; if(!peEdit||peEdit.idx!==idx) peEdit={idx,imgs:[PE_SAMPLE[0],'',''],introName:'',introBody:''}; const hasIntro=!!peEdit.introName; const totalCost='¥'+Math.round(parseFloat(it.cost.replace(/[¥,]/g,''))*it.qty).toLocaleString(); - openSheet(it.name, `
编码${it.code}
系列${it.series}
规格${it.spec}
生产日期${it.prod}
当前库存${it.qty} ${it.unit}
成本价(单瓶)${it.cost}
总成本价${totalCost}
状态${it.status}${it.status==='已售'?'':``}
+ openSheet(it.name, `
编码${it.code}
系列${it.series}
规格${it.spec}
生产日期${it.prod}
批次号${it.batch}
供应商${it.supplier}
当前库存${it.qty} ${it.unit}
成本价(单瓶)${it.cost}
总成本价${totalCost}
状态${it.status}${it.status==='已售'?'':``}
商品图片
建议主图为白底产品图,可再加细节图(瓶身/防伪)与场景图。
商品介绍 / 卖点
diff --git a/design/prototype/screens/product-editor.js b/design/prototype/screens/product-editor.js index 7135643..bd9f990 100644 --- a/design/prototype/screens/product-editor.js +++ b/design/prototype/screens/product-editor.js @@ -1,7 +1,7 @@ // ============================================================ // 商品编辑抽屉 单一真源 —— 商品信息 + 商品图片 + 商品介绍 + 预览 // 用法:任意屏引入 (需先引 shell.js 取 openMenu/toast), -// 行点击调用 openProductEditor(item)。item 字段按需:{name,code,series,spec,cat,prodDate,qty,unit,cost,value,status} +// 行点击调用 openProductEditor(item)。item 字段按需:{name,code,series,spec,cat,prodDate,batch,supplier,qty,unit,cost,value,status} // 改这个抽屉(库存 / 基础数据共用)= 只改此文件 + atoms.css 的 .pe-* 样式。 // ============================================================ (function () { @@ -65,6 +65,9 @@ if (it.cat) r.push(['分类', `${it.cat}`]); // 生产日期行(分类后、当前库存前,mono,2026-07-10) if (it.prodDate) r.push(['生产日期', `${it.prodDate}`]); + // 批次号/供应商行(生产日期后,2026-07-14) + if (it.batch) r.push(['批次号', `${it.batch}`]); + if (it.supplier) r.push(['供应商', `${it.supplier}`]); if (it.qty != null) r.push(['当前库存', `${it.qty} ${it.unit || ''}`]); // 成本两行仅管理员可见(非管理员隐藏,与库存列表/出库同口径,2026-07-06);原型=管理员形态 if (it.cost) r.push(['成本价(单瓶)', `${it.cost}`]);