Compare commits
No commits in common. "10a61a8993f197b83e1d758df58e67199b6cb40d" and "f3f2fb3c7877c188dc28d5d350b12fe48c4511bb" have entirely different histories.
10a61a8993
...
f3f2fb3c78
@ -65,7 +65,7 @@
|
||||
<el-radio
|
||||
v-for="item in enterpriseOptions"
|
||||
:key="item.id"
|
||||
:label="String(item.id)"
|
||||
:label="item.id"
|
||||
class="option-item"
|
||||
>
|
||||
{{ item.name }}
|
||||
@ -75,7 +75,6 @@
|
||||
|
||||
<el-form-item label="6. 请选择您所在的省份(单选)" prop="region">
|
||||
<el-select
|
||||
:key="provinceSelectKey"
|
||||
v-model="formData.region"
|
||||
filterable
|
||||
placeholder="输入省份名称或拼音首字母搜索..."
|
||||
@ -83,9 +82,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in provinceOptions"
|
||||
:key="`region-${item.id}-${item.name}`"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="String(item.id)"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -182,7 +181,6 @@ export default {
|
||||
formData: this.getInitialFormData(),
|
||||
enterpriseOptions: [],
|
||||
provinceOptions: [],
|
||||
provinceSelectKey: 0,
|
||||
consultDirectionOptions: [],
|
||||
submitSuccess: false,
|
||||
rules: {
|
||||
@ -261,7 +259,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: String(item.dict_key),
|
||||
id: item.dict_key,
|
||||
name: item.dict_value
|
||||
}))
|
||||
},
|
||||
@ -296,13 +294,7 @@ export default {
|
||||
const consultDirectionOptions = this.normalizeDirectionOptions(list)
|
||||
|
||||
if (enterpriseOptions.length) this.enterpriseOptions = enterpriseOptions
|
||||
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 (provinceOptions.length) this.provinceOptions = provinceOptions
|
||||
if (consultDirectionOptions.length) this.consultDirectionOptions = consultDirectionOptions
|
||||
} catch (error) {
|
||||
// 保留本地兜底选项,避免接口异常时无法填写表单。
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user