Browse Source

天线 箱单的箱数在箱上

master
han\hanst 21 hours ago
parent
commit
5131caa343
  1. 2
      src/views/modules/ecss/codelnotifyTX.vue
  2. 60
      src/views/modules/ecss/components/PackingDetailTabPallet.vue
  3. 12
      src/views/modules/ecss/del_upload_excel_tx.vue

2
src/views/modules/ecss/codelnotifyTX.vue

@ -73,7 +73,7 @@
fixed="left" fixed="left"
label="操作"> label="操作">
<template slot-scope="scope" > <template slot-scope="scope" >
<a type="text" style="color: red" size="small" @click="deleteDelHeader(scope.row)">删除</a>
<a type="text" style="color: red" size="small" v-if="scope.row.notifyStatus!=='已报关'" @click="deleteDelHeader(scope.row)">删除</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

60
src/views/modules/ecss/components/PackingDetailTabPallet.vue

@ -10,6 +10,7 @@
<!-- 行合并表格 - 托盘和明细一目了然 --> <!-- 行合并表格 - 托盘和明细一目了然 -->
<div style="height: 350px"> <div style="height: 350px">
<el-table <el-table
:key="'packing-table-' + boxQtyColumnMode"
:data="flattenedTableData" :data="flattenedTableData"
:max-height="350" :max-height="350"
border border
@ -56,6 +57,11 @@
<span class="box-weight-text">{{ scope.row.net_weight || '-' }}</span> <span class="box-weight-text">{{ scope.row.net_weight || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="isMhmBu" :key="'box_qty_after_net'" label="箱数" prop="box_qty" min-width="100" align="center">
<template slot-scope="scope">
<span class="detail-text">{{ scope.row.box_qty || '-' }}</span>
</template>
</el-table-column>
<!-- 明细信息列不合并 --> <!-- 明细信息列不合并 -->
<el-table-column label="PN" prop="pn" min-width="120" align="left"> <el-table-column label="PN" prop="pn" min-width="120" align="left">
@ -73,7 +79,7 @@
<span class="detail-text">{{ scope.row.qty_per_box || '-' }}</span> <span class="detail-text">{{ scope.row.qty_per_box || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="箱数" prop="box_qty" min-width="100" align="center">
<el-table-column v-if="!isMhmBu" :key="'box_qty_after_qty_per_box'" label="箱数" prop="box_qty" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="detail-text">{{ scope.row.box_qty || '-' }}</span> <span class="detail-text">{{ scope.row.box_qty || '-' }}</span>
</template> </template>
@ -128,6 +134,14 @@ export default {
computed: { computed: {
currentTotalGrossWeight() { currentTotalGrossWeight() {
return this.totalGrossWeight; 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: { watch: {
@ -240,8 +254,8 @@ export default {
notifyDetailItemNo: detail.notifyDetailItemNo, notifyDetailItemNo: detail.notifyDetailItemNo,
pn: detail.pn, pn: detail.pn,
qty: detail.qty, 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 { } else {
@ -321,8 +335,10 @@ export default {
return { rowspan: 1, colspan: 1 }; 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) { if (row._isFirstRowOfPallet) {
return { rowspan: row._palletRowSpan, colspan: 1 }; return { rowspan: row._palletRowSpan, colspan: 1 };
} else { } 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) { if (row._isFirstRowOfBox) {
return { rowspan: row._boxRowSpan, colspan: 1 }; return { rowspan: row._boxRowSpan, colspan: 1 };
} else { } else {
@ -363,7 +383,7 @@ export default {
if (column.property === 'pallet_no' || column.property === 'pallet_qty' || column.property === 'volume') { if (column.property === 'pallet_no' || column.property === 'pallet_qty' || column.property === 'volume') {
this.hoveredPalletKey = row._palletKey; this.hoveredPalletKey = row._palletKey;
this.hoveredBoxKey = null; 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.hoveredBoxKey = row._boxKey;
this.hoveredPalletKey = null; this.hoveredPalletKey = null;
} }
@ -375,22 +395,24 @@ export default {
}, },
getHeaderClassName({ column, columnIndex }) { getHeaderClassName({ column, columnIndex }) {
if (columnIndex >= 0 && columnIndex <= 2) {
const columnProp = column.property;
if (columnProp === 'pallet_no' || columnProp === 'pallet_qty' || columnProp === 'volume') {
return 'pallet-header'; 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'; 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 'detail-header';
} }
return ''; return '';
}, },
getCellClassName({ row, column, rowIndex, columnIndex }) { 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'; 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'; 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 'detail-cell';
} }
return ''; return '';
@ -455,7 +477,17 @@ export default {
}, 0); }, 0);
sums[index] = sum > 0 ? sum.toLocaleString() : ''; sums[index] = sum > 0 ? sum.toLocaleString() : '';
} else if (column.property === 'box_qty') { } 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; let sum = 0;
const boxFirstRows = data.filter(item => item._isFirstRowOfBox); const boxFirstRows = data.filter(item => item._isFirstRowOfBox);
boxFirstRows.forEach(boxRow => { boxFirstRows.forEach(boxRow => {

12
src/views/modules/ecss/del_upload_excel_tx.vue

@ -13,7 +13,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label=" "> <el-form-item label=" ">
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -1619,9 +1619,9 @@
* @return {boolean} 是否可以保存 * @return {boolean} 是否可以保存
*/ */
isRowReadyForSave(row) { isRowReadyForSave(row) {
return !!(row.selectedTemplate &&
row.selectedTemplate.trim() &&
row.selectedCustomer &&
return !!(row.selectedTemplate &&
row.selectedTemplate.trim() &&
row.selectedCustomer &&
row.selectedCustomer.trim()) row.selectedCustomer.trim())
}, },
@ -1644,7 +1644,7 @@
// //
const isNewTemplate = !row.originalTemplateName || row.originalTemplateName === '' const isNewTemplate = !row.originalTemplateName || row.originalTemplateName === ''
const isNameChanged = row.originalTemplateName && row.selectedTemplate !== row.originalTemplateName const isNameChanged = row.originalTemplateName && row.selectedTemplate !== row.originalTemplateName
let confirmMessage = '' let confirmMessage = ''
if (isNewTemplate) { if (isNewTemplate) {
// //
@ -1701,7 +1701,7 @@
} else { } else {
this.$message.success(`模板"${row.selectedTemplate}"更新成功!`) this.$message.success(`模板"${row.selectedTemplate}"更新成功!`)
} }
// //
this.saveToCache() this.saveToCache()
} else { } else {

Loading…
Cancel
Save