Browse Source

批量修改箱明细

java8
han\hanst 3 months ago
parent
commit
fc84727b3a
  1. 3
      src/views/modules/ecss/codelnotifyConfirm.vue
  2. 147
      src/views/modules/ecss/components/PackingDetailTab.vue

3
src/views/modules/ecss/codelnotifyConfirm.vue

@ -207,7 +207,8 @@
ref="packingDetailTab" ref="packingDetailTab"
:current-row="currentRow" :current-row="currentRow"
:height="height" :height="height"
:show-actions="true">
:show-actions="true"
@refresh="searchTable">
</packing-detail-tab> </packing-detail-tab>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="相关文档" name="codelnotifyConfirmDocument"> <el-tab-pane label="相关文档" name="codelnotifyConfirmDocument">

147
src/views/modules/ecss/components/PackingDetailTab.vue

@ -18,7 +18,7 @@
@expand-change="handleBoxExpand" @expand-change="handleBoxExpand"
show-summary show-summary
:summary-method="getSummaries"> :summary-method="getSummaries">
<el-table-column type="expand">
<el-table-column type="expand" width="70px">
<template slot-scope="props"> <template slot-scope="props">
<!-- 加载状态 --> <!-- 加载状态 -->
<div v-if="props.row.loading" class="expand-loading"> <div v-if="props.row.loading" class="expand-loading">
@ -109,6 +109,28 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 托盘重量和总毛重显示模拟表格行布局 -->
<div class="weight-summary-table">
<div class="weight-row">
<div class="weight-cell cell-expand label-cell" >托盘重量</div>
<div class="weight-cell cell-data "></div>
<div class="weight-cell cell-data"></div>
<div class="weight-cell cell-data value-cell">{{ palletWeight }}</div>
<div class="weight-cell cell-data"></div>
<div class="weight-cell cell-data"></div>
<div class="weight-cell cell-action"></div>
</div>
<div class="weight-row">
<div class="weight-cell cell-expand label-cell">总毛重</div>
<div class="weight-cell cell-data "></div>
<div class="weight-cell cell-data"></div>
<div class="weight-cell cell-data value-cell">{{ totalGrossWeight.toFixed(2) }}</div>
<div class="weight-cell cell-data"></div>
<div class="weight-cell cell-data"></div>
<div class="weight-cell cell-action"></div>
</div>
</div>
<!-- 修改箱信息弹窗 --> <!-- 修改箱信息弹窗 -->
<el-dialog <el-dialog
title="修改箱信息" title="修改箱信息"
@ -332,7 +354,7 @@
</template> </template>
<script> <script>
import { selectBoxList, searchCoDelPalletDataNew, updateBoxInfo, deleteBoxInfo, updateDetailInfo, deleteDetailInfo, batchUpdatePackingInfo } from "@/api/ecss/ecss.js"
import { selectBoxList, searchCoDelPalletDataNew, updateBoxInfo, deleteBoxInfo, updateDetailInfo, deleteDetailInfo, batchUpdatePackingInfo, searchEcssCoDelPalletHeaderData } from "@/api/ecss/ecss.js"
export default { export default {
name: "PackingDetailTab", name: "PackingDetailTab",
@ -356,6 +378,10 @@ export default {
expandedBoxRows: [], // expandedBoxRows: [], //
dataListLoading: false, dataListLoading: false,
//
palletWeight: 0, //
totalGrossWeight: 0, // +
// //
editBoxDialogVisible: false, editBoxDialogVisible: false,
editBoxForm: { editBoxForm: {
@ -409,7 +435,7 @@ export default {
sortLv: 0, sortLv: 0,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 40
columnWidth: 100
}, },
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -502,7 +528,7 @@ export default {
sortLv: 0, sortLv: 0,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 40
columnWidth: 50
}, },
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -602,6 +628,8 @@ export default {
loadBoxList() { loadBoxList() {
if (!this.currentRow || !this.currentRow.site) { if (!this.currentRow || !this.currentRow.site) {
this.dataListBoxes = []; this.dataListBoxes = [];
this.palletWeight = 0;
this.totalGrossWeight = 0;
return; return;
} }
@ -609,26 +637,54 @@ export default {
this.expandedBoxRows = []; this.expandedBoxRows = [];
this.dataListLoading = true; this.dataListLoading = true;
// ecss_CoDelBoxList
selectBoxList(this.currentRow).then(({data}) => {
if (data && data.code == 0) {
this.dataListBoxes = data.rows.map(row => ({
//
Promise.all([
selectBoxList(this.currentRow),
searchEcssCoDelPalletHeaderData(this.currentRow)
]).then(([boxResponse, palletResponse]) => {
//
if (boxResponse.data && boxResponse.data.code == 0) {
this.dataListBoxes = boxResponse.data.rows.map(row => ({
...row, ...row,
palletDetails: [], // palletDetails: [], //
loading: false, // loading: false, //
hadDetails: false // hadDetails: false //
}))
}));
} else { } else {
this.dataListBoxes = []; this.dataListBoxes = [];
} }
// -
if (palletResponse.data && palletResponse.data.code == 0) {
const palletList = palletResponse.data.rows || [];
// palletQty > 0
this.palletWeight = palletList
.filter(item => item.palletQty > 0)
.reduce((sum, item) => sum + (Number(item.weight) || 0), 0);
} else {
this.palletWeight = 0;
}
// = +
this.calculateTotalGrossWeight();
}).catch(error => { }).catch(error => {
console.error('加载箱数据失败:', error);
console.error('加载数据失败:', error);
this.dataListBoxes = []; this.dataListBoxes = [];
this.palletWeight = 0;
this.totalGrossWeight = 0;
}).finally(() => { }).finally(() => {
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
//
calculateTotalGrossWeight() {
const boxGrossWeight = this.dataListBoxes.reduce((sum, item) => {
return sum + (Number(item.grossWeight) || 0);
}, 0);
this.totalGrossWeight = boxGrossWeight + this.palletWeight;
},
// //
getBoxRowKey(row) { getBoxRowKey(row) {
// 使 // 使
@ -781,6 +837,7 @@ export default {
deleteBoxInfo(deleteParams).then(({data}) => { deleteBoxInfo(deleteParams).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.loadBoxList() this.loadBoxList()
this.$emit('refresh') //
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -911,6 +968,7 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.editBoxDialogVisible = false; this.editBoxDialogVisible = false;
this.loadBoxList() this.loadBoxList()
this.$emit('refresh') //
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -953,6 +1011,7 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.editDetailDialogVisible = false; this.editDetailDialogVisible = false;
this.loadBoxList() this.loadBoxList()
this.$emit('refresh') //
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -990,6 +1049,7 @@ export default {
deleteDetailInfo(deleteParams).then(({data}) => { deleteDetailInfo(deleteParams).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.loadBoxList() this.loadBoxList()
this.$emit('refresh') //
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -1552,6 +1612,7 @@ export default {
this.$message.success(`成功保存 ${this.batchEditModifiedCount} 处修改`); this.$message.success(`成功保存 ${this.batchEditModifiedCount} 处修改`);
this.batchEditDialogVisible = false; this.batchEditDialogVisible = false;
this.loadBoxList(); // this.loadBoxList(); //
this.$emit('refresh'); //
} else { } else {
this.$alert(response.data.msg || '保存失败', '错误', { this.$alert(response.data.msg || '保存失败', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1573,6 +1634,70 @@ export default {
width: 100%; width: 100%;
} }
/* 托盘重量和总毛重显示样式(模拟表格行) */
.weight-summary-table {
border: 1px solid #ebeef5;
border-top: none;
background: #fff;
}
.weight-row {
display: flex;
border-bottom: 1px solid #ebeef5;
}
.weight-row:last-child {
border-bottom: none;
}
.weight-cell {
padding: 8px 10px;
border-right: 1px solid #ebeef5;
min-height: 23px;
box-sizing: border-box;
}
.weight-cell:last-child {
border-right: none;
}
/* 展开列 - 固定宽度50px */
.cell-expand {
width: 70px;
min-width: 50px;
max-width: 70px;
}
/* 标签列(序号列位置) - flex分配 */
.cell-label {
flex: 1;
min-width: 100px;
}
/* 数据列(箱数、毛重、净重、总Rolls) - flex分配 */
.cell-data {
flex: 1;
min-width: 80px;
text-align: right;
}
/* 操作列 - 固定宽度120px */
.cell-action {
width: 120px;
min-width: 120px;
max-width: 120px;
}
.label-cell {
color: #19be6b;
font-weight: bold;
}
.value-cell {
color: #19be6b;
font-weight: bold;
}
/* 展开明细容器样式 */ /* 展开明细容器样式 */
.expand-detail-container { .expand-detail-container {
background: #fafafa; background: #fafafa;
@ -1638,7 +1763,7 @@ export default {
} }
.expand-empty-state i { .expand-empty-state i {
font-size: 48px;
font-size: 70px;
color: #ddd; color: #ddd;
margin-bottom: 12px; margin-bottom: 12px;
display: block; display: block;

Loading…
Cancel
Save