mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-09 15:46:43 +08:00
feat(ebiz): 改进受益人信息添加功能
- 移除身份证扫描注释代码并优化组件加载方式 - 新增 mediaDTOS 属性支持图片信息传递 - 动态导入 IdentityCardScan 组件提升性能 - 增加 idImage 计算属性处理前后端图片路径 - 清理冗余的同步申请人信息注释代码 - 优化图片验证逻辑减少重复条件判断 - 移除重复的组件导入声明避免冲突
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div class="add-beneficiary-container redRadioCheckbox">
|
||||
<!-- 身份证扫描 -->
|
||||
<!-- <IdentityCardScan :role="user.beneficiary" :subTask="`${subTask}-uploadPhoto`" :user-info="beneficiary" @getScanInfo="$emit('scaned', $event)" />-->
|
||||
<template v-if="uploadComponentInfo">
|
||||
<Component :is="uploadComponentInfo.component" v-bind="uploadComponentInfo.props" v-on="uploadComponentInfo.event" />
|
||||
</template>
|
||||
@@ -364,7 +362,7 @@ export default {
|
||||
subTask: this.task
|
||||
}
|
||||
},
|
||||
props: ['beneficiary', 'task', 'disableSyncApplicant'],
|
||||
props: ['beneficiary', 'task', 'disableSyncApplicant', 'mediaDTOS'],
|
||||
inject: ['nextStepProcesserContainer'],
|
||||
computed: {
|
||||
user: () => user,
|
||||
@@ -382,11 +380,12 @@ export default {
|
||||
this.userInfo.relationToInsured = value
|
||||
}
|
||||
},
|
||||
|
||||
uploadComponentInfo() {
|
||||
const idType = this.userInfo.idType
|
||||
const subTask = `${this.subTask}-uploadPhoto`
|
||||
const IdentityCardScan = {
|
||||
component: 'IdentityCardScan',
|
||||
component: () => import('@/views/ebiz/saleFlowProImprove/components/IdentityCardScan.vue'),
|
||||
props: { subTask, role: user.beneficiary, userInfo: this.beneficiary },
|
||||
event: { getScanInfo: event => this.$emit('scaned', event) }
|
||||
}
|
||||
@@ -394,11 +393,39 @@ export default {
|
||||
|
||||
const PhotoScan = {
|
||||
component: () => import('./components/PhotoScanner.vue'),
|
||||
props: { userInfo: this.beneficiary, role: user.beneficiary, subTask },
|
||||
props: { userInfo: this.beneficiary, role: user.beneficiary, subTask, mediaDTOS: this.mediaDTOS },
|
||||
event: { getScanInfo: event => this.$emit('scaned', event) }
|
||||
}
|
||||
|
||||
return !idType ? IdentityCardScan : Number(idType) === 1 ? IdentityCardScan : PhotoScan
|
||||
},
|
||||
idImage() {
|
||||
if (!Array.isArray(this.mediaDTOS) || !this.mediaDTOS.length) return
|
||||
const applicantImage = this.mediaDTOS.filter(dto => dto.subBusinessNo === this.beneficiary.bnfId)
|
||||
const [applicantFront, applicantBack] = applicantImage.toSorted((dto1, dto2) => dto1.imageInfoType.localeCompare(dto2.imageInfoType))
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
if (!applicantBack || !applicantFront || !applicantBack.rgssUrl || !applicantFront.rgssUrl) {
|
||||
return { frontID: { exist: false }, backID: { exist: false } }
|
||||
}
|
||||
|
||||
const base = isDev ? 'https://iagentsales-test2.e-guofu.com/' : ''
|
||||
// 测试环境采用截取地址的方式获取 url , 正式环境下采用 rgssUrl
|
||||
const frontRgssUrl = isDev ? base + applicantFront.rgssUrl.replace('/opt/ebiz/static', '') : applicantFront.rgssUrl
|
||||
const backRgssUrl = isDev ? base + applicantBack.rgssUrl.replace('/opt/ebiz/static', '') : applicantBack.rgssUrl
|
||||
|
||||
return {
|
||||
frontID: {
|
||||
exist: !!this.mediaDTOS,
|
||||
imageBase64: '',
|
||||
imagePath: this.mediaDTOS ? frontRgssUrl : ''
|
||||
},
|
||||
backID: {
|
||||
exist: !!this.mediaDTOS,
|
||||
imageBase64: '',
|
||||
imagePath: this.mediaDTOS ? backRgssUrl : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -1282,55 +1309,6 @@ export default {
|
||||
}
|
||||
|
||||
this.isInsured = true
|
||||
|
||||
// this.syncToApplicant()
|
||||
// getOrderDetail(params).then(res => {
|
||||
// if (res.result == 0) {
|
||||
// let insuredDetail = res.orderDTO.appntDTO
|
||||
// this.userInfo.name = insuredDetail.name //姓名
|
||||
// this.nameLimit = Boolean(insuredDetail.name)
|
||||
// this.userInfo.sex = insuredDetail.sex //性别
|
||||
// this.sexLimit = Boolean(insuredDetail.sex)
|
||||
// this.userInfo.nativeplace = insuredDetail.nativeplace //国家地区
|
||||
// this.userInfo.birthday = insuredDetail.birthday //出生日期
|
||||
// this.birthdayLimit = Boolean(insuredDetail.birthday)
|
||||
// this.userInfo.idType = insuredDetail.idType //证件类型
|
||||
// this.userInfo.idNo = insuredDetail.idNo //证件号码
|
||||
// this.idNoLimit = Boolean(insuredDetail.idNo)
|
||||
// this.userInfo.certificateValidate = insuredDetail.certificateValidate //证件起始日期
|
||||
// this.userInfo.certiexpiredate = insuredDetail.certiexpiredate == '9999-12-31' ? '' : insuredDetail.certiexpiredate //证件截止日期
|
||||
// this.userInfo.effectiveDateType = insuredDetail.certiexpiredate == '9999-12-31' //是否长期
|
||||
// this.userInfo.mobile = insuredDetail.mobile
|
||||
// this.mobileLimit = Boolean(insuredDetail.mobile)
|
||||
// this.userInfo.marriage = insuredDetail.marriage
|
||||
// if (this.userInfo.marriage == 1) {
|
||||
// this.userInfo.marriageStatus = '已婚'
|
||||
// } else if (this.userInfo.marriage == 2) {
|
||||
// this.userInfo.marriageStatus = '未婚'
|
||||
// } else if (this.userInfo.marriage == 3) {
|
||||
// this.userInfo.marriageStatus = '离异'
|
||||
// } else if (this.userInfo.marriage == 4) {
|
||||
// this.userInfo.marriageStatus = '丧偶'
|
||||
// }
|
||||
// let age = utilsAge.getAge(insuredDetail.birthday, new Date())
|
||||
// this.effectiveDateTypeAble = age <= 45
|
||||
// if (age > 45) {
|
||||
// this.userInfo.effectiveDateType = true
|
||||
// }
|
||||
// this.idLimit = true
|
||||
// this.userInfo.occupationCode = insuredDetail.occupationCode //职业类别编码
|
||||
// this.userInfo.occupationName = insuredDetail.occupationName //职业类别名称
|
||||
//
|
||||
// this.areaStr = getAreaName([{ code: insuredDetail.homeProvince }, { code: insuredDetail.homeCity }, { code: insuredDetail.homeArea }])
|
||||
// this.userInfo.province = insuredDetail.homeProvince
|
||||
// this.userInfo.city = insuredDetail.homeCity
|
||||
// this.userInfo.area = insuredDetail.homeArea
|
||||
// this.userInfo.village = insuredDetail.homeAddress
|
||||
//
|
||||
// this.userInfo.yearSalary = insuredDetail.averageAnnualIncome
|
||||
// this.userInfo.averageAnnualIncome = insuredDetail.averageAnnualIncome
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
this.isInsured = false
|
||||
this.userInfo.relationToInsured = ''
|
||||
@@ -1499,7 +1477,6 @@ export default {
|
||||
[Popup.name]: Popup,
|
||||
[Picker.name]: Picker,
|
||||
[Area.name]: Area,
|
||||
IdentityCardScan: () => import('@/views/ebiz/saleFlowProImprove/components/IdentityCardScan.vue'),
|
||||
[CustomerPicker.name]: CustomerPicker
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
ref="beneficiaryRef"
|
||||
:beneficiary.sync="beneficiary"
|
||||
:disableSyncApplicant="index < 1"
|
||||
:mediaDTOS="mediaDTOS"
|
||||
:task="`saveBeneficiary-${beneficiary.bid}`"
|
||||
@scaned="getIdentityInfo($event, index)"
|
||||
@syncBeneficiary="handleSyncBeneficiary($event, index)"
|
||||
@@ -66,7 +67,8 @@ export default {
|
||||
bnfType: '0', // 0 身故受益人 1 身前受益人
|
||||
salePageFlag: '4',
|
||||
isShowEvaluationPoint: '0',
|
||||
preTasks: []
|
||||
preTasks: [],
|
||||
mediaDTOS: []
|
||||
}
|
||||
},
|
||||
props: { taskID: { type: String, default: '' } },
|
||||
@@ -92,6 +94,10 @@ export default {
|
||||
} else {
|
||||
localStorage.beneficiaryInfo = []
|
||||
}
|
||||
|
||||
if (Array.isArray(res.orderDTO.mediaDTOS)) {
|
||||
this.mediaDTOS = res.orderDTO.mediaDTOS
|
||||
}
|
||||
})
|
||||
|
||||
const getInsuredName = () => {
|
||||
@@ -283,13 +289,6 @@ export default {
|
||||
// on cancel
|
||||
})
|
||||
},
|
||||
//获取受益人列表
|
||||
async getBeneficiaryList() {
|
||||
const res = await getOrderDetail({ orderNo: this.$route.query.orderNo })
|
||||
if (res.result == 0 && res.orderDTO && Array.isArray(res.orderDTO)) {
|
||||
Object.assign(this.beneficiaries, res.orderDTO.inuseredDTOs[0].bnfDTOs)
|
||||
}
|
||||
},
|
||||
registerMainTask() {
|
||||
if (!this.taskID) return
|
||||
this.nextStepProcesserContainer.registerMainTask(
|
||||
|
||||
@@ -153,19 +153,10 @@ export default {
|
||||
const result = getOrderDetail({ orderNo: this.$route.query.orderNo })
|
||||
|
||||
// 如果触发上传图片行为, 就开始进行列表检测
|
||||
if (this.updateImage) {
|
||||
if (this.list.length <= 2) {
|
||||
setTimeout(() => this.$toast('请补充完整影像信息'), 600)
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
// 如果没有上传图片,对云端图片进行检测
|
||||
if (!this.validateRoleImage(result)) {
|
||||
setTimeout(() => this.$toast('请补充完整影像信息'), 600)
|
||||
return false
|
||||
}
|
||||
if ((this.updateImage && this.list.length <= 2) || (!this.updateImage && !this.validateRoleImage(result))) {
|
||||
setTimeout(() => this.$toast('请补充完整影像信息'), 600)
|
||||
return false
|
||||
}
|
||||
|
||||
// 针对 受益人进行特殊的处理, 下一步前的前置处理
|
||||
if (this.role === this.user.beneficiary) {
|
||||
if (result.result !== '0') return false
|
||||
|
||||
Reference in New Issue
Block a user