|
@@ -565,10 +565,6 @@ export default {
|
|
|
},
|
|
|
// 获取城市列表
|
|
|
getCityList (val) {
|
|
|
- const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
|
|
|
- if (index >= 0) {
|
|
|
- this.form.provinceName = this.addrProvinceList[index].name
|
|
|
- }
|
|
|
this.addrCityList = []
|
|
|
this.addrDistrictList = []
|
|
|
this.form.citySn = undefined
|
|
@@ -576,35 +572,34 @@ export default {
|
|
|
this.form.address = ''
|
|
|
if (val) {
|
|
|
this.getArea('city', val, 0)
|
|
|
+ this.form.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
|
|
|
+ } else {
|
|
|
+ this.form.provinceName = ''
|
|
|
}
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
getAreaList (val) {
|
|
|
- const index = this.addrCityList.findIndex(item => item.areaSn == val)
|
|
|
- if (index >= 0) {
|
|
|
- this.form.cityName = this.addrCityList[index].name
|
|
|
- }
|
|
|
this.addrDistrictList = []
|
|
|
this.form.districtSn = undefined
|
|
|
this.form.address = ''
|
|
|
if (val) {
|
|
|
this.getArea('district', val, 0)
|
|
|
+ this.form.cityName = this.addrCityList.find(item => item.areaSn == val).name
|
|
|
+ } else {
|
|
|
+ this.form.cityName = ''
|
|
|
}
|
|
|
},
|
|
|
// 区县变更
|
|
|
areaCharged (val) {
|
|
|
- const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
|
|
|
- if (index >= 0) {
|
|
|
- this.form.districtName = this.addrDistrictList[index].name
|
|
|
- }
|
|
|
this.form.address = ''
|
|
|
+ if (val) {
|
|
|
+ this.form.districtName = this.addrDistrictList.find(item => item.areaSn == val).name
|
|
|
+ } else {
|
|
|
+ this.form.districtName = ''
|
|
|
+ }
|
|
|
},
|
|
|
// 获取城市列表
|
|
|
getCityList1 (val) {
|
|
|
- const index = this.addrProvinceList1.findIndex(item => item.areaSn == val)
|
|
|
- if (index >= 0) {
|
|
|
- this.form.receiveProvinceName = this.addrProvinceList1[index].name
|
|
|
- }
|
|
|
this.addrCityList1 = []
|
|
|
this.addrDistrictList1 = []
|
|
|
this.form.receiveCitySn = undefined
|
|
@@ -612,28 +607,31 @@ export default {
|
|
|
this.form.receiveAddress = ''
|
|
|
if (val) {
|
|
|
this.getArea('city', val, 1)
|
|
|
+ this.form.receiveProvinceName = this.addrProvinceList1.find(item => item.areaSn == val).name
|
|
|
+ } else {
|
|
|
+ this.form.receiveProvinceName = ''
|
|
|
}
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
getAreaList1 (val) {
|
|
|
- const index = this.addrCityList1.findIndex(item => item.areaSn == val)
|
|
|
- if (index >= 0) {
|
|
|
- this.form.receiveCityName = this.addrCityList1[index].name
|
|
|
- }
|
|
|
this.addrDistrictList1 = []
|
|
|
this.form.receiveDistrictSn = undefined
|
|
|
this.form.receiveAddress = ''
|
|
|
if (val) {
|
|
|
this.getArea('district', val, 1)
|
|
|
+ this.form.receiveCityName = this.addrCityList1.find(item => item.areaSn == val).name
|
|
|
+ } else {
|
|
|
+ this.form.receiveCityName = ''
|
|
|
}
|
|
|
},
|
|
|
// 区县变更
|
|
|
areaCharged1 (val) {
|
|
|
- const index = this.addrDistrictList1.findIndex(item => item.areaSn == val)
|
|
|
- if (index >= 0) {
|
|
|
- this.form.receiveDistrictName = this.addrDistrictList1[index].name
|
|
|
- }
|
|
|
this.form.receiveAddress = ''
|
|
|
+ if (val) {
|
|
|
+ this.form.receiveDistrictName = this.addrDistrictList1.find(item => item.areaSn == val).name
|
|
|
+ } else {
|
|
|
+ this.form.receiveDistrictName = ''
|
|
|
+ }
|
|
|
},
|
|
|
// 省/市/区
|
|
|
getArea (leve, sn, index) {
|