新闻
This commit is contained in:
parent
8c2ce03296
commit
963e3e4c8a
@ -65,7 +65,7 @@
|
|||||||
<el-radio
|
<el-radio
|
||||||
v-for="item in enterpriseOptions"
|
v-for="item in enterpriseOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.id"
|
:label="String(item.id)"
|
||||||
class="option-item"
|
class="option-item"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
@ -75,6 +75,7 @@
|
|||||||
|
|
||||||
<el-form-item label="6. 请选择您所在的省份(单选)" prop="region">
|
<el-form-item label="6. 请选择您所在的省份(单选)" prop="region">
|
||||||
<el-select
|
<el-select
|
||||||
|
:key="provinceSelectKey"
|
||||||
v-model="formData.region"
|
v-model="formData.region"
|
||||||
filterable
|
filterable
|
||||||
placeholder="输入省份名称或拼音首字母搜索..."
|
placeholder="输入省份名称或拼音首字母搜索..."
|
||||||
@ -82,9 +83,9 @@
|
|||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in provinceOptions"
|
v-for="item in provinceOptions"
|
||||||
:key="item.id"
|
:key="`region-${item.id}-${item.name}`"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -181,6 +182,7 @@ export default {
|
|||||||
formData: this.getInitialFormData(),
|
formData: this.getInitialFormData(),
|
||||||
enterpriseOptions: [],
|
enterpriseOptions: [],
|
||||||
provinceOptions: [],
|
provinceOptions: [],
|
||||||
|
provinceSelectKey: 0,
|
||||||
consultDirectionOptions: [],
|
consultDirectionOptions: [],
|
||||||
submitSuccess: false,
|
submitSuccess: false,
|
||||||
rules: {
|
rules: {
|
||||||
@ -259,7 +261,7 @@ export default {
|
|||||||
.filter(item => item && item.dict_type === type)
|
.filter(item => item && item.dict_type === type)
|
||||||
.sort((a, b) => Number(a.sort_order || 0) - Number(b.sort_order || 0))
|
.sort((a, b) => Number(a.sort_order || 0) - Number(b.sort_order || 0))
|
||||||
.map(item => ({
|
.map(item => ({
|
||||||
id: item.dict_key,
|
id: String(item.dict_key),
|
||||||
name: item.dict_value
|
name: item.dict_value
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@ -294,7 +296,13 @@ export default {
|
|||||||
const consultDirectionOptions = this.normalizeDirectionOptions(list)
|
const consultDirectionOptions = this.normalizeDirectionOptions(list)
|
||||||
|
|
||||||
if (enterpriseOptions.length) this.enterpriseOptions = enterpriseOptions
|
if (enterpriseOptions.length) this.enterpriseOptions = enterpriseOptions
|
||||||
if (provinceOptions.length) this.provinceOptions = provinceOptions
|
if (provinceOptions.length) {
|
||||||
|
this.provinceOptions = provinceOptions
|
||||||
|
this.provinceSelectKey += 1
|
||||||
|
if (this.formData.region && !provinceOptions.some(item => item.id === String(this.formData.region))) {
|
||||||
|
this.formData.region = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
if (consultDirectionOptions.length) this.consultDirectionOptions = consultDirectionOptions
|
if (consultDirectionOptions.length) this.consultDirectionOptions = consultDirectionOptions
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 保留本地兜底选项,避免接口异常时无法填写表单。
|
// 保留本地兜底选项,避免接口异常时无法填写表单。
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user