feat(client): 出入库单详情抽屉明细增加生产日期+批次号列(两端,抽屉加宽 660,原型同步)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-14 09:54:10 +08:00
parent 3721fe6006
commit 44c985e6b5
11 changed files with 201 additions and 80 deletions
@@ -6,6 +6,9 @@ import 'package:jiu_client/widgets/order_detail_drawer.dart';
/// 2026-07 定价重设计:出库详情按角色两种形态——
/// 管理员(行带 cost/profit)= 成本价/售价/利润 三数值列 + 合计利润;
/// operator(不带)= 售价/小计两列,无成本无利润。
///
/// 2026-07-14:明细新增「生产日期 / 批次号」双行列(入库 5→6 列 / 出库管理员
/// 7→8 列),两种形态下都固定渲染,与成本/利润的角色可见性无关。
void main() {
Widget host(OrderDetailDrawer drawer) => MaterialApp(
theme: buildTheme('a'),
@@ -22,6 +25,8 @@ void main() {
amount: '¥800.00',
cost: '¥355.00',
profit: '¥90.00',
productionDate: '2021-01-27',
batchNo: '20260506',
);
const line4 = OrderLine(
@@ -32,9 +37,11 @@ void main() {
qty: '2',
price: '¥400.00',
amount: '¥800.00',
productionDate: '2021-01-27',
batchNo: '20260506',
);
testWidgets('管理员形态:成本价/售价/利润列 + 合计利润', (tester) async {
testWidgets('管理员形态:成本价/售价/利润列 + 生产日期/批次号列 + 合计利润', (tester) async {
await tester.pumpWidget(host(OrderDetailDrawer(
title: 'CK001',
infoRows: const [],
@@ -54,9 +61,12 @@ void main() {
expect(find.text('¥355.00'), findsOneWidget);
expect(find.text('¥90.00'), findsNWidgets(2)); // 行利润 + 合计利润
expect(find.text('合计利润 '), findsOneWidget);
expect(find.text('生产日期 / 批次号'), findsOneWidget);
expect(find.text('2021-01-27'), findsOneWidget);
expect(find.text('20260506'), findsOneWidget);
});
testWidgets('operator 形态:售价/小计,无成本无利润', (tester) async {
testWidgets('operator 形态:售价/小计 + 生产日期/批次号列,无成本无利润', (tester) async {
await tester.pumpWidget(host(OrderDetailDrawer(
title: 'CK001',
infoRows: const [],
@@ -73,5 +83,32 @@ void main() {
expect(find.text('利润'), findsNothing);
expect(find.text('合计利润 '), findsNothing);
expect(find.text('¥800.00'), findsNWidgets(2)); // 行小计 + 合计金额
expect(find.text('生产日期 / 批次号'), findsOneWidget);
expect(find.text('2021-01-27'), findsOneWidget);
expect(find.text('20260506'), findsOneWidget);
});
testWidgets('生产日期/批次号两值都空时,桌面列仍渲染但单元格显示 —', (tester) async {
const lineEmpty = OrderLine(
name: '汾酒青花20年',
code: 'ZXZ027232',
series: '普通/53度',
spec: '500ml*6/件',
qty: '2',
price: '¥400.00',
amount: '¥800.00',
);
await tester.pumpWidget(host(OrderDetailDrawer(
title: 'RK001',
infoRows: const [],
linesLabel: '入库明细',
lines: const [lineEmpty],
totalText: '¥800.00',
priceLabel: '进价(单瓶)',
amountLabel: '总价',
actionGroups: const [],
)));
expect(find.text('生产日期 / 批次号'), findsOneWidget);
expect(find.text(''), findsNWidgets(2)); // 生产日期 + 批次号均兜底
});
}