Commit 1f7ca662 by yuzhenWang

合并代码,做到了预约附件

parent 3f5ee310
......@@ -143,3 +143,11 @@ export function getInsuranceCompany(data) {
method: 'post'
})
}
// 获取保险险种列表
export function getInsuranceCategory(data) {
return request({
url: '/insurance/base/api/insuranceCategory/page',
data: data,
method: 'post'
})
}
const beneficiary = [
{
bigTitle: '受益人',
deleteIcon: true,
id: 1, //唯一标识,用于删除
children: [
// 客户信息 此模块始终展示
fatherTitle: '是否法定受益人',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'isLegalBeneficiary',
anchorKey: 'isLegalBeneficiary',
showMoudle: true, //模块是否展示
showTable: false, //是否展示表格
fatherRequired: true, //父级必填,代表个人资料这个模块有必填项
data: [
{
fatherTitle: '客户信息',
type: 'object',
key: 'customer',
showMoudle: true, //模块是否展示
data: [
{
label: '客户类型',
key: 'customerType',
customerKey: 'customerType',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'csf_customer_type',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '与受保人关系',
key: 'insurantRel',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'csf_ap_rel',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
label: '是否法定受益人',
key: 'isLegalBeneficiary',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'sys_no_yes',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
//受益人
{
showMoudle: false, //模块是否展示
fatherTitle: '受益人',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'apiBeneficiaryInfoDtoList',
anchorKey: 'apiBeneficiaryInfoDtoList',
fatherRequired: true, //父级必填,代表个人资料这个模块有必填项
addChildren: true,
addChildrenTxt: '新增受益人',
showTable: true, //是否展示表格
columns: [
{
label: '与受保人关系',
prop: 'insurantRelName',
type: 'text'
},
{
label: '姓名(中文)',
prop: 'nameCn',
type: 'text'
},
{
label: '姓名(拼音/英文)',
prop: 'namePyEn',
type: 'text'
},
{
label: '证件类型',
prop: 'documentTypeName',
type: 'text'
},
{
label: '证件号码',
prop: 'idNumber',
type: 'text'
},
{
label: '性别',
prop: 'genderName',
type: 'text'
},
{
label: '出生日期',
prop: 'birthday',
type: 'text'
},
{
label: '国籍',
prop: 'nationality',
type: 'text'
},
{
label: '受益比例',
prop: 'benefitRatio',
type: 'text'
}
],
data: [],
// 弹窗表单的配置
formItem: [
{
label: '与受保人关系',
key: 'insurantRel',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'csf_ap_rel',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
// 基础信息
{
fatherTitle: '基础信息',
type: 'object',
key: 'person',
label: '名字(中文)',
key: 'nameCn',
domType: 'Input',
unit: '历史客户',
unitColor: 'rgba(0, 82, 217, 1)',
inputType: 'text',
required: false,
maxLength: 15,
disabled: false,
placeholder: '请输入2~6位汉字',
show: true,
labelPosition: 'top', //标签的位置
showMoudle: true, //模块是否展示
// description: '证件信息至少填写一项',
data: [
{
label: '名字',
key: 'name',
customerKey: 'name',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '名字-英文',
key: 'nameEn',
customerKey: 'firstNamePinyin',
showEn: true, //是否填写英文
domType: 'Input',
inputType: 'text',
required: true,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '性别',
key: 'gender',
customerKey: 'gender',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'sys_gender',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '证件类型',
key: 'documentType',
customerKey: 'idType',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'csf_id_type',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '证件号码',
key: 'idNumber',
customerKey: 'idCard',
domType: 'Input',
inputType: 'number',
required: true,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '出生日期',
key: 'birthTime',
customerKey: 'birthdate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
{
label: '姓名(拼音/英文)',
key: 'namePyEn',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '证件类型',
key: 'documentType',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'csf_id_type',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
// 公司信息
{
fatherTitle: '公司信息',
type: 'object',
key: 'company',
label: '证件号码',
key: 'idNumber',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
showMoudle: false, //模块是否展示
data: [
{
label: '公司名称',
key: 'companyName',
customerKey: '',
domType: 'Input',
inputType: 'text',
required: true,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司名称(英文)',
key: 'companyNameEn',
customerKey: 'companyNameEn',
showEn: true, //是否填写英文
domType: 'Input',
inputType: 'text',
required: true,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司商业登记号码',
key: 'companyBusinessNo',
customerKey: 'companyBusinessNo',
domType: 'Input',
inputType: 'text',
required: true,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司注册日期',
key: 'companyRegisterTime',
customerKey: '',
domType: 'DatePicker',
required: true,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司注册地区',
key: 'companyRegisterRegion',
customerKey: '',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'csf_ap_registration',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司电话',
key: 'companyMobile',
customerKey: '',
domType: 'arrowRight',
required: true,
disabled: false,
placeholder: '请填写',
show: true,
drawerType: 'phone',
companyMobile: {}, //带有区号得电话一定要有一个和key一样得对象用于收集区号和号码
code: 'companyMobileCode',
maxLength: 20,
labelPosition: 'top', //标签的位置
labelWidth: '180px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司邮箱',
key: 'companyEmail',
customerKey: '',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司登记地址',
key: 'companyEnterAddress',
customerKey: '',
domType: 'arrowRight',
required: false,
disabled: false,
placeholder: '请填写',
show: true,
drawerType: 'address',
companyEnterAddress: {},
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '通讯地址',
key: 'txAddress',
customerKey: '',
domType: 'arrowRight',
required: false,
disabled: false,
placeholder: '请填写',
show: true,
drawerType: 'address',
txAddress: {},
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '授权代表姓名中文-名字',
key: 'authNameCn',
customerKey: '',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '授权代表姓名英文-名字',
key: 'authNameEn',
customerKey: '',
showEn: true, //是否填写英文
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '授权代表职称',
key: 'authProfessional',
customerKey: '',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '授权代表电话',
key: 'authMobile',
customerKey: '',
domType: 'arrowRight',
required: false,
disabled: false,
placeholder: '请填写',
show: true,
drawerType: 'phone',
authMobile: {}, //带有区号得电话一定要有一个和key一样得对象用于收集区号和号码
code: 'authMobileCode',
maxLength: 20,
labelPosition: 'top', //标签的位置
labelWidth: '180px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
{
label: '性别',
key: 'gender',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'sys_gender',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '生日',
key: 'birthday',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
// 其他信息
{
fatherTitle: '其他信息',
type: 'object',
key: 'customer',
showMoudle: true, //模块是否展示
data: [
{
label: '受益比例(%)',
key: 'benefitRatio',
customerKey: 'idCard',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '备注',
key: 'remark',
customerKey: 'idCard',
domType: 'Input',
inputType: 'textarea',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数
lg: 24 //栅格布局份数
}
]
label: '国籍(国家/地区)',
key: 'nationality',
domType: 'arrowRight',
required: false,
disabled: false,
placeholder: '请填写',
show: true,
drawerType: 'country',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '受益比例',
key: 'benefitRatio',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入受益比例',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
}
......
......@@ -62,14 +62,14 @@ const fnaForm = [
}
],
data: [
{
brokerName: '',
brokerGender: '',
brokerNumber: '',
brokerTeam: '',
brokerRatio: '',
remark: ''
}
// {
// brokerName: '',
// brokerGender: '',
// brokerNumber: '',
// brokerTeam: '',
// brokerRatio: '',
// remark: ''
// }
]
},
// 受供养人信息
......@@ -105,10 +105,10 @@ const fnaForm = [
}
],
data: [
{
policyholderRel: '',
dependantAge: ''
}
// {
// policyholderRel: '',
// dependantAge: ''
// }
]
},
// 已生效仍在缴费期的保单情况
......@@ -157,24 +157,24 @@ const fnaForm = [
type: 'datePicker',
placeholder: '请选择日期',
required: true
}
},
// 有重疾险才让填写
// {
// label: '保额',
// prop: 'sumInsured',
// type: 'inputNumber',
// placeholder: '请输入保额',
// required: true
// },
],
data: [
{
insurer: '',
insuranceType: '',
sumInsured: '',
currency: '',
policyIssueDate: ''
label: '保额(重疾险填写)',
prop: 'sumInsured',
type: 'inputNumber',
placeholder: '请输入保额',
required: true
}
],
data: [
// {
// insurer: '',
// insuranceType: '',
// sumInsured: '',
// currency: '',
// policyIssueDate: ''
// }
]
},
// 不动产信息
......@@ -225,18 +225,18 @@ const fnaForm = [
}
],
data: [
{
propertyType: '',
address: '',
marketValue: '',
currency: ''
}
// {
// propertyType: '',
// address: '',
// marketValue: '',
// currency: ''
// }
]
},
// 保费负担能力评估
{
fatherTitle: '保费负担能力评估',
type: 'object',
keyType: 'Object',
key: 'premiumAffordability',
anchorKey: 'premiumAffordability',
showTable: false,
......
import { anchorKey } from 'element-plus/es/components/anchor/src/constants.mjs'
const productPlan = [
{
fatherTitle: '基础信息',
......@@ -29,6 +27,7 @@ const productPlan = [
key: 'insuranceTypeName',
domType: 'SearchSelect',
required: true,
maxLength: 30,
disabled: false,
placeholder: '请输入',
......@@ -57,7 +56,6 @@ const productPlan = [
key: 'issueNumber',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'issueNumber',
show: true,
......@@ -71,7 +69,7 @@ const productPlan = [
key: 'guaranteePeriod',
domType: 'Input',
inputType: 'number',
required: true,
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
......@@ -95,21 +93,7 @@ const productPlan = [
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单额度(重疾)',
key: 'sumInsured',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '付款频率',
key: 'paymentFrequency',
......@@ -251,36 +235,22 @@ const productPlan = [
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保单额度(重疾)',
key: 'sumInsured',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: false,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
// {
// label: '地区',
// key: 'region',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 20,
// disabled: true,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '保单生效日',
// key: 'policyEffectiveDate',
// domType: 'DatePicker',
// required: false,
// disabled: false,
// placeholder: '请选择',
// show: false,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// }
]
},
//附加险
......@@ -294,135 +264,53 @@ const productPlan = [
addChildren: true,
addChildrenTxt: '新增附加险',
showTable: true, //是否展示表格
data: [
// {
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数
// childTitle: '附加险',
// deleteBtn: true,
// children: [
// {
// label: '产品名称',
// key: 'addProductName',
// domType: 'SearchSelect',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// labelPosition: 'top', //标签的位置
// lg: 8 //栅格布局份数
// },
// {
// label: '保额',
// key: 'sumInsured',
// domType: 'Input',
// inputType: 'number',
// required: true,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '保费',
// key: 'premium',
// domType: 'Input',
// inputType: 'number',
// required: true,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '保障地区',
// key: 'guaranteeRegion',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// 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: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '等级',
// key: 'insuranceType',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '自付额',
// key: 'deductibles',
// domType: 'Input',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '附加保障',
// key: 'additionalSafeguards',
// domType: 'Input',
// inputType: 'textarea',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 24, //栅格布局份数
// lg: 24 //栅格布局份数
// }
// ]
// }
data: [],
columns: [
{
label: '产品名称',
prop: 'productLaunchNameValue',
type: 'text'
},
{
label: '供款期数',
prop: 'issueNumber',
type: 'text'
},
{
label: '保障年期',
prop: 'guaranteePeriod',
type: 'text'
},
{
label: '保单币种',
prop: 'policyCurrency',
type: 'text'
},
{
label: '保单额度',
prop: 'sumInsured',
type: 'text'
},
{
label: '每期保费',
prop: 'eachIssuePremium',
type: 'text'
},
{
label: '保障级别',
prop: 'protectionLevel',
type: 'text'
},
{
label: '自付额',
prop: 'deductibles',
type: 'text'
},
{
label: '附加保障',
prop: 'additionalSafeguards',
type: 'text'
}
],
// 弹窗表单的配置
formItem: [
......@@ -499,7 +387,7 @@ const productPlan = [
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
show: false,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
......
const secondHolder = [
// 基础信息
{
fatherTitle: '',
type: 'object',
key: 'person',
labelPosition: 'top', //标签的位置
fatherTitle: '是否有第二持有人',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'isSecond',
anchorKey: 'isSecond',
showMoudle: true, //模块是否展示
// description: '证件信息至少填写一项',
showTable: false, //是否展示表格
fatherRequired: true, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '是否有第二持有人',
key: 'isSecond',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'sys_no_yes',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
//受益人
{
showMoudle: false, //模块是否展示
fatherTitle: '受益人',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'apiSecondHolderInfoDto',
anchorKey: 'apiSecondHolderInfoDto',
fatherRequired: true, //父级必填,代表个人资料这个模块有必填项
addChildren: true,
addChildrenTxt: '新增受益人',
showTable: false, //是否展示表格
data: [
{
label: '与受保人关系',
......@@ -23,30 +52,30 @@ const secondHolder = [
lg: 8 //栅格布局份数
},
{
label: '名字',
key: 'name',
customerKey: 'name',
label: '名字(中文)',
key: 'nameCn',
domType: 'Input',
unit: '历史客户',
unitColor: 'rgba(0, 82, 217, 1)',
inputType: 'text',
required: false,
maxLength: 20,
maxLength: 15,
disabled: false,
placeholder: '请输入',
placeholder: '请输入2~6位汉字',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '名字-英文',
key: 'nameEn',
customerKey: 'firstNamePinyin',
showEn: true, //是否填写英文
label: '姓名(拼音/英文)',
key: 'namePyEn',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
......@@ -56,14 +85,13 @@ const secondHolder = [
lg: 8 //栅格布局份数
},
{
label: '性别',
key: 'gender',
customerKey: 'gender',
label: '证件类型',
key: 'documentType',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'sys_gender',
dictType: 'csf_id_type',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
......@@ -71,29 +99,29 @@ const secondHolder = [
lg: 8 //栅格布局份数
},
{
label: '出生日期',
key: 'birthTime',
customerKey: 'birthdate',
domType: 'DatePicker',
label: '证件号码',
key: 'idNumber',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请选择',
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '年龄',
key: 'age',
customerKey: 'age',
domType: 'Input',
inputType: 'number',
label: '性别',
key: 'gender',
domType: 'Select',
required: false,
maxLength: 20,
disabled: true,
placeholder: '请输入',
disabled: false,
placeholder: '请选择',
dictType: 'sys_gender',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
......@@ -101,30 +129,28 @@ const secondHolder = [
lg: 8 //栅格布局份数
},
{
label: '证件类型',
key: 'documentType',
customerKey: 'idType',
domType: 'Select',
label: '生日',
key: 'birthday',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'csf_id_type',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '证件号码',
key: 'idNumber',
customerKey: 'idCard',
label: '受益比例',
key: 'benefitRatio',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 20,
maxLength: 300,
disabled: false,
placeholder: '请输入',
placeholder: '请输入受益比例',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
......
......@@ -87,8 +87,10 @@
v-if="child.domType === 'Select'"
v-model="form[child.key]"
:placeholder="child.placeholder"
:data-key="child.key"
@change="handleSelectChange(child)"
:disabled="editStatus"
clearable
>
<el-option
v-for="item in child.options"
......@@ -187,7 +189,6 @@
:disabled="editStatus"
>取消</el-button
>
<!-- @click="submitForm" -->
<el-button
type="primary"
icon="Check"
......@@ -341,7 +342,8 @@ const props = defineProps({
tabIndex: { type: [String, Number], default: '' }, //tab索引
affixOffset: { type: Number, default: 250 }, //锚点吸顶距离
customerBizId: { type: String, default: '' }, //提交状态,新增、修改
tabSource: { type: String, default: '' } //引用这个组件的页面来源,用于逻辑判断
tabSource: { type: String, default: '' },
idsObj: { type: Object, default: () => ({}) } //引用这个组件的页面来源,用于逻辑判断
})
const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance()
......@@ -361,6 +363,7 @@ const tableData = ref([])
const total = ref(0)
//计算默认显示的日期(18年前的今天)
const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate())
// 地址组件菜单数据
const addressMenuList = ref([
{
......@@ -719,12 +722,6 @@ const processFormData = async () => {
]
}
}
// if (field.key === 'bmi') {
// rules.value[field.key] = [
// { required: false, trigger: 'change' },
// { validator: validateBMI,trigger: 'change' }
// ]
// }
}
}
}
......@@ -734,12 +731,19 @@ const processFormData = async () => {
{ required: true, message: `与投保人关系不能为空`, trigger: 'blur' }
]
}
if (props.customerBizId) {
if (props.customerBizId && props.tabSource == 'customer') {
// 在客户资料中是编辑客户资料,需要回显客户资料
getCustomerInfo(props.customerBizId, processedData)
} else if (
props.customerBizId &&
(props.tabSource == 'policyholder' || props.tabSource == 'insurantInfo') &&
!props.idsObj.appointmentBizId
) {
//是投保人/受保人但是新增预约 需要引用客户资料的值
getCustomerInfo(props.customerBizId, processedData)
} else {
processedCustomerData.value = oldCustomerData.value = processedData
}
console.log('form', form.value)
}
//弹出右侧抽屉
......@@ -899,6 +903,8 @@ const handleSelectChange = child => {
}
break
case 'policyholderRel':
// 强制同步:确保form.value.policyholderRel与当前选择的值一致
processedCustomerData.value.forEach(section => {
if (form.value[child.key] == 'MYSELF') {
if (section.key == 'policyholderRel') {
......@@ -910,6 +916,8 @@ const handleSelectChange = child => {
section.showMoudle = true
}
})
console.log('下拉', form.value)
break
default:
break
......@@ -946,6 +954,9 @@ const setFormValue = (obj, formData, exportValue) => {
phoneQuickList.value = []
// 深拷贝原始数据
form.value = JSON.parse(JSON.stringify(obj))
if (props.activeName == 'insurantInfo' && !props.idsObj.appointmentBizId) {
form.value['policyholderRel'] = ''
}
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) {
......@@ -1066,10 +1077,6 @@ const setFormValue = (obj, formData, exportValue) => {
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
// if (!exportValue) {
// // 保存一份就得表单数据便于做撤销操作
// oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
// }
processedCustomerData.value = processedData
}
// 数组去重
......@@ -1136,59 +1143,38 @@ const resetShow = (key, status) => {
}
}
// 方法1:使用 Promise 包装 validateField
const debugValidation = async () => {
const fieldNames = Object.keys(rules.value)
console.log('开始验证以下字段:', fieldNames)
// 1. 为每个字段创建验证Promise,并直接返回该字段的验证结果
const validationPromises = fieldNames.map(field => {
return new Promise(resolve => {
if (!customerFormRef.value) {
console.error(`[${field}] 表单实例不存在`)
resolve({ field, error: null, valid: false }) // 标记为无效
return
}
customerFormRef.value.validateField(field, errorMessage => {
console.log(`[${field}] 验证结果:`, errorMessage ? `失败 - ${errorMessage}` : '通过')
// 关键修改:只有当 errorMessage 存在(有错误)时,才携带错误信息
if (errorMessage) {
resolve({ field, error: errorMessage, valid: false })
} else {
resolve({ field, error: null, valid: true })
}
})
})
})
// 2. 等待所有验证完成
const results = await Promise.all(validationPromises)
// 3. 筛选出所有验证失败的字段
const errors = results
.filter(result => !result.valid && result.error)
.map(result => ({ field: result.field, message: result.error }))
// 暴露一个同步获取数据的方法
const getFormData = () => {
// 确保form对象包含所有必要的字段
const formData = { ...form.value }
console.log('最终收集到的错误列表:', errors)
return errors
}
// 滚动到第一个错误字段
const scrollToFirstError = () => {
const firstError = document.querySelector('.el-form-item__error')
if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' })
// 如果policyholderRel不存在,尝试从select元素获取
if (!formData.hasOwnProperty('policyholderRel') || !formData.policyholderRel) {
// 这里可以根据你的实际情况获取最新的值
const selectElement = document.querySelector('[data-key="policyholderRel"]')
if (selectElement) {
formData.policyholderRel = selectElement.value
}
}
return formData
}
const handleFormValues = () => {
//source:因为这个组件是公共组件所以提交的时候要知道是哪里要获取表单的值
const handleFormValues = source => {
return new Promise(async resolve => {
let submitObj = { ...form.value }
let submitObj = {}
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理
if (source == 'policyHolderInfoRef') {
form.value['policyholderRel'] = '111' //因为校验在form上所以这句不能去除
submitObj = { ...policyholderForm.value }
} else if (source == 'insuredInfoRef') {
submitObj = { ...insuredForm.value }
} else {
submitObj = { ...form.value }
}
let addressList = []
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday'])
customerFormRef.value.validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
//处理表单数据
......@@ -1239,7 +1225,7 @@ const handleFormValues = () => {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
if (props.customerBizId && props.activeName == 'customer') {
editCustomer(submitObj).then(res => {
if (res.code == 200) {
......@@ -1269,6 +1255,7 @@ const handleFormValues = () => {
}
})
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
......@@ -1289,10 +1276,22 @@ const anchorList = computed(() => {
}
return data
})
const policyholderForm = ref({}) //投保人表单值
const insuredForm = ref({}) //受保人表单值
watch(
() => props.activeName,
() => form.value,
newVal => {
if (props.activeName == 'policyholder') {
policyholderForm.value = JSON.parse(JSON.stringify(newVal))
} else if (props.activeName == 'insurantInfo') {
insuredForm.value = JSON.parse(JSON.stringify(newVal))
}
},
{ immediate: true, deep: true }
)
watch(
() => props.activeName,
(newVal, oldVal) => {
editStatus.value = false
customerRightRef.value = null
if (newVal === 'customer' || newVal === 'policyholder' || newVal === 'insurantInfo') {
......@@ -1304,6 +1303,12 @@ watch(
editStatus.value = false
}
}
// 切换tab要保存各自的表单值
if (oldVal == 'policyholder') {
policyholderForm.value = JSON.parse(JSON.stringify(form.value))
} else if (oldVal == 'insurantInfo') {
insuredForm.value = JSON.parse(JSON.stringify(form.value))
}
}
)
watch(
......@@ -1315,7 +1320,8 @@ watch(
// 暴露给父组件
defineExpose({
handleFormValues,
handleEditStatus
handleEditStatus,
getRawForm: () => JSON.parse(JSON.stringify(form.value))
})
</script>
<style lang="scss" scoped>
......
<template>
<div v-if="processedFanFormData.length > 0">
<div ref="fanContainerRef">
<!-- <el-row>
<el-col :span="24">
<div class="topBtn">
<el-button
v-if="props.fnaFormBizId"
type="primary"
icon="EditPen"
@click="handleEditStatus"
>编辑</el-button
>
</div>
</el-col>
</el-row> -->
<div class="editBtn">
<el-button
v-if="props.fnaFormBizId && props.tabSource == 'fnaform'"
type="primary"
icon="EditPen"
@click="handleEditStatus"
>编辑</el-button
>
</div>
<CommonForm
:anchorList="anchorList"
:affixOffset="250"
......@@ -32,9 +29,12 @@
<template #mainTitCustom>
<div
class="dependNum"
v-if="father.key == 'dependantList' && father.data.length > 0"
v-if="
father.key == 'dependantList' &&
father.data.filter(item => !item.unSave).length > 0
"
>
受供养人数目:{{ father.data.length }}
受供养人数目:{{ father.data.filter(item => !item.unSave).length }}
</div>
</template>
<template #content>
......@@ -48,7 +48,18 @@
? ''
: child.label
"
:prop="child.key"
:prop="father.key + '.' + child.key"
:rules="
child.required
? [
{
required: true,
message: `${child.label}不能为空`,
trigger: child.domType === 'Select' ? 'change' : 'blur'
}
]
: undefined
"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
......@@ -71,7 +82,7 @@
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="child.value"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
maxlength="30"
:disabled="editStatus"
......@@ -82,7 +93,7 @@
</el-input>
<el-select
v-if="child.domType === 'Select'"
v-model="child.value"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(child)"
:disabled="editStatus"
......@@ -97,7 +108,7 @@
<el-date-picker
style="width: 100%"
v-if="child.domType === 'DatePicker'"
v-model="child.value"
v-model="form[father.key][child.key]"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
......@@ -110,7 +121,7 @@
<el-input
v-if="child.domType === 'arrowRight'"
v-model="child.value"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder"
@click="handleFoucs(child)"
:suffix-icon="ArrowRight"
......@@ -120,7 +131,7 @@
</el-input>
<el-checkbox-group
v-if="child.domType === 'Checkbox'"
v-model="child.value"
v-model="form[father.key][child.key]"
:disabled="editStatus"
>
<template class="customCheckBox">
......@@ -136,9 +147,11 @@
style="width: 250px"
v-if="
child.key === 'liquidAssetType' &&
child.value.filter(item => item == 'G').length > 0
form[father.key][child.key] &&
form[father.key][child.key].filter(item => item == 'G')
.length > 0
"
v-model="child.otherLiquidAsset"
v-model="form[father.key]['otherLiquidAsset']"
placeholder="请输入说明"
:disabled="editStatus"
/>
......@@ -179,17 +192,29 @@
remote
reserve-keyword
:placeholder="column.placeholder"
:remote-method="query => searchSelectList(query, column.searchType)"
:remote-method="
query => searchSelectList(query, column.searchType, scope.row)
"
:loading="searchLoadingStates[column.searchType]"
:disabled="editStatus"
@change="handleRemoteSelectChange(scope.row, column)"
@change="handleRemoteSelectChange(scope.row, column, father)"
>
<el-option
v-for="item in searchOptions[column.searchType] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
<template v-if="column.searchType !== 'insuranceType'">
<el-option
v-for="item in searchOptions[column.searchType] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</template>
<template v-else>
<el-option
v-for="item in scope.row.insuranceTypeOption || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</template>
</el-select>
<!-- 普通选择框 -->
......@@ -221,7 +246,20 @@
<!-- 数字输入框 -->
<el-input
v-else-if="column.type === 'inputNumber'"
v-else-if="
column.type === 'inputNumber' && !!scope.row.showSumInsured
"
v-model.number="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
type="number"
>
<template v-if="column.unit" #append>
<span>{{ column.unit }}</span>
</template>
</el-input>
<el-input
v-else-if="column.type === 'inputNumber' && scope.row.showSumInsured"
v-model.number="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
......@@ -231,10 +269,9 @@
<span>{{ column.unit }}</span>
</template>
</el-input>
<!-- 普通输入框(默认) -->
<el-input
v-else
v-else-if="column.prop !== 'sumInsured'"
v-model="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus"
......@@ -243,13 +280,27 @@
</el-table-column>
<!-- 操作列(固定) -->
<el-table-column width="60px" align="center" label="操作">
<el-table-column
:width="father.key == 'dependantList' ? 150 : 80"
align="center"
label="操作"
>
<template #default="scope">
<el-icon
class="deleteIcon"
<el-button
type="primary"
size="small"
v-if="father.key == 'dependantList'"
@click="saveTableData(father, scope.row)"
>
{{ scope.row.unSave ? '未保存' : '已保存' }}
</el-button>
<el-button
type="danger"
size="small"
@click="deleteChildren(father, scope.$index)"
><Delete
/></el-icon>
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -295,7 +346,12 @@ import useDictStore from '@/store/modules/dict'
import fanFormDomData from '@/formJson/fnaForm'
import { watch, nextTick } from 'vue'
import { addfanForm, getfanFormDetail, editFanForm, getCustomerList } from '@/api/sign/fna'
import { getUserSaleExpandList, getAllTeam, getInsuranceCompany } from '@/api/common'
import {
getUserSaleExpandList,
getAllTeam,
getInsuranceCompany,
getInsuranceCategory
} from '@/api/common'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const dictStore = useDictStore() //获取字典数据
......@@ -307,7 +363,8 @@ const props = defineProps({
customerBizId: { type: String, default: '' }, //提交状态,新增、修改
dictTypeLists: { type: Array, default: () => [] }, //多个字典值数据
anchorContainer: { type: String, default: '' }, //锚点滚动容器
tabIndex: { type: [String, Number], default: '' } //tab索引
tabIndex: { type: [String, Number], default: '' }, //tab索引
tabSource: { type: String, default: '' } //引用这个组件的页面来源,用于逻辑判断
})
const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance()
......@@ -342,14 +399,37 @@ const {
tempFanFormValue,
tempFanFormData
} = toRefs(data)
const handleRemoteSelectChange = (row, column) => {
const handleRemoteSelectChange = async (row, column, father) => {
console.log(row, column)
// 通过保险公司查保险种类 row中收集了insurer的值
if (column.prop == 'insurer') {
const params1 = {
pageNo: 1,
pageSize: 10
}
const response1 = await getInsuranceCategory(params1)
if (response1.code == 200) {
response1.data.records = response1.data.records.map(item => {
return {
...item,
label: item.name,
value: item.insuranceCategoryBizId
}
})
row.insuranceTypeOption = response1.data.records
}
}
if (column.prop == 'insuranceType' && row.insuranceType) {
//如果险种选择了重疾险,则显示重疾险的输入框
row.insuranceTypeOption.forEach(item => {
if (item.value == row.insuranceType && item.code == 'CI') {
row.showSumInsured = true
}
})
}
}
// 搜索方法
const searchSelectList = async (query, fieldKey) => {
const searchSelectList = async (query, fieldKey, row) => {
// 设置该字段的加载状态
searchLoadingStates.value[fieldKey] = true
let queryString = query.trim()
......@@ -406,6 +486,31 @@ const searchSelectList = async (query, fieldKey) => {
})
searchOptions.value[fieldKey] = response9.data.records
}
} else if (fieldKey == 'insuranceType') {
if (!row.insurer) {
proxy.$modal.confirm(`请先选择保险公司`, {
showCancel: '0',
title: '填写提示'
})
row.insuranceType = ''
return
}
const params1 = {
pageNo: 1,
pageSize: 10,
name: queryString
}
const response1 = await getInsuranceCategory(params1)
if (response1.code == 200) {
response1.data.records = response1.data.records.map(item => {
return {
...item,
label: item.name,
value: item.insuranceCategoryBizId
}
})
row.insuranceTypeOption = response1.data.records
}
}
} catch (error) {
console.error(`${fieldKey} 搜索失败`, error)
......@@ -450,46 +555,21 @@ const processFormData = async () => {
rules.value[section.key] = {}
}
//给表单赋值各模块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') {
if (section.keyType == 'Object') {
form.value[section.key] = {}
}
if (section.data) {
for (const field of section.data) {
// 为下拉搜索框加options
// if (field.domType == 'SearchSelect') {
// if (field.key == 'accountName') {
// searchOptions.value[field.key] = dictStore.tenantUserList
// }
// }
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
if (field.dictType == 'sys_no_yes') {
noYesList.value = field.options
}
}
if (field.required) {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
if (props.fnaFormBizId) {
field.disabled = true
} else {
field.disabled = false
}
}
}
}
if (props.fnaFormBizId) {
// getFanformInfo(props.fnaFormBizId, processedData)
// editStatus.value = true
getFanformInfo(props.fnaFormBizId, processedData)
editStatus.value = true
} else {
// tab切走在切回来时,表单会重置,所以这里需要把表单的值赋回去
if (Object.keys(tempFanFormValue.value).length > 0) {
......@@ -504,7 +584,6 @@ const processFormData = async () => {
}
editStatus.value = false
loading.value = false
console.log('processedFanFormData.value', processedFanFormData.value)
}
processedFanFormData.value = oldFanFormData.value = processedData
}
......@@ -522,15 +601,16 @@ const addChildren = father => {
let obj2 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
policyholderRel: '',
dependantAge: ''
dependantAge: '',
unSave: true //新增受供养人的时候是未保存状态
}
let obj3 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
insurer: '',
insuranceType: '',
sumInsured: '',
currency: '',
policyIssueDate: ''
policyIssueDate: '',
showSumInsured: false //重疾险显示保额输入框
}
let obj4 = {
propertyType: '',
......@@ -544,7 +624,14 @@ const addChildren = father => {
section.data.push(obj1)
}
if (father.key == 'dependantList' && section.key == father.key) {
section.data.push(obj2)
if (father.data.length == 0 || father.data.filter(item => item.unSave).length == 0) {
section.data.push(obj2)
} else if (father.data.filter(item => item.unSave).length > 0) {
proxy.$modal.confirm(`请先保存‘新增的受供养人’信息再添加`, {
showCancel: '0',
title: '填写提示'
})
}
}
if (father.key == 'existingSecurityOwner' && section.key == father.key) {
section.data.push(obj3)
......@@ -555,6 +642,7 @@ const addChildren = father => {
}
processedFanFormData.value = processedData
}
const deleteChildren = (father, childIndex) => {
if (editStatus.value) {
proxy.$modal.confirm(`请先点击编辑再进行删除操作`, { showCancel: '0', title: '填写提示' })
......@@ -562,31 +650,33 @@ const deleteChildren = (father, childIndex) => {
}
const processedData = JSON.parse(JSON.stringify(processedFanFormData.value))
for (const section of processedData) {
if (father.key == 'familyMembers' && section.key == father.key) {
if (father.key == 'brokerList' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
if (father.key == 'taxList' && section.key == father.key) {
if (father.key == 'dependantList' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
if (
(father.key == 'existingSecurityOwner' || father.key == 'existingSecurityInsured') &&
section.key == father.key
) {
if (father.key == 'existingSecurityOwner' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
if (
(father.key == 'investment' || father.key == 'primaryResidence') &&
section.key == father.key
) {
if (father.key == 'primaryResidence' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
}
//更新form表单对应的数据,以便收集填写的值
form.value[father.key].splice(childIndex, 1)
processedFanFormData.value = processedData
}
// 根据联动重置表单项的显示与否
// 保存表格数据
const saveTableData = (father, row) => {
if (father.key == 'dependantList') {
console.log(!row.policyholderRel && !row.dependantAge)
if (!row.policyholderRel && !row.dependantAge) {
proxy.$modal.confirm(`请先填写受供养人信息再保存`, { showCancel: '0', title: '填写提示' })
return
}
row.unSave = false
}
}
const resetShow = (childKey, status) => {
console.log(childKey, status)
......@@ -650,171 +740,22 @@ const handleEditStatus = () => {
}
//给表单赋值 方便表单回显 obj 为表单数据
const setFormValue = (obj, formData) => {
loading.value = true
console.log('回显值', obj)
let newForm = JSON.parse(JSON.stringify(form.value))
// 1.先正确的拿到表单的回显值
for (const key in newForm) {
for (const key2 in obj) {
if (isObject(newForm[key]) && key == key2) {
newForm[key] = obj[key2]
}
if (isArray(newForm[key]) && key == key2 && obj[key2] && obj[key2].length > 0) {
newForm[key] = obj[key2]
}
}
}
// 2.根据最新的表单数据更新processedFanFormData的值,因为有些模块是多项的,所以表单数据要和dom对应上,防止dom有form表单里没有对应的数据会报错
let newChildren = {
type: '4',
childTitle: '儿女',
delete: true, //是否显示删除按钮
age: '',
needProvide: '',
options: noYesList.value
}
// 深拷贝原始表单dom数据
const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) {
for (const key in newForm) {
//回显的数据有的没填写就会是null,收集表单值得时候和dom对应不上,对于null值得项要根据section得keyType给form正确得数据类型
if (!newForm[key]) {
if (section.keyType == 'Array' && key == section.key) {
newForm[key] = []
} else if (section.keyType == 'Object' && key == section.key) {
newForm[key] = {}
}
}
if (section.data) {
if (section.key == 'familyMembers' && section.key == key) {
// 根据家人得type对应,如果填写得有儿女processedFanFormData和form应该加上对应得值
newForm[key].forEach((item, index) => {
// 儿女特殊处理,因为可能有多个儿女为了区分是哪个儿女,所以加上id
if (item.type == '4') {
item.id = index + 1
section.data.push({ id: index + 1, ...newChildren })
form.value[key].push({ id: index + 1, ...newChildren })
}
})
} else if (key !== 'familyMembers' && section.key == key) {
if (isArray(newForm[key]) && newForm[key].length <= section.dataLength) {
let num = section.dataLength - newForm[key].length
for (let i = 0; i < num; i++) {
newForm[key].push(section.data[0])
}
}
}
loading.value = true
let processedData = JSON.parse(JSON.stringify(formData))
if (section.key == 'personalData' && key == section.key) {
if (isObject(newForm[key])) {
for (const key2 in newForm[key]) {
// 如果就业情况为其他,显示其他就业情况
if (key2 == 'employment' && newForm[key][key2] == 'OTHER') {
for (const item of section.data) {
if (item.key == 'otherEmployment') {
item.show = true
}
}
}
}
}
}
}
}
}
// 回显表单值特殊处理
for (const key in form.value) {
for (const key2 in newForm) {
if (key == key2 && key == 'familyMembers') {
if (newForm[key2].length > 0) {
form.value[key] = form.value[key].map(item1 => {
newForm[key2].forEach(item2 => {
if (item1.type == '4' && item1.id == item2.id) {
item1.age = item2.age
item1.needProvide = item2.needProvide
} else {
if (item1.type == item2.type && !item2.id) {
item1.age = item2.age
item1.needProvide = item2.needProvide
}
}
})
return item1
})
}
} else if (key == key2 && key !== 'familyMembers') {
if (isArray(newForm[key2]) && newForm[key].length > 0) {
form.value[key] = newForm[key2]
} else if (isObject(newForm[key2])) {
for (const key3 in newForm[key2]) {
if (!newForm[key2][key3]) {
if (key3 == 'premiumFundingSource' || key3 == 'liquidAssetType') {
newForm[key2][key3] = []
} else {
newForm[key2][key3] = ''
}
} else {
if (key3 == 'premiumFundingSource' || key3 == 'liquidAssetType') {
newForm[key2][key3] = newForm[key2][key3].split(',')
}
}
}
form.value[key] = newForm[key2]
}
}
}
}
for (const section of processedData) {
for (const key1 in obj) {
if (section.data) {
if (
obj[key1] &&
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' &&
obj[key1]
) {
section.data = form.value[key1].map(item => {
for (const key2 in item) {
if (key2 == 'needProvide') {
item.options = fetchDictData('sys_no_yes')
}
}
return {
...item
}
})
}
// 流动资产包含其他的时候,显示其他说明
if (section.key == 'liquidAssets') {
for (const field of section.data) {
if (
field.key == 'otherLiquidAsset' &&
obj[section.key]['liquidAssetType'] &&
obj[section.key]['liquidAssetType'].includes('G')
) {
field.show = true
}
}
}
}
if (section.keyType == 'Array') {
section.data = obj[section.key] ? obj[section.key] : []
} else if (section.keyType == 'Object') {
obj[section.key].premiumFundingSource = obj[section.key].premiumFundingSource
? obj[section.key].premiumFundingSource.split(',')
: []
obj[section.key].liquidAssetType = obj[section.key].liquidAssetType
? obj[section.key].liquidAssetType.split(',')
: []
form.value[section.key] = obj[section.key]
}
}
......@@ -850,64 +791,58 @@ const isObject = value => {
// 表单提交
const submitForm = saveType => {
let oldForm = JSON.parse(JSON.stringify(form.value))
// 深拷贝原始数据
let result = JSON.parse(JSON.stringify(form.value))
let resDom = JSON.parse(JSON.stringify(processedFanFormData.value))
console.log('result', result)
let result = {}
// 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]) {
if (isArray(result[key][key2])) {
if (
key == 'liquidAssets' &&
key2 == 'liquidAssetType' &&
!result[key][key2].includes('G')
) {
result[key]['otherLiquidAsset'] = ''
}
result[key][key2] = result[key][key2].join(',')
if (section.keyType == 'Array' && section.data.length > 0) {
section.data.forEach(item => {
if (item.brokerName) {
dictStore.userSaleExpandList.forEach(item2 => {
if (item2.value == item.brokerName) {
item.brokerName = item2.label
}
})
}
if (item.brokerTeam) {
dictStore.allTeaList.forEach(item2 => {
if (item2.value == item.brokerTeam) {
item.brokerTeam = item2.label
}
})
}
if (item.insurer) {
dictStore.allInsuranceCompanyList.forEach(item2 => {
if (item2.value == item.insurer) {
item.insurer = item2.label
}
})
}
if (item.insuranceType) {
item.insuranceTypeOption.forEach(item2 => {
if (item2.value == item.insuranceType) {
item.insuranceType = item2.label
}
})
}
}
}
if (isArray(result[key])) {
result[key] = result[key]
.map(item => {
// 删除指定字段
delete item.childTitle
delete item.children
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)
}
return item
})
.filter(item => Object.keys(item).length > 0) // 过滤空对象
}
if (key == 'familyMembers') {
result[key] = result[key].filter(item => {
if (item.age || item.needProvide) return item
})
result[section.key] = section.data
}
}
result.premiumAffordability = JSON.parse(JSON.stringify(form.value.premiumAffordability))
result.premiumAffordability.liquidAssetType =
result.premiumAffordability.liquidAssetType.join(',')
result.premiumAffordability.premiumFundingSource =
result.premiumAffordability.premiumFundingSource.join(',')
if (result.premiumAffordability.liquidAssetType.includes('G')) {
result.premiumAffordability.otherLiquidAsset = oldForm.premiumAffordability.otherLiquidAsset
}
result.saveType = saveType
result.customerBizId = props.customerBizId
console.log('====================================')
......@@ -991,6 +926,12 @@ watch(
)
</script>
<style lang="scss" scoped>
.editBtn {
position: fixed;
right: 3.5%;
top: 22%;
z-index: 999;
}
.dependNum {
font-size: 14px;
font-weight: none;
......
......@@ -102,6 +102,7 @@
@handleSuccess="handleSuccess"
:tabIndex="tabsList.findIndex(t => t.name === 'fnaform')"
anchorContainer=".tabPaneBox"
tabSource="fnaform"
/>
</div>
<div v-if="tab.name === 'appointment'">
......
......@@ -119,7 +119,7 @@
</div>
<!-- 投保人 -->
<div v-if="tab.name === 'policyholder'">
<!-- :customerBizId="processInfo.customerBizId" @handleSuccess="handleSuccess"-->
<!-- @handleSuccess="handleSuccess"-->
<Customer
:activeName="activeName"
:fatherTabName="tabName"
......@@ -130,6 +130,10 @@
tabSource="policyholder"
ref="policyHolderInfoRef"
:fatherEditStatus="editStatus"
:customerInfo="customerInfo"
:apiPolicyholderInfoDto="appointmentSummeryInfo.apiPolicyholderInfoDto"
:idsObj="idsObj"
:customerBizId="props.processDetail.customerBizId"
/>
<!-- <PolicyHolderInfo
:activeName="activeName"
......@@ -157,6 +161,8 @@
tabSource="insurantInfo"
ref="insuredInfoRef"
:fatherEditStatus="editStatus"
:idsObj="idsObj"
:customerBizId="props.processDetail.customerBizId"
/>
<!-- <InsuredInfo
:activeName="activeName"
......@@ -186,6 +192,10 @@
:pageSource="pageSource"
:showSubmitBtn="showSubmitBtn"
@policyEditSuccess="getPolicyDetail"
:tabIndex="tabsList.findIndex(t => t.name === 'secondHolder')"
anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName"
:editStatus="editStatus"
/>
</div>
<div v-if="tab.name === 'beneficiary'">
......@@ -200,6 +210,10 @@
:pageSource="pageSource"
:showSubmitBtn="showSubmitBtn"
@policyEditSuccess="getPolicyDetail"
:tabIndex="tabsList.findIndex(t => t.name === 'beneficiary')"
anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName"
:editStatus="editStatus"
/>
</div>
<div v-if="tab.name === 'questionnaires'">
......@@ -213,6 +227,10 @@
:pageSource="pageSource"
:showSubmitBtn="showSubmitBtn"
:foldInsurantInfo="foldInsurantInfo"
:affixOffset="360"
:tabIndex="tabsList.findIndex(t => t.name === 'questionnaires')"
anchorContainer=".appointmentTabPaneBox"
:editStatus="editStatus"
/>
</div>
<div v-if="tab.name === 'fna'">
......@@ -805,12 +823,6 @@ const beforeTabLeave = (activeTabName, oldTabName) => {
return true
}
const handleBack = () => {
// 先手动清理状态
submitAppointmentObj.value = {}
appointmentSummeryInfo.value = {}
router.go(-1)
}
// 判断是否为数组
const isArray = value => {
return Array.isArray(value)
......@@ -829,24 +841,44 @@ const handleSubmit = async type => {
// }
// if (productPlanRef.value) {
// submitAppointmentObj.value.apiProductPlanInfoDto = productPlanRef.value[0].handleSubmitForm()
// submitAppointmentObj.value.apiProductPlanInfoDto =
// await productPlanRef.value[0].handleSubmitForm()
// if (!submitAppointmentObj.value.apiProductPlanInfoDto) return
// }
// 获取投保人form
// if (policyHolderInfoRef.value) {
// submitAppointmentObj.value.apiPolicyholderInfoDto =
// await policyHolderInfoRef.value[0].handleFormValues('policyHolderInfoRef')
// if (!submitAppointmentObj.value.apiPolicyholderInfoDto) return
// }
// 获取受保人form
// if (insuredInfoRef.value) {
// console.log('insuredInfoRef.value', insuredInfoRef.value)
// await nextTick() // 👈 加这一行!
// const result = await insuredInfoRef.value[0].handleFormValues('insuredInfoRef')
// console.log('result', result)
// if (!result) return
// submitAppointmentObj.value.apiInsurantInfoDto = result
// }
// if (secondHolderInfoRef.value) {
// submitAppointmentObj.value.apiSecondHolderInfoDto =
// await secondHolderInfoRef.value[0].handleFormValues()
// if (!submitAppointmentObj.value.apiSecondHolderInfoDto) return
// }
if (policyHolderInfoRef.value) {
submitAppointmentObj.value.apiPolicyholderInfoDto =
policyHolderInfoRef.value[0].handleFormValues()
}
if (insuredInfoRef.value) {
submitAppointmentObj.value.apiInsurantInfoDto = insuredInfoRef.value[0].handleFormValues()
}
return
if (secondHolderInfoRef.value) {
submitAppointmentObj.value.apiSecondHolderInfoDto =
secondHolderInfoRef.value[0].handleFormValues()
}
if (beneficiaryInfoRef.value) {
submitAppointmentObj.value.apiBeneficiaryInfoDtoList =
beneficiaryInfoRef.value[0].handleFormValues()
submitAppointmentObj.value.apiBeneficiaryInfoFzDto =
await beneficiaryInfoRef.value[0].handleFormValues()
if (!submitAppointmentObj.value.apiBeneficiaryInfoFzDto) return
}
if (questionnairesInfoRef.value && questionnairesInfoRef.value[0].questionLength > 0) {
submitAppointmentObj.value.questionnairesDetailResponse =
await questionnairesInfoRef.value[0].handleFormValues()
if (!submitAppointmentObj.value.questionnairesDetailResponse) return
}
console.log('大提交', submitAppointmentObj.value)
return
// 代表新增预约
if (formStatus.value == 'appointmentAdd' && !idsObj.value.appointmentBizId) {
......@@ -1005,7 +1037,7 @@ watch(
//代表是新增预约状态
if (!idsObj.value.appointmentBizId) {
formStatus.value = 'appointmentAdd'
// getCustomerInfo(props.processDetail.customerBizId)
getCustomerInfo(props.processDetail.customerBizId)
tabsList.value = [
{
......@@ -1048,6 +1080,20 @@ watch(
id: 5,
status: '0',
key: 'secondHolderBizId'
},
{
label: '健康信息',
name: 'questionnaires',
id: 7,
status: '0',
key: 'questionnaireBizId'
},
{
label: '附件', //大提交的时候不用提交了,因为上传文件的时候已经入库了
name: 'accessories',
id: 10,
status: '0',
key: 'fnaBizId'
}
]
nextTick(() => {
......@@ -1306,6 +1352,7 @@ const showSubmitBtn = computed(() => {
return false
}
})
//刚进页面的编辑状态
if (route.query.appointmentNo && route.query.source == 'appointmentList') {
editStatus.value = true
} else if (route.query.source == 'policyList') {
......@@ -1315,7 +1362,6 @@ if (route.query.appointmentNo && route.query.source == 'appointmentList') {
} else if (route.query.source == 'fnaList' && !idsObj.value.appointmentBizId) {
editStatus.value = false
}
console.log('editStatus.value ', editStatus.value, idsObj.value)
onUnmounted(() => {
// 彻底重置所有响应式数据
......
<template>
<!-- v-if="processedBeneficiaryData.length > 0" -->
<div>
<div v-if="processedBeneficiaryData.length > 0">
<el-row>
<el-col :span="24">
<div class="topBtn">
<el-button
type="warning"
icon="DocumentAdd"
@click="addBeneficiary"
:disabled="editStatus"
>新增受益人</el-button
>
<el-button
v-if="props.showSubmitBtn"
type="primary"
icon="EditPen"
@click="handleEditStatus(!editStatus)"
style="margin-left: 10px"
>编辑</el-button
>
</div>
</el-col>
</el-row>
<el-form ref="beneficiaryInfoFormRef" :model="form" label-width="120px">
<div v-for="(level1, l1) in processedBeneficiaryData" :key="level1.id">
<el-row style="margin-bottom: 10px">
<div class="formBox">
<div class="level1Label">
<span>{{ level1.bigTitle }}-{{ l1 + 1 }}</span>
<el-icon
@click="deleteBeneficiary(l1, level1)"
v-if="level1.deleteIcon && processedBeneficiaryData.length > 1"
style="color: red; font-size: 18px; margin-left: 10px"
><Delete
/></el-icon>
</div>
<div v-for="(level2, l2) in level1.children" :key="level2.key">
<div class="fatherLable" v-if="level2.showMoudle">{{ level2.fatherTitle }}</div>
<el-row :gutter="20" v-if="level2.showMoudle">
<template v-for="child in level2.data" :key="child.key">
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div>
<!-- :rules="
child.required
? [
{
required: true,
message: `${child.label}不能为空`,
trigger: 'blur'
}
]
: []
" -->
<el-form-item
:label-width="child.labelWidth"
:label="child.label"
:prop="`apiBeneficiaryInfoDtoList.${l1}.${child.key}`"
:key="child.key"
:label-position="child.labelPosition"
:rules="getRules(child)"
<div ref="beneficiaryRef">
<CommonForm :showAnchor="false">
<template #form-right>
<el-form ref="beneficiaryInfoFormRef" :model="form" :rules="rules">
<el-row v-for="father in processedBeneficiaryData" style="margin-bottom: 10px">
<div class="formBox formFna">
<CardOne :title="father.fatherTitle" v-if="father.showMoudle">
<template #content>
<el-row v-if="!father.showTable" :gutter="20">
<template v-for="child in father.data" :key="child.key">
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div>
<el-form-item
:label="child.label"
:prop="child.key"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
>
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
:disabled="editStatus"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="form[child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(father, child)"
:disabled="editStatus"
>
<el-option
v-for="item in child.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
style="width: 100%"
v-if="child.domType === 'DatePicker'"
v-model="form[child.key]"
type="date"
:placeholder="child.placeholder"
:disabled="editStatus"
/>
<el-checkbox-group
v-if="child.domType === 'Checkbox'"
v-model="form[child.key]"
:disabled="editStatus"
>
<el-checkbox
v-for="item in child.options"
:key="item.value"
:label="item.value"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<el-select
v-model="form[child.key]"
v-if="child.domType === 'SearchSelect'"
filterable
remote
reserve-keyword
placeholder="请输入关键词搜索"
:remote-method="query => searchSelectList(query, child.key)"
:loading="searchLoadingStates[child.key]"
:disabled="editStatus"
@change="handleSearchSelectChange(child.key)"
>
<el-option
v-for="item in searchOptions[child.key] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</div>
</el-col>
</template>
</el-row>
<!-- 是表格数据 -->
<el-row v-if="father.showTable">
<el-col :span="24" v-if="father.addChildren">
<el-button
:disabled="editStatus"
type="primary"
icon="Plus"
size="small"
style="margin-bottom: 10px"
@click="addChildren(father)"
>{{ father.addChildrenTxt }}</el-button
>
</el-col>
<el-table :data="father.data" border v-if="father.data.length > 0">
<!-- 动态渲染列 -->
<el-table-column
v-for="column in father.columns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- @input="handleInputChange(father, child, l1)" -->
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="form['apiBeneficiaryInfoDtoList'][l1][child.key]"
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="form['apiBeneficiaryInfoDtoList'][l1][child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(child, l1, l2)"
:disabled="child.disabled"
>
<el-option
v-for="item in child.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
v-model="form['apiBeneficiaryInfoDtoList'][l1][child.key]"
style="width: 100%"
v-if="child.domType === 'DatePicker'"
type="date"
:placeholder="child.placeholder"
:disabled="child.disabled"
:disabled-date="disabledDate"
/>
<el-input
v-if="child.domType === 'arrowRight'"
v-model="form['apiBeneficiaryInfoDtoList'][l1][child.key]"
:placeholder="child.placeholder"
@click="handleFoucs(child, l1, level1)"
:suffix-icon="ArrowRight"
readonly
:disabled="child.disabled"
>
</el-input>
</el-form-item>
</div>
</el-col>
<template #default="scope">
<span v-if="column.type === 'text'">{{ scope.row[column.prop] }}</span>
</template>
</el-table-column>
<!-- 操作列(固定) -->
<el-table-column align="center" label="操作" width="150">
<template #default="scope">
<el-button
type="primary"
size="small"
@click="updateChildren(father, scope.row)"
>
修改
</el-button>
<el-button
type="danger"
size="small"
@click="deleteChildren(father, scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</template>
</el-row>
</CardOne>
</div>
</div>
</el-row>
</div>
<el-row v-if="props.showSubmitBtn">
<el-col>
<div class="tabButton">
<!-- <el-button
type="primary"
icon="RefreshRight"
@click="resetForm"
size="large"
:disabled="editStatus"
>重置</el-button
> -->
<el-button
type="primary"
icon="Check"
@click="submitForm"
size="large"
:disabled="editStatus"
>提交</el-button
>
</div>
</el-col>
</el-row>
</el-form>
<el-dialog title="联系人信息" v-model="openList" width="600px" append-to-body>
<div>
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="85px">
<el-form-item label="联系人姓名" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入姓名" @input="customerList" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" circle @click="customerList" />
<el-button type="info" icon="Refresh" circle @click="resetCustomerList" />
</el-form-item>
</el-row>
</el-form>
<div class="customerBox">
<div class="customerItem" v-for="item in tableData" :key="item.id">
<div class="top">
<div class="right">
<el-button type="primary" size="small" @click="handleExport(item)"
>导入联系人</el-button
</template>
</CommonForm>
<CommonDialog
:dialogTitle="dialogTitle"
confirmText="确定"
cancleText="关闭"
dialogWidth="70%"
:showClose="true"
:openDialog="dialogVisible"
@close="dialogVisible = false"
@confirm="dialogConfirm"
>
<div class="dialogBox">
<el-form :model="dialogForm" ref="dialogFormRef">
<el-row :gutter="20">
<template v-for="(child, dIndex) in addBeneficiaryForm">
<el-col :sm="child.sm" :lg="child.lg" class="formItem">
<el-form-item
:label="child.label"
:prop="child.key"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
:rules="getRules(child)"
>
</div>
</div>
<div class="bottom">
<div class="left">
<div class="infoItem">
<span>姓名:</span>
<span> {{ item.name || '暂无' }}</span>
</div>
<div class="infoItem">
<span>性别:</span>
<span>
<dict-tag :options="fetchDictData('sys_gender')" :value="item.gender"
/></span>
</div>
<div class="infoItem">
<span>年龄:</span>
<span> {{ item.age || '暂无' }}</span>
</div>
</div>
</div>
</div>
</div>
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="dialogForm[child.key]"
:placeholder="child.placeholder"
maxlength="30"
@blur="handleInputBlur(child)"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="dialogForm[child.key]"
:placeholder="child.placeholder"
>
<el-option
v-for="item in child.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
style="width: 100%"
v-if="child.domType === 'DatePicker'"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
v-model="dialogForm[child.key]"
type="date"
:placeholder="child.placeholder"
/>
<el-input
v-if="child.domType === 'arrowRight'"
v-model="dialogForm[child.key]"
:placeholder="child.placeholder"
@click="handleFoucs(child)"
:suffix-icon="ArrowRight"
readonly
:disabled="editStatus"
>
</el-input>
</el-form-item>
</el-col>
</template>
</el-row>
</el-form>
</div>
</el-dialog>
</CommonDialog>
</div>
<!-- <div v-else class="domEmpty" v-loading="loading"></div> -->
<Phone
@close="handleCloseDrawer"
:showDrawer="showPhoneDrawer"
......@@ -202,6 +239,11 @@
</div>
</template>
<script setup name="beneficiaryInfo">
import { getCustomerList, calculateFieldValue } from '@/api/sign/fna'
import CommonDialog from '@/components/commonDialog'
import CardOne from '@/components/formCard/cardOne'
import CommonForm from '@/views/components/commonForm'
import { validateEnglish } from '@/utils/validate'
import { ArrowRight } from '@element-plus/icons-vue'
import beneficiaryDomData from '@/formJson/beneficiary'
......@@ -210,7 +252,6 @@ import Phone from '@/views/components/phone'
import Address from '@/views/components/address'
import { watch, nextTick } from 'vue'
import { getCustomerList } from '@/api/sign/fna'
import { updatePolicyBeneficiary, delPolicyBeneficiary } from '@/api/sign/underwritingMain'
import { editBeneficiaryInfo, delBeneficiary } from '@/api/sign/appointment'
import useDictStore from '@/store/modules/dict'
......@@ -225,7 +266,11 @@ const props = defineProps({
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) }, //客户详情回显表单用
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
pageSource: { type: String, default: false } //页面来源
pageSource: { type: String, default: false }, //页面来源
fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: true }, //编辑状态
tabIndex: { type: [String, Number], default: '' } //tab索引
})
const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess'])
const { proxy } = getCurrentInstance()
......@@ -237,7 +282,7 @@ const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const tempSaveKey = ref({}) // 用于tab切换的时候保存一份临时的值,防止切换的时候数据丢失
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
// const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const phoneOraddressKey = ref([]) // 存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
......@@ -301,6 +346,10 @@ const tempAddressQuickList = ref([])
const tempPhoneQuickList = ref([])
const personalObj = ref({}) //存储个人key
const companyObj = ref({}) //存储公司key
const dialogVisible = ref(false) //新增受益人弹窗
const addBeneficiaryForm = ref([]) //新增受益人表单
const dialogTitle = ref('') //新增受益人弹窗标题
const dialogKey = ref('') //新增受益人弹窗标题
const deleteKeyList = ref([
'objType',
'mailingAddress',
......@@ -319,6 +368,7 @@ const data = reactive({
tempBeneficiaryDomData: [], //保存旧的表单Dom,便于撤销操作
oldAppointmentData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
dialogForm: {},
queryParams: {
pageNo: 1,
pageSize: 4,
......@@ -332,8 +382,108 @@ const {
queryParams,
oldAppointmentData,
tempBeneficiaryForm,
tempBeneficiaryDomData
tempBeneficiaryDomData,
dialogForm
} = toRefs(data)
const deleteChildren = (father, index) => {
if (father.key == 'apiBeneficiaryInfoDtoList') {
father.data.splice(index, 1)
proxy.$message.success('受益人删除成功')
}
}
const updateChildren = (father, row) => {
dialogForm.value = JSON.parse(JSON.stringify(row))
if (father.key == 'apiBeneficiaryInfoDtoList') {
dialogTitle.value = '修改受益人'
dialogKey.value = 'apiBeneficiaryInfoDtoList'
addBeneficiaryForm.value = JSON.parse(JSON.stringify(father.formItem))
}
dialogVisible.value = true
}
const dialogConfirm = () => {
let newDOM = JSON.parse(JSON.stringify(processedBeneficiaryData.value))
proxy.$refs['dialogFormRef'].validate((valid, fields) => {
if (valid) {
for (const section of newDOM) {
if (section.key == dialogKey.value) {
// 处理下拉值得显示
for (const child of section.formItem) {
if (child.domType == 'Select' && dialogForm.value[child.key]) {
child.options.forEach(item => {
if (item.value == dialogForm.value[child.key]) {
dialogForm.value[child.key + 'Name'] = item.label
}
})
}
}
let index = section.data.findIndex(item => item.id == dialogForm.value.id)
if (index == -1) {
section.data.push(dialogForm.value)
} else {
section.data[index] = JSON.parse(JSON.stringify(dialogForm.value))
}
}
}
processedBeneficiaryData.value = newDOM
dialogVisible.value = false
dialogForm.value = {}
}
})
}
// 添加表单子级dom
const addChildren = father => {
if (props.editStatus) {
proxy.$message.warning('请先点击编辑')
return
}
dialogForm.value = { id: Date.now() + Math.floor(Math.random()) }
if (father.key == 'apiBeneficiaryInfoDtoList') {
dialogTitle.value = '新增受益人'
dialogKey.value = 'apiBeneficiaryInfoDtoList'
addBeneficiaryForm.value = JSON.parse(JSON.stringify(father.formItem))
dialogVisible.value = true
}
}
const handleInputBlur = child => {
if (dialogForm.value['documentType'] == 'idCard' && child.key == 'idNumber') {
getFieldValue(child.key)
} else if (child.key == 'nameCn' && dialogForm.value['nameCn']) {
getFieldValue(child.key)
}
}
const getFieldValue = key => {
let obj = {}
if (dialogForm.value['documentType'] == 'idCard' && key == 'idNumber') {
obj = {
calculateType: 6,
requestValue: dialogForm.value['idNumber']
}
} else if (key == 'nameCn') {
obj = {
calculateType: 1,
requestValue: dialogForm.value['nameCn']
}
}
calculateFieldValue(obj).then(res => {
if (res.code == 200) {
res.data.forEach(item => {
if (obj.calculateType == 6) {
if (item.calculateType == 2) {
dialogForm.value['gender'] = item.responseKey
} else if (item.calculateType == 3) {
dialogForm.value['birthday'] = item.requestValue
} else if (item.calculateType == 4) {
dialogForm.value['age'] = item.requestValue
}
} else if (obj.calculateType == 1) {
dialogForm.value['namePyEn'] = item.responseValue
}
})
}
})
}
// 获取表单项的校验规则
const getRules = child => {
const rules = []
......@@ -347,80 +497,12 @@ const getRules = child => {
})
}
// 为英文姓名添加自定义校验
if (child.key === 'nameEn') {
rules.push({
validator: validateEnglish,
trigger: 'change'
})
}
return rules
}
// 新增受益人
const addBeneficiary = () => {
let oneMoudle = JSON.parse(JSON.stringify(processedBeneficiaryData.value[0]))
oneMoudle.id = Date.now() + Math.floor(Math.random() * 1000) //唯一标识,用于删除
processedBeneficiaryData.value.push(oneMoudle)
form.value.apiBeneficiaryInfoDtoList.push({ id: oneMoudle.id })
}
// 删除受益人
const deleteBeneficiary = (l1, level1) => {
console.log('====================================')
console.log('l1', form.value.apiBeneficiaryInfoDtoList[l1])
console.log('====================================')
if (editStatus.value) {
proxy.$modal.confirm(`编辑状态下才能删除`, { showCancel: '0', title: '填写提示' })
return
}
if (processedBeneficiaryData.value.length == 1) {
proxy.$modal.confirm(`至少保留一个受益人`, { showCancel: '0', title: '填写提示' })
return
}
if (
level1.beneficiaryBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
delBeneficiary(level1.beneficiaryBizId).then(res => {
if (res.code == 200) {
proxy.$message.success('预约-受益人删除成功')
processedBeneficiaryData.value.splice(l1, 1)
form.value.apiBeneficiaryInfoDtoList.splice(l1, 1)
emit('handleSuccessEdit')
}
})
} else if (
form.value.apiBeneficiaryInfoDtoList[l1].policyBeneficiaryBizId &&
props.pageSource == 'policyList'
) {
delPolicyBeneficiary(form.value.apiBeneficiaryInfoDtoList[l1].policyBeneficiaryBizId).then(
res => {
if (res.code == 200) {
proxy.$message.success('新单跟进-受益人删除成功')
processedBeneficiaryData.value.splice(l1, 1)
form.value.apiBeneficiaryInfoDtoList.splice(l1, 1)
emit('policyEditSuccess')
}
}
)
} else {
proxy.$message.success('受益人删除成功')
processedBeneficiaryData.value.splice(l1, 1)
form.value.apiBeneficiaryInfoDtoList.splice(l1, 1)
}
}
const disabledDate = time => {
return time.getTime() > Date.now()
}
const exportInfo = () => {
if (props.customerBizId && editStatus.value) {
proxy.$modal.confirm(`请先点击编辑在导入客户信息`, { showCancel: '0', title: '填写提示' })
return
}
openList.value = true
customerList()
}
const customerList = () => {
console.log('触发了')
......@@ -477,29 +559,23 @@ const fetchDictData = dictType => {
const processFormData = async obj => {
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(obj.domdata))
for (const item of processedData) {
if (tempBeneficiaryDomData.value.length == 0) {
form.value.apiBeneficiaryInfoDtoList.push({ id: item.id })
for (const section of processedData) {
if (section.data) {
for (const field of section.data) {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
}
}
}
if (item.children) {
for (const section of item.children) {
if (section.data) {
for (const field of section.data) {
if (section.key == 'customer' || section.key == 'other') {
personalObj.value[field.key] = field.key
companyObj.value[field.key] = field.key
}
// 收集key,区分个人和企业
if (section.key == 'person') {
personalObj.value[field.key] = field.key
} else if (section.key == 'company') {
companyObj.value[field.key] = field.key
}
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
}
}
if (section.formItem) {
for (const field of section.formItem) {
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
}
}
}
......@@ -517,50 +593,46 @@ const processFormData = async obj => {
} else {
processedBeneficiaryData.value = oldAppointmentData.value = processedData
}
if (props.showSubmitBtn) {
editStatus.value = true
} else {
editStatus.value = false
// processedBeneficiaryData.value = oldAppointmentData.value = processedData
}
// if (props.showSubmitBtn) {
// } else {
// processedBeneficiaryData.value = oldAppointmentData.value = processedData
// }
}
//弹出右侧抽屉
const handleFoucs = (child, l1, level1) => {
if (child.disabled) return
child.l1 = l1
child.id = level1.id
drawerInfo.value = JSON.parse(JSON.stringify(child))
console.log('drawerInfo', drawerInfo.value)
switch (child.drawerType) {
case 'phone':
phoneMenuList.value[0].key = child.code
phoneMenuList.value[1].key = child.key
phoneMenuList.value.forEach(item => {
item.value = ''
})
let phoneString = form.value.apiBeneficiaryInfoDtoList[l1][child.key]
if (phoneString) {
phoneMenuList.value[0].value = phoneString.split(' ')[0]
phoneMenuList.value[1].value = phoneString.split(' ')[1]
}
showPhoneDrawer.value = true
break
case 'address':
addressMenuList.value.forEach(item => {
item.value = ''
phoneOraddressKey.value.forEach(item1 => {
if (item1.id == level1.id && item1.type == child.key) {
for (const key in item1) {
if (item.key == key) {
item.value = item1[key]
}
}
}
})
})
showAddressDrawer.value = true
break
// case 'phone':
// phoneMenuList.value[0].key = child.code
// phoneMenuList.value[1].key = child.key
// phoneMenuList.value.forEach(item => {
// item.value = ''
// })
// let phoneString = form.value.apiBeneficiaryInfoDtoList[l1][child.key]
// if (phoneString) {
// phoneMenuList.value[0].value = phoneString.split(' ')[0]
// phoneMenuList.value[1].value = phoneString.split(' ')[1]
// }
// showPhoneDrawer.value = true
// break
// case 'address':
// addressMenuList.value.forEach(item => {
// item.value = ''
// phoneOraddressKey.value.forEach(item1 => {
// if (item1.id == level1.id && item1.type == child.key) {
// for (const key in item1) {
// if (item.key == key) {
// item.value = item1[key]
// }
// }
// }
// })
// })
// showAddressDrawer.value = true
// break
case 'country':
showCountryDrawer.value = true
break
......@@ -651,7 +723,7 @@ const confirmDrawer = info => {
break
case 'country':
// info.objType = drawerInfo.value.drawerType
// form.value[drawerInfo.value.key] = info.name
dialogForm.value[drawerInfo.value.key] = info.name
// saveKey.value[drawerInfo.value.key] = info
break
default:
......@@ -692,85 +764,15 @@ const resetShow = obj => {
break
}
}
console.log('更新', processedBeneficiaryData.value)
}
const handleSelectChange = (child, l1, l2) => {
let customerType = form.value['apiBeneficiaryInfoDtoList'][l1]['customerType']
let insurantRel = form.value['apiBeneficiaryInfoDtoList'][l1]['insurantRel']
const handleSelectChange = (father, child) => {
switch (child.key) {
case 'customerType':
const newDOM = JSON.parse(JSON.stringify(processedBeneficiaryData.value))
//这里存在一个对index得问题,暂不解决先放在这
for (const section of newDOM[l1].children) {
if (
(customerType == 'COMPANY' || customerType == 'INDIVIDUAL') &&
insurantRel &&
insurantRel == 'MYSELF' &&
section.key == 'customer'
) {
section.showMoudle = true
} else if (customerType == 'COMPANY' && insurantRel && insurantRel !== 'MYSELF') {
if (section.key == 'person') {
section.showMoudle = false
} else {
section.showMoudle = true
}
} else if (customerType == 'INDIVIDUAL' && insurantRel && insurantRel !== 'MYSELF') {
if (section.key == 'company') {
section.showMoudle = false
} else {
section.showMoudle = true
}
} else if (customerType == 'COMPANY' && !insurantRel) {
if (section.key == 'company') {
section.showMoudle = true
} else if (section.key == 'person') {
section.showMoudle = false
}
} else if (customerType == 'INDIVIDUAL' && !insurantRel) {
if (section.key == 'company') {
section.showMoudle = false
} else if (section.key == 'person') {
section.showMoudle = true
}
}
}
processedBeneficiaryData.value = newDOM
break
case 'insurantRel':
const newDOM1 = JSON.parse(JSON.stringify(processedBeneficiaryData.value))
for (const child of newDOM1[l1].children) {
if (insurantRel == 'MYSELF') {
if (child.key == 'customer') {
child.showMoudle = true
} else {
child.showMoudle = false
}
} else {
if (customerType == 'COMPANY') {
if (child.key == 'company') {
child.showMoudle = true
} else if (child.key == 'person') {
child.showMoudle = false
}
} else {
if (child.key == 'company') {
child.showMoudle = false
} else {
child.showMoudle = true
}
}
}
}
processedBeneficiaryData.value = newDOM1
break
case 'smokingAllowed':
// 选择吸烟,展示吸烟数量
if (form.value[child.key] == '1') {
resetShow({ type: 'child', key: 'smokingVolume', status: true })
case 'isLegalBeneficiary':
if (form.value[child.key] == '0') {
resetShow({ type: 'father', key: 'apiBeneficiaryInfoDtoList', status: true })
} else {
resetShow({ type: 'child', key: 'smokingVolume', status: false })
resetShow({ type: 'father', key: 'apiBeneficiaryInfoDtoList', status: false })
}
break
......@@ -965,139 +967,37 @@ const getInvalidFields = fields => {
// 处理表单填写得数据
const handleFormValues = () => {
//提交的时候记得填写区号的电话,把相对应的区号字段加上
//地址相关的还没处理
return new Promise(async resolve => {
let submitObj = { ...form.value }
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理
let submitForm = []
let result = {}
if (props.activeName == 'beneficiary') {
result = JSON.parse(JSON.stringify(form.value))
} else {
result = JSON.parse(JSON.stringify(tempBeneficiaryForm.value))
}
const pattern = /Time$/ // 以Time结尾
for (const section of result['apiBeneficiaryInfoDtoList']) {
let submitObj = {}
if (
props.pageSource == 'policyList' &&
props.idsObj.policyBizId &&
section.policyBeneficiaryBizId
) {
submitObj['policyBeneficiaryBizId'] = section.policyBeneficiaryBizId
submitObj['policyBizId'] = section.policyBizId
}
if (phoneOraddressKey.value.length > 0) {
submitObj.addressList = []
}
for (const key in section) {
if (pattern.test(key) && section[key]) {
section[key] = proxy.formatToDateTime(section[key])
}
//客户类型为个人的时候
if (section['customerType'] == 'INDIVIDUAL' && section[key]) {
for (const key1 in personalObj.value) {
if (key == key1) {
submitObj[key1] = section[key]
proxy.$refs['beneficiaryInfoFormRef'].validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
//处理表单数据
processedBeneficiaryData.value.forEach(item => {
if (item.keyType == 'Array') {
submitObj[item.key] = item.data
}
}
}
// 客户类型为公司的时候
if (section['customerType'] == 'COMPANY' && section[key]) {
for (const key2 in companyObj.value) {
if (key == key2) {
submitObj[key2] = section[key]
}
}
}
}
if (submitObj['companyMobile']) {
submitObj['companyMobileCode'] = submitObj['companyMobile'].split(' ')[0]
submitObj['companyMobile'] = submitObj['companyMobile'].split(' ')[1]
}
if (submitObj['mobile']) {
submitObj['mobileCode'] = submitObj['mobile'].split(' ')[0]
submitObj['mobile'] = submitObj['mobile'].split(' ')[1]
}
if (submitObj['authMobile']) {
submitObj['authMobileCode'] = submitObj['authMobile'].split(' ')[0]
submitObj['authMobile'] = submitObj['authMobile'].split(' ')[1]
}
phoneOraddressKey.value.forEach(item => {
if (item.drawerType == 'address' && item.id === section.id) {
submitObj.addressList.push({
type: item.type,
location: item.location,
street: item.street,
city: item.city,
region: item.region
})
}
})
deleteKeyList.value.forEach(item => {
delete submitObj[item]
})
submitForm.push(submitObj)
// if (Object.keys(submitObj).length > 0) {
// submitForm.push(submitObj)
// }
}
console.log('====================================')
console.log('提交受益人', submitForm)
console.log('====================================')
// 删除多余字段
return submitForm
}
// 表单提交
const submitForm = () => {
proxy.$refs['beneficiaryInfoFormRef'].validate((valid, fields) => {
if (valid) {
let submitObj = handleFormValues()
// return
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editBeneficiaryInfo({
appointmentBizId: props.idsObj.appointmentBizId,
apiBeneficiaryInfoDtoList: submitObj
}).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('受益人修改成功')
emit('handleSuccessEdit')
}
})
}
if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
updatePolicyBeneficiary({
policyBizId: props.idsObj.policyBizId,
policyBeneficiaryList: submitObj
}).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('新单跟进-受益人修改成功')
emit('policyEditSuccess')
}
})
}
errorFields.value = [] // 清空错误信息
} else {
// 获取校验失败的字段信息
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
}
})
})
}
const resetForm = () => {
proxy.$modal
.confirm('是否确认撤销所作操作?')
......@@ -1127,18 +1027,15 @@ watch(
if (newVal === 'beneficiary') {
openList.value = false
setTimeout(() => {
// 修改状态
if (props.showSubmitBtn) {
setFormValue()
} else {
// 新增状态
processFormData({
domdata: beneficiaryDomData,
exportValue: null
})
}
}, 500)
if (props.showSubmitBtn) {
setFormValue()
} else {
// 新增状态
processFormData({
domdata: beneficiaryDomData,
exportValue: null
})
}
}
}
)
......
<template>
<div>
<div v-if="questionnairesDom.length > 0">
<el-row>
<el-col :span="24">
<div class="topBtn">
<!-- <el-button type="warning" icon="DocumentAdd" @click="exportInfo" v-if="showContacts"
>导入联系人</el-button
> -->
<el-button
v-if="props.idsObj.appointmentBizId"
type="primary"
icon="EditPen"
@click="handleEditStatus(!editStatus)"
>编辑</el-button
<div v-if="questionnairesDom.length > 0" ref="questionRef">
<CommonForm
:anchorList="anchorList"
:affixOffset="affixOffset"
:anchorOffset="10"
:scrollContainerSelector="anchorContainer"
:scrollOffset="10"
:domIndex="tabIndex"
:activeName="activeName"
v-if="questionRef"
>
<template #form-right>
<el-form ref="heathFormRef" :model="form" :rules="rules">
<div
v-for="(level1, l1) in questionnairesDom"
:key="level1.firstCategory"
:id="level1.firstCategory"
>
</div>
</el-col>
</el-row>
<el-form ref="heathFormRef" :model="form" :rules="rules">
<div v-for="(level1, l1) in questionnairesDom" :key="level1.firstCategory">
<el-row style="margin-bottom: 10px">
<div class="formBox">
<div class="fatherLable">
<span>{{ level1.firstCategoryName }}</span>
<div class="openCon" v-if="level1.showIcon" @click="changeOpenStatus(level1)">
<el-icon v-if="!level1.showMoudle"><Hide /></el-icon>
<el-icon v-else><View /></el-icon>
</div>
</div>
<el-row :gutter="20" v-if="level1.showMoudle">
<template
v-for="(level2, l2) in level1.secondCategoryDtoList"
:key="level2.secondCategory"
>
<el-col :sm="level2.sm" :lg="level2.lg" class="formItem">
<div class="level2Title">
{{ level2.secondCategoryName }}
</div>
<div>
<div class="level2Content" v-for="(level3, l3) in level2.questionsDtoList">
<div
class="level2Left"
v-if="level2.secondCategory !== 'MEDICAL_CONDITION'"
<el-row style="margin-bottom: 10px">
<div class="formBox">
<CardOne :title="level1.firstCategoryName">
<template #content>
<el-row :gutter="20" v-if="level1.showMoudle">
<template
v-for="(level2, l2) in level1.secondCategoryDtoList"
:key="level2.secondCategory"
>
{{ l3 + 1 }}/{{ level2.questionsDtoList.length }}
</div>
<div class="level2Right">
<div
class="level3Title"
v-if="level2.secondCategory !== 'MEDICAL_CONDITION'"
>
{{ level3.text }}
</div>
<div
class="level3Content"
v-if="level2.secondCategory !== 'MEDICAL_CONDITION'"
>
<!-- 回显得时候拿不到optionBizId -->
<el-radio-group
v-model="
form[l1]['secondCategoryDtoList'][l2]['questionsDtoList'][l3][
'answerSessionsDto'
]['optionBizId']
"
@change="handleRadioChange(l1, l2, l3, level3)"
:disabled="editStatus"
>
<el-radio
v-for="dict in level3.optionsDtoList"
:key="dict.optionBizId"
:value="dict.optionBizId"
>{{ dict.text }}</el-radio
<el-col :sm="level2.sm" :lg="level2.lg" class="formItem">
<div class="level2Title">
{{ level2.secondCategoryName }}
</div>
<div>
<div
class="level2Content"
v-for="(level3, l3) in level2.questionsDtoList"
>
</el-radio-group>
<!--选择是才展示附加条件 -->
<div
v-if="
form[l1]['secondCategoryDtoList'][l2]['questionsDtoList'][l3][
'answerSessionsDto'
]['optionBizId'] == 'option_1002'
"
style="width: 100%"
>
<!-- 附加问题 -->
<div v-for="(level4, l4) in level3.addQuestionsDtoList">
<el-form-item
label-position="top"
:key="level4.addQuestionsBizId"
:label="level4.text"
:rules="
level4.isRequired
? [
{
required: true,
message: `${level4.text}不能为空`,
trigger: 'blur'
}
]
: []
"
<div
class="level2Left"
v-if="level2.secondCategory !== 'MEDICAL_CONDITION'"
>
<div class="level4Content">
<el-input
v-if="level4.type === 'TEXT'"
:type="level4.type"
{{ l3 + 1 }}/{{ level2.questionsDtoList.length }}
</div>
<div class="level2Right">
<div
class="level3Title"
v-if="level2.secondCategory !== 'MEDICAL_CONDITION'"
>
{{ level3.text }}
</div>
<div
class="level3Content"
v-if="level2.secondCategory !== 'MEDICAL_CONDITION'"
>
<el-radio-group
v-model="
form[l1]['secondCategoryDtoList'][l2]['questionsDtoList'][
l3
]['addQuestionsDtoList'][l4]['content']
]['answerSessionsDto']['optionBizId']
"
placeholder="请输入"
maxlength="30"
style="width: 50%"
@change="handleRadioChange(l1, l2, l3, level3)"
:disabled="editStatus"
/>
<el-date-picker
style="width: 50%"
v-if="level4.type === 'DATE'"
:disabled="editStatus"
v-model="
>
<el-radio
v-for="dict in level3.optionsDtoList"
:key="dict.optionBizId"
:value="dict.optionBizId"
>{{ dict.text }}</el-radio
>
</el-radio-group>
<!--选择是才展示附加条件 -->
<div
v-if="
form[l1]['secondCategoryDtoList'][l2]['questionsDtoList'][
l3
]['addQuestionsDtoList'][l4]['content']
]['answerSessionsDto']['optionBizId'] == 'option_1002'
"
type="date"
placeholder="请输入"
:disabled-date="disabledDate"
@change="handleDateChange(l1, l2, l3, l4)"
/>
style="width: 100%"
>
<!-- 附加问题 -->
<div v-for="(level4, l4) in level3.addQuestionsDtoList">
<el-form-item
label-position="top"
:key="level4.addQuestionsBizId"
:label="level4.text"
:rules="
level4.isRequired
? [
{
required: true,
message: `${level4.text}不能为空`,
trigger: 'blur'
}
]
: []
"
>
<div class="level4Content">
<el-input
v-if="level4.type === 'TEXT'"
:type="level4.type"
v-model="
form[l1]['secondCategoryDtoList'][l2][
'questionsDtoList'
][l3]['addQuestionsDtoList'][l4]['content']
"
placeholder="请输入"
maxlength="30"
style="width: 50%"
:disabled="editStatus"
/>
<el-date-picker
style="width: 50%"
v-if="level4.type === 'DATE'"
:disabled="editStatus"
v-model="
form[l1]['secondCategoryDtoList'][l2][
'questionsDtoList'
][l3]['addQuestionsDtoList'][l4]['content']
"
type="date"
placeholder="请输入"
:disabled-date="disabledDate"
@change="handleDateChange(l1, l2, l3, l4)"
/>
</div>
</el-form-item>
</div>
</div>
</div>
</el-form-item>
</div>
</div>
</div>
<div v-if="level2.secondCategory == 'MEDICAL_CONDITION'">
<div
v-for="(question, q4) in level3.answerSessionsDto
.questionTextJsonDtoList"
style="margin-bottom: 10px"
>
<div class="questionContent">
<div class="questionTitle">{{ `${question.title}${q4 + 1}` }}</div>
<el-input
type="text"
:disabled="editStatus"
v-model="
form[l1]['secondCategoryDtoList'][l2]['questionsDtoList'][l3][
'answerSessionsDto'
]['questionTextJsonDtoList'][q4]['content']
"
placeholder="请输入"
maxlength="300"
style="width: 70%"
/>
<el-icon class="deleteIcon" @click="deleteMedical(l1, l2, l3, q4)"
><Remove
/></el-icon>
<div v-if="level2.secondCategory == 'MEDICAL_CONDITION'">
<el-button
style="margin-bottom: 10px"
class="addBtn"
type="primary"
:icon="Plus"
size="small"
@click="addMedical(l1, l2, l3)"
:disabled="editStatus"
>继续添加</el-button
>
<div
v-for="(question, q4) in level3.answerSessionsDto
.questionTextJsonDtoList"
style="margin-bottom: 10px"
>
<div class="questionContent">
<div class="questionTitle">
{{ `${question.title}${q4 + 1}` }}
</div>
<el-input
type="text"
:disabled="editStatus"
v-model="
form[l1]['secondCategoryDtoList'][l2][
'questionsDtoList'
][l3]['answerSessionsDto']['questionTextJsonDtoList'][
q4
]['content']
"
placeholder="请输入"
maxlength="300"
style="width: 70%"
/>
<el-icon
class="deleteIcon"
@click="deleteMedical(l1, l2, l3, q4)"
><Remove
/></el-icon>
</div>
</div>
</div>
</div>
</div>
</div>
<el-button
class="addBtn"
type="primary"
:icon="Plus"
size="small"
@click="addMedical(l1, l2, l3)"
:disabled="editStatus"
>继续添加</el-button
>
</div>
</div>
</div>
</div>
</el-col>
</template>
</el-col>
</template>
</el-row>
</template>
</CardOne>
</div>
</el-row>
</div>
</el-row>
</div>
<el-row>
<el-col>
<div class="tabButton">
<!-- <el-button
type="primary"
icon="RefreshRight"
@click="resetForm"
size="large"
:disabled="editStatus"
>重置</el-button
> -->
<el-button
type="primary"
icon="Check"
@click="submitForm"
:disabled="editStatus"
size="large"
>提交</el-button
>
</div>
</el-col>
</el-row>
</el-form>
<!-- <el-row>
<el-col>
<div class="tabButton">
<el-button
type="primary"
icon="Check"
@click="submitForm"
:disabled="editStatus"
size="large"
>提交</el-button
>
</div>
</el-col>
</el-row> -->
</el-form>
</template>
</CommonForm>
</div>
<div v-else class="domEmpty" v-loading="loading"></div>
</div>
</template>
<script setup name="secondHolderInfo">
import { Plus } from '@element-plus/icons-vue'
import CommonForm from '@/views/components/commonForm'
import CardOne from '@/components/formCard/cardOne'
import { watch } from 'vue'
import { getQuestionnaires, saveQuestionnaires } from '@/api/sign/appointment'
import useDictStore from '@/store/modules/dict'
......@@ -216,28 +215,34 @@ import useDictStore from '@/store/modules/dict'
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
editStatus: {
type: Boolean,
default: false
}, //父组件状态,新增、修改
formStatus: { type: String, default: '' }, //父组件状态,新增、修改
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) },
//客户详情回显表单用
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
foldInsurantInfo: { type: Boolean, default: false }, //是否隐藏受保人信息
pageSource: { type: String, default: '' } //页面来源
pageSource: { type: String, default: '' }, //页面来源
anchorContainer: { type: String, default: '' }, //锚点滚动容器
tabIndex: { type: [String, Number], default: '' }, //tab索引
affixOffset: { type: Number, default: 250 } //锚点吸顶距离
})
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
const loading = ref(false)
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const questionRef = ref(null)
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const showInsurant = ref(false) //是否显示受保人信息
const questionnairesDom = ref([])
const data = reactive({
form: [],
tempSecondHolderForm: [], //由于切换tab的时候,表单数据会重置,所以需要
questionnairesDom: [], // 处理后的表单数据
// questionnairesDom: [], // 处理后的表单数据
oldAppointmentData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
queryParams: {
......@@ -246,8 +251,7 @@ const data = reactive({
name: undefined
}
})
const { form, rules, questionnairesDom, queryParams, oldAppointmentData, tempSecondHolderForm } =
toRefs(data)
const { form, rules, queryParams, oldAppointmentData, tempSecondHolderForm } = toRefs(data)
const changeOpenStatus = level1 => {
console.log('level1', level1)
let newDom = JSON.parse(JSON.stringify(questionnairesDom.value))
......@@ -267,7 +271,7 @@ const addMedical = (l1, l2, l3) => {
})
}
const deleteMedical = (l1, l2, l3, index) => {
if (editStatus.value) {
if (props.editStatus) {
proxy.$modal.confirm(`请先点击编辑在删除病况`, { showCancel: '0', title: '填写提示' })
return
}
......@@ -304,9 +308,7 @@ const handleRadioChange = (l1, l2, l3, level3) => {
})
}
}
console.log('====================================')
console.log('answer', answer)
console.log('====================================')
let optionItem = level3.optionsDtoList.filter(item => item.optionBizId === answer.optionBizId)
let newObj = {
......@@ -380,61 +382,77 @@ const getInvalidFields = fields => {
// 处理表单填写得数据
const handleFormValues = () => {
let submitObj = []
if (props.activeName == 'questionnaires') {
submitObj = JSON.parse(JSON.stringify(form.value))
console.log('1111', submitObj)
} else {
// submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
// console.log('2222', submitObj)
}
return new Promise(async resolve => {
proxy.$refs['heathFormRef'].validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
let submitObj = []
if (props.activeName == 'questionnaires') {
submitObj = JSON.parse(JSON.stringify(form.value))
console.log('1111', submitObj)
} else {
// submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
// console.log('2222', submitObj)
}
let answerSessionsDtoList = []
// 处理表单数据
submitObj.forEach(level1 => {
level1.secondCategoryDtoList.forEach(level2 => {
// 修正:应该是 questionsDtoList 而不是 questionDtoList
if (level2.questionsDtoList && level2.questionsDtoList.length > 0) {
level2.questionsDtoList.forEach(level3 => {
// 检查是否有答案数据和附加问题
//
if (level3.answerSessionsDto) {
// 问题选择了是
if (
level3.answerSessionsDto.optionJsonDtoList &&
level3.answerSessionsDto.optionBizId &&
level3.answerSessionsDto.optionBizId == 'option_1002'
) {
level3.answerSessionsDto.optionJsonDtoList.forEach(level4 => {
level4.addQuestionsJsonDtoList = JSON.parse(
JSON.stringify(level3.addQuestionsDtoList)
)
let answerSessionsDtoList = []
// 处理表单数据
submitObj.forEach(level1 => {
level1.secondCategoryDtoList.forEach(level2 => {
// 修正:应该是 questionsDtoList 而不是 questionDtoList
if (level2.questionsDtoList && level2.questionsDtoList.length > 0) {
level2.questionsDtoList.forEach(level3 => {
// 检查是否有答案数据和附加问题
//
if (level3.answerSessionsDto) {
// 问题选择了是
if (
level3.answerSessionsDto.optionJsonDtoList &&
level3.answerSessionsDto.optionBizId &&
level3.answerSessionsDto.optionBizId == 'option_1002'
) {
level3.answerSessionsDto.optionJsonDtoList.forEach(level4 => {
level4.addQuestionsJsonDtoList = JSON.parse(
JSON.stringify(level3.addQuestionsDtoList)
)
})
}
answerSessionsDtoList.push({
questionBizId: level3.questionBizId,
...level3.answerSessionsDto
})
}
})
}
answerSessionsDtoList.push({
questionBizId: level3.questionBizId,
...level3.answerSessionsDto
})
}
})
})
let objectBizId = ''
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
objectBizId = props.idsObj.appointmentBizId
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
objectBizId = props.idsObj.policyBizId
}
resolve(
errorFields.value.length == 0
? {
questionnaireBizId: 'questionnaires_1001',
objectBizId: objectBizId,
answerSessionsDtoList
}
: null
)
} else {
// 获取校验失败的字段信息
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
}
})
})
let objectBizId = ''
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
objectBizId = props.idsObj.appointmentBizId
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
objectBizId = props.idsObj.policyBizId
}
return {
questionnaireBizId: 'questionnaires_1001',
objectBizId: objectBizId,
answerSessionsDtoList
}
}
// 表单提交
const submitForm = () => {
......@@ -449,16 +467,6 @@ const submitForm = () => {
getQuestionnairesInfo()
}
})
// if (props.idsObj.appointmentBizId || props.idsObj.policyBizId) {
// saveQuestionnaires(submitObj).then(res => {
// if (res.code == 200) {
// handleEditStatus(true)
// proxy.$message.success('健康信息修改成功')
// emit('handleSuccessEdit')
// getQuestionnairesInfo()
// }
// })
// }
errorFields.value = [] // 清空错误信息
} else {
......@@ -506,7 +514,7 @@ const getQuestionnairesInfo = () => {
level1.showMoudle = true
} else if (level1.firstCategory == 'INSURED_PERSON') {
level1.showIcon = true
level1.showMoudle = false
level1.showMoudle = true
}
level1.secondCategoryDtoList.forEach((level2, l2) => {
level2.sm = 24
......@@ -581,10 +589,19 @@ const getQuestionnairesInfo = () => {
questionnairesDom.value = form.value = result
loading.value = false
console.log('questionnairesDom.value', questionnairesDom.value)
}
})
}
const anchorList = computed(() => {
let data = []
for (const section of questionnairesDom.value) {
if (section.showMoudle) {
data.push({ title: section.firstCategory, name: section.firstCategoryName })
}
}
return data
})
watch(
() => props.activeName,
newVal => {
......@@ -596,9 +613,7 @@ watch(
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editStatus.value = true
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
editStatus.value = true
}
getQuestionnairesInfo()
console.log('foldInsurantInfo', props.foldInsurantInfo)
......@@ -609,7 +624,11 @@ watch(
// 暴露给父组件
defineExpose({
handleFormValues,
handleEditStatus
handleEditStatus,
questionLength: computed(() => {
return questionnairesDom.value.length
})
})
</script>
<style lang="scss" scoped>
......@@ -663,6 +682,7 @@ defineExpose({
.level2Left {
margin-right: 15px;
margin-top: 3px;
color: #0052d9;
}
.level2Right {
width: calc(100% - 30px);
......
<template>
<!-- 只画好了样式具体的逻辑还没处理 -->
<div v-if="processedProductData.length > 0">
<!-- v-if="processedProductData.length > 0" -->
<div>
<div ref="productRef">
<CommonForm
:anchorList="anchorList"
......@@ -87,7 +87,7 @@
:remote-method="query => searchSelectList(query, child.key)"
:loading="searchLoadingStates[child.key]"
:disabled="editStatus"
@change="handleSearchSelectChange(father, child)"
@change="handleSearchSelectChange(child.key)"
>
<el-option
v-for="item in searchOptions[child.key] || []"
......@@ -115,18 +115,38 @@
>
</el-col>
<el-table :data="father.data" border v-if="father.data.length > 0">
<template v-if="father.key == 'apiProductPlanAdditionalInfoDtoList'">
<el-table-column label="姓名" prop="realName" align="center" />
<el-table-column width="60px" align="center" label="操作">
<template #default="scope">
<el-icon
class="deleteIcon"
@click="deleteChildren(father, scope.$index)"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
<!-- 动态渲染列 -->
<el-table-column
v-for="column in father.columns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
>
<template #default="scope">
<span v-if="column.type === 'text'">{{ scope.row[column.prop] }}</span>
</template>
</el-table-column>
<!-- 操作列(固定) -->
<el-table-column align="center" label="操作" width="150" fixed="right">
<template #default="scope">
<el-button
type="primary"
size="small"
@click="updateChildren(father, scope.row)"
>
修改
</el-button>
<el-button
type="danger"
size="small"
@click="deleteChildren(father, scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</template>
......@@ -145,9 +165,10 @@
:showClose="true"
:openDialog="dialogVisible"
@close="dialogVisible = false"
@confirm="dialogProductConfirm"
>
<div class="dialogBox">
<el-form>
<el-form :model="dialogForm" ref="dialogFormRef">
<el-row :gutter="20">
<template v-for="(child, dIndex) in additionalProductForm">
<el-col :sm="child.sm" :lg="child.lg" class="formItem">
......@@ -161,14 +182,14 @@
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="child.value"
v-model="dialogForm[child.key]"
:placeholder="child.placeholder"
maxlength="30"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="child.value"
v-model="dialogForm[child.key]"
:placeholder="child.placeholder"
>
<el-option
......@@ -181,12 +202,12 @@
<el-date-picker
style="width: 100%"
v-if="child.domType === 'DatePicker'"
v-model="child.value"
v-model="dialogForm[child.key]"
type="date"
:placeholder="child.placeholder"
/>
<el-select
v-model="child.value"
v-model="dialogForm[child.key]"
v-if="child.domType === 'SearchSelect'"
filterable
remote
......@@ -224,7 +245,9 @@ import { watch } from 'vue'
import {
getInsuranceProductList,
getAdditionalProductList,
secondAdditonalList
secondAdditonalList,
getInsuranceCategory,
getInsuranceCompany
} from '@/api/common'
import { editProductPlanInfo, delAdditional } from '@/api/sign/appointment'
import { updatePolicyProduct, delPolicyAdditional } from '@/api/sign/underwritingMain'
......@@ -252,11 +275,11 @@ const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess'])
const { proxy } = getCurrentInstance()
// const { sys_no_yes } = proxy.useDict('sys_no_yes')
const dialogTitle = ref('新增')
const dialogKey = ref('')
const dialogVisible = ref(false)
const productRef = ref(null) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const errorFields = ref([]) // 存储校验失败的字段信息
// const anchorList = ref([]) // 存储校验失败的字段信息
// const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const currencyType = ref([]) // 是否列表
......@@ -269,86 +292,89 @@ const data = reactive({
processedProductData: [], // 处理后的表单数据
oldProductDomData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
dialogForm: {},
queryParams: {
pageNo: 1,
pageSize: 4,
name: undefined
}
})
const { form, rules, processedProductData, queryParams, oldProductDomData, tempForm } = toRefs(data)
// 添加表单子级dom
const addChildren = father => {
if (props.editStatus) {
proxy.$message.warning('请先点击编辑')
return
const { form, rules, processedProductData, queryParams, oldProductDomData, tempForm, dialogForm } =
toRefs(data)
const deleteChildren = (father, index) => {
if (father.key == 'apiProductPlanAdditionalInfoDtoList') {
father.data.splice(index, 1)
proxy.$message.success('附加计划删除成功')
}
}
const updateChildren = (father, row) => {
dialogForm.value = JSON.parse(JSON.stringify(row))
if (father.key == 'apiProductPlanAdditionalInfoDtoList') {
dialogTitle.value = '新增附加计划'
dialogTitle.value = '修改附加计划'
dialogKey.value = 'apiProductPlanAdditionalInfoDtoList'
additionalProductForm.value = JSON.parse(JSON.stringify(father.formItem))
dialogVisible.value = true
}
dialogVisible.value = true
}
const deleteChildren = (father, childIndex) => {
if (editStatus.value) {
proxy.$message.warning('编辑状态下才能删除')
return
}
return
const processedData = JSON.parse(JSON.stringify(processedProductData.value))
if (
props.idsObj.appointmentBizId &&
form.value[father.key][childIndex].additionalBizId &&
(props.pageSource == 'appointmentList' || props.pageSource == 'fnaList')
) {
delAdditional(form.value[father.key][childIndex].additionalBizId).then(res => {
if (res.code == 200) {
proxy.$message.success('附加险删除成功')
for (const section of processedData) {
if (father.key == 'apiProductPlanAdditionalInfoDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1)
const dialogProductConfirm = () => {
proxy.$refs['dialogFormRef'].validate((valid, fields) => {
if (valid) {
let newDOM = JSON.parse(JSON.stringify(processedProductData.value))
for (const section of newDOM) {
if (section.key == dialogKey.value) {
// 处理下拉值得显示
for (const child of section.formItem) {
if (child.domType == 'Select' && dialogForm.value[child.key]) {
child.options.forEach(item => {
if (item.value == dialogForm.value[child.key]) {
dialogForm.value[child.key + 'Value'] = item.label
}
})
}
if (child.domType == 'SearchSelect' && dialogForm.value[child.key]) {
if (child.key == 'productLaunchName') {
dictStore.productAdditionalList.forEach(item => {
if (item.value == dialogForm.value[child.key]) {
dialogForm.value[child.key + 'Value'] = item.label
}
})
}
}
}
}
//更新form表单对应的数据,以便收集填写的值
form.value[father.key].splice(childIndex, 1)
emit('handleSuccessEdit')
}
})
} else if (
props.idsObj.policyBizId &&
form.value[father.key][childIndex].id &&
props.pageSource == 'policyList'
) {
delPolicyAdditional(form.value[father.key][childIndex].id).then(res => {
if (res.code == 200) {
proxy.$message.success('附加险删除成功')
for (const section of processedData) {
if (father.key == 'apiProductPlanAdditionalInfoDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1)
let index = section.data.findIndex(item => item.id == dialogForm.value.id)
if (index == -1) {
section.data.push(dialogForm.value)
} else {
section.data[index] = JSON.parse(JSON.stringify(dialogForm.value))
}
}
//更新form表单对应的数据,以便收集填写的值
form.value[father.key].splice(childIndex, 1)
emit('policyEditSuccess')
}
})
} else {
for (const section of processedData) {
if (father.key == 'apiProductPlanAdditionalInfoDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
processedProductData.value = newDOM
dialogVisible.value = false
dialogForm.value = {}
}
//更新form表单对应的数据,以便收集填写的值
form.value[father.key].splice(childIndex, 1)
})
}
// 添加表单子级dom
const addChildren = father => {
if (props.editStatus) {
proxy.$message.warning('请先点击编辑')
return
}
dialogForm.value = { id: Date.now() + Math.floor(Math.random()) }
if (father.key == 'apiProductPlanAdditionalInfoDtoList') {
dialogTitle.value = '新增附加计划'
dialogKey.value = father.key
additionalProductForm.value = JSON.parse(JSON.stringify(father.formItem))
dialogVisible.value = true
}
processedProductData.value = processedData
}
const handleSearchSelectChange = (key, index) => {
// 附加计划选择产品后,给供款期数下拉框赋值
if (key == 'productLaunchName') {
additionalProductForm.value.forEach(item => {
searchOptions.value['productLaunchName'].forEach(item1 => {
if (item1.value == additionalProductForm.value[index]['value']) {
if (item1.value == dialogForm.value['productLaunchName']) {
item1.apiAttributeSettingDtoList.forEach(item2 => {
if (
item2.attributeSettingBizId == 'attribute_setting_okpcuc8tlXRfVIAy' &&
......@@ -371,6 +397,17 @@ const handleSearchSelectChange = (key, index) => {
})
})
}
if (key == 'insuranceTypeName') {
searchOptions.value['insuranceTypeName'].forEach(item => {
if (item.value == form.value['apiProductPlanMainInfoDto']['insuranceTypeName']) {
if (item.code == 'CI') {
resetShow('sumInsured', true)
} else {
resetShow('sumInsured', false)
}
}
})
}
}
// 下拉框搜索方法
// 搜索方法
......@@ -423,6 +460,48 @@ const searchSelectList = async (query, fieldKey) => {
})
searchOptions.value[fieldKey] = response.data.records
}
} else if (fieldKey === 'companyName') {
const params9 = {
pageNo: 1,
pageSize: 10,
queryContent: query.trim()
}
const response9 = await getInsuranceCompany(params9)
if (response9.code == 200) {
response9.data.records = response9.data.records.map(item => {
return {
...item,
label: item.fullName,
value: item.insuranceCompanyBizId
}
})
searchOptions.value[fieldKey] = response9.data.records
}
} else if (fieldKey == 'insuranceTypeName') {
if (!form.value['apiProductPlanMainInfoDto'].companyName) {
proxy.$modal.confirm(`请先选择保险公司`, {
showCancel: '0',
title: '填写提示'
})
// row.insuranceType = ''
return
}
const params1 = {
pageNo: 1,
pageSize: 10,
name: query.trim()
}
const response1 = await getInsuranceCategory(params1)
if (response1.code == 200) {
response1.data.records = response1.data.records.map(item => {
return {
...item,
label: item.name,
value: item.insuranceCategoryBizId
}
})
searchOptions.value[fieldKey] = response1.data.records
}
}
} catch (error) {
console.error(`${fieldKey} 搜索失败`, error)
......@@ -453,7 +532,6 @@ const processFormData = async () => {
const processedData = JSON.parse(JSON.stringify(productDomData))
for (const section of processedData) {
// anchorList.value.push({ title: section.anchorKey, name: section.fatherTitle })
if (section.fatherRequired) {
rules.value[section.key] = {}
}
......@@ -493,11 +571,6 @@ const processFormData = async () => {
currencyType.value = child.options
}
}
if (props.fnaFormBizId) {
child.disabled = true
} else {
child.disabled = false
}
}
}
if (field.dictType) {
......@@ -513,11 +586,6 @@ const processFormData = async () => {
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
if (props.showSubmitBtn) {
field.disabled = true
} else {
field.disabled = false
}
}
}
}
......@@ -548,13 +616,14 @@ const processFormData = async () => {
// idsObj.appointmentBizId
// 证明是修改
if (props.showSubmitBtn) {
// editStatus.value = true
// processedProductData.value = processedData
//在流程和预约的时候要调用这个方法回显修改数据
setFormValue(props.apiProductPlanInfoDto, processedData)
} else {
// editStatus.value = false
processedProductData.value = processedData
if (oldProductDomData.value.length > 0) {
processedProductData.value = JSON.parse(JSON.stringify(oldProductDomData.value))
} else {
processedProductData.value = processedData
}
}
}
......@@ -564,7 +633,7 @@ const resetShow = (childKey, status) => {
for (const section of processedProductData.value) {
// 暂时没考虑data里嵌套children的情况
if (section.data) {
if (section.data && section.data.length > 0) {
for (const field of section.data) {
if (field.key == childKey) {
// 获取字典数据
......@@ -834,7 +903,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) {
errors.push({
field: field,
message: fields[field][0].message
message: `产品计划模块-${fields[field][0].message}`
})
}
}
......@@ -850,105 +919,57 @@ const isObject = value => {
return typeof value === 'object' && value !== null && !Array.isArray(value)
}
const handleSubmitForm = () => {
let result = {}
let submitObj = {}
if (props.activeName == 'productPlan') {
result = JSON.parse(JSON.stringify(form.value))
submitObj = JSON.parse(JSON.stringify(form.value))
} else {
result = JSON.parse(JSON.stringify(tempForm.value))
submitObj = JSON.parse(JSON.stringify(tempForm.value))
}
for (const key in result) {
if (isObject(result[key])) {
for (const key2 in result[key]) {
if (key2 == 'isBacktrack' && result[key][key2] == '0') {
result[key]['policyEffectiveDate'] = null
}
if (key2 == 'policyEffectiveDate' && result[key][key2]) {
result[key][key2] = proxy.formatToDateTime(result[key][key2])
}
for (const section of dictStore.insureProductList) {
if (key2 == 'productName' && section.productBizId == result[key][key2]) {
result[key][key2] = section.productName
result[key]['productBizId'] = section.productBizId
result[key]['companyName'] = section.ssDeptName
let resDom = JSON.parse(JSON.stringify(processedProductData.value))
return new Promise(async resolve => {
proxy.$refs['productFormRef'].validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
resDom.forEach(section => {
if (section.keyType == 'Array' && section.data.length > 0) {
submitObj[section.key] = JSON.parse(JSON.stringify(section.data))
}
}
}
}
if (isArray(result[key])) {
result[key] = result[key]
.map(item => {
// 删除指定字段
delete item.childTitle
delete item.children
delete item.disabled
delete item.id
delete item.span
delete item.deleteBtn
return item
})
.filter(item => Object.keys(item).length > 0) // 过滤空对象
}
if (key == 'apiProductPlanAdditionalInfoDtoList') {
if (result[key].length > 0) {
result[key] = result[key].filter(item => {
for (const key4 in item) {
for (const section of dictStore.additionalProductList) {
if (key4 == 'addProductName' && section.additionalProductBizId == item[key4]) {
item[key4] = section.productName
item['additionalProductBizId'] = section.additionalProductBizId
}
}
if (item[key4]) return item
// 保险公司名称转换
dictStore.allInsuranceCompanyList.forEach(item => {
if (submitObj.apiProductPlanMainInfoDto.companyName == item.value) {
submitObj.apiProductPlanMainInfoDto.companyName = item.label
}
})
}
}
}
console.log('新单提交产品计划', result)
return result
}
// 表单提交
const submitForm = saveType => {
// return
proxy.$refs['productFormRef'].validate((valid, fields) => {
if (valid) {
let result = handleSubmitForm()
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editProductPlanInfo(result).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('预约-产品计划修改成功')
emit('handleSuccessEdit')
searchOptions.value['insuranceTypeName'].forEach(item => {
if (submitObj.apiProductPlanMainInfoDto.insuranceTypeName == item.value) {
submitObj.apiProductPlanMainInfoDto.insuranceTypeName = item.label
}
})
}
if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
result.policyBizId = props.idsObj.policyBizId
updatePolicyProduct(result).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('新单跟进-产品计划修改成功')
emit('policyEditSuccess')
searchOptions.value['productLaunchName'].forEach(item => {
if (submitObj.apiProductPlanMainInfoDto.productLaunchName == item.value) {
submitObj.apiProductPlanMainInfoDto.productLaunchName = item.label
}
})
console.log('产品计划', submitObj)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
errorFields.value = [] // 清空错误信息
} else {
// 获取校验失败的字段信息
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
}
})
})
}
const anchorList = computed(() => {
let data = []
for (const section of processedProductData.value) {
......@@ -972,6 +993,7 @@ watch(
newVal => {
productRef.value = null
tempForm.value = { ...form.value }
oldProductDomData.value = JSON.parse(JSON.stringify(processedProductData.value))
if (newVal === 'productPlan') {
openList.value = false
processFormData()
......
<template>
<!-- v-if="processedSecondHolderData.length > 0" -->
<div>
<div v-if="processedSecondHolderData.length > 0">
<el-row>
<el-col :span="24">
<div class="topBtn">
<!-- <el-button type="warning" icon="DocumentAdd" @click="exportInfo" v-if="showContacts"
>导入联系人</el-button
> -->
<el-button
v-if="props.showSubmitBtn"
type="primary"
icon="EditPen"
@click="handleEditStatus(!editStatus)"
>编辑</el-button
>
</div>
</el-col>
</el-row>
<el-form ref="secondHolderFormRef" :model="form" :rules="rules" label-width="120px">
<div v-for="father in processedSecondHolderData">
<el-row style="margin-bottom: 10px" v-if="father.showMoudle">
<div class="formBox">
<div class="fatherLable">{{ father.fatherTitle }}</div>
<div class="fatherDes">{{ father.description }}</div>
<el-row :gutter="20">
<template v-for="child in father.data" :key="child.key">
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div>
<el-form-item
:label-width="child.labelWidth"
:label="child.label"
:prop="child.key"
:key="child.key"
:label-position="child.labelPosition"
>
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
@input="handleInputChange(father, child)"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="form[child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(father, child)"
:disabled="child.disabled"
<div>
<CommonForm :showAnchor="false">
<template #form-right>
<el-form ref="secondHolderFormRef" :model="form" :rules="rules">
<el-row v-for="father in processedSecondHolderData" style="margin-bottom: 10px">
<div class="formBox formFna">
<CardOne :title="father.fatherTitle" v-if="father.showMoudle">
<template #content>
<el-row v-if="!father.showTable" :gutter="20">
<template v-for="child in father.data" :key="child.key">
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div>
<el-form-item
:label="child.label"
:prop="child.key"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
>
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
:disabled="editStatus"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="form[child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(father, child)"
:disabled="editStatus"
>
<el-option
v-for="item in child.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
style="width: 100%"
v-if="child.domType === 'DatePicker'"
v-model="form[child.key]"
type="date"
:placeholder="child.placeholder"
:disabled="editStatus"
/>
<el-checkbox-group
v-if="child.domType === 'Checkbox'"
v-model="form[child.key]"
:disabled="editStatus"
>
<el-checkbox
v-for="item in child.options"
:key="item.value"
:label="item.value"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<!-- <el-select
v-model="form[child.key]"
v-if="child.domType === 'SearchSelect'"
filterable
remote
reserve-keyword
placeholder="请输入关键词搜索"
:remote-method="query => searchSelectList(query, child.key)"
:loading="searchLoadingStates[child.key]"
:disabled="editStatus"
@change="handleSearchSelectChange(child.key)"
>
<el-option
v-for="item in searchOptions[child.key] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select> -->
</el-form-item>
</div>
</el-col>
</template>
</el-row>
<!-- 是表格数据 -->
<el-row v-if="father.showTable">
<el-col :span="24" v-if="father.addChildren">
<el-button
:disabled="editStatus"
type="primary"
icon="Plus"
size="small"
style="margin-bottom: 10px"
@click="addChildren(father)"
>{{ father.addChildrenTxt }}</el-button
>
<el-option
v-for="item in child.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
v-model="form[child.key]"
style="width: 100%"
v-if="child.domType === 'DatePicker'"
type="date"
:placeholder="child.placeholder"
:disabled="child.disabled"
:disabled-date="disabledDate"
@change="handleDateChange(child)"
/>
<el-input
v-if="child.domType === 'arrowRight'"
v-model="form[child.key]"
:placeholder="child.placeholder"
@click="handleFoucs(child)"
:suffix-icon="ArrowRight"
readonly
:disabled="child.disabled"
</el-col>
<el-table :data="father.data" border v-if="father.data.length > 0">
<!-- 动态渲染列 -->
<el-table-column
v-for="column in father.columns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
>
</el-input>
<el-button v-if="child.domType === 'button'" :type="child.buttonType">{{
child.buttonTxt
}}</el-button>
</el-form-item>
</div>
</el-col>
</template>
</el-row>
</div>
</el-row>
</div>
<el-row v-if="props.showSubmitBtn">
<el-col>
<div class="tabButton">
<!-- <el-button
type="primary"
icon="RefreshRight"
@click="resetForm"
size="large"
:disabled="editStatus"
>重置</el-button
> -->
<el-button
type="primary"
icon="Check"
@click="submitForm"
size="large"
:disabled="editStatus"
>提交</el-button
>
</div>
</el-col>
</el-row>
</el-form>
<template #default="scope">
<span v-if="column.type === 'text'">{{ scope.row[column.prop] }}</span>
</template>
</el-table-column>
<!-- 操作列(固定) -->
<el-table-column align="center" label="操作" width="150">
<template #default="scope">
<el-button
type="primary"
size="small"
@click="updateChildren(father, scope.row)"
>
修改
</el-button>
<el-button
type="danger"
size="small"
@click="deleteChildren(father, scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</template>
</CardOne>
</div>
</el-row>
</el-form>
</template>
</CommonForm>
<el-dialog title="联系人信息" v-model="openList" width="600px" append-to-body>
<div>
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="85px">
......@@ -179,6 +211,8 @@
</div>
</template>
<script setup name="secondHolderInfo">
import CardOne from '@/components/formCard/cardOne'
import CommonForm from '@/views/components/commonForm'
import { calculateExactAge } from '@/utils/date'
import { ArrowRight } from '@element-plus/icons-vue'
import secondHolderDomData from '@/formJson/secondHolder'
......@@ -202,7 +236,11 @@ const props = defineProps({
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) }, //客户详情回显表单用
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
pageSource: { type: String, default: false } //页面来源
pageSource: { type: String, default: false }, //页面来源
fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: false }, //编辑状态
tabIndex: { type: [String, Number], default: '' } //tab索引
})
const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess'])
......@@ -214,7 +252,7 @@ const showCountryDrawer = ref(false) //国家/地区抽屉开关
const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输入值
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
// const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const showContacts = ref(true)
......@@ -317,14 +355,7 @@ const handleDateChange = child => {
const disabledDate = time => {
return time.getTime() > Date.now()
}
const exportInfo = () => {
if (props.customerBizId && editStatus.value) {
proxy.$modal.confirm(`请先点击编辑在导入客户信息`, { showCancel: '0', title: '填写提示' })
return
}
openList.value = true
customerList()
}
const customerList = () => {
tableLoading.value = true
getCustomerList(queryParams.value).then(res => {
......@@ -397,16 +428,9 @@ const processFormData = async obj => {
field.options = fetchDictData(field.dictType)
}
if (field.required) {
if (field.showEn) {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' },
{ validator: validateEnglish, trigger: 'change' }
]
} else {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
if (obj.customerInfo) {
for (const key1 in obj.customerInfo) {
......@@ -419,10 +443,6 @@ const processFormData = async obj => {
}
}
}
if (props.showSubmitBtn) {
field.disabled = true
}
}
}
}
......@@ -437,9 +457,7 @@ const processFormData = async obj => {
}
if (props.showSubmitBtn) {
form.value = { ...props.apiSecondHolderInfoDto }
editStatus.value = true
} else {
editStatus.value = false
}
processedSecondHolderData.value = oldAppointmentData.value = processedData
}
......@@ -559,43 +577,39 @@ const resetShow = obj => {
}
}
const handleSelectChange = (father, child) => {
const processData = JSON.parse(JSON.stringify(processedSecondHolderData.value))
for (const section of processData) {
switch (child.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]
}
switch (child.key) {
case 'isSecond':
if (form.value[child.key] == '1') {
resetShow({ type: 'father', key: 'apiSecondHolderInfoDto', status: true })
} else {
resetShow({ type: 'father', key: 'apiSecondHolderInfoDto', status: false })
}
break
case 'insurantRel':
// 是本人自动带入信息
if (form.value[child.key] == 'MYSELF') {
for (const section of father.data) {
for (const cKey in props.customerInfo) {
if (section.key == cKey) {
form.value[cKey] = props.customerInfo[cKey]
}
}
}
if (form.value['birthTime']) {
let age = calculateExactAge(proxy.formatToDate(form.value.birthTime))
if (age >= 0) {
form.value.age = age
} else {
// 不是本人清空信息
for (const section of father.data) {
if (section.key !== 'insurantRel') {
form.value[section.key] = ''
}
}
break
default:
break
}
}
}
const handleInputChange = (father, child) => {
switch (child.key) {
case 'nameEn':
validateEnglish(form.value[child.key], child.key)
}
break
default:
break
}
}
// 改变编辑状态
const handleEditStatus = status => {
editStatus.value = status
......@@ -646,19 +660,42 @@ const getInvalidFields = fields => {
// 处理表单填写得数据
const handleFormValues = () => {
let submitObj = {}
if (props.activeName == 'secondHolder') {
submitObj = JSON.parse(JSON.stringify(form.value))
} else {
submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
}
//处理表单数据
for (const key1 in submitObj) {
if (key1 == 'birthTime') {
submitObj[key1] = proxy.formatToDateTime(submitObj[key1])
return new Promise(async resolve => {
let submitObj = {}
if (props.activeName == 'secondHolder') {
submitObj = JSON.parse(JSON.stringify(form.value))
} else {
submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
}
}
proxy.$refs['secondHolderFormRef'].validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
if (submitObj.isSecond && submitObj.isSecond == '0') {
for (const key in submitObj) {
if (key !== 'isSecond') {
submitObj[key] = ''
}
}
}
if (submitObj['birthday']) {
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday'])
}
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
})
return submitObj
}
......@@ -726,12 +763,10 @@ watch(
if (newVal === 'secondHolder') {
openList.value = false
setTimeout(() => {
processFormData({
domdata: secondHolderDomData,
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