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

View File

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

View File

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