feat(client): 草稿 KPI 卡(暗黄)+ 出库详情总售价列 + 明细去¥缩号 + 建单默认值 + 若干列名

- 出入库列表加草稿 KPI 卡(DsKpiTone.warn 新档,审核卡后,点击筛选草稿)
- 出库详情 7 列:售价后加总售价;明细行内价格去 ¥ 且缩一号(合计保留 ¥);
  5/7 列宽重排(系列/数量左移、进价(单瓶)不折行)
- 出库建单:数量默认=可用数量、售价默认=参考售价(product.sale_price)
- 入库详情列名:进价(单瓶)/总价;库存列表「单价」→「总价」(库存×成本);
  商品抽屉:成本价(单瓶)/总成本价
- 公开商品预览页加返回按钮(仅 App 内 canPop 时显示,扫码直达保持纯净)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
wangjia
2026-07-03 14:31:50 +08:00
parent 4d1d69595b
commit 2bf5b98ba2
28 changed files with 132 additions and 35 deletions
@@ -50,7 +50,7 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
static const _statusOptions = ['全部', '在售', '预警', '缺货'];
// 列序照原型 inventory.html COLS:商品/规格/系列/批次/库存/成本价/单价/生产/入库/供应商/状态/操作。
// 成本价=入库进价(unitPrice)价=售价(salePrice)
// 成本价=入库进价(unitPrice)价=库存×成本价(2026-07-03 用户拍板:原「单价/参考售价」列换掉)
// 仓库/备注原型没有 → 默认隐藏的可选列(列设置可开)。
static const _colDefs = [
ColDef('product', '商品', required: true),
@@ -59,7 +59,7 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
ColDef('batch', '批次号'),
ColDef('qty', '库存'),
ColDef('cost', '成本价'),
ColDef('price', ''),
ColDef('price', ''),
ColDef('prodDate', '生产日期'),
ColDef('inTime', '入库时间'),
ColDef('supplier', '供应商'),
@@ -274,7 +274,7 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
'批次号',
'库存量',
'成本价',
'',
'',
'生产日期',
'入库时间',
'供应商',
@@ -295,7 +295,9 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
item.batchNo,
'${item.quantity.toStringAsFixed(0)} ${item.unit}'.trim(),
item.unitPrice != null ? item.unitPrice!.toStringAsFixed(2) : '',
item.salePrice != null ? item.salePrice!.toStringAsFixed(2) : '',
item.unitPrice != null
? (item.unitPrice! * item.quantity).toStringAsFixed(2)
: '',
item.productionDate ?? '',
item.createdAt != null && item.createdAt!.length >= 10
? item.createdAt!.substring(0, 10)
@@ -362,11 +364,11 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
fontFamily: AppFonts.mono,
fontFamilyFallback: AppFonts.monoFallback)),
'price' => Text(
item.salePrice != null
? '¥${item.salePrice!.toStringAsFixed(2)}'
: '待定价',
style: item.salePrice == null
? TextStyle(color: t.warn, fontWeight: FontWeight.w600)
item.unitPrice != null
? _fmtCost(item.unitPrice! * item.quantity)
: '-',
style: item.unitPrice == null
? TextStyle(color: t.faint)
: const TextStyle(
fontFamily: AppFonts.mono,
fontFamilyFallback: AppFonts.monoFallback)),