|
|
@@ -98,7 +98,7 @@
|
|
|
<el-form-item label="注册地址" required>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-cascader :options="countryoptions" placeholder="省市区" v-model="CityAry" style="width: 100%">
|
|
|
+ <el-cascader :options="countryoptions" :props="countryprops" placeholder="省市区" v-model="CityAry" style="width: 100%">
|
|
|
</el-cascader>
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
@@ -117,7 +117,7 @@
|
|
|
<el-form-item label="通信地址" required>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-cascader :options="countryoptions" placeholder="省市区" v-model="CityAry" style="width: 100%">
|
|
|
+ <el-cascader :options="countryoptions" :props="countryprops" placeholder="省市区" v-model="CityAry" style="width: 100%">
|
|
|
</el-cascader>
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
@@ -538,6 +538,11 @@
|
|
|
UnitRelationOptions: [],
|
|
|
UnitRelationAry: [],
|
|
|
countryoptions: [],
|
|
|
+ countryprops: {
|
|
|
+ value: 'adcode',
|
|
|
+ label: 'name',
|
|
|
+ children: 'districts'
|
|
|
+ },
|
|
|
CityAry: [],
|
|
|
serviceId: '',
|
|
|
certId: '',
|
|
|
@@ -693,20 +698,18 @@
|
|
|
},
|
|
|
|
|
|
getDictOptions () {
|
|
|
- this.getCityList()
|
|
|
api.getDictList(this.$axios).then(res => {
|
|
|
this.UnitRelationOptions = res.data.items['UnitRelation']
|
|
|
+ this.getCityList(res.data.items['GaodeMapChinaAreas'])
|
|
|
}).catch(err => {
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- getCityList () {
|
|
|
- this.$axios.get('http://restapi.amap.com/v3/config/district?key=13f54664eb5a883195604db09d3fba5c&subdistrict=3')
|
|
|
- .then((res) => {
|
|
|
- let countstr = JSON.stringify(res.data.districts[0].districts)
|
|
|
- countstr = countstr.replace(/\,\"districts\"\:\[\]/g,'')
|
|
|
- this.countryoptions = JSON.parse(countstr)
|
|
|
- })
|
|
|
+ getCityList (areaJson) {
|
|
|
+ let resData = JSON.parse(areaJson)
|
|
|
+ let countstr = JSON.stringify(resData.districts[0].districts)
|
|
|
+ countstr = countstr.replace(/\,\"districts\"\:\[\]/g,'')
|
|
|
+ this.countryoptions = JSON.parse(countstr)
|
|
|
},
|
|
|
|
|
|
//保存信息
|