feat(boxing): show work order numbers in boxing views

This commit is contained in:
Misaka_Company
2026-05-13 09:48:08 +08:00
parent 62583510b2
commit c2fc884b66
3 changed files with 81 additions and 26 deletions

View File

@@ -19,10 +19,15 @@ class BoxingDetailPage extends StatelessWidget {
children: [
const Text('装箱详情'),
const SizedBox(width: 12),
Text(
paichanNo,
style:
const TextStyle(fontSize: 14, fontWeight: FontWeight.normal),
Expanded(
child: Text(
paichanNo,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
@@ -77,11 +82,29 @@ class BoxingDetailPage extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(item.zongpaiNo, style: const TextStyle(fontSize: 14)),
Text('数量:${item.quantity}',
style: const TextStyle(fontSize: 14)),
Expanded(
flex: 3,
child: Text(
item.zongpaiNo,
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 8),
Expanded(
flex: 2,
child: Text(
item.workOrderNo ?? '--',
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 8),
Text(
'数量:${item.quantity}',
style: const TextStyle(fontSize: 14),
),
],
),
);

View File

@@ -49,6 +49,7 @@ class _BoxingPageState extends State<BoxingPage> {
// 排产号信息(来自后端查询)
String? _paichanNo;
String? _workOrderNo;
int? _erpQuantity;
List<BoxDetailData> _existingBoxes = [];
int _maxBoxNo = 0;
@@ -129,6 +130,7 @@ class _BoxingPageState extends State<BoxingPage> {
_phase = _Phase.waiting;
_zongpaiNo = null;
_paichanNo = null;
_workOrderNo = null;
_erpQuantity = null;
_existingBoxes = [];
_maxBoxNo = 0;
@@ -222,6 +224,7 @@ class _BoxingPageState extends State<BoxingPage> {
setState(() {
_zongpaiNo = zongpai;
_paichanNo = result.paichanNo;
_workOrderNo = result.workOrderNo;
_erpQuantity = result.quantity;
_existingBoxes = result.existingBoxes;
_maxBoxNo = result.maxBoxNo;
@@ -363,7 +366,13 @@ class _BoxingPageState extends State<BoxingPage> {
..add(
BoxDetailData(
boxNo: boxNo,
items: [BoxItemData(zongpaiNo: _zongpaiNo!, quantity: quantity)],
items: [
BoxItemData(
zongpaiNo: _zongpaiNo!,
workOrderNo: _workOrderNo,
quantity: quantity,
),
],
),
);
_maxBoxNo = _maxBoxNo > boxNo ? _maxBoxNo : boxNo;
@@ -658,27 +667,41 @@ class _BoxingPageState extends State<BoxingPage> {
Widget _buildInfoArea(bool isWaiting, ColorScheme colorScheme) {
final grey = isWaiting;
final paichanText = grey ? '--' : (_paichanNo ?? '--');
final workOrderText = grey ? '--' : (_workOrderNo ?? '--');
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'排产号:',
style: TextStyle(
fontSize: 13,
color: grey ? Colors.grey : Colors.black54,
),
Row(
children: [
Expanded(
child: Text(
paichanText,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
color: grey ? Colors.grey : Colors.black87,
),
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 12),
Expanded(
child: Text(
workOrderText,
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: grey ? Colors.grey : Colors.black87,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 2),
Text(
_paichanNo ?? '--',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: grey ? Colors.grey : Colors.black87,
),
),
const SizedBox(height: 8),
const SizedBox(height: 10),
Row(
children: [