Commit 2fbd81ef by yuzhenWang

优化修复bug,发布测试

parent 3fdb591d
......@@ -107,7 +107,6 @@ export function completePolicyFortune(data) {
})
}
// 获取对账公司
// /csf/api/reconciliation_company/list/page
export function getReconciliationCompanyList(data) {
......@@ -148,7 +147,6 @@ export function addPolicyFortuneAccount(data) {
})
}
// 删除发佣
// /csf/api/fortune/delete/fortuneAccount
export function deletePolicyFortuneAccount(data) {
......@@ -168,11 +166,27 @@ export function addPolicyCommission(data) {
data: data
})
}
// 入账管理的统计数据
export function incomeStatistics(data) {
return request({
url: '/csf/api/commission/statistics',
method: 'post',
data: data
})
}
// 出账管理的统计数据
export function billStatistics(data) {
return request({
url: '/csf/api/fortune/statistics',
method: 'post',
data: data
})
}
// 出账管理的统计数据
export function salaryStatistics(data) {
return request({
url: '/csf/api/fortune/fortuneAccount/statistics',
method: 'post',
data: data
})
}
......@@ -56,6 +56,37 @@ export function getPolicyStatus(policyBizId) {
method: 'get'
})
}
// 获取预计来佣生成状态
export function expectedFortuneIsGenerate(policyNo) {
return request({
url: `/csf/api/expectedFortune/isGenerate?policyNo=${policyNo}`,
method: 'get'
})
}
// 生成签约单
export function policyFollowReport(policyBizId) {
return request({
url: `/csf/api/policy_follow/report/download?policyBizId=${policyBizId}`,
method: 'get',
responseType: 'blob' // 关键设置
})
}
// 生成预计发佣
export function expectedFortuneGenerate(data) {
return request({
url: '/csf/api/expectedFortune/generate',
method: 'post',
data: data
})
}
//发佣日志信息
export function getExpectedFortuneLog(data) {
return request({
url: '/csf/api/expectedFortuneLog/page',
method: 'post',
data: data
})
}
// 新单跟进附件列表
export function getAttachmentList(data) {
return request({
......@@ -142,6 +173,14 @@ export function getCommissionList(data) {
data: data
})
}
// 新单跟进的预计发佣列表
export function getExpectedFortuneList(data) {
return request({
url: '/csf/api/expectedFortune/page',
method: 'post',
data: data
})
}
// 新单跟进的预计来佣单个提交
export function editSigalCommission(data) {
return request({
......@@ -173,3 +212,4 @@ export function changePolicyStatus(data) {
data: data
})
}
......@@ -3,11 +3,15 @@
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span
v-if="(item.elTagType == 'default' || item.elTagType == '') && (item.elTagClass == '' || item.elTagClass == null)"
v-if="
(item.elTagType == 'default' || item.elTagType == '') &&
(item.elTagClass == '' || item.elTagClass == null)
"
:key="item.value"
:index="index"
:class="item.elTagClass"
>{{ item.label + " " }}</span>
>{{ item.label + ' ' }}</span
>
<el-tag
v-else
:disable-transitions="true"
......@@ -15,7 +19,8 @@
:index="index"
:type="item.elTagType"
:class="item.elTagClass"
>{{ item.label + " " }}</el-tag>
>{{ item.label + ' ' }}</el-tag
>
</template>
</template>
<template v-if="unmatch && showValue">
......@@ -32,30 +37,39 @@ const props = defineProps({
// 数据
options: {
type: Array,
default: null,
default: null
},
// 当前的值
value: [Number, String, Array],
// 当未找到匹配的数据时,显示value
showValue: {
type: Boolean,
default: true,
default: true
},
separator: {
type: String,
default: ",",
default: ','
}
})
const values = computed(() => {
if (props.value === null || typeof props.value === 'undefined' || props.value === '') return []
return Array.isArray(props.value) ? props.value.map(item => '' + item) : String(props.value).split(props.separator)
return Array.isArray(props.value)
? props.value.map(item => '' + item)
: String(props.value).split(props.separator)
})
const unmatch = computed(() => {
unmatchArray.value = []
// 没有value不显示
if (props.value === null || typeof props.value === 'undefined' || props.value === '' || !Array.isArray(props.options) || props.options.length === 0) return false
if (
props.value === null ||
typeof props.value === 'undefined' ||
props.value === '' ||
!Array.isArray(props.options) ||
props.options.length === 0
)
return false
// 传入值为数组
let unmatch = false // 添加一个标志来判断是否有未匹配项
values.value.forEach(item => {
......@@ -68,9 +82,9 @@ const unmatch = computed(() => {
})
function handleArray(array) {
if (array.length === 0) return ""
if (array.length === 0) return ''
return array.reduce((pre, cur) => {
return pre + " " + cur
return pre + ' ' + cur
})
}
</script>
......
......@@ -178,7 +178,7 @@ const applicant = [
label: '通讯地址',
commonKey: true, //是否是公共字段
key: 'txAddress',
// customerKey: 'mailingAddress',
customerKey: 'residenceAddress',
domType: 'arrowRight',
required: false,
disabled: false,
......
......@@ -75,7 +75,7 @@ const appointmentInfo = [
lg: 8 //栅格布局份数
},
{
label: '业务代表账号',
label: '签单员账号',
key: 'businessRepresentAccount1',
domType: 'Input',
inputType: 'text',
......@@ -90,7 +90,7 @@ const appointmentInfo = [
lg: 8 //栅格布局份数
},
{
label: '业务代表姓名',
label: '签单员姓名',
key: 'businessRepresentName1',
domType: 'Input',
inputType: 'text',
......@@ -105,7 +105,7 @@ const appointmentInfo = [
lg: 8 //栅格布局份数
},
{
label: '业务代表电话号码',
label: '签单员电话号码',
key: 'businessRepresentMobile1',
domType: 'arrowRight',
required: false,
......@@ -122,7 +122,7 @@ const appointmentInfo = [
lg: 8 //栅格布局份数
},
{
label: '业务代表邮箱',
label: '签单员邮箱',
key: 'businessRepresentEmail1',
domType: 'Input',
inputType: 'text',
......@@ -267,11 +267,11 @@ const appointmentInfo = [
lg: 8 //栅格布局份数
},
{
label: '离港时间(先选择离港时间)',
label: '离港时间(离港时间必须晚于到港时间)',
key: 'departureTime',
domType: 'datetimePicker',
required: false,
disabled: true,
disabled: false,
placeholder: '请选择',
show: true,
labelPosition: 'top', //标签的位置
......
......@@ -452,6 +452,21 @@ const customer = [
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '身份证地址',
key: 'idCardAddress',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: false,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
......@@ -493,12 +508,27 @@ const customer = [
lg: 8 //栅格布局份数
},
{
label: '职位',
key: 'position',
label: '公司地址',
key: 'companyAddress',
type: 'arrowRight',
required: false,
disabled: false,
placeholder: '请填写',
show: true,
drawerType: 'address',
companyAddress: {},
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '公司地址邮编',
key: 'companyAddressPostcode',
type: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
maxLength: 20,
disabled: false,
placeholder: '请输入',
show: true,
......@@ -508,10 +538,10 @@ const customer = [
lg: 8 //栅格布局份数
},
{
label: '总工作年期',
key: 'workYear',
label: '职位',
key: 'position',
type: 'Input',
inputType: 'number',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
......@@ -523,8 +553,8 @@ const customer = [
lg: 8 //栅格布局份数
},
{
label: '现时每月收入',
key: 'salary',
label: '工作年期',
key: 'workYear',
type: 'Input',
inputType: 'number',
required: false,
......@@ -538,15 +568,15 @@ const customer = [
lg: 8 //栅格布局份数
},
{
label: '公司地址',
key: 'companyAddress',
type: 'arrowRight',
label: '现时每月收入',
key: 'salary',
type: 'Input',
inputType: 'number',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请填写',
placeholder: '请输入',
show: true,
drawerType: 'address',
companyAddress: {},
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
......
......@@ -8,6 +8,21 @@ const insured = [
showMoudle: true, //模块是否展示
data: [
{
label: '与投保人关系',
key: 'policyholderRel',
// customerKey: 'customerType',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'csf_ap_rel',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '客户类型',
key: 'customerType',
customerKey: 'customerType',
......@@ -37,25 +52,10 @@ const insured = [
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '与投保人关系',
key: 'policyholderRel',
// customerKey: 'customerType',
domType: 'Select',
required: true,
disabled: false,
placeholder: '请选择',
dictType: 'csf_ap_rel',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
// 基础信息
{
fatherTitle: '基础信息',
type: 'object',
......@@ -193,7 +193,7 @@ const insured = [
label: '通讯地址',
commonKey: true, //是否是公共字段
key: 'txAddress',
// customerKey: 'mailingAddress',
customerKey: 'residenceAddress',
domType: 'arrowRight',
required: false,
disabled: false,
......@@ -482,36 +482,7 @@ const insured = [
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '平均每月收入',
// key: 'monthIncome',
// domType: 'Input',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入平均每月收入',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '平均每月支出',
// key: 'monthExpenditure',
// domType: 'Input',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入平均每月支出',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '受雇于现职年期',
key: 'currentTenure',
......@@ -527,21 +498,7 @@ const insured = [
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '总流动资产',
// key: 'totalCurrentAssets',
// domType: 'Input',
// inputType: 'number',
// required: false,
// maxLength: 300,
// disabled: false,
// placeholder: '请输入平均每月支出',
// show: true,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '总负债额',
key: 'totalDebt',
......
......@@ -7,38 +7,6 @@ const policyInfo = [
child: 'no', //没有子级dom,直接展示
fatherrequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
// {
// label: '客户姓名',
// key: 'customerName',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '客户编号',
// key: 'customerBizId',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '140px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '保单号',
key: 'policyNo',
......@@ -69,22 +37,22 @@ const policyInfo = [
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '签单人',
key: 'signer',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '130px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '签单人',
// key: 'signer',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '130px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '生效日期',
key: 'effectiveDate',
......@@ -113,53 +81,7 @@ const policyInfo = [
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '产品名称',
// key: 'productName',
// domType: 'SearchSelect',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// value: '',
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// labelPosition: 'top', //标签的位置
// lg: 8 //栅格布局份数
// },
// {
// label: '产品类别',
// key: 'productCate',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '130px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '供款年期',
// key: 'paymentTerm',
// domType: 'Select',
// required: false,
// disabled: false,
// placeholder: '请选择',
// dictType: 'paymentTerm',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '期交保费',
key: 'paymentPremium',
......@@ -254,37 +176,32 @@ const policyInfo = [
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
// {
// label: '受保人',
// key: 'insured',
// domType: 'Input',
// inputType: 'text',
// required: false,
// maxLength: 30,
// disabled: false,
// placeholder: '请输入',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: '币种',
// key: 'currency',
// domType: 'Select',
// required: false,
// disabled: false,
// placeholder: '请选择',
// dictType: 'bx_currency_type',
// show: true,
// value: '',
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// },
{
label: '备注',
key: 'remark',
domType: 'Input',
inputType: 'textarea',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数
lg: 24 //栅格布局份数
}
]
},
{
fatherTitle: '缴费信息',
keyType: 'Object', //用于表单收集值时,判断是数组还是对象
key: 'policyFollowUpdateDto',
child: 'no', //没有子级dom,直接展示
fatherrequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
{
label: '首期保费',
key: 'initialPremium',
......@@ -302,10 +219,10 @@ const policyInfo = [
lg: 8 //栅格布局份数
},
{
label: '备注',
key: 'remark',
label: '保单征费',
key: 'policyLevy',
domType: 'Input',
inputType: 'textarea',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
......@@ -314,10 +231,79 @@ const policyInfo = [
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 24, //栅格布局份数
lg: 24 //栅格布局份数
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '首期待交保费',
key: 'initialPremiumDue',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '首期已交保费',
key: 'initialPremiumPaid',
domType: 'Input',
inputType: 'number',
required: false,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '最晚缴费日期',
key: 'latestPaymentDate',
domType: 'DatePicker',
required: false,
disabled: false,
placeholder: '请选择',
show: true,
value: '',
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 8, //栅格布局份数
lg: 8 //栅格布局份数
}
]
},
//签单人信息
{
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'signerList',
showTable: true,
subTitle: '签单人信息',
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '签单人', //新增按钮得文本
isOpen: false, //dom是否展开
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
data: [
// {
// span: 24, //栅格布局份数
// signer: '',
// phone: '',
// email: '',
// idType: '',
// idNo: '',
// dictType: 'csf_id_type',
// registrationNumber: ''
// }
]
}
]
export default policyInfo
......@@ -55,7 +55,7 @@
<!-- <router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link> -->
<el-dropdown-item divided command="logout">
<el-dropdown-item command="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
......
......@@ -13,3 +13,36 @@ export default function deepClone(obj) {
return clonedObj
}
}
// 处理用户名相同的情况
export function processUserName(users) {
const nameCountMap = new Map()
// 统计 realName 重复情况
users.forEach(user => {
if (!nameCountMap.has(user.realName)) {
nameCountMap.set(user.realName, new Set())
}
nameCountMap.get(user.realName).add(user.userBizId)
})
// 处理 showName
return users.map(user => {
const userBizIds = nameCountMap.get(user.realName)
const needDistinguish = userBizIds && userBizIds.size > 1
if (needDistinguish) {
const mobile = user.mobile
const prefix = mobile.substring(0, 3)
const suffix = mobile.substring(mobile.length - 4)
return {
...user,
showName: `${user.realName} ${prefix}****${suffix}`
}
} else {
return {
...user,
showName: user.realName
}
}
})
}
......@@ -28,13 +28,44 @@
<template v-for="child in father.data" :key="child.key">
<el-col :sm="child.sm" :lg="child.lg" class="formItem" v-if="child.show">
<div>
<el-form-item
<!-- <el-form-item
:label="child.label"
:prop="child.key"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
> -->
<el-form-item
:label="
child.key === 'residentialAddress' && child.type === 'arrowRight'
? ''
: child.label
"
:prop="child.key"
:key="child.key"
:label-width="child.labelWidth"
:label-position="child.labelPosition"
>
<!-- 自定义 label 插槽 -->
<template
v-if="child.key === 'residentialAddress' && child.type === 'arrowRight'"
#label
>
<div class="custom-label">
<span>{{ child.label }}</span>
<el-checkbox-group
v-model="form.isCopyAddress"
size="small"
style="margin-left: 8px"
@change="changeAddressStatus(child)"
:disabled="copyAddress"
>
<el-checkbox :value="true" name="isCopyAddress">
同通讯地址
</el-checkbox>
</el-checkbox-group>
</div>
</template>
<el-input
v-if="child.type === 'Input'"
:type="child.inputType"
......@@ -228,7 +259,7 @@ const total = ref(0)
const customerRef = ref(null)
//计算默认显示的日期(18年前的今天)
const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate())
// const copyAddress = ref(false) //是否可以复制地址
// 地址组件菜单数据
const addressMenuList = ref([
{
......@@ -288,7 +319,7 @@ const deleteKeyList = ref([
'companyAddress'
]) // 存储需要删除的key
const data = reactive({
form: {},
form: { isCopyAddress: [] },
processedCustomerData: [], // 处理后的表单数据
oldCustomerData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
......@@ -299,6 +330,31 @@ const data = reactive({
}
})
const { form, rules, processedCustomerData, queryParams, oldCustomerData } = toRefs(data)
const copyAddress = computed(() => {
const residenceAddressIndex = addressQuickList.value.findIndex(
item => item.type === 'residenceAddress'
)
if (residenceAddressIndex !== -1) {
return false
} else {
return true
}
})
const changeAddressStatus = child => {
// 复用地址
if (form.value.isCopyAddress.length > 0 && form.value.isCopyAddress[0]) {
if (child.key == 'residentialAddress') {
form.value[child.key] = form.value['residenceAddress']
// 这里是直接复用地址了,但是地址组件的值是双向绑定的,所以这里需要手动更新地址组件的值
addressQuickList.value.forEach(item => {
if (item.type == 'residenceAddress') {
saveKey.value[child.key] = { ...item, type: child.key }
}
})
}
}
console.log('saveKey.value', saveKey.value)
}
const handleInputChange = child => {
if (
(child.key == 'lastName' || child.key == 'firstName') &&
......@@ -480,11 +536,11 @@ const handleCloseDrawer = () => {
}
// 点击了抽屉的确定
const confirmDrawer = info => {
console.log('抽屉info', info)
// console.log('抽屉info', info)
// info 为抽屉返回的值
if (drawerInfo.value.type == 'arrowRight' && drawerInfo.value.drawerType) {
console.log('drawerInfo.value', drawerInfo.value)
// console.log('drawerInfo.value', drawerInfo.value)
let newObj = info[drawerInfo.value.key]
//要判断drawerType
......@@ -525,6 +581,28 @@ const confirmDrawer = info => {
newObj.type = drawerInfo.value.key
form.value[info.key] = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
saveKey.value[info.key] = newObj
console.log('newObj', newObj)
newObj.addressString = `${newObj.region}${newObj.city}${newObj.street}${newObj.location}`
// 检查数组中是否已存在key的地址
// debugger
const existinAddressIndex = addressQuickList.value.findIndex(
item => item.type === newObj.type
)
if (existinAddressIndex !== -1) {
// 更新已存在的电话
addressQuickList.value[existinAddressIndex] = {
...newObj
}
} else {
// 添加新的快捷电话
addressQuickList.value.push(newObj)
}
addressQuickList.value = removeDuplicates(addressQuickList.value, 'addressString')
console.log('填写地址', copyAddress.value)
break
case 'country':
info.objType = drawerInfo.value.drawerType
......@@ -569,9 +647,15 @@ const handleSelectChange = child => {
} else {
resetShow('smokeQuantity', false)
}
break
case 'idType':
// 选择吸烟,展示吸烟数量
if (form.value[child.key] == 'idCard') {
resetShow('idCardAddress', true)
} else {
resetShow('idCardAddress', false)
}
break
default:
break
}
......@@ -610,7 +694,10 @@ const setFormValue = (obj, formData, exportValue) => {
if (obj.smokeQuantity && field.key == 'smokeQuantity') {
field.show = true
}
//证件类型是身份证,身份证地址就显示否则不显示
if (field.key == 'idCardAddress' && obj.idType == 'idCard') {
field.show = true
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
......@@ -654,7 +741,7 @@ const setFormValue = (obj, formData, exportValue) => {
form.value[
field.key
] = `${addressObj.region} ${addressObj.city} ${addressObj.street} ${addressObj.location}`
addressObj.addressString = `${addressObj.region} ${addressObj.city} ${addressObj.street} ${addressObj.location}`
addressObj.addressString = `${addressObj.region}${addressObj.city}${addressObj.street}${addressObj.location}`
addressObj.objType = field.drawerType
saveKey.value[field.key] = addressObj
if (tempAddressList.length > 0) {
......@@ -717,12 +804,12 @@ const setFormValue = (obj, formData, exportValue) => {
oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
}
processedCustomerData.value = oldCustomerData.value = processedData
console.log('====================================')
console.log('processedCustomerData.value', processedCustomerData.value)
console.log('====================================')
console.log('====================================')
console.log('form', form.value)
console.log('====================================')
// console.log('====================================')
// console.log('processedCustomerData.value', processedCustomerData.value)
// console.log('====================================')
// console.log('====================================')
// console.log('form', form.value)
// console.log('====================================')
}
// 数组去重
function removeDuplicates(arr, key) {
......@@ -730,7 +817,7 @@ function removeDuplicates(arr, key) {
const result = []
for (const item of arr) {
if (!seen.has(item[key])) {
if (!seen.has(item[key]) && item[key]) {
seen.set(item[key], true)
result.push(item)
}
......@@ -872,6 +959,11 @@ watch(
)
</script>
<style lang="scss" scoped>
.custom-label {
width: 100%;
display: flex;
align-items: center;
}
.topBtn {
width: 100%;
display: flex;
......
......@@ -129,7 +129,7 @@
</div>
</template>
<script setup name="FnaEdit">
import { onUnmounted } from 'vue'
import { processUserName } from '@/utils/common'
import AppointmentEdit from '@/views/sign/appointment/appointmentEdit'
import useUserStore from '@/store/modules/user'
import useDictStore from '@/store/modules/dict'
......@@ -209,7 +209,14 @@ const getDictsData = async () => {
}
const response1 = await listTenantUser(params1)
if (response1.code == 200) {
dictStore.setTenantUserList(response1.data.records)
let result = processUserName(response1.data.records)
result = result.map(item => {
return {
value: item.userBizId,
label: item.showName
}
})
dictStore.setTenantUserList(result)
}
const params2 = {
loginTenantBizId: userStore.projectInfo.tenantBizId,
......
......@@ -124,6 +124,7 @@
:customerInfo="customerInfo"
:idsObj="idsObj"
:apiInsurantInfoDto="appointmentSummeryInfo.apiInsurantInfoDto"
:currentPolicyholderInfo="currentPolicyholderInfo"
:appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="insuredInfoRef"
......@@ -171,6 +172,7 @@
ref="questionnairesInfoRef"
:pageSource="pageSource"
:showSubmitBtn="showSubmitBtn"
:foldInsurantInfo="foldInsurantInfo"
/>
</div>
<div v-if="tab.name === 'fna'">
......@@ -244,6 +246,13 @@
:policyNo="policyNo"
/>
</div>
<div v-if="tab.name === 'expectedFortune'">
<expectedFortuneInfo
:activeName="activeName"
:policyBizId="route.query.policyBizId"
:policyNo="policyNo"
/>
</div>
</div>
</el-tab-pane>
</el-tabs>
......@@ -298,6 +307,7 @@ import PolicyBrokerInfo from '@/views/sign/underwritingMain/components/brokerInf
import PolicyMailing from '@/views/sign/underwritingMain/components/policyMailing.vue' //新单跟进里的保单附件
import VerifyPolicyInfo from '@/views/sign/underwritingMain/components/verifyPolicyInfo.vue' //新单跟进里的保单附件
import ExpectedCommission from '@/views/sign/underwritingMain/components/expectedCommission.vue' //新单跟进里的保单附件
import expectedFortuneInfo from '@/views/sign/underwritingMain/components/expectedFortuneInfo.vue' //新单跟进里得预计发佣
import useUserStore from '@/store/modules/user'
import useDictStore from '@/store/modules/dict'
import { getCustomerDetail } from '@/api/sign/fna'
......@@ -346,6 +356,7 @@ const customerInfo = ref({})
const idsObj = ref({}) //各个模块的bizId
const appointmentSummeryInfo = ref({}) //预约详情总信息
const currentFile = ref(null)
const foldInsurantInfo = ref(false) //健康信息中得受保人信息是否隐藏
const processInfo = ref({
fnaNo: '暂无',
status: '未完成',
......@@ -355,7 +366,7 @@ const processInfo = ref({
const execlDialog = ref(false)
const isEmbed = ref(false) //是否作为组件插入
const policyNo = ref('') //新单跟进保单号
const currentPolicyholderInfo = ref({}) //存储下投保人信息,受保人模块要用到
const tabsList = ref([
{
label: '预约信息',
......@@ -569,6 +580,9 @@ function getCustomerInfo(customerBizId) {
getCustomerDetail(customerBizId).then(res => {
if (res.code == 200) {
customerInfo.value = res.data
if (customerInfo.value.smoke) {
customerInfo.value.smoke = Number(customerInfo.value.smoke)
}
}
})
}
......@@ -649,6 +663,54 @@ const getDictsData = async () => {
}
// Tab切换前的验证
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
}
......@@ -672,6 +734,7 @@ const handleSubmit = type => {
if (appointmentInfoRef.value) {
submitAppointmentObj.value.apiAppointmentInfoDto =
appointmentInfoRef.value[0].handleFormValues()
if (!submitAppointmentObj.value.apiAppointmentInfoDto) return
}
if (productPlanRef.value) {
submitAppointmentObj.value.apiProductPlanInfoDto = productPlanRef.value[0].handleSubmitForm()
......@@ -1027,6 +1090,12 @@ if (route.query.source == 'policyList') {
key: 'expectedCommission'
},
{
label: '预计发佣',
name: 'expectedFortune',
id: 1,
key: 'expectedFortune'
},
{
label: '保单信息',
name: 'policyInfo',
id: 2,
......
......@@ -368,7 +368,7 @@ const addBeneficiary = () => {
// 删除受益人
const deleteBeneficiary = (l1, level1) => {
console.log('====================================')
console.log('l1', form.value.apiBeneficiaryInfoDtoList[l1])
console.log('l1', form.value.apiBeneficiaryInfoDtoList[l1])
console.log('====================================')
if (editStatus.value) {
proxy.$modal.confirm(`编辑状态下才能删除`, { showCancel: '0', title: '填写提示' })
......@@ -390,15 +390,20 @@ const deleteBeneficiary = (l1, level1) => {
emit('handleSuccessEdit')
}
})
} else if (form.value.apiBeneficiaryInfoDtoList[l1].policyBeneficiaryBizId && props.pageSource == 'policyList') {
delPolicyBeneficiary(form.value.apiBeneficiaryInfoDtoList[l1].policyBeneficiaryBizId).then(res => {
if (res.code == 200) {
proxy.$message.success('新单跟进-受益人删除成功')
processedBeneficiaryData.value.splice(l1, 1)
form.value.apiBeneficiaryInfoDtoList.splice(l1, 1)
emit('policyEditSuccess')
} else if (
form.value.apiBeneficiaryInfoDtoList[l1].policyBeneficiaryBizId &&
props.pageSource == 'policyList'
) {
delPolicyBeneficiary(form.value.apiBeneficiaryInfoDtoList[l1].policyBeneficiaryBizId).then(
res => {
if (res.code == 200) {
proxy.$message.success('新单跟进-受益人删除成功')
processedBeneficiaryData.value.splice(l1, 1)
form.value.apiBeneficiaryInfoDtoList.splice(l1, 1)
emit('policyEditSuccess')
}
}
})
)
} else {
proxy.$message.success('受益人删除成功')
processedBeneficiaryData.value.splice(l1, 1)
......@@ -610,6 +615,8 @@ const confirmDrawer = info => {
form.value.apiBeneficiaryInfoDtoList[drawerInfo.value.l1][
drawerInfo.value.key
] = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
newObj.addressString = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
// 检查数组中是否已存在相同ID的地址
const existingIndex = phoneOraddressKey.value.findIndex(
item => item.id === newObj.id && item.type === newObj.type
......@@ -622,6 +629,24 @@ const confirmDrawer = info => {
// 添加新地址
phoneOraddressKey.value.push({ ...newObj })
}
newObj.addressString = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
// 检查数组中是否已存在key的地址
// debugger
const existinAddressIndex = addressQuickList.value.findIndex(
item => item.type === newObj.type
)
if (existinAddressIndex !== -1) {
// 更新已存在的电话
addressQuickList.value[existinAddressIndex] = {
...newObj
}
} else {
// 添加新的快捷电话
addressQuickList.value.push(newObj)
}
addressQuickList.value = removeDuplicates(addressQuickList.value, 'addressString')
break
case 'country':
......
......@@ -21,9 +21,15 @@
<div v-for="(level1, l1) in questionnairesDom" :key="level1.firstCategory">
<el-row style="margin-bottom: 10px">
<div class="formBox">
<div class="fatherLable">{{ level1.firstCategoryName }}</div>
<div class="fatherLable">
<span>{{ level1.firstCategoryName }}</span>
<div class="openCon" v-if="level1.showIcon" @click="changeOpenStatus(level1)">
<el-icon v-if="!level1.showMoudle"><Hide /></el-icon>
<el-icon v-else><View /></el-icon>
</div>
</div>
<el-row :gutter="20">
<el-row :gutter="20" v-if="level1.showMoudle">
<template
v-for="(level2, l2) in level1.secondCategoryDtoList"
:key="level2.secondCategory"
......@@ -218,6 +224,7 @@ const props = defineProps({
customerInfo: { type: Object, default: () => ({}) },
//客户详情回显表单用
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
foldInsurantInfo: { type: Boolean, default: false }, //是否隐藏受保人信息
pageSource: { type: String, default: '' } //页面来源
})
const emit = defineEmits(['handleSuccessEdit'])
......@@ -226,7 +233,7 @@ const loading = ref(false)
const errorFields = ref([]) // 存储校验失败的字段信息
const editStatus = ref(true) // 表单是否可编辑,若是修改初始不可编辑
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const showInsurant = ref(false) //是否显示受保人信息
const data = reactive({
form: [],
tempSecondHolderForm: [], //由于切换tab的时候,表单数据会重置,所以需要
......@@ -241,6 +248,16 @@ const data = reactive({
})
const { form, rules, questionnairesDom, queryParams, oldAppointmentData, tempSecondHolderForm } =
toRefs(data)
const changeOpenStatus = level1 => {
console.log('level1', level1)
let newDom = JSON.parse(JSON.stringify(questionnairesDom.value))
newDom.forEach((item, index) => {
if (item.firstCategory == level1.firstCategory) {
item.showMoudle = !item.showMoudle
}
})
questionnairesDom.value = newDom
}
const addMedical = (l1, l2, l3) => {
form.value[l1]['secondCategoryDtoList'][l2]['questionsDtoList'][l3]['answerSessionsDto'][
'questionTextJsonDtoList'
......@@ -453,22 +470,7 @@ const submitForm = () => {
}
})
}
const resetForm = () => {
proxy.$modal
.confirm('是否确认撤销所作操作?')
.then(function () {
if (props.customerBizId) {
form.value = { ...oldObjInfo.value }
editStatus.value = true
} else {
// resetShow('smokeQuantity', false)
proxy.$refs['heathFormRef'].resetFields()
}
questionnairesDom.value = JSON.parse(JSON.stringify(oldAppointmentData.value))
})
.catch(() => {})
}
const getQuestionnairesInfo = () => {
loading.value = true
let id = ''
......@@ -482,17 +484,30 @@ const getQuestionnairesInfo = () => {
}
getQuestionnaires(id).then(res => {
if (res.code == 200) {
let result = res.data.firstAndSecondCategoryDtoList
let result = []
if (props.foldInsurantInfo) {
result = [res.data.firstAndSecondCategoryDtoList[0]]
} else {
result = res.data.firstAndSecondCategoryDtoList
}
let first_category = fetchDictData('wj_question_first_category')
let second_category = fetchDictData('wj_question_second_category')
form.value = {}
result.forEach((level1, l1) => {
// form.value[level1.firstCategory] = {}
first_category.forEach((first, i) => {
if (level1.firstCategory == first.value) {
if (level1.firstCategory == first.value && !props.foldInsurantInfo) {
level1.firstCategoryName = first.label
} else if (props.foldInsurantInfo && level1.firstCategory == 'POLICYHOLDER') {
level1.firstCategoryName = '投保人 / 受保人'
}
})
if (level1.firstCategory == 'POLICYHOLDER') {
// level1.showIcon = true
level1.showMoudle = true
} else if (level1.firstCategory == 'INSURED_PERSON') {
level1.showIcon = true
level1.showMoudle = false
}
level1.secondCategoryDtoList.forEach((level2, l2) => {
level2.sm = 24
level2.lg = 24
......@@ -586,6 +601,7 @@ watch(
editStatus.value = true
}
getQuestionnairesInfo()
console.log('foldInsurantInfo', props.foldInsurantInfo)
}
}
)
......@@ -620,6 +636,13 @@ defineExpose({
font-size: 18px;
border-left: 4px solid #165dff;
padding-left: 5px;
margin-bottom: 5px;
display: flex;
align-items: center;
.openCon {
margin-left: 10px;
cursor: pointer;
}
}
.fatherDes {
font-size: 14px;
......@@ -705,7 +728,7 @@ defineExpose({
}
}
.tabButton {
box-shadow: 0 -1px 14px #00000014;
/* box-shadow: 0 -1px 14px #00000014; */
width: 100%;
display: flex;
align-items: center;
......
......@@ -55,7 +55,6 @@
:label-position="child.labelPosition"
:rules="getRules(child)"
>
<!-- @input="handleInputChange(father, child)" -->
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
......@@ -223,6 +222,7 @@ const props = defineProps({
apiInsurantInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) }, //客户详情回显表单用
currentPolicyholderInfo: { type: Object, default: () => ({}) }, //当前保单的投保人信息
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
pageSource: { type: String, default: '' } //页面来源
})
......@@ -349,16 +349,7 @@ const getRules = child => {
return rules
}
const handleInputChange = (father, child) => {
switch (child.key) {
case 'nameEn':
validateEnglish(form.value[child.key], child.key)
break
default:
break
}
}
const handleDateChange = child => {
let age = null
if (child.key == 'birthday') {
......@@ -433,16 +424,6 @@ const fetchDictData = dictType => {
return []
}
}
// // 添加英文校验函数
// const validateEnglish = (rule, value, callback) => {
// if (value && !/^[A-Za-z]*$/.test(value)) {
// // 清空非英文字符
// form.value.firstNamePinyin = ''
// callback(new Error('只能输入英文字母'))
// } else {
// callback()
// }
// }
const mergeObjects = (obj1, obj2) => {
const result = Object.assign({}, obj1)
......@@ -461,14 +442,20 @@ const mergeObjects = (obj1, obj2) => {
* exportValue:是否从导入联系人列表中导入客户信息到当前表单
*/
const processFormData = async obj => {
form.value = {}
saveKey.value = {}
let tempPhoneList = []
let tempAddressList = []
form.value = {}
saveKey.value = {}
addressQuickList.value = []
phoneQuickList.value = []
// if (!obj.exportValue) {
// form.value = {}
// saveKey.value = {}
// addressQuickList.value = []
// phoneQuickList.value = []
// }
// 深拷贝原始数据
// const processedData = JSON.parse(JSON.stringify(policyDomData))
const processedData = JSON.parse(JSON.stringify(obj.domdata))
for (const section of processedData) {
......@@ -576,7 +563,7 @@ const processFormData = async obj => {
for (const key1 in field) {
if (obj.customerInfo.addressList && obj.customerInfo.addressList.length > 0) {
obj.customerInfo.addressList.forEach(item => {
if (key1 == item.type) {
if (field.customerKey == item.type) {
addressObj = item
}
})
......@@ -619,6 +606,7 @@ const processFormData = async obj => {
}
}
}
//当tab切换走,在切换回来的时候,需要把之前保存的值赋值回来
if (
JSON.stringify(tempPolicyForm.value) !== '{}' &&
......@@ -649,7 +637,11 @@ const processFormData = async obj => {
}
}
if (props.showSubmitBtn) {
field.disabled = true
if (obj.source && obj.source == 'policyholderRel' && field.key !== 'age') {
field.disabled = false
} else {
field.disabled = true
}
} else {
if (field.key == 'age') {
field.disabled = true
......@@ -660,7 +652,6 @@ const processFormData = async obj => {
}
}
}
addressQuickList.value = tempAddressList
tempPhoneList.forEach(item => {
for (const key in saveKey.value) {
......@@ -696,11 +687,20 @@ const processFormData = async obj => {
if (form.value.smokingAllowed) {
form.value.smokingAllowed = Number(form.value.smokingAllowed)
}
editStatus.value = true
} else {
editStatus.value = false
}
// // 投保人为本人时,信息从投保人带入
// if (obj.source && obj.source == 'policyholderRel') {
// form.value = {
// ...obj.customerInfo,
// policyholderRel: form.value.policyholderRel
// }
// if (form.value.smokingAllowed) {
// form.value.smokingAllowed = Number(form.value.smokingAllowed)
// }
// }
if (form.value['birthday']) {
let age = calculateExactAge(proxy.formatToDate(form.value.birthday))
if (age >= 0) {
......@@ -715,8 +715,6 @@ const processFormData = async obj => {
//弹出右侧抽屉
const handleFoucs = child => {
if (child.disabled) return
console.log('saveKey.value', saveKey.value)
console.log('child', child)
drawerInfo.value = JSON.parse(JSON.stringify(child))
switch (child.drawerType) {
......@@ -810,7 +808,25 @@ const confirmDrawer = info => {
form.value[info.key] = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
saveKey.value[info.key] = newObj
newObj.addressString = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
// 检查数组中是否已存在key的地址
// debugger
const existinAddressIndex = addressQuickList.value.findIndex(
item => item.type === newObj.type
)
if (existinAddressIndex !== -1) {
// 更新已存在的电话
addressQuickList.value[existinAddressIndex] = {
...newObj
}
} else {
// 添加新的快捷电话
addressQuickList.value.push(newObj)
}
addressQuickList.value = removeDuplicates(addressQuickList.value, 'addressString')
console.log('填写地址', addressQuickList.value)
break
case 'country':
info.objType = drawerInfo.value.drawerType
......@@ -861,13 +877,10 @@ const handleSelectChange = (father, child) => {
case 'customerType':
if (form.value[child.key] == 'COMPANY') {
showContacts.value = false
console.log(' commonObj.value', commonObj.value)
for (const section of processedinsuredData.value) {
if (section.key == 'company') {
console.log(11111)
for (const key1 in saveKey.value) {
for (const key2 in commonObj.value) {
console.log(key1, key2)
if (key1 == key2) {
saveKey.value[key1]['fatherKey'] = section.key
}
......@@ -908,6 +921,32 @@ const handleSelectChange = (father, child) => {
}
break
case 'policyholderRel':
//选择投保人为本人得时候,带入投保人得信息
if (form.value['policyholderRel'] == 'MYSELF') {
form.value = JSON.parse(JSON.stringify(props.currentPolicyholderInfo.form))
saveKey.value = JSON.parse(JSON.stringify(props.currentPolicyholderInfo.saveKey))
form.value['policyholderRel'] = 'MYSELF'
if (form.value['customerType'] == 'COMPANY') {
resetShow({ type: 'father', key: 'person', status: false })
resetShow({ type: 'father', key: 'company', status: true })
} else if (form.value['customerType'] == 'INDIVIDUAL') {
resetShow({ type: 'father', key: 'person', status: true })
resetShow({ type: 'father', key: 'company', status: false })
}
// 选择吸烟,展示吸烟数量
if (form.value['smokingAllowed'] == '1') {
resetShow({ type: 'child', key: 'smokingVolume', status: true })
} else {
resetShow({ type: 'child', key: 'smokingVolume', status: false })
}
if (form.value['isVip'] == '1') {
resetShow({ type: 'child', key: 'vipRemark', status: true })
} else {
resetShow({ type: 'child', key: 'vipRemark', status: false })
}
}
break
default:
break
......@@ -1077,8 +1116,10 @@ const submitForm = () => {
proxy.$refs['insuredInfoFormRef'].validate((valid, fields) => {
if (valid) {
let submitObj = handleFormValues()
if (props.idsObj.appointmentBizId&&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')) {
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
submitObj['appointmentBizId'] = props.apiInsurantInfoDto.appointmentBizId
submitObj['id'] = props.apiInsurantInfoDto.id
submitObj['insurantBizId'] = props.apiInsurantInfoDto.insurantBizId
......@@ -1112,22 +1153,6 @@ const submitForm = () => {
}
})
}
const resetForm = () => {
proxy.$modal
.confirm('是否确认撤销所作操作?')
.then(function () {
if (props.customerBizId) {
form.value = { ...oldObjInfo.value }
editStatus.value = true
} else {
// resetShow('smokeQuantity', false)
proxy.$refs['insuredInfoFormRef'].resetFields()
}
processedinsuredData.value = JSON.parse(JSON.stringify(oldAppointmentData.value))
})
.catch(() => {})
}
watch(
() => props.activeName,
......@@ -1153,6 +1178,9 @@ watch(
})
}
}, 500)
console.log('====================================')
console.log('受保人拿到投保人信息', props.currentPolicyholderInfo)
console.log('====================================')
}
}
)
......
......@@ -211,7 +211,7 @@ const props = defineProps({
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiPolicyholderInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) }, //客户详情回显表单用
customerInfo: { type: Object, default: () => ({}) }, //客户详情新增时带入表单
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
pageSource: { type: String, default: '' } //页面来源
})
......@@ -343,16 +343,7 @@ const getRules = child => {
return rules
}
const handleInputChange = (father, child) => {
switch (child.key) {
case 'nameEn':
validateEnglish(form.value[child.key], child.key)
break
default:
break
}
}
const handleDateChange = child => {
let age = null
if (child.key == 'birthday') {
......@@ -409,7 +400,6 @@ const handleExport = row => {
customerInfo: row,
exportValue: true
})
// setFormValue(row, processedPolicyData.value, true)
openList.value = false
}
......@@ -569,7 +559,11 @@ const processFormData = async obj => {
for (const key1 in field) {
if (obj.customerInfo.addressList && obj.customerInfo.addressList.length > 0) {
obj.customerInfo.addressList.forEach(item => {
if (key1 == item.type) {
// 之前得写法
// if (key1 == item.type) {
// addressObj = item
// }
if (field.customerKey == item.type) {
addressObj = item
}
})
......@@ -641,7 +635,7 @@ const processFormData = async obj => {
}
}
}
// props.idsObj.appointmentBizId
if (props.showSubmitBtn) {
field.disabled = true
} else {
......@@ -801,6 +795,25 @@ const confirmDrawer = info => {
newObj.type = drawerInfo.value.key
form.value[info.key] = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
saveKey.value[info.key] = newObj
newObj.addressString = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
// 检查数组中是否已存在key的地址
// debugger
const existinAddressIndex = addressQuickList.value.findIndex(
item => item.type === newObj.type
)
if (existinAddressIndex !== -1) {
// 更新已存在的电话
addressQuickList.value[existinAddressIndex] = {
...newObj
}
} else {
// 添加新的快捷电话
addressQuickList.value.push(newObj)
}
addressQuickList.value = removeDuplicates(addressQuickList.value, 'addressString')
console.log('填写地址', addressQuickList.value)
break
case 'country':
info.objType = drawerInfo.value.drawerType
......@@ -1056,6 +1069,12 @@ const handleFormValues = () => {
return submitObj
}
const providePolicyholderInfoData = () => {
return {
form: JSON.parse(JSON.stringify(form.value)),
saveKey: JSON.parse(JSON.stringify(saveKey.value))
}
}
// 表单提交
const submitForm = () => {
proxy.$refs['policyholderInfoFormRef'].validate((valid, fields) => {
......@@ -1099,22 +1118,6 @@ const submitForm = () => {
}
})
}
const resetForm = () => {
proxy.$modal
.confirm('是否确认撤销所作操作?')
.then(function () {
if (props.customerBizId) {
form.value = { ...oldObjInfo.value }
editStatus.value = true
} else {
// resetShow('smokeQuantity', false)
proxy.$refs['policyholderInfoFormRef'].resetFields()
}
processedPolicyData.value = JSON.parse(JSON.stringify(oldAppointmentData.value))
})
.catch(() => {})
}
watch(
() => props.activeName,
......@@ -1136,6 +1139,7 @@ watch(
} else {
processFormData({
domdata: policyDomData,
customerInfo: props.customerInfo,
exportValue: null
})
}
......@@ -1147,7 +1151,8 @@ watch(
// 暴露给父组件
defineExpose({
handleFormValues,
handleEditStatus
handleEditStatus,
providePolicyholderInfoData
})
</script>
<style lang="scss" scoped>
......
......@@ -714,7 +714,6 @@ const handleSelectChange = (father, child) => {
// 选是,展示日期
if (form.value[father.key][child.key] == '1') {
resetShow('policyEffectiveDate', true)
// form.value[father.key]['policyEffectiveDate'] = ''
} else {
resetShow('policyEffectiveDate', false)
}
......@@ -925,11 +924,7 @@ const setFormValue = (obj, formData) => {
for (const field of section.data) {
if (key == 'apiProductPlanMainInfoDto') {
for (const key2 in newForm[key]) {
if (
field.key == 'policyEffectiveDate' &&
newForm[key][field.key] &&
newForm[key]['isBacktrack'] == '1'
) {
if (field.key == 'policyEffectiveDate' && newForm[key]['isBacktrack'] == '1') {
field.show = true
}
}
......
......@@ -73,6 +73,13 @@
<dict-tag :options="csf_ap_status" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="最终预约时间" align="center" width="180">
<template #default="scope">
<span>{{
scope.row.confirmAppointmentTime ? parseTime(scope.row.confirmAppointmentTime) : '--'
}}</span>
</template>
</el-table-column>
<el-table-column label="产品名称" align="center" prop="productName" width="150" />
<el-table-column label="保险公司" align="center" prop="companyName" width="150" />
<el-table-column label="业务员" align="center" prop="businessRepresentName1" width="150" />
......@@ -88,7 +95,20 @@
</template>
</el-table-column>
<el-table-column label="时间" align="center" prop="time" width="240" show-overflow-tooltip>
<el-table-column
label="意向预约时间"
align="center"
prop="intentionAppointmentTime"
width="240"
show-overflow-tooltip
>
<template #default="scope">
<span>{{
scope.row.intentionAppointmentTime
? parseTime(scope.row.intentionAppointmentTime)
: '--'
}}</span>
</template>
</el-table-column>
<!-- sortable -->
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
......
......@@ -493,10 +493,7 @@ const handleEditStatus = () => {
}
processedFanFormData.value = processedData
}
//给表单赋值 方便表单回显 obj 为表单数据
const setFormValue = (obj, formData) => {
loading.value = true
}
// 获取校验失败的字段信息
const getInvalidFields = fields => {
......
......@@ -29,8 +29,8 @@
/>
</template>
</el-table-column>
<!-- sortable -->
<el-table-column label="来佣金额" prop="amount" align="center" width="120">
<!-- <el-table-column label="来佣金额" prop="amount" align="center" width="120">
<template #default="scope">
<el-input
v-model="scope.row.amount"
......@@ -39,8 +39,17 @@
placeholder="请输入"
/>
</template>
</el-table-column> -->
<el-table-column label="来佣比例" prop="ratio" align="center" width="120">
<template #default="scope">
<el-input
v-model="scope.row.ratio"
size="default"
type="number"
placeholder="请输入"
/>
</template>
</el-table-column>
<!-- sortable -->
<el-table-column label="佣金期数" prop="commissionPeriod" align="center" width="120">
<template #default="scope">
<el-input
......
......@@ -9,6 +9,7 @@
</div>
</template>
<script setup name="FollowUpDetail">
import { processUserName } from '@/utils/common'
import AppointmentEdit from '@/views/sign/appointment/appointmentEdit'
import { getPolicyfollow, getPolicyInfo } from '@/api/sign/underwritingMain'
import useUserStore from '@/store/modules/user'
......@@ -39,7 +40,14 @@ const getDictsData = async () => {
}
const response1 = await listTenantUser(params1)
if (response1.code == 200) {
dictStore.setTenantUserList(response1.data.records)
let result = processUserName(response1.data.records)
result = result.map(item => {
return {
value: item.userBizId,
label: item.showName
}
})
dictStore.setTenantUserList(result)
}
const params2 = {
loginTenantBizId: userStore.projectInfo.tenantBizId,
......
......@@ -83,9 +83,7 @@
:show-file-list="false"
accept=".xlsx, .xls"
>
<el-button type="success" :icon="UploadFilled" size="default">
上传Excel文件
</el-button>
<el-button type="success" size="default"> 上传Excel文件 </el-button>
</el-upload>
<el-button text @click="downloadTemplate" size="default" class="download-template-btn">
下载模板
......@@ -136,6 +134,15 @@
<span>{{ convertStatusToDict(1, scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column prop="coolingOffEndDate" label="冷静期结束日期" width="150" align="center">
<template #default="scope">
<span>{{
scope.row.coolingOffEndDate ? parseTime(scope.row.coolingOffEndDate) : '--'
}}</span>
</template>
</el-table-column>
<el-table-column prop="coolingOffDays" label="冷静期天数" width="150" align="center">
</el-table-column>
<el-table-column prop="policyNo" label="保单号" width="150" align="center" sortable />
<el-table-column prop="customerName" label="客户名称" width="100" align="center" sortable />
<el-table-column prop="signDate" label="签单日期" width="150" align="center" sortable>
......@@ -162,7 +169,11 @@
sortable
/>
<el-table-column prop="insured" label="受保人" width="100" align="center" sortable />
<el-table-column prop="currency" label="币种" width="100" align="center" sortable />
<el-table-column prop="currency" label="币种" width="100" align="center" sortable>
<template #default="scope">
<dict-tag :options="currencyTypeOptions" :value="scope.row.currency" />
</template>
</el-table-column>
<el-table-column prop="initialPremium" label="首期保费" width="150" align="center" sortable>
<template #default="scope">
{{ numberWithCommas(scope.row.initialPremium) }}
......@@ -171,16 +182,37 @@
<el-table-column
label="操作"
align="center"
width="250"
width="200"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button text size="primary" @click="handleView(scope.row)"> 查看 </el-button>
<el-button text size="primary" @click="handleStatus(scope.row)"> 跟进 </el-button>
<div class="btnCon">
<el-button link type="primary" size="small" @click="handleReport(scope.row)">
生成签约单完成报告
</el-button>
<el-dropdown placement="bottom" style="margin-left: 10px">
<el-button type="primary" link size="small">
更多 <el-icon><ArrowDown /></el-icon
></el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="handleView(scope.row)">查看</el-dropdown-item>
<el-dropdown-item @click="handleStatus(scope.row)">跟进</el-dropdown-item>
<el-dropdown-item @click="handleEditStatus(scope.row)"
>修改状态</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<!-- <el-button text size="primary" @click="handleView(scope.row)"> 查看 </el-button> -->
<!-- <el-button text size="primary" @click="handleStatus(scope.row)"> 跟进 </el-button>
<el-button text type="warning" @click="handleEditStatus(scope.row)">
修改状态
</el-button>
</el-button> -->
</template>
</el-table-column>
</el-table>
......@@ -236,7 +268,11 @@
</el-dialog>
</div>
</template>
<!-- {
"code": 200,
"msg": "生成预计发佣正在处理....,稍后查看预计发佣列表",
"data": null
} -->
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
......@@ -244,7 +280,8 @@ import axios from 'axios'
import {
getPolicyFollowList,
getExpectedCommissionList,
changePolicyStatus
changePolicyStatus,
policyFollowReport
} from '@/api/sign/underwritingMain'
import { getToken } from '@/utils/auth'
import { listType } from '@/api/system/dict/type'
......@@ -259,6 +296,7 @@ const router = useRouter()
const policyFollowStatusList = ref([])
const commissionStatusList = ref([])
const fortuneStatusList = ref([])
const currencyTypeOptions = ref([])
const currentPolicyRow = ref({}) //当前保单
const editStatus = ref(false) //新单信息状态
const data = reactive({
......@@ -287,7 +325,12 @@ const submitForm = () => {
}
const getLists = () => {
listType({
typeList: ['csf_policy_follow_status', 'csf_expected_commission_status', 'csf_fortune_status']
typeList: [
'csf_policy_follow_status',
'csf_expected_commission_status',
'csf_fortune_status',
'bx_currency_type'
]
})
.then(res => {
if (res.code === 200 && res.data) {
......@@ -299,10 +342,20 @@ const getLists = () => {
commissionStatusList.value = commissionStatusData?.dictItemList || []
const fortuneStatusData = res.data.find(item => item.dictType === 'csf_fortune_status')
fortuneStatusList.value = fortuneStatusData?.dictItemList || []
// 处理币种字典值
const currencyData = res.data.find(item => item.dictType === 'bx_currency_type')
if (currencyData) {
currencyData?.dictItemList.forEach(item => {
item.value = item.itemValue
item.label = item.itemLabel
})
}
currencyTypeOptions.value = currencyData?.dictItemList || []
} else {
policyFollowStatusList.value = []
commissionStatusList.value = []
fortuneStatusList.value = []
currencyTypeOptions.value = []
}
})
.catch(error => {
......@@ -378,7 +431,34 @@ const handleView = async row => {
fetchExpectedCommissionList(row.policyNo)
getPolicyFortuneLists(row.policyNo)
}
const handleReport = async row => {
try {
const res = await policyFollowReport(row.policyBizId)
console.log('pdf请求', res)
// 创建 Blob 对象
const blob = new Blob([res], { type: 'application/pdf' })
// 创建对象 URL
const url = window.URL.createObjectURL(blob)
// 在新窗口打开
window.open(url, '_blank')
//下载得方式
// const blob = new Blob([res], { type: 'application/pdf' })
// const url = window.URL.createObjectURL(blob)
// // 创建下载链接
// const link = document.createElement('a')
// link.href = url
// link.download = '签约单.pdf' // 设置文件名
// link.click()
// // 清理 URL 对象
// window.URL.revokeObjectURL(url)
} catch (error) {
console.error('导出失败:', error)
}
}
// 处理详情弹窗关闭
const handleDetailClose = () => {
viewDialogVisible.value = false
......@@ -668,6 +748,11 @@ const handleEditStatus = row => {
</script>
<style scoped>
.btnCon {
display: flex;
align-items: center;
justify-content: center;
}
.data-management-page {
padding: 20px;
/* max-width: 1600px; */
......
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