diff --git a/src/views/emis/emisWaybill/waybillGot.vue b/src/views/emis/emisWaybill/waybillGot.vue index 94b934f3..f3c078b7 100644 --- a/src/views/emis/emisWaybill/waybillGot.vue +++ b/src/views/emis/emisWaybill/waybillGot.vue @@ -354,7 +354,7 @@ - + @@ -881,7 +881,7 @@ import { parseTime } from "@/utils/custom"; import { debounce } from 'throttle-debounce' import { getDestSite } from "@/api/emis/emisDestination"; import { getValidExchangeRate } from "@/api/emis/emisExchangeRate"; - +import { matchByAddress } from "@/api/emis/emisSpecialZone"; import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue'; @@ -2752,7 +2752,40 @@ methods: { }, //收件地址失去焦点时 handleRecieverAddressChange() { - this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + setTimeout(()=>{ + this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + },500) + }, + async handleRecieverAddressBlur(){ + //如果目的国是柬埔寨、孟加拉国 匹配特区标签 + if (['0855', '0880'].includes(this.form.destinationCountry)) { + const res = await matchByAddress({ + address: this.form.reciever.address + }); + // if(res.data){ + // this.recieverCountryCode = res.data.countryCode; + // this.form.reciever.country = res.data.countryCode; + // this.form.reciever.province = res.data.provinceCode; + // this.recieverRegionName = res.data.provinceName; + // } + if(res.data && res.data.provinceName !== this.recieverRegionName){ + // 弹出确认框 + this.$confirm(`收件地址在"${res.data.provinceName}",请仔细核对,并将其设为收件省份吗?`, "提示", { + confirmButtonText: "确定", + type: "warning", + distinguishCancelAndClose: true, + closeOnClickModal: false, + showCancelButton: true, + showClose: false + }).then(() => { + this.recieverCountryCode = res.data.countryCode; + this.form.reciever.country = res.data.countryCode; + this.form.reciever.province = res.data.provinceCode; + this.recieverRegionName = res.data.provinceName; + this.handleCalcDestSite(); + }); + } + } }, // 弹出柬埔寨特区提醒 openSpecialZone(countryCode, address, recieverRegionName) { diff --git a/src/views/emis/emisWaybill/waybillModify.vue b/src/views/emis/emisWaybill/waybillModify.vue index e6195d59..ba8b868a 100644 --- a/src/views/emis/emisWaybill/waybillModify.vue +++ b/src/views/emis/emisWaybill/waybillModify.vue @@ -63,7 +63,7 @@ - + @@ -356,7 +356,7 @@ - + @@ -880,6 +880,7 @@ import { parseTime } from "@/utils/custom"; import { debounce } from 'throttle-debounce' import { getDestSite } from "@/api/emis/emisDestination"; import { getValidExchangeRate } from "@/api/emis/emisExchangeRate"; +import { matchByAddress } from "@/api/emis/emisSpecialZone"; import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue'; @@ -2753,7 +2754,39 @@ methods: { }, //收件地址失去焦点时 handleRecieverAddressChange() { - this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + setTimeout(() => { + this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + }, 500); + }, + async handleRecieverAddressBlur(){ + //如果目的国是柬埔寨、孟加拉国 匹配特区标签 + if (['0855', '0880'].includes(this.form.destinationCountry)) { + const res = await matchByAddress({ + address: this.form.reciever.address + }); + // if(res.data){ + // this.recieverCountryCode = res.data.countryCode; + // this.form.reciever.country = res.data.countryCode; + // this.form.reciever.province = res.data.provinceCode; + // this.recieverRegionName = res.data.provinceName; + // } + if(res.data && res.data.provinceName !== this.recieverRegionName){ + this.$confirm(`收件地址在"${res.data.provinceName}",请仔细核对,并将其设为收件省份吗?`, "提示", { + confirmButtonText: "确定", + type: "warning", + distinguishCancelAndClose: true, + closeOnClickModal: false, + showCancelButton: true, + showClose: false + }).then(() => { + this.recieverCountryCode = res.data.countryCode; + this.form.reciever.country = res.data.countryCode; + this.form.reciever.province = res.data.provinceCode; + this.recieverRegionName = res.data.provinceName; + this.handleCalcDestSite(); + }); + } + } }, // 弹出柬埔寨特区提醒 openSpecialZone(countryCode, address, recieverRegionName) { diff --git a/src/views/emis/emisWaybill/waybillRecord.vue b/src/views/emis/emisWaybill/waybillRecord.vue index 8139a47e..57eeb7cf 100644 --- a/src/views/emis/emisWaybill/waybillRecord.vue +++ b/src/views/emis/emisWaybill/waybillRecord.vue @@ -357,7 +357,7 @@ - + @@ -879,6 +879,7 @@ import { realMatchWaybill,getTotalAvailablePag } from "@/api/emis/emisCommon"; import { checkWaybillIsExists,getWaybillDetail,realSubmitOrder,calcWaybillFee,calcSetteldWeight,calcVolumeWeight} from "@/api/emis/emisWaybill"; import { listCustomsLevel } from "@/api/emis/emisCustomsLevel"; +import { matchByAddress } from "@/api/emis/emisSpecialZone"; import { parseTime } from "@/utils/custom"; import { debounce } from 'throttle-debounce' import { getDestSite } from "@/api/emis/emisDestination"; @@ -2717,11 +2718,38 @@ methods: { this.recieverRegionName = null; } this.handleCalcDestSite(); - this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); }, - //收件地址失去焦点时 - handleRecieverAddressChange() { - this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + //收件地址值变化 + handleRecieverAddressChange() { + setTimeout(()=>{ + this.openSpecialZone(this.recieverCountryCode, this.form.reciever.address, this.recieverRegionName); + },500) + }, + async handleRecieverAddressBlur(){ + //如果目的国是柬埔寨、孟加拉国 匹配特区标签 + if (['0855', '0880'].includes(this.form.destinationCountry)) { + const res = await matchByAddress({ + address: this.form.reciever.address + }); + if(res.data && res.data.provinceName !== this.recieverRegionName){ + // 弹出确认框 + this.$confirm(`收件地址在"${res.data.provinceName}",请仔细核对,并将其设为收件省份吗?`, "提示", { + confirmButtonText: "确定", + type: "warning", + distinguishCancelAndClose: true, + closeOnClickModal: false, + showCancelButton: true, + showClose: false + }).then(() => { + this.recieverCountryCode = res.data.countryCode; + this.form.reciever.country = res.data.countryCode; + this.form.reciever.province = res.data.provinceCode; + this.recieverRegionName = res.data.provinceName; + this.handleCalcDestSite(); + }); + } + } }, // 弹出柬埔寨特区提醒 diff --git a/src/views/emis/emisWaybillAjustApply/adjustPanel.vue b/src/views/emis/emisWaybillAjustApply/adjustPanel.vue index 21129ecd..e7dce161 100644 --- a/src/views/emis/emisWaybillAjustApply/adjustPanel.vue +++ b/src/views/emis/emisWaybillAjustApply/adjustPanel.vue @@ -736,7 +736,7 @@ - + @@ -1222,6 +1222,7 @@ import { checkWaybillIsExists,getWaybillDetail,realSubmitOrder,calcWaybillFee,calcSetteldWeight,calcVolumeWeight} from "@/api/emis/emisWaybill"; import { listCustomsLevel } from "@/api/emis/emisCustomsLevel"; import { getDestSite } from "@/api/emis/emisDestination"; +import { matchByAddress } from "@/api/emis/emisSpecialZone"; import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue'; @@ -2397,7 +2398,39 @@ export default { this.calcBillFee(); }, handleRecieverAddressChange() { - this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + setTimeout(()=>{ + this.openSpecialZone(this.recieverCountryCode,this.form.reciever.address , this.recieverRegionName); + },500) + }, + async handleRecieverAddressBlur(){ + //如果目的国是柬埔寨、孟加拉国 匹配特区标签 + if (['0855', '0880'].includes(this.form.reciever.country)) { + const res = await matchByAddress({ + address: this.form.reciever.address + }); + // if(res.data){ + // this.recieverCountryCode = res.data.countryCode; + // this.form.reciever.country = res.data.countryCode; + // this.form.reciever.province = res.data.provinceCode; + // this.recieverRegionName = res.data.provinceName; + // } + if(res.data && res.data.provinceName !== this.recieverRegionName){ + this.$confirm(`收件地址在"${res.data.provinceName}",请仔细核对,并将其设为收件省份吗?`, "提示", { + confirmButtonText: "确定", + type: "warning", + distinguishCancelAndClose: true, + closeOnClickModal: false, + showCancelButton: true, + showClose: false + }).then(() => { + this.recieverCountryCode = res.data.countryCode; + this.form.reciever.country = res.data.countryCode; + this.form.reciever.province = res.data.provinceCode; + this.recieverRegionName = res.data.provinceName; + this.handleCalcDestSite(); + }); + } + } }, // 弹出柬埔寨特区提醒 openSpecialZone(countryCode, address, recieverRegionName) {