diff --git a/src/views/modules/ecss/components/PackingDetailTabPallet.vue b/src/views/modules/ecss/components/PackingDetailTabPallet.vue
index a432752..1322df8 100644
--- a/src/views/modules/ecss/components/PackingDetailTabPallet.vue
+++ b/src/views/modules/ecss/components/PackingDetailTabPallet.vue
@@ -57,6 +57,18 @@
{{ scope.row.net_weight || '-' }}
+
+
+ {{ scope.row.box_no || '-' }}
+
+
+
+
+
+ {{ scope.row.volume_per_box !== null && scope.row.volume_per_box !== undefined && scope.row.volume_per_box !== '' ? Number(scope.row.volume_per_box).toFixed(2) : '-' }}
+
+
+
{{ scope.row.box_qty || '-' }}
@@ -220,10 +232,41 @@ export default {
detailsMap.get(boxItemNo).push(detail);
});
+ // 兜底:部分历史数据可能没有托盘头,但存在箱和明细,按箱的seq_no自动分组展示
+ let palletSource = pallets || [];
+ if (palletSource.length === 0 && boxes.length > 0) {
+ const derivedPalletMap = new Map();
+ boxes.forEach(box => {
+ const seqNo = String(box.seq_no || box.seqNo || '');
+ if (!seqNo) {
+ return;
+ }
+ if (!derivedPalletMap.has(seqNo)) {
+ derivedPalletMap.set(seqNo, {
+ seqNo: seqNo,
+ palletNo: seqNo,
+ palletQty: '',
+ volume: null
+ });
+ }
+ });
+ palletSource = Array.from(derivedPalletMap.values()).sort((a, b) => {
+ const seqA = Number(a.seqNo);
+ const seqB = Number(b.seqNo);
+ if (!isNaN(seqA) && !isNaN(seqB)) {
+ return seqA - seqB;
+ }
+ return String(a.seqNo).localeCompare(String(b.seqNo));
+ });
+ }
+
const flattenedData = [];
- pallets.forEach(pallet => {
- const palletSeqNo = String(pallet.seqNo);
+ palletSource.forEach(pallet => {
+ const palletSeqNo = String(pallet.seqNo || pallet.seq_no || '');
+ if (!palletSeqNo) {
+ return;
+ }
const palletBoxes = boxesMap.get(palletSeqNo) || [];
let palletRowSpan = 0;
@@ -243,9 +286,11 @@ export default {
_isFirstRowOfPallet: boxIdx === 0 && detailIdx === 0,
_isFirstRowOfBox: detailIdx === 0,
_boxRowSpan: detailIdx === 0 ? boxDetails.length : 0,
- pallet_no: pallet.palletNo,
- pallet_qty: pallet.palletQty,
+ pallet_no: pallet.palletNo || pallet.pallet_no || palletSeqNo,
+ pallet_qty: pallet.palletQty || pallet.pallet_qty || '',
volume: pallet.volume,
+ box_no: box.item_no || box.itemNo,
+ volume_per_box: box.volume,
gross_weight: box.gross_weight || box.grossWeight,
net_weight: box.net_weight || box.netWeight,
_hasDetail: true,
@@ -266,9 +311,11 @@ export default {
_isFirstRowOfPallet: boxIdx === 0,
_isFirstRowOfBox: true,
_boxRowSpan: 1,
- pallet_no: pallet.palletNo,
- pallet_qty: pallet.palletQty,
+ pallet_no: pallet.palletNo || pallet.pallet_no || palletSeqNo,
+ pallet_qty: pallet.palletQty || pallet.pallet_qty || '',
volume: pallet.volume,
+ box_no: box.item_no || box.itemNo,
+ volume_per_box: box.volume,
gross_weight: box.gross_weight || box.grossWeight,
net_weight: box.net_weight || box.netWeight,
_hasDetail: false,
@@ -288,9 +335,11 @@ export default {
_isFirstRowOfPallet: true,
_isFirstRowOfBox: true,
_boxRowSpan: 1,
- pallet_no: pallet.palletNo,
- pallet_qty: pallet.palletQty,
+ pallet_no: pallet.palletNo || pallet.pallet_no || palletSeqNo,
+ pallet_qty: pallet.palletQty || pallet.pallet_qty || '',
volume: pallet.volume,
+ box_no: '',
+ volume_per_box: '',
gross_weight: '',
net_weight: '',
_hasDetail: false,
@@ -350,6 +399,8 @@ export default {
const shouldMergeByBox =
columnProp === 'gross_weight' ||
columnProp === 'net_weight' ||
+ (this.isMhmBu && columnProp === 'box_no') ||
+ (this.isMhmBu && columnProp === 'volume_per_box') ||
(this.isMhmBu && columnProp === 'box_qty');
if (shouldMergeByBox) {
if (row._isFirstRowOfBox) {
@@ -383,7 +434,7 @@ export default {
if (column.property === 'pallet_no' || column.property === 'pallet_qty' || column.property === 'volume') {
this.hoveredPalletKey = row._palletKey;
this.hoveredBoxKey = null;
- } else if (column.property === 'gross_weight' || column.property === 'net_weight' || (this.isMhmBu && column.property === 'box_qty')) {
+ } else if (column.property === 'gross_weight' || column.property === 'net_weight' || (this.isMhmBu && column.property === 'box_no') || (this.isMhmBu && column.property === 'volume_per_box') || (this.isMhmBu && column.property === 'box_qty')) {
this.hoveredBoxKey = row._boxKey;
this.hoveredPalletKey = null;
}
@@ -398,7 +449,7 @@ export default {
const columnProp = column.property;
if (columnProp === 'pallet_no' || columnProp === 'pallet_qty' || columnProp === 'volume') {
return 'pallet-header';
- } else if (columnProp === 'gross_weight' || columnProp === 'net_weight' || (this.isMhmBu && columnProp === 'box_qty')) {
+ } else if (columnProp === 'gross_weight' || columnProp === 'net_weight' || (this.isMhmBu && columnProp === 'box_no') || (this.isMhmBu && columnProp === 'volume_per_box') || (this.isMhmBu && columnProp === 'box_qty')) {
return 'box-header';
} else if (columnProp === 'pn' || columnProp === 'qty' || columnProp === 'qty_per_box' || (!this.isMhmBu && columnProp === 'box_qty')) {
return 'detail-header';
@@ -410,7 +461,7 @@ export default {
const columnProp = column.property;
if (columnProp === 'pallet_no' || columnProp === 'pallet_qty' || columnProp === 'volume') {
return 'pallet-cell';
- } else if (columnProp === 'gross_weight' || columnProp === 'net_weight' || (this.isMhmBu && columnProp === 'box_qty')) {
+ } else if (columnProp === 'gross_weight' || columnProp === 'net_weight' || (this.isMhmBu && columnProp === 'box_no') || (this.isMhmBu && columnProp === 'volume_per_box') || (this.isMhmBu && columnProp === 'box_qty')) {
return 'box-cell';
} else if (columnProp === 'pn' || columnProp === 'qty' || columnProp === 'qty_per_box' || (!this.isMhmBu && columnProp === 'box_qty')) {
return 'detail-cell';