|
|
@@ -9,6 +9,7 @@
|
|
|
$permission.getUserInfo().dataScope === 1 ||
|
|
|
$permission.getUserInfo().dataScope === 2
|
|
|
"
|
|
|
+ clearable
|
|
|
@change="handleProvinceChange"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -28,6 +29,7 @@
|
|
|
$permission.getUserInfo().dataScope === 1 ||
|
|
|
$permission.getUserInfo().dataScope === 2
|
|
|
"
|
|
|
+ clearable
|
|
|
@change="handleCityChange"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -44,6 +46,7 @@
|
|
|
!cityId || disabled || $permission.getUserInfo().dataScope === 2
|
|
|
"
|
|
|
style="width: 30%"
|
|
|
+ clearable
|
|
|
@change="handleDistrictChange"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -333,9 +336,17 @@
|
|
|
const areaInfo = res.value
|
|
|
if (!areaInfo) return
|
|
|
|
|
|
- const { id: finalId, name: finalName, pid, level } = areaInfo
|
|
|
+ const {
|
|
|
+ id: finalId,
|
|
|
+ name: finalName,
|
|
|
+ pid,
|
|
|
+ level,
|
|
|
+ code: finalCode,
|
|
|
+ } = areaInfo
|
|
|
let provinceId = ''
|
|
|
let cityId = ''
|
|
|
+ let cityCode = ''
|
|
|
+ let districtCode = ''
|
|
|
let districtId = ''
|
|
|
let provinceName = ''
|
|
|
let cityName = ''
|
|
|
@@ -346,6 +357,7 @@
|
|
|
// 县
|
|
|
districtId = finalId
|
|
|
districtName = finalName
|
|
|
+ districtCode = finalCode
|
|
|
|
|
|
// 市
|
|
|
const cityList = await getDistrictTree()
|
|
|
@@ -355,6 +367,7 @@
|
|
|
)
|
|
|
cityId = Number(city.id)
|
|
|
cityName = city.name
|
|
|
+ cityCode = city.code
|
|
|
|
|
|
// 获取市对应的区县列表(确保区县选项有数据)
|
|
|
const districtRes = await getCityListByPid({ pid: cityId })
|
|
|
@@ -367,6 +380,7 @@
|
|
|
)
|
|
|
provinceId = Number(province.id)
|
|
|
provinceName = province.name
|
|
|
+ provinceCode = province.code
|
|
|
|
|
|
// 获取省对应的城市列表(确保城市选项有数据)
|
|
|
const cityRes = await getCityListByPid({ pid: provinceId })
|
|
|
@@ -383,11 +397,11 @@
|
|
|
// 市
|
|
|
cityId = finalId
|
|
|
cityName = finalName
|
|
|
+ cityCode = finalCode
|
|
|
|
|
|
// 获取市对应的区县列表(确保区县选项有数据)
|
|
|
const districtRes = await getCityListByPid({ pid: cityId })
|
|
|
this.districts = districtRes.value || []
|
|
|
-
|
|
|
// 省
|
|
|
if (pid) {
|
|
|
provinceId = pid
|
|
|
@@ -396,7 +410,6 @@
|
|
|
provinceName = result.name
|
|
|
provinceCode = result.code
|
|
|
}
|
|
|
-
|
|
|
// 获取省对应的城市列表(确保城市选项有数据)
|
|
|
const cityRes = await getCityListByPid({ pid: provinceId })
|
|
|
this.cities = cityRes.value || []
|
|
|
@@ -405,6 +418,7 @@
|
|
|
// 省
|
|
|
provinceId = finalId
|
|
|
provinceName = finalName
|
|
|
+ provinceCode = finalCode
|
|
|
|
|
|
// 获取省对应的城市列表(确保城市选项有数据)
|
|
|
const cityRes = await getCityListByPid({ pid: provinceId })
|
|
|
@@ -412,8 +426,11 @@
|
|
|
}
|
|
|
|
|
|
this.provinceId = provinceId
|
|
|
+ this.provinceCode = provinceCode
|
|
|
this.cityId = cityId
|
|
|
+ this.cityCode = cityCode
|
|
|
this.districtId = districtId
|
|
|
+ this.districtCode = districtCode
|
|
|
this.provinceName = provinceName
|
|
|
this.cityName = cityName
|
|
|
this.districtName = districtName
|