feat(underwriting): 添加表单组件禁用状态控制

- 为 FieldSelect 组件添加 disabled 属性以控制禁用状态
- 为 SexRadio 组件添加 disabled 属性以控制禁用状态
- 在 UnderwritingDataCollection 页面中实现 actionDisabled 计算属性
- 将 disabled 属性传递给相关的表单字段组件
- 添加 handleActivePopup 方法以处理禁用状态下的弹窗激活逻辑
This commit is contained in:
hz
2025-12-15 09:21:00 +08:00
parent ddd1bee126
commit dafba738de
3 changed files with 18 additions and 5 deletions

View File

@@ -59,6 +59,11 @@ export default {
fn: this.handleDataSubmit,
isShow
}
},
actionDisabled: {
get() {
return true
}
}
},
data() {
@@ -101,6 +106,7 @@ export default {
<div>
<FieldSelect
v-validate="'required'"
:disabled="actionDisabled"
:type="FIELD_SELECT_TYPE.riskType"
:value.sync="user.idType"
label="险种名称"
@@ -110,8 +116,8 @@ export default {
required
right-icon="arrow"
/>
<GField v-validate="'required'" :value="user.name" label="姓名" />
<SexRadio :sex.sync="user.sex" :value="user.sex"></SexRadio>
<GField v-validate="'required'" :disabled="actionDisabled" :value="user.name" label="姓名" />
<SexRadio :hairline="true" :sex.sync="user.sex" :value="user.sex"></SexRadio>
<FieldPicker
ref="birthday"
v-validate="'required'"

View File

@@ -9,7 +9,8 @@ export default {
components: { GField, Popup, Picker },
props: {
type: { type: Number, default: FIELD_SELECT_TYPE.other }
type: { type: Number, default: FIELD_SELECT_TYPE.other },
disabled: { type: Boolean, default: false }
},
data() {
return {
@@ -32,6 +33,10 @@ export default {
handlePopupSubmit(value) {
if (this.type === FIELD_SELECT_TYPE.other) return
this.$emit('submit', value)``
},
handleActivePopup() {
if (this.disabled) return
this.show = true
}
}
}
@@ -39,7 +44,7 @@ export default {
<template>
<div class="field-select-container">
<GField v-bind="$attrs" @click="show = true" />
<GField v-bind="{ ...$attrs, disabled: disabled }" @click="handleActivePopup" />
<Popup v-model="show" position="bottom">
<Picker :columns="columns" show-toolbar @cancel="show = false" @confirm="handlePopupSubmit" />

View File

@@ -7,7 +7,8 @@ export default {
props: {
required: { type: Boolean, default: true },
sex: { type: String, default: SEX.male },
hairline: { type: Boolean, default: true }
hairline: { type: Boolean, default: true },
disabled: { type: Boolean, default: true }
},
data() {
return {
@@ -38,6 +39,7 @@ export default {
<div class="sex-radio-container">
<SelectRadio
:class="{ hairline }"
:disabled="disabled"
:radios="sexRadio"
:required="required"
:value.sync="_sex"