diff --git a/src/views/modules/ecss/codelnotifyTX.vue b/src/views/modules/ecss/codelnotifyTX.vue index ea91af3..cb75a41 100644 --- a/src/views/modules/ecss/codelnotifyTX.vue +++ b/src/views/modules/ecss/codelnotifyTX.vue @@ -73,7 +73,7 @@ fixed="left" label="操作">
{{ scope.row.net_weight || '-' }} + + + @@ -73,7 +79,7 @@ {{ scope.row.qty_per_box || '-' }} - + @@ -128,6 +134,14 @@ export default { computed: { currentTotalGrossWeight() { return this.totalGrossWeight; + }, + isMhmBu() { + const buNo = this.currentRow && this.currentRow.buNo ? String(this.currentRow.buNo).trim() : ''; + const buName = this.currentRow && this.currentRow.buName ? String(this.currentRow.buName).trim() : ''; + return buNo === '04-MHM' || buName === '04-MHM'; + }, + boxQtyColumnMode() { + return this.isMhmBu ? 'mhm' : 'default'; } }, watch: { @@ -240,8 +254,8 @@ export default { notifyDetailItemNo: detail.notifyDetailItemNo, pn: detail.pn, qty: detail.qty, - box_qty: detail.boxQty, - qty_per_box: detail.boxQty && detail.boxQty > 0 ? (detail.qty / detail.boxQty).toFixed(2) : '-' + box_qty: this.isMhmBu ? (box.box_qty || box.boxQty || '') : detail.boxQty, + qty_per_box: detail.rolls }); }); } else { @@ -321,8 +335,10 @@ export default { return { rowspan: 1, colspan: 1 }; } + const columnProp = column.property; + // 托盘级别合并(托号、托数、总体积) - if (columnIndex >= 0 && columnIndex <= 2) { + if (columnProp === 'pallet_no' || columnProp === 'pallet_qty' || columnProp === 'volume') { if (row._isFirstRowOfPallet) { return { rowspan: row._palletRowSpan, colspan: 1 }; } else { @@ -330,8 +346,12 @@ export default { } } - // 箱级别合并(毛重、净重) - if (columnIndex >= 3 && columnIndex <= 4) { + // 箱级别合并(毛重、净重;天线04-MHM时箱数也按箱合并) + const shouldMergeByBox = + columnProp === 'gross_weight' || + columnProp === 'net_weight' || + (this.isMhmBu && columnProp === 'box_qty'); + if (shouldMergeByBox) { if (row._isFirstRowOfBox) { return { rowspan: row._boxRowSpan, colspan: 1 }; } else { @@ -363,7 +383,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') { + } else if (column.property === 'gross_weight' || column.property === 'net_weight' || (this.isMhmBu && column.property === 'box_qty')) { this.hoveredBoxKey = row._boxKey; this.hoveredPalletKey = null; } @@ -375,22 +395,24 @@ export default { }, getHeaderClassName({ column, columnIndex }) { - if (columnIndex >= 0 && columnIndex <= 2) { + const columnProp = column.property; + if (columnProp === 'pallet_no' || columnProp === 'pallet_qty' || columnProp === 'volume') { return 'pallet-header'; - } else if (columnIndex >= 3 && columnIndex <= 4) { + } else if (columnProp === 'gross_weight' || columnProp === 'net_weight' || (this.isMhmBu && columnProp === 'box_qty')) { return 'box-header'; - } else if (columnIndex >= 5 && columnIndex <= 8) { + } else if (columnProp === 'pn' || columnProp === 'qty' || columnProp === 'qty_per_box' || (!this.isMhmBu && columnProp === 'box_qty')) { return 'detail-header'; } return ''; }, getCellClassName({ row, column, rowIndex, columnIndex }) { - if (columnIndex >= 0 && columnIndex <= 2) { + const columnProp = column.property; + if (columnProp === 'pallet_no' || columnProp === 'pallet_qty' || columnProp === 'volume') { return 'pallet-cell'; - } else if (columnIndex >= 3 && columnIndex <= 4) { + } else if (columnProp === 'gross_weight' || columnProp === 'net_weight' || (this.isMhmBu && columnProp === 'box_qty')) { return 'box-cell'; - } else if (columnIndex >= 5 && columnIndex <= 8) { + } else if (columnProp === 'pn' || columnProp === 'qty' || columnProp === 'qty_per_box' || (!this.isMhmBu && columnProp === 'box_qty')) { return 'detail-cell'; } return ''; @@ -455,7 +477,17 @@ export default { }, 0); sums[index] = sum > 0 ? sum.toLocaleString() : ''; } else if (column.property === 'box_qty') { - // 箱数需要根据明细累加,如果没有明细,则根据箱级别累加 + // 天线04-MHM:箱数使用箱表box_qty,且按箱级别汇总 + if (this.isMhmBu) { + const boxFirstRows = data.filter(item => item._isFirstRowOfBox); + const sum = boxFirstRows.reduce((prev, curr) => { + const value = Number(curr.box_qty); + return !isNaN(value) ? prev + value : prev; + }, 0); + sums[index] = sum; + return; + } + // 其他BU:保持原逻辑(按明细累加;无明细时取箱级别) let sum = 0; const boxFirstRows = data.filter(item => item._isFirstRowOfBox); boxFirstRows.forEach(boxRow => { diff --git a/src/views/modules/ecss/del_upload_excel_tx.vue b/src/views/modules/ecss/del_upload_excel_tx.vue index 208fa09..6f2e549 100644 --- a/src/views/modules/ecss/del_upload_excel_tx.vue +++ b/src/views/modules/ecss/del_upload_excel_tx.vue @@ -13,7 +13,7 @@ - 下载文件模板 + @@ -1619,9 +1619,9 @@ * @return {boolean} 是否可以保存 */ isRowReadyForSave(row) { - return !!(row.selectedTemplate && - row.selectedTemplate.trim() && - row.selectedCustomer && + return !!(row.selectedTemplate && + row.selectedTemplate.trim() && + row.selectedCustomer && row.selectedCustomer.trim()) }, @@ -1644,7 +1644,7 @@ // 判断操作类型,给用户明确提示 const isNewTemplate = !row.originalTemplateName || row.originalTemplateName === '' const isNameChanged = row.originalTemplateName && row.selectedTemplate !== row.originalTemplateName - + let confirmMessage = '' if (isNewTemplate) { // 手动输入的新模板名 @@ -1701,7 +1701,7 @@ } else { this.$message.success(`模板"${row.selectedTemplate}"更新成功!`) } - + // 保存成功后更新缓存 this.saveToCache() } else {