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 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-05-21 16:24:50 +08:00
parent e87d29e696
commit 950effc164

View File

@@ -82,6 +82,14 @@ class SingleCodeBody extends StatelessWidget {
return Column( return Column(
children: [ children: [
_SingleInfoBar(
isWaiting: isWaiting,
paichanNo: paichanNo,
existingBoxes: existingBoxes,
maxBoxNo: maxBoxNo,
colorScheme: colorScheme,
onOpenDetail: onOpenDetail,
),
_SingleScanBar( _SingleScanBar(
isWaiting: isWaiting, isWaiting: isWaiting,
zongpaiNo: zongpaiNo, zongpaiNo: zongpaiNo,
@@ -89,16 +97,6 @@ class SingleCodeBody extends StatelessWidget {
erpQuantity: erpQuantity, erpQuantity: erpQuantity,
packedQuantity: packedQuantity, packedQuantity: packedQuantity,
), ),
_SingleInfoBar(
isWaiting: isWaiting,
paichanNo: paichanNo,
packedQuantity: packedQuantity,
erpQuantity: erpQuantity,
existingBoxes: existingBoxes,
maxBoxNo: maxBoxNo,
colorScheme: colorScheme,
onOpenDetail: onOpenDetail,
),
_SingleAssignedList( _SingleAssignedList(
isWaiting: isWaiting, isWaiting: isWaiting,
isFinished: isFinished, isFinished: isFinished,
@@ -155,7 +153,7 @@ class _SingleScanBar extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isWaiting) { if (isWaiting) {
return Container( return Container(
height: 50, height: 35,
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade100, color: Colors.grey.shade100,
@@ -175,7 +173,7 @@ class _SingleScanBar extends StatelessWidget {
} }
return Container( return Container(
height: 50, height: 35,
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.green.shade50, color: Colors.green.shade50,
@@ -188,7 +186,7 @@ class _SingleScanBar extends StatelessWidget {
Expanded( Expanded(
child: Text( child: Text(
zongpaiNo ?? '', zongpaiNo ?? '',
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w700), style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w700),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
@@ -210,8 +208,6 @@ class _SingleScanBar extends StatelessWidget {
class _SingleInfoBar extends StatelessWidget { class _SingleInfoBar extends StatelessWidget {
final bool isWaiting; final bool isWaiting;
final String? paichanNo; final String? paichanNo;
final int packedQuantity;
final int? erpQuantity;
final List<BoxDetailData> existingBoxes; final List<BoxDetailData> existingBoxes;
final int maxBoxNo; final int maxBoxNo;
final ColorScheme colorScheme; final ColorScheme colorScheme;
@@ -220,8 +216,6 @@ class _SingleInfoBar extends StatelessWidget {
const _SingleInfoBar({ const _SingleInfoBar({
required this.isWaiting, required this.isWaiting,
required this.paichanNo, required this.paichanNo,
required this.packedQuantity,
required this.erpQuantity,
required this.existingBoxes, required this.existingBoxes,
required this.maxBoxNo, required this.maxBoxNo,
required this.colorScheme, required this.colorScheme,
@@ -230,10 +224,6 @@ class _SingleInfoBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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; final detailEnabled = !isWaiting && existingBoxes.isNotEmpty;
return Container( return Container(
@@ -242,69 +232,57 @@ class _SingleInfoBar extends StatelessWidget {
color: Colors.grey.shade50, color: Colors.grey.shade50,
border: Border(bottom: BorderSide(color: Colors.grey.shade300)), border: Border(bottom: BorderSide(color: Colors.grey.shade300)),
), ),
child: IntrinsicHeight( child: Row(
child: Row( children: [
crossAxisAlignment: CrossAxisAlignment.stretch, Text(
children: [ isWaiting ? '排产号 --' : (paichanNo ?? '--'),
Expanded( style: TextStyle(
child: Column( fontSize: 22,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.w700,
mainAxisSize: MainAxisSize.min, color: isWaiting
children: [ ? Colors.grey.shade400
Row( : Colors.black87,
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<Color>(
finished ? Colors.green.shade700 : colorScheme.primary,
),
),
),
],
),
), ),
const SizedBox(width: 10), overflow: TextOverflow.ellipsis,
BoxingDetailButton( ),
enabled: detailEnabled, const SizedBox(width: 10),
colorScheme: colorScheme, Expanded(
onPressed: onOpenDetail, 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,
),
],
), ),
); );
} }