feat(client): 出入库单打印按新版式重做 + 单价口径修正

- 版式参照单据样板:公司抬头 + 两行三列表头 + 统一明细列
  (商品编号/名称/系列/规格/批次号/生产日期/数量/单价/金额/备注)
- 单据总计独立成行(仅数量+金额,右对齐高亮)
- 出库单保留温馨提示,入库单去掉
- 签字行:制单人=当前登录用户(OrderPrintMeta),采购员/销售员=经办人;
  公司名取门店(shopInfoProvider)
- 出库单单价=售价(sale_price),金额=售价×数量;历史单 sale_price=0
  时回退 unit_price/total_price。入库单单价=进价(unit_price)
- 桌面 PDF 与 Web HTML 两端同构

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-26 17:03:23 +08:00
parent 5187702fc5
commit a355a3a2a2
9 changed files with 418 additions and 285 deletions
@@ -227,7 +227,7 @@ class _StockInFormScreenState extends ConsumerState<StockInFormScreen> {
Future<void> _printOrder() async {
if (_loadedOrder == null) return;
await showStockInOrderPrint(context, _loadedOrder!);
await showStockInOrderPrint(context, ref, _loadedOrder!);
}
Future<void> _submit(bool asDraft) async {
@@ -530,7 +530,7 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
onPrint: () async {
final order = await ref.read(stockInRepositoryProvider).get(o.id);
if (context.mounted) {
await showStockInOrderPrint(context, order);
await showStockInOrderPrint(context, ref, order);
}
},
afterPrint: [
@@ -1075,7 +1075,7 @@ class _StockInDetailDialogState extends ConsumerState<_StockInDetailDialog> {
IconButton(
icon: const Icon(Icons.print_outlined, color: AppTheme.primaryDark),
tooltip: '打印',
onPressed: () => showStockInOrderPrint(context, _loadedOrder!),
onPressed: () => showStockInOrderPrint(context, ref, _loadedOrder!),
),
],
),
@@ -258,7 +258,7 @@ class _StockOutFormScreenState extends ConsumerState<StockOutFormScreen> {
Future<void> _printOrder() async {
if (_loadedOrder == null) return;
await showStockOutOrderPrint(context, _loadedOrder!);
await showStockOutOrderPrint(context, ref, _loadedOrder!);
}
Future<void> _submit(bool asDraft) async {
@@ -558,7 +558,7 @@ class _StockOutListScreenState extends ConsumerState<StockOutListScreen> {
onPrint: () async {
final order = await ref.read(stockOutRepositoryProvider).get(o.id);
if (context.mounted) {
await showStockOutOrderPrint(context, order);
await showStockOutOrderPrint(context, ref, order);
}
},
onSettle: () => _confirmSettle(context, o.id, 'stock_out'),
@@ -986,7 +986,7 @@ class _StockOutDetailDialogState extends ConsumerState<_StockOutDetailDialog> {
IconButton(
icon: const Icon(Icons.print_outlined, color: AppTheme.primaryDark),
tooltip: '打印',
onPressed: () => showStockOutOrderPrint(context, _loadedOrder!),
onPressed: () => showStockOutOrderPrint(context, ref, _loadedOrder!),
),
],
),