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'
})
}
......@@ -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>
......
......@@ -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(() => {
// 彻底重置所有响应式数据
......
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