From 950effc16450498a8b409722f90e9b8b375fa41a Mon Sep 17 00:00:00 2001 From: Misaka_Company Date: Thu, 21 May 2026 16:24:50 +0800 Subject: [PATCH] refactor: redesign single-code boxing info bar layout - Remove progress bar from paichanNo info section - Increase paichanNo font size to 22, decrease zongpaiNo to 15 - Swap paichanNo and zongpaiNo row positions (paichanNo on top) - Split boxing detail info into two lines (box count, max box number) - Reduce zongpaiNo row height from 50 to 35 Co-Authored-By: Claude Opus 4.6 --- .../boxing/widgets/single_code_body.dart | 142 ++++++++---------- 1 file changed, 60 insertions(+), 82 deletions(-) diff --git a/lib/pages/boxing/widgets/single_code_body.dart b/lib/pages/boxing/widgets/single_code_body.dart index 82e3dbb..490d96b 100644 --- a/lib/pages/boxing/widgets/single_code_body.dart +++ b/lib/pages/boxing/widgets/single_code_body.dart @@ -82,6 +82,14 @@ class SingleCodeBody extends StatelessWidget { return Column( children: [ + _SingleInfoBar( + isWaiting: isWaiting, + paichanNo: paichanNo, + existingBoxes: existingBoxes, + maxBoxNo: maxBoxNo, + colorScheme: colorScheme, + onOpenDetail: onOpenDetail, + ), _SingleScanBar( isWaiting: isWaiting, zongpaiNo: zongpaiNo, @@ -89,16 +97,6 @@ class SingleCodeBody extends StatelessWidget { erpQuantity: erpQuantity, packedQuantity: packedQuantity, ), - _SingleInfoBar( - isWaiting: isWaiting, - paichanNo: paichanNo, - packedQuantity: packedQuantity, - erpQuantity: erpQuantity, - existingBoxes: existingBoxes, - maxBoxNo: maxBoxNo, - colorScheme: colorScheme, - onOpenDetail: onOpenDetail, - ), _SingleAssignedList( isWaiting: isWaiting, isFinished: isFinished, @@ -155,7 +153,7 @@ class _SingleScanBar extends StatelessWidget { Widget build(BuildContext context) { if (isWaiting) { return Container( - height: 50, + height: 35, padding: const EdgeInsets.symmetric(horizontal: 12), decoration: BoxDecoration( color: Colors.grey.shade100, @@ -175,7 +173,7 @@ class _SingleScanBar extends StatelessWidget { } return Container( - height: 50, + height: 35, padding: const EdgeInsets.symmetric(horizontal: 12), decoration: BoxDecoration( color: Colors.green.shade50, @@ -188,7 +186,7 @@ class _SingleScanBar extends StatelessWidget { Expanded( child: Text( zongpaiNo ?? '', - style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w700), + style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w700), overflow: TextOverflow.ellipsis, ), ), @@ -210,8 +208,6 @@ class _SingleScanBar extends StatelessWidget { class _SingleInfoBar extends StatelessWidget { final bool isWaiting; final String? paichanNo; - final int packedQuantity; - final int? erpQuantity; final List existingBoxes; final int maxBoxNo; final ColorScheme colorScheme; @@ -220,8 +216,6 @@ class _SingleInfoBar extends StatelessWidget { const _SingleInfoBar({ required this.isWaiting, required this.paichanNo, - required this.packedQuantity, - required this.erpQuantity, required this.existingBoxes, required this.maxBoxNo, required this.colorScheme, @@ -230,10 +224,6 @@ class _SingleInfoBar extends StatelessWidget { @override Widget build(BuildContext context) { - final total = erpQuantity ?? 0; - final packed = isWaiting ? 0 : packedQuantity; - final progress = total <= 0 ? 0.0 : (packed / total).clamp(0.0, 1.0); - final finished = !isWaiting && total > 0 && packed >= total; final detailEnabled = !isWaiting && existingBoxes.isNotEmpty; return Container( @@ -242,69 +232,57 @@ class _SingleInfoBar extends StatelessWidget { color: Colors.grey.shade50, border: Border(bottom: BorderSide(color: Colors.grey.shade300)), ), - child: IntrinsicHeight( - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Row( - children: [ - Text( - isWaiting ? '排产号 --' : (paichanNo ?? '--'), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w700, - color: isWaiting - ? Colors.grey.shade400 - : Colors.black87, - ), - overflow: TextOverflow.ellipsis, - ), - const SizedBox(width: 10), - Expanded( - child: Text( - isWaiting - ? '已有 -- 箱 · 最大箱号 --' - : '已有 ${existingBoxes.length} 箱 · 最大箱号 $maxBoxNo', - style: TextStyle( - fontSize: 10, - color: isWaiting - ? Colors.grey.shade400 - : Colors.grey.shade600, - ), - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.right, - ), - ), - ], - ), - const SizedBox(height: 4), - ClipRRect( - borderRadius: BorderRadius.circular(2), - child: LinearProgressIndicator( - value: progress, - minHeight: 3, - backgroundColor: Colors.grey.shade300, - valueColor: AlwaysStoppedAnimation( - finished ? Colors.green.shade700 : colorScheme.primary, - ), - ), - ), - ], - ), + child: Row( + children: [ + Text( + isWaiting ? '排产号 --' : (paichanNo ?? '--'), + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.w700, + color: isWaiting + ? Colors.grey.shade400 + : Colors.black87, ), - const SizedBox(width: 10), - BoxingDetailButton( - enabled: detailEnabled, - colorScheme: colorScheme, - onPressed: onOpenDetail, + overflow: TextOverflow.ellipsis, + ), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + isWaiting + ? '已有 -- 箱' + : '已有 ${existingBoxes.length} 箱', + style: TextStyle( + fontSize: 12, + color: isWaiting + ? Colors.grey.shade400 + : Colors.grey.shade600, + ), + ), + Text( + isWaiting + ? '最大箱号 --' + : '最大箱号 $maxBoxNo', + style: TextStyle( + fontSize: 12, + color: isWaiting + ? Colors.grey.shade400 + : Colors.grey.shade600, + ), + ), + ], ), - ], - ), + ), + const SizedBox(width: 10), + BoxingDetailButton( + enabled: detailEnabled, + colorScheme: colorScheme, + onPressed: onOpenDetail, + ), + ], ), ); }