...
|
...
|
@@ -128,7 +128,11 @@ export default { |
|
|
|
|
|
/* 处理编辑时父组件传递的省市区 */
|
|
|
async parentHandleclick({ areaCode }) {
|
|
|
if (areaCode === "" || areaCode === undefined || areaCode.length < 8) {
|
|
|
if (areaCode === "" || areaCode === undefined) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (areaCode.length < 2) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -146,6 +150,10 @@ export default { |
|
|
this.province.allTitle = provincesCaption;
|
|
|
this.province.title = this.titleHandle(provincesCaption);
|
|
|
|
|
|
if (areaCode.length < 4) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//市
|
|
|
let citysCaption = "";
|
|
|
this.city.id = areaCode.substring(0, 4);
|
...
|
...
|
@@ -162,6 +170,10 @@ export default { |
|
|
this.city.allTitle = citysCaption;
|
|
|
this.city.title = this.titleHandle(citysCaption);
|
|
|
|
|
|
if (areaCode.length < 6) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//县
|
|
|
let areasCaption = "";
|
|
|
this.area.id = areaCode.substring(0, 6);
|
...
|
...
|
@@ -179,9 +191,13 @@ export default { |
|
|
this.area.allTitle = areasCaption;
|
|
|
this.area.title = this.titleHandle(areasCaption);
|
|
|
|
|
|
if (areaCode.length < 9) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//街道
|
|
|
let streetsCaption = "";
|
|
|
this.street.id = areaCode;
|
|
|
this.street.id = areaCode.substring(0, 9);
|
|
|
const result = await this.fetchAddressProvinces(areaCode.substring(0, 6));
|
|
|
this.streets = result.data;
|
|
|
this.streets.map(info => {
|
...
|
...
|
|