diff --git a/src/api/ecss/ecss.js b/src/api/ecss/ecss.js index 8eeb8a4..273ac71 100644 --- a/src/api/ecss/ecss.js +++ b/src/api/ecss/ecss.js @@ -98,6 +98,12 @@ export const saveEcssTemplateData = data => createAPI(`/ecss/coDel/saveEcssTempl export const deleteEcssTemplate= data => createAPI(`/ecss/coDel/deleteEcssTemplate`,'post',data) +// 装箱明细相关API +export const updateBoxInfo = data => createAPI(`/ecss/coDel/updateBoxInfo`,'post',data) +export const deleteBoxInfo = data => createAPI(`/ecss/coDel/deleteBoxInfo`,'post',data) +export const updateDetailInfo = data => createAPI(`/ecss/coDel/updateDetailInfo`,'post',data) +export const deleteDetailInfo = data => createAPI(`/ecss/coDel/deleteDetailInfo`,'post',data) + export const searchTemplateList = data => createAPI(`/select/ecssMapper/searchTemplateList/list`,'post',data) export const searchWalMartOrderData = data => createAPI(`/ecss/coDel/searchWalMartOrderData`,'post',data) diff --git a/src/views/modules/ecss/codelnotify.vue b/src/views/modules/ecss/codelnotify.vue index 930990e..1ab223b 100644 --- a/src/views/modules/ecss/codelnotify.vue +++ b/src/views/modules/ecss/codelnotify.vue @@ -177,7 +177,8 @@ + :height="height" + :show-actions="false"> @@ -1001,10 +1002,10 @@ serialNumber: '801001Table1ErpDelNo', tableId: "801001Table1", tableName: "关务系统发货通知单", - columnProp: "erpDelNo", + columnProp: "walMartOrderFlag", headerAlign: "center", align: "left", - columnLabel: "ERP发货单号", + columnLabel: "沃尔玛订单", columnHidden: false, columnImage: false, columnSortable: false, diff --git a/src/views/modules/ecss/codelnotifyConfirm.vue b/src/views/modules/ecss/codelnotifyConfirm.vue index 35193d0..b6cb38c 100644 --- a/src/views/modules/ecss/codelnotifyConfirm.vue +++ b/src/views/modules/ecss/codelnotifyConfirm.vue @@ -161,6 +161,7 @@ {{'一键装箱'}} {{'导入装箱单'}} + {{'装箱'}} {{'栈板维护'}} {{'导出模版'}} + :height="height" + :show-actions="true"> @@ -275,41 +277,7 @@ 关闭 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 保存 - 关闭 - - + @@ -357,6 +325,85 @@ + + + + +
+

箱信息

+ + + + + + + + + + + + + + + + + + + + +
+ + +
+

箱明细

+ +
+ + + + + + + + + + + + + + + +
+
+ + + +
+ + @@ -620,7 +667,7 @@ length:'', width:'', height:'', - volume:'', + boxQty:'', grossWeight:'', netWeight:'', palletRemark:'', @@ -865,10 +912,10 @@ serialNumber: '801002Table1ErpDelNo', tableId: "801002Table1", tableName: "关务系统发货通知单", - columnProp: "erpDelNo", + columnProp: "walMartOrderFlag", headerAlign: "center", align: "left", - columnLabel: "ERP发货单号", + columnLabel: "沃尔玛订单", columnHidden: false, columnImage: false, columnSortable: false, @@ -1651,17 +1698,7 @@ this.height = (window.innerHeight - 260)/2; }) }, - watch: { - dataList8: { - handler() { - this.$nextTick(() => { - if(this.currentRow.buNo==='03-RFID' && this.currentRow.walMartOrderFlag==='Y') { - this.toggleSelection(this.dataList8) - } - }) - }, - } - }, + methods: { isPnDataIncomplete(row) { const hasBoxrolls = row.boxrolls !== null && row.boxrolls !== undefined && row.boxrolls !== ''; @@ -2028,113 +2065,81 @@ site:this.currentRow.site, buNo:this.currentRow.buNo, delNo:this.currentRow.delNo, - seqNo:'', - palletNo:'', - palletQty:'', - length:'', - width:'', - height:'', - volume:'', grossWeight:'', netWeight:'', - pallet:'', - palletRemark:'', + boxQty:'', } searchEcssCoDelNotifyDetail(this.currentRow).then(({data}) => { if (data && data.code == 0) { this.dataList8 = data.rows - this.dataList8.forEach(o => { - if (!o.nocartons) { - o.nativeNocartons = Math.ceil(o.qty/(o.rollqty*o.boxrolls)); - o.nocartons = Math.ceil(o.qty/(o.rollqty*o.boxrolls)); - } else { - o.nativeNocartons = o.nocartons; - } - if (this.notifyDetailMap.has(o.pn)) { - this.notifyDetailMap.get(o.pn).qty=parseInt(this.notifyDetailMap.get(o.pn).qty)+parseInt(o.qty); - } else { - this.notifyDetailMap.set(o.pn, JSON.parse(JSON.stringify(o))); - } - }); - this.dataList8 = this.dataList8.filter(o => parseInt(o.nocartons)>0); } else { this.dataList8 = []; } }); this.palletModelFlag=true }, - handleSelectionChange(val) { - this.multipleSelection = val; - }, - toggleSelection(rows) { - rows.forEach(row => { - this.$refs.partTableRef.toggleRowSelection(row,true); - }); + fillUseQty(row) { + row.useQty = row.surplusQty || 0; }, + savePalletHeader(type) { + // 过滤出 useQty > 0 的行 + const selectedRows = this.dataList8.filter(item => item.useQty && item.useQty > 0); - savePalletHeader(){ - if (this.palletModelData.addFlag===0 && this.multipleSelection.length===0) { - this.$alert('请选择装箱物料!', '错误', { + if (this.palletModelData.addFlag === 0 && selectedRows.length === 0) { + this.$alert('请至少输入一行装箱数量!', '错误', { confirmButtonText: '确定' - }) - return false - } - if(this.palletModelData.palletQty===''||this.palletModelData.palletQty==null){ - this.$alert('请输入数量!', '错误', { - confirmButtonText: '确定' - }) - return false - } - let qtyNoMatch = false; - let pn=''; - if (this.currentRow.buNo==='03-RFID' && this.currentRow.walMartOrderFlag==='Y') { - let mulMap = new Map(); - this.multipleSelection.forEach(o => { - o.nocartons = Math.ceil(o.qty/(o.rollqty*o.boxrolls)); - if (mulMap.has(o.pn)) { - mulMap.get(o.pn).qty=parseInt(mulMap.get(o.pn).qty)+parseInt(o.qty); - } else { - mulMap.set(o.pn, JSON.parse(JSON.stringify(o))); - } - }); - mulMap.forEach((value, key) => { - if (parseInt(this.notifyDetailMap.get(key).qty)!==parseInt(value.qty)) { - qtyNoMatch = true; - pn = pn+(pn?',':'')+value.pn; - } - }) - } else { - this.multipleSelection.forEach(o => { - o.qty = o.nocartons*o.rollqty*o.boxrolls; - o.nocartons = o.nativeNocartons - o.nocartons; }); + return false; } - if (qtyNoMatch) { - this.$alert('PN['+pn+']原始数量和输入总数不相等!', '错误', { + + // 校验:装箱数量不能大于可装箱数量 (item.qty) + const invalidRow = selectedRows.find(item => item.useQty > item.surplusQty); + if (invalidRow) { + this.$alert(`PN ${invalidRow.pn} 的装箱数量不能大于可装箱数量(${invalidRow.surplusQty})!`, '错误', { confirmButtonText: '确定' - }) - return false + }); + return false; } + this.palletModelData.walMartOrderFlag = this.currentRow.walMartOrderFlag; - this.palletModelData.notifyDetailList = this.multipleSelection; - savePalletHeader(this.palletModelData).then(({data}) => { + this.palletModelData.notifyDetailList = selectedRows; + + savePalletHeader(this.palletModelData).then(({ data }) => { if (data && data.code === 0) { - this.refreshCurrentTabTable() - this.palletModelFlag=false; + if (type===0) { + this.palletModelData={ + addFlag:0, + site:this.currentRow.site, + buNo:this.currentRow.buNo, + delNo:this.currentRow.delNo, + grossWeight:'', + netWeight:'', + boxQty:'', + } + searchEcssCoDelNotifyDetail(this.currentRow).then(({data}) => { + if (data && data.code == 0) { + this.dataList8 = data.rows + } else { + this.dataList8 = []; + } + }); + } else { + this.refreshCurrentTabTable() + this.palletModelFlag=false; + } this.$message({ message: '操作成功', type: 'success', - duration: 1500, - onClose: () => {} - }) + duration: 1500 + }); } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' - }) + }); } - }) - + }); }, + deletePallet(row){ this.$confirm('确认删除此明细?', '提示').then(() => { deletePalletHeader(row).then(({data}) => { @@ -2473,4 +2478,20 @@ margin-bottom: 8px; color: #409EFF; } +.pallet-dialog .section { + margin: 10px 7px; +} + +.section-title { + font-size: 14px; + font-weight: bold; + color: #333; + margin-bottom: 8px; +} + +.table-wrapper { + height: 300px; /* 让表格部分固定高度并滚动 */ + overflow-y: auto; +} + diff --git a/src/views/modules/ecss/components/PackingDetailTab.vue b/src/views/modules/ecss/components/PackingDetailTab.vue index 963edb9..239f5c0 100644 --- a/src/views/modules/ecss/components/PackingDetailTab.vue +++ b/src/views/modules/ecss/components/PackingDetailTab.vue @@ -45,6 +45,19 @@ + + + + + @@ -72,12 +85,92 @@ style="width: 100px; height: 80px"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +