Commit 17384168 by yuzhenWang

做到了预约列表发布测试

parent 6bbe241c
...@@ -197,3 +197,19 @@ export function uploadOssFileList(data) { ...@@ -197,3 +197,19 @@ export function uploadOssFileList(data) {
method: 'post' method: 'post'
}) })
} }
// 提交附件
export function uploadOssFileSubmit(data) {
return request({
url: '/oss/api/relObjectMaterial/upload/submit',
data: data,
method: 'post'
})
}
// 下载材料包
export function downloadCompressedFile(data) {
return request({
url: '/oss/api/material/download/compressed/file',
data: data,
method: 'post'
})
}
...@@ -223,3 +223,34 @@ export function delSigleAppointment(appointmentBizId) { ...@@ -223,3 +223,34 @@ export function delSigleAppointment(appointmentBizId) {
}) })
} }
// 签约历史记录列表
export function getAppointmentlog(data) {
return request({
url: '/csf/api/appointment/log/page',
method: 'post',
data: data
})
}
// 查看签约历史记录详情
export function getAppointmentlogDetail(appointmentLogBizId) {
return request({
url: '/csf/api/appointment/log/detail?appointmentLogBizId=' + appointmentLogBizId,
method: 'get'
})
}
// 编辑状态预约暂存
export function appointmentEditStorage(data) {
return request({
url: '/csf/api/appointment/edit/storage',
method: 'put',
data: data
})
}
// 编辑状态预约取消申请
export function appointmentEditStatus(data) {
return request({
url: '/csf/api/appointment/edit/status',
method: 'put',
data: data
})
}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- 取消按钮 --> <!-- 取消按钮 -->
<el-button type="info" plain v-if="showCancle" @click="close">{{ cancleText }}</el-button> <el-button type="info" plain v-if="showCancle" @click="close">{{ cancleText }}</el-button>
<!-- 确认按钮 --> <!-- 确认按钮 -->
<el-button type="primary" v-if="showConfirm" @click="confirm">{{ <el-button :loading="confirmLoading" type="primary" v-if="showConfirm" @click="confirm">{{
confirmText confirmText
}}</el-button> }}</el-button>
</div> </div>
...@@ -81,6 +81,11 @@ const props = defineProps({ ...@@ -81,6 +81,11 @@ const props = defineProps({
center: { center: {
type: Boolean, type: Boolean,
default: true default: true
},
// 打开弹窗
confirmLoading: {
type: Boolean,
default: false
} }
}) })
const showDialog = ref(props.openDialog) const showDialog = ref(props.openDialog)
...@@ -115,7 +120,7 @@ watch( ...@@ -115,7 +120,7 @@ watch(
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 15px 0; padding: 15px 0;
color: rgba(0,0,0,0.9); color: rgba(0, 0, 0, 0.9);
} }
.content { .content {
padding: 0 15px; padding: 0 15px;
...@@ -127,5 +132,4 @@ watch( ...@@ -127,5 +132,4 @@ watch(
align-items: center; align-items: center;
padding: 20px 0; padding: 20px 0;
} }
</style> </style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-card class="cardStyle"> <el-card class="cardStyle">
<el-row> <el-row>
<!-- 按钮区域 --> <!-- 按钮区域 -->
<el-col :span="24" class="operationBtn"> <el-col :span="24" class="operationBtn" v-if="showOperationBtn">
<div class="operationLeft"> <div class="operationLeft">
<!-- 左侧按钮 --> <!-- 左侧按钮 -->
<template v-for="btn in leftButtons" :key="btn.key || btn.label"> <template v-for="btn in leftButtons" :key="btn.key || btn.label">
...@@ -131,6 +131,8 @@ interface Props { ...@@ -131,6 +131,8 @@ interface Props {
showSearchForm?: boolean showSearchForm?: boolean
// 是否显示分页 // 是否显示分页
showPagination?: boolean showPagination?: boolean
// 是否显示操作按钮
showOperationBtn?: boolean
// 总条数 // 总条数
total?: number total?: number
// 当前页码 // 当前页码
...@@ -153,6 +155,7 @@ const props = withDefaults(defineProps<Props>(), { ...@@ -153,6 +155,7 @@ const props = withDefaults(defineProps<Props>(), {
operationBtnList: () => [], operationBtnList: () => [],
showSearchForm: true, showSearchForm: true,
showPagination: false, showPagination: false,
showOperationBtn: true,
total: 0, total: 0,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
...@@ -489,6 +492,5 @@ onMounted(() => { ...@@ -489,6 +492,5 @@ onMounted(() => {
.cardStyle { .cardStyle {
margin-bottom: 8px; margin-bottom: 8px;
} }
} }
</style> </style>
...@@ -22,8 +22,8 @@ const appointmentInfo = [ ...@@ -22,8 +22,8 @@ const appointmentInfo = [
lg: 8 //栅格布局份数 lg: 8 //栅格布局份数
}, },
{ {
label: '意向签单日', label: '签单日',
key: 'intentionAppointmentTime', key: 'signDate',
domType: 'DatePicker', domType: 'DatePicker',
required: true, required: true,
disabled: false, disabled: false,
...@@ -76,58 +76,6 @@ const appointmentInfo = [ ...@@ -76,58 +76,6 @@ const appointmentInfo = [
sm: 12, //栅格布局份数 sm: 12, //栅格布局份数
lg: 8 //栅格布局份数 lg: 8 //栅格布局份数
} }
// {
// label: '预约时间',
// key: 'confirmAppointmentTime',
// domType: 'datetimePicker',
// required: false,
// disabled: true,
// placeholder: '请选择',
// show: false,
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// },
// {
// label: ' ',
// key: 'newPolicyButton',
// domType: 'button',
// buttonTxt: '生成新单跟进记录',
// buttonType: 'primary',
// required: false,
// maxLength: 10,
// disabled: false,
// show: false,
// // labelPosition: 'top', //标签的位置
// labelWidth: '0px', //标签宽度
// sm: 12, //栅格布局份数
// lg: 8 //栅格布局份数
// }
]
},
// 陪同转介人信息
{
fatherTitle: '陪同转介人',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'referrerDtoList',
anchorKey: 'referrerDtoList',
moudleType: 'referrerDtoList',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true,
showMoudle: false, //模块是否展示
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '陪同转介人', //新增按钮得文本
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
isOpen: false, //dom是否展开
data: [
// {
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数
// email: '',
// phone: '',
// realName: ''
// }
] ]
}, },
// 到港信息 // 到港信息
...@@ -145,7 +93,7 @@ const appointmentInfo = [ ...@@ -145,7 +93,7 @@ const appointmentInfo = [
dateValue: '', //YYYY-MM-DD dateValue: '', //YYYY-MM-DD
timeValue: '', //HH:mm timeValue: '', //HH:mm
compositionTime: true, //是否组合时间 compositionTime: true, //是否组合时间
finishTime: '',
required: false, required: false,
disabled: false, disabled: false,
placeholder: '请选择', placeholder: '请选择',
...@@ -161,6 +109,7 @@ const appointmentInfo = [ ...@@ -161,6 +109,7 @@ const appointmentInfo = [
domType: 'datetimePicker', domType: 'datetimePicker',
dateValue: '', //YYYY-MM-DD dateValue: '', //YYYY-MM-DD
timeValue: '', //HH:mm timeValue: '', //HH:mm
finishTime: '',
compositionTime: true, //是否组合时间 compositionTime: true, //是否组合时间
required: false, required: false,
disabled: false, disabled: false,
...@@ -222,6 +171,31 @@ const appointmentInfo = [ ...@@ -222,6 +171,31 @@ const appointmentInfo = [
}, },
// 陪同转介人信息 // 陪同转介人信息
{ {
fatherTitle: '陪同转介人',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'referrerDtoList',
anchorKey: 'referrerDtoList',
moudleType: 'referrerDtoList',
dataLength: 1, //设置dataLength,用于控制子级dom的个数,子级保存一个样例数据,便于加子级数据
showTable: true,
showMoudle: false, //模块是否展示
addChildren: true, //是否可以新增子级dom
addChildrenTxt: '陪同转介人', //新增按钮得文本
fatherRequired: false, //父级必填,代表个人资料这个模块有必填项
isOpen: false, //dom是否展开
data: [
// {
// id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
// span: 24, //栅格布局份数
// email: '',
// phone: '',
// realName: ''
// }
]
},
// 陪同转介人信息
{
fatherTitle: '签单员', fatherTitle: '签单员',
keyType: 'Array', //用于表单收集值时,判断是数组还是对象 keyType: 'Array', //用于表单收集值时,判断是数组还是对象
key: 'userSignDtoList', key: 'userSignDtoList',
......
...@@ -39,7 +39,7 @@ const productPlan = [ ...@@ -39,7 +39,7 @@ const productPlan = [
}, },
{ {
label: '产品名称', label: '产品名称',
key: 'productLaunchName', key: 'productLaunchMainName',
domType: 'SearchSelect', domType: 'SearchSelect',
required: true, required: true,
maxLength: 30, maxLength: 30,
......
{ {
"isCopyAddress": [ "apiAppointmentInfoDto": {
true "appointmentBizId": "appointment_lrEyN7kxrSU2YZLt",
], "appointmentNo": "Y2601082985339",
"nameCn": "王玉珍", "customerBizId": "customer_iNeCSyIKYrjXVTXa",
"namePyEn": "WANGYUZHEN", "customerNo": null,
"documentType": "idCard", "fnaBizId": "fna_nWhIilamRAqCV27g",
"idNumber": "411424199704041622", "fnaNo": "CSF-B-20260107-0906",
"gender": "2", "proposalBizId": null,
"birthday": "1997-04-04", "proposalNo": null,
"age": "28", "applyType": "INVESTMENT",
"nationality": "中国澳门", "signDate": "2026-01-14 00:00:00",
"birthplace": "111111", "arrivalTime": "2026-01-08 00:00:00",
"isOtherCountry": "1", "departureTime": "2026-01-14 00:00:00",
"smokingStatus": "1", "meetingPoint": "INSURANCE_COMPANY",
"maritalStatus": "SINGLE", "signingAddress": "6666",
"educationLevel": "SECONDARY", "hkMobileCode": "+81",
"isRetirement": "1", "hkMobile": "5556",
"retirementAge": "55", "isOpenAccount": 0,
"riskAppetite": "LOW", "bankId": null,
"weight": "51", "policyTransfer": null,
"height": "160", "isUseCar": 0,
"bmi": "19.92", "isReferrerAccompany": 0,
"mobile": "11111", "creatorName": "zs",
"residenceMobile": "2222", "referrerDtoList": [],
"landline": "22222", "userSignDtoList": [
"email": "33333", {
"mailingAddressCode": "55555", "appointmentUserSignBizId": "appointment_user_sign_1x7bWfRC8YkmpiL4",
"employmentStatus": "1", "userSignBizId": "user_sign_rrrrsae445556er",
"csName": "33333", "userBizId": "user_HNpzB3A0A72JMLVN",
"industry": "44444", "name": "SW",
"currentMonthlyIncome": "5555", "practiceCode": "6666",
"totalWorkingYears": "12", "phone": "6666",
"currentTenure": "12", "cardType": "household_register",
"position": "哇哇哇哇", "cardNo": "6666",
"companyMobile": "4444", "email": "6666"
"companyAddressCode": "7777", }
"monthIncome": "222", ]
"monthExpenditure": "333", },
"totalCurrentAssets": "12222", "apiProductPlanInfoDto": {
"totalDebt": "1", "apiProductPlanMainInfoDto": {
"travel": "111", "planBizId": "product_plan_aMNtyxS4lQp3Dou3",
"exercise": "GOLF", "companyId": "insurance_company_7dtUJyhgDk6v5Eva",
"game": "OTHER", "companyName": "上海测试有限公司",
"movieDrama": "HORROR", "insuranceTypeId": "e67a90222b654545a5778df3fcc8ced3",
"delicacy": "111", "insuranceTypeName": "重疾险",
"certificateAddress": "1111111", "productLaunchBizId": "product_launch_1LcCgSXEsf0KfmQM",
"country": "MACAO", "productLaunchMainName": "附加产品001",
"countryName": "中国澳门", "issueNumber": "3",
"mobileCode": "+1", "guaranteePeriod": "6666",
"phoneString": "+355 4444", "policyCurrency": "SGD",
"key": "companyMobile", "sumInsured": 6666,
"residenceMobileCode": "+1284", "paymentFrequency": "QUARTER",
"companyMobileCode": "+355", "eachIssuePremium": 6666,
"addressList": [ "initialPaymentMethod": "UNIONPAY",
{ "policyLevy": 6666,
"region": "111", "isPrepay": 0,
"city": "222", "isTraceable": 1,
"street": "333", "isBacktrack": 1,
"location": "444", "isJoin": 0,
"objType": "address", "dividendDistributionMethod": "BREATH",
"type": "mailingAddress", "renewalPaymentMethod": "UNIONPAY"
"addressString": "111222333444"
}, },
{ "apiProductPlanAdditionalInfoDtoList": [
"region": "111", {
"city": "222", "additionalBizId": "additional_zriaqQRTuqwhFPON",
"street": "333", "planBizId": "product_plan_aMNtyxS4lQp3Dou3",
"location": "444", "productLaunchBizId": "product_launch_1LcCgSXEsf0KfmQM",
"objType": "address", "productLaunchName": "附加产品001",
"type": "residentialAddress", "paymentFrequency": null,
"addressString": "111222333444" "issueNumber": "3",
}, "guaranteePeriod": "6666",
{ "policyCurrency": "USD",
"region": "555", "sumInsured": 6666,
"city": "555", "eachIssuePremium": 6666,
"street": "666", "protectionLevel": "6666",
"location": "666", "guaranteeRegion": "6666",
"objType": "address", "deductibles": "6666",
"type": "companyAddress", "additionalSafeguards": "6666",
"addressString": "555555666666" "policyLevy": 0
} }
], ]
"apiTaxationDtoList": [ },
{ "apiPolicyholderInfoDto": {
"id": 1766714955566, "policyholderBizId": "policyholder_uMqoYsDOOQ3AOpu9",
"span": 24, "customerBizId": "customer_iNeCSyIKYrjXVTXa",
"taxCountry": "1111", "customerNo": null,
"taxId": "22222" "nameCn": "最新的投保人",
} "namePyEn": "ZUIXINDE",
] "documentType": "idCard",
"idNumber": "411424199604041622",
"gender": "2",
"birthday": "2007-01-01 00:00:00",
"age": "19",
"nationality": "英属处女群岛",
"birthplace": "1284",
"isOtherCountry": 0,
"smokingStatus": "1",
"maritalStatus": "SINGLE",
"educationLevel": "UNIVERSITY",
"isRetirement": 0,
"retirementAge": null,
"height": "158",
"weight": "50",
"bmi": "20.03",
"riskAppetite": "CHINESE",
"dependentsNum": 1,
"mobileCode": "+81",
"mobile": "1284",
"residenceMobileCode": "+886",
"residenceMobile": "1284",
"landlineCode": null,
"landline": "1284",
"email": "1284",
"certificateAddress": "1284",
"mailingAddress": null,
"residentialAddress": null,
"mailingAddressCode": "1284",
"employmentStatus": "1",
"csName": "1284",
"industry": "1284",
"currentMonthlyIncome": null,
"totalWorkingYears": 1284,
"currentTenure": null,
"position": "1284",
"companyAddress": null,
"companyMobileCode": null,
"companyMobile": null,
"companyAddressCode": "1284",
"monthIncome": 1284,
"monthExpenditure": 1284,
"totalCurrentAssets": 1284,
"totalDebt": 1284,
"travel": "1284",
"exercise": "BICYCLE",
"game": "STIMULATE",
"movieDrama": "HISTORY",
"delicacy": "1284",
"addressList": [
{
"type": "mailingAddress",
"region": "1284",
"city": "1284",
"street": "1284",
"location": "1284"
},
{
"type": "residentialAddress",
"region": "1284",
"city": "1284",
"street": "1284",
"location": "1284"
},
{
"type": "companyAddress",
"region": "1284",
"city": "1284",
"street": "1284",
"location": "1284"
}
],
"apiTaxationDtoList": null,
"birthdayValid": true
},
"apiInsurantInfoDto": {
"insurantBizId": "insurant_eH5N7m2YyVHQ54H3",
"customerBizId": "customer_iNeCSyIKYrjXVTXa",
"customerNo": null,
"policyholderRel": "PARENTS",
"nameCn": "最新的受保",
"namePyEn": "ZUIXINDESHOUBAO",
"documentType": "idCard",
"idNumber": "411424199604041622",
"gender": "2",
"birthday": "2007-01-01 00:00:00",
"age": "19",
"nationality": "英属处女群岛",
"birthplace": "1284",
"isOtherCountry": 0,
"smokingStatus": "1",
"maritalStatus": "SINGLE",
"educationLevel": "UNIVERSITY",
"isRetirement": 0,
"retirementAge": null,
"height": "158",
"weight": "50",
"bmi": "20.03",
"riskAppetite": "CHINESE",
"dependentsNum": 1,
"mobileCode": "+81",
"mobile": "1284",
"residenceMobileCode": "+886",
"residenceMobile": "1284",
"landlineCode": null,
"landline": "1284",
"email": "1284",
"certificateAddress": "1284",
"mailingAddress": null,
"residentialAddress": null,
"mailingAddressCode": "1284",
"employmentStatus": "1",
"csName": "1284",
"industry": "1284",
"currentMonthlyIncome": null,
"totalWorkingYears": 1284,
"currentTenure": null,
"position": "1284",
"companyAddress": null,
"companyMobileCode": null,
"companyMobile": null,
"companyAddressCode": "1284",
"monthIncome": 1284,
"monthExpenditure": 1284,
"totalCurrentAssets": 1284,
"totalDebt": 1284,
"travel": "1284",
"exercise": "BICYCLE",
"game": "STIMULATE",
"movieDrama": "HISTORY",
"delicacy": "1284",
"addressList": [
{
"type": "mailingAddress",
"region": "1284",
"city": "1284",
"street": "1284",
"location": "1284"
},
{
"type": "residentialAddress",
"region": "1284",
"city": "1284",
"street": "1284",
"location": "1284"
},
{
"type": "companyAddress",
"region": "1284",
"city": "1284",
"street": "1284",
"location": "1284"
}
],
"apiTaxationDtoList": null,
"self": false,
"birthdayValid": true
},
"apiSecondHolderInfoDto": {},
"apiBeneficiaryInfoFzDto": {
"apiBeneficiaryInfoDtoList": [
{
"id": 1767840050795,
"appointmentBizId": "appointment_lrEyN7kxrSU2YZLt",
"beneficiaryBizId": "beneficiary_rJq87qgQKrTnHLIZ",
"insurantRel": "PARENTS",
"nameCn": "受益人",
"namePyEn": "SHOUYIREN",
"documentType": "idCard",
"idNumber": "411414199604041234",
"gender": "1",
"birthday": "1996-04-04 00:00:00",
"nationality": "中国澳门",
"benefitRatio": 6666
}
],
"isLegalBeneficiary": 0
},
"materialDtoList": []
} }
<template> <template>
<div class="formContainer"> <div class="formContainer">
<div class="formLeft" v-if="showAnchor"> <div class="formLeft" v-if="showAnchor && scrollContainerSelector">
<el-affix :offset="affixOffset"> <el-affix :offset="affixOffset">
<el-anchor <el-anchor
:direction="direction" :direction="direction"
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
v-model="form[child.key]" v-model="form[child.key]"
type="date" type="date"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss"
:placeholder="child.placeholder" :placeholder="child.placeholder"
:disabled="editStatus" :disabled="editStatus"
:disabled-date="time => disabledDate(time, child)" :disabled-date="time => disabledDate(time, child)"
...@@ -337,13 +337,15 @@ import useDictStore from '@/store/modules/dict' ...@@ -337,13 +337,15 @@ import useDictStore from '@/store/modules/dict'
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,所以需要父组件传值控制子组件的编辑状态 fatherEditStatus: { type: Boolean, default: false }, //因为嵌套了双层tab,所以需要父组件传值控制子组件的编辑状态
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
tabIndex: { type: [String, Number], default: '' }, //tab索引 tabIndex: { type: [String, Number], default: '' }, //tab索引
affixOffset: { type: Number, default: 250 }, //锚点吸顶距离 affixOffset: { type: Number, default: 250 }, //锚点吸顶距离
customerBizId: { type: String, default: '' }, //提交状态,新增、修改 customerBizId: { type: String, default: '' }, //提交状态,新增、修改
tabSource: { type: String, default: '' }, tabSource: { type: String, default: '' },
idsObj: { type: Object, default: () => ({}) } //引用这个组件的页面来源,用于逻辑判断 idsObj: { type: Object, default: () => ({}) }, //引用这个组件的页面来源,用于逻辑判断
apiPolicyholderInfoDto: { type: Object, default: () => ({}) }, //投保人编辑状态详情
apiInsurantInfoDto: { type: Object, default: () => ({}) } //受保人编辑状态详情
}) })
const emit = defineEmits(['handleSuccess']) const emit = defineEmits(['handleSuccess'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
...@@ -362,7 +364,7 @@ const tableLoading = ref(false) ...@@ -362,7 +364,7 @@ const tableLoading = ref(false)
const tableData = ref([]) const tableData = ref([])
const total = ref(0) const total = ref(0)
//计算默认显示的日期(18年前的今天) //计算默认显示的日期(18年前的今天)
const defaultDisplayDate = ref(dayjs().subtract(18, 'year').toDate()) const defaultDisplayDate = ref(dayjs().subtract(19, 'year').toDate())
// 地址组件菜单数据 // 地址组件菜单数据
const addressMenuList = ref([ const addressMenuList = ref([
...@@ -610,7 +612,7 @@ const handleDateChange = child => { ...@@ -610,7 +612,7 @@ const handleDateChange = child => {
const disabledDate = (time, child) => { const disabledDate = (time, child) => {
if (child.key == 'birthday') { if (child.key == 'birthday') {
// 计算18年前的今天 // 计算18年前的今天
const eighteenYearsAgo = dayjs().subtract(18, 'year') const eighteenYearsAgo = dayjs().subtract(19, 'year')
// 禁用今天之后的日期和18年前的今天之后的日期 // 禁用今天之后的日期和18年前的今天之后的日期
return time.getTime() > Date.now() || time.getTime() > eighteenYearsAgo.valueOf() return time.getTime() > Date.now() || time.getTime() > eighteenYearsAgo.valueOf()
} else { } else {
...@@ -646,8 +648,6 @@ const customerList = () => { ...@@ -646,8 +648,6 @@ const customerList = () => {
const handleExport = row => { const handleExport = row => {
oldCustomerData.value = JSON.parse(JSON.stringify(processedCustomerData.value)) // 修改时存储原始数据,便于撤销操作 oldCustomerData.value = JSON.parse(JSON.stringify(processedCustomerData.value)) // 修改时存储原始数据,便于撤销操作
oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) // 修改时存储原始数据,便于撤销操作 oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) // 修改时存储原始数据,便于撤销操作
console.log('导入前form', oldObjInfo.value)
console.log('导入前dom', oldCustomerData.value)
setFormValue(row, processedCustomerData.value, true) setFormValue(row, processedCustomerData.value, true)
openList.value = false openList.value = false
...@@ -679,20 +679,6 @@ const processFormData = async () => { ...@@ -679,20 +679,6 @@ const processFormData = async () => {
const processedData = JSON.parse(JSON.stringify(customerDomData)) const processedData = JSON.parse(JSON.stringify(customerDomData))
rules.value = {} rules.value = {}
for (const section of processedData) { for (const section of processedData) {
// 如果在受保人中,与投保人关系已填写,根据填写内容展示对应的模块
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') { if (props.activeName == 'insurantInfo' && section.key == 'policyholderRel') {
section.showMoudle = true section.showMoudle = true
} else if (props.activeName !== 'insurantInfo' && section.key == 'policyholderRel') { } else if (props.activeName !== 'insurantInfo' && section.key == 'policyholderRel') {
...@@ -741,6 +727,12 @@ const processFormData = async () => { ...@@ -741,6 +727,12 @@ const processFormData = async () => {
) { ) {
//是投保人/受保人但是新增预约 需要引用客户资料的值 //是投保人/受保人但是新增预约 需要引用客户资料的值
getCustomerInfo(props.customerBizId, processedData) getCustomerInfo(props.customerBizId, processedData)
} else if (props.tabSource == 'policyholder' && props.idsObj.appointmentBizId) {
// 投保人回显值
setFormValue(props.apiPolicyholderInfoDto, processedData)
} else if (props.tabSource == 'insurantInfo' && props.idsObj.appointmentBizId) {
// 投保人回显值
setFormValue(props.apiInsurantInfoDto, processedData)
} else { } else {
processedCustomerData.value = oldCustomerData.value = processedData processedCustomerData.value = oldCustomerData.value = processedData
} }
...@@ -954,9 +946,6 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -954,9 +946,6 @@ const setFormValue = (obj, formData, exportValue) => {
phoneQuickList.value = [] phoneQuickList.value = []
// 深拷贝原始数据 // 深拷贝原始数据
form.value = JSON.parse(JSON.stringify(obj)) form.value = JSON.parse(JSON.stringify(obj))
if (props.activeName == 'insurantInfo' && !props.idsObj.appointmentBizId) {
form.value['policyholderRel'] = ''
}
// 深拷贝原始数据 // 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(formData)) const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) { for (const section of processedData) {
...@@ -971,11 +960,24 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -971,11 +960,24 @@ const setFormValue = (obj, formData, exportValue) => {
) { ) {
section.data = JSON.parse(JSON.stringify(obj.apiTaxationDtoList)) section.data = JSON.parse(JSON.stringify(obj.apiTaxationDtoList))
} }
// 编辑状态当tab为受保人时,与投保人关系为本人控制受保人信息模块隐藏
if (
props.activeName == 'insurantInfo' &&
props.idsObj.appointmentBizId &&
obj.policyholderRel == 'MYSELF' &&
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 (obj.isRetirement && obj.isRetirement == '1' && field.key == 'retirementAge') { if (obj.isRetirement && obj.isRetirement == '1' && field.key == 'retirementAge') {
field.show = true field.show = true
} }
if (obj.isRetirement || obj.isRetirement == 0) {
form.value['isRetirement'] = String(obj.isRetirement)
}
//要判断drawerType,因为抽屉要回显数据 //要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) { switch (field.drawerType) {
case 'phone': case 'phone':
...@@ -1078,6 +1080,7 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -1078,6 +1080,7 @@ const setFormValue = (obj, formData, exportValue) => {
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString') addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
processedCustomerData.value = processedData processedCustomerData.value = processedData
console.log('processedCustomerData.value', processedCustomerData.value)
} }
// 数组去重 // 数组去重
function removeDuplicates(arr, key) { function removeDuplicates(arr, key) {
...@@ -1100,7 +1103,12 @@ const getInvalidFields = fields => { ...@@ -1100,7 +1103,12 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message:
props.activeName == 'policyHolderInfo'
? `投保人模块-${fields[field][0].message}`
: props.activeName == 'insuredInfo'
? `受保人模块-${fields[field][0].message}`
: fields[field][0].message
}) })
} }
} }
...@@ -1143,128 +1151,151 @@ const resetShow = (key, status) => { ...@@ -1143,128 +1151,151 @@ const resetShow = (key, status) => {
} }
} }
// 暴露一个同步获取数据的方法
const getFormData = () => {
// 确保form对象包含所有必要的字段
const formData = { ...form.value }
// 如果policyholderRel不存在,尝试从select元素获取
if (!formData.hasOwnProperty('policyholderRel') || !formData.policyholderRel) {
// 这里可以根据你的实际情况获取最新的值
const selectElement = document.querySelector('[data-key="policyholderRel"]')
if (selectElement) {
formData.policyholderRel = selectElement.value
}
}
return formData
}
//source:因为这个组件是公共组件所以提交的时候要知道是哪里要获取表单的值 //source:因为这个组件是公共组件所以提交的时候要知道是哪里要获取表单的值
const handleFormValues = source => { const handleFormValues = source => {
let submitObj = {}
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理
if (source == 'policyHolderInfoRef') {
form.value['policyholderRel'] = '111' //因为校验在form上所以这句不能去除
submitObj = { ...policyholderForm.value }
} else if (source == 'insuredInfoRef') {
submitObj = { ...insuredForm.value }
} else {
submitObj = { ...form.value }
}
let processedData = JSON.parse(JSON.stringify(processedCustomerData.value))
return new Promise(async resolve => { return new Promise(async resolve => {
let submitObj = {} // 如果没有点击受保人这个tab页就进行填写提醒,
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理 if (
if (source == 'policyHolderInfoRef') { source == 'insuredInfoRef' &&
form.value['policyholderRel'] = '111' //因为校验在form上所以这句不能去除 !props.idsObj.appointmentBizId &&
submitObj = { ...policyholderForm.value } !form.value['policyholderRel']
} else if (source == 'insuredInfoRef') { ) {
submitObj = { ...insuredForm.value } resolve(undefined)
} else { return
submitObj = { ...form.value }
} }
let addressList = [] if (processedData.length > 0) {
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday']) customerFormRef.value.validate((valid, fields) => {
customerFormRef.value.validate((valid, fields) => { if (valid) {
if (valid) { if (source == 'insuredInfoRef') {
errorFields.value = [] // 清空错误信息 console.log('====================================')
//处理表单数据 console.log('submitObj', form.value['policyholderRel'])
for (const key1 in form.value) { console.log('====================================')
for (const key2 in saveKey.value) { }
//要判断drawerType let addressList = []
switch (saveKey.value[key2].objType) { if (submitObj['birthday']) {
case 'phone': if (source == 'insuredInfoRef' || source == 'policyHolderInfoRef') {
if (key1 == key2) { submitObj['birthday'] = proxy.formatToDateTime(submitObj['birthday'])
for (const key3 in saveKey.value[key2]) { } else {
submitObj[key3] = saveKey.value[key2][key3] submitObj['birthday'] = proxy.formatToDate(submitObj['birthday'])
}
}
errorFields.value = [] // 清空错误信息
//处理表单数据
for (const key1 in form.value) {
for (const key2 in saveKey.value) {
//要判断drawerType
switch (saveKey.value[key2].objType) {
case 'phone':
if (key1 == key2) {
for (const key3 in saveKey.value[key2]) {
submitObj[key3] = saveKey.value[key2][key3]
}
} }
}
break break
case 'address': case 'address':
if (key1 == key2) { if (key1 == key2) {
addressList.push(saveKey.value[key2]) addressList.push(saveKey.value[key2])
} }
break break
case 'country': case 'country':
if (key1 == key2) { if (key1 == key2) {
submitObj['country'] = saveKey.value[key2]['countryCode'] submitObj['country'] = saveKey.value[key2]['countryCode']
submitObj['countryName'] = saveKey.value[key2]['name'] submitObj['countryName'] = saveKey.value[key2]['name']
} }
break break
default: default:
break break
}
} }
} }
} if (addressList.length > 0) {
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 => {
delete submitObj[item]
})
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
if (props.customerBizId && props.activeName == 'customer') { processedCustomerData.value.forEach(item => {
editCustomer(submitObj).then(res => { if (item.key == 'apiTaxationDtoList' && item.data.length > 0) {
if (res.code == 200) { submitObj['apiTaxationDtoList'] = item.data.filter(item => {
handleEditStatus() return item.taxCountry && item.taxCountry.trim() && item.taxId && item.taxId.trim()
proxy.$message.success('客户修改成功')
emit('handleSuccess', {
tab: 'customer',
customerBizId: props.customerBizId,
type: 'edit'
}) })
} }
}) })
} else if (!props.customerBizId && props.activeName == 'customer') {
addFna({ remark: '' }).then(response => { // 删除多余字段
if (response.code == 200) { deleteKeyList.value.forEach(item => {
addCustomer(submitObj).then(res => { delete submitObj[item]
if (res.code == 200) {
proxy.$message.success('客户新增成功')
emit('handleSuccess', {
tab: 'customer',
customerBizId: res.data.customerBizId,
fnaBizId: response.data.fnaBizId,
type: 'add'
})
}
})
}
}) })
}
resolve(errorFields.value.length == 0 ? submitObj : null) if (errorFields.value.length > 0) {
} else { proxy.$message.error(errorFields.value[0].message)
errorFields.value = getInvalidFields(fields) return undefined
if (errorFields.value.length > 0) { }
proxy.$message.error(errorFields.value[0].message)
if (props.customerBizId && props.activeName == 'customer') {
editCustomer(submitObj).then(res => {
if (res.code == 200) {
handleEditStatus()
proxy.$message.success('客户修改成功')
emit('handleSuccess', {
tab: 'customer',
customerBizId: props.customerBizId,
type: 'edit'
})
}
})
} else if (!props.customerBizId && props.activeName == 'customer') {
addFna({ remark: '' }).then(response => {
if (response.code == 200) {
addCustomer(submitObj).then(res => {
if (res.code == 200) {
proxy.$message.success('客户新增成功')
emit('handleSuccess', {
tab: 'customer',
customerBizId: res.data.customerBizId,
fnaBizId: response.data.fnaBizId,
type: 'add'
})
}
})
}
})
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
} else {
// 编辑状态
if (props.idsObj.appointmentBizId) {
if (source == 'policyHolderInfoRef') {
resolve(props.apiPolicyholderInfoDto)
} else if (source == 'insuredInfoRef') {
resolve(props.apiInsurantInfoDto)
} }
} else {
// 新增状态
// 因为这两个在同一个大提交里,所以要判断是哪个提交,方便这两个都有自己独立的提交验证
resolve(undefined) resolve(undefined)
} }
}) }
}) })
} }
const anchorList = computed(() => { const anchorList = computed(() => {
...@@ -1302,6 +1333,9 @@ watch( ...@@ -1302,6 +1333,9 @@ watch(
} else if (props.tabSource == 'customer' && !props.customerBizId) { } else if (props.tabSource == 'customer' && !props.customerBizId) {
editStatus.value = false editStatus.value = false
} }
if (newVal === 'policyholder' || newVal === 'insurantInfo') {
editStatus.value = props.fatherEditStatus
}
} }
// 切换tab要保存各自的表单值 // 切换tab要保存各自的表单值
if (oldVal == 'policyholder') { if (oldVal == 'policyholder') {
......
...@@ -420,10 +420,14 @@ const handleRemoteSelectChange = async (row, column, father) => { ...@@ -420,10 +420,14 @@ const handleRemoteSelectChange = async (row, column, father) => {
} }
} }
if (column.prop == 'insuranceType' && row.insuranceType) { if (column.prop == 'insuranceType' && row.insuranceType) {
// 改变险种的时候逻辑还未处理
//如果险种选择了重疾险,则显示重疾险的输入框 //如果险种选择了重疾险,则显示重疾险的输入框
row.insuranceTypeOption.forEach(item => { row.insuranceTypeOption.forEach(item => {
if (item.value == row.insuranceType && item.code == 'CI') { if (item.value == row.insuranceType) {
row.showSumInsured = true if (item.code == 'CI') {
row.showSumInsured = true
}
row.insuranceType = item.label
} }
}) })
} }
...@@ -823,13 +827,13 @@ const submitForm = saveType => { ...@@ -823,13 +827,13 @@ const submitForm = saveType => {
} }
}) })
} }
if (item.insuranceType) { // if (item.insuranceType) {
item.insuranceTypeOption.forEach(item2 => { // item.insuranceTypeOption.forEach(item2 => {
if (item2.value == item.insuranceType) { // if (item2.value == item.insuranceType) {
item.insuranceType = item2.label // item.insuranceType = item2.label
} // }
}) // })
} // }
}) })
result[section.key] = section.data result[section.key] = section.data
} }
......
...@@ -131,7 +131,6 @@ import useDictStore from '@/store/modules/dict' ...@@ -131,7 +131,6 @@ import useDictStore from '@/store/modules/dict'
import { addFna, getProcessDetail, updateProcess, getCustomerDetail } from '@/api/sign/fna' import { addFna, getProcessDetail, updateProcess, getCustomerDetail } from '@/api/sign/fna'
import { import {
listTenantUser, listTenantUser,
getInsuranceProductList,
getAdditionalProductList, getAdditionalProductList,
getBankList, getBankList,
getUserSaleExpandList, getUserSaleExpandList,
...@@ -230,17 +229,6 @@ const getDictsData = async () => { ...@@ -230,17 +229,6 @@ const getDictsData = async () => {
pageSize: 10 pageSize: 10
} }
// const response2 = await getInsuranceProductList(params2)
// if (response2.code == 200) {
// response2.data.records = response2.data.records.map(item => {
// return {
// ...item,
// label: item.productName,
// value: item.productBizId
// }
// })
// dictStore.setInsureProductList(response2.data.records)
// }
const params3 = { const params3 = {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
...@@ -399,7 +387,7 @@ const processUpdate = (data, status) => { ...@@ -399,7 +387,7 @@ const processUpdate = (data, status) => {
} }
// 获取流程详情 // 获取流程详情
function getProcessInfo(fnaBizId, changeTab) { function getProcessInfo(fnaBizId, changeTab, currentTab) {
getProcessDetail(fnaBizId).then(res => { getProcessDetail(fnaBizId).then(res => {
if (res.code == 200) { if (res.code == 200) {
processInfo.value = res.data processInfo.value = res.data
...@@ -415,7 +403,9 @@ function getProcessInfo(fnaBizId, changeTab) { ...@@ -415,7 +403,9 @@ function getProcessInfo(fnaBizId, changeTab) {
processInfo.value.status = item.label processInfo.value.status = item.label
} }
}) })
if (changeTab) { if (currentTab == 'appointment' && changeTab == 'appointment') {
router.push({ path: '/sign/appointment' })
} else if (changeTab) {
activeName.value = changeTab activeName.value = changeTab
} }
} }
...@@ -524,7 +514,7 @@ const handleSuccess = info => { ...@@ -524,7 +514,7 @@ const handleSuccess = info => {
break break
case 'appointment': case 'appointment':
if (info.type == 'add') { if (info.type == 'add') {
getProcessInfo(processInfo.value.fnaBizId, 'newpolicy') getProcessInfo(processInfo.value.fnaBizId, 'appointment', 'appointment')
} else { } else {
} }
break break
......
...@@ -290,7 +290,13 @@ function handleAdd() { ...@@ -290,7 +290,13 @@ function handleAdd() {
function handleUpdate(row) { function handleUpdate(row) {
router.push({ router.push({
path: '/sign/FnaList/edit', path: '/sign/FnaList/edit',
query: { fnaBizId: row.fnaBizId, type: 'edit', status: row.status, source: 'fnaList' } query: {
fnaBizId: row.fnaBizId,
type: 'edit',
status: row.status,
source: 'fnaList',
appointmentBizId: row.appointmentBizId
}
}) })
} }
......
...@@ -30,13 +30,52 @@ ...@@ -30,13 +30,52 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<el-button type="success" :icon="Check" @click="handleSubmit('submit')">提交</el-button> <div v-if="appointmentSummeryInfo.status == '2'">
<el-button <el-button
v-if="idsObj.appointmentBizId" v-if="pageSource !== 'policyList' && idsObj.appointmentBizId"
type="primary" type="warning"
icon="Plus" :icon="Edit"
@click="handleAddExecl" @click="handleCancel('appoint')"
>上传EXECL</el-button >取消预约</el-button
>
</div>
<div v-else="appointmentSummeryInfo.status !== '2'" style="margin-right: 10px">
<el-button
v-if="pageSource !== 'policyList' && editStatus"
type="primary"
:icon="Edit"
@click="handleEdit"
>编辑</el-button
>
<el-button type="primary" v-if="!editStatus" @click="handleSubmit('editStorage')"
>暂存</el-button
>
<el-button
v-if="!editStatus"
type="success"
:icon="Check"
@click="handleSubmit('submit')"
>提交</el-button
>
<el-button
v-if="
pageSource !== 'policyList' &&
appointmentSummeryInfo.status == '1' &&
idsObj.appointmentBizId
"
type="warning"
:icon="Edit"
@click="handleCancel('apply')"
>取消申请</el-button
>
</div>
<el-button v-if="idsObj.appointmentBizId" type="primary" @click="assetVerification"
>投保人资产验证</el-button
>
<el-button v-if="idsObj.appointmentBizId" type="primary" @click="assetVerification"
>投保人收支验证</el-button
> >
</div> </div>
</div> </div>
...@@ -52,12 +91,13 @@ ...@@ -52,12 +91,13 @@
>上传EXECL</el-button >上传EXECL</el-button
> --> > -->
<el-button <el-button
v-if="pageSource !== 'policyList'" v-if="pageSource !== 'policyList' && idsObj.appointmentBizId"
type="primary" type="primary"
:icon="Edit" :icon="Edit"
@click="handleEdit" @click="handleEdit"
>编辑</el-button >编辑</el-button
> >
<el-button <el-button
v-if="pageSource !== 'policyList'" v-if="pageSource !== 'policyList'"
type="success" type="success"
...@@ -72,6 +112,12 @@ ...@@ -72,6 +112,12 @@
@click="handleSubmit('storage')" @click="handleSubmit('storage')"
>暂存</el-button >暂存</el-button
> >
<el-button v-if="idsObj.appointmentBizId" type="primary" @click="assetVerification"
>投保人资产验证</el-button
>
<el-button v-if="idsObj.appointmentBizId" type="primary" @click="assetVerification"
>投保人收支验证</el-button
>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -91,12 +137,12 @@ ...@@ -91,12 +137,12 @@
:idsObj="idsObj" :idsObj="idsObj"
:apiAppointmentInfoDto="appointmentSummeryInfo.apiAppointmentInfoDto" :apiAppointmentInfoDto="appointmentSummeryInfo.apiAppointmentInfoDto"
:appointmentStatus="appointmentSummeryInfo.status" :appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="appointmentInfoRef" ref="appointmentInfoRef"
:tabIndex="tabsList.findIndex(t => t.name === 'appointmentInfo')" :tabIndex="tabsList.findIndex(t => t.name === 'appointmentInfo')"
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName" :fatherTabName="tabName"
:editStatus="editStatus" :editStatus="editStatus"
:affixOffset="pageSource == 'fnaList' ? 360 : 250"
/> />
</div> </div>
<div v-if="tab.name === 'productPlan'"> <div v-if="tab.name === 'productPlan'">
...@@ -106,7 +152,6 @@ ...@@ -106,7 +152,6 @@
:idsObj="idsObj" :idsObj="idsObj"
:apiProductPlanInfoDto="appointmentSummeryInfo.apiProductPlanInfoDto" :apiProductPlanInfoDto="appointmentSummeryInfo.apiProductPlanInfoDto"
:appointmentStatus="appointmentSummeryInfo.status" :appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="productPlanRef" ref="productPlanRef"
@policyEditSuccess="getPolicyDetail" @policyEditSuccess="getPolicyDetail"
:pageSource="pageSource" :pageSource="pageSource"
...@@ -115,16 +160,16 @@ ...@@ -115,16 +160,16 @@
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName" :fatherTabName="tabName"
:editStatus="editStatus" :editStatus="editStatus"
:affixOffset="pageSource == 'fnaList' ? 360 : 250"
/> />
</div> </div>
<!-- 投保人 --> <!-- 投保人 -->
<div v-if="tab.name === 'policyholder'"> <div v-if="tab.name === 'policyholder'">
<!-- @handleSuccess="handleSuccess"-->
<Customer <Customer
:activeName="activeName" :activeName="activeName"
:fatherTabName="tabName" :fatherTabName="tabName"
:fatherStatus="editStatus" :fatherStatus="editStatus"
:affixOffset="360" :affixOffset="pageSource == 'fnaList' ? 360 : 250"
:tabIndex="tabsList.findIndex(t => t.name === 'policyholder')" :tabIndex="tabsList.findIndex(t => t.name === 'policyholder')"
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
tabSource="policyholder" tabSource="policyholder"
...@@ -135,27 +180,13 @@ ...@@ -135,27 +180,13 @@
:idsObj="idsObj" :idsObj="idsObj"
:customerBizId="props.processDetail.customerBizId" :customerBizId="props.processDetail.customerBizId"
/> />
<!-- <PolicyHolderInfo
:activeName="activeName"
:formStatus="formStatus"
:customerInfo="customerInfo"
:idsObj="idsObj"
:apiPolicyholderInfoDto="appointmentSummeryInfo.apiPolicyholderInfoDto"
:appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="policyHolderInfoRef"
:pageSource="pageSource"
:showSubmitBtn="showSubmitBtn"
@policyEditSuccess="getPolicyDetail"
/> -->
</div> </div>
<div v-if="tab.name === 'insurantInfo'"> <div v-if="tab.name === 'insurantInfo'">
<!-- :customerBizId="processInfo.customerBizId" @handleSuccess="handleSuccess"-->
<Customer <Customer
:activeName="activeName" :activeName="activeName"
:fatherTabName="tabName" :fatherTabName="tabName"
:fatherStatus="editStatus" :fatherStatus="editStatus"
:affixOffset="360" :affixOffset="pageSource == 'fnaList' ? 360 : 250"
:tabIndex="tabsList.findIndex(t => t.name === 'insurantInfo')" :tabIndex="tabsList.findIndex(t => t.name === 'insurantInfo')"
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
tabSource="insurantInfo" tabSource="insurantInfo"
...@@ -163,21 +194,8 @@ ...@@ -163,21 +194,8 @@
:fatherEditStatus="editStatus" :fatherEditStatus="editStatus"
:idsObj="idsObj" :idsObj="idsObj"
:customerBizId="props.processDetail.customerBizId" :customerBizId="props.processDetail.customerBizId"
/>
<!-- <InsuredInfo
:activeName="activeName"
:formStatus="formStatus"
:customerInfo="customerInfo"
:idsObj="idsObj"
:apiInsurantInfoDto="appointmentSummeryInfo.apiInsurantInfoDto" :apiInsurantInfoDto="appointmentSummeryInfo.apiInsurantInfoDto"
:currentPolicyholderInfo="currentPolicyholderInfo" />
:appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="insuredInfoRef"
:pageSource="pageSource"
:showSubmitBtn="showSubmitBtn"
@policyEditSuccess="getPolicyDetail"
/> -->
</div> </div>
<div v-if="tab.name === 'secondHolder'"> <div v-if="tab.name === 'secondHolder'">
<SecondHolderInfo <SecondHolderInfo
...@@ -187,7 +205,6 @@ ...@@ -187,7 +205,6 @@
:apiSecondHolderInfoDto="appointmentSummeryInfo.apiSecondHolderInfoDto" :apiSecondHolderInfoDto="appointmentSummeryInfo.apiSecondHolderInfoDto"
:appointmentStatus="appointmentSummeryInfo.status" :appointmentStatus="appointmentSummeryInfo.status"
:customerInfo="customerInfo" :customerInfo="customerInfo"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="secondHolderInfoRef" ref="secondHolderInfoRef"
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
...@@ -196,6 +213,7 @@ ...@@ -196,6 +213,7 @@
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName" :fatherTabName="tabName"
:editStatus="editStatus" :editStatus="editStatus"
:affixOffset="pageSource == 'fnaList' ? 360 : 250"
/> />
</div> </div>
<div v-if="tab.name === 'beneficiary'"> <div v-if="tab.name === 'beneficiary'">
...@@ -203,9 +221,8 @@ ...@@ -203,9 +221,8 @@
:activeName="activeName" :activeName="activeName"
:formStatus="formStatus" :formStatus="formStatus"
:idsObj="idsObj" :idsObj="idsObj"
:apiBeneficiaryInfoDtoList="appointmentSummeryInfo.apiBeneficiaryInfoDtoList" :apiBeneficiaryInfoFzDto="appointmentSummeryInfo.apiBeneficiaryInfoFzDto"
:appointmentStatus="appointmentSummeryInfo.status" :appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="beneficiaryInfoRef" ref="beneficiaryInfoRef"
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
...@@ -214,6 +231,7 @@ ...@@ -214,6 +231,7 @@
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName" :fatherTabName="tabName"
:editStatus="editStatus" :editStatus="editStatus"
:affixOffset="pageSource == 'fnaList' ? 360 : 250"
/> />
</div> </div>
<div v-if="tab.name === 'questionnaires'"> <div v-if="tab.name === 'questionnaires'">
...@@ -222,15 +240,14 @@ ...@@ -222,15 +240,14 @@
:formStatus="formStatus" :formStatus="formStatus"
:idsObj="idsObj" :idsObj="idsObj"
:appointmentStatus="appointmentSummeryInfo.status" :appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="questionnairesInfoRef" ref="questionnairesInfoRef"
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
:foldInsurantInfo="foldInsurantInfo" :foldInsurantInfo="foldInsurantInfo"
:affixOffset="360"
:tabIndex="tabsList.findIndex(t => t.name === 'questionnaires')" :tabIndex="tabsList.findIndex(t => t.name === 'questionnaires')"
anchorContainer=".appointmentTabPaneBox" anchorContainer=".appointmentTabPaneBox"
:editStatus="editStatus" :editStatus="editStatus"
:affixOffset="pageSource == 'fnaList' ? 360 : 250"
/> />
</div> </div>
<div v-if="tab.name === 'fna'"> <div v-if="tab.name === 'fna'">
...@@ -238,7 +255,6 @@ ...@@ -238,7 +255,6 @@
:activeName="activeName" :activeName="activeName"
:formStatus="formStatus" :formStatus="formStatus"
:idsObj="idsObj" :idsObj="idsObj"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
:pageSource="pageSource" :pageSource="pageSource"
/> />
</div> </div>
...@@ -248,7 +264,6 @@ ...@@ -248,7 +264,6 @@
:formStatus="formStatus" :formStatus="formStatus"
:idsObj="idsObj" :idsObj="idsObj"
:apiAppointmentInfoDto="appointmentSummeryInfo.apiAppointmentInfoDto" :apiAppointmentInfoDto="appointmentSummeryInfo.apiAppointmentInfoDto"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="policyTransferRef" ref="policyTransferRef"
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
...@@ -259,7 +274,6 @@ ...@@ -259,7 +274,6 @@
<FileUpload <FileUpload
:activeName="activeName" :activeName="activeName"
:idsObj="idsObj" :idsObj="idsObj"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
:pageSource="pageSource" :pageSource="pageSource"
:showSubmitBtn="showSubmitBtn" :showSubmitBtn="showSubmitBtn"
ref="appointmentAccessoriesRef" ref="appointmentAccessoriesRef"
...@@ -376,17 +390,19 @@ import { ...@@ -376,17 +390,19 @@ import {
getAppointmentDetail, getAppointmentDetail,
storageAppointment, storageAppointment,
editAppointmentDetail, editAppointmentDetail,
uploadExcel uploadExcel,
appointmentEditStorage,
appointmentEditStatus
} from '@/api/sign/appointment' } from '@/api/sign/appointment'
import { getPolicyfollow, getPolicyInfo, signName } from '@/api/sign/underwritingMain' import { getPolicyfollow, getPolicyInfo, signName } from '@/api/sign/underwritingMain'
import { import {
listTenantUser, listTenantUser,
getInsuranceProductList,
getAdditionalProductList, getAdditionalProductList,
getBankList, getBankList,
getUserSaleExpandList, getUserSaleExpandList,
secondAdditonalList, secondAdditonalList,
getAllSignList getAllSignList,
uploadMaterialList
} 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'
...@@ -426,17 +442,19 @@ const idsObj = ref({}) //各个模块的bizId ...@@ -426,17 +442,19 @@ const idsObj = ref({}) //各个模块的bizId
const appointmentSummeryInfo = ref({}) //预约详情总信息 const appointmentSummeryInfo = ref({}) //预约详情总信息
const currentFile = ref(null) const currentFile = ref(null)
const foldInsurantInfo = ref(false) //健康信息中得受保人信息是否隐藏 const foldInsurantInfo = ref(false) //健康信息中得受保人信息是否隐藏
const showCancelApply = ref(false) //是否显示取消申请按钮
const processInfo = ref({ const processInfo = ref({
fnaNo: '暂无', fnaNo: '暂无',
status: '未完成', status: '未完成',
createTime: proxy.parseTime(new Date()), createTime: proxy.parseTime(new Date()),
customerName: userStore.name customerName: userStore.name
}) })
const editStatus = ref(false) //编辑状态 const editStatus = ref(null) //编辑状态
const execlDialog = ref(false) const execlDialog = ref(false)
const isEmbed = ref(false) //是否作为组件插入 const isEmbed = ref(false) //是否作为组件插入
const policyNo = ref('') //新单跟进保单号 const policyNo = ref('') //新单跟进保单号
const currentPolicyholderInfo = ref({}) //存储下投保人信息,受保人模块要用到
const fileTableList = ref([])
const tabsList = ref([ const tabsList = ref([
{ {
label: '签约信息', label: '签约信息',
...@@ -486,43 +504,67 @@ const tabsList = ref([ ...@@ -486,43 +504,67 @@ const tabsList = ref([
status: '0', status: '0',
key: 'questionnaireBizId' key: 'questionnaireBizId'
}, },
{
label: '关联FNA',
name: 'fna',
id: 8,
status: '0',
key: 'fnaBizId'
},
{
label: '转保声明',
name: 'policyTransfer',
id: 9,
status: '0',
key: 'policyTransfer'
},
{
label: '附件', //大提交的时候不用提交了,因为上传文件的时候已经入库了
name: 'accessories',
id: 10,
status: '0',
key: 'fnaBizId'
}
//
// { // {
// label: '关联计划书', //关联计划书暂时先不做 // label: '关联FNA',
// name: 'fna', // name: 'fna',
// id: 10, // id: 8,
// status: '0', // status: '0',
// key: 'fnaBizId' // key: 'fnaBizId'
// }, // },
// { // {
// label: '其他', //先不做 // label: '转保声明',
// name: 'fna', // name: 'policyTransfer',
// id: 11, // id: 9,
// status: '0', // status: '0',
// key: 'fnaBizId' // key: 'policyTransfer'
// }, // },
{
label: '附件', //大提交的时候不用提交了,因为上传文件的时候已经入库了
name: 'accessories',
id: 10,
status: '0',
key: 'fnaBizId'
}
]) ])
const assetVerification = () => {
proxy.$message.warning('此功能等待开放')
}
// 取消操作
const handleCancel = type => {
let obj = {
oprType: type == 'apply' ? 1 : 2, //操作类型 1-取消申请 2-取消预约
appointmentBizId: idsObj.value.appointmentBizId, //预约信息主表唯一业务ID
status: appointmentSummeryInfo.value.status //预约状态
}
proxy.$modal
.confirm(`确认取消${type == 'apply' ? '申请' : '预约'}`)
.then(function () {
return appointmentEditStatus(obj)
})
.then(res => {
if (res.code == 200) {
proxy.$modal.msgSuccess('已成功取消')
getAppointmentInfo(idsObj.value.appointmentBizId)
}
})
.catch(() => {})
}
// 获取默认附件信息
const getFileList = () => {
try {
uploadMaterialList({ objectType: 'appointment' }).then(response => {
fileTableList.value = response.data.map(item => {
return {
materialBizId: item.materialBizId,
fileBizIdList: []
}
})
})
} catch (error) {
fileTableList.value = []
proxy.$message.error('附件列表获取失败')
}
}
// 获取字典数据 // 获取字典数据
const fetchDictData = dictType => { const fetchDictData = dictType => {
let options = [] let options = []
...@@ -538,10 +580,7 @@ const fetchDictData = dictType => { ...@@ -538,10 +580,7 @@ const fetchDictData = dictType => {
return [] return []
} }
} }
// 上传EXECL
const handleAddExecl = () => {
execlDialog.value = true
}
const downloadExcel = () => { const downloadExcel = () => {
// 创建隐藏的下载链接 // 创建隐藏的下载链接
const link = document.createElement('a') const link = document.createElement('a')
...@@ -622,7 +661,16 @@ const execlUpload = () => { ...@@ -622,7 +661,16 @@ const execlUpload = () => {
function getAppointmentInfo(appointmentBizId, changeTab) { function getAppointmentInfo(appointmentBizId, changeTab) {
getAppointmentDetail(appointmentBizId).then(res => { getAppointmentDetail(appointmentBizId).then(res => {
if (res.code == 200) { if (res.code == 200) {
editStatus.value = true
//因为是否第二持有人放在了预约主体里,所以需要单独处理
appointmentSummeryInfo.value = res.data appointmentSummeryInfo.value = res.data
if (
res.data.apiAppointmentInfoDto.isSecond == '0' ||
res.data.apiAppointmentInfoDto.isSecond
) {
appointmentSummeryInfo.value.apiSecondHolderInfoDto.isSecond =
res.data.apiAppointmentInfoDto.isSecond
}
let options = fetchDictData('csf_ap_status') let options = fetchDictData('csf_ap_status')
options.forEach(item => { options.forEach(item => {
if (item.value == appointmentSummeryInfo.value.status) { if (item.value == appointmentSummeryInfo.value.status) {
...@@ -668,15 +716,9 @@ const getDictsData = async () => { ...@@ -668,15 +716,9 @@ const getDictsData = async () => {
const response4 = await signName(params4) const response4 = await signName(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 {
// ...item,
// label: item.productName,
// value: item.additionalProductBizId
// }
return item return item
}) })
dictStore.setSignNameList(response4.data.records) dictStore.setSignNameList(response4.data.records)
console.log('response4', response4.data.records)
} }
return return
} }
...@@ -690,23 +732,7 @@ const getDictsData = async () => { ...@@ -690,23 +732,7 @@ const getDictsData = async () => {
if (response1.code == 200) { if (response1.code == 200) {
dictStore.setTenantUserList(response1.data.records) dictStore.setTenantUserList(response1.data.records)
} }
const params2 = {
loginTenantBizId: userStore.projectInfo.tenantBizId,
pageNo: 1,
pageSize: 10
}
const response2 = await getInsuranceProductList(params2)
if (response2.code == 200) {
response2.data.records = response2.data.records.map(item => {
return {
...item,
label: item.productName,
value: item.productBizId
}
})
dictStore.setInsureProductList(response2.data.records)
}
const params3 = { const params3 = {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
...@@ -838,74 +864,97 @@ const isObject = value => { ...@@ -838,74 +864,97 @@ 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 console.log('====================================')
// } console.log('预约', result)
console.log('====================================')
if (!submitAppointmentObj.value.apiAppointmentInfoDto) return
}
if (productPlanRef.value) {
submitAppointmentObj.value.apiProductPlanInfoDto =
await productPlanRef.value[0].handleSubmitForm()
// if (productPlanRef.value) { if (!submitAppointmentObj.value.apiProductPlanInfoDto) {
// submitAppointmentObj.value.apiProductPlanInfoDto = proxy.$message.error('请完善产品计划信息')
// await productPlanRef.value[0].handleSubmitForm() return
// if (!submitAppointmentObj.value.apiProductPlanInfoDto) return }
// } }
// 获取投保人form // 获取投保人form
// if (policyHolderInfoRef.value) { if (policyHolderInfoRef.value) {
// submitAppointmentObj.value.apiPolicyholderInfoDto = submitAppointmentObj.value.apiPolicyholderInfoDto =
// await policyHolderInfoRef.value[0].handleFormValues('policyHolderInfoRef') await policyHolderInfoRef.value[0].handleFormValues('policyHolderInfoRef')
// if (!submitAppointmentObj.value.apiPolicyholderInfoDto) return if (!submitAppointmentObj.value.apiPolicyholderInfoDto) {
// } proxy.$message.error('请确认投保人信息')
// 获取受保人form return
// if (insuredInfoRef.value) { }
// console.log('insuredInfoRef.value', insuredInfoRef.value) }
// await nextTick() // 👈 加这一行! // 获取受保人form
// const result = await insuredInfoRef.value[0].handleFormValues('insuredInfoRef') if (insuredInfoRef.value) {
// console.log('result', result) submitAppointmentObj.value.apiInsurantInfoDto = await insuredInfoRef.value[0].handleFormValues(
'insuredInfoRef'
)
// if (!result) return console.log('受保人', submitAppointmentObj.value.apiInsurantInfoDto)
// submitAppointmentObj.value.apiInsurantInfoDto = result if (!submitAppointmentObj.value.apiInsurantInfoDto) {
// } proxy.$message.error('请完善受保人信息')
return
}
}
if (beneficiaryInfoRef.value) {
submitAppointmentObj.value.apiBeneficiaryInfoFzDto =
await beneficiaryInfoRef.value[0].handleFormValues()
if (!submitAppointmentObj.value.apiBeneficiaryInfoFzDto) {
proxy.$message.error('请完善受益人信息')
return
} else {
}
}
if (secondHolderInfoRef.value) {
submitAppointmentObj.value.apiSecondHolderInfoDto =
await secondHolderInfoRef.value[0].handleFormValues()
if (!submitAppointmentObj.value.apiSecondHolderInfoDto) {
proxy.$message.error('请完善第二持有人信息')
return
} else {
submitAppointmentObj.value.apiAppointmentInfoDto.isSecond =
submitAppointmentObj.value.apiSecondHolderInfoDto.isSecond
}
}
// if (secondHolderInfoRef.value) { if (questionnairesInfoRef.value) {
// submitAppointmentObj.value.apiSecondHolderInfoDto = submitAppointmentObj.value.apiAnswerSaveRequest =
// await secondHolderInfoRef.value[0].handleFormValues() await questionnairesInfoRef.value[0].handleFormValues()
// if (!submitAppointmentObj.value.apiSecondHolderInfoDto) return if (!submitAppointmentObj.value.apiAnswerSaveRequest) {
// } submitAppointmentObj.value.apiAnswerSaveRequest = null
// if (beneficiaryInfoRef.value) { }
// submitAppointmentObj.value.apiBeneficiaryInfoFzDto = }
// await beneficiaryInfoRef.value[0].handleFormValues() if (appointmentAccessoriesRef.value && !idsObj.value.appointmentBizId) {
// if (!submitAppointmentObj.value.apiBeneficiaryInfoFzDto) return
// }
// if (questionnairesInfoRef.value && questionnairesInfoRef.value[0].questionLength > 0) {
// submitAppointmentObj.value.questionnairesDetailResponse =
// await questionnairesInfoRef.value[0].handleFormValues()
// if (!submitAppointmentObj.value.questionnairesDetailResponse) return
// }
if (appointmentAccessoriesRef.value) {
submitAppointmentObj.value.materialDtoList = submitAppointmentObj.value.materialDtoList =
appointmentAccessoriesRef.value[0].handleFormValues() appointmentAccessoriesRef.value[0].handleFormValues()
if (!submitAppointmentObj.value.materialDtoList) return if (submitAppointmentObj.value.materialDtoList.length == 0) {
submitAppointmentObj.value.materialDtoList = fileTableList.value
}
} }
console.log('大提交', submitAppointmentObj.value) console.log('大提交', submitAppointmentObj.value)
return
// return
// 代表新增预约 // 代表新增预约
if (formStatus.value == 'appointmentAdd' && !idsObj.value.appointmentBizId) { if (formStatus.value == 'appointmentAdd' && !idsObj.value.appointmentBizId) {
submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId = submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId =
props.processDetail.customerBizId props.processDetail.customerBizId
submitAppointmentObj.value.apiAppointmentInfoDto.fnaBizId = props.processDetail.fnaBizId submitAppointmentObj.value.apiAppointmentInfoDto.fnaBizId = props.processDetail.fnaBizId
submitAppointmentObj.value.apiAppointmentInfoDto.fnaNo = props.processDetail.fnaNo submitAppointmentObj.value.apiAppointmentInfoDto.fnaNo = props.processDetail.fnaNo
console.log('大提交', submitAppointmentObj.value)
// return
if (type == 'submit') { if (type == 'submit') {
// 新增预约单 // 新增预约单
addAppointment(submitAppointmentObj.value).then(res => { addAppointment(submitAppointmentObj.value).then(res => {
if (res.code == 200) { if (res.code == 200) {
proxy.$message.success('预约成功') proxy.$message.success('预约成功')
appointmentInfoRef.value[0].handleEditStatus(true) editStatus.value = false
productPlanRef.value[0].handleEditStatus(true)
policyHolderInfoRef.value[0].handleEditStatus(true)
insuredInfoRef.value[0].handleEditStatus(true)
secondHolderInfoRef.value[0].handleEditStatus(true)
beneficiaryInfoRef.value[0].handleEditStatus(true)
emit('handleSuccess', { emit('handleSuccess', {
tab: 'appointment', tab: 'appointment',
type: 'add' type: 'add'
...@@ -914,75 +963,22 @@ const handleSubmit = async type => { ...@@ -914,75 +963,22 @@ const handleSubmit = async type => {
}) })
} }
} }
// 代表修改预约单 // 代表修改预约单 因为编辑暂存也会有预约id
if (idsObj.value.appointmentBizId) { if (idsObj.value.appointmentBizId && type == 'submit') {
if (policyTransferRef.value) { // 已生成行程单的方式预约提交
submitAppointmentObj.value.apiAppointmentInfoDto.policyTransfer = if (route.query.appointmentType == '2') {
policyTransferRef.value[0].form.policyTransfer submitAppointmentObj.value.source = 2
}
if (questionnairesInfoRef.value) {
submitAppointmentObj.value.answerSessionsDtoList =
questionnairesInfoRef.value[0].handleFormValues().answerSessionsDtoList
}
// 与预约聚合详情做对比,如果拿到得个表单数据有为空得就使用聚合详情得数据
for (const key1 in appointmentSummeryInfo.value) {
for (const key2 in submitAppointmentObj.value) {
if (
key1 == key2 &&
isArray(submitAppointmentObj.value[key2]) &&
submitAppointmentObj.value[key2].length == 0
) {
submitAppointmentObj.value[key2] = appointmentSummeryInfo.value[key1]
}
if (
key1 == key2 &&
isObject(submitAppointmentObj.value[key2]) &&
Object.keys(submitAppointmentObj.value[key2]).length == 0
) {
submitAppointmentObj.value[key2] = appointmentSummeryInfo.value[key1]
}
if (
key2 == 'apiPolicyholderInfoDto' &&
Object.keys(submitAppointmentObj.value[key2]).length !== 0
) {
submitAppointmentObj.value[key2]['appointmentBizId'] =
appointmentSummeryInfo.value.apiPolicyholderInfoDto.appointmentBizId
submitAppointmentObj.value[key2]['id'] =
appointmentSummeryInfo.value.apiPolicyholderInfoDto.id
submitAppointmentObj.value[key2]['policyholderBizId'] =
appointmentSummeryInfo.value.apiPolicyholderInfoDto.policyholderBizId
}
if (
key2 == 'apiInsurantInfoDto' &&
Object.keys(submitAppointmentObj.value[key2]).length !== 0
) {
submitAppointmentObj.value[key2]['appointmentBizId'] =
appointmentSummeryInfo.value.apiInsurantInfoDto.appointmentBizId
submitAppointmentObj.value[key2]['id'] =
appointmentSummeryInfo.value.apiInsurantInfoDto.id
submitAppointmentObj.value[key2]['insurantBizId'] =
appointmentSummeryInfo.value.apiInsurantInfoDto.insurantBizId
}
}
} }
// 编辑预约单 // 编辑预约单
editAppointmentDetail(submitAppointmentObj.value).then(res => { editAppointmentDetail(submitAppointmentObj.value).then(res => {
if (res.code == 200) { if (res.code == 200) {
appointmentInfoRef.value[0].handleEditStatus(true) editStatus.value = true
productPlanRef.value[0].handleEditStatus(true) getAppointmentInfo(idsObj.value.appointmentBizId)
policyHolderInfoRef.value[0].handleEditStatus(true)
insuredInfoRef.value[0].handleEditStatus(true)
secondHolderInfoRef.value[0].handleEditStatus(true)
beneficiaryInfoRef.value[0].handleEditStatus(true)
policyTransferRef.value[0].handleEditStatus(true)
questionnairesInfoRef.value[0].handleEditStatus(true)
proxy.$message.success('修改预约单成功') proxy.$message.success('修改预约单成功')
} }
}) })
getAppointmentInfo(idsObj.value.appointmentBizId)
} }
// 预约暂存 // 新增预约暂存
if (type == 'storage') { if (type == 'storage') {
submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId = submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId =
props.processDetail.customerBizId props.processDetail.customerBizId
...@@ -996,6 +992,21 @@ const handleSubmit = async type => { ...@@ -996,6 +992,21 @@ const handleSubmit = async type => {
} }
}) })
} }
// 编辑状态下预约暂存
if (type == 'editStorage') {
// submitAppointmentObj.value.apiAppointmentInfoDto.customerBizId =
// props.processDetail.customerBizId
// submitAppointmentObj.value.apiAppointmentInfoDto.fnaBizId = props.processDetail.fnaBizId
// submitAppointmentObj.value.apiAppointmentInfoDto.fnaNo = props.processDetail.fnaNo
// 暂存预约单
appointmentEditStorage(submitAppointmentObj.value).then(res => {
if (res.code == 200) {
proxy.$message.success('预约暂存提交成功')
editStatus.value = true
getAppointmentInfo(idsObj.value.appointmentBizId)
}
})
}
} }
const handleEdit = () => { const handleEdit = () => {
editStatus.value = !editStatus.value editStatus.value = !editStatus.value
...@@ -1005,8 +1016,10 @@ if (route.query.appointmentNo && route.query.source == 'appointmentList') { ...@@ -1005,8 +1016,10 @@ if (route.query.appointmentNo && route.query.source == 'appointmentList') {
processInfo.value = route.query processInfo.value = route.query
idsObj.value.appointmentBizId = route.query.appointmentBizId idsObj.value.appointmentBizId = route.query.appointmentBizId
getDictsData() getDictsData()
// 请求预约单聚合详情 setTimeout(() => {
getAppointmentInfo(idsObj.value.appointmentBizId, true) // 请求预约单聚合详情
getAppointmentInfo(idsObj.value.appointmentBizId, true)
}, 500)
} }
const pageSource = computed(() => { const pageSource = computed(() => {
return props.source || route.query.source return props.source || route.query.source
...@@ -1026,7 +1039,7 @@ const minHight = computed(() => { ...@@ -1026,7 +1039,7 @@ const minHight = computed(() => {
} else if (pageSource.value == 'policyList') { } else if (pageSource.value == 'policyList') {
return 'calc(100vh - 84.5px)' return 'calc(100vh - 84.5px)'
} else { } else {
return 'calc(100vh - 325px)' return 'calc(100vh - 400px)'
} }
}) })
...@@ -1105,11 +1118,14 @@ watch( ...@@ -1105,11 +1118,14 @@ watch(
key: 'fnaBizId' key: 'fnaBizId'
} }
] ]
nextTick(() => { nextTick(() => {
activeName.value = 'appointmentInfo' activeName.value = 'appointmentInfo'
}) })
} else { } else {
// getAppointmentInfo(idsObj.value.appointmentBizId) activeName.value = ''
getAppointmentInfo(idsObj.value.appointmentBizId)
tabsList.value = [ tabsList.value = [
{ {
label: '签约信息', label: '签约信息',
...@@ -1159,20 +1175,20 @@ watch( ...@@ -1159,20 +1175,20 @@ watch(
status: '0', status: '0',
key: 'questionnaireBizId' key: 'questionnaireBizId'
}, },
{ // {
label: '关联FNA', // label: '关联FNA',
name: 'fna', // name: 'fna',
id: 8, // id: 8,
status: '0', // status: '0',
key: 'fnaBizId' // key: 'fnaBizId'
}, // },
{ // {
label: '转保声明', // label: '转保声明',
name: 'policyTransfer', // name: 'policyTransfer',
id: 9, // id: 9,
status: '0', // status: '0',
key: 'policyTransfer' // key: 'policyTransfer'
}, // },
{ {
label: '附件', //大提交的时候不用提交了,因为上传文件的时候已经入库了 label: '附件', //大提交的时候不用提交了,因为上传文件的时候已经入库了
name: 'accessories', name: 'accessories',
...@@ -1182,7 +1198,6 @@ watch( ...@@ -1182,7 +1198,6 @@ watch(
} }
] ]
} }
nextTick(() => { nextTick(() => {
activeName.value = 'appointmentInfo' activeName.value = 'appointmentInfo'
}) })
...@@ -1275,12 +1290,7 @@ if (route.query.source == 'policyList') { ...@@ -1275,12 +1290,7 @@ if (route.query.source == 'policyList') {
id: 6, id: 6,
key: 'verifyPolicyInfo' key: 'verifyPolicyInfo'
}, },
// {
// label: '新单事项',
// name: 'newpolicyTodo',
// id: 7,
// key: 'newpolicyTodo'
// },
{ {
label: '产品计划', label: '产品计划',
name: 'productPlan', name: 'productPlan',
...@@ -1323,13 +1333,7 @@ if (route.query.source == 'policyList') { ...@@ -1323,13 +1333,7 @@ if (route.query.source == 'policyList') {
status: '0', status: '0',
key: 'questionnaireBizId' key: 'questionnaireBizId'
}, },
// {
// label: '关联FNA',
// name: 'fna',
// id: 14,
// status: '0',
// key: 'fnaBizId'
// },
{ {
label: '转保声明', label: '转保声明',
name: 'policyTransfer', name: 'policyTransfer',
...@@ -1361,17 +1365,20 @@ const showSubmitBtn = computed(() => { ...@@ -1361,17 +1365,20 @@ const showSubmitBtn = computed(() => {
return false return false
} }
}) })
//刚进页面的编辑状态 //刚进页面的编辑状态,根据不同页面来源做处理
if (route.query.appointmentNo && route.query.source == 'appointmentList') { if (route.query.appointmentNo && route.query.source == 'appointmentList') {
editStatus.value = true editStatus.value = true
console.log('route.query', route.query)
} else if (route.query.source == 'policyList') { } else if (route.query.source == 'policyList') {
editStatus.value = true editStatus.value = true
} else if (route.query.source == 'fnaList' && idsObj.value.appointmentBizId) { } else if (route.query.source == 'fnaList' && route.query.appointmentBizId) {
idsObj.value.appointmentBizId = route.query.appointmentBizId
getAppointmentInfo(route.query.appointmentBizId)
editStatus.value = true editStatus.value = true
} else if (route.query.source == 'fnaList' && !idsObj.value.appointmentBizId) { } else if (route.query.source == 'fnaList' && !route.query.appointmentBizId) {
editStatus.value = false editStatus.value = false
} }
getFileList()
onUnmounted(() => { onUnmounted(() => {
// 彻底重置所有响应式数据 // 彻底重置所有响应式数据
submitAppointmentObj.value = {} submitAppointmentObj.value = {}
...@@ -1393,9 +1400,6 @@ onUnmounted(() => { ...@@ -1393,9 +1400,6 @@ onUnmounted(() => {
beneficiaryInfoRef.value = null beneficiaryInfoRef.value = null
policyTransferRef.value = null policyTransferRef.value = null
questionnairesInfoRef.value = null questionnairesInfoRef.value = null
// 清理事件监听器(如果有的话)
// window.removeEventListener('resize', yourHandler)
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -1407,7 +1411,7 @@ onUnmounted(() => { ...@@ -1407,7 +1411,7 @@ onUnmounted(() => {
background-color: #fff !important; background-color: #fff !important;
} }
.noembed-container { .noembed-container {
padding: 20px; padding: 10px 20px;
background-color: #f2f3f5; background-color: #f2f3f5;
/* min-height: calc(100vh - 84.5px); */ /* min-height: calc(100vh - 84.5px); */
} }
...@@ -1464,6 +1468,10 @@ onUnmounted(() => { ...@@ -1464,6 +1468,10 @@ onUnmounted(() => {
} }
} }
} }
.right {
display: flex;
align-items: center;
}
} }
.tabsBox { .tabsBox {
.topButtonBox { .topButtonBox {
...@@ -1500,6 +1508,7 @@ onUnmounted(() => { ...@@ -1500,6 +1508,7 @@ onUnmounted(() => {
.appointmentTabPaneBox { .appointmentTabPaneBox {
overflow-y: auto; overflow-y: auto;
padding-right: 10px; padding-right: 10px;
position: relative;
} }
.overviewBox { .overviewBox {
......
<template>
<div v-if="processedAppointmentData.length > 0">
<div>
<CommonForm
:showAnchor="false"
:anchorList="anchorList"
:affixOffset="affixOffset"
:anchorOffset="10"
:scrollContainerSelector="anchorContainer"
>
<template #form-right>
<el-form ref="appointmentInfoFormRef" :model="form" label-width="120px">
<div v-for="father in processedAppointmentData">
<el-row style="margin-bottom: 10px" v-if="father.showMoudle" :id="father.anchorKey">
<div class="formBox">
<CardOne :title="father.fatherTitle">
<!-- <template #mainTitCustom v-if="props.idsObj.appointmentBizId">
<div style="margin-left: 10px">
<el-button
@click="viewHistory"
type="primary"
link
v-if="father.key == 'administration'"
>历史记录</el-button
>
</div>
</template> -->
<!-- <template #headerRight v-if="father.key == 'administration'">
<div>
<el-button
v-if="idsObj.appointmentBizId"
@click="handleExprot"
type="primary"
link
>导出预约表</el-button
>
<el-button
v-if="appointmentStatus >= 2"
@click="getItineraryInfo"
type="primary"
link
>行程单预览</el-button
>
</div>
</template> -->
<template #content>
<!-- 不是表格 -->
<el-row :gutter="20" v-if="!father.showTable">
<template v-for="child in father.data" :key="child.key">
<el-col
:sm="child.sm"
:lg="child.lg"
class="formItemBox"
v-if="child.show"
>
<div>
<el-form-item
:label-width="child.labelWidth"
:label="child.label"
:prop="child.key"
:key="child.key"
:label-position="child.labelPosition"
class="button-form-item"
>
<el-input
v-if="child.domType === 'Input'"
:type="child.inputType"
v-model="form[child.key]"
:placeholder="child.placeholder"
maxlength="30"
:rows="child.rows"
:disabled="editStatus"
/>
<el-select
v-if="child.domType === 'Select'"
v-model="form[child.key]"
:placeholder="child.placeholder"
@change="handleSelectChange(father, child)"
:disabled="editStatus"
>
<el-option
v-for="item in child.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- 带时分的时间框 -->
<div
v-if="child.domType === 'datetimePicker'"
class="compositionDateTime"
>
<el-date-picker
type="date"
placeholder="选择日期"
style="width: 100%"
v-model="form[child.key]"
:disabled="editStatus"
@change="handleDateChange(child)"
:disabled-date="time => disabledDate(time, child)"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@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"
@change="timeValueChange(child)"
/>
</div>
<!-- 不带时分 -->
<el-date-picker
style="width: 100%"
v-if="child.domType === 'DatePicker'"
v-model="form[child.key]"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:placeholder="child.placeholder"
:disabled="editStatus"
:disabled-date="time => disabledDate(time, child)"
@change="handleDateChange(child)"
@clear="handleDateClear(child)"
/>
<el-input
v-if="child.domType === 'arrowRight'"
v-model="form[child.key]"
:placeholder="child.placeholder"
:suffix-icon="ArrowRight"
readonly
:disabled="editStatus"
@focus="handleFoucs(child)"
>
</el-input>
<el-select
v-model="form[child.key]"
v-if="child.domType === 'SearchSelect'"
filterable
:allow-create="child.allowCreate"
reserve-keyword
@change="handleSelectChange(father, child)"
:remote-method="query => searchSelectList(query, child.key)"
placeholder="请输入关键词搜索"
:loading="searchLoadingStates[child.key]"
:disabled="editStatus"
>
<el-option
v-for="item in searchOptions[child.key] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<div v-if="child.domType === 'Div'" class="divClass">
<div v-if="child.key == 'information'" class="desBox">
<div class="title">{{ child.title }}</div>
<div class="informationBox">
<div
v-for="(item, index) in child.informationList"
:key="index"
>
{{ item.name }}
</div>
</div>
</div>
</div>
</div>
</el-col>
</template>
</el-row>
<!-- 是表格数据 -->
<el-row v-if="father.showTable">
<el-col :span="24" v-if="father.addChildren">
<el-button
:disabled="editStatus"
type="primary"
icon="Plus"
size="small"
style="margin-bottom: 10px"
@click="addChildren(father)"
>{{ father.addChildrenTxt }}</el-button
>
</el-col>
<el-table :data="father.data" border v-if="father.data.length > 0">
<template v-if="father.key == 'referrerDtoList'">
<el-table-column label="姓名" prop="realName" align="center">
<template #header>
<span class="required-label">姓名</span>
</template>
<template #default="scope">
<el-select
v-model="scope.row.realName"
filterable
remote
reserve-keyword
placeholder="请输入关键词搜索"
:remote-method="query => searchSelectList(query, 'realName')"
:loading="searchLoadingStates['realName']"
:disabled="editStatus"
@change="handleTableSelectChange(father, scope.row, 'realName')"
>
<el-option
v-for="item in searchOptions['realName'] || []"
: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="email" align="center">
<template #header>
<span class="required-label">邮箱</span>
</template>
<template #default="scope">
<el-input
v-model="scope.row.email"
size="default"
placeholder="请输入"
:disabled="editStatus"
/>
</template>
</el-table-column>
<el-table-column width="60px" align="center" label="操作">
<template #default="scope">
<el-icon
class="deleteIcon"
@click="deleteChildren(father, scope.$index)"
><Delete
/></el-icon>
</template>
</el-table-column>
</template>
<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"
@change="handleTableSelectChange(father, scope.row, 'name')"
>
<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-row>
</template>
</CardOne>
</div>
</el-row>
</div>
</el-form>
</template>
</CommonForm>
</div>
<Phone
@close="handleCloseDrawer"
:showDrawer="showPhoneDrawer"
:drawerInfo="drawerInfo"
:phoneMenuList="phoneMenuList"
:phoneQuickList="phoneQuickList"
@confirmDrawer="confirmDrawer"
/>
<Address
@close="handleCloseDrawer"
:showAddressDrawer="showAddressDrawer"
:drawerInfo="drawerInfo"
:addressMenuList="addressMenuList"
:addressQuickList="addressQuickList"
@confirmDrawer="confirmDrawer"
/>
<Country
:showCountryDrawer="showCountryDrawer"
@close="handleCloseDrawer"
@confirmCountry="confirmDrawer"
/>
</div>
</template>
<script setup name="appointmentInfo">
import CommonPage from '@/components/commonPage'
import dayjs from 'dayjs'
import { ArrowRight } from '@element-plus/icons-vue'
import appointmentDomData from '@/formJson/appointmentInfo'
import Country from '@/views/components/country'
import Phone from '@/views/components/phone'
import Address from '@/views/components/address'
import DetailPanel from '@/components/DetailPanel'
import { watch, nextTick } from 'vue'
import {
getAppointmentlog,
getAppointmentlogDetail,
getItineraryExprot,
getItineraryDetail,
getAppointmentExprot
} from '@/api/sign/appointment'
import { getBankList, getAllSignList, getUserSaleExpandList } from '@/api/common'
import CommonForm from '@/views/components/commonForm'
import CommonDialog from '@/components/commonDialog'
import CardOne from '@/components/formCard/cardOne'
import useDictStore from '@/store/modules/dict'
const dictStore = useDictStore() //获取字典数据
const props = defineProps({
activeName: { type: String, default: '' }, //tab名称
formStatus: { type: String, default: '' }, //父组件状态,新增、修改
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
detailInfo: { type: Object, default: () => ({}) }, //父组件传递过来的签约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约状态
customerBizId: { type: String, default: '' }, //提交状态,新增、修改
fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: true }, //编辑状态
affixOffset: { type: Number, default: 360 } //tab索引
})
const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance()
const appointmentRef = ref(null)
const showPhoneDrawer = ref(false) //电话抽屉开关
const showAddressDrawer = ref(false) //地址抽屉开关
const showCountryDrawer = ref(false) //国家/地区抽屉开关
const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输入值
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const errorFields = ref([]) // 存储校验失败的字段信息
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const consultKey = ref({})
const openAccountKey = ref({})
const openList = ref(false) //历史签约记录弹窗开关
const showDetail = ref(false) //签约详情弹窗开关
const detailTitle = ref('') //签约详情弹窗title
const detailInfo = ref({}) //签约详情信息
const tableData = ref([])
const tableLoading = ref([])
const itineraryData = ref([]) //行程单数据
const appointmentSummeryInfo = ref({}) //行程单数据
const exportLoading = ref(false) //下载行程单loading
const showItinerary = ref(false) //下载行程单loading
// 地址组件菜单数据
const addressMenuList = ref([
{
name: '国家/地区',
icon: false,
value: '',
placeholder: '请输入国家/地区',
key: 'region'
},
{
name: '省市',
icon: false,
value: '',
placeholder: '请输入省市',
key: 'city'
},
{
name: '街道',
icon: false,
value: '',
placeholder: '请输入街道',
key: 'street'
},
{
name: '详细地址',
icon: false,
value: '',
placeholder: '请输入详细地址',
key: 'location'
}
])
// 快捷地址的数据
const addressQuickList = ref([])
const phoneMenuList = ref([
{
name: '区号',
icon: true,
value: '',
placeholder: '请输入区号',
arrow: true,
type: 'string'
},
{
name: '电话号码',
icon: false,
value: '',
placeholder: '请输入电话号码',
type: 'number'
}
])
const phoneQuickList = ref([])
const deleteKeyList = ref([
'objType',
'mailingAddress',
'residentialAddress',
'residenceAddress',
'companyAddress'
]) // 存储需要删除的key
const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const total = ref(0)
const data = reactive({
form: {},
processedAppointmentData: [], // 处理后的表单数据
oldAppointmentData: [], // 保存旧的表单Dom,便于撤销操作
rules: {}, //表单验证规则,
queryParams: {
pageNo: 1,
pageSize: 10
}
})
const { form, rules, processedAppointmentData, queryParams, oldAppointmentData } = toRefs(data)
// 获取预约行程单详情
function getItineraryInfo() {
getItineraryDetail(props.idsObj.appointmentBizId).then(res => {
if (res.code == 200) {
appointmentSummeryInfo.value = res.data
fetchDictData('csf_ap_meeting_point').forEach(item => {
if (item.value == appointmentSummeryInfo.value.meetingPoint) {
appointmentSummeryInfo.value.meetingPoint = item.label
}
})
if (appointmentSummeryInfo.value.total) {
appointmentSummeryInfo.value.total = Number(appointmentSummeryInfo.value.total).toFixed(2)
}
itineraryData.value = [
{
title: '集合信息',
data: [
// 第一行:2列布局(各占12)
{
label: '集合时间',
value: appointmentSummeryInfo.value.arrivalTime,
span: 12 // 占12/24
},
{
label: '集合地点',
value: appointmentSummeryInfo.value.meetingPoint,
span: 12 // 占12/24
},
{
label: '意向地点',
value: appointmentSummeryInfo.value.signingAddress,
span: 12 // 占12/24
}
]
},
{
title: '业务代表',
data: [
// 第一行:2列布局(各占12)
{
label: '业务代表',
value: appointmentSummeryInfo.value.businessRepresentName1,
span: 12 // 占12/24
},
{
label: '联系电话',
value: appointmentSummeryInfo.value.businessRepresentMobile1
? appointmentSummeryInfo.value.businessRepresentMobile1Code +
appointmentSummeryInfo.value.businessRepresentMobile1
: '-',
span: 12 // 占12/24
}
]
},
{
title: '咨询内容',
data: [
// 第一行:2列布局(各占12)
{
label: '咨询人',
value: appointmentSummeryInfo.value.name,
span: 12 // 占12/24
},
{
label: '意向缴费年期',
value: appointmentSummeryInfo.value.paymentTerm,
span: 12 // 占12/24
},
{
label: '保单征费',
value: appointmentSummeryInfo.value.policyFee || '-',
span: 12 // 占12/24
},
{
label: '首期保费',
value: appointmentSummeryInfo.value.eachIssuePremium || '-',
span: 12 // 占12/24
},
{
label: '币种',
value: appointmentSummeryInfo.value.currency,
span: 12 // 占12/24
},
{
label: '意向咨询产品',
value: appointmentSummeryInfo.value.productName,
span: 12 // 占12/24
},
{
label: '首期合计金额',
value: appointmentSummeryInfo.value.total,
span: 12 // 占12/24
}
]
}
]
showItinerary.value = true
}
})
}
// 导出行程单Pdf
const handleExprotPdf = () => {
exportLoading.value = true
getItineraryExprot(appointmentSummeryInfo.value.appointmentBizId).then(res => {
if (res.code == 200) {
// 创建隐藏的下载链接
const link = document.createElement('a')
link.href = res.data
link.target = '_blank' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = `香港行程安排.pdf`
link.download = fileName
// 触发下载
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
exportLoading.value = false
showItinerary.value = false
} else {
proxy.$message.error('行程单下载失败')
exportLoading.value = false
}
})
}
//导出预约表
const handleExprot = async row => {
try {
const res = await getAppointmentExprot(props.idsObj.appointmentBizId)
if (res.code == 200) {
// 创建隐藏的下载链接
const link = document.createElement('a')
link.href = res.data.url
// link.target = '_blank' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = '预约导出.xlsx'
link.download = fileName
// 触发下载
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
proxy.$message.success('导出成功')
}
} catch (error) {
console.error('导出失败:', error)
}
}
const changePageNo = val => {
queryParams.value.pageNo = val
// getList()
}
const changePageSize = val => {
queryParams.value.pageSize = val
// getList()
}
const timeValueChange = child => {
if (form.value[child.key]) {
child.finishTime = `${form.value[child.key]} ${child.timeValue}:00`
} else if (!form.value[child.key]) {
proxy.$message.warning(`请先选择${child.label}日期`)
child.timeValue = ''
}
}
// 签约详情
const viewDetail = row => {
try {
getAppointmentlogDetail(row.appointmentLogBizId).then(response => {
detailInfo.value = response.data
detailTitle.value = `${row.creatorName}签约详情`
showDetail.value = true
})
} catch (error) {
detailTitle.value = ''
detailInfo.value = {}
showDetail.value = false
}
}
// 签约历史记录
const viewHistory = () => {
try {
getAppointmentlog(queryParams.value).then(response => {
tableData.value = response.data.records
total.value = response.data.total
tableLoading.value = false
openList.value = true
})
} catch (error) {
tableData.value = []
} finally {
tableLoading.value = false
}
}
const handleTableSelectChange = (father, row, key) => {
searchOptions.value[key].forEach(item => {
if (row[key] == item.value) {
row[key] = item.label
row.userBizId = item.userBizId
if (key == 'name') {
row.userSignBizId = item.value
} else if (key == 'realName') {
row.userSaleBizId = item.value
}
}
})
}
// 添加表单子级dom
const addChildren = father => {
const processedData = JSON.parse(JSON.stringify(processedAppointmentData.value))
let obj4 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
email: '',
phone: '',
realName: ''
}
let obj5 = {
id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
name: '', //姓名
practiceCode: '', //执业编码
phone: '', //手机号
cardType: '', //证件类型
cardNo: '', //证件号码
email: '' //邮箱
}
for (const section of processedData) {
if (father.key == 'referrerDtoList' && section.key == father.key) {
section.data.push(obj4)
}
if (father.key == 'userSignDtoList' && section.key == father.key) {
section.data.push(obj5)
}
}
//更新form表单对应的数据,以便收集填写的值
// form.value[father.key].push(obj)
processedAppointmentData.value = processedData
}
const deleteChildren = (father, childIndex) => {
if (props.editStatus) {
proxy.$modal.confirm(`请先点击编辑再进行删除操作`, { showCancel: '0', title: '填写提示' })
return
}
const processedData = JSON.parse(JSON.stringify(processedAppointmentData.value))
for (const section of processedData) {
if (father.key == 'referrerDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
if (father.key == 'userSignDtoList' && section.key == father.key) {
section.data.splice(childIndex, 1)
}
}
processedAppointmentData.value = processedData
}
// 搜索方法
const searchSelectList = async (query, key) => {
// 设置该字段的加载状态
searchLoadingStates.value[key] = true
let queryString = query.trim()
try {
// 根据不同的字段key调用不同的API
if (key === 'bankName') {
const params4 = {
pageNo: 1,
pageSize: 10,
queryContent: queryString
}
const response4 = await getBankList(params4)
if (response4.code == 200) {
response4.data.records = response4.data.records.map(item => {
return {
...item,
label: item.bankName,
value: item.bankBizId
}
})
searchOptions.value[key] = response4.data.records
}
} else if (key == 'realName') {
const params5 = {
pageNo: 1,
pageSize: 10,
queryContent: queryString
}
const response5 = await getUserSaleExpandList(params5)
if (response5.code == 200) {
response5.data.records = response5.data.records.map(item => {
return {
...item,
label: item.realName,
value: item.userSaleBizId
}
})
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) {
console.error(` 搜索失败`, error)
searchOptions.value[key] = []
} finally {
searchLoadingStates.value[key] = false
}
}
const disabledDate = (time, child) => {
// 获取“今天”的日期,并将其时间部分设置为 00:00:00
const today = dayjs().startOf('day') // :cite[7]
// 将传入的 timestamp 转换为 dayjs 对象
const inputDate = dayjs(time)
switch (child.key) {
case 'signDate':
// 默认禁用今天及今天之前
return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day')
break
case 'confirmAppointmentTime':
return inputDate.isBefore(today, 'day')
break
case 'openAccountStartTime':
return time.getTime() > Date.now()
break
case 'openAccountEndTime':
// 获取开始日期(需要从表单数据中获取)
const startTime = form.value.openAccountStartTime
if (startTime) {
const startDate = dayjs(startTime).startOf('day')
// 禁用开始日期之前的所有日期(包括开始日期当天)
return inputDate.isBefore(startDate, 'day') || inputDate.isSame(startDate, 'day')
} else {
// 如果没有选择开始日期,禁用今天之前的日期
return inputDate.isBefore(today, 'day')
}
break
default:
// return time.getTime() > Date.now()
break
}
}
const handleDateClear = child => {
if (child.key == 'openAccountStartTime' && !form.value['openAccountStartTime']) {
form.value['openAccountEndTime'] = ''
resetShow({ type: 'child', key: 'openAccountEndTime', status: true, flag: 'disabled' })
return
}
if (child.key == 'arrivalTime' && !form.value['arrivalTime']) {
form.value['departureTime'] = ''
resetShow({ type: 'child', key: 'departureTime', status: true, flag: 'disabled' })
return
}
}
const handleDateChange = child => {
if (child.key == 'openAccountStartTime' && form.value['openAccountStartTime']) {
resetShow({ type: 'child', key: 'openAccountEndTime', status: false, flag: 'disabled' })
disabledDate(form.value['openAccountStartTime'], { key: 'openAccountEndTime' })
}
// 拼接日期与时分
if (child.key == 'arrivalTime' && child.finishTime && child.finishTime.split(' ').length == 2) {
child.finishTime = `${form.value[child.key]} ${child.timeValue}:00`
} else if (
child.key == 'departureTime' &&
child.finishTime &&
child.finishTime.split(' ').length == 2
) {
child.finishTime = `${form.value[child.key]} ${child.timeValue}:00`
}
// 离港时间在到港时间之前
if (
child.key == 'arrivalTime' &&
form.value['departureTime'] &&
!dayjs(form.value['arrivalTime']).isBefore(dayjs(form.value['departureTime']))
) {
proxy.$message.error('到港时间应在离港时间之前!!')
}
if (
child.key == 'departureTime' &&
form.value['arrivalTime'] &&
dayjs(form.value['departureTime']).isBefore(dayjs(form.value['arrivalTime']))
) {
proxy.$message.error('离港时间应在到港时间之后!!')
}
if (child.key === 'confirmAppointmentTime' && !form.value[child.key]) {
resetShow({ type: 'child', key: 'newPolicyButton', status: false, flag: 'show' })
} else if (child.key === 'confirmAppointmentTime' && form.value[child.key]) {
resetShow({ type: 'child', key: 'newPolicyButton', status: true, flag: 'show' })
}
}
// 获取字典数据
const fetchDictData = dictType => {
let options = []
try {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == dictType) {
// options = item.dictItemList
if (dictType == 'sys_no_yes') {
item.dictItemList.forEach(item1 => {
item1.value = Number(item1.value)
})
}
options = item.dictItemList
}
})
return options
} catch (error) {
console.error('获取字典数据失败:', error)
return []
}
}
// 添加英文校验函数
const validateEnglish = (rule, value, callback) => {
if (value && !/^[A-Za-z]*$/.test(value)) {
// 清空非英文字符
form.value.firstNamePinyin = ''
callback(new Error('只能输入英文字母'))
} else {
callback()
}
}
// 处理表单配置,添加字典数据
const processFormData = async () => {
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(appointmentDomData))
for (const section of processedData) {
if (section.keyType == 'Array') {
//给表格类型里的下拉框options赋值,否则提交的时候会报错
searchOptions.value['realName'] = dictStore.userSaleExpandList
searchOptions.value['name'] = dictStore.userSaleExpandList
}
if (section.data) {
for (const field of section.data) {
if (section.key == 'openAccount') {
openAccountKey.value[field.key] = field.key
}
if (section.key == 'consult') {
consultKey.value[field.key] = field.key
}
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
}
if (field.key == 'bankName') {
searchOptions.value[field.key] = dictStore.bankList
}
if (field.required) {
if (field.key === 'firstNamePinyin') {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' },
{ validator: validateEnglish, trigger: 'change' }
]
} else {
rules.value[field.key] = [
{ required: true, message: `${field.label}不能为空`, trigger: 'blur' }
]
}
}
}
}
}
console.log('searchOptions.value', searchOptions.value)
setFormValue(props.detailInfo, processedData)
// if (props.idsObj.appointmentBizId) {
// setFormValue(props.apiAppointmentInfoDto, processedData)
// return
// } else if (showDetail.value) {
// // 回显历史签约详情
// setFormValue(detailData.value, processedData)
// return
// } else {
// // 新增给默认值
// form.value['isReferrerAccompany'] = form.value['isOpenAccount'] = form.value['isUseCar'] = 0
// processedAppointmentData.value = processedData
// }
}
//弹出右侧抽屉
const handleFoucs = child => {
if (child.disabled) return
console.log('saveKey.value', saveKey.value)
drawerInfo.value = JSON.parse(JSON.stringify(child))
switch (child.drawerType) {
case 'phone':
phoneMenuList.value[0].key = child.code
phoneMenuList.value[1].key = child.key
phoneMenuList.value.forEach(item => {
for (const key in saveKey.value) {
if (key == child.key) {
for (const key2 in saveKey.value[key]) {
if (item.key == key2) {
item.value = saveKey.value[key][key2]
}
}
}
}
})
showPhoneDrawer.value = true
break
case 'address':
addressMenuList.value.forEach(item => {
item.value = ''
for (const key in saveKey.value) {
if (key == child.key) {
for (const key2 in saveKey.value[key]) {
if (item.key == key2) {
item.value = saveKey.value[key][key2]
}
}
}
}
})
showAddressDrawer.value = true
break
case 'country':
showCountryDrawer.value = true
break
default:
break
}
}
// 处理抽屉关闭
const handleCloseDrawer = () => {
showPhoneDrawer.value = false
showAddressDrawer.value = false
showCountryDrawer.value = false
drawerInfo.value = {}
}
const confirmDrawer = info => {
// info 为抽屉返回的值
if (drawerInfo.value.domType == 'arrowRight' && drawerInfo.value.drawerType) {
let newObj = info[drawerInfo.value.key]
//要判断drawerType
switch (drawerInfo.value.drawerType) {
case 'phone':
newObj.objType = drawerInfo.value.drawerType
// 因为电话有多个,根据点击的电话类型在抽屉里回显,所以要用drawerInfo.value.code来控制
newObj.key = drawerInfo.value.key
form.value[info.key] = newObj.phoneString = `${newObj[drawerInfo.value.code]} ${
newObj[drawerInfo.value.key]
}`
saveKey.value[drawerInfo.value.key] = newObj
// 检查数组中是否已存在key的电话
const existingIndex = phoneQuickList.value.findIndex(item => item.key === newObj.key)
if (existingIndex !== -1) {
// 更新已存在的电话
phoneQuickList.value[existingIndex] = {
code: newObj[drawerInfo.value.code],
mobile: newObj[drawerInfo.value.key],
key: drawerInfo.value.key,
phoneString: newObj.phoneString
}
} else {
// 添加新的快捷电话
phoneQuickList.value.push({
code: newObj[drawerInfo.value.code],
mobile: newObj[drawerInfo.value.key],
key: drawerInfo.value.key,
phoneString: newObj.phoneString
})
}
phoneQuickList.value = removeDuplicates(phoneQuickList.value, 'phoneString')
break
case 'address':
newObj.objType = drawerInfo.value.drawerType
newObj.type = drawerInfo.value.key
form.value[info.key] = `${newObj.region} ${newObj.city} ${newObj.street} ${newObj.location}`
saveKey.value[info.key] = newObj
break
case 'country':
info.objType = drawerInfo.value.drawerType
form.value[drawerInfo.value.key] = info.name
saveKey.value[drawerInfo.value.key] = info
break
default:
break
}
}
handleCloseDrawer()
}
// 根据联动重置表单项的显示与否 是否禁用
const resetShow = obj => {
for (const section of processedAppointmentData.value) {
if (obj.type == 'father' && section.key == obj.key) {
section.showMoudle = obj.status
// if (!obj.status) {
// if (section.data) {
// for (const field of section.data) {
// form.value[field.key] = ''
// }
// }
// }
} else if (obj.type == 'child') {
if (section.data) {
for (const field of section.data) {
if (field.key == obj.key && obj.flag == 'show') {
// 获取字典数据
field.show = obj.status
} else if (field.key == obj.key && obj.flag == 'disabled') {
field.disabled = obj.status
}
}
}
}
}
}
const handleSelectChange = (father, child) => {
switch (child.key) {
case 'isReferrerAccompany':
// 选择吸烟,展示吸烟数量
if (form.value[child.key] == '1') {
resetShow({ type: 'father', key: 'referrerDtoList', status: true })
} else {
resetShow({ type: 'father', key: 'referrerDtoList', status: false })
}
break
case 'isOpenAccount':
// 根据是否开户,展示开户信息
if (form.value[child.key] == '1') {
resetShow({ type: 'father', key: 'openAccount', status: true })
} else {
resetShow({ type: 'father', key: 'openAccount', status: false })
}
break
case 'bankName':
if (form.value[child.key]) {
searchOptions.value[child.key].forEach(item => {
if (item.value == form.value[child.key]) {
form.value[child.key] = item.label
form.value['bankId'] = item.value
}
})
if (
searchOptions.value[child.key].findIndex(item => item.value == form.value['bankId']) !==
-1
) {
searchOptions.value[child.key].forEach(item => {
if (item.value == form.value['bankId']) {
form.value['materials'] = item.materials
}
})
} else {
form.value['materials'] = ''
}
}
break
default:
break
}
}
// 改变编辑状态
const handleEditStatus = status => {
editStatus.value = status
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(processedAppointmentData.value))
for (const section of processedData) {
if (section.data) {
for (const field of section.data) {
if (editStatus.value) {
field.disabled = true
} else {
if (!form.value['openAccountStartTime'] && field.key == 'openAccountEndTime') {
field.disabled = true
} else {
field.disabled = false
}
}
}
}
}
processedAppointmentData.value = processedData
}
//给表单赋值 方便表单回显 obj 为表单数据
const setFormValue = (obj, formData) => {
let tempPhoneList = []
let tempAddressList = []
addressQuickList.value = []
phoneQuickList.value = []
// 深拷贝原始数据
form.value = JSON.parse(JSON.stringify(obj))
// 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) {
if (obj.isOpenAccount == 1 && section.key == 'openAccount') {
section.showMoudle = true
}
if (obj.isReferrerAccompany == 1 && section.key == 'referrerDtoList') {
section.showMoudle = true
}
// 给表单表格赋值
for (const objKey in obj) {
if (objKey == section.key && section.keyType == 'Array' && obj[section.key].length > 0) {
section.data = obj[section.key]
}
}
if (section.data) {
for (const field of section.data) {
if (field.key == 'confirmAppointmentTime' && props.appointmentStatus !== 0) {
field.show = true
}
// 处理时间
if (field.key == 'openAccountEndTime' && obj[field.key]) {
// 开始时间是否在结束时间之前
if (
obj['openAccountStartTime'] &&
!dayjs(obj['openAccountStartTime']).isBefore(dayjs(obj[field.key]))
) {
form.value[field.key] = ''
}
}
if (field.key == 'departureTime' && obj[field.key]) {
if (obj[field.key].split(' ').length > 1) {
form.value[field.key] = obj[field.key].split(' ')[0]
field.timeValue = obj[field.key].split(' ')[1]
}
field.finishTime = obj[field.key]
// 开始时间是否在结束时间之前
if (obj['arrivalTime'] && !dayjs(obj['arrivalTime']).isBefore(dayjs(obj[field.key]))) {
form.value[field.key] = ''
}
}
// 给到港时间的时分赋值
if (field.key == 'arrivalTime') {
if (obj[field.key] && obj[field.key].split(' ').length > 1) {
form.value[field.key] = obj[field.key].split(' ')[0]
field.timeValue = obj[field.key].split(' ')[1]
}
field.finishTime = obj[field.key]
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
let phoneObj = {}
for (const key1 in field) {
for (const key2 in obj) {
if (key1 !== 'drawerType' && field[key1] == key2) {
if (key1 == 'code' && obj[key2]) {
phoneObj[field[key1]] = obj[key2].includes('+') ? obj[key2] : `+${obj[key2]}`
} else {
phoneObj[field[key1]] = obj[key2]
}
}
}
}
if (phoneObj[field.key]) {
phoneObj.phoneString = form.value[field.key] = `${phoneObj[field.code]} ${
phoneObj[field.key]
}`
tempPhoneList.push(phoneObj)
}
phoneObj.objType = field.drawerType
phoneObj.key = field.key
phoneObj.phoneCode = field.code
saveKey.value[field.key] = phoneObj
break
case 'address':
let addressObj = null
for (const key1 in field) {
if (obj.addressList && obj.addressList.length > 0) {
obj.addressList.forEach(item => {
if (key1 == item.type) {
addressObj = item
}
})
}
}
if (addressObj) {
form.value[
field.key
] = `${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) {
tempAddressList.forEach(item => {
if (item.addressString !== addressObj.addressString) {
tempAddressList.push(addressObj)
}
})
} else {
tempAddressList.push(addressObj)
}
}
break
case 'country':
form.value[field.key] = obj.countryName
saveKey.value[field.key] = {
country: obj.country || '',
countryCode: obj.country || '',
countryName: obj.countryName || '',
name: obj.countryName || '',
objType: field.drawerType
}
break
default:
break
}
}
}
}
addressQuickList.value = tempAddressList
tempPhoneList.forEach(item => {
for (const key in saveKey.value) {
if (item.key == key) {
for (const key2 in saveKey.value[key]) {
if (item.key == key2) {
item.mobile = saveKey.value[key][key2]
}
if (item.phoneCode == key2) {
item.code = saveKey.value[key][key2]
}
}
}
}
})
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
processedAppointmentData.value = oldAppointmentData.value = processedData
oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
console.log('form.value', form.value)
}
// 数组去重
function removeDuplicates(arr, key) {
const seen = new Map()
const result = []
for (const item of arr) {
if (!seen.has(item[key])) {
seen.set(item[key], true)
result.push(item)
}
}
return result
}
// 获取校验失败的字段信息
const getInvalidFields = fields => {
const errors = []
for (const field in fields) {
if (fields[field] && fields[field].length > 0) {
errors.push({
field: field,
message: `签约信息模块-${fields[field][0].message}`
})
}
}
return errors
}
const handleFormValues = () => {
return new Promise(resolve => {
let submitObj = { ...form.value }
const pattern = /Time$/
proxy.$refs['appointmentInfoFormRef'].validate((valid, fields) => {
if (valid) {
errorFields.value = [] // 清空错误信息
//处理表单数据
for (const key1 in form.value) {
// 不开户去除开户相关信息
if (key1 == 'isOpenAccount' && form.value[key1] == 0) {
for (const key4 in openAccountKey.value) {
delete submitObj[key4]
}
}
if (pattern.test(key1) && form.value[key1]) {
submitObj[key1] = proxy.formatToDateTime(form.value[key1])
}
// 处理电话和地址相关的
for (const key2 in saveKey.value) {
//要判断drawerType
switch (saveKey.value[key2].objType) {
case 'phone':
if (key1 == key2) {
for (const key3 in saveKey.value[key2]) {
submitObj[key3] = saveKey.value[key2][key3]
}
}
break
case 'address':
if (key1 == key2) {
addressList.push(saveKey.value[key2])
}
break
case 'country':
if (key1 == key2) {
submitObj['country'] = saveKey.value[key2]['countryCode']
submitObj['countryName'] = saveKey.value[key2]['name']
}
break
default:
break
}
}
}
let obj = {
realName: '转介人姓名',
phone: '转介人手机',
email: '转介人邮箱'
}
let obj1 = {
name: '签单员姓名',
phone: '签单员电话',
practiceCode: '签单员执业编码'
}
processedAppointmentData.value.forEach(item => {
if (item.key == 'referrerDtoList') {
if (form.value['isReferrerAccompany'] == 1 && item.data.length > 0) {
item.data.forEach((item1, index) => {
for (const key in item1) {
if (!item1[key]) {
errorFields.value.push({
message: `陪同转介人-第${index + 1}${obj[key]}不能为空`
})
}
}
})
submitObj['referrerDtoList'] = item.data
} else if (form.value['isReferrerAccompany'] == 1 && item.data.length == 0) {
errorFields.value.push({
message: '签约信息模块--转介人陪同时,陪同转介人信息不能为空!!'
})
}
}
if (item.key == 'position') {
item.data.forEach((item1, index) => {
if (item1.compositionTime) {
submitObj[item1.key] = item1.finishTime
}
})
}
if (item.key == 'userSignDtoList' && item.data.length > 0) {
item.data.forEach((item1, index) => {
for (const key in item1) {
if (!item1[key]) {
errorFields.value.push({
message: `签单员-第${index + 1}${obj1[key]}不能为空`
})
}
}
})
submitObj['userSignDtoList'] = item.data
}
})
if (submitObj['signDate']) {
submitObj['signDate'] = proxy.formatToDateTime(submitObj['signDate'])
}
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) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
})
}
const anchorList = computed(() => {
let data = []
for (const section of processedAppointmentData.value) {
if (section.showMoudle) {
data.push({ title: section.anchorKey, name: section.fatherTitle })
}
}
return data
})
// 因为tab嵌套了两层,所以需要监听父组件的tab否则锚点的显示就会有bug
watch(
() => props.fatherTabName,
newVal => {
if (newVal) {
appointmentRef.value = null
}
}
)
if (Object.keys(props.detailInfo).length > 0) {
processFormData()
}
// 暴露给父组件
defineExpose({
handleFormValues,
handleEditStatus
})
</script>
<style lang="scss" scoped>
.required-label::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.domEmpty {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
font-size: 16px;
color: #a8abb2;
margin-top: 100px;
}
.topBtn {
width: 100%;
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.formBox {
width: 100%;
.fatherLable {
font-size: 18px;
border-left: 4px solid #165dff;
padding-left: 5px;
}
.fatherDes {
font-size: 14px;
color: #a8abb2;
margin-top: 5px;
margin-bottom: 20px;
}
.inputBox {
width: 100%;
border: 1px solid #dcdfe6;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: space-between;
min-height: 32px;
padding: 0px 11px;
.rightArrow {
font-size: 14px;
color: #a8abb2;
}
}
.desBox {
.title {
width: 120px;
font-size: 14px;
text-align: left;
margin-bottom: 10px;
color: #606266;
font-weight: 700;
}
.informationBox {
font-size: 14px;
border: 1px solid #dcdfe6;
width: 100%;
border-radius: 4px;
padding: 2px 4px;
box-sizing: border-box;
}
}
}
.tabButton {
box-shadow: 0 -1px 14px #00000014;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
/* padding-right: 20px; */
padding-top: 20px;
.sumbitBtn {
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
height: 60px;
background-color: #165dff;
color: #fff;
padding: 0 30px;
.buttonIcon {
font-size: 16px;
color: #fff;
}
}
}
.customerBox {
.customerItem {
padding: 10px;
border-radius: 5px;
margin-bottom: 20px;
box-shadow: 0 -1px 14px #00000014;
.top {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
.left {
width: 40%;
display: flex;
align-items: center;
justify-content: flex-start;
.gender {
display: flex;
align-items: center;
}
}
}
.bottom {
.infoItem {
display: flex;
align-items: center;
margin: 5px 0;
}
}
}
.customerItem:last-child {
margin-bottom: 0px;
}
}
.deleteIcon {
color: red;
font-size: 18px;
padding-top: 10px;
}
.compositionDateTime {
display: flex;
width: 100%;
box-sizing: border-box;
}
.itineraryDialogBox {
.dialogItem {
.dialogItemTitle {
font-size: 16px;
font-weight: 500;
margin: 10px 0;
color: #333;
}
}
}
@media only screen and (min-width: 768px) {
.formBtn {
margin-top: 0 !important;
}
}
@media only screen and (min-width: 1200px) {
.formBtn {
margin-top: 30px !important;
}
}
</style>
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
<div ref="appointmentRef"> <div ref="appointmentRef">
<CommonForm <CommonForm
:anchorList="anchorList" :anchorList="anchorList"
:affixOffset="360" :affixOffset="affixOffset"
:anchorOffset="10" :anchorOffset="10"
:scrollContainerSelector="anchorContainer" :scrollContainerSelector="anchorContainer"
:scrollOffset="10"
:domIndex="tabIndex" :domIndex="tabIndex"
:activeName="activeName" :activeName="activeName"
v-if="appointmentRef" v-if="appointmentRef"
...@@ -17,6 +16,35 @@ ...@@ -17,6 +16,35 @@
<el-row style="margin-bottom: 10px" v-if="father.showMoudle" :id="father.anchorKey"> <el-row style="margin-bottom: 10px" v-if="father.showMoudle" :id="father.anchorKey">
<div class="formBox"> <div class="formBox">
<CardOne :title="father.fatherTitle"> <CardOne :title="father.fatherTitle">
<template #mainTitCustom v-if="props.idsObj.appointmentBizId">
<div style="margin-left: 10px">
<el-button
@click="viewHistory"
type="primary"
link
v-if="father.key == 'administration'"
>历史记录</el-button
>
</div>
</template>
<template #headerRight v-if="father.key == 'administration'">
<div>
<el-button
v-if="idsObj.appointmentBizId"
@click="handleExprot"
type="primary"
link
>导出预约表</el-button
>
<el-button
v-if="appointmentStatus >= 2"
@click="getItineraryInfo"
type="primary"
link
>行程单预览</el-button
>
</div>
</template>
<template #content> <template #content>
<!-- 不是表格 --> <!-- 不是表格 -->
<el-row :gutter="20" v-if="!father.showTable"> <el-row :gutter="20" v-if="!father.showTable">
...@@ -84,6 +112,7 @@ ...@@ -84,6 +112,7 @@
:disabled="editStatus" :disabled="editStatus"
format="HH:mm" format="HH:mm"
value-format="HH:mm" value-format="HH:mm"
@change="timeValueChange(child)"
/> />
</div> </div>
<!-- 不带时分 --> <!-- 不带时分 -->
...@@ -110,13 +139,6 @@ ...@@ -110,13 +139,6 @@
@focus="handleFoucs(child)" @focus="handleFoucs(child)"
> >
</el-input> </el-input>
<el-button
class="formBtn"
v-if="child.domType === 'button'"
:type="child.buttonType"
@click="handleButtonClick(child)"
>{{ child.buttonTxt }}</el-button
>
<el-select <el-select
v-model="form[child.key]" v-model="form[child.key]"
...@@ -184,6 +206,7 @@ ...@@ -184,6 +206,7 @@
:remote-method="query => searchSelectList(query, 'realName')" :remote-method="query => searchSelectList(query, 'realName')"
:loading="searchLoadingStates['realName']" :loading="searchLoadingStates['realName']"
:disabled="editStatus" :disabled="editStatus"
@change="handleTableSelectChange(father, scope.row, 'realName')"
> >
<el-option <el-option
v-for="item in searchOptions['realName'] || []" v-for="item in searchOptions['realName'] || []"
...@@ -245,6 +268,7 @@ ...@@ -245,6 +268,7 @@
:remote-method="query => searchSelectList(query, 'name')" :remote-method="query => searchSelectList(query, 'name')"
:loading="searchLoadingStates['name']" :loading="searchLoadingStates['name']"
:disabled="editStatus" :disabled="editStatus"
@change="handleTableSelectChange(father, scope.row, 'name')"
> >
<el-option <el-option
v-for="item in searchOptions['name'] || []" v-for="item in searchOptions['name'] || []"
...@@ -340,6 +364,101 @@ ...@@ -340,6 +364,101 @@
</template> </template>
</CommonForm> </CommonForm>
</div> </div>
<!-- 历史签约记录 -->
<CommonDialog
dialogTitle="历史记录"
:showConfirm="false"
cancleText="关闭"
dialogWidth="70%"
:openDialog="openList"
:showClose="true"
@close="openList = false"
>
<div class="dialogBox">
<CommonPage
:showSearchForm="false"
:show-pagination="true"
:currentPage="queryParams.pageNo"
:total="total"
:pageSize="queryParams.pageSize"
@current-change="changePageNo"
@size-change="changePageSize"
:showOperationBtn="false"
>
<template #table>
<el-table v-loading="tableLoading" :data="tableData" border>
<el-table-column label="创建人" align="center" prop="creatorName" />
<!-- <el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :options="fetchDictData('sys_gender')" :value="scope.row.gender" />
</template>
</el-table-column> -->
<el-table-column label="创建时间" align="center" prop="createTime">
<template #default="scope">
<span>{{
scope.row.createTime ? formatToDateTime(scope.row.createTime) : '--'
}}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="100"
class-name="small-padding fixed-width"
fixed="right"
>
<template #default="scope">
<el-button link type="primary" @click="viewDetail(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</template>
</CommonPage>
</div>
</CommonDialog>
<!-- 签约详情 -->
<CommonDialog
:dialogTitle="detailTitle"
:showConfirm="false"
cancleText="关闭"
dialogWidth="70%"
:openDialog="showDetail"
:showClose="true"
@close="showDetail = false"
>
<el-scrollbar max-height="600px">
<div class="dialogBox">
<AppointmentDetail :detailInfo="detailInfo" :editSatus="true"></AppointmentDetail>
</div>
</el-scrollbar>
</CommonDialog>
<!-- 行程单详情 -->
<CommonDialog
dialogTitle="香港行程安排"
confirmText="下载行程单"
dialogWidth="70%"
:openDialog="showItinerary"
@confirm="handleExprotPdf"
@close="showItinerary = false"
:showClose="true"
:showCancle="false"
:confirmLoading="exportLoading"
>
<div class="itineraryDialogBox">
<div class="dialogItem" v-for="item in itineraryData">
<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>
</CommonDialog>
<Phone <Phone
@close="handleCloseDrawer" @close="handleCloseDrawer"
:showDrawer="showPhoneDrawer" :showDrawer="showPhoneDrawer"
...@@ -364,18 +483,27 @@ ...@@ -364,18 +483,27 @@
</div> </div>
</template> </template>
<script setup name="appointmentInfo"> <script setup name="appointmentInfo">
import CommonPage from '@/components/commonPage'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ArrowRight } from '@element-plus/icons-vue' import { ArrowRight } from '@element-plus/icons-vue'
import appointmentDomData from '@/formJson/appointmentInfo' import appointmentDomData from '@/formJson/appointmentInfo'
import Country from '@/views/components/country' import Country from '@/views/components/country'
import Phone from '@/views/components/phone' import Phone from '@/views/components/phone'
import Address from '@/views/components/address' import Address from '@/views/components/address'
import DetailPanel from '@/components/DetailPanel'
import { watch, nextTick } from 'vue' import { watch, nextTick } from 'vue'
import { editAppointmentInfo, newPolicy } from '@/api/sign/appointment' import {
getAppointmentlog,
getAppointmentlogDetail,
getItineraryExprot,
getItineraryDetail,
getAppointmentExprot
} from '@/api/sign/appointment'
import { getBankList, getAllSignList, getUserSaleExpandList } from '@/api/common' import { getBankList, getAllSignList, getUserSaleExpandList } from '@/api/common'
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 AppointmentDetail from './appointmentDetail'
import useDictStore from '@/store/modules/dict' import useDictStore from '@/store/modules/dict'
const dictStore = useDictStore() //获取字典数据 const dictStore = useDictStore() //获取字典数据
...@@ -385,13 +513,15 @@ const props = defineProps({ ...@@ -385,13 +513,15 @@ 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名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: true }, //编辑状态 editStatus: { type: Boolean, default: true }, //编辑状态
tabIndex: { type: [String, Number], default: '' } //tab索引 tabIndex: { type: [String, Number], default: '' }, //tab索引
affixOffset: { type: Number, default: 360 } //tab索引
}) })
const emit = defineEmits(['handleSuccessEdit']) const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const appointmentRef = ref(null) const appointmentRef = ref(null)
...@@ -401,11 +531,19 @@ const showCountryDrawer = ref(false) //国家/地区抽屉开关 ...@@ -401,11 +531,19 @@ const showCountryDrawer = ref(false) //国家/地区抽屉开关
const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输入值 const drawerInfo = ref({}) // 用于存储所有arrowRight类型的输入框输入值
const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key const saveKey = ref({}) // 用于存储当前点击的drawer框返回的对象,修改的时候回显值也要存key
const errorFields = ref([]) // 存储校验失败的字段信息 const errorFields = ref([]) // 存储校验失败的字段信息
const openList = ref(false) // 客户列表弹窗
const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作 const oldObjInfo = ref({}) // 修改时存储原始数据,便于撤销操作
const consultKey = ref({}) const consultKey = ref({})
const openAccountKey = ref({}) const openAccountKey = ref({})
const openList = ref(false) //历史签约记录弹窗开关
const showDetail = ref(false) //签约详情弹窗开关
const detailTitle = ref('') //签约详情弹窗title
const detailInfo = ref({}) //签约详情信息
const tableData = ref([])
const tableLoading = ref([])
const itineraryData = ref([]) //行程单数据
const appointmentSummeryInfo = ref({}) //行程单数据
const exportLoading = ref(false) //下载行程单loading
const showItinerary = ref(false) //下载行程单loading
// 地址组件菜单数据 // 地址组件菜单数据
const addressMenuList = ref([ const addressMenuList = ref([
{ {
...@@ -466,6 +604,7 @@ const deleteKeyList = ref([ ...@@ -466,6 +604,7 @@ const deleteKeyList = ref([
]) // 存储需要删除的key ]) // 存储需要删除的key
const searchOptions = ref({}) // 存储不同key对应的选项 const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态 const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const total = ref(0)
const data = reactive({ const data = reactive({
form: {}, form: {},
processedAppointmentData: [], // 处理后的表单数据 processedAppointmentData: [], // 处理后的表单数据
...@@ -473,11 +612,223 @@ const data = reactive({ ...@@ -473,11 +612,223 @@ const data = reactive({
rules: {}, //表单验证规则, rules: {}, //表单验证规则,
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 4, pageSize: 10
name: undefined
} }
}) })
const { form, rules, processedAppointmentData, queryParams, oldAppointmentData } = toRefs(data) const { form, rules, processedAppointmentData, queryParams, oldAppointmentData } = toRefs(data)
// 获取预约行程单详情
function getItineraryInfo() {
getItineraryDetail(props.idsObj.appointmentBizId).then(res => {
if (res.code == 200) {
appointmentSummeryInfo.value = res.data
fetchDictData('csf_ap_meeting_point').forEach(item => {
if (item.value == appointmentSummeryInfo.value.meetingPoint) {
appointmentSummeryInfo.value.meetingPoint = item.label
}
})
if (appointmentSummeryInfo.value.total) {
appointmentSummeryInfo.value.total = Number(appointmentSummeryInfo.value.total).toFixed(2)
}
itineraryData.value = [
{
title: '集合信息',
data: [
// 第一行:2列布局(各占12)
{
label: '集合时间',
value: appointmentSummeryInfo.value.arrivalTime,
span: 12 // 占12/24
},
{
label: '集合地点',
value: appointmentSummeryInfo.value.meetingPoint,
span: 12 // 占12/24
},
{
label: '意向地点',
value: appointmentSummeryInfo.value.signingAddress,
span: 12 // 占12/24
}
]
},
{
title: '业务代表',
data: [
// 第一行:2列布局(各占12)
{
label: '业务代表',
value: appointmentSummeryInfo.value.businessRepresentName1,
span: 12 // 占12/24
},
{
label: '联系电话',
value: appointmentSummeryInfo.value.businessRepresentMobile1
? appointmentSummeryInfo.value.businessRepresentMobile1Code +
appointmentSummeryInfo.value.businessRepresentMobile1
: '-',
span: 12 // 占12/24
}
]
},
{
title: '咨询内容',
data: [
// 第一行:2列布局(各占12)
{
label: '咨询人',
value: appointmentSummeryInfo.value.name,
span: 12 // 占12/24
},
{
label: '意向缴费年期',
value: appointmentSummeryInfo.value.paymentTerm,
span: 12 // 占12/24
},
{
label: '保单征费',
value: appointmentSummeryInfo.value.policyFee || '-',
span: 12 // 占12/24
},
{
label: '首期保费',
value: appointmentSummeryInfo.value.eachIssuePremium || '-',
span: 12 // 占12/24
},
{
label: '币种',
value: appointmentSummeryInfo.value.currency,
span: 12 // 占12/24
},
{
label: '意向咨询产品',
value: appointmentSummeryInfo.value.productName,
span: 12 // 占12/24
},
{
label: '首期合计金额',
value: appointmentSummeryInfo.value.total,
span: 12 // 占12/24
}
]
}
]
showItinerary.value = true
}
})
}
// 导出行程单Pdf
const handleExprotPdf = () => {
exportLoading.value = true
getItineraryExprot(appointmentSummeryInfo.value.appointmentBizId).then(res => {
if (res.code == 200) {
// 创建隐藏的下载链接
const link = document.createElement('a')
link.href = res.data
link.target = '_blank' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = `香港行程安排.pdf`
link.download = fileName
// 触发下载
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
exportLoading.value = false
showItinerary.value = false
} else {
proxy.$message.error('行程单下载失败')
exportLoading.value = false
}
})
}
//导出预约表
const handleExprot = async row => {
try {
const res = await getAppointmentExprot(props.idsObj.appointmentBizId)
if (res.code == 200) {
// 创建隐藏的下载链接
const link = document.createElement('a')
link.href = res.data.url
// link.target = '_blank' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = '预约导出.xlsx'
link.download = fileName
// 触发下载
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
proxy.$message.success('导出成功')
}
} catch (error) {
console.error('导出失败:', error)
}
}
const changePageNo = val => {
queryParams.value.pageNo = val
// getList()
}
const changePageSize = val => {
queryParams.value.pageSize = val
// getList()
}
const timeValueChange = child => {
if (form.value[child.key]) {
child.finishTime = `${form.value[child.key]} ${child.timeValue}:00`
} else if (!form.value[child.key]) {
proxy.$message.warning(`请先选择${child.label}日期`)
child.timeValue = ''
}
}
// 签约详情
const viewDetail = row => {
try {
getAppointmentlogDetail(row.appointmentLogBizId).then(response => {
detailInfo.value = response.data
detailTitle.value = `${row.creatorName}签约详情`
showDetail.value = true
})
} catch (error) {
detailTitle.value = ''
detailInfo.value = {}
showDetail.value = false
}
}
// 签约历史记录
const viewHistory = () => {
try {
getAppointmentlog(queryParams.value).then(response => {
tableData.value = response.data.records
total.value = response.data.total
tableLoading.value = false
openList.value = true
})
} catch (error) {
tableData.value = []
} finally {
tableLoading.value = false
}
}
const handleTableSelectChange = (father, row, key) => {
searchOptions.value[key].forEach(item => {
if (row[key] == item.value) {
row[key] = item.label
row.userBizId = item.userBizId
if (key == 'name') {
row.userSignBizId = item.value
} else if (key == 'realName') {
row.userSaleBizId = item.value
}
}
})
}
// 添加表单子级dom // 添加表单子级dom
const addChildren = father => { const addChildren = father => {
const processedData = JSON.parse(JSON.stringify(processedAppointmentData.value)) const processedData = JSON.parse(JSON.stringify(processedAppointmentData.value))
...@@ -513,7 +864,7 @@ const addChildren = father => { ...@@ -513,7 +864,7 @@ const addChildren = father => {
processedAppointmentData.value = processedData processedAppointmentData.value = processedData
} }
const deleteChildren = (father, childIndex) => { const deleteChildren = (father, childIndex) => {
if (props.editStatus.value) { if (props.editStatus) {
proxy.$modal.confirm(`请先点击编辑再进行删除操作`, { showCancel: '0', title: '填写提示' }) proxy.$modal.confirm(`请先点击编辑再进行删除操作`, { showCancel: '0', title: '填写提示' })
return return
} }
...@@ -602,7 +953,7 @@ const disabledDate = (time, child) => { ...@@ -602,7 +953,7 @@ const disabledDate = (time, child) => {
const inputDate = dayjs(time) const inputDate = dayjs(time)
switch (child.key) { switch (child.key) {
case 'intentionAppointmentTime': case 'signDate':
// 默认禁用今天及今天之前 // 默认禁用今天及今天之前
return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day') return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day')
break break
...@@ -631,21 +982,6 @@ const disabledDate = (time, child) => { ...@@ -631,21 +982,6 @@ const disabledDate = (time, child) => {
break break
} }
} }
const handleButtonClick = child => {
if (child.key == 'newPolicyButton') {
let obj = {
appointmentBizId: props.idsObj.appointmentBizId,
confirmAppointmentTime: form.value.confirmAppointmentTime
}
newPolicy(obj).then(response => {
if (response.code == 200) {
proxy.$modal.msgSuccess('新单已生成')
emit('handleSuccessEdit')
}
})
}
}
const handleDateClear = child => { const handleDateClear = child => {
if (child.key == 'openAccountStartTime' && !form.value['openAccountStartTime']) { if (child.key == 'openAccountStartTime' && !form.value['openAccountStartTime']) {
form.value['openAccountEndTime'] = '' form.value['openAccountEndTime'] = ''
...@@ -663,7 +999,16 @@ const handleDateChange = child => { ...@@ -663,7 +999,16 @@ 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' })
} }
// 拼接日期与时分
if (child.key == 'arrivalTime' && child.finishTime && child.finishTime.split(' ').length == 2) {
child.finishTime = `${form.value[child.key]} ${child.timeValue}:00`
} else if (
child.key == 'departureTime' &&
child.finishTime &&
child.finishTime.split(' ').length == 2
) {
child.finishTime = `${form.value[child.key]} ${child.timeValue}:00`
}
// 离港时间在到港时间之前 // 离港时间在到港时间之前
if ( if (
child.key == 'arrivalTime' && child.key == 'arrivalTime' &&
...@@ -723,6 +1068,11 @@ const processFormData = async () => { ...@@ -723,6 +1068,11 @@ const processFormData = async () => {
const processedData = JSON.parse(JSON.stringify(appointmentDomData)) const processedData = JSON.parse(JSON.stringify(appointmentDomData))
for (const section of processedData) { for (const section of processedData) {
if (section.keyType == 'Array') {
//给表格类型里的下拉框options赋值,否则提交的时候会报错
searchOptions.value['realName'] = dictStore.userSaleExpandList
searchOptions.value['name'] = dictStore.userSaleExpandList
}
if (section.data) { if (section.data) {
for (const field of section.data) { for (const field of section.data) {
if (section.key == 'openAccount') { if (section.key == 'openAccount') {
...@@ -738,9 +1088,7 @@ const processFormData = async () => { ...@@ -738,9 +1088,7 @@ const processFormData = async () => {
if (field.key == 'bankName') { if (field.key == 'bankName') {
searchOptions.value[field.key] = dictStore.bankList searchOptions.value[field.key] = dictStore.bankList
} }
if (field.key == 'realName') {
searchOptions.value[field.key] = dictStore.userSaleExpandList
}
if (field.required) { if (field.required) {
if (field.key === 'firstNamePinyin') { if (field.key === 'firstNamePinyin') {
rules.value[field.key] = [ rules.value[field.key] = [
...@@ -756,10 +1104,16 @@ const processFormData = async () => { ...@@ -756,10 +1104,16 @@ const processFormData = async () => {
} }
} }
} }
console.log('searchOptions.value', searchOptions.value)
// 编辑状态下回显值
if (props.idsObj.appointmentBizId) { if (props.idsObj.appointmentBizId) {
// editStatus.value = true
setFormValue(props.apiAppointmentInfoDto, processedData) setFormValue(props.apiAppointmentInfoDto, processedData)
return
} else if (showDetail.value) {
// 回显历史签约详情
setFormValue(detailData.value, processedData)
return
} else { } else {
// 新增给默认值 // 新增给默认值
form.value['isReferrerAccompany'] = form.value['isOpenAccount'] = form.value['isUseCar'] = 0 form.value['isReferrerAccompany'] = form.value['isOpenAccount'] = form.value['isUseCar'] = 0
...@@ -912,7 +1266,7 @@ const handleSelectChange = (father, child) => { ...@@ -912,7 +1266,7 @@ const handleSelectChange = (father, child) => {
break break
case 'isOpenAccount': case 'isOpenAccount':
// 选择吸烟,展示吸烟数量 // 根据是否开户,展示开户信息
if (form.value[child.key] == '1') { if (form.value[child.key] == '1') {
resetShow({ type: 'father', key: 'openAccount', status: true }) resetShow({ type: 'father', key: 'openAccount', status: true })
} else { } else {
...@@ -920,14 +1274,20 @@ const handleSelectChange = (father, child) => { ...@@ -920,14 +1274,20 @@ const handleSelectChange = (father, child) => {
} }
break break
case 'bankName': case 'bankName':
// 选择吸烟,展示吸烟数量
if (form.value[child.key]) { if (form.value[child.key]) {
searchOptions.value[child.key].forEach(item => {
if (item.value == form.value[child.key]) {
form.value[child.key] = item.label
form.value['bankId'] = item.value
}
})
if ( if (
searchOptions.value[child.key].findIndex(item => item.value == form.value[child.key]) !== searchOptions.value[child.key].findIndex(item => item.value == form.value['bankId']) !==
-1 -1
) { ) {
searchOptions.value[child.key].forEach(item => { searchOptions.value[child.key].forEach(item => {
if (item.value == form.value[child.key]) { if (item.value == form.value['bankId']) {
form.value['materials'] = item.materials form.value['materials'] = item.materials
} }
}) })
...@@ -955,11 +1315,7 @@ const handleEditStatus = status => { ...@@ -955,11 +1315,7 @@ const handleEditStatus = status => {
} else { } else {
if (!form.value['openAccountStartTime'] && field.key == 'openAccountEndTime') { if (!form.value['openAccountStartTime'] && field.key == 'openAccountEndTime') {
field.disabled = true field.disabled = true
} } else {
// else if (!form.value['arrivalTime'] && field.key == 'departureTime') {
// field.disabled = true
// }
else {
field.disabled = false field.disabled = false
} }
} }
...@@ -979,29 +1335,24 @@ const setFormValue = (obj, formData) => { ...@@ -979,29 +1335,24 @@ const setFormValue = (obj, formData) => {
// 深拷贝原始数据 // 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(formData)) const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) { for (const section of processedData) {
if (obj.isOpenAccount === 1 && section.key == 'openAccount') { if (obj.isOpenAccount == 1 && section.key == 'openAccount') {
section.showMoudle = true section.showMoudle = true
} }
if (obj.isAccompany === 1 && section.key == 'consult') { if (obj.isReferrerAccompany == 1 && section.key == 'referrerDtoList') {
section.showMoudle = true section.showMoudle = true
} }
// 给表单表格赋值
for (const objKey in obj) {
if (objKey == section.key && section.keyType == 'Array' && obj[section.key].length > 0) {
section.data = obj[section.key]
}
}
if (section.data) { if (section.data) {
for (const field of section.data) { for (const field of section.data) {
if (field.key == 'confirmAppointmentTime' && props.appointmentStatus !== 0) { if (field.key == 'confirmAppointmentTime' && props.appointmentStatus !== 0) {
field.show = true field.show = true
} }
if (obj.confirmAppointmentTime && field.key == 'newPolicyButton') {
field.show = true
}
if (props.apiAppointmentInfoDto.appointmentBizId) {
field.disabled = true
} else {
field.disabled = false
}
// if (field.key == 'bankName') {
// searchOptions.value[field.key] = fetchDictData(field.dictType)
// }
// 处理时间 // 处理时间
if (field.key == 'openAccountEndTime' && obj[field.key]) { if (field.key == 'openAccountEndTime' && obj[field.key]) {
// 开始时间是否在结束时间之前 // 开始时间是否在结束时间之前
...@@ -1010,16 +1361,28 @@ const setFormValue = (obj, formData) => { ...@@ -1010,16 +1361,28 @@ const setFormValue = (obj, formData) => {
!dayjs(obj['openAccountStartTime']).isBefore(dayjs(obj[field.key])) !dayjs(obj['openAccountStartTime']).isBefore(dayjs(obj[field.key]))
) { ) {
form.value[field.key] = '' form.value[field.key] = ''
field.disabled = true
} }
} }
if (field.key == 'departureTime' && obj[field.key]) { if (field.key == 'departureTime' && obj[field.key]) {
if (obj[field.key].split(' ').length > 1) {
form.value[field.key] = obj[field.key].split(' ')[0]
field.timeValue = obj[field.key].split(' ')[1]
}
field.finishTime = obj[field.key]
// 开始时间是否在结束时间之前 // 开始时间是否在结束时间之前
if (obj['arrivalTime'] && !dayjs(obj['arrivalTime']).isBefore(dayjs(obj[field.key]))) { if (obj['arrivalTime'] && !dayjs(obj['arrivalTime']).isBefore(dayjs(obj[field.key]))) {
form.value[field.key] = '' form.value[field.key] = ''
// field.disabled = true
} }
} }
// 给到港时间的时分赋值
if (field.key == 'arrivalTime') {
if (obj[field.key] && obj[field.key].split(' ').length > 1) {
form.value[field.key] = obj[field.key].split(' ')[0]
field.timeValue = obj[field.key].split(' ')[1]
}
field.finishTime = obj[field.key]
}
//要判断drawerType,因为抽屉要回显数据 //要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) { switch (field.drawerType) {
case 'phone': case 'phone':
...@@ -1114,6 +1477,7 @@ const setFormValue = (obj, formData) => { ...@@ -1114,6 +1477,7 @@ const setFormValue = (obj, formData) => {
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString') addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
processedAppointmentData.value = oldAppointmentData.value = processedData processedAppointmentData.value = oldAppointmentData.value = processedData
oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
console.log('form.value', form.value)
} }
// 数组去重 // 数组去重
function removeDuplicates(arr, key) { function removeDuplicates(arr, key) {
...@@ -1136,7 +1500,7 @@ const getInvalidFields = fields => { ...@@ -1136,7 +1500,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `签约信息模块-${fields[field][0].message}`
}) })
} }
} }
...@@ -1191,14 +1555,6 @@ const handleFormValues = () => { ...@@ -1191,14 +1555,6 @@ const handleFormValues = () => {
} }
} }
} }
if (submitObj['bankName']) {
searchOptions.value['bankName'].forEach(item => {
if (submitObj['bankName'] == item.bankBizId) {
submitObj['bankName'] = item.bankName
}
})
}
let obj = { let obj = {
realName: '转介人姓名', realName: '转介人姓名',
phone: '转介人手机', phone: '转介人手机',
...@@ -1212,14 +1568,7 @@ const handleFormValues = () => { ...@@ -1212,14 +1568,7 @@ const handleFormValues = () => {
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) {
submitObj['referrerDtoList'] = item.data.map((item1, index) => { item.data.forEach((item1, index) => {
if (item1.realName) {
searchOptions.value['realName'].forEach(item2 => {
if (item1.realName == item2.userSaleBizId) {
item1.realName = item2.realName
}
})
}
for (const key in item1) { for (const key in item1) {
if (!item1[key]) { if (!item1[key]) {
errorFields.value.push({ errorFields.value.push({
...@@ -1227,12 +1576,8 @@ const handleFormValues = () => { ...@@ -1227,12 +1576,8 @@ const handleFormValues = () => {
}) })
} }
} }
return {
realName: item1.realName,
phone: item1.phone,
email: item1.email
}
}) })
submitObj['referrerDtoList'] = item.data
} 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: '签约信息模块--转介人陪同时,陪同转介人信息不能为空!!'
...@@ -1242,23 +1587,12 @@ const handleFormValues = () => { ...@@ -1242,23 +1587,12 @@ const handleFormValues = () => {
if (item.key == 'position') { if (item.key == 'position') {
item.data.forEach((item1, index) => { item.data.forEach((item1, index) => {
if (item1.compositionTime) { if (item1.compositionTime) {
if (item1.timeValue) { submitObj[item1.key] = item1.finishTime
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) { if (item.key == 'userSignDtoList' && item.data.length > 0) {
submitObj['userSignDtoList'] = item.data.map((item1, index) => { item.data.forEach((item1, index) => {
if (item1.name) {
searchOptions.value['name'].forEach(item2 => {
if (item1.name == item2.userSignBizId) {
item1.name = item2.realName
}
})
}
for (const key in item1) { for (const key in item1) {
if (!item1[key]) { if (!item1[key]) {
errorFields.value.push({ errorFields.value.push({
...@@ -1266,17 +1600,13 @@ const handleFormValues = () => { ...@@ -1266,17 +1600,13 @@ const handleFormValues = () => {
}) })
} }
} }
return {
name: item1.name,
phone: item1.phone,
email: item1.email,
practiceCode: item1.practiceCode,
cardType: item1.cardType,
cardNo: item1.cardNo
}
}) })
submitObj['userSignDtoList'] = item.data
} }
}) })
if (submitObj['signDate']) {
submitObj['signDate'] = proxy.formatToDateTime(submitObj['signDate'])
}
console.log('submitObj', submitObj) console.log('submitObj', submitObj)
if (submitObj['departureTime']) { if (submitObj['departureTime']) {
// 开始时间是否在结束时间之前 // 开始时间是否在结束时间之前
...@@ -1314,13 +1644,34 @@ const anchorList = computed(() => { ...@@ -1314,13 +1644,34 @@ const anchorList = computed(() => {
} }
return data return data
}) })
// 关闭弹窗时清空弹窗历史签约表格
watch(openList, newVal => {
if (!newVal) {
tableData.value = []
}
})
// 关闭弹窗时清空行程单数据
watch(showItinerary, newVal => {
if (!newVal) {
appointmentSummeryInfo.value = {}
itineraryData.value = []
}
})
// 关闭详情弹窗时清空
watch(showDetail, newVal => {
if (!newVal) {
detailTitle.value = ''
detailInfo.value = {}
}
})
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
appointmentRef.value = null appointmentRef.value = null
if (newVal === 'appointmentInfo') { if (newVal === 'appointmentInfo') {
openList.value = false
processFormData() processFormData()
showDetail.value = false
openList.value = false
} }
} }
) )
...@@ -1338,7 +1689,6 @@ watch( ...@@ -1338,7 +1689,6 @@ watch(
() => props.formStatus, () => props.formStatus,
newVal => { newVal => {
if (newVal === 'appointmentEdit') { if (newVal === 'appointmentEdit') {
openList.value = false
processFormData() processFormData()
} }
} }
...@@ -1485,6 +1835,16 @@ defineExpose({ ...@@ -1485,6 +1835,16 @@ defineExpose({
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.itineraryDialogBox {
.dialogItem {
.dialogItemTitle {
font-size: 16px;
font-weight: 500;
margin: 10px 0;
color: #333;
}
}
}
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
.formBtn { .formBtn {
margin-top: 0 !important; margin-top: 0 !important;
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
:disabled="props.editStatus"
@click="updateChildren(father, scope.row)" @click="updateChildren(father, scope.row)"
> >
修改 修改
...@@ -128,6 +129,7 @@ ...@@ -128,6 +129,7 @@
<el-button <el-button
type="danger" type="danger"
size="small" size="small"
:disabled="props.editStatus"
@click="deleteChildren(father, scope.$index)" @click="deleteChildren(father, scope.$index)"
> >
删除 删除
...@@ -262,7 +264,7 @@ const props = defineProps({ ...@@ -262,7 +264,7 @@ const props = defineProps({
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改 fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
formStatus: { type: String, default: '' }, //父组件状态,新增、修改 formStatus: { type: String, default: '' }, //父组件状态,新增、修改
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象 idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiBeneficiaryInfoDtoList: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情 apiBeneficiaryInfoFzDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态 appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) }, //客户详情回显表单用 customerInfo: { type: Object, default: () => ({}) }, //客户详情回显表单用
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改 showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
...@@ -270,6 +272,7 @@ const props = defineProps({ ...@@ -270,6 +272,7 @@ const props = defineProps({
fatherTabName: { type: String, default: '' }, //一级tab名称 fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: true }, //编辑状态 editStatus: { type: Boolean, default: true }, //编辑状态
affixOffset: { type: Number },
tabIndex: { type: [String, Number], default: '' } //tab索引 tabIndex: { type: [String, Number], default: '' } //tab索引
}) })
const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess']) const emit = defineEmits(['handleSuccessEdit', 'policyEditSuccess'])
...@@ -499,9 +502,6 @@ const getRules = child => { ...@@ -499,9 +502,6 @@ const getRules = child => {
return rules return rules
} }
const disabledDate = time => {
return time.getTime() > Date.now()
}
const customerList = () => { const customerList = () => {
console.log('触发了') console.log('触发了')
...@@ -593,10 +593,11 @@ const processFormData = async obj => { ...@@ -593,10 +593,11 @@ const processFormData = async obj => {
} else { } else {
processedBeneficiaryData.value = oldAppointmentData.value = processedData processedBeneficiaryData.value = oldAppointmentData.value = processedData
} }
// if (props.showSubmitBtn) { if (props.idsObj.appointmentBizId) {
// } else { setFormValue(processedData)
// processedBeneficiaryData.value = oldAppointmentData.value = processedData } else {
// } processedBeneficiaryData.value = oldAppointmentData.value = processedData
}
} }
//弹出右侧抽屉 //弹出右侧抽屉
...@@ -816,140 +817,51 @@ function removeDuplicates(arr, key) { ...@@ -816,140 +817,51 @@ function removeDuplicates(arr, key) {
return result return result
} }
// 修改状态下,处理表单数据 // 修改状态下,处理表单数据
const setFormValue = () => { const setFormValue = processedData => {
personalObj.value = {} personalObj.value = {}
companyObj.value = {} companyObj.value = {}
processedBeneficiaryData.value = [] processedBeneficiaryData.value = []
let quickMobile = [] let quickMobile = []
let qucikAddress = [] let qucikAddress = []
// 深拷贝原始数据 // 深拷贝原始数据
const oldDom = JSON.parse(JSON.stringify(beneficiaryDomData)) const oldDom = JSON.parse(JSON.stringify(processedData))
// 先收集key,区分个人和企业 let obj = JSON.parse(JSON.stringify(props.apiBeneficiaryInfoFzDto))
for (const item of oldDom) { for (const section of oldDom) {
if (props.apiBeneficiaryInfoDtoList.length == 0) { for (const key in obj) {
form.value.apiBeneficiaryInfoDtoList.push({ id: item.id }) if (section.keyType == 'Object') {
} form.value[key] = obj[key]
if (item.children) {
for (const section of item.children) {
if (section.data) {
for (const field of section.data) {
if (section.key == 'customer' || section.key == 'other') {
personalObj.value[field.key] = field.key
companyObj.value[field.key] = field.key
}
// 收集key,区分个人和企业
if (section.key == 'person') {
personalObj.value[field.key] = field.key
} else if (section.key == 'company') {
companyObj.value[field.key] = field.key
}
if (field.dictType) {
// 获取字典数据
field.options = fetchDictData(field.dictType)
}
if (props.showSubmitBtn) {
field.disabled = true
}
}
}
} }
} if (section.keyType == 'Array' && key == section.key && obj[key].length > 0) {
} if (section.formItem) {
let newInfoList = JSON.parse(JSON.stringify(props.apiBeneficiaryInfoDtoList)) for (const child of section.formItem) {
// 详情中有数据,dom应该根据详情中的数据来渲染 if (child.domType == 'Select') {
if (newInfoList.length > 0) { obj[key].forEach((item1, index) => {
let newDOM1 = JSON.parse(JSON.stringify(oldDom)) if (section.key == 'apiBeneficiaryInfoDtoList' && item1.birthday) {
newInfoList.forEach((info, index) => { item1.birthday = proxy.formatToDate(item1.birthday)
newDOM1 = JSON.parse(JSON.stringify(oldDom)) }
for (const item of newDOM1) { fetchDictData(child.dictType).forEach(item2 => {
if (item.children) { if (item1[child.key] == item2.value) {
for (const section of item.children) { item1[child.key + 'Name'] = item2.label
// 根据选择得客户类型和与受保人关系,展示对应的模块 }
if ( })
(info.customerType == 'COMPANY' || info.customerType == 'INDIVIDUAL') && })
info.insurantRel &&
info.insurantRel == 'MYSELF' &&
section.key == 'customer'
) {
section.showMoudle = true
} else if (
info.customerType == 'COMPANY' &&
info.insurantRel &&
info.insurantRel !== 'MYSELF'
) {
if (section.key == 'person') {
section.showMoudle = false
} else {
section.showMoudle = true
}
} else if (
info.customerType == 'INDIVIDUAL' &&
info.insurantRel &&
info.insurantRel !== 'MYSELF'
) {
if (section.key == 'company') {
section.showMoudle = false
} else {
section.showMoudle = true
}
} else if (
(info.customerType == 'COMPANY' || info.customerType == 'INDIVIDUAL') &&
info.insurantRel &&
info.insurantRel == 'MYSELF' &&
section.key !== 'customer'
) {
section.showMoudle = false
} }
} }
} }
}
let phone = JSON.parse(JSON.stringify(info)) section.data = obj[key]
if (info.authMobile) { if (section.key == 'apiBeneficiaryInfoDtoList') {
quickMobile.push({ if (obj['isLegalBeneficiary'] == '0') {
code: phone.authMobileCode, section.showMoudle = true
mobile: phone.authMobile, } else {
phoneString: `${phone.authMobileCode} ${phone.authMobile}` section.data = []
}) section.showMoudle = false
info.authMobile = `${info.authMobileCode} ${info.authMobile}`
}
if (info.companyMobile) {
quickMobile.push({
code: phone.companyMobileCode,
mobile: phone.companyMobile,
phoneString: `${phone.companyMobileCode} ${phone.companyMobile}`
})
info.companyMobile = `${info.companyMobileCode} ${info.companyMobile}`
}
if (info.addressList && info.addressList.length > 0) {
info.addressList.forEach(address => {
if (address.type == 'companyEnterAddress') {
info.companyEnterAddress = `${address.region} ${address.city} ${address.street} ${address.location}`
}
if (address.type == 'txAddress') {
info.txAddress = `${address.region} ${address.city} ${address.street} ${address.location}`
} }
qucikAddress.push({ }
...address,
id: info.id,
drawerType: 'address',
addressString: `${address.region} ${address.city} ${address.street} ${address.location}`
})
})
} }
processedBeneficiaryData.value.push({ }
...newDOM1[0],
id: info.id,
beneficiaryBizId: info.beneficiaryBizId
})
})
form.value.apiBeneficiaryInfoDtoList = newInfoList
phoneQuickList.value = removeDuplicates(quickMobile, 'phoneString')
phoneOraddressKey.value = qucikAddress
addressQuickList.value = removeDuplicates(qucikAddress, 'addressString')
} else {
processedBeneficiaryData.value.push(oldDom[0]) // 详情中没有数据 ,dom应该根据默认数据来渲染
} }
processedBeneficiaryData.value = oldDom
} }
// 获取校验失败的字段信息 // 获取校验失败的字段信息
const getInvalidFields = fields => { const getInvalidFields = fields => {
...@@ -958,7 +870,7 @@ const getInvalidFields = fields => { ...@@ -958,7 +870,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `受益人模块-${fields[field][0].message}`
}) })
} }
} }
...@@ -968,33 +880,48 @@ const getInvalidFields = fields => { ...@@ -968,33 +880,48 @@ const getInvalidFields = fields => {
// 处理表单填写得数据 // 处理表单填写得数据
const handleFormValues = () => { const handleFormValues = () => {
return new Promise(async resolve => { return new Promise(async resolve => {
let submitObj = { ...form.value } if (processedBeneficiaryData.value.length > 0) {
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理 let submitObj = { ...form.value }
// 因为投保人没有policyholderRel的校验会影响 受保人,所以暂时先赋值处理
proxy.$refs['beneficiaryInfoFormRef'].validate((valid, fields) => { proxy.$refs['beneficiaryInfoFormRef'].validate((valid, fields) => {
if (valid) { if (valid) {
errorFields.value = [] // 清空错误信息 errorFields.value = [] // 清空错误信息
//处理表单数据 //处理表单数据
processedBeneficiaryData.value.forEach(item => { processedBeneficiaryData.value.forEach(item => {
if (item.keyType == 'Array') { if (item.keyType == 'Array') {
submitObj[item.key] = item.data submitObj[item.key] = JSON.parse(JSON.stringify(item.data))
submitObj[item.key].forEach((item1, index) => {
if (item1['birthday']) {
item1['birthday'] = proxy.formatToDateTime(item1['birthday'])
}
})
}
})
if (submitObj['isLegalBeneficiary'] == '1') {
delete submitObj['apiBeneficiaryInfoDtoList']
}
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
} }
})
if (errorFields.value.length > 0) { resolve(errorFields.value.length == 0 ? submitObj : null)
proxy.$message.error(errorFields.value[0].message) } else {
return undefined errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
} }
})
resolve(errorFields.value.length == 0 ? submitObj : null) } else {
if (props.idsObj.appointmentBizId) {
resolve(props.apiBeneficiaryInfoFzDto)
} else { } else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined) resolve(undefined)
} }
}) }
}) })
} }
...@@ -1027,15 +954,16 @@ watch( ...@@ -1027,15 +954,16 @@ watch(
if (newVal === 'beneficiary') { if (newVal === 'beneficiary') {
openList.value = false openList.value = false
if (props.showSubmitBtn) { processFormData({
setFormValue() domdata: beneficiaryDomData,
} else { exportValue: null
// 新增状态 })
processFormData({ // if (props.idsObj.appointmentBizId) {
domdata: beneficiaryDomData, // setFormValue()
exportValue: null // } else {
}) // // 新增状态
}
// }
} }
} }
) )
......
<template> <template>
<div class="uploadContainer"> <div class="uploadContainer">
<CardOne title="材料信息"> <CardOne title="材料信息">
<template #headerRight>
<div>
<el-button @click="downloadFile" type="primary" :loading="downLoading"
>下载材料包</el-button
>
</div>
</template>
<template #content> <template #content>
<el-table v-loading="loading" :data="fileTableList" boder> <el-table v-loading="loading" :data="fileTableList" boder>
<el-table-column label="序号" type="index" width="55" /> <el-table-column label="序号" type="index" width="55" />
...@@ -23,8 +30,8 @@ ...@@ -23,8 +30,8 @@
v-if="fileTableList.length > 0 && fileTableList[0].relObjectMaterialBizId" v-if="fileTableList.length > 0 && fileTableList[0].relObjectMaterialBizId"
> >
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.status === 1">已上传</span> <span v-if="scope.row.status === 'YSC'">已上传</span>
<span v-if="scope.row.status === 0" style="color: red">待上传</span> <span v-if="scope.row.status === 'WSC'" style="color: red">待上传</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -35,17 +42,16 @@ ...@@ -35,17 +42,16 @@
fixed="right" fixed="right"
> >
<template #default="scope"> <template #default="scope">
<!-- <el-button type="primary" link @click="downloadFile(scope.row)">下载</el-button> -->
<el-button <el-button
type="primary" type="primary"
link link
@click="handleUploadFile(scope.row)" @click="handleUploadFile(scope.row)"
v-if="scope.row.fileBizIdList.length == 0" v-if="scope.row.status == 'WSC'"
> >
上传 上传
</el-button> </el-button>
<el-button <el-button
v-if="props.pageSource !== 'policyList' && scope.row.fileBizIdList.length > 0" v-if="props.pageSource !== 'policyList' && scope.row.status == 'YSC'"
type="primary" type="primary"
link link
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
...@@ -135,7 +141,10 @@ import { ...@@ -135,7 +141,10 @@ import {
uploadMaterialList, uploadMaterialList,
delUploadFile, delUploadFile,
uploadRelObjectMaterialList, uploadRelObjectMaterialList,
uploadOssFileList uploadOssFileList,
uploadOssFileSubmit,
downloadCompressedFile,
delMaterial
} from '@/api/common' } from '@/api/common'
const props = defineProps({ const props = defineProps({
activeName: { type: String, default: '' }, //tab名称 activeName: { type: String, default: '' }, //tab名称
...@@ -156,7 +165,7 @@ const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + '/oss/api/oss/uploa ...@@ -156,7 +165,7 @@ const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + '/oss/api/oss/uploa
// 图片查看相关状态 // 图片查看相关状态
const imageViewerVisible = ref(false) const imageViewerVisible = ref(false)
const imageUrl = ref('') const imageUrl = ref('')
const tempFileTableList = ref([]) const downLoading = ref(false)
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
...@@ -170,11 +179,35 @@ const uploadedFiles = ref([]) ...@@ -170,11 +179,35 @@ const uploadedFiles = ref([])
const currentUploadRow = ref([]) const currentUploadRow = ref([])
const handleSubmitUpload = () => { const handleSubmitUpload = () => {
if (uploadedFiles.value.length > 0) { if (uploadedFiles.value.length > 0) {
fileTableList.value.forEach(item => { if (currentUploadRow.value.relObjectMaterialBizId) {
if (item.materialBizId == currentUploadRow.value.materialBizId) { try {
item.fileBizIdList = JSON.parse(JSON.stringify(uploadedFiles.value)) uploadOssFileSubmit({
relObjectMaterialBizId: currentUploadRow.value.relObjectMaterialBizId,
fileBizIdList: uploadedFiles.value.map(item => item.fileBizId)
}).then(response => {
getFileList()
// fileTableList.value.forEach(item => {
// if (item.materialBizId == currentUploadRow.value.materialBizId) {
// item.status = 'YSC'
// }
// })
editVisible.value = false
})
} catch (error) {
console.log('error', error)
uploadedFiles.value = []
proxy.$message.error('文件修改失败')
} }
}) } else {
fileTableList.value.forEach(item => {
if (item.materialBizId == currentUploadRow.value.materialBizId) {
item.fileBizIdList = JSON.parse(JSON.stringify(uploadedFiles.value))
item.status = 'YSC'
}
})
console.log('fileTableList.value', fileTableList.value)
}
} }
editVisible.value = false editVisible.value = false
} }
...@@ -212,15 +245,28 @@ const handleDetele = row => { ...@@ -212,15 +245,28 @@ const handleDetele = row => {
.confirm('是否确认删除此行数据?') .confirm('是否确认删除此行数据?')
.then(function () { .then(function () {
if (row.relObjectMaterialBizId) { if (row.relObjectMaterialBizId) {
console.log('远程删除')
return delMaterial(row.relObjectMaterialBizId) return delMaterial(row.relObjectMaterialBizId)
} else { } else {
fileTableList.value.splice(row.index, 1) // 本地临时数据,直接从列表中移除
const index = fileTableList.value.findIndex(
item => item.materialBizId === row.materialBizId
)
if (index !== -1) {
fileTableList.value.splice(index, 1)
}
// 注意:这里不需要 return Promise,因为是同步操作
// 但为了统一 then 链,可以 return 一个成功标识
return { code: 200 } // 模拟成功
} }
}) })
.then(res => { .then(res => {
if (res.code == 200) { if (res && res.code == 200) {
proxy.$modal.msgSuccess('删除成功') proxy.$modal.msgSuccess('删除成功')
getFileList() if (row.relObjectMaterialBizId) {
getFileList()
}
} }
}) })
.catch(() => {}) .catch(() => {})
...@@ -234,7 +280,7 @@ const handleUpdate = row => { ...@@ -234,7 +280,7 @@ const handleUpdate = row => {
if (row.relObjectMaterialBizId) { if (row.relObjectMaterialBizId) {
try { try {
uploadOssFileList({ objectBizId: row.relObjectMaterialBizId }).then(response => { uploadOssFileList({ objectBizId: row.relObjectMaterialBizId }).then(response => {
uploadedFiles.value = response.data uploadedFiles.value = response.data || []
editVisible.value = true editVisible.value = true
}) })
} catch (error) { } catch (error) {
...@@ -250,21 +296,65 @@ const handleView = row => { ...@@ -250,21 +296,65 @@ const handleView = row => {
imageUrl.value = row.fileUrl imageUrl.value = row.fileUrl
imageViewerVisible.value = true imageViewerVisible.value = true
} }
const downloadFile = row => { // 下载材料包
// 创建隐藏的下载链接 const downloadFile = () => {
const link = document.createElement('a') let apiMaterialDtoList = []
link.href = row.fileUrl let params = {
link.target = '_blank' // 新窗口打开 objectName: '预约附件材料包', //对象名(包名)
objectBizId: '' //对象业务ID
}
if (!props.idsObj.appointmentBizId) {
if (fileTableList.value.filter(item => item.fileBizIdList.length > 0).length == 0) {
proxy.$modal.msgError('请先上传文件')
return
}
apiMaterialDtoList = fileTableList.value.map(item => {
return {
dataPerson: item.dataPerson, //资料人(字典)
dataType: item.dataType, //资料类型(字典)
fileUrlList: item.fileBizIdList.map(item2 => item2.url) //文件url
}
})
} else {
if (fileTableList.value.filter(item => item.fileUrlList.length > 0).length == 0) {
proxy.$modal.msgError('请先上传文件')
return
}
apiMaterialDtoList = fileTableList.value.map(item => {
return {
dataPerson: item.dataPerson, //资料人(字典)
dataType: item.dataType, //资料类型(字典)
fileUrlList: item.fileUrlList
}
})
}
params.apiMaterialDtoList = apiMaterialDtoList
try {
downLoading.value = true
downloadCompressedFile(params).then(response => {
downLoading.value = false
// 创建隐藏的下载链接
const link = document.createElement('a')
link.href = response.data.url
link.target = '_blank' // 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const fileName = '预约材料包'
link.download = fileName
// 设置下载文件名(重要) // 触发下载
// 从URL中提取文件名,或者使用返回的文件名 document.body.appendChild(link)
const fileName = row.fileName link.click()
link.download = fileName document.body.removeChild(link)
})
} catch (error) {
console.log('error', error)
// 触发下载 proxy.$message.error('材料包下载失败')
document.body.appendChild(link) } finally {
link.click() downLoading.value = false
document.body.removeChild(link) }
} }
// 上传前loading加载 // 上传前loading加载
...@@ -322,6 +412,7 @@ const getFileList = () => { ...@@ -322,6 +412,7 @@ const getFileList = () => {
if (fileTableList.value.length > 0) { if (fileTableList.value.length > 0) {
fileTableList.value.forEach(item => { fileTableList.value.forEach(item => {
item.fileBizIdList = [] item.fileBizIdList = []
item.status = 'WSC'
}) })
} }
loading.value = false loading.value = false
...@@ -332,13 +423,10 @@ const getFileList = () => { ...@@ -332,13 +423,10 @@ const getFileList = () => {
objectBizId: props.idsObj.appointmentBizId objectBizId: props.idsObj.appointmentBizId
} }
uploadRelObjectMaterialList(obj).then(response => { uploadRelObjectMaterialList(obj).then(response => {
fileTableList.value = response.data fileTableList.value = response.data.records
loading.value = false loading.value = false
}) })
} }
if (tempFileTableList.value.length > 0) {
fileTableList.value = JSON.parse(JSON.stringify(tempFileTableList.value))
}
} catch (error) { } catch (error) {
fileTableList.value = [] fileTableList.value = []
} finally { } finally {
...@@ -348,12 +436,10 @@ const getFileList = () => { ...@@ -348,12 +436,10 @@ const getFileList = () => {
const handleFormValues = () => { const handleFormValues = () => {
let submitData = [] let submitData = []
fileTableList.value.forEach(item => { fileTableList.value.forEach(item => {
if (item.fileBizIdList.length > 0) { submitData.push({
submitData.push({ materialBizId: item.materialBizId,
materialBizId: item.materialBizId, fileBizIdList: item.fileBizIdList.map(item => item.fileBizId)
fileBizIdList: item.fileBizIdList.map(item => item.fileBizId) })
})
}
}) })
return submitData return submitData
} }
...@@ -363,12 +449,15 @@ watch(editVisible, newVal => { ...@@ -363,12 +449,15 @@ watch(editVisible, newVal => {
resetUploadedList() resetUploadedList()
} }
}) })
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
tempFileTableList.value = JSON.parse(JSON.stringify(fileTableList.value))
if (newVal === 'accessories') { if (newVal === 'accessories') {
getFileList() if (!hasLoaded.value) {
getFileList()
hasLoaded.value = true
}
} }
} }
) )
......
...@@ -373,7 +373,7 @@ const getInvalidFields = fields => { ...@@ -373,7 +373,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `健康信息模块-${fields[field][0].message}`
}) })
} }
} }
...@@ -382,80 +382,86 @@ const getInvalidFields = fields => { ...@@ -382,80 +382,86 @@ const getInvalidFields = fields => {
// 处理表单填写得数据 // 处理表单填写得数据
const handleFormValues = () => { const handleFormValues = () => {
let submitObj = []
return new Promise(async resolve => { return new Promise(async resolve => {
proxy.$refs['heathFormRef'].validate((valid, fields) => { if (questionnairesDom.value.length > 0) {
if (valid) { proxy.$refs['heathFormRef'].validate((valid, fields) => {
errorFields.value = [] // 清空错误信息 if (valid) {
let submitObj = [] errorFields.value = [] // 清空错误信息
if (props.activeName == 'questionnaires') {
submitObj = JSON.parse(JSON.stringify(form.value))
console.log('1111', submitObj)
} else {
// submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
// console.log('2222', submitObj)
}
let answerSessionsDtoList = [] if (props.activeName == 'questionnaires') {
// 处理表单数据 submitObj = JSON.parse(JSON.stringify(form.value))
submitObj.forEach(level1 => { } else {
level1.secondCategoryDtoList.forEach(level2 => { submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
// 修正:应该是 questionsDtoList 而不是 questionDtoList }
if (level2.questionsDtoList && level2.questionsDtoList.length > 0) {
level2.questionsDtoList.forEach(level3 => { let answerSessionsDtoList = []
// 检查是否有答案数据和附加问题 if (submitObj.length > 0) {
// // 处理表单数据
if (level3.answerSessionsDto) { submitObj.forEach(level1 => {
// 问题选择了是 level1.secondCategoryDtoList.forEach(level2 => {
if ( // 修正:应该是 questionsDtoList 而不是 questionDtoList
level3.answerSessionsDto.optionJsonDtoList && if (level2.questionsDtoList && level2.questionsDtoList.length > 0) {
level3.answerSessionsDto.optionBizId && level2.questionsDtoList.forEach(level3 => {
level3.answerSessionsDto.optionBizId == 'option_1002' // 检查是否有答案数据和附加问题
) { //
level3.answerSessionsDto.optionJsonDtoList.forEach(level4 => { if (level3.answerSessionsDto) {
level4.addQuestionsJsonDtoList = JSON.parse( // 问题选择了是
JSON.stringify(level3.addQuestionsDtoList) if (
) level3.answerSessionsDto.optionJsonDtoList &&
}) level3.answerSessionsDto.optionBizId &&
} level3.answerSessionsDto.optionBizId == 'option_1002'
answerSessionsDtoList.push({ ) {
questionBizId: level3.questionBizId, level3.answerSessionsDto.optionJsonDtoList.forEach(level4 => {
...level3.answerSessionsDto level4.addQuestionsJsonDtoList = JSON.parse(
JSON.stringify(level3.addQuestionsDtoList)
)
})
}
answerSessionsDtoList.push({
questionBizId: level3.questionBizId,
...level3.answerSessionsDto
})
}
}) })
} }
}) })
} })
}) }
})
let objectBizId = '' let objectBizId = ''
if ( if (
props.idsObj.appointmentBizId && props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList') (props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) { ) {
objectBizId = props.idsObj.appointmentBizId objectBizId = props.idsObj.appointmentBizId
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') { } else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
objectBizId = props.idsObj.policyBizId objectBizId = props.idsObj.policyBizId
} }
resolve( resolve(
errorFields.value.length == 0 errorFields.value.length == 0
? { ? {
questionnaireBizId: 'questionnaires_1001', questionnaireBizId: 'questionnaires_1001',
objectBizId: objectBizId, objectBizId: objectBizId,
answerSessionsDtoList answerSessionsDtoList
} }
: null : null
) )
} 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)
} }
} })
}) } else {
resolve(undefined)
}
}) })
} }
const getQuestionnairesInfo = () => { const getQuestionnairesInfo = () => {
loading.value = true loading.value = true
let id = '' let id = ''
...@@ -566,6 +572,7 @@ const getQuestionnairesInfo = () => { ...@@ -566,6 +572,7 @@ const getQuestionnairesInfo = () => {
questionnairesDom.value = form.value = result questionnairesDom.value = form.value = result
loading.value = false loading.value = false
console.log('questionnairesDom.value', questionnairesDom.value) console.log('questionnairesDom.value', questionnairesDom.value)
} }
}) })
...@@ -579,6 +586,7 @@ const anchorList = computed(() => { ...@@ -579,6 +586,7 @@ const anchorList = computed(() => {
} }
return data return data
}) })
const hasLoaded = ref(false) // 新增:是否已加载过数据
watch( watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
...@@ -586,14 +594,10 @@ watch( ...@@ -586,14 +594,10 @@ watch(
tempSecondHolderForm.value = { ...form.value } tempSecondHolderForm.value = { ...form.value }
if (newVal === 'questionnaires') { if (newVal === 'questionnaires') {
if ( if (!hasLoaded.value) {
props.idsObj.appointmentBizId && getQuestionnairesInfo()
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList') hasLoaded.value = true
) {
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
} }
getQuestionnairesInfo()
console.log('foldInsurantInfo', props.foldInsurantInfo)
} }
} }
) )
...@@ -603,7 +607,6 @@ defineExpose({ ...@@ -603,7 +607,6 @@ defineExpose({
handleFormValues, handleFormValues,
handleEditStatus, handleEditStatus,
questionLength: computed(() => { questionLength: computed(() => {
return questionnairesDom.value.length return questionnairesDom.value.length
}) })
}) })
......
...@@ -995,7 +995,7 @@ const getInvalidFields = fields => { ...@@ -995,7 +995,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `签约信息模块-${fields[field][0].message}`
}) })
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div ref="productRef"> <div ref="productRef">
<CommonForm <CommonForm
:anchorList="anchorList" :anchorList="anchorList"
:affixOffset="360" :affixOffset="affixOffset"
:anchorOffset="10" :anchorOffset="10"
:scrollContainerSelector="anchorContainer" :scrollContainerSelector="anchorContainer"
:scrollOffset="10" :scrollOffset="10"
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
:remote-method="query => searchSelectList(query, child.key)" :remote-method="query => searchSelectList(query, child.key)"
:loading="searchLoadingStates[child.key]" :loading="searchLoadingStates[child.key]"
:disabled="editStatus" :disabled="editStatus"
@change="handleSearchSelectChange(child.key)" @change="handleSearchSelectChange(father, child.key)"
> >
<el-option <el-option
v-for="item in searchOptions[child.key] || []" v-for="item in searchOptions[child.key] || []"
...@@ -135,6 +135,7 @@ ...@@ -135,6 +135,7 @@
type="primary" type="primary"
size="small" size="small"
@click="updateChildren(father, scope.row)" @click="updateChildren(father, scope.row)"
:disabled="props.editStatus"
> >
修改 修改
</el-button> </el-button>
...@@ -142,6 +143,7 @@ ...@@ -142,6 +143,7 @@
type="danger" type="danger"
size="small" size="small"
@click="deleteChildren(father, scope.$index)" @click="deleteChildren(father, scope.$index)"
:disabled="props.editStatus"
> >
删除 删除
</el-button> </el-button>
...@@ -213,7 +215,7 @@ ...@@ -213,7 +215,7 @@
remote remote
reserve-keyword reserve-keyword
placeholder="请输入关键词搜索" placeholder="请输入关键词搜索"
@change="handleSearchSelectChange(child.key, dIndex)" @change="handleSearchSelectChange('', child.key)"
:remote-method="query => searchSelectList(query, child.key)" :remote-method="query => searchSelectList(query, child.key)"
:loading="searchLoadingStates[child.key]" :loading="searchLoadingStates[child.key]"
> >
...@@ -266,6 +268,7 @@ const props = defineProps({ ...@@ -266,6 +268,7 @@ const props = defineProps({
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象 idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiProductPlanInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情 apiProductPlanInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态 appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
affixOffset: { type: Number }, //父组件传递过来的预约的状态
fatherTabName: { type: String, default: '' }, //一级tab名称 fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: true }, //编辑状态 editStatus: { type: Boolean, default: true }, //编辑状态
...@@ -287,7 +290,7 @@ const searchOptions = ref({}) // 存储不同key对应的选项 ...@@ -287,7 +290,7 @@ const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态 const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const additionalProductForm = ref([]) // 附加险的表单 const additionalProductForm = ref([]) // 附加险的表单
const data = reactive({ const data = reactive({
form: {}, form: { apiProductPlanMainInfoDto: {}, apiProductPlanAdditionalInfoDtoList: [] },
tempForm: {}, //由于切换tab的时候,表单数据会重置,所以需要保存一份临时表单数据 tempForm: {}, //由于切换tab的时候,表单数据会重置,所以需要保存一份临时表单数据
processedProductData: [], // 处理后的表单数据 processedProductData: [], // 处理后的表单数据
oldProductDomData: [], // 保存旧的表单Dom,便于撤销操作 oldProductDomData: [], // 保存旧的表单Dom,便于撤销操作
...@@ -313,6 +316,31 @@ const updateChildren = (father, row) => { ...@@ -313,6 +316,31 @@ const updateChildren = (father, row) => {
dialogTitle.value = '修改附加计划' dialogTitle.value = '修改附加计划'
dialogKey.value = 'apiProductPlanAdditionalInfoDtoList' dialogKey.value = 'apiProductPlanAdditionalInfoDtoList'
additionalProductForm.value = JSON.parse(JSON.stringify(father.formItem)) additionalProductForm.value = JSON.parse(JSON.stringify(father.formItem))
searchOptions.value['productLaunchName'] = dictStore.productAdditionalList
// 给弹窗里的供款年期赋值,否则下拉框没数据 有bug,有空再调试
// additionalProductForm.value.forEach(item => {
// searchOptions.value['productLaunchName'].forEach(item1 => {
// if (item1.value == dialogForm.value['productLaunchName']) {
// item1.apiAttributeSettingDtoList.forEach(item2 => {
// 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 }
// })
// }
// }
// })
// }
// })
// })
} }
dialogVisible.value = true dialogVisible.value = true
} }
...@@ -369,31 +397,63 @@ const addChildren = father => { ...@@ -369,31 +397,63 @@ const addChildren = father => {
dialogVisible.value = true dialogVisible.value = true
} }
} }
const handleSearchSelectChange = (key, index) => { const handleSearchSelectChange = (father, key) => {
// 附加计划选择产品后,给供款期数下拉框赋值 // 附加计划选择产品后,给供款期数下拉框赋值
if (key == 'productLaunchName') { if (key == 'productLaunchName') {
additionalProductForm.value.forEach(item => { additionalProductForm.value.forEach(item => {
searchOptions.value['productLaunchName'].forEach(item1 => { searchOptions.value['productLaunchName'].forEach(item1 => {
if (item1.value == dialogForm.value['productLaunchName']) { if (item1.value == dialogForm.value['productLaunchName']) {
item1.apiAttributeSettingDtoList.forEach(item2 => { dialogForm.value['productLaunchName'] = item1.label
if ( dialogForm.value['productLaunchBizId'] = item1.value
item2.attributeSettingBizId == 'attribute_setting_okpcuc8tlXRfVIAy' && }
item.key == 'issueNumber' item1.apiAttributeSettingDtoList.forEach(item2 => {
) { if (
if (item2.value) { item2.attributeSettingBizId == 'attribute_setting_okpcuc8tlXRfVIAy' &&
item.options = item2.value item.key == 'issueNumber'
.split(/[,,;;\s]+/) ) {
.map(item => item.trim()) if (item2.value) {
.filter(item => item !== '') item.options = item2.value
.map(item => { .split(/[,,;;\s]+/)
return { label: item, value: item } .map(item => item.trim())
}) .filter(item => item !== '')
.map(item => {
return { label: item, value: item }
})
if (item.options.length > 0) item.value = item.options[0].value if (item.options.length > 0) dialogForm.value[item.key] = item.options[0].value
}
} }
}) }
})
})
})
}
if (key == 'productLaunchMainName') {
father.data.forEach(item => {
searchOptions.value['productLaunchMainName'].forEach(item1 => {
if (item1.value == form.value[father.key][key]) {
form.value[father.key][key] = item1.label
form.value[father.key]['productLaunchBizId'] = item1.value
} }
item1.apiAttributeSettingDtoList.forEach(item2 => {
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 }
})
if (item.options.length > 0)
form.value[father.key]['issueNumber'] = item.options[0].value
}
console.log(item.options, item, '1111')
}
})
}) })
}) })
} }
...@@ -405,6 +465,16 @@ const handleSearchSelectChange = (key, index) => { ...@@ -405,6 +465,16 @@ const handleSearchSelectChange = (key, index) => {
} else { } else {
resetShow('sumInsured', false) resetShow('sumInsured', false)
} }
form.value['apiProductPlanMainInfoDto']['insuranceTypeName'] = item.label
form.value['apiProductPlanMainInfoDto']['insuranceTypeId'] = item.value
}
})
}
if (key == 'companyName') {
dictStore.allInsuranceCompanyList.forEach(item => {
if (form.value[father.key][key] == item.value) {
form.value[father.key][key] = item.label
form.value[father.key].companyId = item.value
} }
}) })
} }
...@@ -438,7 +508,7 @@ const searchSelectList = async (query, fieldKey) => { ...@@ -438,7 +508,7 @@ const searchSelectList = async (query, fieldKey) => {
} }
} }
// 可以添加其他字段的处理,可以放其他的字段得请求,目前只有accountName,以后有了其他的在填充 // 可以添加其他字段的处理,可以放其他的字段得请求,目前只有accountName,以后有了其他的在填充
else if (fieldKey === 'productLaunchName') { else if (fieldKey === 'productLaunchName' || fieldKey === 'productLaunchMainName') {
const params = { const params = {
productName: query.trim(), productName: query.trim(),
pageNo: 1, pageNo: 1,
...@@ -548,14 +618,15 @@ const processFormData = async () => { ...@@ -548,14 +618,15 @@ const processFormData = async () => {
} }
}) })
} }
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) {
if (section.dataLength) { // if (section.dataLength) {
for (let i = 1; i < section.dataLength; i++) { // for (let i = 1; i < section.dataLength; i++) {
section.data.push(JSON.parse(JSON.stringify(section.data[0]))) // section.data.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') {
...@@ -615,7 +686,7 @@ const processFormData = async () => { ...@@ -615,7 +686,7 @@ const processFormData = async () => {
} }
// idsObj.appointmentBizId // idsObj.appointmentBizId
// 证明是修改 // 证明是修改
if (props.showSubmitBtn) { if (props.idsObj.appointmentBizId) {
//在流程和预约的时候要调用这个方法回显修改数据 //在流程和预约的时候要调用这个方法回显修改数据
setFormValue(props.apiProductPlanInfoDto, processedData) setFormValue(props.apiProductPlanInfoDto, processedData)
} else { } else {
...@@ -713,136 +784,6 @@ const setFormValue = (obj, formData) => { ...@@ -713,136 +784,6 @@ const setFormValue = (obj, formData) => {
} }
} }
// 2.根据最新的表单数据更新processedProductData的值,因为有些模块是多项的,所以表单数据要和dom对应上,防止dom有form表单里没有对应的数据会报错 // 2.根据最新的表单数据更新processedProductData的值,因为有些模块是多项的,所以表单数据要和dom对应上,防止dom有form表单里没有对应的数据会报错
let newChildren = {
//id: Date.now() + Math.floor(Math.random() * 1000), //唯一标识
span: 24, //栅格布局份数
childTitle: '附加险',
deleteBtn: true,
children: [
{
label: '产品名称',
key: 'addProductName',
domType: 'SearchSelect',
required: true,
maxLength: 30,
disabled: false,
placeholder: '请输入',
show: true,
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
labelPosition: 'top', //标签的位置
lg: 8 //栅格布局份数
},
{
label: '保额',
key: 'sumInsured',
domType: 'Input',
inputType: 'number',
required: true,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保费',
key: 'premium',
domType: 'Input',
inputType: 'number',
required: true,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '保障地区',
key: 'guaranteeRegion',
domType: 'Input',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
labelWidth: '120px', //标签宽度
sm: 12, //栅格布局份数
lg: 8 //栅格布局份数
},
{
label: '货币',
key: 'currency',
domType: 'Select',
inputType: 'text',
required: false,
maxLength: 300,
disabled: false,
placeholder: '请输入',
show: true,
dictType: 'bx_currency_type',
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 //栅格布局份数
}
]
}
// 深拷贝原始表单dom数据 // 深拷贝原始表单dom数据
const processedData = JSON.parse(JSON.stringify(formData)) const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) { for (const section of processedData) {
...@@ -862,28 +803,10 @@ const setFormValue = (obj, formData) => { ...@@ -862,28 +803,10 @@ const setFormValue = (obj, formData) => {
key == 'apiProductPlanAdditionalInfoDtoList' && key == 'apiProductPlanAdditionalInfoDtoList' &&
newForm[section.key].length > 0 newForm[section.key].length > 0
) { ) {
for (let i = 0; i < newForm[section.key].length; i++) { newForm[section.key].forEach(item => {
section.data.push(newChildren) item.productLaunchNameValue = item.productLaunchName
} })
} section.data = newForm[section.key]
for (const field of section.data) {
if (key == 'apiProductPlanMainInfoDto') {
for (const key2 in newForm[key]) {
if (field.key == 'policyEffectiveDate' && newForm[key]['isBacktrack'] == '1') {
field.show = true
}
}
}
if (section.child == 'yes' && field.children && field.children.length > 0) {
for (const child of field.children) {
if (props.showSubmitBtn) {
child.disabled = true
} else {
child.disabled = false
}
}
}
} }
} }
} }
...@@ -919,54 +842,46 @@ const isObject = value => { ...@@ -919,54 +842,46 @@ const isObject = value => {
return typeof value === 'object' && value !== null && !Array.isArray(value) return typeof value === 'object' && value !== null && !Array.isArray(value)
} }
const handleSubmitForm = () => { const handleSubmitForm = () => {
let submitObj = {}
if (props.activeName == 'productPlan') {
submitObj = JSON.parse(JSON.stringify(form.value))
} else {
submitObj = JSON.parse(JSON.stringify(tempForm.value))
}
let resDom = JSON.parse(JSON.stringify(processedProductData.value))
return new Promise(async resolve => { return new Promise(async resolve => {
proxy.$refs['productFormRef'].validate((valid, fields) => { if (processedProductData.value.length > 0) {
if (valid) { proxy.$refs['productFormRef'].validate((valid, fields) => {
errorFields.value = [] // 清空错误信息 if (valid) {
resDom.forEach(section => { errorFields.value = [] // 清空错误信息
if (section.keyType == 'Array' && section.data.length > 0) { let submitObj = {}
submitObj[section.key] = JSON.parse(JSON.stringify(section.data)) if (props.activeName == 'productPlan') {
} submitObj = JSON.parse(JSON.stringify(form.value))
}) } else {
// 保险公司名称转换 submitObj = JSON.parse(JSON.stringify(tempForm.value))
dictStore.allInsuranceCompanyList.forEach(item => {
if (submitObj.apiProductPlanMainInfoDto.companyName == item.value) {
submitObj.apiProductPlanMainInfoDto.companyName = item.label
}
})
searchOptions.value['insuranceTypeName'].forEach(item => {
if (submitObj.apiProductPlanMainInfoDto.insuranceTypeName == item.value) {
submitObj.apiProductPlanMainInfoDto.insuranceTypeName = item.label
} }
}) let resDom = JSON.parse(JSON.stringify(processedProductData.value))
searchOptions.value['productLaunchName'].forEach(item => {
if (submitObj.apiProductPlanMainInfoDto.productLaunchName == item.value) { resDom.forEach(section => {
submitObj.apiProductPlanMainInfoDto.productLaunchName = item.label if (section.keyType == 'Array' && section.data.length > 0) {
submitObj[section.key] = JSON.parse(JSON.stringify(section.data))
}
})
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
} }
})
console.log('产品计划', submitObj)
if (errorFields.value.length > 0) { resolve(errorFields.value.length == 0 ? submitObj : null)
proxy.$message.error(errorFields.value[0].message) } else {
return undefined errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
} }
})
resolve(errorFields.value.length == 0 ? submitObj : null) } else {
if (props.idsObj.appointmentBizId) {
resolve(props.apiProductPlanInfoDto)
} else { } else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined) resolve(undefined)
} }
}) }
}) })
} }
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
v-if="child.domType === 'DatePicker'" v-if="child.domType === 'DatePicker'"
v-model="form[child.key]" v-model="form[child.key]"
type="date" type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
:placeholder="child.placeholder" :placeholder="child.placeholder"
:disabled="editStatus" :disabled="editStatus"
/> />
...@@ -240,6 +242,7 @@ const props = defineProps({ ...@@ -240,6 +242,7 @@ const props = defineProps({
fatherTabName: { type: String, default: '' }, //一级tab名称 fatherTabName: { type: String, default: '' }, //一级tab名称
anchorContainer: { type: String, default: '' }, //锚点滚动容器 anchorContainer: { type: String, default: '' }, //锚点滚动容器
editStatus: { type: Boolean, default: false }, //编辑状态 editStatus: { type: Boolean, default: false }, //编辑状态
affixOffset: { type: Number },
tabIndex: { type: [String, Number], default: '' } //tab索引 tabIndex: { type: [String, Number], default: '' } //tab索引
}) })
...@@ -419,10 +422,19 @@ const processFormData = async obj => { ...@@ -419,10 +422,19 @@ const processFormData = async obj => {
form.value = {} form.value = {}
// 深拷贝原始数据 // 深拷贝原始数据
const processedData = JSON.parse(JSON.stringify(obj.domdata)) const processedData = JSON.parse(JSON.stringify(obj.domdata))
console.log('obj', obj)
for (const section of processedData) { for (const section of processedData) {
if (section.data) { if (section.data) {
for (const field of section.data) { for (const field of section.data) {
// 编辑状态下回显表单值
if (section.key == 'apiSecondHolderInfoDto' && props.idsObj.appointmentBizId) {
if (obj['detailInfo'] && obj['detailInfo']['isSecond'] == '0') {
section.showMoudle = false
} else {
section.showMoudle = true
}
}
if (field.dictType) { if (field.dictType) {
// 获取字典数据 // 获取字典数据
field.options = fetchDictData(field.dictType) field.options = fetchDictData(field.dictType)
...@@ -455,7 +467,7 @@ const processFormData = async obj => { ...@@ -455,7 +467,7 @@ const processFormData = async obj => {
) { ) {
form.value = { ...tempSecondHolderForm.value } form.value = { ...tempSecondHolderForm.value }
} }
if (props.showSubmitBtn) { if (props.idsObj.appointmentBizId) {
form.value = { ...props.apiSecondHolderInfoDto } form.value = { ...props.apiSecondHolderInfoDto }
} else { } else {
} }
...@@ -651,7 +663,7 @@ const getInvalidFields = fields => { ...@@ -651,7 +663,7 @@ const getInvalidFields = fields => {
if (fields[field] && fields[field].length > 0) { if (fields[field] && fields[field].length > 0) {
errors.push({ errors.push({
field: field, field: field,
message: fields[field][0].message message: `第二持有人模块-${fields[field][0].message}`
}) })
} }
} }
...@@ -661,79 +673,46 @@ const getInvalidFields = fields => { ...@@ -661,79 +673,46 @@ const getInvalidFields = fields => {
// 处理表单填写得数据 // 处理表单填写得数据
const handleFormValues = () => { const handleFormValues = () => {
return new Promise(async resolve => { return new Promise(async resolve => {
let submitObj = {} if (processedSecondHolderData.value.length > 0) {
if (props.activeName == 'secondHolder') { proxy.$refs['secondHolderFormRef'].validate((valid, fields) => {
submitObj = JSON.parse(JSON.stringify(form.value)) let submitObj = { ...form.value }
} else { // debugger
submitObj = JSON.parse(JSON.stringify(tempSecondHolderForm.value))
}
proxy.$refs['secondHolderFormRef'].validate((valid, fields) => { console.log('form.value', form.value)
if (valid) { if (valid) {
errorFields.value = [] // 清空错误信息 errorFields.value = [] // 清空错误信息
if (submitObj.isSecond && submitObj.isSecond == '0') { if (form.value.isSecond == '0') {
for (const key in submitObj) { for (const key in submitObj) {
if (key !== 'isSecond') { if (key !== 'isSecond') {
submitObj[key] = '' submitObj[key] = ''
}
} }
} }
} submitObj['isSecond'] = form.value.isSecond
if (submitObj['birthday']) { if (submitObj['birthday']) {
submitObj['birthday'] = proxy.formatToDate(submitObj['birthday']) submitObj['birthday'] = proxy.formatToDateTime(submitObj['birthday'])
}
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
return undefined
}
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
})
return submitObj
}
// 表单提交
const submitForm = () => {
proxy.$refs['secondHolderFormRef'].validate((valid, fields) => {
if (valid) {
let submitObj = handleFormValues()
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editSecondHolderInfo(submitObj).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('第二持有人修改成功')
emit('handleSuccessEdit')
} }
}) if (errorFields.value.length > 0) {
} proxy.$message.error(errorFields.value[0].message)
if (props.idsObj.policyBizId && props.pageSource == 'policyList') { return undefined
// submitObj['policySecondHolderBizId'] = props.apiInsurantInfoDto.policySecondHolderBizId
// submitObj['policyBizId'] = props.apiInsurantInfoDto.policyBizId
// submitObj['id'] = props.apiInsurantInfoDto.id
updatePolicySecondHolder(submitObj).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('新单跟进-受保人修改成功')
emit('policyEditSuccess')
} }
}) if (props.idsObj.appointmentBizId) {
} submitObj['secondHolderBizId'] = props.apiSecondHolderInfoDto.secondHolderBizId
errorFields.value = [] // 清空错误信息 }
resolve(errorFields.value.length == 0 ? submitObj : null)
} else {
errorFields.value = getInvalidFields(fields)
if (errorFields.value.length > 0) {
proxy.$message.error(errorFields.value[0].message)
}
resolve(undefined)
}
})
} else { } else {
// 获取校验失败的字段信息 if (props.idsObj.appointmentBizId) {
errorFields.value = getInvalidFields(fields) resolve(props.apiSecondHolderInfoDto)
if (errorFields.value.length > 0) { } else {
proxy.$message.error(errorFields.value[0].message) resolve(undefined)
} }
} }
}) })
...@@ -763,10 +742,19 @@ watch( ...@@ -763,10 +742,19 @@ watch(
if (newVal === 'secondHolder') { if (newVal === 'secondHolder') {
openList.value = false openList.value = false
processFormData({ if (props.idsObj.appointmentBizId) {
domdata: secondHolderDomData, processFormData({
exportValue: null domdata: secondHolderDomData,
}) exportValue: null,
detailInfo: props.apiSecondHolderInfoDto
})
console.log(' props.apiSecondHolderInfoDto', props.apiSecondHolderInfoDto)
} else {
processFormData({
domdata: secondHolderDomData,
exportValue: null
})
}
} }
} }
) )
......
...@@ -118,30 +118,40 @@ ...@@ -118,30 +118,40 @@
<span>{{ formatToDate(scope.row.createTime) }}</span> <span>{{ formatToDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="操作" <el-table-column fixed="right" label="操作" width="80" align="center">
align="left" <template #default="{ row }">
width="250" <el-popover placement="left" :width="160" trigger="click">
class-name="small-padding fixed-width" <template #reference>
fixed="right" <el-button link type="primary" size="small">
> <el-icon><MoreFilled /></el-icon>
<template #default="scope"> </el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button> </template>
<el-button <el-menu @select="index => handleSelect(index, row)" popper-class="custom-menu">
link <el-menu-item
type="primary" v-for="item in getVisibleDropdownItems(row)"
v-if="scope.row.status == 2 || scope.row.status == 3" :index="item.value"
@click="getAppointmentInfo(scope.row.appointmentBizId)" :key="item.value"
>查看行程单</el-button >
> <el-text class="mx-1" v-if="!item.confirm">{{ item.label }}</el-text>
<el-button link type="primary" @click="handleExprot(scope.row)">导出</el-button> <el-popconfirm
<el-button v-else
link confirm-button-text="Yes"
type="danger" cancel-button-text="No"
v-if="scope.row.status === 0" :icon="InfoFilled"
@click="handleDelete(scope.row)" icon-color="#626AEF"
>删除</el-button :title="item.confirm"
> @confirm="handleMenuConfirm(item.value, row)"
width="300"
placement="left-end"
>
<template #reference>
<el-text class="mx-1">{{ item.label }}</el-text>
</template>
</el-popconfirm>
</el-menu-item>
</el-menu>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -187,6 +197,8 @@ ...@@ -187,6 +197,8 @@
</template> </template>
<script setup name="Appointment"> <script setup name="Appointment">
import { MoreFilled, InfoFilled } from '@element-plus/icons-vue'
import CommonPage from '@/components/commonPage' import CommonPage from '@/components/commonPage'
import DetailPanel from '@/components/DetailPanel' import DetailPanel from '@/components/DetailPanel'
import { onMounted, onActivated, ref } from 'vue' import { onMounted, onActivated, ref } from 'vue'
...@@ -227,6 +239,7 @@ const operationBtnList = ref([ ...@@ -227,6 +239,7 @@ const operationBtnList = ref([
click: handleQuery click: handleQuery
} }
]) ])
const changePageNo = val => { const changePageNo = val => {
queryParams.value.pageNo = val queryParams.value.pageNo = val
getList() getList()
...@@ -251,6 +264,60 @@ const { bx_currency_type, csf_ap_status, csf_ap_meeting_point } = proxy.useDict( ...@@ -251,6 +264,60 @@ const { bx_currency_type, csf_ap_status, csf_ap_meeting_point } = proxy.useDict(
'csf_ap_status', 'csf_ap_status',
'csf_ap_meeting_point' 'csf_ap_meeting_point'
) )
// 基础菜单项配置(不使用 ref,因为它是静态的)
const baseDropdownItems = [
{ label: '修改', value: 'edit', confirm: '' },
{
label: '生成行程单',
value: 'viewItinerary',
confirm: '',
// 只有当 row.status == 1 时才显示
showCondition: row => row.status == 1
}
]
const getVisibleDropdownItems = row => {
return baseDropdownItems.filter(item => {
// 如果有 showCondition,则执行;否则默认显示
return typeof item.showCondition === 'function' ? item.showCondition(row) : true
})
}
// 菜单选择处理(无确认的操作)
const handleSelect = (index, row) => {
// 只处理不需要确认的操作
const item = baseDropdownItems.find(i => i.value === index)
if (item && !item.confirm) {
handleMenuAction(index, row)
}
// 如果有 confirm,则由 el-popconfirm 触发 handleMenuConfirm
}
// 带确认的操作(由 popconfirm 触发)
const handleMenuConfirm = (value, row) => {
handleMenuAction(value, row)
}
// 统一处理菜单动作
const handleMenuAction = (action, row) => {
switch (action) {
case 'edit':
handleUpdate(row)
break
case 'viewItinerary':
if (row.status !== 0) {
handleUpdate(row, 'viewItinerary')
}
break
case 'delete':
if (row.status !== 0) {
proxy.$message.warning('仅“待提交”状态的预约可删除')
return
}
handleDelete(row)
break
default:
proxy.$message.info('功能暂未开放')
}
}
const handleExprotPdf = () => { const handleExprotPdf = () => {
exportLoading.value = true exportLoading.value = true
getItineraryExprot(appointmentSummeryInfo.value.appointmentBizId).then(res => { getItineraryExprot(appointmentSummeryInfo.value.appointmentBizId).then(res => {
...@@ -489,7 +556,7 @@ function handleDelete(row) { ...@@ -489,7 +556,7 @@ function handleDelete(row) {
.catch(() => {}) .catch(() => {})
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
function handleUpdate(row) { function handleUpdate(row, type) {
// 对预约status进行转换,到编辑页面在转换会有时机问题 // 对预约status进行转换,到编辑页面在转换会有时机问题
csf_ap_status._object.csf_ap_status.forEach(element => { csf_ap_status._object.csf_ap_status.forEach(element => {
element.value = Number(element.value) element.value = Number(element.value)
...@@ -506,6 +573,10 @@ function handleUpdate(row) { ...@@ -506,6 +573,10 @@ function handleUpdate(row) {
appointmentBizId: row.appointmentBizId, appointmentBizId: row.appointmentBizId,
source: 'appointmentList' source: 'appointmentList'
} }
// 以生成行程单的方式进入到预约详情
if (type == 'viewItinerary') {
data.appointmentType = '2'
}
router.push({ router.push({
path: '/sign/appointment/appointmentEdit', path: '/sign/appointment/appointmentEdit',
query: data query: data
......
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