二手车交易,直辖市的code取第一个

This commit is contained in:
2025-03-17 13:56:59 +08:00
parent 88293b2089
commit 301babc54e

View File

@ -258,12 +258,14 @@ export default {
this.$router.push({ name: "privacyComponent"}) this.$router.push({ name: "privacyComponent"})
}, },
confirmHandle(val){ confirmHandle(val){
let data=val.length // let data=val.length
this.form.areaCode=val[data - 1]?.code // this.form.areaCode=val[data - 1]?.code
if(val[0].name.includes('市')){ if(val[0].name.includes('市')){
this.areaName=val[0].name this.areaName=val[0].name
this.form.areaCode=val[0].code
}else{ }else{
this.areaName=val[0].name +val[1].name this.areaName=val[0].name +val[1].name
this.form.areaCode=val[1].code
} }
this.areaShow=false this.areaShow=false
}, },