From 953c143a3b3dc3403d67bc3f34d75f0b606efc18 Mon Sep 17 00:00:00 2001 From: liuyp Date: Wed, 17 Jul 2024 11:57:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=BB=84=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E7=9A=84=E8=BF=BD=E5=8A=A0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../emisTmsSiteBatch/centerGenBatchMgnt.vue | 106 +++++++++++++++++- 1 file changed, 103 insertions(+), 3 deletions(-) diff --git a/src/views/emis/emisTmsSiteBatch/centerGenBatchMgnt.vue b/src/views/emis/emisTmsSiteBatch/centerGenBatchMgnt.vue index c1815b59..44c16804 100644 --- a/src/views/emis/emisTmsSiteBatch/centerGenBatchMgnt.vue +++ b/src/views/emis/emisTmsSiteBatch/centerGenBatchMgnt.vue @@ -669,6 +669,21 @@ + + + + + + + + + + + + @@ -837,7 +852,7 @@ import { listEmisTmsSiteBatch, getTmsGroupBatchNo, getEmisTmsSiteBatch, delEmisTmsSiteBatch, addEmisTmsSiteBatch, updateEmisTmsSiteBatch } from "@/api/emis/emisTmsSiteBatch"; import { listEmisTmsSiteBatchDtl, delEmisTmsSiteBatchDtl, addEmisTmsSiteBatchDtl } from "@/api/emis/emisTmsSiteBatchDtl"; import { addEmisTmsSiteBatchLoading, listEmisTmsSiteBatchLoading, updateEmisTmsSiteBatchLoading } from "@/api/emis/emisTmsSiteBatchLoading"; -import { listEmisWaybill } from "@/api/emis/emisWaybill"; +import { listEmisWaybill, getWaybillDetail } from "@/api/emis/emisWaybill"; // import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker'; import emisTmsPackForm from '@/views/emis/emisTmsPack/emisTmsPackForm'; import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker'; @@ -897,6 +912,11 @@ export default { coData: { }, + + openBatch: false, + titleBatch: "", + formBatchBillList:"", + // 新增/修改包详情数据 emisCoPackDetail:[], blUnpack:"1", @@ -1508,6 +1528,79 @@ export default { this.tempCoPackList = selection; this.tempCoPackList.length > 0 ? this.addWayBillDisabled = false : this.addWayBillDisabled = true; }, + async submitFormBatch(){ + if(this.formBatchBillList==null || this.formBatchBillList==''){ + this.$message.error("请输入单号"); + return; + } + let bcList=this.formBatchBillList.trim().split(/[;\;\,\,\n]/)||[]; + + bcList.forEach(async (billcode) => { + if(this.emisCoPackDetail.filter(wb => wb.billCode == billcode).length == 0){ + let billRes = await listEmisWaybill({billCode:billcode}); + if(!billRes || billRes.code != 200 || !billRes.rows || billRes.rows.length < 1){ + this.$modal.msgError((response && response.msg || '无此运单数据') + ": " + billcode) + return; + } + let item = billRes.rows[0]; + this.emisCoPackDetail.push(item); + if(this.coPackType=="edit"){ + let packDetail = { + batchNo: this.coData.batchNo, + billCode: item.billCode, + scanDate: item.scanDate, + scanStatus: item.scanStatus, + groupStatus: "1",//已组批次 + scanMan: item.scanMan, + scanSite: item.scanSite, + createBy: this.$store.getters.empCode, + createTime: parseTime(new Date()) + }; + let response = await addEmisTmsSiteBatchDtl(packDetail); + if(!response || response.code != 200){ + this.$modal.msgError(response && response.msg || '组批次明细新增失败') + return; + } + } + } + }) + this.titleBatch=""; + this.openBatch=false; + this.formBatchBillList = ""; + this.wayBillData = { + pageNum: 1, + pageSize: 20, + params:{} + }; + this.emisWayBillList=[]; + this.tempCoPackList=[]; + this.addWayBillDisabled = true; + this.wayBillotal=0; + this.computeTotal(); + // 更新主表 + if(this.coPackType=="edit"){ + this.tempCoPackInfo.batchName = this.coData.batchName; + this.tempCoPackInfo.transType = this.coData.transType; + this.tempCoPackInfo.startSiteCode = this.coData.startSiteCode; + this.tempCoPackInfo.startSiteName = this.coData.startSiteName || null; + this.tempCoPackInfo.nextSiteCode = this.coData.nextSiteCode; + this.tempCoPackInfo.airBilllNo = this.coData.airBilllNo; + this.tempCoPackInfo.etd = this.coData.etd; + this.tempCoPackInfo.carNo = this.coData.carNo; + this.tempCoPackInfo.destCountry = this.coData.destCountry; + this.tempCoPackInfo.shipNo = this.coData.shipNo; + this.tempCoPackInfo.totalWaybillQty = this.coData.totalWaybillQty; + this.tempCoPackInfo.totalParcelQty = this.coData.totalParcelQty; + this.tempCoPackInfo.totalWeight = this.coData.totalWeight; + this.tempCoPackInfo.totalVolume = this.coData.totalVolume; + this.tempCoPackInfo.loadingFile = this.coData.loadingFile; + let res = await updateEmisTmsSiteBatch(this.tempCoPackInfo); + if(!res || res.code != 200){ + this.$modal.msgError(res && res.msg || '未知错误') + return; + } + } + }, async handleCoAdd(){ this.tempCoPackList.forEach(async (item) => { if(this.emisCoPackDetail.filter(wb => wb.billCode == item.billCode).length == 0){ @@ -1782,8 +1875,15 @@ export default { this.$modal.msgError("请先选择必填项") return; } - this.openWayBillForm= true; - this.titleWayBill = "运单列表"; + // this.openWayBillForm= true; + // this.titleWayBill = "运单列表"; + this.openBatch = true; + this.titleBatch = "批量输入运单号"; + }, + cancelBatch(){ + this.openBatch=false; + this.titleBatch = ""; + this.formBatchBillList = ""; }, handleShowMoreInput(){ this.moreInputVisible = !this.moreInputVisible;