feat(client): 库存商品抽屉增加供应商与批次号信息行(两端,原型同步)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-14 09:40:16 +08:00
parent 7a9f480ae3
commit 7e020a04b3
4 changed files with 26 additions and 4 deletions
@@ -129,6 +129,8 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
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(),
);
@@ -46,6 +46,8 @@ Future<void> showProductEditorDrawer(
String? status, // 在售 / 库存 / 已售(三态显示标签)
int? inventoryId, // 库存行 id:非空时状态行显示挂售 switch
String? inventoryStatus, // stock / on_sale / soldswitch 初始态)
String? supplier, // 供应商(生产日期行后,非空才显示,2026-07-14)
String? batchNo, // 批次号(生产日期行后,非空才显示,2026-07-14)
VoidCallback? onStatusChanged, // switch 切换成功后回调(列表刷新)
}) {
// 窄屏:底部 sheet 形态(原型 m-inventory openItem 内嵌公开页编辑)
@@ -64,6 +66,8 @@ Future<void> showProductEditorDrawer(
status: status,
inventoryId: inventoryId,
inventoryStatus: inventoryStatus,
supplier: supplier,
batchNo: batchNo,
onStatusChanged: onStatusChanged),
),
);
@@ -94,6 +98,8 @@ Future<void> 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((
'当前库存',