Compare commits
No commits in common. "10a61a8993f197b83e1d758df58e67199b6cb40d" and "f3f2fb3c7877c188dc28d5d350b12fe48c4511bb" have entirely different histories.
10a61a8993
...
f3f2fb3c78
@ -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="String(item.id)"
|
:label="item.id"
|
||||||
class="option-item"
|
class="option-item"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
@ -75,7 +75,6 @@
|
|||||||
|
|
||||||
<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="输入省份名称或拼音首字母搜索..."
|
||||||
@ -83,9 +82,9 @@
|
|||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in provinceOptions"
|
v-for="item in provinceOptions"
|
||||||
:key="`region-${item.id}-${item.name}`"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="String(item.id)"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -182,7 +181,6 @@ export default {
|
|||||||
formData: this.getInitialFormData(),
|
formData: this.getInitialFormData(),
|
||||||
enterpriseOptions: [],
|
enterpriseOptions: [],
|
||||||
provinceOptions: [],
|
provinceOptions: [],
|
||||||
provinceSelectKey: 0,
|
|
||||||
consultDirectionOptions: [],
|
consultDirectionOptions: [],
|
||||||
submitSuccess: false,
|
submitSuccess: false,
|
||||||
rules: {
|
rules: {
|
||||||
@ -261,7 +259,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: String(item.dict_key),
|
id: item.dict_key,
|
||||||
name: item.dict_value
|
name: item.dict_value
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@ -296,13 +294,7 @@ 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) {
|
if (provinceOptions.length) this.provinceOptions = provinceOptions
|
||||||
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