Commit f7b0b3d9 authored by dragondean@qq.com's avatar dragondean@qq.com

订单下单校验收货人手机区号是否与目的国一致

parent 09914fec
......@@ -115,3 +115,12 @@ export function listByIds(params){
params
})
}
// 检查国家区域是否与手机号国家区号一致
export function checkCountryCode(params){
return request({
url: 'ecw/region/check/dest-currency/area-code/',
method: 'get',
params
})
}
......@@ -675,7 +675,7 @@ import {getChannelList} from '@/api/ecw/channel'
import Selector from '@/components/Selector'
import CustomerContactSelector from '@/components/CustomerContactSelector'
import { getGuojiaAndShiAndWarehouseList, openedRouterList as getOpenedRouterList } from '@/api/ecw/warehouse'
import {getTradeCityList} from '@/api/ecw/region'
import { checkCountryCode, getTradeCityList } from '@/api/ecw/region'
import {getDictData, getDictDatas} from '@/utils/dict'
import {getCurrencyList} from '@/api/ecw/currency'
import {getUnitList} from '@/api/ecw/unit'
......@@ -1668,6 +1668,17 @@ export default {
hasConsignee: this.hasConsignee
})
data.type = data.type.join(',')
// 校验手机号跟目的国是否匹配
if(this.hasConsignee && data.consigneeCountryCode && data.consigneePhone){
const res = await checkCountryCode({
areaCode: data.consigneeCountryCode,
currencyId: this.form.destCountryId
})
// 并不一致则提示
if(!res.data){
await this.$confirm(this.$t('电话所在国与目的国不一致,请检查'))
}
}
// 添加的提交
createOrder(data).then(response => {
this.$modal.msgSuccess(this.$t("新增成功"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment