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

编辑订单也校验目的国和收货人手机区号 + 优化收货地区回显

parent 39f24dc5
...@@ -70,14 +70,15 @@ export default { ...@@ -70,14 +70,15 @@ export default {
} }
}, },
created() { created() {
getListTree({ treeType: 1 }).then(response => { getListTree({ treeType: 1 }).then(async response => {
this.treeList = response.data this.treeList = response.data
this.formData.country = this.country
await this.$nextTick()
this.formData.province = this.province
await this.$nextTick()
this.formData.city = this.city
}) })
this.formData = {
country: this.country,
province: this.province,
city: this.city
}
} }
} }
</script> </script>
...@@ -2588,6 +2588,19 @@ export default { ...@@ -2588,6 +2588,19 @@ export default {
} }
}) })
this.form.status = status this.form.status = status
// 校验目的国与收货人手机号地区是否匹配
if (this.hasConsignee && this.form.countryCode) {
const res = await checkCountryCode({
areaCode: this.form.countryCode,
currencyId: this.form.destCountryId
})
// 并不一致则提示
if (!res.data) {
await this.$confirm(this.$t('电话所在国与目的国不一致,请检查'))
}
}
// 修改的提交 // 修改的提交
if (this.form.orderId) { if (this.form.orderId) {
const data = Object.assign({}, this.form, { const data = Object.assign({}, this.form, {
...@@ -2620,17 +2633,7 @@ export default { ...@@ -2620,17 +2633,7 @@ export default {
type: this.form.type?.join(","), type: this.form.type?.join(","),
hasConsignee: this.hasConsignee hasConsignee: this.hasConsignee
}) })
// 校验目的国与收货人手机号地区是否匹配
if(this.hasConsignee && data.countryCode){
const res = await checkCountryCode({
areaCode: data.countryCode,
currencyId: this.form.destCountryId
})
// 并不一致则提示
if(!res.data){
await this.$confirm(this.$t('电话所在国与目的国不一致,请检查'))
}
}
// 添加的提交 // 添加的提交
createOrder(data).then((response) => { createOrder(data).then((response) => {
if (status != 0) { if (status != 0) {
......
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