Commit f1a17490 by yuzhenWang

Merge branch 'feature-20250827wyz-写业务' into 'test'

修改流程2

See merge request !9
parents e731143c eb5a516b
......@@ -24,7 +24,7 @@ const appointmentInfo = [
label: '预约时间',
key: 'confirmAppointmentTime',
domType: 'datetimePicker',
required: true,
required: false,
disabled: true,
placeholder: '请选择',
show: false,
......
......@@ -377,7 +377,7 @@ const beneficiary = [
showMoudle: true, //模块是否展示
data: [
{
label: '受益比',
label: '受益比',
key: 'benefitRatio',
customerKey: 'idCard',
domType: 'Input',
......
......@@ -4,36 +4,36 @@ const customer = [
type: 'object',
key: 'personInfo',
data: [
{
label: '姓氏',
key: 'lastName',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 5,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '名字',
key: 'firstName',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 10,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '姓氏',
// key: 'lastName',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 5,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '名字',
// key: 'firstName',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 10,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '姓名',
key: 'name',
......@@ -49,36 +49,36 @@ const customer = [
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '姓氏拼音',
key: 'lastNamePinyin',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '姓名拼音',
key: 'pinyin',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '姓氏拼音',
// key: 'lastNamePinyin',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '姓名拼音',
// key: 'pinyin',
// type: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '名字-英文',
key: 'firstNamePinyin',
......@@ -126,7 +126,7 @@ const customer = [
label: '生日',
key: 'birthdate',
type: 'DatePicker',
required: false,
required: true,
disabled: false,
placeholder: '请选择',
show: true,
......@@ -142,7 +142,7 @@ const customer = [
inputType: 'number',
maxLength: 30,
required: true,
disabled: false,
disabled: true,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
......@@ -251,7 +251,7 @@ const customer = [
type: 'Input',
inputType: 'text',
maxLength: 300,
required: true,
required: false,
disabled: false,
placeholder: '请输入',
show: true,
......
......@@ -164,12 +164,11 @@ const fnaForm = [
}
]
},
//家庭状况
{
fatherTitle: '家庭状况',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
showTable: true, //以table的形式展示
key: 'familyMembers',
child: 'yes', //有子级dom,需要循环展示
addFamilyChildren: true, //是否可以新增子级dom
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
......@@ -177,426 +176,208 @@ const fnaForm = [
type: '1',
childTitle: '父亲',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '年龄',
key: 'age',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否需要供养',
key: 'needProvide',
domType: 'Select',
required: false,
maxLength: 30,
age: '',
needProvide: '',
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
options: []
},
{
type: '2',
childTitle: '母亲',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '年龄',
key: 'age',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
age: '',
needProvide: '',
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否需要供养',
key: 'needProvide',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
options: []
},
{
type: '3',
childTitle: '配偶',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '年龄',
key: 'age',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
age: '',
needProvide: '',
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否需要供养',
key: 'needProvide',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
options: []
}
]
},
//财务需要分析
{
fatherTitle: '财务需要分析',
subTitle: '保单持有人个人已有保障',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'existingSecurityOwner',
showTable: true,
dataLength: 5, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
childTitle: '保单持有人个人已有保障',
children: [
{
label: '保险公司',
key: 'insurer',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保障类型',
key: 'insuranceType',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保额',
key: 'sumInsured',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
insurer: '',
insuranceType: '',
sumInsured: '',
policyIssueDate: '',
currency: '',
dictType: 'bx_currency_type',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单签发日期',
key: 'policyIssueDate',
domType: 'DatePicker',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
options: []
}
]
},
//受保人个人已有保障
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
subTitle: '受保人个人已有保障',
key: 'existingSecurityInsured',
dataLength: 5, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
showTable: true,
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '受保人个人已有保障',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '保险公司',
key: 'insurer',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保障类型',
key: 'insuranceType',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保额',
key: 'sumInsured',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
subTitle: '受保人个人已有保障',
insurer: '',
insuranceType: '',
sumInsured: '',
policyIssueDate: '',
currency: '',
dictType: 'bx_currency_type',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单签发日期',
key: 'policyIssueDate',
domType: 'DatePicker',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
options: []
}
]
}
]
},
//保单持有人资产
// data: [
// {
// childTitle: '受保人个人已有保障',
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数
// children: [
// {
// label: '保险公司',
// key: 'insurer',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '保障类型',
// key: 'insuranceType',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '保额',
// key: 'sumInsured',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '币种',
// key: 'currency',
// domType: 'Select',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// dictType: 'bx_currency_type',
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '保单签发日期',
// key: 'policyIssueDate',
// domType: 'DatePicker',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// }
// ]
// }
// ]
},
// 投资房地产
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'primaryResidence',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
subTitle: '保单持有人资产',
key: 'investment',
subTitle: '投资房地产',
showTable: true,
dataLength: 2, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '自住用途之房地产',
childTitle: '投资房地产',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '自住用途之房地产地址',
key: 'address',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '180px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
address: '',
currency: '',
dictType: 'bx_currency_type',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '自住用途之房地产市值(HKD)',
key: 'marketValue',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '220px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
marketValue: ''
}
]
},
//保单持有人资产
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'investment',
dataLength: 2, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
child: 'yes', //有子级dom,需要循环展示
key: 'primaryResidence',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true,
subTitle: '保单持有人资产',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '投资房地产',
childTitle: '自住用途之房地产',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
children: [
{
label: '地址',
key: 'address',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '币种',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
address: '',
currency: '',
dictType: 'bx_currency_type',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '市值(HKD)',
key: 'marketValue',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
marketValue: ''
}
]
},
......
......@@ -41,6 +41,7 @@
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
@change="handleInputChange(child)"
/>
<el-select
v-if="child.type === 'Select'"
......@@ -63,6 +64,9 @@
type="date"
:placeholder="child.placeholder"
:disabled="child.disabled"
:disabled-date="time => disabledDate(time, child)"
:default-value="defaultDisplayDate"
@change="handleDateChange(child)"
/>
<el-input
......@@ -180,6 +184,8 @@
</div>
</template>
<script setup name="customer">
import { calculateExactAge } from '@/utils/date'
import dayjs from 'dayjs'
import { ArrowRight } from '@element-plus/icons-vue'
import customerDomData from '@/formJson/customer'
import Country from '@/views/components/country'
......@@ -211,6 +217,10 @@ const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const tableLoading = ref(false)
const tableData = ref([])
const total = ref(0)
const customerRef = ref(null)
// / 计算默认显示的日期(18年前的今天)
const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate())
// 地址组件菜单数据
const addressMenuList = ref([
{
......@@ -281,6 +291,34 @@ const data = reactive({
}
})
const { form, rules, processedCustomerData, queryParams, oldCustomerData } = toRefs(data)
const handleInputChange = child => {
if (
(child.key == 'lastName' || child.key == 'firstName') &&
form.value['lastName'] &&
form.value['firstName']
) {
form.value['name'] = form.value['lastName'] + form.value['firstName']
}
}
const handleDateChange = child => {
let age = null
if (child.key == 'birthdate') {
age = calculateExactAge(proxy.formatToDate(form.value.birthdate))
if (age >= 18) {
form.value.age = age
}
}
}
const disabledDate = (time, child) => {
if (child.key == 'birthdate') {
// 计算18年前的今天
const eighteenYearsAgo = dayjs().subtract(18, 'year')
// 禁用今天之后的日期和18年前的今天之后的日期
return time.getTime() > Date.now() || time.getTime() > eighteenYearsAgo.valueOf()
} else {
return time.getTime() > Date.now()
}
}
const resetCustomerList = () => {
queryParams.value = {
pageNo: 1,
......@@ -369,7 +407,7 @@ const processFormData = async () => {
}
if (props.customerBizId) {
field.disabled = true
} else {
} else if (field.key !== 'age') {
field.disabled = false
}
}
......@@ -437,6 +475,7 @@ const handleCloseDrawer = () => {
showCountryDrawer.value = false
drawerInfo.value = {}
}
// 点击了抽屉的确定
const confirmDrawer = info => {
// info 为抽屉返回的值
if (drawerInfo.value.type == 'arrowRight' && drawerInfo.value.drawerType) {
......@@ -465,8 +504,13 @@ const confirmDrawer = info => {
default:
break
}
// 手动触发表单验证
nextTick(() => {
// 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key
customerRef.value.clearValidate(validateField)
})
}
console.log('saveKey.value', saveKey.value)
handleCloseDrawer()
}
......@@ -505,8 +549,6 @@ const handleSelectChange = child => {
// 改变编辑状态
const handleEditStatus = () => {
editStatus.value = !editStatus.value
console.log('触发了编辑状态', editStatus.value)
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(processedCustomerData.value))
for (const section of processedData) {
......@@ -514,7 +556,7 @@ const handleEditStatus = () => {
for (const field of section.data) {
if (editStatus.value) {
field.disabled = true
} else {
} else if (field.key !== 'age') {
field.disabled = false
}
}
......@@ -627,6 +669,15 @@ const setFormValue = (obj, formData, exportValue) => {
}
}
})
if (form.value['birthdate']) {
let age = calculateExactAge(proxy.formatToDate(form.value.birthdate))
if (age >= 18) {
form.value.age = age
}
} else {
form.value.age = null
}
console.log('form.value回填', form.value)
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
......@@ -760,7 +811,7 @@ const resetForm = () => {
.catch(() => {})
}
// 获取流程详情
// 获取客户详情
function getCustomerInfo(customerBizId, formData) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
......
......@@ -198,6 +198,226 @@
>
</el-col>
</el-row>
<el-row v-if="father.showTable">
<template
><div class="subTitle" v-if="father.subTitle">{{ father.subTitle }}</div></template
>
<el-table :data="father.data" border>
<template v-if="father.key == 'familyMembers' && form[father.key].length > 0">
<el-table-column label="亲属" prop="childTitle" width="100px" align="center">
<template #default="scope">
{{
scope.row.type == '4'
? `${scope.row.childTitle}-${scope.$index - 2}`
: scope.row.childTitle
}}
</template>
</el-table-column>
<el-table-column label="年龄" prop="age" align="center">
<template #default="scope">
<el-input
v-model="scope.row.age"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="是否需要供养" prop="needProvide" align="center">
<template #default="scope">
<el-select
v-model="scope.row.needProvide"
placeholder="请选择"
:disabled="editStatus"
>
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column
width="50px"
v-if="father.data && father.data.some(item => item.type === '4')"
align="center"
>
<template #default="scope">
<el-icon
v-if="scope.row.type == '4'"
@click="deleteChildren(father, scope.$index)"
class="deleteIcon"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
<template
v-if="
(father.key == 'existingSecurityOwner' ||
father.key == 'existingSecurityInsured') &&
form[father.key].length > 0
"
>
<el-table-column label="保险公司" prop="insurer" align="center">
<template #default="scope">
<el-input
size="default"
placeholder="请输入"
v-model="scope.row.insurer"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="保障类型" prop="insuranceType" align="center">
<template #default="scope">
<el-input
v-model="scope.row.insuranceType"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="保额" prop="sumInsured" align="center">
<template #default="scope">
<el-input
v-model="scope.row.sumInsured"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="币种" prop="currency" align="center">
<template #default="scope">
<el-select
v-model="scope.row.currency"
placeholder="请选择"
:disabled="editStatus"
>
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="保单签发日期" prop="policyIssueDate" align="center">
<template #default="scope">
<el-date-picker
style="width: 100%"
v-model="scope.row.policyIssueDate"
type="date"
placeholder="请输入"
:disabled="editStatus"
:disabled-date="disabledDate"
/>
</template>
</el-table-column>
</template>
<template v-if="father.key == 'investment' && form[father.key].length > 0">
<el-table-column label="地址" prop="address" align="center">
<template #default="scope">
<el-input
size="default"
placeholder="请输入"
v-model="scope.row.address"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="市值(HKD)" prop="marketValue" align="center">
<template #default="scope">
<el-input
v-model="scope.row.marketValue"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="币种" prop="currency" align="center">
<template #default="scope">
<el-select
v-model="scope.row.currency"
placeholder="请选择"
:disabled="editStatus"
>
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</template>
<template v-if="father.key == 'primaryResidence'">
<el-table-column label="自住用途之房地产地址" prop="address" align="center">
<template #default="scope">
<el-input
size="default"
placeholder="请输入"
v-model="scope.row.address"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column
label="自住用途之房地产市值(HKD)"
prop="marketValue"
align="center"
>
<template #default="scope">
<el-input
v-model="scope.row.marketValue"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="币种" prop="currency" align="center">
<template #default="scope">
<el-select
v-model="scope.row.currency"
placeholder="请选择"
:disabled="editStatus"
>
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</template>
</el-table>
<el-col
:span="24"
v-if="father.addFamilyChildren"
style="display: flex; justify-content: center"
>
<el-button
:disabled="editStatus"
style="margin-top: 10px"
type="primary"
icon="Plus"
@click="addChildren(father)"
>添加儿女</el-button
>
</el-col>
</el-row>
</div>
</el-row>
......@@ -225,19 +445,21 @@
</el-row>
</el-form>
</div>
<div v-else class="domEmpty" v-loading="loading"></div>
</div>
</template>
<script setup name="customer">
<script setup name="fanForm">
import useDictStore from '@/store/modules/dict'
import fanFormDomData from '@/formJson/fnaForm'
import { getDicts } from '@/api/system/dict/data'
import { watch } from 'vue'
import { watch, nextTick } from 'vue'
import { addfanForm, getfanFormDetail, editFanForm, getCustomerList } from '@/api/sign/fna'
import { listTenantUser } from '@/api/common'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
customerInfo: { type: Object, default: () => {} }, //客户详情
activeName: { type: String, default: '' }, //tab名称
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
fnaFormBizId: { type: String, default: '' }, //提交状态,新增、修改
......@@ -247,17 +469,19 @@ const props = defineProps({
const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance()
// const { sys_no_yes } = proxy.useDict('sys_no_yes')
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const loading = ref(false)
const fanFormRef = ref(null)
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const noYesList = ref([]) // 是否列表
const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const data = reactive({
form: {},
processedFanFormData: [], // 处理后的表单数据
tempFanFormValue: {}, // 切换tab得时候保存临时填写得值
tempFanFormData: [], // 处理后的表单数据
oldFanFormData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
queryParams: {
......@@ -266,8 +490,18 @@ const data = reactive({
name: undefined
}
})
const { form, rules, processedFanFormData, queryParams, oldFanFormData } = toRefs(data)
// 下拉框搜索方法
const {
form,
rules,
processedFanFormData,
queryParams,
oldFanFormData,
tempFanFormValue,
tempFanFormData
} = toRefs(data)
const disabledDate = time => {
return time.getTime() > Date.now()
}
// 搜索方法
const searchSelectList = async (query, fieldKey) => {
// 设置该字段的加载状态
......@@ -315,6 +549,7 @@ const fetchDictData = dictType => {
}
// 处理表单配置,添加字典数据
const processFormData = async () => {
loading.value = true
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(fanFormDomData))
......@@ -325,6 +560,9 @@ const processFormData = async () => {
//给表单赋值各模块key,对应表单的father.key便于收集值
if (section.keyType == 'Array') {
form.value[section.key] = []
if (section.key == 'familyMembers') {
form.value[section.key] = section.data
}
} else if (section.keyType == 'Object') {
form.value[section.key] = {}
}
......@@ -334,6 +572,7 @@ const processFormData = async () => {
if (section.dataLength) {
for (let i = 1; i < section.dataLength; i++) {
section.data.push(JSON.parse(JSON.stringify(section.data[0])))
form.value[formKey].push(JSON.parse(JSON.stringify(section.data[0])))
}
}
for (const field of section.data) {
......@@ -361,6 +600,9 @@ const processFormData = async () => {
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
if (field.dictType == 'sys_no_yes') {
noYesList.value = field.options
}
}
//
/*
......@@ -375,6 +617,9 @@ const processFormData = async () => {
if (props.fnaFormBizId) {
field.disabled = true
} else {
if (field.key == 'customerName' && section.key == 'personalData') {
form.value['personalData'][field.key] = props.customerInfo.firstNamePinyin
}
field.disabled = false
}
}
......@@ -385,13 +630,23 @@ const processFormData = async () => {
}
}
}
if (props.fnaFormBizId) {
getFanformInfo(props.fnaFormBizId, processedData)
editStatus.value = true
} else {
// tab切走在切回来时,表单会重置,所以这里需要把表单的值赋回去
if (Object.keys(tempFanFormValue.value).length > 0) {
form.value = JSON.parse(JSON.stringify(tempFanFormValue.value))
}
if (tempFanFormData.value.length > 0) {
processedFanFormData.value = oldFanFormData.value = JSON.parse(
JSON.stringify(tempFanFormData.value)
)
} else {
processedFanFormData.value = oldFanFormData.value = processedData
}
editStatus.value = false
loading.value = false
}
}
// 添加表单子级dom
......@@ -404,44 +659,11 @@ const addChildren = father => {
let obj = {
type: '4',
childTitle: '儿女',
span: 24, //栅格布局份数
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
delete: true, //是否显示删除按钮
age: '',
needProvide: '',
children: [
{
label: '年龄',
key: 'age',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否需要供养',
key: 'needProvide',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
options: noYesList.value,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
options: noYesList.value
}
for (const section of processedData) {
if (father.key == 'familyMembers' && section.key == father.key) {
......@@ -453,6 +675,9 @@ const addChildren = father => {
processedFanFormData.value = processedData
}
const deleteChildren = (father, childIndex) => {
if (editStatus.value) {
proxy.$modal.confirm(`请先点击编辑再删除儿女`, { showCancel: '0', title: '填写提示' })
}
const processedData = JSON.parse(JSON.stringify(processedFanFormData.value))
for (const section of processedData) {
if (father.key == 'familyMembers' && section.key == father.key) {
......@@ -528,7 +753,8 @@ const handleEditStatus = () => {
}
//给表单赋值 方便表单回显 obj 为表单数据
const setFormValue = (obj, formData) => {
// 写到给家人赋值了,家人传值也不太对
loading.value = true
let newForm = JSON.parse(JSON.stringify(form.value))
// 1.先正确的拿到表单的回显值
for (const key in newForm) {
......@@ -545,41 +771,10 @@ const setFormValue = (obj, formData) => {
let newChildren = {
type: '4',
childTitle: '儿女',
span: 24, //栅格布局份数
delete: true, //是否显示删除按钮
age: '',
needProvide: '',
children: [
{
label: '年龄',
key: 'age',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
sm: 10, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '是否需要供养',
key: 'needProvide',
domType: 'Select',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
options: noYesList.value,
labelWidth: '120px', //标签宽度
sm: 10, //栅格布局份数
lg: 8 //栅格布局份数
}
]
options: noYesList.value
}
// 深拷贝原始表单dom数据
const processedData = JSON.parse(JSON.stringify(formData))
......@@ -672,17 +867,44 @@ const setFormValue = (obj, formData) => {
}
}
}
console.log('====================================')
console.log('回显form.value', form.value)
console.log('====================================')
// if (!exportValue) {
// // 保存一份就得表单数据便于做撤销操作
// oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
// }
for (const section of processedData) {
for (const key1 in obj) {
if (section.data) {
//key1 !== 'familyMembers' &&
if (key1 !== 'familyMembers' && key1 == section.key && section.keyType == 'Array') {
section.data = obj[key1].map(item => {
for (const key2 in item) {
if (key2 == 'currency') {
item.options = fetchDictData('bx_currency_type')
} else if (key2 == 'needProvide') {
item.options = fetchDictData('sys_no_yes')
}
}
return {
...item
}
})
} else if (key1 == 'familyMembers' && key1 == section.key && section.keyType == 'Array') {
section.data = form.value[key1].map(item => {
for (const key2 in item) {
if (key2 == 'needProvide') {
item.options = fetchDictData('sys_no_yes')
}
}
return {
...item
}
})
}
}
}
}
processedFanFormData.value = processedData
console.log('====================================')
console.log('processedFanFormData.value', processedFanFormData.value)
console.log('====================================')
loading.value = false
nextTick(() => {
fanFormRef.value.clearValidate()
})
}
// 获取校验失败的字段信息
......@@ -710,13 +932,23 @@ const isObject = value => {
// 表单提交
const submitForm = saveType => {
console.log('form.value', form.value)
console.log('dom', processedFanFormData.value)
console.log('表单值', form.value)
// 深拷贝原始数据
let result = JSON.parse(JSON.stringify(form.value))
let resDom = JSON.parse(JSON.stringify(processedFanFormData.value))
// return
proxy.$refs['fanFormRef'].validate((valid, fields) => {
if (valid) {
for (const section of resDom) {
for (const key1 in result) {
// key1 !== 'familyMembers' &&
if (section.key == key1 && section.keyType == 'Array') {
result[key1] = section.data
}
}
}
for (const key in result) {
if (isObject(result[key])) {
for (const key2 in result[key]) {
......@@ -734,6 +966,10 @@ const submitForm = saveType => {
delete item.disabled
delete item.id
delete item.span
delete item.dictType
delete item.options
delete item.delete
delete item.subTitle
if (item.policyIssueDate) {
item.policyIssueDate = proxy.formatToDate(item.policyIssueDate)
}
......@@ -752,6 +988,7 @@ const submitForm = saveType => {
console.log('====================================')
console.log('提交的数据', result)
console.log('====================================')
// return
if (props.fnaFormBizId) {
result.fnaFormBizId = props.fnaFormBizId
editFanForm(result).then(res => {
......@@ -797,17 +1034,41 @@ function getFanformInfo(fnaFormBizId, formData) {
}
})
}
watch(fanFormRef, newVal => {
if (newVal) {
for (const key in rules.value) {
for (const key2 in rules.value[key]) {
fanFormRef.value.clearValidate(key2)
}
}
}
})
watch(
() => props.activeName,
newVal => {
tempFanFormValue.value = JSON.parse(JSON.stringify(form.value))
tempFanFormData.value = JSON.parse(JSON.stringify(processedFanFormData.value))
if (newVal === 'fnaform') {
openList.value = false
setTimeout(() => {
processFormData()
}, 500)
}
}
)
</script>
<style lang="scss" scoped>
.domEmpty {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
font-size: 16px;
color: #a8abb2;
margin-top: 100px;
}
.topBtn {
width: 100%;
display: flex;
......@@ -823,7 +1084,7 @@ watch(
margin-bottom: 5px;
}
.subTitle {
font-size: 16px;
font-size: 15px;
/* padding-left: 8px; */
margin-bottom: 10px;
}
......@@ -855,7 +1116,7 @@ watch(
.deleteIcon {
color: red;
font-size: 18px;
padding-top: 15px;
padding-top: 10px;
}
}
.tabButton {
......@@ -920,15 +1181,13 @@ watch(
}
@media only screen and (min-width: 768px) {
.formInput,
.deleteIcon {
.formInput {
margin-top: 30px !important;
}
}
@media only screen and (min-width: 1200px) {
.formInput,
.deleteIcon {
.formInput {
margin-top: 30px !important;
}
}
......
......@@ -106,6 +106,7 @@
:fnaFormBizId="processInfo.fnaFormBizId"
:customerBizId="processInfo.customerBizId"
:dictTypeLists="dictTypeLists"
:customerInfo="customerInfo"
@handleSuccess="handleSuccess"
/>
</div>
......@@ -130,7 +131,7 @@
import AppointmentEdit from '@/views/sign/appointment/appointmentEdit'
import useUserStore from '@/store/modules/user'
import useDictStore from '@/store/modules/dict'
import { addFna, getProcessDetail, updateProcess } from '@/api/sign/fna'
import { addFna, getProcessDetail, updateProcess, getCustomerDetail } from '@/api/sign/fna'
import { listTenantUser, getInsuranceProductList, getAdditionalProductList } from '@/api/common'
import Customer from './components/customer'
import FanForm from './components/fanForm'
......@@ -151,6 +152,7 @@ const processInfo = ref({
}) // 流程详情信息
const updateStatus = ref(false)
const dictTypeLists = ref([])
const customerInfo = ref({})
const tabsList = ref([
{
label: '总览',
......@@ -314,6 +316,9 @@ function getProcessInfo(fnaBizId, changeTab) {
}
// Tab切换前的验证
const beforeTabLeave = (activeTabName, oldTabName) => {
if (processInfo.value.customerBizId) {
getCustomerInfo(processInfo.value.customerBizId)
}
// 如果切换到总览,始终允许
if (activeTabName === 'overview' || activeTabName === 'customer') {
return true
......@@ -372,6 +377,14 @@ if (route.query.type == 'add') {
getProcessInfo(route.query.fnaBizId)
}, 100)
}
// 获取客户详情
function getCustomerInfo(customerBizId) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
customerInfo.value = res.data
}
})
}
const handleSuccess = info => {
switch (info.tab) {
case 'customer':
......@@ -384,7 +397,7 @@ const handleSuccess = info => {
} else {
processUpdate({ fnaBizId: processInfo.value.fnaBizId, customerBizId: info.customerBizId })
}
getCustomerInfo(info.customerBizId)
break
case 'fnaform':
if (info.type == 'add') {
......
......@@ -80,15 +80,9 @@
@selection-change="tableSelect"
@sort-change="sortChange"
>
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="50" />
<el-table-column label="流程编号" align="center" prop="fnaNo" width="200" />
<el-table-column label="预约编号" align="center" prop="appointmentNo" width="200" />
<el-table-column label="新单编号" align="center" prop="policyId" />
<el-table-column label="保单号" align="center" prop="policyNo" width="150" />
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column type="index" width="50" label="序号" />
<el-table-column label="客户姓名" align="center" prop="customerName" width="100" />
<el-table-column label="状态" align="center" width="150">
<template #default="scope">
<span v-if="scope.row.status == 'UNCOMPLETED'">
......@@ -102,6 +96,11 @@
</span>
</template>
</el-table-column>
<el-table-column label="流程编号" align="center" prop="fnaNo" width="200" />
<el-table-column label="预约编号" align="center" prop="appointmentNo" width="200" />
<el-table-column label="新单编号" align="center" prop="policyId" />
<el-table-column label="保单号" align="center" prop="policyNo" width="150" />
<el-table-column label="创建时间" sortable align="center" prop="createTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
......@@ -115,13 +114,9 @@
fixed="right"
>
<template #default="scope">
<el-button type="primary" @click="handleUpdate(scope.row)">修改</el-button>
<el-button type="success" @click="handleCopy(scope.row)">生成副本</el-button>
<!-- v-if="scope.row.status == 'COMPLETED'" -->
<el-button
v-if="scope.row.status == 'COMPLETED'"
type="danger"
@click="handleDelete(scope.row)"
<el-button type="primary" link @click="handleUpdate(scope.row)">修改</el-button>
<el-button type="success" link @click="handleCopy(scope.row)">生成副本</el-button>
<el-button v-if="!scope.row.policyNo" type="danger" link @click="handleDelete(scope.row)"
>删除</el-button
>
</template>
......
......@@ -124,6 +124,7 @@
:idsObj="idsObj"
:apiSecondHolderInfoDto="appointmentSummeryInfo.apiSecondHolderInfoDto"
:appointmentStatus="appointmentSummeryInfo.status"
:customerInfo="customerInfo"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="secondHolderInfoRef"
/>
......@@ -468,6 +469,7 @@ function getAppointmentInfo(appointmentBizId, changeTab) {
processInfo.value.status = item.label
}
})
getCustomerInfo(res.data.apiAppointmentInfoDto.customerBizId)
if (!appointmentSummeryInfo.value.apiAppointmentInfoDto.appointmentBizId) {
showStorage.value = true
}
......@@ -744,9 +746,7 @@ watch(
if (!idsObj.value.appointmentBizId) {
formStatus.value = 'appointmentAdd'
getCustomerInfo(props.processDetail.customerBizId)
// if (idsObj.value.appointmentBizId) {
// getAppointmentInfo(idsObj.value.appointmentBizId)
// }
tabsList.value = [
{
label: '预约信息',
......@@ -867,12 +867,14 @@ watch(
}
]
}
nextTick(() => {
activeName.value = 'appointmentInfo'
})
}
}
)
onUnmounted(() => {
console.log('预约编辑页面完全销毁')
......
......@@ -64,6 +64,7 @@
:placeholder="child.placeholder"
:disabled="child.disabled"
@change="handleDateChange(child)"
:disabled-date="time => disabledDate(time, child)"
format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm:ss"
/>
......@@ -151,6 +152,7 @@
</div>
</template>
<script setup name="appointmentInfo">
import dayjs from 'dayjs'
import { ArrowRight } from '@element-plus/icons-vue'
import appointmentDomData from '@/formJson/appointmentInfo'
import Country from '@/views/components/country'
......@@ -256,6 +258,25 @@ const data = reactive({
}
})
const { form, rules, processedAppointmentData, queryParams, oldAppointmentData } = toRefs(data)
const disabledDate = (time, child) => {
// 获取“今天”的日期,并将其时间部分设置为 00:00:00
const today = dayjs().startOf('day') // :cite[7]
// 将传入的 timestamp 转换为 dayjs 对象
const inputDate = dayjs(time)
// 可以根据参数调整逻辑
if (child.key == 'intentionAppointmentTime') {
// 默认禁用今天及今天之前 (使用 isBefore 或 isSame)
return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day') // :cite[3]
// 如果允许选择今天,只禁用今天之前的日期 (使用 isBefore)
// return inputDate.isBefore(today, 'day') // :cite[3]
} else {
// 如果允许选择今天,只禁用今天之前的日期 (使用 isBefore)
return inputDate.isBefore(today, 'day') // :cite[3]
// return time.getTime() > Date.now()
}
}
const handleButtonClick = child => {
if (child.key == 'newPolicyButton') {
let obj = {
......
......@@ -218,6 +218,7 @@ const props = defineProps({
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
const insuredInfoFormRef = ref(null)
const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
......@@ -665,11 +666,7 @@ const confirmDrawer = info => {
// info 为抽屉返回的值
if (drawerInfo.value.domType == 'arrowRight' && drawerInfo.value.drawerType) {
let newObj = info[drawerInfo.value.key]
// if (form.value['customerType'] == 'COMPANY') {
// newObj.fatherKey = 'company'
// } else if (form.value['customerType'] == 'INDIVIDUAL') {
// newObj.fatherKey = 'person'
// }
//要判断drawerType
switch (drawerInfo.value.drawerType) {
case 'phone':
......@@ -692,6 +689,12 @@ const confirmDrawer = info => {
default:
break
}
// 手动触发表单验证
nextTick(() => {
// 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key
insuredInfoFormRef.value.clearValidate(validateField)
})
}
handleCloseDrawer()
......
......@@ -218,6 +218,7 @@ const props = defineProps({
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
const policyholderInfoFormRef = ref(null)
const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
......@@ -609,10 +610,9 @@ const processFormData = async obj => {
//弹出右侧抽屉
const handleFoucs = child => {
if (child.disabled) return
console.log('saveKey.value', saveKey.value)
console.log('child', child)
drawerInfo.value = JSON.parse(JSON.stringify(child))
switch (child.drawerType) {
case 'phone':
phoneMenuList.value[0].key = child.code
......@@ -687,6 +687,12 @@ const confirmDrawer = info => {
default:
break
}
// 手动触发表单验证
nextTick(() => {
// 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key
policyholderInfoFormRef.value.clearValidate(validateField)
})
}
handleCloseDrawer()
......
......@@ -42,6 +42,7 @@
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
@input="handleInputChange(father, child)"
/>
<el-select
v-if="child.domType === 'Select'"
......@@ -200,6 +201,7 @@ const props = defineProps({
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) } //客户详情回显表单用
})
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
......@@ -208,7 +210,6 @@ const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输入值
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const tempSaveKey = ref({}) // 用于tab切换的时候保存一份临时的值,防止切换的时候数据丢失
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗
......@@ -366,13 +367,11 @@ const fetchDictData = dictType => {
}
}
// 添加英文校验函数
const validateEnglish = (rule, value, callback) => {
const validateEnglish = (value, key) => {
if (value && !/^[A-Za-z]*$/.test(value)) {
// 清空非英文字符
form.value.firstNamePinyin = ''
callback(new Error('只能输入英文字母'))
} else {
callback()
form.value[key] = ''
proxy.$modal.msgError('请输入英文字符')
}
}
......@@ -420,12 +419,6 @@ const processFormData = async obj => {
if (props.idsObj.appointmentBizId) {
field.disabled = true
} else {
if (field.key == 'age') {
field.disabled = true
} else {
field.disabled = false
}
}
}
}
......@@ -558,53 +551,37 @@ const resetShow = obj => {
}
}
const handleSelectChange = (father, child) => {
const processData = JSON.parse(JSON.stringify(processedSecondHolderData.value))
for (const section of processData) {
switch (child.key) {
case 'customerType':
if (form.value[child.key] == 'COMPANY') {
showContacts.value = false
for (const section of processedSecondHolderData.value) {
if (section.key == 'company') {
for (const key1 in saveKey.value) {
for (const key2 in commonObj.value) {
if (key1 == key2) {
saveKey.value[key1]['fatherKey'] = section.key
}
}
case 'insurantRel':
for (const field of section.data) {
for (const key1 in field) {
for (const key2 in props.customerInfo) {
//当选择得关系是本人 用dom得key和用户信息得key做对比,给表单赋值
if (key1 == 'customerKey' && field[key1] == key2) {
form.value[field.key] = props.customerInfo[key2]
}
section.showMoudle = true
} else if (section.key !== 'customer') {
section.showMoudle = false
}
}
} else {
showContacts.value = true
for (const section of processedSecondHolderData.value) {
if (section.key == 'company') {
section.showMoudle = false
} else {
section.showMoudle = true
}
if (form.value['birthTime']) {
let age = calculateExactAge(proxy.formatToDate(form.value.birthTime))
if (age >= 0) {
form.value.age = age
}
}
break
case 'smokingAllowed':
// 选择吸烟,展示吸烟数量
if (form.value[child.key] == '1') {
resetShow({ type: 'child', key: 'smokingVolume', status: true })
} else {
resetShow({ type: 'child', key: 'smokingVolume', status: false })
}
default:
break
case 'isVip':
// 选择vip,展示vip备注
if (form.value[child.key] == '1') {
resetShow({ type: 'child', key: 'vipRemark', status: true })
} else {
resetShow({ type: 'child', key: 'vipRemark', status: false })
}
}
}
const handleInputChange = (father, child) => {
switch (child.key) {
case 'nameEn':
validateEnglish(form.value[child.key], child.key)
break
default:
......@@ -623,7 +600,7 @@ const handleEditStatus = status => {
for (const field of section.data) {
if (editStatus.value) {
field.disabled = true
} else {
} else if (field.key !== 'age') {
field.disabled = false
}
}
......@@ -732,10 +709,6 @@ watch(
exportValue: null
})
}, 500)
// processFormData({
// domdata: secondHolderDomData,
// exportValue: null
// })
}
}
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment