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:
@@ -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<BoxDetailData> 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,21 +232,12 @@ 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,
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: isWaiting
|
||||
? Colors.grey.shade400
|
||||
@@ -266,32 +247,30 @@ class _SingleInfoBar extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
isWaiting
|
||||
? '已有 -- 箱 · 最大箱号 --'
|
||||
: '已有 ${existingBoxes.length} 箱 · 最大箱号 $maxBoxNo',
|
||||
? '已有 -- 箱'
|
||||
: '已有 ${existingBoxes.length} 箱',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontSize: 12,
|
||||
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,
|
||||
),
|
||||
Text(
|
||||
isWaiting
|
||||
? '最大箱号 --'
|
||||
: '最大箱号 $maxBoxNo',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isWaiting
|
||||
? Colors.grey.shade400
|
||||
: Colors.grey.shade600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -305,7 +284,6 @@ class _SingleInfoBar extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user