Commit 3f5ee310 by yuzhenWang

做到了fnaForm的保险公司

parent f43a9d6e
<template> <template>
<el-watermark :font="font" :content="content"> <el-watermark :font="font" :content="content">
<router-view /> <router-view />
</el-watermark> </el-watermark>
...@@ -10,10 +9,10 @@ import useSettingsStore from '@/store/modules/settings' ...@@ -10,10 +9,10 @@ import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme' import { handleThemeStyle } from '@/utils/theme'
import { reactive } from 'vue' import { reactive } from 'vue'
const font = reactive({ const font = reactive({
color: 'rgba(0, 0, 0, .15)', color: 'rgba(0, 0, 0, .15)'
}) })
const content = reactive('csf') const content = ref('')
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
......
...@@ -111,3 +111,35 @@ export function getUserSaleExpandList(data) { ...@@ -111,3 +111,35 @@ export function getUserSaleExpandList(data) {
data: data data: data
}) })
} }
// 第二个附加险列表
export function secondAdditonalList(data) {
return request({
url: '/product/api/relProjectProductLaunch/parameter/page',
method: 'post',
data: data
})
}
// 获取签单员列表
export function getAllSignList(data) {
return request({
url: '/insurance/base/api/userSignExpand/page',
method: 'post',
data: data
})
}
// 获取团队列表
export function getAllTeam(data) {
return request({
url: '/csf/api/team/page',
method: 'post',
data: data
})
}
// 获取保险公司列表
export function getInsuranceCompany(data) {
return request({
url: '/insurance/base/api/insuranceCompany/page',
data: data,
method: 'post'
})
}
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
<template #header> <template #header>
<div class="cardOneheader"> <div class="cardOneheader">
<div class="cardOneLeft"> <div class="cardOneLeft">
<div class="mainTitle">{{ title }}</div> <div class="mainTitle">
{{ title }}
<slot name="mainTitCustom"></slot>
</div>
<slot name="headerRight"></slot> <slot name="headerRight"></slot>
</div> </div>
<div class="subTitle" v-if="desTitle">{{ desTitle }}</div> <div class="subTitle" v-if="desTitle">{{ desTitle }}</div>
...@@ -60,6 +63,7 @@ const props = defineProps({ ...@@ -60,6 +63,7 @@ const props = defineProps({
padding-left: 5px; padding-left: 5px;
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 20px;
/* border-top-left-radius: 2px; /* border-top-left-radius: 2px;
border-bottom-left-radius: 2px; border-bottom-left-radius: 2px;
...@@ -69,7 +73,7 @@ const props = defineProps({ ...@@ -69,7 +73,7 @@ const props = defineProps({
content: ''; content: '';
display: inline-block; display: inline-block;
width: 4px; width: 4px;
height: 22px; height: 18px;
background: #0052d9; background: #0052d9;
margin-right: 5px; margin-right: 5px;
border-radius: 4px; border-radius: 4px;
......
...@@ -142,6 +142,10 @@ const appointmentInfo = [ ...@@ -142,6 +142,10 @@ const appointmentInfo = [
label: '到港时间', label: '到港时间',
key: 'arrivalTime', key: 'arrivalTime',
domType: 'datetimePicker', domType: 'datetimePicker',
dateValue: '', //YYYY-MM-DD
timeValue: '', //HH:mm
compositionTime: true, //是否组合时间
required: false, required: false,
disabled: false, disabled: false,
placeholder: '请选择', placeholder: '请选择',
...@@ -155,6 +159,9 @@ const appointmentInfo = [ ...@@ -155,6 +159,9 @@ const appointmentInfo = [
label: '离港时间(离港时间必须晚于到港时间)', label: '离港时间(离港时间必须晚于到港时间)',
key: 'departureTime', key: 'departureTime',
domType: 'datetimePicker', domType: 'datetimePicker',
dateValue: '', //YYYY-MM-DD
timeValue: '', //HH:mm
compositionTime: true, //是否组合时间
required: false, required: false,
disabled: false, disabled: false,
placeholder: '请选择', placeholder: '请选择',
...@@ -213,6 +220,31 @@ const appointmentInfo = [ ...@@ -213,6 +220,31 @@ const appointmentInfo = [
} }
] ]
}, },
// 陪同转介人信息
{
fatherTitle: '签单员',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'userSignDtoList',
anchorKey: 'userSignDtoList',
moudleType: 'userSignDtoList',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true,
showMoudle: true, //模块是否展示
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '签单员', //新增按钮得文本
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
isOpen: false, //dom是否展开
data: [
// {
// name: '', //姓名
// practiceCode: '', //执业编码
// phone: '', //手机号
// cardType: '', //证件类型
// cardNo: '', //证件号码
// email: '' //邮箱
// }
]
},
// 开户信息 // 开户信息
{ {
fatherTitle: '开户信息', fatherTitle: '开户信息',
......
const customer = [ const customer = [
// 与投保人关系-在受保人中显示
{
fatherTitle: '与投保人关系',
type: 'object',
key: 'policyholderRel',
anchorKey: 'policyholderRel',
showTable: false,
showMoudle: false,
data: [
{
label: '与投保人关系',
key: 'policyholderRel',
domType: 'Select',
required: false,
disabled: false,
placeholder: '请选择',
dictType: 'csf_ap_rel',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
// 基础信息 // 基础信息
{ {
fatherTitle: '基础信息', fatherTitle: '基础信息',
...@@ -6,6 +31,7 @@ const customer = [ ...@@ -6,6 +31,7 @@ const customer = [
key: 'personInfo', key: 'personInfo',
anchorKey: 'personInfo', anchorKey: 'personInfo',
showTable: false, showTable: false,
showMoudle: true,
data: [ data: [
{ {
label: '名字(中文)', label: '名字(中文)',
...@@ -40,20 +66,7 @@ const customer = [ ...@@ -40,20 +66,7 @@ const customer = [
sm: 12, //栅格布局份数 sm: 12, //栅格布局份数
lg: 8 //栅格布局份数 lg: 8 //栅格布局份数
}, },
// {
// label: '称谓',
// key: 'title',
// domType: 'Select',
// required: true,
// disabled: false,
// placeholder: '请选择',
// dictType: 'csf_customer_title',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{ {
label: '证件类型', label: '证件类型',
key: 'documentType', key: 'documentType',
...@@ -183,21 +196,7 @@ const customer = [ ...@@ -183,21 +196,7 @@ const customer = [
sm: 12, //栅格布局份数 sm: 12, //栅格布局份数
lg: 8 //栅格布局份数 lg: 8 //栅格布局份数
}, },
// {
// label: '吸烟数量(支/天)',
// key: 'smokeQuantity',
// domType: 'Input',
// inputType: 'number',
// maxLength: 30,
// required: false,
// disabled: false,
// placeholder: '请输入',
// show: false,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{ {
label: '婚姻状况', label: '婚姻状况',
key: 'maritalStatus', key: 'maritalStatus',
...@@ -325,6 +324,7 @@ const customer = [ ...@@ -325,6 +324,7 @@ const customer = [
anchorKey: 'apiTaxationDtoList', anchorKey: 'apiTaxationDtoList',
moudleType: 'apiTaxationDtoList', moudleType: 'apiTaxationDtoList',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据 dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showMoudle: true,
showTable: true, showTable: true,
addChildren: true, //是否可以新增子级dom addChildren: true, //是否可以新增子级dom
addChildrenTxt: '税务', //新增按钮得文本 addChildrenTxt: '税务', //新增按钮得文本
...@@ -335,7 +335,7 @@ const customer = [ ...@@ -335,7 +335,7 @@ const customer = [
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 // id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数 // span: 24, //栅格布局份数
// taxCountry: '', // taxCountry: '',
// taxNumber: '' // taxId: ''
// } // }
] ]
}, },
...@@ -346,6 +346,7 @@ const customer = [ ...@@ -346,6 +346,7 @@ const customer = [
key: 'contactInfo', key: 'contactInfo',
anchorKey: 'contactInfo', anchorKey: 'contactInfo',
showTable: false, showTable: false,
showMoudle: true,
data: [ data: [
{ {
label: '移动电话', label: '移动电话',
...@@ -403,7 +404,7 @@ const customer = [ ...@@ -403,7 +404,7 @@ const customer = [
domType: 'Input', domType: 'Input',
inputType: 'text', inputType: 'text',
maxLength: 30, maxLength: 30,
required: true, required: false,
disabled: false, disabled: false,
placeholder: '请输入', placeholder: '请输入',
show: true, show: true,
...@@ -421,7 +422,7 @@ const customer = [ ...@@ -421,7 +422,7 @@ const customer = [
maxLength: 20, maxLength: 20,
disabled: false, disabled: false,
placeholder: '请输入', placeholder: '请输入',
show: false, show: true,
labelPosition: 'top', //标签的位置 labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度 labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数 sm: 12, //栅格布局份数
...@@ -483,6 +484,7 @@ const customer = [ ...@@ -483,6 +484,7 @@ const customer = [
key: 'companyInfo', key: 'companyInfo',
anchorKey: 'companyInfo', anchorKey: 'companyInfo',
showTable: false, showTable: false,
showMoudle: true,
data: [ data: [
{ {
label: '就业情况', label: '就业情况',
...@@ -649,6 +651,7 @@ const customer = [ ...@@ -649,6 +651,7 @@ const customer = [
key: 'financeInfo', key: 'financeInfo',
anchorKey: 'financeInfo', anchorKey: 'financeInfo',
showTable: false, showTable: false,
showMoudle: true,
data: [ data: [
{ {
label: '平均每月收入', label: '平均每月收入',
......
/**
* 1.普通模块得数据格式,无子级:
* {
一些页面用到得属性,比如个人资料模块得数据格式
data:[] data主要是这个模块对应得表单dom数据
}
2. 有子级得模块得数据格式:
{
一些页面用到得属性,比如家庭状况模块得数据格式
data:[ data主要父级模块对应得表单
{
比如家庭状况中有父亲,母亲,配偶,这个对象就代表这些人
children:[],代表得是这些人对应得表单dom
}
]
}
以上两种格式说明了fnaForm页面得dom数据格式,如果有子级得dom请参照2格式添加,否则可能有未知错误
*/
const fnaForm = [ const fnaForm = [
{ // 介绍人信息
fatherTitle: '个人资料', {
keyType: 'Object', //用于表单收集值时,判断是数组还是对象 fatherTitle: '转介人信息',
key: 'personalData', keyType: 'Array',
child: 'no', //没有子级dom,直接展示 key: 'brokerList',
fatherRequired: true, //父级必填,代表个人资料这个模块有必填项 anchorKey: 'brokerList',
data: [ moudleType: 'brokerList',
{ dataLength: 1,
label: '转介人', showMoudle: true,
key: 'accountName', showTable: true,
domType: 'SearchSelect', addChildren: true,
required: true, addChildrenTxt: '转介人',
maxLength: 30, fatherRequired: false,
disabled: false, isOpen: false,
placeholder: '请输入', // 新增表格列配置
show: true, columns: [
labelPosition: 'top', //标签的位置 {
labelWidth: '120px', //标签宽度 label: '姓名',
sm: 8, //栅格布局份数 prop: 'brokerName',
lg: 8 //栅格布局份数 type: 'remoteSelect',
searchType: 'brokerName',
placeholder: '请输入关键词搜索',
required: false
}, },
// {
// label: '签单员注册编号',
// key: 'registrationNumber',
// domType: 'Input',
// inputType: 'text',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '140px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '签单员内部编码',
// key: 'number',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '130px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{ {
label: '客户姓名', label: '性别',
key: 'customerName', prop: 'brokerGender',
domType: 'Input', type: 'select',
inputType: 'text', dictType: 'sys_gender',
required: true, placeholder: '请选择',
maxLength: 30, required: false
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}, },
// {
// label: '税务国家',
// key: 'taxCountry',
// domType: 'Input',
// inputType: 'text',
// required: true,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{ {
label: '就业情况', label: '内部编号',
key: 'employment', prop: 'brokerNumber',
domType: 'Select', type: 'input',
required: true,
maxLength: 30,
disabled: false,
placeholder: '请输入', placeholder: '请输入',
show: true, required: false
dictType: 'csf_employment',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}, },
{ {
label: '是否退休', label: '所属团队',
key: 'isRetired', prop: 'brokerTeam',
domType: 'Select', type: 'remoteSelect',
required: true, searchType: 'brokerTeam',
maxLength: 30, placeholder: '请输入关键词搜索',
disabled: false, required: false
placeholder: '请输入',
show: true,
dictType: 'sys_no_yes',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}, },
{ {
label: '退休年龄', label: '分配比例',
key: 'retiredAge', prop: 'brokerRatio',
domType: 'Input', type: 'inputNumber',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入', placeholder: '请输入',
show: true, required: true
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}, },
{ {
label: '其他就业情况', label: '备注',
key: 'otherEmployment', prop: 'remark',
domType: 'Input', type: 'input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入', placeholder: '请输入',
show: false, required: false
labelPosition: 'top', //标签的位置 }
labelWidth: '120px', //标签宽度 ],
sm: 8, //栅格布局份数 data: [
lg: 8 //栅格布局份数 {
brokerName: '',
brokerGender: '',
brokerNumber: '',
brokerTeam: '',
brokerRatio: '',
remark: ''
} }
] ]
}, },
{ // 受供养人信息
fatherTitle: '家庭状况', {
keyType: 'Array', //用于表单收集值时,判断是数组还是对象 fatherTitle: '受供养人信息',
showTable: true, //以table的形式展示 keyType: 'Array',
key: 'familyMembers', key: 'dependantList',
moudleType: 'family', anchorKey: 'dependantList',
addChildren: true, //是否可以新增子级dom moudleType: 'dependantList',
dataLength: 1,
addChildrenTxt: '添加儿女', //新增按钮得文本 showMoudle: true,
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项 showTable: true,
addChildren: true,
addChildrenTxt: '受供养人',
fatherRequired: false,
isOpen: false, isOpen: false,
openIcon: true, // 表格列配置
data: [ columns: [
{ {
type: '1', label: '与投保人关系',
childTitle: '父亲', prop: 'policyholderRel',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 type: 'select',
age: '', dictType: 'csf_ap_rel',
needProvide: '', placeholder: '请选择',
disabled: false, required: false
dictType: 'sys_no_yes',
options: []
}, },
{ {
type: '2', label: '年龄',
childTitle: '母亲', prop: 'dependantAge',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 type: 'inputNumber',
span: 24, //栅格布局份数 placeholder: '请输入年龄',
age: '', required: false
needProvide: '', }
disabled: false, ],
dictType: 'sys_no_yes', data: [
options: []
},
{ {
type: '3', policyholderRel: '',
childTitle: '配偶', dependantAge: ''
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
age: '',
needProvide: '',
disabled: false,
dictType: 'sys_no_yes',
options: []
} }
] ]
}, },
//财务需要分析 // 已生效仍在缴费期的保单情况
{ {
fatherTitle: '财务需要分析', fatherTitle: '已生效仍在缴费期的保单情况',
subTitle: '保单持有人个人已有保障', keyType: 'Array',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'existingSecurityOwner', key: 'existingSecurityOwner',
moudleType: 'finance', anchorKey: 'existingSecurityOwner',
addChildren: true, //是否可以新增子级dom moudleType: 'existingSecurityOwner',
addChildrenTxt: '保单持有人个人已有保障', //新增按钮得文本 dataLength: 1,
showMoudle: true,
showTable: true, showTable: true,
dataLength: 5, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据 addChildren: true,
addChildrenTxt: '保单',
fatherRequired: false,
isOpen: false, isOpen: false,
openIcon: true, // 表格列配置
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项 columns: [
data: [ {
label: '保险公司',
prop: 'insurer',
type: 'remoteSelect',
searchType: 'insurer',
placeholder: '请搜索保险公司名称',
required: true
},
{ {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 label: '保险种类',
span: 24, //栅格布局份数 prop: 'insuranceType',
childTitle: '保单持有人个人已有保障', type: 'remoteSelect',
insurer: '', searchType: 'insuranceType',
insuranceType: '', placeholder: '请选择',
sumInsured: '', required: true
policyIssueDate: '', },
currency: '', {
label: '保单币种',
prop: 'currency',
type: 'select',
dictType: 'bx_currency_type', dictType: 'bx_currency_type',
options: [] placeholder: '请选择',
} required: true
]
}, },
//受保人个人已有保障
{ {
keyType: 'Array', //用于表单收集值时,判断是数组还是对象 label: '投保日期',
subTitle: '受保人个人已有保障', prop: 'policyIssueDate',
key: 'existingSecurityInsured', type: 'datePicker',
moudleType: 'finance', placeholder: '请选择日期',
addChildren: true, //是否可以新增子级dom required: true
addChildrenTxt: '受保人个人已有保障', //新增按钮得文本 }
dataLength: 5, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据 // 有重疾险才让填写
showTable: true, // {
isOpen: false, //dom是否展开 // label: '保额',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项 // prop: 'sumInsured',
// type: 'inputNumber',
// placeholder: '请输入保额',
// required: true
// },
],
data: [ data: [
{ {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
subTitle: '受保人个人已有保障',
insurer: '', insurer: '',
insuranceType: '', insuranceType: '',
sumInsured: '', sumInsured: '',
policyIssueDate: '',
currency: '',
dictType: 'bx_currency_type',
options: []
}
]
},
// 投资房地产
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'investment',
moudleType: 'finance',
subTitle: '投资房地产',
showTable: true,
dataLength: 2, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '投资房地产', //新增按钮得文本
isOpen: false, //dom是否展开
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '投资房地产',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
address: '',
currency: '', currency: '',
dictType: 'bx_currency_type', policyIssueDate: ''
marketValue: ''
} }
] ]
}, },
//保单持有人资产 // 不动产信息
{ {
keyType: 'Array', //用于表单收集值时,判断是数组还是对象 fatherTitle: '不动产信息',
keyType: 'Array',
key: 'primaryResidence', key: 'primaryResidence',
moudleType: 'finance', anchorKey: 'primaryResidence',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据 moudleType: 'primaryResidence',
showTable: true, dataLength: 1,
subTitle: '保单持有人资产', showMoudle: true,
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '保单持有人资产', //新增按钮得文本
isOpen: false, //dom是否展开
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
childTitle: '自住用途之房地产',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
address: '',
currency: '',
dictType: 'bx_currency_type',
marketValue: ''
}
]
},
// 税务国家
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'taxList',
moudleType: 'finance',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true, showTable: true,
subTitle: '税务', addChildren: true,
addChildren: true, //是否可以新增子级dom addChildrenTxt: '不动产',
addChildrenTxt: '税务', //新增按钮得文本 fatherRequired: false,
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项 isOpen: false,
isOpen: false, //dom是否展开 // 表格列配置
data: [ columns: [
{ {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 label: '类型',
span: 24, //栅格布局份数 prop: 'propertyType',
taxCountry: '', type: 'select',
taxNumber: '' dictType: 'csf_property_type',
} placeholder: '请选择',
] required: true
}, },
//公司业务资料
{
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'companyBusinessData',
child: 'no', //有子级dom,需要循环展示
isOpen: true, //是否展开
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
subTitle: '公司业务资料 (适用于公司老板跟股东)',
data: [
{ {
label: '公司過去兩年平均純利', label: '房地产地址',
key: 'averageNetProfit', prop: 'address',
domType: 'Input', type: 'input',
inputType: 'text', placeholder: '请输入地址',
required: false, required: false
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '220px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}, },
{ {
label: '公司現時大約的總資產', label: '市值',
key: 'estimatedTotalAssets', prop: 'marketValue',
domType: 'Input', type: 'inputNumber',
inputType: 'text', placeholder: '请输入市场价值',
required: false, required: false
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '220px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}, },
{ {
label: '币种', label: '币种',
key: 'currency', prop: 'currency',
domType: 'Select', type: 'select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'bx_currency_type', dictType: 'bx_currency_type',
labelPosition: 'top', //标签的位置 placeholder: '请选择',
labelWidth: '120px', //标签宽度 required: false
sm: 8, //栅格布局份数 }
lg: 8 //栅格布局份数 ],
}, data: [
{ {
label: '资产所佔百分比 (%)', propertyType: '',
key: 'assetPercentage', address: '',
domType: 'Input', marketValue: '',
inputType: 'text', currency: ''
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '220px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
} }
] ]
}, },
//支出 // 保费负担能力评估
{ {
key: 'incomeExpense', fatherTitle: '保费负担能力评估',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象 type: 'object',
child: 'no', key: 'premiumAffordability',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项 anchorKey: 'premiumAffordability',
showTable: false,
showMoudle: true,
data: [ data: [
{ {
label: label: '在过去12个月里你的平均每月收入',
'在过去12个月里,你从所有所得的收入来源所得的平均每月收入为(包括薪金、花红、佣金、其他薪酬红利、银行存款利息、债券利息及股息等。',
key: 'monthlyIncome', key: 'monthlyIncome',
value: '',
domType: 'Input', domType: 'Input',
inputType: 'text', unit: 'HKD',
required: false, showDes: true, //是否展示描述
inputType: 'number',
required: true,
maxLength: 300, maxLength: 300,
disabled: false, disabled: false,
placeholder: '请输入', placeholder: '请输入平均每月收入',
tooltip: '包括薪金、花红、佣金、其他薪酬红利、银行存款利息、债券利息及股息等',
show: true, show: true,
inputWidth: '300px', labelPosition: 'top', //标签的位置
labelWidth: '800px', //标签宽度 labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数 sm: 24, //栅格布局份数
lg: 24, //栅格布局份数 lg: 8 //栅格布局份数
labelPosition: 'top' //标签的位置
}, },
{ {
label: '过去12个月每月里,你每月的平均开支为', label: '在过去12个月里你的平均每月开支',
key: 'monthlyExpense', key: 'monthlyExpense',
value: '',
domType: 'Input', domType: 'Input',
inputType: 'text', unit: 'HKD',
required: false, showDes: true, //是否展示描述
inputType: 'number',
required: true,
maxLength: 300, maxLength: 300,
disabled: false, disabled: false,
placeholder: '请输入', placeholder: '请输入平均每月开支',
show: true, show: true,
inputWidth: '300px', //输入框宽度 labelPosition: 'top', //标签的位置
labelWidth: '260px', //标签宽度 labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数 sm: 24, //栅格布局份数
lg: 12, //栅格布局份数 lg: 8 //栅格布局份数
labelPosition: 'top' //标签的位置
}
]
}, },
{ {
key: 'liquidAssets',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
child: 'no',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '您现时的累积流动资产约有多少?', label: '您现时的累积流动资产约有多少?',
key: 'liquidAssets', key: 'liquidAssets',
value: '',
domType: 'Input', domType: 'Input',
inputType: 'text', unit: 'HKD',
required: false, inputType: 'number',
required: true,
maxLength: 300, maxLength: 300,
disabled: false, disabled: false,
placeholder: '请输入', placeholder: '请输入流动资产',
tooltip: '流動资産是指可以容易變為现金的資産。例如現金、存款、外幣及股票,不包括物業。',
show: true, show: true,
inputWidth: '300px', //输入框宽度 labelPosition: 'top', //标签的位置
labelWidth: '220px', //标签宽度 labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数 sm: 24, //栅格布局份数
lg: 12, //栅格布局份数 lg: 8 //栅格布局份数
labelPosition: 'top' //标签的位置
}, },
{ {
label: '流动资产种类', label: '流动资产种类有?(多选)',
key: 'liquidAssetType', key: 'liquidAssetType',
value: [],
domType: 'Checkbox', domType: 'Checkbox',
required: false, dictType: 'csf_liquid_asset_type',
required: true,
maxLength: 300, maxLength: 300,
disabled: false, disabled: false,
placeholder: '请输入',
show: true, show: true,
labelWidth: '100px', //标签宽度
sm: 24, //栅格布局份数
lg: 24, //栅格布局份数
labelPosition: 'top', //标签的位置 labelPosition: 'top', //标签的位置
dictType: 'csf_liquid_asset_type' labelWidth: '120px', //标签宽度
}, sm: 12, //栅格布局份数
{ lg: 8 //栅格布局份数
label: '',
key: 'otherLiquidAsset',
inputType: 'Input',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: false,
labelWidth: '0px', //标签宽度
sm: 24, //栅格布局份数
lg: 24, //栅格布局份数
labelPosition: 'top' //标签的位置
}
]
}, },
{
fatherTitle: '',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
child: 'no',
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
key: 'other',
data: [
{ {
label: '首期及续保保费的财富来源', label: '首期及续保保费的财富来源?(多选)',
key: 'premiumFundingSource', key: 'premiumFundingSource',
value: [],
domType: 'Checkbox', domType: 'Checkbox',
required: false, dictType: 'csf_premium_funding_source',
maxLength: 30, required: true,
maxLength: 300,
disabled: false, disabled: false,
placeholder: '请输入',
show: true, show: true,
labelWidth: '180px', //标签宽度
sm: 24, //栅格布局份数
lg: 24, //栅格布局份数
labelPosition: 'top', //标签的位置 labelPosition: 'top', //标签的位置
dictType: 'csf_premium_funding_source' labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
} }
] ]
} }
// 公司业务资料
// {
// fatherTitle: '公司业务资料',
// type: 'object',
// key: 'companyBusinessData',
// anchorKey: 'companyBusinessData',
// showTable: false,
// showMoudle: true,
// data: [
// {
// label: '公司过去两年平均纯利',
// key: 'averageNetProfit',
// value: '',
// domType: 'Input',
// unit: 'HKD',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '公司现时大约总资产',
// key: 'estimatedTotalAssets',
// value: '',
// domType: 'Input',
// unit: 'HKD',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '币种',
// key: 'currency',
// value: '',
// domType: 'Select',
// required: false,
// disabled: false,
// placeholder: '请选择',
// dictType: 'bx_currency_type',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '资产所占百分比(%)',
// key: 'assetPercentage',
// value: '',
// domType: 'Input',
// unit: 'HKD',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// }
// ]
// }
] ]
export default fnaForm export default fnaForm
...@@ -10,7 +10,6 @@ const insured = [ ...@@ -10,7 +10,6 @@ const insured = [
{ {
label: '与投保人关系', label: '与投保人关系',
key: 'policyholderRel', key: 'policyholderRel',
// customerKey: 'customerType',
domType: 'Select', domType: 'Select',
required: true, required: true,
disabled: false, disabled: false,
......
...@@ -286,7 +286,7 @@ const productPlan = [ ...@@ -286,7 +286,7 @@ const productPlan = [
//附加险 //附加险
{ {
showMoudle: true, //模块是否展示 showMoudle: true, //模块是否展示
fatherTitle: '附加', fatherTitle: '附加计划',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象 keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'apiProductPlanAdditionalInfoDtoList', key: 'apiProductPlanAdditionalInfoDtoList',
anchorKey: 'apiProductPlanAdditionalInfoDtoList', anchorKey: 'apiProductPlanAdditionalInfoDtoList',
...@@ -429,7 +429,7 @@ const productPlan = [ ...@@ -429,7 +429,7 @@ const productPlan = [
{ {
label: '产品名称', label: '产品名称',
value: '', value: '',
key: 'addProductName', key: 'productLaunchName',
domType: 'SearchSelect', domType: 'SearchSelect',
required: false, required: false,
maxLength: 30, maxLength: 30,
...@@ -443,13 +443,13 @@ const productPlan = [ ...@@ -443,13 +443,13 @@ const productPlan = [
}, },
{ {
label: '供款期数', label: '供款期数',
key: 'paymentTerm', key: 'issueNumber',
value: '', value: '',
domType: 'Select', domType: 'Select',
required: false, required: false,
disabled: false, disabled: false,
placeholder: '请选择', placeholder: '请选择',
dictType: 'paymentTerm', dictType: 'issueNumber',
show: true, show: true,
labelPosition: 'top', //标签的位置 labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度 labelWidth: '120px', //标签宽度
...@@ -458,7 +458,7 @@ const productPlan = [ ...@@ -458,7 +458,7 @@ const productPlan = [
}, },
{ {
label: '保障年期(若是终身,输入999)', label: '保障年期(若是终身,输入999)',
key: 'sumInsured', key: 'guaranteePeriod',
value: '', value: '',
domType: 'Input', domType: 'Input',
inputType: 'number', inputType: 'number',
...@@ -474,7 +474,7 @@ const productPlan = [ ...@@ -474,7 +474,7 @@ const productPlan = [
}, },
{ {
label: '保单币种', label: '保单币种',
key: 'currency', key: 'policyCurrency',
value: '', value: '',
domType: 'Select', domType: 'Select',
inputType: 'text', inputType: 'text',
...@@ -507,7 +507,7 @@ const productPlan = [ ...@@ -507,7 +507,7 @@ const productPlan = [
}, },
{ {
label: '每期保费', label: '每期保费',
key: 'premium', key: 'eachIssuePremium',
value: '', value: '',
domType: 'Input', domType: 'Input',
inputType: 'number', inputType: 'number',
...@@ -541,7 +541,7 @@ const productPlan = [ ...@@ -541,7 +541,7 @@ const productPlan = [
{ {
label: '保障级别', label: '保障级别',
value: '', value: '',
key: 'insuranceType', key: 'protectionLevel',
domType: 'Input', domType: 'Input',
inputType: 'text', inputType: 'text',
required: false, required: false,
......
...@@ -11,7 +11,11 @@ const useDictStore = defineStore('dict', { ...@@ -11,7 +11,11 @@ const useDictStore = defineStore('dict', {
dictTypeLists: [], //字典列表,根据请求得不同会变化,所以使用之前需要使用useDictLists请求数据 dictTypeLists: [], //字典列表,根据请求得不同会变化,所以使用之前需要使用useDictLists请求数据
signNameList: [], signNameList: [],
bankList: [], //银行列表 bankList: [], //银行列表
userSaleExpandList: [] //最新转介人列表 userSaleExpandList: [], //最新转介人列表
productAdditionalList: [], //附加险产品列表对应的是产品计划
signPeopleList: [], //所有签单员
allTeaList: [], //所有团队
allInsuranceCompanyList: [] //最新的保险公司列表
}), }),
actions: { actions: {
// 获取字典 // 获取字典
...@@ -94,6 +98,22 @@ const useDictStore = defineStore('dict', { ...@@ -94,6 +98,22 @@ const useDictStore = defineStore('dict', {
//设置最新转介人列表 //设置最新转介人列表
setUserSaleExpandList(list) { setUserSaleExpandList(list) {
this.userSaleExpandList = list this.userSaleExpandList = list
},
//设置最新的附加险产品列表
setProductAdditionalList(list) {
this.productAdditionalList = list
},
//设置签单员列表
setSignPeopleList(list) {
this.signPeopleList = list
},
//设置团队列表
setAllTeaList(list) {
this.allTeaList = list
},
//设置最新的保险公司列表
setAllInsuranceCompanyList(list) {
this.allInsuranceCompanyList = list
} }
} }
}) })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div ref="customerRightRef"> <div ref="customerRightRef">
<div class="editBtn"> <div class="editBtn">
<el-button <el-button
v-if="props.customerBizId" v-if="props.customerBizId && tabSource == 'customer'"
type="primary" type="primary"
icon="EditPen" icon="EditPen"
@click="handleEditStatus" @click="handleEditStatus"
...@@ -12,20 +12,19 @@ ...@@ -12,20 +12,19 @@
</div> </div>
<CommonForm <CommonForm
:anchorList="anchorList" :anchorList="anchorList"
:affixOffset="250" :affixOffset="affixOffset"
:anchorOffset="10" :anchorOffset="10"
:scrollContainerSelector="anchorContainer" :scrollContainerSelector="anchorContainer"
:scrollOffset="10" :scrollOffset="10"
:domIndex="tabIndex" :domIndex="tabIndex"
:containerRef="tabPaneRef"
:activeName="activeName" :activeName="activeName"
v-if="customerRightRef" v-if="customerRightRef"
> >
<template #form-right> <template #form-right>
<el-form ref="customerRef" :model="form" :rules="rules" label-width="120px"> <el-form :model="form" :rules="rules" label-width="120px" ref="customerFormRef">
<el-row v-for="(father, fIndex) in processedCustomerData" :id="father.anchorKey"> <el-row v-for="(father, fIndex) in processedCustomerData" :id="father.anchorKey">
<div class="formBox"> <div class="formBox">
<CardOne :title="father.fatherTitle"> <CardOne :title="father.fatherTitle" v-if="father.showMoudle">
<template #content> <template #content>
<el-row :gutter="20" v-if="!father.showTable"> <el-row :gutter="20" v-if="!father.showTable">
<template v-for="child in father.data" :key="child.key"> <template v-for="child in father.data" :key="child.key">
...@@ -71,7 +70,9 @@ ...@@ -71,7 +70,9 @@
v-model="form[child.key]" v-model="form[child.key]"
:placeholder="child.placeholder" :placeholder="child.placeholder"
maxlength="30" maxlength="30"
:disabled="child.disabled" :disabled="
child.key == 'age' || child.key == 'bmi' ? true : editStatus
"
@blur="handleInputBlur(child)" @blur="handleInputBlur(child)"
> >
<template #append v-if="child.unit"> <template #append v-if="child.unit">
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
v-model="form[child.key]" v-model="form[child.key]"
:placeholder="child.placeholder" :placeholder="child.placeholder"
@change="handleSelectChange(child)" @change="handleSelectChange(child)"
:disabled="child.disabled" :disabled="editStatus"
> >
<el-option <el-option
v-for="item in child.options" v-for="item in child.options"
...@@ -104,7 +105,7 @@ ...@@ -104,7 +105,7 @@
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
:placeholder="child.placeholder" :placeholder="child.placeholder"
:disabled="child.disabled" :disabled="editStatus"
:disabled-date="time => disabledDate(time, child)" :disabled-date="time => disabledDate(time, child)"
:default-value="defaultDisplayDate" :default-value="defaultDisplayDate"
@change="handleDateChange(child)" @change="handleDateChange(child)"
...@@ -117,7 +118,7 @@ ...@@ -117,7 +118,7 @@
@click="handleFoucs(child)" @click="handleFoucs(child)"
:suffix-icon="ArrowRight" :suffix-icon="ArrowRight"
readonly readonly
:disabled="child.disabled" :disabled="editStatus"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -175,8 +176,7 @@ ...@@ -175,8 +176,7 @@
</CardOne> </CardOne>
</div> </div>
</el-row> </el-row>
<el-row v-if="tabSource == 'customer'">
<el-row>
<el-col> <el-col>
<div class="tabButton"> <div class="tabButton">
<el-button <el-button
...@@ -187,10 +187,11 @@ ...@@ -187,10 +187,11 @@
:disabled="editStatus" :disabled="editStatus"
>取消</el-button >取消</el-button
> >
<!-- @click="submitForm" -->
<el-button <el-button
type="primary" type="primary"
icon="Check" icon="Check"
@click="submitForm" @click="handleFormValues"
size="large" size="large"
:disabled="editStatus" :disabled="editStatus"
>提交</el-button >提交</el-button
...@@ -247,15 +248,16 @@ ...@@ -247,15 +248,16 @@
> >
<!-- 查询条件插槽 --> <!-- 查询条件插槽 -->
<template #searchForm> <template #searchForm>
<el-form :model="queryParams" ref="queryRef" label-width="100px"> <el-form :model="queryParams" ref="queryRef" label-width="100px" label-position="top">
<el-row :gutter="30"> <el-row :gutter="30">
<el-col :sm="12" :lg="8" :xs="24"> <el-col :sm="12" :lg="8" :xs="24">
<el-form-item label="预约编号" prop="appointmentNo"> <el-form-item label="姓名" prop="name">
<el-input <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable />
v-model="queryParams.appointmentNo" </el-form-item>
placeholder="请输入预约编号" </el-col>
clearable <el-col :sm="12" :lg="8" :xs="24">
/> <el-form-item label="手机号" prop="mobile">
<el-input v-model="queryParams.mobile" placeholder="请输入手机号" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -331,23 +333,18 @@ import { ...@@ -331,23 +333,18 @@ import {
calculateFieldValue calculateFieldValue
} from '@/api/sign/fna' } from '@/api/sign/fna'
import useDictStore from '@/store/modules/dict' import useDictStore from '@/store/modules/dict'
import { HttpStatusCode } from 'axios'
const dictStore = useDictStore() //获取字典数据 const dictStore = useDictStore() //获取字典数据
const props = defineProps({ const props = defineProps({
activeName: { type: String, default: '' }, //tab名称 activeName: { type: String, default: '' }, //tab名称
fatherEditStatus: { type: Boolean, default: true }, //因为嵌套了双层tab,所以需要父组件传值控制子组件的编辑状态
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
tabIndex: { type: [String, Number], default: '' }, //tab索引 tabIndex: { type: [String, Number], default: '' }, //tab索引
tabPaneRef: { affixOffset: { type: Number, default: 250 }, //锚点吸顶距离
type: Object, customerBizId: { type: String, default: '' }, //提交状态,新增、修改
default: null tabSource: { type: String, default: '' } //引用这个组件的页面来源,用于逻辑判断
},
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
customerBizId: { type: String, default: '' } //提交状态,新增、修改
}) })
const emit = defineEmits(['handleSuccess']) const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
const anchorList = ref([]) //锚点列表
const customerRightRef = ref(null) const customerRightRef = ref(null)
const showPhoneDrawer = ref(false) //电话抽屉开关 const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关 const showAddressDrawer = ref(false) //地址抽屉开关
...@@ -362,7 +359,6 @@ const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作 ...@@ -362,7 +359,6 @@ const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const tableLoading = ref(false) const tableLoading = ref(false)
const tableData = ref([]) const tableData = ref([])
const total = ref(0) const total = ref(0)
const customerRef = ref(null)
//计算默认显示的日期(18年前的今天) //计算默认显示的日期(18年前的今天)
const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate()) const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate())
// 地址组件菜单数据 // 地址组件菜单数据
...@@ -452,6 +448,8 @@ const operationBtnList = ref([ ...@@ -452,6 +448,8 @@ const operationBtnList = ref([
click: handleQuery click: handleQuery
} }
]) ])
const customerFormRef = ref(null)
const changePageNo = val => { const changePageNo = val => {
queryParams.value.pageNo = val queryParams.value.pageNo = val
customerList() customerList()
...@@ -547,7 +545,7 @@ const addChildren = father => { ...@@ -547,7 +545,7 @@ const addChildren = father => {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数 span: 24, //栅格布局份数
taxCountry: '', taxCountry: '',
taxNumber: '' taxId: ''
} }
for (const section of processedData) { for (const section of processedData) {
...@@ -555,9 +553,8 @@ const addChildren = father => { ...@@ -555,9 +553,8 @@ const addChildren = father => {
section.data.push(obj4) section.data.push(obj4)
} }
} }
//更新form表单对应的数据,以便收集填写的值
// form.value[father.key].push(obj)
processedCustomerData.value = processedData processedCustomerData.value = processedData
console.log('processedCustomerData.value', processedCustomerData.value)
} }
const deleteChildren = (father, childIndex) => { const deleteChildren = (father, childIndex) => {
if (editStatus.value) { if (editStatus.value) {
...@@ -644,10 +641,12 @@ const customerList = () => { ...@@ -644,10 +641,12 @@ const customerList = () => {
} }
// 从客户列表中导入客户信息到当前表单 // 从客户列表中导入客户信息到当前表单
const handleExport = row => { const handleExport = row => {
console.log('row', row) oldCustomerData.value = JSON.parse(JSON.stringify(processedCustomerData.value)) // 修改时存储原始数据,便于撤销操作
oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) // 修改时存储原始数据,便于撤销操作 oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) // 修改时存储原始数据,便于撤销操作
// setFormValue(row, processedCustomerData.value, true) console.log('导入前form', oldObjInfo.value)
console.log('导入前dom', oldCustomerData.value)
setFormValue(row, processedCustomerData.value, true)
openList.value = false openList.value = false
} }
...@@ -673,12 +672,30 @@ const fetchDictData = dictType => { ...@@ -673,12 +672,30 @@ const fetchDictData = dictType => {
} }
// 处理表单配置,添加字典数据 // 处理表单配置,添加字典数据
const processFormData = async () => { const processFormData = async () => {
anchorList.value = []
// 深拷贝原始数据 // 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(customerDomData)) const processedData = JSON.parse(JSON.stringify(customerDomData))
rules.value = {}
for (const section of processedData) { for (const section of processedData) {
anchorList.value.push({ title: section.anchorKey, name: section.fatherTitle }) // 如果在受保人中,与投保人关系已填写,根据填写内容展示对应的模块
if (
props.activeName == 'insurantInfo' &&
form.value['policyholderRel'] &&
form.value['policyholderRel'] == 'MYSELF'
) {
if (section.key == 'policyholderRel') {
section.showMoudle = true
} else {
section.showMoudle = false
}
} else {
section.showMoudle = true
}
if (props.activeName == 'insurantInfo' && section.key == 'policyholderRel') {
section.showMoudle = true
} else if (props.activeName !== 'insurantInfo' && section.key == 'policyholderRel') {
section.showMoudle = false
}
if (section.data) { if (section.data) {
for (const field of section.data) { for (const field of section.data) {
if (field.dictType) { if (field.dictType) {
...@@ -702,27 +719,27 @@ const processFormData = async () => { ...@@ -702,27 +719,27 @@ const processFormData = async () => {
] ]
} }
} }
if (field.key === 'bmi') { // if (field.key === 'bmi') {
rules.value[field.key] = [{ validator: validateBMI, trigger: 'change' }] // rules.value[field.key] = [
} // { required: false, trigger: 'change' },
if (props.customerBizId) { // { validator: validateBMI,trigger: 'change' }
field.disabled = true // ]
// }
} }
} }
} }
// 为私有的加form验证
if (props.activeName == 'insurantInfo') {
rules.value['policyholderRel'] = [
{ required: true, message: `与投保人关系不能为空`, trigger: 'blur' }
]
} }
if (props.customerBizId) { if (props.customerBizId) {
getCustomerInfo(props.customerBizId, processedData) getCustomerInfo(props.customerBizId, processedData)
editStatus.value = true
} else { } else {
editStatus.value = false
form.value.customerType = 'INDIVIDUAL'
processedCustomerData.value = oldCustomerData.value = processedData processedCustomerData.value = oldCustomerData.value = processedData
} }
console.log('====================================') console.log('form', form.value)
console.log('anchorList.value', anchorList.value)
console.log('====================================')
} }
//弹出右侧抽屉 //弹出右侧抽屉
...@@ -863,7 +880,7 @@ const confirmDrawer = info => { ...@@ -863,7 +880,7 @@ const confirmDrawer = info => {
nextTick(() => { nextTick(() => {
// 根据不同的drawerType确定要验证的字段key // 根据不同的drawerType确定要验证的字段key
const validateField = drawerInfo.value.key const validateField = drawerInfo.value.key
customerRef.value.clearValidate(validateField) customerFormRef.value.clearValidate(validateField)
}) })
} }
...@@ -873,15 +890,6 @@ const confirmDrawer = info => { ...@@ -873,15 +890,6 @@ const confirmDrawer = info => {
const handleSelectChange = child => { const handleSelectChange = child => {
switch (child.key) { switch (child.key) {
case 'documentType': case 'documentType':
// 先不加这个验证,有问题
// if (form.value[child.key] == 'idCard') {
// rules.value.idNumber.push({
// validator: validateIdCard,
// trigger: 'blur'
// })
// } else {
// rules.value.idNumber = [{ required: true, message: `证件号码不能为空`, trigger: 'blur' }]
// }
break break
case 'isRetirement': case 'isRetirement':
if (form.value[child.key] == '1') { if (form.value[child.key] == '1') {
...@@ -890,7 +898,18 @@ const handleSelectChange = child => { ...@@ -890,7 +898,18 @@ const handleSelectChange = child => {
resetShow('retirementAge', false) resetShow('retirementAge', false)
} }
break break
case 'policyholderRel':
processedCustomerData.value.forEach(section => {
if (form.value[child.key] == 'MYSELF') {
if (section.key == 'policyholderRel') {
section.showMoudle = true
} else {
section.showMoudle = false
}
} else {
section.showMoudle = true
}
})
break break
default: default:
break break
...@@ -934,15 +953,18 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -934,15 +953,18 @@ const setFormValue = (obj, formData, exportValue) => {
// if (section.key == 'personInfo') { // if (section.key == 'personInfo') {
// section.data.push() // section.data.push()
// } // }
if (
section.key == 'apiTaxationDtoList' &&
obj.apiTaxationDtoList &&
obj.apiTaxationDtoList.length > 0
) {
section.data = JSON.parse(JSON.stringify(obj.apiTaxationDtoList))
}
if (section.data) { if (section.data) {
for (const field of section.data) { for (const field of section.data) {
if (obj.isRetirement && obj.isRetirement == '1' && field.key == 'retirementAge') { if (obj.isRetirement && obj.isRetirement == '1' && field.key == 'retirementAge') {
field.show = true field.show = true
} }
//证件类型是身份证,身份证地址就显示否则不显示
// if (field.key == 'idCardAddress' && obj.idType == 'idCard') {
// field.show = true
// }
//要判断drawerType,因为抽屉要回显数据 //要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) { switch (field.drawerType) {
case 'phone': case 'phone':
...@@ -1002,12 +1024,12 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -1002,12 +1024,12 @@ const setFormValue = (obj, formData, exportValue) => {
break break
case 'country': case 'country':
form.value[field.key] = obj.countryName form.value[field.key] = obj.nationality
saveKey.value[field.key] = { saveKey.value[field.key] = {
country: obj.country || '', // country: obj.country || '',
countryCode: obj.country || '', // countryCode: obj.country || '',
countryName: obj.countryName || '', // countryName: obj.countryName || '',
name: obj.countryName || '', name: obj.nationality || '',
objType: field.drawerType objType: field.drawerType
} }
break break
...@@ -1044,11 +1066,11 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -1044,11 +1066,11 @@ const setFormValue = (obj, formData, exportValue) => {
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString') phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString') addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
if (!exportValue) { // if (!exportValue) {
// 保存一份就得表单数据便于做撤销操作 // // 保存一份就得表单数据便于做撤销操作
oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) // oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
} // }
processedCustomerData.value = oldCustomerData.value = processedData processedCustomerData.value = processedData
} }
// 数组去重 // 数组去重
function removeDuplicates(arr, key) { function removeDuplicates(arr, key) {
...@@ -1077,15 +1099,98 @@ const getInvalidFields = fields => { ...@@ -1077,15 +1099,98 @@ const getInvalidFields = fields => {
} }
return errors return errors
} }
// 表单提交
const submitForm = () => { const resetForm = () => {
//提交得时候要处理税务国家得数据。表格得值收集在processedCustomerData中,所以需要从processedCustomerData中取值 proxy.$modal
.confirm('是否确认撤销所作操作?')
.then(function () {
customerFormRef.value.resetFields()
console.log('切换之前的form', oldObjInfo.value)
console.log('切换之前的dom', oldCustomerData.value)
// processedCustomerData.value = JSON.parse(JSON.stringify(oldCustomerData.value))
setFormValue(oldObjInfo.value, oldCustomerData.value)
})
.catch(() => {})
}
// 获取客户详情
function getCustomerInfo(customerBizId, formData) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
// 回显值
setFormValue(res.data, formData)
}
})
}
// 根据联动重置表单项的显示与否
const resetShow = (key, status) => {
for (const section of processedCustomerData.value) {
if (section.data) {
for (const field of section.data) {
if (field.key == key) {
// 获取字典数据
field.show = 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 }))
console.log('最终收集到的错误列表:', errors)
return errors
}
// 滚动到第一个错误字段
const scrollToFirstError = () => {
const firstError = document.querySelector('.el-form-item__error')
if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' })
}
}
const handleFormValues = () => {
return new Promise(async resolve => {
let submitObj = { ...form.value } let submitObj = { ...form.value }
let addressList = [] let addressList = []
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday']) submitObj['birthday'] = proxy.formatToDate(submitObj['birthday'])
customerFormRef.value.validate((valid, fields) => {
proxy.$refs['customerRef'].validate((valid, fields) => {
if (valid) { if (valid) {
errorFields.value = [] // 清空错误信息
//处理表单数据 //处理表单数据
for (const key1 in form.value) { for (const key1 in form.value) {
for (const key2 in saveKey.value) { for (const key2 in saveKey.value) {
...@@ -1117,12 +1222,25 @@ const submitForm = () => { ...@@ -1117,12 +1222,25 @@ const submitForm = () => {
} }
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday']) submitObj['birthday'] = proxy.formatToDate(submitObj['birthday'])
submitObj['addressList'] = addressList submitObj['addressList'] = addressList
processedCustomerData.value.forEach(item => {
if (item.key == 'apiTaxationDtoList' && item.data.length > 0) {
submitObj['apiTaxationDtoList'] = item.data.filter(item => {
return item.taxCountry && item.taxCountry.trim() && item.taxId && item.taxId.trim()
})
}
})
// 删除多余字段 // 删除多余字段
deleteKeyList.value.forEach(item => { deleteKeyList.value.forEach(item => {
delete submitObj[item] delete submitObj[item]
}) })
return
if (props.customerBizId) { if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
if (props.customerBizId && props.activeName == 'customer') {
editCustomer(submitObj).then(res => { editCustomer(submitObj).then(res => {
if (res.code == 200) { if (res.code == 200) {
handleEditStatus() handleEditStatus()
...@@ -1134,10 +1252,9 @@ const submitForm = () => { ...@@ -1134,10 +1252,9 @@ const submitForm = () => {
}) })
} }
}) })
} else { } else if (!props.customerBizId && props.activeName == 'customer') {
addFna({ remark: '' }).then(response => { addFna({ remark: '' }).then(response => {
if (response.code == 200) { if (response.code == 200) {
// res.data.fnaBizId 写到这了,先增加fna,再增加客户 看一下流程是否报错
addCustomer(submitObj).then(res => { addCustomer(submitObj).then(res => {
if (res.code == 200) { if (res.code == 200) {
proxy.$message.success('客户新增成功') proxy.$message.success('客户新增成功')
...@@ -1152,66 +1269,54 @@ const submitForm = () => { ...@@ -1152,66 +1269,54 @@ const submitForm = () => {
} }
}) })
} }
resolve(errorFields.value.length == 0 ? submitObj : null)
// emit('submitForm', submitObj)
errorFields.value = [] // 清空错误信息
} else { } else {
// 获取校验失败的字段信息
errorFields.value = getInvalidFields(fields) errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) { if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message) proxy.$message.error(errorFields.value[0].message)
} }
resolve(undefined)
} }
}) })
}
const resetForm = () => {
proxy.$modal
.confirm('是否确认撤销所作操作?')
.then(function () {
if (props.customerBizId) {
form.value = { ...oldObjInfo.value }
editStatus.value = true
} else {
// resetShow('smokeQuantity', false)
proxy.$refs['customerRef'].resetFields()
}
processedCustomerData.value = JSON.parse(JSON.stringify(oldCustomerData.value))
})
.catch(() => {})
}
// 获取客户详情
function getCustomerInfo(customerBizId, formData) {
getCustomerDetail(customerBizId).then(async res => {
if (res.code == 200) {
// 回显值
setFormValue(res.data, formData)
}
}) })
} }
// 根据联动重置表单项的显示与否 const anchorList = computed(() => {
const resetShow = (key, status) => { let data = []
for (const section of processedCustomerData.value) { for (const section of processedCustomerData.value) {
if (section.data) { if (section.showMoudle) {
for (const field of section.data) { data.push({ title: section.anchorKey, name: section.fatherTitle })
if (field.key == key) {
// 获取字典数据
field.show = status
} }
} }
} return data
} })
}
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
editStatus.value = false
customerRightRef.value = null customerRightRef.value = null
if (newVal === 'customer') { if (newVal === 'customer' || newVal === 'policyholder' || newVal === 'insurantInfo') {
processFormData() processFormData()
// 因为客户资料里的编辑状态是单独控制的
if (props.tabSource == 'customer' && props.customerBizId) {
editStatus.value = true
} else if (props.tabSource == 'customer' && !props.customerBizId) {
editStatus.value = false
}
} }
} }
) )
watch(
() => props.fatherEditStatus,
newVal => {
editStatus.value = newVal
}
)
// 暴露给父组件
defineExpose({
handleFormValues,
handleEditStatus
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialogBox { .dialogBox {
......
<template> <template>
<div>
<div v-if="processedFanFormData.length > 0"> <div v-if="processedFanFormData.length > 0">
<el-row> <div ref="fanContainerRef">
<!-- <el-row>
<el-col :span="24"> <el-col :span="24">
<div class="topBtn"> <div class="topBtn">
<el-button <el-button
...@@ -13,58 +13,79 @@ ...@@ -13,58 +13,79 @@
> >
</div> </div>
</el-col> </el-col>
</el-row> </el-row> -->
<el-form ref="fanFormRef" :model="form" :rules="rules"> <CommonForm
<div v-for="father in processedFanFormData"> :anchorList="anchorList"
<div> :affixOffset="250"
<div class="fatherLable"> :anchorOffset="10"
{{ father.fatherTitle }} :scrollContainerSelector="anchorContainer"
<div class="openCon" v-if="father.openIcon" @click="changeOpenStatus(father)"> :scrollOffset="10"
<el-icon v-if="!father.isOpen"><Hide /></el-icon> :domIndex="tabIndex"
<el-icon v-else><View /></el-icon> :activeName="activeName"
</div> v-if="fanContainerRef"
</div> >
<div class="subTitle" v-if="father.subTitle && father.isOpen"> <template #form-right>
{{ father.subTitle }} <el-form :model="form" :rules="rules" ref="fanFormRef">
</div> <el-row v-for="(father, fIndex) in processedFanFormData" :id="father.anchorKey">
<div class="formBox">
<CardOne :title="father.fatherTitle" v-if="father.showMoudle">
<template #mainTitCustom>
<div
class="dependNum"
v-if="father.key == 'dependantList' && father.data.length > 0"
>
受供养人数目:{{ father.data.length }}
</div> </div>
<el-row v-if="father.child == 'no'" :gutter="20"> </template>
<template #content>
<el-row :gutter="20" v-if="!father.showTable" class="selfStyle">
<template v-for="child in father.data" :key="child.key"> <template v-for="child in father.data" :key="child.key">
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show"> <el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div> <div>
<el-form-item <el-form-item
:label="child.label" :label="
:prop="father.key + '.' + child.key" child.key === 'monthlyIncome' && child.domType === 'Input'
? ''
: child.label
"
:prop="child.key"
:key="child.key" :key="child.key"
:label-width="child.labelWidth" :label-width="child.labelWidth"
:label-position="child.labelPosition" :label-position="child.labelPosition"
> >
<!-- 自定义 label 插槽 -->
<template
v-if="
(child.key === 'monthlyIncome' || child.key === 'liquidAssets') &&
child.domType === 'Input'
"
#label
>
<div class="custom-label">
<span>{{ child.label }}</span>
<el-tooltip :content="child.tooltip" placement="top">
<el-icon><QuestionFilled /></el-icon>
</el-tooltip>
</div>
</template>
<el-input <el-input
v-if="child.domType === 'Input'" v-if="child.domType === 'Input'"
:type="child.inputType" :type="child.inputType"
v-model="form[father.key][child.key]" v-model="child.value"
:placeholder="child.placeholder"
maxlength="30"
:disabled="child.disabled"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }"
/>
<el-input
v-if="child.inputType === 'Input'"
:type="child.inputType"
v-model="form[father.key][child.key]"
:placeholder="child.placeholder" :placeholder="child.placeholder"
maxlength="30" maxlength="30"
:disabled="child.disabled" :disabled="editStatus"
:style="{ width: child.inputWidth ? child.inputWidth : '100%' }" >
class="formInput" <template #append v-if="child.unit">
/> <span>{{ child.unit }}</span>
</template>
</el-input>
<el-select <el-select
v-if="child.domType === 'Select'" v-if="child.domType === 'Select'"
v-model="form[father.key][child.key]" v-model="child.value"
:placeholder="child.placeholder" :placeholder="child.placeholder"
@change="handleSelectChange(father, child)" @change="handleSelectChange(child)"
:disabled="child.disabled" :disabled="editStatus"
clearable
> >
<el-option <el-option
v-for="item in child.options" v-for="item in child.options"
...@@ -76,17 +97,33 @@ ...@@ -76,17 +97,33 @@
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
v-if="child.domType === 'DatePicker'" v-if="child.domType === 'DatePicker'"
v-model="form[father.key][child.key]" v-model="child.value"
type="date" type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:placeholder="child.placeholder" :placeholder="child.placeholder"
:disabled="child.disabled" :disabled="editStatus"
:disabled-date="time => disabledDate(time, child)"
:default-value="defaultDisplayDate"
@change="handleDateChange(child)"
/> />
<el-input
v-if="child.domType === 'arrowRight'"
v-model="child.value"
:placeholder="child.placeholder"
@click="handleFoucs(child)"
:suffix-icon="ArrowRight"
readonly
:disabled="editStatus"
>
</el-input>
<el-checkbox-group <el-checkbox-group
v-if="child.domType === 'Checkbox'" v-if="child.domType === 'Checkbox'"
v-model="form[father.key][child.key]" v-model="child.value"
:disabled="child.disabled" :disabled="editStatus"
@change="changeCheck(father, child)"
> >
<template class="customCheckBox">
<el-checkbox <el-checkbox
v-for="item in child.options" v-for="item in child.options"
:key="item.value" :key="item.value"
...@@ -94,299 +131,133 @@ ...@@ -94,299 +131,133 @@
> >
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group>
<el-select <el-input
v-model="form[father.key][child.key]" style="width: 250px"
v-if="child.domType === 'SearchSelect'" v-if="
filterable child.key === 'liquidAssetType' &&
remote child.value.filter(item => item == 'G').length > 0
reserve-keyword "
placeholder="请输入关键词搜索" v-model="child.otherLiquidAsset"
:remote-method="query => searchSelectList(query, child.key)" placeholder="请输入说明"
:loading="searchLoadingStates[child.key]" :disabled="editStatus"
:disabled="child.disabled"
clearable
>
<el-option
v-for="item in searchOptions[child.key] || []"
:key="item.value"
:label="item.label"
:value="item.value"
/> />
</el-select> </template>
</el-checkbox-group>
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
</template> </template>
</el-row> </el-row>
<el-row v-if="father.showTable && father.isOpen"> <el-row v-if="father.showTable">
<el-table :data="father.data" border> <el-col :span="24" v-if="father.addChildren">
<template v-if="father.key == 'familyMembers'"> <el-button
<el-table-column label="亲属" prop="childTitle" width="100px" align="center">
<template #default="scope">
{{
scope.row.type == '4'
? `${scope.row.childTitle}-${scope.$index - 2}`
: scope.row.childTitle
}}
</template>
</el-table-column>
<el-table-column label="年龄" prop="age" align="center">
<template #default="scope">
<el-input
v-model="scope.row.age"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="是否需要供养" prop="needProvide" align="center">
<template #default="scope">
<el-select
v-model="scope.row.needProvide"
placeholder="请选择"
:disabled="editStatus" :disabled="editStatus"
clearable type="primary"
icon="Plus"
size="small"
style="margin-bottom: 10px"
@click="addChildren(father)"
>{{ father.addChildrenTxt }}</el-button
> >
<el-option </el-col>
v-for="item in scope.row.options" <el-table :data="father.data" border v-if="father.data.length > 0">
:key="item.value" <!-- 动态渲染列 -->
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column <el-table-column
width="60px" v-for="column in father.columns"
v-if="father.data && father.data.some(item => item.type === '4')" :key="column.prop"
:label="column.label"
:prop="column.prop"
align="center" align="center"
label="操作"
> >
<template #default="scope"> <template #default="scope">
<el-icon <!-- 远程搜索选择框 -->
v-if="scope.row.type == '4'"
@click="deleteChildren(father, scope.$index)"
class="deleteIcon"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
<template
v-if="
father.key == 'existingSecurityOwner' || father.key == 'existingSecurityInsured'
"
>
<el-table-column label="保险公司" prop="insurer" align="center">
<template #default="scope">
<el-input
size="default"
placeholder="请输入"
v-model="scope.row.insurer"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="保障类型" prop="insuranceType" align="center">
<template #default="scope">
<el-input
v-model="scope.row.insuranceType"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="保额" prop="sumInsured" align="center">
<template #default="scope">
<el-input
v-model="scope.row.sumInsured"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="币种" prop="currency" align="center">
<template #default="scope">
<el-select <el-select
v-model="scope.row.currency" v-if="column.type === 'remoteSelect'"
placeholder="请选择" v-model="scope.row[column.prop]"
filterable
remote
reserve-keyword
:placeholder="column.placeholder"
:remote-method="query => searchSelectList(query, column.searchType)"
:loading="searchLoadingStates[column.searchType]"
:disabled="editStatus" :disabled="editStatus"
clearable @change="handleRemoteSelectChange(scope.row, column)"
> >
<el-option <el-option
v-for="item in scope.row.options" v-for="item in searchOptions[column.searchType] || []"
:key="item.value" :key="item.id"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</template>
</el-table-column> <!-- 普通选择框 -->
<el-table-column label="保单签发日期" prop="policyIssueDate" align="center">
<template #default="scope">
<el-date-picker
style="width: 100%"
v-model="scope.row.policyIssueDate"
type="date"
placeholder="请输入"
:disabled="editStatus"
:disabled-date="disabledDate"
/>
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="操作">
<template #default="scope">
<el-icon @click="deleteChildren(father, scope.$index)" class="deleteIcon"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
<template v-if="father.key == 'investment'">
<el-table-column label="地址" prop="address" align="center">
<template #default="scope">
<el-input
size="default"
placeholder="请输入"
v-model="scope.row.address"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="市值" prop="marketValue" align="center">
<template #default="scope">
<el-input
v-model="scope.row.marketValue"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="币种" prop="currency" align="center">
<template #default="scope">
<el-select <el-select
v-model="scope.row.currency" v-else-if="column.type === 'select'"
placeholder="请选择" v-model="scope.row[column.prop]"
:placeholder="column.placeholder"
:disabled="editStatus" :disabled="editStatus"
clearable
> >
<el-option <el-option
v-for="item in scope.row.options" v-for="item in fetchDictData(column.dictType)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="操作">
<template #default="scope">
<el-icon @click="deleteChildren(father, scope.$index)" class="deleteIcon"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
<template v-if="father.key == 'primaryResidence'"> <!-- 日期选择器 -->
<el-table-column label="自住用途之房地产地址" prop="address" align="center"> <el-date-picker
<template #default="scope"> v-else-if="column.type === 'datePicker'"
<el-input v-model="scope.row[column.prop]"
size="default" type="date"
placeholder="请输入" format="YYYY-MM-DD"
v-model="scope.row.address" value-format="YYYY-MM-DD"
:placeholder="column.placeholder"
:disabled="editStatus" :disabled="editStatus"
style="width: 100%"
/> />
</template>
</el-table-column> <!-- 数字输入框 -->
<el-table-column label="自住用途之房地产市值" prop="marketValue" align="center">
<template #default="scope">
<el-input <el-input
v-model="scope.row.marketValue" v-else-if="column.type === 'inputNumber'"
size="default" v-model.number="scope.row[column.prop]"
placeholder="请输入" :placeholder="column.placeholder"
:disabled="editStatus" :disabled="editStatus"
/> type="number"
</template>
</el-table-column>
<el-table-column label="币种" prop="currency" align="center">
<template #default="scope">
<el-select
v-model="scope.row.currency"
placeholder="请选择"
:disabled="editStatus"
clearable
> >
<el-option <template v-if="column.unit" #append>
v-for="item in scope.row.options" <span>{{ column.unit }}</span>
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="操作">
<template #default="scope">
<el-icon @click="deleteChildren(father, scope.$index)" class="deleteIcon"
><Delete
/></el-icon>
</template> </template>
</el-table-column> </el-input>
</template>
<template v-if="father.key == 'taxList'"> <!-- 普通输入框(默认) -->
<el-table-column label="税务国家" prop="taxCountry" align="center">
<template #default="scope">
<el-input
size="default"
placeholder="请输入"
v-model="scope.row.taxCountry"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="税务编号" prop="taxNumber" align="center">
<template #default="scope">
<el-input <el-input
v-model="scope.row.taxNumber" v-else
size="default" v-model="scope.row[column.prop]"
placeholder="请输入" :placeholder="column.placeholder"
:disabled="editStatus" :disabled="editStatus"
/> />
</template> </template>
</el-table-column> </el-table-column>
<!-- 操作列(固定) -->
<el-table-column width="60px" align="center" label="操作"> <el-table-column width="60px" align="center" label="操作">
<template #default="scope"> <template #default="scope">
<el-icon @click="deleteChildren(father, scope.$index)" class="deleteIcon" <el-icon
class="deleteIcon"
@click="deleteChildren(father, scope.$index)"
><Delete ><Delete
/></el-icon> /></el-icon>
</template> </template>
</el-table-column> </el-table-column>
</template>
</el-table> </el-table>
<el-col
:span="24"
v-if="father.addChildren"
style="display: flex; justify-content: center"
>
<el-button
:disabled="editStatus"
style="margin-top: 10px"
type="primary"
icon="Plus"
@click="addChildren(father)"
>{{ father.addChildrenTxt }}</el-button
>
</el-col>
</el-row> </el-row>
</template>
</CardOne>
</div> </div>
</el-row>
<el-row> <el-row>
<el-col> <el-col>
<div class="tabButton"> <div class="tabButton">
...@@ -410,31 +281,37 @@ ...@@ -410,31 +281,37 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</template>
</CommonForm>
</div> </div>
<div v-else class="domEmpty" v-loading="loading"></div> <!-- <div v-else class="domEmpty" v-loading="loading"></div> -->
</div> </div>
</template> </template>
<script setup name="fanForm"> <script setup name="fanForm">
import CommonForm from '@/views/components/commonForm'
import CardOne from '@/components/formCard/cardOne'
import { processUserName } from '@/utils/common' import { processUserName } from '@/utils/common'
import useDictStore from '@/store/modules/dict' import useDictStore from '@/store/modules/dict'
import fanFormDomData from '@/formJson/fnaForm' import fanFormDomData from '@/formJson/fnaForm'
import { watch, nextTick } from 'vue' import { watch, nextTick } from 'vue'
import { addfanForm, getfanFormDetail, editFanForm, getCustomerList } from '@/api/sign/fna' import { addfanForm, getfanFormDetail, editFanForm, getCustomerList } from '@/api/sign/fna'
import { listTenantUser } from '@/api/common' import { getUserSaleExpandList, getAllTeam, getInsuranceCompany } from '@/api/common'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
const dictStore = useDictStore() //获取字典数据 const dictStore = useDictStore() //获取字典数据
const props = defineProps({ const props = defineProps({
customerInfo: { type: Object, default: () => {} }, //客户详情 customerInfo: { type: Object, default: () => {} }, //客户详情
activeName: { type: String, default: '' }, //tab名称 activeName: { type: String, default: '' }, //tab名称
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
fnaFormBizId: { type: String, default: '' }, //提交状态,新增、修改 fnaFormBizId: { type: String, default: '' }, //提交状态,新增、修改
customerBizId: { type: String, default: '' }, //提交状态,新增、修改 customerBizId: { type: String, default: '' }, //提交状态,新增、修改
dictTypeLists: { type: Array, default: () => [] } //多个字典值数据 dictTypeLists: { type: Array, default: () => [] }, //多个字典值数据
anchorContainer: { type: String, default: '' }, //锚点滚动容器
tabIndex: { type: [String, Number], default: '' } //tab索引
}) })
const emit = defineEmits(['handleSuccess']) const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// const { sys_no_yes } = proxy.useDict('sys_no_yes') const fanContainerRef = ref(null)
const loading = ref(false) const loading = ref(false)
const fanFormRef = ref(null) const fanFormRef = ref(null)
const errorFields = ref([]) // 存储校验失败的字段信息 const errorFields = ref([]) // 存储校验失败的字段信息
...@@ -465,61 +342,70 @@ const { ...@@ -465,61 +342,70 @@ const {
tempFanFormValue, tempFanFormValue,
tempFanFormData tempFanFormData
} = toRefs(data) } = toRefs(data)
const changeCheck = (father, child) => { const handleRemoteSelectChange = (row, column) => {
if (child.key == 'liquidAssetType') { console.log(row, column)
resetShow('otherLiquidAsset', form.value[father.key][child.key].includes('G')) // 通过保险公司查保险种类 row中收集了insurer的值
} if (column.prop == 'insurer') {
}
const changeOpenStatus = father => {
const processedData = JSON.parse(JSON.stringify(processedFanFormData.value))
for (const section of processedData) {
if (
father.key == 'familyMembers' &&
section.key == father.key &&
section.moudleType == 'family'
) {
section.isOpen = !father.isOpen
}
if (section.moudleType == 'finance' && father.key !== 'familyMembers') {
section.isOpen = !father.isOpen
}
} }
processedFanFormData.value = processedData
console.log('processedFanFormData.value', processedFanFormData.value)
}
const disabledDate = time => {
return time.getTime() > Date.now()
} }
// 搜索方法 // 搜索方法
const searchSelectList = async (query, fieldKey) => { const searchSelectList = async (query, fieldKey) => {
// 设置该字段的加载状态 // 设置该字段的加载状态
searchLoadingStates.value[fieldKey] = true searchLoadingStates.value[fieldKey] = true
let queryString = query.trim()
try { try {
// 根据不同的字段key调用不同的API // 根据不同的字段key调用不同的API
if (fieldKey === 'accountName') { if (fieldKey === 'brokerName') {
const params = { const params5 = {
tenantBizId: userStore.projectInfo.tenantBizId,
realName: query.trim(),
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
queryContent: queryString
} }
const response5 = await getUserSaleExpandList(params5)
const response = await listTenantUser(params) if (response5.code == 200) {
if (response.code == 200) { response5.data.records = response5.data.records.map(item => {
let result = processUserName(response.data.records) return {
result = result.map(item => { ...item,
label: item.realName,
value: item.userSaleBizId
}
})
searchOptions.value[fieldKey] = response5.data.records
}
} else if (fieldKey === 'brokerTeam') {
const params8 = {
pageNo: 1,
pageSize: 10,
teamName: queryString
}
const response8 = await getAllTeam(params8)
if (response8.code == 200) {
response8.data.records = response8.data.records.map(item => {
return { return {
value: item.userBizId, ...item,
label: item.showName label: item.teamName,
value: item.teamBizId
} }
}) })
searchOptions.value[fieldKey] = result searchOptions.value[fieldKey] = response8.data.records
}
} else if (fieldKey === 'insurer') {
const params9 = {
pageNo: 1,
pageSize: 10,
queryContent: queryString
} }
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
} }
// 可以添加其他字段的处理,可以放其他的字段得请求,目前只有accountName,以后有了其他的在填充
else if (fieldKey === 'otherField') {
console.log('otherField')
} }
} catch (error) { } catch (error) {
console.error(`${fieldKey} 搜索失败`, error) console.error(`${fieldKey} 搜索失败`, error)
...@@ -529,6 +415,10 @@ const searchSelectList = async (query, fieldKey) => { ...@@ -529,6 +415,10 @@ const searchSelectList = async (query, fieldKey) => {
} }
} }
const disabledDate = time => {
return time.getTime() > Date.now()
}
// 获取字典数据 // 获取字典数据
const fetchDictData = dictType => { const fetchDictData = dictType => {
let options = [] let options = []
...@@ -569,36 +459,13 @@ const processFormData = async () => { ...@@ -569,36 +459,13 @@ const processFormData = async () => {
form.value[section.key] = {} form.value[section.key] = {}
} }
if (section.data) { if (section.data) {
for (const formKey in form.value) {
if (section.key == formKey) {
if (section.dataLength) {
for (let i = 1; i < section.dataLength; i++) {
section.data.push(JSON.parse(JSON.stringify(section.data[0])))
form.value[formKey].push(JSON.parse(JSON.stringify(section.data[0])))
}
}
for (const field of section.data) { for (const field of section.data) {
// 为下拉搜索框加options // 为下拉搜索框加options
if (field.domType == 'SearchSelect') { // if (field.domType == 'SearchSelect') {
if (field.key == 'accountName') { // if (field.key == 'accountName') {
searchOptions.value[field.key] = dictStore.tenantUserList // searchOptions.value[field.key] = dictStore.tenantUserList
} // }
} // }
if (section.key == formKey && field.children) {
for (const child of field.children) {
if (child.dictType) {
child.options = fetchDictData(child.dictType)
if (child.dictType == 'sys_no_yes') {
noYesList.value = child.options
}
}
if (props.fnaFormBizId) {
child.disabled = true
} else {
child.disabled = false
}
}
}
if (field.dictType) { if (field.dictType) {
// 获取字典数据 // 获取字典数据
field.options = fetchDictData(field.dictType) field.options = fetchDictData(field.dictType)
...@@ -606,35 +473,23 @@ const processFormData = async () => { ...@@ -606,35 +473,23 @@ const processFormData = async () => {
noYesList.value = field.options noYesList.value = field.options
} }
} }
//
/* if (field.required) {
1.没有嵌套子级的也就是没有children的数据加rules,根据data中的required字段判断是否必填 rules.value[field.key] = [
2.有嵌套子级的也就是有children的数据,根据children中的required字段判断是否必填,现在没这个需求,所以先注释
*/
if (field.required && section.child == 'no') {
rules.value[section.key][field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' } { required: true, message: `${field.label}不能为空`, trigger: 'blur' }
] ]
} }
if (props.fnaFormBizId) { if (props.fnaFormBizId) {
field.disabled = true field.disabled = true
} else { } else {
if (field.key == 'customerName' && section.key == 'personalData') {
form.value['personalData'][field.key] = props.customerInfo.firstNamePinyin
}
field.disabled = false field.disabled = false
} }
} }
if (section.child == 'yes') {
form.value[formKey] = section.data //便于表单收集值
}
}
}
} }
} }
if (props.fnaFormBizId) { if (props.fnaFormBizId) {
getFanformInfo(props.fnaFormBizId, processedData) // getFanformInfo(props.fnaFormBizId, processedData)
editStatus.value = true // editStatus.value = true
} else { } else {
// tab切走在切回来时,表单会重置,所以这里需要把表单的值赋回去 // tab切走在切回来时,表单会重置,所以这里需要把表单的值赋回去
if (Object.keys(tempFanFormValue.value).length > 0) { if (Object.keys(tempFanFormValue.value).length > 0) {
...@@ -649,67 +504,55 @@ const processFormData = async () => { ...@@ -649,67 +504,55 @@ const processFormData = async () => {
} }
editStatus.value = false editStatus.value = false
loading.value = false loading.value = false
console.log('processedFanFormData.value', processedFanFormData.value)
} }
processedFanFormData.value = oldFanFormData.value = processedData
} }
// 添加表单子级dom // 添加表单子级dom
const addChildren = father => { const addChildren = father => {
const processedData = JSON.parse(JSON.stringify(processedFanFormData.value)) const processedData = JSON.parse(JSON.stringify(processedFanFormData.value))
let obj = { let obj1 = {
type: '4', brokerName: '',
childTitle: '儿女', brokerGender: '',
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 brokerNumber: '',
delete: true, //是否显示删除按钮 brokerTeam: '',
age: '', brokerRatio: '',
needProvide: '', remark: ''
options: noYesList.value
} }
let obj2 = { let obj2 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数 policyholderRel: '',
dependantAge: ''
}
let obj3 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
insurer: '', insurer: '',
insuranceType: '', insuranceType: '',
sumInsured: '', sumInsured: '',
policyIssueDate: '',
currency: '', currency: '',
options: fetchDictData('bx_currency_type') policyIssueDate: ''
} }
let obj3 = { let obj4 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 propertyType: '',
span: 24, //栅格布局份数
address: '', address: '',
currency: '',
marketValue: '', marketValue: '',
options: fetchDictData('bx_currency_type') currency: ''
}
let obj4 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
taxCountry: '',
taxNumber: ''
} }
for (const section of processedData) { for (const section of processedData) {
if (father.key == 'familyMembers' && section.key == father.key) { if (father.key == 'brokerList' && section.key == father.key) {
section.data.push(obj) section.data.push(obj1)
} }
if (father.key == 'existingSecurityOwner' && section.key == father.key) { if (father.key == 'dependantList' && section.key == father.key) {
section.data.push(obj2) section.data.push(obj2)
} }
if (father.key == 'existingSecurityInsured' && section.key == father.key) { if (father.key == 'existingSecurityOwner' && section.key == father.key) {
section.data.push(obj2)
}
if (father.key == 'investment' && section.key == father.key) {
section.data.push(obj3) section.data.push(obj3)
} }
if (father.key == 'primaryResidence' && section.key == father.key) { if (father.key == 'primaryResidence' && section.key == father.key) {
section.data.push(obj3)
}
if (father.key == 'taxList' && section.key == father.key) {
section.data.push(obj4) section.data.push(obj4)
} }
} }
//更新form表单对应的数据,以便收集填写的值
form.value[father.key].push(obj)
processedFanFormData.value = processedData processedFanFormData.value = processedData
} }
const deleteChildren = (father, childIndex) => { const deleteChildren = (father, childIndex) => {
...@@ -1116,6 +959,15 @@ function getFanformInfo(fnaFormBizId, formData) { ...@@ -1116,6 +959,15 @@ function getFanformInfo(fnaFormBizId, formData) {
} }
}) })
} }
const anchorList = computed(() => {
let data = []
for (const section of processedFanFormData.value) {
if (section.showMoudle) {
data.push({ title: section.anchorKey, name: section.fatherTitle })
}
}
return data
})
watch(fanFormRef, newVal => { watch(fanFormRef, newVal => {
if (newVal) { if (newVal) {
for (const key in rules.value) { for (const key in rules.value) {
...@@ -1128,20 +980,30 @@ watch(fanFormRef, newVal => { ...@@ -1128,20 +980,30 @@ watch(fanFormRef, newVal => {
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
fanContainerRef.value = null
tempFanFormValue.value = JSON.parse(JSON.stringify(form.value)) tempFanFormValue.value = JSON.parse(JSON.stringify(form.value))
tempFanFormData.value = JSON.parse(JSON.stringify(processedFanFormData.value)) tempFanFormData.value = JSON.parse(JSON.stringify(processedFanFormData.value))
if (newVal === 'fnaform') { if (newVal === 'fnaform') {
openList.value = false openList.value = false
setTimeout(() => {
processFormData() processFormData()
}, 500)
} }
} }
) )
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dependNum {
font-size: 14px;
font-weight: none;
margin-left: 10px;
}
.customCheckBox {
display: flex;
flex-direction: column;
width: 100%;
}
.domEmpty { .domEmpty {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1267,6 +1129,12 @@ watch( ...@@ -1267,6 +1129,12 @@ watch(
.formFna :deep(.el-checkbox) { .formFna :deep(.el-checkbox) {
margin-right: 10px; margin-right: 10px;
} }
.selfStyle :deep(.el-form-item--label-top .el-form-item__label) {
text-align: none !important;
display: flex;
align-items: center;
justify-content: flex-start;
}
/* @media only screen and (min-width: 768px) { /* @media only screen and (min-width: 768px) {
.formInput { .formInput {
......
...@@ -86,22 +86,22 @@ ...@@ -86,22 +86,22 @@
<Customer <Customer
v-if="tab.name === 'customer'" v-if="tab.name === 'customer'"
:activeName="activeName" :activeName="activeName"
:fearthStatus="route.query.type"
:customerBizId="processInfo.customerBizId" :customerBizId="processInfo.customerBizId"
@handleSuccess="handleSuccess" @handleSuccess="handleSuccess"
:tabPaneRef="tabPaneRef"
:tabIndex="tabsList.findIndex(t => t.name === 'customer')" :tabIndex="tabsList.findIndex(t => t.name === 'customer')"
anchorContainer=".tabPaneBox" anchorContainer=".tabPaneBox"
tabSource="customer"
/> />
<div v-if="tab.name === 'fnaform'"> <div v-if="tab.name === 'fnaform'">
<FanForm <FanForm
:activeName="activeName" :activeName="activeName"
:fearthStatus="route.query.type"
:fnaFormBizId="processInfo.fnaFormBizId" :fnaFormBizId="processInfo.fnaFormBizId"
:customerBizId="processInfo.customerBizId" :customerBizId="processInfo.customerBizId"
:dictTypeLists="dictTypeLists" :dictTypeLists="dictTypeLists"
:customerInfo="customerInfo" :customerInfo="customerInfo"
@handleSuccess="handleSuccess" @handleSuccess="handleSuccess"
:tabIndex="tabsList.findIndex(t => t.name === 'fnaform')"
anchorContainer=".tabPaneBox"
/> />
</div> </div>
<div v-if="tab.name === 'appointment'"> <div v-if="tab.name === 'appointment'">
...@@ -133,7 +133,11 @@ import { ...@@ -133,7 +133,11 @@ import {
getInsuranceProductList, getInsuranceProductList,
getAdditionalProductList, getAdditionalProductList,
getBankList, getBankList,
getUserSaleExpandList getUserSaleExpandList,
secondAdditonalList,
getAllSignList,
getAllTeam,
getInsuranceCompany
} from '@/api/common' } from '@/api/common'
import Customer from './components/customer' import Customer from './components/customer'
import FanForm from './components/fanForm' import FanForm from './components/fanForm'
...@@ -258,7 +262,6 @@ const getDictsData = async () => { ...@@ -258,7 +262,6 @@ const getDictsData = async () => {
} }
const response4 = await getBankList(params4) const response4 = await getBankList(params4)
if (response4.code == 200) { if (response4.code == 200) {
response4.data.records = response4.data.records.map(item => { response4.data.records = response4.data.records.map(item => {
return { return {
...item, ...item,
...@@ -274,7 +277,6 @@ const getDictsData = async () => { ...@@ -274,7 +277,6 @@ const getDictsData = async () => {
} }
const response5 = await getUserSaleExpandList(params5) const response5 = await getUserSaleExpandList(params5)
if (response5.code == 200) { if (response5.code == 200) {
response5.data.records = response5.data.records.map(item => { response5.data.records = response5.data.records.map(item => {
return { return {
...item, ...item,
...@@ -284,6 +286,70 @@ const getDictsData = async () => { ...@@ -284,6 +286,70 @@ const getDictsData = async () => {
}) })
dictStore.setUserSaleExpandList(response5.data.records) dictStore.setUserSaleExpandList(response5.data.records)
} }
const params6 = {
pageNo: 1,
pageSize: 99999,
projectBizId: userStore.projectInfo.projectBizId,
tenantBizId: userStore.projectInfo.tenantBizId,
fieldBizId: 'field_olk1qZe81qHHKXbw',
fieldValueBizId: 'field_value_yXzTigvgUdRMFpoR'
}
const response6 = await secondAdditonalList(params6)
if (response6.code == 200) {
response6.data.records = response6.data.records.map(item => {
return {
...item,
label: item.title,
value: item.productLaunchBizId
}
})
dictStore.setProductAdditionalList(response6.data.records)
}
const params7 = {
pageNo: 1,
pageSize: 99999
}
const response7 = await getAllSignList(params7)
if (response7.code == 200) {
response7.data.records = response7.data.records.map(item => {
return {
...item,
label: item.realName,
value: item.userSignBizId
}
})
dictStore.setSignPeopleList(response7.data.records)
}
const params8 = {
pageNo: 1,
pageSize: 99999
}
const response8 = await getAllTeam(params8)
if (response8.code == 200) {
response8.data.records = response8.data.records.map(item => {
return {
...item,
label: item.teamName,
value: item.teamBizId
}
})
dictStore.setAllTeaList(response8.data.records)
}
const params9 = {
pageNo: 1,
pageSize: 99999
}
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
}
})
dictStore.setAllInsuranceCompanyList(response9.data.records)
}
// 请求每个流程中所涉及到的字典值数据 // 请求每个流程中所涉及到的字典值数据
proxy.useDictLists([ proxy.useDictLists([
'csf_employment', 'csf_employment',
...@@ -311,7 +377,8 @@ const getDictsData = async () => { ...@@ -311,7 +377,8 @@ const getDictsData = async () => {
'wj_question_first_category', 'wj_question_first_category',
'wj_question_second_category', 'wj_question_second_category',
'csf_ap_policy_transfer', 'csf_ap_policy_transfer',
'md_bank' 'md_bank',
'csf_property_type'
]) ])
} }
...@@ -354,7 +421,7 @@ function getProcessInfo(fnaBizId, changeTab) { ...@@ -354,7 +421,7 @@ function getProcessInfo(fnaBizId, changeTab) {
// Tab切换前的验证 // Tab切换前的验证
const beforeTabLeave = (activeTabName, oldTabName) => { const beforeTabLeave = (activeTabName, oldTabName) => {
if (processInfo.value.customerBizId) { if (processInfo.value.customerBizId) {
getCustomerInfo(processInfo.value.customerBizId) // getCustomerInfo(processInfo.value.customerBizId)
} }
// 如果切换到总览,始终允许 // 如果切换到总览,始终允许
if (activeTabName === 'overview' || activeTabName === 'customer') { if (activeTabName === 'overview' || activeTabName === 'customer') {
......
...@@ -117,8 +117,21 @@ ...@@ -117,8 +117,21 @@
:editStatus="editStatus" :editStatus="editStatus"
/> />
</div> </div>
<!-- 投保人 -->
<div v-if="tab.name === 'policyholder'"> <div v-if="tab.name === 'policyholder'">
<PolicyHolderInfo <!-- :customerBizId="processInfo.customerBizId" @handleSuccess="handleSuccess"-->
<Customer
:activeName="activeName"
:fatherTabName="tabName"
:fatherStatus="editStatus"
:affixOffset="360"
:tabIndex="tabsList.findIndex(t => t.name === 'policyholder')"
anchorContainer=".appointmentTabPaneBox"
tabSource="policyholder"
ref="policyHolderInfoRef"
:fatherEditStatus="editStatus"
/>
<!-- <PolicyHolderInfo
:activeName="activeName" :activeName="activeName"
:formStatus="formStatus" :formStatus="formStatus"
:customerInfo="customerInfo" :customerInfo="customerInfo"
...@@ -130,10 +143,22 @@ ...@@ -130,10 +143,22 @@
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
@policyEditSuccess="getPolicyDetail" @policyEditSuccess="getPolicyDetail"
/> /> -->
</div> </div>
<div v-if="tab.name === 'insurantInfo'"> <div v-if="tab.name === 'insurantInfo'">
<InsuredInfo <!-- :customerBizId="processInfo.customerBizId" @handleSuccess="handleSuccess"-->
<Customer
:activeName="activeName"
:fatherTabName="tabName"
:fatherStatus="editStatus"
:affixOffset="360"
:tabIndex="tabsList.findIndex(t => t.name === 'insurantInfo')"
anchorContainer=".appointmentTabPaneBox"
tabSource="insurantInfo"
ref="insuredInfoRef"
:fatherEditStatus="editStatus"
/>
<!-- <InsuredInfo
:activeName="activeName" :activeName="activeName"
:formStatus="formStatus" :formStatus="formStatus"
:customerInfo="customerInfo" :customerInfo="customerInfo"
...@@ -146,7 +171,7 @@ ...@@ -146,7 +171,7 @@
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
@policyEditSuccess="getPolicyDetail" @policyEditSuccess="getPolicyDetail"
/> /> -->
</div> </div>
<div v-if="tab.name === 'secondHolder'"> <div v-if="tab.name === 'secondHolder'">
<SecondHolderInfo <SecondHolderInfo
...@@ -317,6 +342,7 @@ import PolicyTransferInfo from './components/policyTransferInfo.vue' ...@@ -317,6 +342,7 @@ import PolicyTransferInfo from './components/policyTransferInfo.vue'
import FileUpload from './components/fileUpload.vue' import FileUpload from './components/fileUpload.vue'
import HealthInfo from './components/healthInfo.vue' import HealthInfo from './components/healthInfo.vue'
import PolicyInfo from '@/views/sign/underwritingMain/components/policyInfo' //新单跟进里的保单信息 import PolicyInfo from '@/views/sign/underwritingMain/components/policyInfo' //新单跟进里的保单信息
import Customer from '@/views/sign/FnaList/components/customer'
import PolicyFileUpload from '@/views/sign/underwritingMain/components/fileUpload.vue' //新单跟进里的保单附件 import PolicyFileUpload from '@/views/sign/underwritingMain/components/fileUpload.vue' //新单跟进里的保单附件
import PolicyBrokerInfo from '@/views/sign/underwritingMain/components/brokerInfo.vue' //新单跟进里的保单附件 import PolicyBrokerInfo from '@/views/sign/underwritingMain/components/brokerInfo.vue' //新单跟进里的保单附件
import PolicyMailing from '@/views/sign/underwritingMain/components/policyMailing.vue' //新单跟进里的保单附件 import PolicyMailing from '@/views/sign/underwritingMain/components/policyMailing.vue' //新单跟进里的保单附件
...@@ -339,7 +365,9 @@ import { ...@@ -339,7 +365,9 @@ import {
getInsuranceProductList, getInsuranceProductList,
getAdditionalProductList, getAdditionalProductList,
getBankList, getBankList,
getUserSaleExpandList getUserSaleExpandList,
secondAdditonalList,
getAllSignList
} from '@/api/common' } from '@/api/common'
import { Check, Edit } from '@element-plus/icons-vue' import { Check, Edit } from '@element-plus/icons-vue'
import { ref, nextTick, onUnmounted } from 'vue' import { ref, nextTick, onUnmounted } from 'vue'
...@@ -384,7 +412,7 @@ const processInfo = ref({ ...@@ -384,7 +412,7 @@ const processInfo = ref({
createTime: proxy.parseTime(new Date()), createTime: proxy.parseTime(new Date()),
customerName: userStore.name customerName: userStore.name
}) })
const editStatus = ref(true) //编辑状态 const editStatus = ref(false) //编辑状态
const execlDialog = ref(false) const execlDialog = ref(false)
const isEmbed = ref(false) //是否作为组件插入 const isEmbed = ref(false) //是否作为组件插入
const policyNo = ref('') //新单跟进保单号 const policyNo = ref('') //新单跟进保单号
...@@ -581,7 +609,7 @@ function getAppointmentInfo(appointmentBizId, changeTab) { ...@@ -581,7 +609,7 @@ function getAppointmentInfo(appointmentBizId, changeTab) {
processInfo.value.status = item.label processInfo.value.status = item.label
} }
}) })
getCustomerInfo(res.data.apiAppointmentInfoDto.customerBizId) // getCustomerInfo(res.data.apiAppointmentInfoDto.customerBizId)
if (!appointmentSummeryInfo.value.apiAppointmentInfoDto.appointmentBizId) { if (!appointmentSummeryInfo.value.apiAppointmentInfoDto.appointmentBizId) {
showStorage.value = true showStorage.value = true
} }
...@@ -708,6 +736,40 @@ const getDictsData = async () => { ...@@ -708,6 +736,40 @@ const getDictsData = async () => {
}) })
dictStore.setUserSaleExpandList(response5.data.records) dictStore.setUserSaleExpandList(response5.data.records)
} }
const params6 = {
pageNo: 1,
pageSize: 99999,
projectBizId: userStore.projectInfo.projectBizId,
tenantBizId: userStore.projectInfo.tenantBizId,
fieldBizId: 'field_olk1qZe81qHHKXbw',
fieldValueBizId: 'field_value_yXzTigvgUdRMFpoR'
}
const response6 = await secondAdditonalList(params6)
if (response6.code == 200) {
response6.data.records = response6.data.records.map(item => {
return {
...item,
label: item.title,
value: item.productLaunchBizId
}
})
dictStore.setProductAdditionalList(response6.data.records)
}
const params7 = {
pageNo: 1,
pageSize: 99999
}
const response7 = await getAllSignList(params7)
if (response7.code == 200) {
response7.data.records = response7.data.records.map(item => {
return {
...item,
label: item.realName,
value: item.userSignBizId
}
})
dictStore.setSignPeopleList(response7.data.records)
}
proxy.useDictLists([ proxy.useDictLists([
'csf_employment', 'csf_employment',
'sys_no_yes', 'sys_no_yes',
...@@ -740,54 +802,6 @@ const getDictsData = async () => { ...@@ -740,54 +802,6 @@ const getDictsData = async () => {
} }
// Tab切换前的验证 // Tab切换前的验证
const beforeTabLeave = (activeTabName, oldTabName) => { const beforeTabLeave = (activeTabName, oldTabName) => {
// 受保人如果选择了本人,使用投保人得信息填充
// oldTabName == 'policyholder' &&
if (activeTabName == 'insurantInfo') {
currentPolicyholderInfo.value = policyHolderInfoRef.value[0].providePolicyholderInfoData()
} else if (
oldTabName !== 'policyholder' &&
activeTabName == 'insurantInfo' &&
showSubmitBtn.value &&
Object.keys(currentPolicyholderInfo.value).length == 0
) {
currentPolicyholderInfo.value = appointmentSummeryInfo.value.apiPolicyholderInfoDto
}
console.log('预约切换tab', currentPolicyholderInfo.value)
// 健康信息模块,如果投保人选择了本人以及受保人选择了本人,健康信息展示投保人/受保人
let policyHolderResult = policyHolderInfoRef.value[0].handleFormValues()
let insuredResult = insuredInfoRef.value[0].handleFormValues()
console.log('policyHolderResult', policyHolderResult)
console.log('insuredResult', insuredResult)
foldInsurantInfo.value = false
if (activeTabName == 'questionnaires') {
// 投保人和受保人都点击过可以拿到最新填写得表单值
if (
policyHolderResult.customerType &&
policyHolderResult.customerType == 'INDIVIDUAL' &&
insuredResult.policyholderRel &&
insuredResult.policyholderRel == 'MYSELF'
) {
foldInsurantInfo.value = true
} else if (
!policyHolderResult.customerType &&
!insuredResult.policyholderRel &&
showSubmitBtn.value
) {
// 如果投保人和受保人都没有点击过,则使用预约单里得信息
let policyHolderInfo = appointmentSummeryInfo.value.apiPolicyholderInfoDto
let insuredInfo = appointmentSummeryInfo.value.apiInsurantInfoDto
if (
policyHolderInfo.customerType &&
policyHolderInfo.customerType == 'INDIVIDUAL' &&
insuredInfo.policyholderRel &&
insuredInfo.policyholderRel == 'MYSELF'
) {
foldInsurantInfo.value = true
}
}
}
return true return true
} }
...@@ -808,15 +822,15 @@ const isObject = value => { ...@@ -808,15 +822,15 @@ const isObject = value => {
} }
const handleSubmit = async type => { const handleSubmit = async type => {
// 提交得时候要拿到各个步骤得表单数据 // 提交得时候要拿到各个步骤得表单数据
if (appointmentInfoRef.value) { // if (appointmentInfoRef.value) {
const result = await appointmentInfoRef.value[0].handleFormValues() // const result = await appointmentInfoRef.value[0].handleFormValues()
submitAppointmentObj.value.apiAppointmentInfoDto = result // submitAppointmentObj.value.apiAppointmentInfoDto = result
if (!submitAppointmentObj.value.apiAppointmentInfoDto) return // if (!submitAppointmentObj.value.apiAppointmentInfoDto) return
} // }
if (productPlanRef.value) { // if (productPlanRef.value) {
submitAppointmentObj.value.apiProductPlanInfoDto = productPlanRef.value[0].handleSubmitForm() // submitAppointmentObj.value.apiProductPlanInfoDto = productPlanRef.value[0].handleSubmitForm()
} // }
if (policyHolderInfoRef.value) { if (policyHolderInfoRef.value) {
submitAppointmentObj.value.apiPolicyholderInfoDto = submitAppointmentObj.value.apiPolicyholderInfoDto =
policyHolderInfoRef.value[0].handleFormValues() policyHolderInfoRef.value[0].handleFormValues()
...@@ -824,6 +838,7 @@ const handleSubmit = async type => { ...@@ -824,6 +838,7 @@ const handleSubmit = async type => {
if (insuredInfoRef.value) { if (insuredInfoRef.value) {
submitAppointmentObj.value.apiInsurantInfoDto = insuredInfoRef.value[0].handleFormValues() submitAppointmentObj.value.apiInsurantInfoDto = insuredInfoRef.value[0].handleFormValues()
} }
return
if (secondHolderInfoRef.value) { if (secondHolderInfoRef.value) {
submitAppointmentObj.value.apiSecondHolderInfoDto = submitAppointmentObj.value.apiSecondHolderInfoDto =
secondHolderInfoRef.value[0].handleFormValues() secondHolderInfoRef.value[0].handleFormValues()
...@@ -832,7 +847,7 @@ const handleSubmit = async type => { ...@@ -832,7 +847,7 @@ const handleSubmit = async type => {
submitAppointmentObj.value.apiBeneficiaryInfoDtoList = submitAppointmentObj.value.apiBeneficiaryInfoDtoList =
beneficiaryInfoRef.value[0].handleFormValues() beneficiaryInfoRef.value[0].handleFormValues()
} }
// return return
// 代表新增预约 // 代表新增预约
if (formStatus.value == 'appointmentAdd' && !idsObj.value.appointmentBizId) { if (formStatus.value == 'appointmentAdd' && !idsObj.value.appointmentBizId) {
submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId = submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId =
...@@ -913,7 +928,6 @@ const handleSubmit = async type => { ...@@ -913,7 +928,6 @@ const handleSubmit = async type => {
// 编辑预约单 // 编辑预约单
editAppointmentDetail(submitAppointmentObj.value).then(res => { editAppointmentDetail(submitAppointmentObj.value).then(res => {
if (res.code == 200) { if (res.code == 200) {
// getAppointmentInfo(idsObj.value.appointmentBizId)
appointmentInfoRef.value[0].handleEditStatus(true) appointmentInfoRef.value[0].handleEditStatus(true)
productPlanRef.value[0].handleEditStatus(true) productPlanRef.value[0].handleEditStatus(true)
policyHolderInfoRef.value[0].handleEditStatus(true) policyHolderInfoRef.value[0].handleEditStatus(true)
...@@ -991,7 +1005,7 @@ watch( ...@@ -991,7 +1005,7 @@ watch(
//代表是新增预约状态 //代表是新增预约状态
if (!idsObj.value.appointmentBizId) { if (!idsObj.value.appointmentBizId) {
formStatus.value = 'appointmentAdd' formStatus.value = 'appointmentAdd'
getCustomerInfo(props.processDetail.customerBizId) // getCustomerInfo(props.processDetail.customerBizId)
tabsList.value = [ tabsList.value = [
{ {
...@@ -1151,7 +1165,7 @@ const getPolicyDetail = tabName => { ...@@ -1151,7 +1165,7 @@ const getPolicyDetail = tabName => {
} }
if (route.query.source == 'policyList') { if (route.query.source == 'policyList') {
idsObj.value.policyBizId = route.query.policyBizId idsObj.value.policyBizId = route.query.policyBizId
getCustomerInfo(props.policyDetailInfo.customerBizId) // getCustomerInfo(props.policyDetailInfo.customerBizId)
appointmentSummeryInfo.value = JSON.parse(JSON.stringify(props.policyDetailInfo)) appointmentSummeryInfo.value = JSON.parse(JSON.stringify(props.policyDetailInfo))
if (appointmentSummeryInfo.value.apiProductPlanInfoDto) { if (appointmentSummeryInfo.value.apiProductPlanInfoDto) {
appointmentSummeryInfo.value.apiAppointmentInfoDto = JSON.parse( appointmentSummeryInfo.value.apiAppointmentInfoDto = JSON.parse(
......
...@@ -60,19 +60,32 @@ ...@@ -60,19 +60,32 @@
/> />
</el-select> </el-select>
<!-- 带时分的时间框 --> <!-- 带时分的时间框 -->
<div
v-if="child.domType === 'datetimePicker'"
class="compositionDateTime"
>
<el-date-picker <el-date-picker
v-model="form[child.key]" type="date"
placeholder="选择日期"
style="width: 100%" style="width: 100%"
v-if="child.domType === 'datetimePicker'" v-model="form[child.key]"
:type="child.timeType || 'datetime'"
:placeholder="child.placeholder"
:disabled="editStatus" :disabled="editStatus"
@change="handleDateChange(child)" @change="handleDateChange(child)"
:disabled-date="time => disabledDate(time, child)" :disabled-date="time => disabledDate(time, child)"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD"
@clear="handleDateClear(child)" @clear="handleDateClear(child)"
/> />
<span class="text-gray-500">-</span>
<el-time-picker
placeholder="选择时分"
style="width: 100%"
v-model="child.timeValue"
:disabled="editStatus"
format="HH:mm"
value-format="HH:mm"
/>
</div>
<!-- 不带时分 --> <!-- 不带时分 -->
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
...@@ -217,6 +230,105 @@ ...@@ -217,6 +230,105 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-if="father.key == 'userSignDtoList'">
<el-table-column label="姓名" prop="name" align="center">
<template #header>
<span class="required-label">姓名</span>
</template>
<template #default="scope">
<el-select
v-model="scope.row.name"
filterable
remote
reserve-keyword
placeholder="请选择"
:remote-method="query => searchSelectList(query, 'name')"
:loading="searchLoadingStates['name']"
:disabled="editStatus"
>
<el-option
v-for="item in searchOptions['name'] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="手机号" prop="phone" align="center">
<template #header>
<span class="required-label">手机号</span>
</template>
<template #default="scope">
<el-input
v-model="scope.row.phone"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="执业编码" prop="practiceCode" align="center">
<template #header>
<span class="required-label">执业编码</span>
</template>
<template #default="scope">
<el-input
v-model="scope.row.practiceCode"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="邮箱" prop="email" align="center">
<template #default="scope">
<el-input
v-model="scope.row.email"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column label="证件类型" prop="cardType" align="center">
<template #default="scope">
<el-select
v-model="scope.row.cardType"
placeholder="请选择"
:disabled="editStatus"
clearable
>
<el-option
v-for="item in fetchDictData('csf_id_type')"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="证件号" prop="cardNo" align="center">
<template #default="scope">
<el-input
v-model="scope.row.cardNo"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="操作">
<template #default="scope">
<el-icon
@click="deleteChildren(father, scope.$index)"
class="deleteIcon"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
</el-table> </el-table>
</el-row> </el-row>
</template> </template>
...@@ -224,20 +336,6 @@ ...@@ -224,20 +336,6 @@
</div> </div>
</el-row> </el-row>
</div> </div>
<!-- <el-row v-if="props.idsObj.appointmentBizId">
<el-col>
<div class="tabButton">
<el-button
type="primary"
icon="Check"
@click="submitForm"
size="large"
:disabled="editStatus"
>提交</el-button
>
</div>
</el-col>
</el-row> -->
</el-form> </el-form>
</template> </template>
</CommonForm> </CommonForm>
...@@ -263,35 +361,6 @@ ...@@ -263,35 +361,6 @@
@close="handleCloseDrawer" @close="handleCloseDrawer"
@confirmCountry="confirmDrawer" @confirmCountry="confirmDrawer"
/> />
<!-- <CommonDialog
dialogTitle="签约信息错误提示"
confirmText="下载行程单"
cancleText="关闭"
dialogWidth="70%"
:openDialog="showError"
@close="showError = false"
>
<div class="dialogBox">
<div class="dialogItem" v-for="item in detailData">
<div class="dialogItemTitle">{{ item.title }}</div>
<DetailPanel
:data="item.data"
:row-span="24"
col-gap="10px"
label-width="120px"
row-height="45px"
:show-col-border="true"
/>
</div>
<div class="remarkBOx">
<div class="remarkTitle">备注</div>
<div class="remarkContent" v-if="appointmentSummeryInfo.remark">
{{ appointmentSummeryInfo.remark }}
</div>
<div class="remarkEmpty" v-else>暂无备注</div>
</div>
</div>
</CommonDialog> -->
</div> </div>
</template> </template>
<script setup name="appointmentInfo"> <script setup name="appointmentInfo">
...@@ -303,9 +372,8 @@ import Phone from '@/views/components/phone' ...@@ -303,9 +372,8 @@ import Phone from '@/views/components/phone'
import Address from '@/views/components/address' import Address from '@/views/components/address'
import { watch, nextTick } from 'vue' import { watch, nextTick } from 'vue'
import { getCustomerDetail } from '@/api/sign/fna'
import { editAppointmentInfo, newPolicy } from '@/api/sign/appointment' import { editAppointmentInfo, newPolicy } from '@/api/sign/appointment'
import { getBankList, getUserSaleExpandList } from '@/api/common' import { getBankList, getAllSignList, getUserSaleExpandList } from '@/api/common'
import CommonForm from '@/views/components/commonForm' import CommonForm from '@/views/components/commonForm'
import CardOne from '@/components/formCard/cardOne' import CardOne from '@/components/formCard/cardOne'
import useDictStore from '@/store/modules/dict' import useDictStore from '@/store/modules/dict'
...@@ -316,7 +384,7 @@ const props = defineProps({ ...@@ -316,7 +384,7 @@ const props = defineProps({
formStatus: { type: String, default: '' }, //父组件状态,新增、修改 formStatus: { type: String, default: '' }, //父组件状态,新增、修改
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象 idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiAppointmentInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的约信息的详情 apiAppointmentInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态 appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerBizId: { type: String, default: '' }, //提交状态,新增、修改 customerBizId: { type: String, default: '' }, //提交状态,新增、修改
fatherTabName: { type: String, default: '' }, //一级tab名称 fatherTabName: { type: String, default: '' }, //一级tab名称
...@@ -327,7 +395,6 @@ const props = defineProps({ ...@@ -327,7 +395,6 @@ const props = defineProps({
const emit = defineEmits(['handleSuccessEdit']) const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const appointmentRef = ref(null) const appointmentRef = ref(null)
// const anchorList = ref([]) //锚点列表
const showPhoneDrawer = ref(false) //电话抽屉开关 const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关 const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关 const showCountryDrawer = ref(false) //国家/地区抽屉开关
...@@ -422,18 +489,31 @@ const addChildren = father => { ...@@ -422,18 +489,31 @@ const addChildren = father => {
phone: '', phone: '',
realName: '' realName: ''
} }
let obj5 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
name: '', //姓名
practiceCode: '', //执业编码
phone: '', //手机号
cardType: '', //证件类型
cardNo: '', //证件号码
email: '' //邮箱
}
for (const section of processedData) { for (const section of processedData) {
if (father.key == 'referrerDtoList' && section.key == father.key) { if (father.key == 'referrerDtoList' && section.key == father.key) {
section.data.push(obj4) section.data.push(obj4)
} }
if (father.key == 'userSignDtoList' && section.key == father.key) {
section.data.push(obj5)
}
} }
//更新form表单对应的数据,以便收集填写的值 //更新form表单对应的数据,以便收集填写的值
// form.value[father.key].push(obj) // form.value[father.key].push(obj)
processedAppointmentData.value = processedData processedAppointmentData.value = processedData
} }
const deleteChildren = (father, childIndex) => { const deleteChildren = (father, childIndex) => {
if (editStatus.value) { if (props.editStatus.value) {
proxy.$modal.confirm(`请先点击编辑再进行删除操作`, { showCancel: '0', title: '填写提示' }) proxy.$modal.confirm(`请先点击编辑再进行删除操作`, { showCancel: '0', title: '填写提示' })
return return
} }
...@@ -442,6 +522,9 @@ const deleteChildren = (father, childIndex) => { ...@@ -442,6 +522,9 @@ const deleteChildren = (father, childIndex) => {
if (father.key == 'referrerDtoList' && section.key == father.key) { if (father.key == 'referrerDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1) section.data.splice(childIndex, 1)
} }
if (father.key == 'userSignDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
} }
processedAppointmentData.value = processedData processedAppointmentData.value = processedData
} }
...@@ -486,6 +569,23 @@ const searchSelectList = async (query, key) => { ...@@ -486,6 +569,23 @@ const searchSelectList = async (query, key) => {
}) })
searchOptions.value[key] = response5.data.records searchOptions.value[key] = response5.data.records
} }
} else if (key == 'name') {
const params5 = {
pageNo: 1,
pageSize: 10,
realName: queryString
}
const response5 = await getAllSignList(params5)
if (response5.code == 200) {
response5.data.records = response5.data.records.map(item => {
return {
...item,
label: item.realName,
value: item.userSignBizId
}
})
searchOptions.value[key] = response5.data.records
}
} }
} catch (error) { } catch (error) {
console.error(` 搜索失败`, error) console.error(` 搜索失败`, error)
...@@ -563,8 +663,7 @@ const handleDateChange = child => { ...@@ -563,8 +663,7 @@ const handleDateChange = child => {
resetShow({ type: 'child', key: 'openAccountEndTime', status: false, flag: 'disabled' }) resetShow({ type: 'child', key: 'openAccountEndTime', status: false, flag: 'disabled' })
disabledDate(form.value['openAccountStartTime'], { key: 'openAccountEndTime' }) disabledDate(form.value['openAccountStartTime'], { key: 'openAccountEndTime' })
} }
// resetShow({ type: 'child', key: 'departureTime', status: false, flag: 'disabled' })
// disabledDate(form.value['arrivalTime'], { key: 'departureTime' })
// 离港时间在到港时间之前 // 离港时间在到港时间之前
if ( if (
child.key == 'arrivalTime' && child.key == 'arrivalTime' &&
...@@ -1099,23 +1198,17 @@ const handleFormValues = () => { ...@@ -1099,23 +1198,17 @@ const handleFormValues = () => {
} }
}) })
} }
if (submitObj['departureTime']) {
// 开始时间是否在结束时间之前
if (
submitObj['arrivalTime'] &&
!dayjs(submitObj['arrivalTime']).isBefore(dayjs(submitObj['departureTime']))
) {
errorFields.value.push({
message: '预约信息模块--离港时间必须晚于到港时间!!'
})
return undefined
}
}
let obj = { let obj = {
realName: '转介人姓名', realName: '转介人姓名',
phone: '转介人手机', phone: '转介人手机',
email: '转介人邮箱' email: '转介人邮箱'
} }
let obj1 = {
name: '签单员姓名',
phone: '签单员电话',
practiceCode: '签单员执业编码'
}
processedAppointmentData.value.forEach(item => { processedAppointmentData.value.forEach(item => {
if (item.key == 'referrerDtoList') { if (item.key == 'referrerDtoList') {
if (form.value['isReferrerAccompany'] == 1 && item.data.length > 0) { if (form.value['isReferrerAccompany'] == 1 && item.data.length > 0) {
...@@ -1130,7 +1223,7 @@ const handleFormValues = () => { ...@@ -1130,7 +1223,7 @@ const handleFormValues = () => {
for (const key in item1) { for (const key in item1) {
if (!item1[key]) { if (!item1[key]) {
errorFields.value.push({ errorFields.value.push({
message: `第${index + 1}${obj[key]}不能为空` message: `陪同转介人-${index + 1}${obj[key]}不能为空`
}) })
} }
} }
...@@ -1142,11 +1235,61 @@ const handleFormValues = () => { ...@@ -1142,11 +1235,61 @@ const handleFormValues = () => {
}) })
} else if (form.value['isReferrerAccompany'] == 1 && item.data.length == 0) { } else if (form.value['isReferrerAccompany'] == 1 && item.data.length == 0) {
errorFields.value.push({ errorFields.value.push({
message: '预约信息模块--转介人陪同时,陪同转介人信息不能为空!!' message: '签约信息模块--转介人陪同时,陪同转介人信息不能为空!!'
})
}
}
if (item.key == 'position') {
item.data.forEach((item1, index) => {
if (item1.compositionTime) {
if (item1.timeValue) {
submitObj[item1.key] = form.value[item1.key] + ' ' + item1.timeValue + ':00'
} else {
submitObj[item1.key] = form.value[item1.key] + ' 00:00:00'
}
}
}) })
} }
if (item.key == 'userSignDtoList' && item.data.length > 0) {
submitObj['userSignDtoList'] = item.data.map((item1, index) => {
if (item1.name) {
searchOptions.value['name'].forEach(item2 => {
if (item1.name == item2.userSignBizId) {
item1.name = item2.realName
} }
}) })
}
for (const key in item1) {
if (!item1[key]) {
errorFields.value.push({
message: `签单员-第${index + 1}${obj1[key]}不能为空`
})
}
}
return {
name: item1.name,
phone: item1.phone,
email: item1.email,
practiceCode: item1.practiceCode,
cardType: item1.cardType,
cardNo: item1.cardNo
}
})
}
})
console.log('submitObj', submitObj)
if (submitObj['departureTime']) {
// 开始时间是否在结束时间之前
if (
submitObj['arrivalTime'] &&
!dayjs(submitObj['arrivalTime']).isBefore(dayjs(submitObj['departureTime']))
) {
errorFields.value.push({
message: '签约信息模块--离港时间必须晚于到港时间!!'
})
// return undefined
}
}
if (errorFields.value.length > 0) { if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message) proxy.$message.error(errorFields.value[0].message)
...@@ -1337,6 +1480,11 @@ defineExpose({ ...@@ -1337,6 +1480,11 @@ defineExpose({
font-size: 18px; font-size: 18px;
padding-top: 10px; padding-top: 10px;
} }
.compositionDateTime {
display: flex;
width: 100%;
box-sizing: border-box;
}
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
.formBtn { .formBtn {
margin-top: 0 !important; margin-top: 0 !important;
......
<template> <template>
<!-- 只画好了样式具体的逻辑还没处理 -->
<div v-if="processedProductData.length > 0"> <div v-if="processedProductData.length > 0">
<div ref="productRef"> <div ref="productRef">
<!-- <el-row>
<el-col :span="24">
<div class="topBtn">
<el-button
v-if="props.showSubmitBtn"
type="primary"
icon="EditPen"
@click="handleEditStatus(!editStatus)"
>编辑</el-button
>
</div>
</el-col>
</el-row> -->
<CommonForm <CommonForm
:anchorList="anchorList" :anchorList="anchorList"
:affixOffset="360" :affixOffset="360"
...@@ -122,7 +110,7 @@ ...@@ -122,7 +110,7 @@
icon="Plus" icon="Plus"
size="small" size="small"
style="margin-bottom: 10px" style="margin-bottom: 10px"
@click="addChildren(father, scope.$index)" @click="addChildren(father)"
>{{ father.addChildrenTxt }}</el-button >{{ father.addChildrenTxt }}</el-button
> >
</el-col> </el-col>
...@@ -141,56 +129,50 @@ ...@@ -141,56 +129,50 @@
</template> </template>
</el-table> </el-table>
</el-row> </el-row>
<!-- 有子孙的dom --> </template>
<!-- <el-row v-if="father.child == 'yes' && father.data.length > 0" :gutter="20"> </CardOne>
<template v-for="(child, childIndex) in father.data" :key="child.id">
<el-col :span="child.span">
<div
class="childLabel"
v-if="father.key == 'apiProductPlanAdditionalInfoDtoList'"
@click="deleteChildren(father, childIndex)"
>
<span>{{ `${child.childTitle}-${childIndex + 1}` }}</span>
<el-icon
v-if="child.deleteBtn"
style="color: red; font-size: 18px; margin-left: 10px"
><Delete
/></el-icon>
</div> </div>
</el-col> </el-row>
<template v-for="grandchildren in child.children" :key="grandchildren.key"> </el-form>
<el-col </template>
:sm="grandchildren.sm" </CommonForm>
:lg="grandchildren.lg" </div>
class="formItem" <CommonDialog
v-if=" :dialogTitle="dialogTitle"
grandchildren.show && form[father.key] && form[father.key][childIndex] confirmText="确定"
" cancleText="关闭"
dialogWidth="70%"
:showClose="true"
:openDialog="dialogVisible"
@close="dialogVisible = false"
> >
<div class="dialogBox">
<el-form>
<el-row :gutter="20">
<template v-for="(child, dIndex) in additionalProductForm">
<el-col :sm="child.sm" :lg="child.lg" class="formItem">
<el-form-item <el-form-item
:label="grandchildren.label" :label="child.label"
:prop="grandchildren.key" :prop="child.key"
:key="grandchildren.key" :key="child.key"
:label-width="grandchildren.labelWidth" :label-width="child.labelWidth"
:label-position="grandchildren.labelPosition" :label-position="child.labelPosition"
> >
<el-input <el-input
v-if="grandchildren.domType === 'Input'" v-if="child.domType === 'Input'"
:type="grandchildren.inputType" :type="child.inputType"
v-model="form[father.key][childIndex][grandchildren.key]" v-model="child.value"
:placeholder="grandchildren.placeholder" :placeholder="child.placeholder"
maxlength="30" maxlength="30"
:disabled="grandchildren.disabled"
/> />
<el-select <el-select
v-if="grandchildren.domType === 'Select'" v-if="child.domType === 'Select'"
v-model="form[father.key][childIndex][grandchildren.key]" v-model="child.value"
:placeholder="grandchildren.placeholder" :placeholder="child.placeholder"
:disabled="grandchildren.disabled"
> >
<el-option <el-option
v-for="item in grandchildren.options" v-for="item in child.options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -198,25 +180,24 @@ ...@@ -198,25 +180,24 @@
</el-select> </el-select>
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
v-if="grandchildren.domType === 'DatePicker'" v-if="child.domType === 'DatePicker'"
v-model="form[father.key][childIndex][grandchildren.key]" v-model="child.value"
type="date" type="date"
:placeholder="grandchildren.placeholder" :placeholder="child.placeholder"
:disabled="grandchildren.disabled"
/> />
<el-select <el-select
v-model="form[father.key][childIndex][grandchildren.key]" v-model="child.value"
v-if="grandchildren.domType === 'SearchSelect'" v-if="child.domType === 'SearchSelect'"
filterable filterable
remote remote
reserve-keyword reserve-keyword
placeholder="请输入关键词搜索" placeholder="请输入关键词搜索"
:remote-method="query => searchSelectList(query, grandchildren.key)" @change="handleSearchSelectChange(child.key, dIndex)"
:loading="searchLoadingStates[grandchildren.key]" :remote-method="query => searchSelectList(query, child.key)"
:disabled="grandchildren.disabled" :loading="searchLoadingStates[child.key]"
> >
<el-option <el-option
v-for="item in searchOptions[grandchildren.key] || []" v-for="item in searchOptions[child.key] || []"
:key="item.id" :key="item.id"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -225,42 +206,26 @@ ...@@ -225,42 +206,26 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
</template>
</el-row> -->
</template>
</CardOne>
</div>
</el-row>
<el-row v-if="props.showSubmitBtn">
<el-col>
<div class="tabButton">
<el-button
type="success"
icon="Check"
@click="submitForm()"
size="large"
:disabled="editStatus"
>保存</el-button
>
</div>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</template>
</CommonForm>
</div> </div>
</CommonDialog>
</div> </div>
</template> </template>
<script setup name="customer"> <script setup name="customer">
import CommonForm from '@/views/components/commonForm' import CommonForm from '@/views/components/commonForm'
import CommonDialog from '@/components/commonDialog'
import CardOne from '@/components/formCard/cardOne' import CardOne from '@/components/formCard/cardOne'
import useDictStore from '@/store/modules/dict' import useDictStore from '@/store/modules/dict'
import productDomData from '@/formJson/productPlan' import productDomData from '@/formJson/productPlan'
import { watch } from 'vue' import { watch } from 'vue'
import { getInsuranceProductList, getAdditionalProductList } from '@/api/common' import {
getInsuranceProductList,
getAdditionalProductList,
secondAdditonalList
} from '@/api/common'
import { editProductPlanInfo, delAdditional } from '@/api/sign/appointment' import { editProductPlanInfo, delAdditional } from '@/api/sign/appointment'
import { updatePolicyProduct, delPolicyAdditional } from '@/api/sign/underwritingMain' import { updatePolicyProduct, delPolicyAdditional } from '@/api/sign/underwritingMain'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
...@@ -286,15 +251,18 @@ const props = defineProps({ ...@@ -286,15 +251,18 @@ const props = defineProps({
const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess']) const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// const { sys_no_yes } = proxy.useDict('sys_no_yes') // const { sys_no_yes } = proxy.useDict('sys_no_yes')
const dialogTitle = ref('新增')
const dialogVisible = ref(false)
const productRef = ref(null) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key const productRef = ref(null) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const errorFields = ref([]) // 存储校验失败的字段信息 const errorFields = ref([]) // 存储校验失败的字段信息
const anchorList = ref([]) // 存储校验失败的字段信息 // const anchorList = ref([]) // 存储校验失败的字段信息
// const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑 // const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const openList = ref(false) // 客户列表弹窗 const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作 const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const currencyType = ref([]) // 是否列表 const currencyType = ref([]) // 是否列表
const searchOptions = ref({}) // 存储不同key对应的选项 const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态 const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const additionalProductForm = ref([]) // 附加险的表单
const data = reactive({ const data = reactive({
form: {}, form: {},
tempForm: {}, //由于切换tab的时候,表单数据会重置,所以需要保存一份临时表单数据 tempForm: {}, //由于切换tab的时候,表单数据会重置,所以需要保存一份临时表单数据
...@@ -310,150 +278,15 @@ const data = reactive({ ...@@ -310,150 +278,15 @@ const data = reactive({
const { form, rules, processedProductData, queryParams, oldProductDomData, tempForm } = toRefs(data) const { form, rules, processedProductData, queryParams, oldProductDomData, tempForm } = toRefs(data)
// 添加表单子级dom // 添加表单子级dom
const addChildren = father => { const addChildren = father => {
if (editStatus.value) { if (props.editStatus) {
proxy.$message.warning('请先点击编辑') proxy.$message.warning('请先点击编辑')
return return
} }
return if (father.key == 'apiProductPlanAdditionalInfoDtoList') {
const processedData = JSON.parse(JSON.stringify(processedProductData.value)) dialogTitle.value = '新增附加计划'
let obj = { additionalProductForm.value = JSON.parse(JSON.stringify(father.formItem))
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识 dialogVisible.value = true
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',
options: fetchDictData('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 //栅格布局份数
}
]
} }
for (const section of processedData) {
if (father.key == 'apiProductPlanAdditionalInfoDtoList' && section.key == father.key) {
section.data.push(obj)
}
}
//更新form表单对应的数据,以便收集填写的值
form.value[father.key].push(obj)
processedProductData.value = processedData
} }
const deleteChildren = (father, childIndex) => { const deleteChildren = (father, childIndex) => {
if (editStatus.value) { if (editStatus.value) {
...@@ -510,33 +343,34 @@ const deleteChildren = (father, childIndex) => { ...@@ -510,33 +343,34 @@ const deleteChildren = (father, childIndex) => {
processedProductData.value = processedData processedProductData.value = processedData
} }
const handleSearchSelectChange = (father, child) => { const handleSearchSelectChange = (key, index) => {
let productItem = dictStore.insureProductList.filter(item => { // 附加计划选择产品后,给供款期数下拉框赋值
return item.value == form.value[father.key][child.key] if (key == 'productLaunchName') {
}) additionalProductForm.value.forEach(item => {
let options = productItem[0].paymentTerm.split(',').map(item => { searchOptions.value['productLaunchName'].forEach(item1 => {
return { if (item1.value == additionalProductForm.value[index]['value']) {
label: item, item1.apiAttributeSettingDtoList.forEach(item2 => {
value: item if (
} item2.attributeSettingBizId == 'attribute_setting_okpcuc8tlXRfVIAy' &&
item.key == 'issueNumber'
) {
if (item2.value) {
item.options = item2.value
.split(/[,,;;\s]+/)
.map(item => item.trim())
.filter(item => item !== '')
.map(item => {
return { label: item, value: item }
}) })
const processedData = JSON.parse(JSON.stringify(processedProductData.value)) if (item.options.length > 0) item.value = item.options[0].value
for (const section of processedData) {
if (section.key == father.key) {
if (section.data) {
for (const field of section.data) {
if (field.dictType && field.dictType == 'paymentTerm') {
field.options = options
}
}
} }
} }
})
} }
if (options.length > 0) { })
form.value[father.key]['paymentTerm'] = options[0].value })
} }
processedProductData.value = processedData
} }
// 下拉框搜索方法 // 下拉框搜索方法
// 搜索方法 // 搜索方法
...@@ -567,20 +401,24 @@ const searchSelectList = async (query, fieldKey) => { ...@@ -567,20 +401,24 @@ const searchSelectList = async (query, fieldKey) => {
} }
} }
// 可以添加其他字段的处理,可以放其他的字段得请求,目前只有accountName,以后有了其他的在填充 // 可以添加其他字段的处理,可以放其他的字段得请求,目前只有accountName,以后有了其他的在填充
else if (fieldKey === 'addProductName') { else if (fieldKey === 'productLaunchName') {
const params = { const params = {
productName: query.trim(), productName: query.trim(),
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
projectBizId: userStore.projectInfo.projectBizId,
tenantBizId: userStore.projectInfo.tenantBizId,
fieldBizId: 'field_olk1qZe81qHHKXbw',
fieldValueBizId: 'field_value_yXzTigvgUdRMFpoR'
} }
const response = await getAdditionalProductList(params) const response = await secondAdditonalList(params)
if (response.code == 200) { if (response.code == 200) {
response.data.records = response.data.records.map(item => { response.data.records = response.data.records.map(item => {
return { return {
...item, ...item,
label: item.productName, label: item.title,
value: item.additionalProductBizId value: item.productLaunchBizId
} }
}) })
searchOptions.value[fieldKey] = response.data.records searchOptions.value[fieldKey] = response.data.records
...@@ -615,7 +453,7 @@ const processFormData = async () => { ...@@ -615,7 +453,7 @@ const processFormData = async () => {
const processedData = JSON.parse(JSON.stringify(productDomData)) const processedData = JSON.parse(JSON.stringify(productDomData))
for (const section of processedData) { for (const section of processedData) {
anchorList.value.push({ title: section.anchorKey, name: section.fatherTitle }) // anchorList.value.push({ title: section.anchorKey, name: section.fatherTitle })
if (section.fatherRequired) { if (section.fatherRequired) {
rules.value[section.key] = {} rules.value[section.key] = {}
} }
...@@ -625,6 +463,13 @@ const processFormData = async () => { ...@@ -625,6 +463,13 @@ const processFormData = async () => {
} else if (section.keyType == 'Object') { } else if (section.keyType == 'Object') {
form.value[section.key] = {} form.value[section.key] = {}
} }
if (section.formItem) {
section.formItem.forEach(item => {
if (item.dictType) {
item.options = fetchDictData(item.dictType)
}
})
}
if (section.data) { if (section.data) {
for (const formKey in form.value) { for (const formKey in form.value) {
if (section.key == formKey) { if (section.key == formKey) {
...@@ -663,7 +508,7 @@ const processFormData = async () => { ...@@ -663,7 +508,7 @@ const processFormData = async () => {
/* /*
1.没有嵌套子级的也就是没有children的数据加rules,根据data中的required字段判断是否必填 1.没有嵌套子级的也就是没有children的数据加rules,根据data中的required字段判断是否必填
*/ */
if (field.required && section.child == 'no') { if (field.required) {
rules.value[section.key][field.key] = [ rules.value[section.key][field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' } { required: true, message: `${field.label}不能为空`, trigger: 'blur' }
] ]
...@@ -706,9 +551,6 @@ const processFormData = async () => { ...@@ -706,9 +551,6 @@ const processFormData = async () => {
// editStatus.value = true // editStatus.value = true
// processedProductData.value = processedData // processedProductData.value = processedData
//在流程和预约的时候要调用这个方法回显修改数据 //在流程和预约的时候要调用这个方法回显修改数据
console.log('====================================')
console.log('props.apiProductPlanInfoDto', props.apiProductPlanInfoDto)
console.log('====================================')
setFormValue(props.apiProductPlanInfoDto, processedData) setFormValue(props.apiProductPlanInfoDto, processedData)
} else { } else {
// editStatus.value = false // editStatus.value = false
...@@ -1107,6 +949,15 @@ const submitForm = saveType => { ...@@ -1107,6 +949,15 @@ const submitForm = saveType => {
} }
}) })
} }
const anchorList = computed(() => {
let data = []
for (const section of processedProductData.value) {
if (section.showMoudle) {
data.push({ title: section.anchorKey, name: section.fatherTitle })
}
}
return data
})
// 因为tab嵌套了两层,所以需要监听父组件的tab否则锚点的显示就会有bug // 因为tab嵌套了两层,所以需要监听父组件的tab否则锚点的显示就会有bug
watch( watch(
() => props.fatherTabName, () => props.fatherTabName,
...@@ -1119,6 +970,7 @@ watch( ...@@ -1119,6 +970,7 @@ watch(
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
productRef.value = null
tempForm.value = { ...form.value } tempForm.value = { ...form.value }
if (newVal === 'productPlan') { if (newVal === 'productPlan') {
openList.value = false openList.value = false
......
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