|
|
@@ -44,7 +44,11 @@
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
@change="selectDistrict">
|
|
|
- <el-option v-for="item in district" :key="item.id" :label="item.distName" :value="item.id" />
|
|
|
+ <el-option
|
|
|
+ v-for="item in district"
|
|
|
+ :key="item.regionCode"
|
|
|
+ :label="item.regionDesc"
|
|
|
+ :value="item.regionCode" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="省份" prop="provinceId" style="display: none">
|
|
|
@@ -158,28 +162,27 @@
|
|
|
async getUserSalesProvince() {
|
|
|
const { data: data } = await regionAuthApi.getUserSalesProvince({})
|
|
|
if (data && data.list) {
|
|
|
- this.district = data.list
|
|
|
+ this.district = data.list.children
|
|
|
}
|
|
|
},
|
|
|
- selectDistrict(id) {
|
|
|
+ selectDistrict(code) {
|
|
|
let obj = {}
|
|
|
obj = this.district.find((item) => {
|
|
|
- return item.id === id //筛选出匹配数据
|
|
|
+ return item.regionCode === code //筛选出匹配数据
|
|
|
})
|
|
|
- console.log('省份名称', obj.distName)
|
|
|
- this.provinceDesc = obj.distName
|
|
|
- this.form.provinceId = obj.id
|
|
|
- this.form.provinceDesc = obj.distName
|
|
|
+ console.log('省份名称', obj)
|
|
|
+ this.provinceDesc = obj.regionDesc
|
|
|
+ this.form.provinceId = obj.regionCode
|
|
|
+ this.form.provinceDesc = obj.regionDesc
|
|
|
},
|
|
|
save() {
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.form.id) {
|
|
|
- console.log(this.form)
|
|
|
- this.form.distBossPhone = this.form.distBossPhone.toString()
|
|
|
-
|
|
|
- this.form.provinceId = parseInt(this.form.provinceId)
|
|
|
+ console.log(this.form)
|
|
|
+ this.form.distBossPhone = this.form.distBossPhone.toString()
|
|
|
+ this.form.provinceId = parseInt(this.form.provinceId)
|
|
|
|
|
|
+ if (this.form.id) {
|
|
|
console.log('表单修改提交内容:', this.form)
|
|
|
const { msg } = await distrApi.doEdit(this.form)
|
|
|
this.$baseMessage(msg, 'success', 'vab-hey-message-success')
|