feat(client): 库存卡片显示单价(进价)+ 成本按角色隐藏
- 手机库存卡副行追加进价(编号 · 规格 · ¥xxx),仅管理员可见 - 宽屏成本价/总价列、货值 KPI、商品抽屉成本行对非管理员隐藏(isAdminProvider) - m-inventory 原型同步 + 移动 golden ×6 重录(管理员形态基准) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
|
||||
import '../core/auth/auth_state.dart';
|
||||
import '../core/config/app_config.dart';
|
||||
import '../core/utils/dialog_util.dart';
|
||||
import '../core/responsive/responsive.dart';
|
||||
@@ -356,10 +357,14 @@ class _ProductEditorDrawerState extends ConsumerState<_ProductEditorDrawer> {
|
||||
b('${_fmtQty(widget.qty!)} ${widget.unit ?? p.unit}'.trim())
|
||||
));
|
||||
}
|
||||
// 成本仅管理员可见(与库存列表/出库同口径);p.purchasePrice 兜底也要一并门控
|
||||
final isAdmin = ref.watch(isAdminProvider);
|
||||
final cost = widget.cost ?? p.purchasePrice;
|
||||
if (cost != null && cost > 0) rows.add(('成本价(单瓶)', b(_fmtMoney(cost))));
|
||||
if (widget.qty != null && cost != null && cost > 0) {
|
||||
rows.add(('总成本价', b(_fmtMoney(widget.qty! * cost))));
|
||||
if (isAdmin && cost != null && cost > 0) {
|
||||
rows.add(('成本价(单瓶)', b(_fmtMoney(cost))));
|
||||
if (widget.qty != null) {
|
||||
rows.add(('总成本价', b(_fmtMoney(widget.qty! * cost))));
|
||||
}
|
||||
}
|
||||
if ((widget.status ?? '').isNotEmpty) {
|
||||
rows.add((
|
||||
|
||||
Reference in New Issue
Block a user