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: [ children: [
const Text('装箱详情'), const Text('装箱详情'),
const SizedBox(width: 12), const SizedBox(width: 12),
Text( Expanded(
child: Text(
paichanNo, paichanNo,
style: style: const TextStyle(
const TextStyle(fontSize: 14, fontWeight: FontWeight.normal), fontSize: 14,
fontWeight: FontWeight.normal,
),
overflow: TextOverflow.ellipsis,
),
), ),
], ],
), ),
@@ -77,11 +82,29 @@ class BoxingDetailPage extends StatelessWidget {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 2), padding: const EdgeInsets.symmetric(vertical: 2),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text(item.zongpaiNo, style: const TextStyle(fontSize: 14)), Expanded(
Text('数量:${item.quantity}', flex: 3,
style: const TextStyle(fontSize: 14)), 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? _paichanNo;
String? _workOrderNo;
int? _erpQuantity; int? _erpQuantity;
List<BoxDetailData> _existingBoxes = []; List<BoxDetailData> _existingBoxes = [];
int _maxBoxNo = 0; int _maxBoxNo = 0;
@@ -129,6 +130,7 @@ class _BoxingPageState extends State<BoxingPage> {
_phase = _Phase.waiting; _phase = _Phase.waiting;
_zongpaiNo = null; _zongpaiNo = null;
_paichanNo = null; _paichanNo = null;
_workOrderNo = null;
_erpQuantity = null; _erpQuantity = null;
_existingBoxes = []; _existingBoxes = [];
_maxBoxNo = 0; _maxBoxNo = 0;
@@ -222,6 +224,7 @@ class _BoxingPageState extends State<BoxingPage> {
setState(() { setState(() {
_zongpaiNo = zongpai; _zongpaiNo = zongpai;
_paichanNo = result.paichanNo; _paichanNo = result.paichanNo;
_workOrderNo = result.workOrderNo;
_erpQuantity = result.quantity; _erpQuantity = result.quantity;
_existingBoxes = result.existingBoxes; _existingBoxes = result.existingBoxes;
_maxBoxNo = result.maxBoxNo; _maxBoxNo = result.maxBoxNo;
@@ -363,7 +366,13 @@ class _BoxingPageState extends State<BoxingPage> {
..add( ..add(
BoxDetailData( BoxDetailData(
boxNo: boxNo, boxNo: boxNo,
items: [BoxItemData(zongpaiNo: _zongpaiNo!, quantity: quantity)], items: [
BoxItemData(
zongpaiNo: _zongpaiNo!,
workOrderNo: _workOrderNo,
quantity: quantity,
),
],
), ),
); );
_maxBoxNo = _maxBoxNo > boxNo ? _maxBoxNo : boxNo; _maxBoxNo = _maxBoxNo > boxNo ? _maxBoxNo : boxNo;
@@ -658,27 +667,41 @@ class _BoxingPageState extends State<BoxingPage> {
Widget _buildInfoArea(bool isWaiting, ColorScheme colorScheme) { Widget _buildInfoArea(bool isWaiting, ColorScheme colorScheme) {
final grey = isWaiting; final grey = isWaiting;
final paichanText = grey ? '--' : (_paichanNo ?? '--');
final workOrderText = grey ? '--' : (_workOrderNo ?? '--');
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
'排产号:', children: [
Expanded(
child: Text(
paichanText,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 20,
color: grey ? Colors.grey : Colors.black54, fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 2),
Text(
_paichanNo ?? '--',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: grey ? Colors.grey : Colors.black87, color: grey ? Colors.grey : Colors.black87,
), ),
overflow: TextOverflow.ellipsis,
), ),
const SizedBox(height: 8), ),
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: 10),
Row( Row(
children: [ children: [

View File

@@ -33,13 +33,19 @@ class RegistrationResult {
/// 箱号内单个总排号明细 /// 箱号内单个总排号明细
class BoxItemData { class BoxItemData {
final String zongpaiNo; final String zongpaiNo;
final String? workOrderNo;
final int quantity; final int quantity;
BoxItemData({required this.zongpaiNo, required this.quantity}); BoxItemData({
required this.zongpaiNo,
this.workOrderNo,
required this.quantity,
});
factory BoxItemData.fromJson(Map<String, dynamic> json) { factory BoxItemData.fromJson(Map<String, dynamic> json) {
return BoxItemData( return BoxItemData(
zongpaiNo: json['zongpai_no'] as String, zongpaiNo: json['zongpai_no'] as String,
workOrderNo: json['work_order_no']?.toString(),
quantity: json['quantity'] as int, quantity: json['quantity'] as int,
); );
} }
@@ -68,6 +74,7 @@ class BoxInfoResult {
final String? errorMessage; final String? errorMessage;
final String? zongpaiNo; final String? zongpaiNo;
final String? paichanNo; final String? paichanNo;
final String? workOrderNo;
final int? quantity; final int? quantity;
final List<BoxDetailData> existingBoxes; final List<BoxDetailData> existingBoxes;
final int maxBoxNo; final int maxBoxNo;
@@ -78,6 +85,7 @@ class BoxInfoResult {
this.errorMessage, this.errorMessage,
this.zongpaiNo, this.zongpaiNo,
this.paichanNo, this.paichanNo,
this.workOrderNo,
this.quantity, this.quantity,
this.existingBoxes = const [], this.existingBoxes = const [],
this.maxBoxNo = 0, this.maxBoxNo = 0,
@@ -94,6 +102,7 @@ class BoxInfoResult {
success: true, success: true,
zongpaiNo: json['zongpai_no'] as String?, zongpaiNo: json['zongpai_no'] as String?,
paichanNo: json['paichan_no'] as String?, paichanNo: json['paichan_no'] as String?,
workOrderNo: json['work_order_no']?.toString(),
quantity: json['quantity'] as int?, quantity: json['quantity'] as int?,
existingBoxes: boxes, existingBoxes: boxes,
maxBoxNo: json['max_box_no'] as int? ?? 0, maxBoxNo: json['max_box_no'] as int? ?? 0,