diff --git a/src/api/emis/emisTmsSiteBatch.js b/src/api/emis/emisTmsSiteBatch.js index 46e2bfde..19b06390 100644 --- a/src/api/emis/emisTmsSiteBatch.js +++ b/src/api/emis/emisTmsSiteBatch.js @@ -37,6 +37,14 @@ export function addEmisTmsSiteBatch(data) { data: data }) } +//货物组批次保存 +export function addAllEmisTmsSiteBatch(data) { + return request({ + url: '/emis/emisTmsSiteBatch/addAll', + method: 'post', + data: data + }) +} // 修改一级网点TMS组批次 export function updateEmisTmsSiteBatch(data) { diff --git a/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue b/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue index e5bf1230..41502eb1 100644 --- a/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue +++ b/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue @@ -360,7 +360,7 @@ import { listEmisTmsSiteBatch, getTmsGroupBatchNo, getEmisTmsSiteBatch, delEmisTmsSiteBatch, addEmisTmsSiteBatch, updateEmisTmsSiteBatch, - scanSiteBatch + scanSiteBatch, addAllEmisTmsSiteBatch } from "@/api/emis/emisTmsSiteBatch"; import { listEmisTmsSiteBatchDtl, delEmisTmsSiteBatchDtl, addEmisTmsSiteBatchDtl } from "@/api/emis/emisTmsSiteBatchDtl"; @@ -1028,7 +1028,7 @@ export default { if (valid) { this.handleAddCoPack(); } - }); + }); }, async handleAddCoPack(){ @@ -1046,18 +1046,8 @@ export default { if(this.isCopy){ this.form.id=null; } - - - console.log("==this.form==>",this.form); - - - let response = await addEmisTmsSiteBatch(this.form); - if(!response || response.code != 200){ - this.isDoing=false; - this.$modal.msgError(response && response.msg || '新增组批次失败') - return; - } - + this.form.batchDtlList=[]; + this.form.loadingList=[]; for(let i = 0; i< this.emisCoPackDetail.length;i++){ let packDetail = { batchNo:this.form.batchNo, @@ -1068,13 +1058,13 @@ export default { scanMan: this.emisCoPackDetail[i].scanMan, scanSite: this.emisCoPackDetail[i].scanSite, }; - - let response = await addEmisTmsSiteBatchDtl(packDetail); - if(!response || response.code != 200){ - this.isDoing=false; - this.$modal.msgError(response && response.msg || '组批次明细新增失败') - return; - } + this.form.batchDtlList.push(packDetail); + // let response = await addEmisTmsSiteBatchDtl(packDetail); + // if(!response || response.code != 200){ + // this.isDoing=false; + // this.$modal.msgError(response && response.msg || '组批次明细新增失败') + // return; + // } this.waitPackList=[]; } @@ -1091,15 +1081,22 @@ export default { remark:"", tenantId:"", } - let resLD = await addEmisTmsSiteBatchLoading(batchLoadingData); - if(!resLD || resLD.code != 200){ - this.isDoing=false; - this.$modal.msgError(resLD && resLD.msg || '组批次配载明细新增失败') - return; - } + this.form.loadingList.push(batchLoadingData); + // let resLD = await addEmisTmsSiteBatchLoading(batchLoadingData); + // if(!resLD || resLD.code != 200){ + // this.isDoing=false; + // this.$modal.msgError(resLD && resLD.msg || '组批次配载明细新增失败') + // return; + // } } + } + let response = await addAllEmisTmsSiteBatch(this.form); + if(!response || response.code != 200){ + this.isDoing=false; + this.$modal.msgError(response && response.msg || '新增组批次失败') + return; } - + // 批次重算 try{ let resScan=await scanSiteBatch(this.form.batchNo);