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