|
@@ -36,8 +36,8 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col span="7" offset="1">
|
|
|
- <a-form-item prop="countySn" style="margin: 0;">
|
|
|
- <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
|
|
|
+ <a-form-item prop="districtSn" style="margin: 0;">
|
|
|
+ <a-select v-model="queryParam.districtSn" placeholder="请选择区/县">
|
|
|
<a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
@@ -160,41 +160,59 @@ 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.queryParam.citySn = undefined
|
|
|
this.queryParam.districtSn = undefined
|
|
|
+ // this.queryParam.address = ''
|
|
|
this.getArea('city', val)
|
|
|
},
|
|
|
// 获取区县列表
|
|
|
getAreaList (val) {
|
|
|
+ // const index = this.addrCityList.findIndex(item => item.areaSn == val)
|
|
|
+ // if (index >= 0) {
|
|
|
+ // this.form.cityName = this.addrCityList[index].name
|
|
|
+ // }
|
|
|
this.addrDistrictList = []
|
|
|
this.queryParam.districtSn = undefined
|
|
|
+ // this.queryParam.address = ''
|
|
|
this.getArea('district', val)
|
|
|
},
|
|
|
+ // 区县变更
|
|
|
+ areaCharged (val) {
|
|
|
+ // const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
|
|
|
+ // if (index >= 0) {
|
|
|
+ // this.form.districtName = this.addrDistrictList[index].name
|
|
|
+ // }
|
|
|
+ // this.queryParam.address = ''
|
|
|
+ },
|
|
|
// 省/市/区
|
|
|
- getArea (type, sn) {
|
|
|
+ getArea (leve, sn) {
|
|
|
let params
|
|
|
- if (type == 'province') {
|
|
|
- params = { level: '1' }
|
|
|
+ if (leve == 'province') {
|
|
|
+ params = { type: '2' }
|
|
|
} else {
|
|
|
- params = { psn: sn }
|
|
|
+ params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
|
|
|
}
|
|
|
getArea(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- if (type == 'province') {
|
|
|
+ if (leve == 'province') {
|
|
|
this.addrProvinceList = res.data || []
|
|
|
- } else if (type == 'city') {
|
|
|
+ } else if (leve == 'city') {
|
|
|
this.addrCityList = res.data || []
|
|
|
- } else if (type == 'district') {
|
|
|
+ } else if (leve == 'district') {
|
|
|
this.addrDistrictList = res.data || []
|
|
|
}
|
|
|
} else {
|
|
|
- if (type == 'province') {
|
|
|
+ if (leve == 'province') {
|
|
|
this.addrProvinceList = []
|
|
|
- } else if (type == 'city') {
|
|
|
+ } else if (leve == 'city') {
|
|
|
this.addrCityList = []
|
|
|
- } else if (type == 'district') {
|
|
|
+ } else if (leve == 'district') {
|
|
|
this.addrDistrictList = []
|
|
|
}
|
|
|
}
|