mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-07 14:46:44 +08:00
987 lines
38 KiB
Vue
987 lines
38 KiB
Vue
<template>
|
||
<div class="notifyingMessage-container redRadioCheckbox">
|
||
<div class="pb50">
|
||
<div class="allFalse">
|
||
<div style="background-color: rgb(245, 245, 245);padding-bottom:5px">
|
||
<index-bar :key="renovate"></index-bar>
|
||
</div>
|
||
<div v-if="!isSpecificMedicalInsurance" class="flex justify-content-s align-items-c bg-white pt20 pb20 pr10">
|
||
<span class="pl10">告知项目</span>
|
||
<div @click="allFalse" class="pr10">
|
||
<van-button type="danger" size="small">一键全否</van-button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div :class="[!isSpecificMedicalInsurance?'content-all-info':'content-all-info2']">
|
||
<div v-if="isSpecificMedicalInsurance" class="pt10 pl20 pr10 bg-white">
|
||
<p class="red">重要提示:</p>
|
||
<span class="fs12 ml25">
|
||
依据《中华人民共和国保险法》的有关规定,保险公司就被保险人有关情况的询问,您应当履行如实告知义务,否则保险公司有权依法解除保险合同,并对保险合同解除前发生的保险事故部承担保险责任。投保人故意或者因重大过失未履行前款规定的如实告知义务,足以影响保险人决定是否同意承保或者提高保险费率的,保险人有权解除合同。
|
||
</span>
|
||
</div>
|
||
<div v-if="isSpecificMedicalInsurance" slot="title" class="flex justify-content-s align-items-c bg-white pt20 pb5 pl15">告知项目</div>
|
||
<div v-for="(im, indx) in impartDTOS" :key="indx">
|
||
<van-collapse v-model="activeNames">
|
||
<van-collapse-item :name="indx + 1">
|
||
<div slot="title" class="flex align-items-c justify-content-s">
|
||
<!--投保人 0 2 4 6 8 10 被保险人 1 3 5 7 9 11 13 特定疾病险固定展示为'被保人健康告知'-->
|
||
{{isSpecificMedicalInsurance?impartTypeNumber['13']:
|
||
relationToAppnt == '1'
|
||
? '投保人/被保险人' +
|
||
impartTypeNumber[im.impartType]
|
||
.replace('投保人', '')
|
||
.replace('被保人', '')
|
||
.replace('被保险人', '')
|
||
: impartTypeNumber[im.impartType]
|
||
}}
|
||
<!--{{ impartTypeNumber[im.impartType] }}-->
|
||
<div class="flex align-items-c justify-content-s">
|
||
<span>{{
|
||
im.impartType == 0 || im.impartType == 2 || im.impartType == 4 || im.impartType == 6 || im.impartType == 8 || im.impartType == 10
|
||
? saleInsuredInfo.name
|
||
: saleInsuredPersonInfo.name
|
||
}}</span>
|
||
|
||
<img :src="$assetsUrl + 'images/avatar.png'" class="w20 ml15" />
|
||
</div>
|
||
</div>
|
||
<!-- <div class="h50">
|
||
<img />
|
||
<span>请如实填写问题中的每一项情况,并对出现“是”的情况载体是框列举说明</span>
|
||
</div>-->
|
||
<div v-if="!isSpecificMedicalInsurance" class="h50 mt10 flex align-items-c notifyingMessage-text">
|
||
<div class="ml15 w315 h35 flex">
|
||
<!-- <img :src="$assetsUrl + 'images/notifiy.png'" class="w18 h18 " /> -->
|
||
<van-icon name="info-o" class="w18 h18" size="20px" color="#4a90e2" />
|
||
<span class="fs12 ml10">请如实填写问题中的每一项情况,并对出现“是”的情况在提示框列举说明</span>
|
||
</div>
|
||
</div>
|
||
<!-- 第一题 -->
|
||
<div v-for="(item, index) in im.impartItemDTOS" :key="index">
|
||
<div class="mt10 pb2" v-if="item.impartCode != '2b'">
|
||
<div :class="[!isSpecificMedicalInsurance?'mb20 ml20':'mb20 ml20 pt15']">
|
||
<span v-if="!isSpecificMedicalInsurance">{{ item.impartCode + '.' + item.impartContent }}</span>
|
||
<span v-else v-html="item.impartCode + '.' + item.impartContent"></span>
|
||
</div>
|
||
<van-radio-group
|
||
v-model="item.impartAnswer"
|
||
class="flex mb10 pb10"
|
||
@change="change(item.isSelect, $event, item.impartCode, im.impartType)"
|
||
v-validate="'required'"
|
||
data-vv-name="单选"
|
||
v-if="!isSpecificMedicalInsurance"
|
||
>
|
||
<van-radio name="0" class="mr150 ml70">是</van-radio>
|
||
<van-radio name="1">否</van-radio>
|
||
</van-radio-group>
|
||
<van-cell-group v-for="(it, ind) in item.questions" :key="ind">
|
||
<div v-if="it.extra">
|
||
<van-field v-model="it.answer" placeholder="请输入" :label="it.questionContent" clearable v-validate="'required'" data-vv-name="答案" />
|
||
</div>
|
||
</van-cell-group>
|
||
<div v-if="item.impartAnswer == '0'">
|
||
<van-cell-group v-for="(it, ind) in item.questions" :key="ind">
|
||
<van-field
|
||
v-model="it.answer"
|
||
placeholder="请输入"
|
||
:label="it.questionContent"
|
||
clearable
|
||
v-validate="'required'"
|
||
data-vv-name="答案"
|
||
v-if="!it.extra"
|
||
/>
|
||
</van-cell-group>
|
||
</div>
|
||
</div>
|
||
<div class="mt10 pb2" :class="{ special: !showFlag || !isShow }" v-else>
|
||
<!-- 被保险人题目为2b -->
|
||
<div v-if="im.impartType == 3 || im.impartType == 7 || im.impartType == 11">
|
||
<div class="mb20 ml20" v-if="item.impartCode == '2b' && showFlag && isShow">
|
||
<span>{{ item.impartCode + '.' + item.impartContent }}</span>
|
||
</div>
|
||
<van-cell-group v-for="(it, ind) in item.questions" :key="ind">
|
||
<div v-if="it.extra && showFlag && isShow">
|
||
<van-field v-model="it.answer" placeholder="请输入" :label="it.questionContent" clearable v-validate="'required'" data-vv-name="答案" />
|
||
</div>
|
||
</van-cell-group>
|
||
<div v-if="showFlag && isShow">
|
||
<van-cell-group v-for="(it, ind) in item.questions" :key="ind">
|
||
<van-field
|
||
v-model="it.answer"
|
||
placeholder="请输入"
|
||
:label="it.questionContent"
|
||
clearable
|
||
v-validate="'required'"
|
||
data-vv-name="答案"
|
||
v-if="!it.extra"
|
||
/>
|
||
</van-cell-group>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</van-collapse-item>
|
||
</van-collapse>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div v-if="!isSpecificMedicalInsurance" class="bottom-btn bg-white">
|
||
<van-button type="danger" size="large" @click="next" :disabled="isDisabled" v-no-more-click="1000">下一步</van-button>
|
||
</div>
|
||
<div v-else class="bottom-btn bg-white">
|
||
<van-button style="width: 50vw" @click="cancel" v-no-more-click="1000">部分为是</van-button>
|
||
<van-button type="danger" style="width: 50vw" @click="next" v-no-more-click="1000">全部为否</van-button
|
||
>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import { Collapse, CollapseItem, RadioGroup, Radio, Field, CellGroup, Icon } from 'vant'
|
||
import { information, saveInformation, getOrderDetail } from '@/api/ebiz/sale/sale'
|
||
import utilsAge from '@/assets/js/utils/age'
|
||
import IndexBar from '@/components/ebiz/sale/IndexBar'
|
||
export default {
|
||
data() {
|
||
return {
|
||
renovate:'',
|
||
// 告知信息
|
||
impartDTOS: [],
|
||
// 折叠面板
|
||
activeNames: [],
|
||
// 投保人信息
|
||
saleInsuredInfo: {},
|
||
// 被保险人信息
|
||
saleInsuredPersonInfo: {},
|
||
// 投被保险人是否同人 1为同一个人
|
||
relationToAppnt: '',
|
||
// 产品编码
|
||
productCodes: '',
|
||
// 是否可以点击
|
||
isDisabled: false,
|
||
// 默认显示被保险人根据后台返回
|
||
noRisk: false,
|
||
//是否存在附加险
|
||
isExistAdditionalRisk: false,
|
||
saleInsuredAge: '',
|
||
saleInsuredSex: '',
|
||
saleInsuredPersonAge: '',
|
||
saleInsuredPersonSex: '',
|
||
showFlag: false,
|
||
isShow: false,
|
||
isShows: false,
|
||
impartTypeNumber: {
|
||
'0': '投保人健康告知',
|
||
'2': '投保人财务告知',
|
||
'1': '被保险人健康告知',
|
||
'3': '被保险人财务告知',
|
||
'4': '投保人健康告知',
|
||
'5': '被保险人健康告知',
|
||
'6': '投保人财务告知',
|
||
'7': '被保险人财务告知',
|
||
'8': '投保人健康告知',
|
||
'10': '投保人财务告知',
|
||
'9': '被保险人健康告知',
|
||
'11': '被保险人财务告知',
|
||
'13': '被保险人健康告知',
|
||
'14': '被保险人职业告知',
|
||
'15': '被保险人职业告知',
|
||
'16': '被保险人职业告知',
|
||
'17': '被保险人职业告知',
|
||
},
|
||
salePageFlag: '5',
|
||
// 是否特定医疗险
|
||
isSpecificMedicalInsurance:false,
|
||
isShowEvaluationPoint:'0',//默认不跳转到风险测评
|
||
isUniversalRiskNotifyShowPoint: '0' //默认不跳转到万能险风险告知
|
||
}
|
||
},
|
||
async created() {
|
||
let res= await getOrderDetail({ orderNo: this.$route.query.orderNo })
|
||
if (res.result == 0) {
|
||
//投被保险人关系
|
||
//this.isShowEvaluationPoint = res.orderDTO.riskEvaluationDTO.isShowEvaluationPoint
|
||
this.isUniversalRiskNotifyShowPoint = res.orderDTO.universalRiskNotifyDTO.isUniversalRiskNotifyShowPoint
|
||
this.renovate = new Date().getTime()
|
||
this.isExistAdditionalRisk = res.orderDTO.insuredDTOs[0].riskDTOLst.length > 1 ? true : false
|
||
|
||
console.log('this.is ====', this.isExistAdditionalRisk)
|
||
this.relationToAppnt = res.orderDTO.insuredDTOs[0].relationToAppnt
|
||
this.$utils.intLocalStorage(res)
|
||
this.saleInsuredInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
|
||
this.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
|
||
//如果返回参数存在曾经提交的告知信息,获取曾经提交的告知信息
|
||
let insuredFinanceImpartDTO = res.orderDTO.appntDTO.financeImpartDTO //投保人财务告知集合
|
||
// 银保非实时才会存在这个字段
|
||
let insuredJobImpartDTO = res.orderDTO.appntDTO.jobImpartDTO ? res.orderDTO.appntDTO.jobImpartDTO : {impartItemDTOS: false} //投保人健康告知集合
|
||
// 银保非实时才会存在这个字段
|
||
let insuredPersonJobImpartDTO = res.orderDTO.insuredDTOs[0].jobImpartDTO ?res.orderDTO.insuredDTOs[0].jobImpartDTO : {impartItemDTOS: false}
|
||
let insuredImpartDTO = res.orderDTO.appntDTO.impartDTO //投保人健康告知集合
|
||
let insuredPersionFinanceImpartDTO = res.orderDTO.insuredDTOs[0].financeImpartDTO //被保人财务告知集合
|
||
let insuredPersionImpartDTO = res.orderDTO.insuredDTOs[0].impartDTO //被保人健康告知集合
|
||
|
||
if (
|
||
insuredFinanceImpartDTO.impartItemDTOS ||
|
||
insuredImpartDTO.impartItemDTOS ||
|
||
insuredPersionFinanceImpartDTO.impartItemDTOS ||
|
||
insuredPersionImpartDTO.impartItemDTOS||
|
||
insuredJobImpartDTO.impartItemDTOS||
|
||
insuredPersonJobImpartDTO.impartItemDTOS
|
||
) {
|
||
if (insuredFinanceImpartDTO.impartItemDTOS) {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredFinanceImpartDTO.impartItemDTOS, impartType: insuredFinanceImpartDTO.impartType })
|
||
} else if (insuredPersionFinanceImpartDTO.impartItemDTOS && this.relationToAppnt == '1') {
|
||
|
||
this.impartDTOS.push({ impartItemDTOS: insuredPersionFinanceImpartDTO.impartItemDTOS, impartType: insuredPersionFinanceImpartDTO.impartType })
|
||
}
|
||
|
||
if (insuredJobImpartDTO.impartItemDTOS) {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredJobImpartDTO.impartItemDTOS, impartType: insuredJobImpartDTO.impartType })
|
||
} else if (insuredPersonJobImpartDTO.impartItemDTOS && this.relationToAppnt == '1') {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredPersonJobImpartDTO.impartItemDTOS, impartType: insuredPersonJobImpartDTO.impartType })
|
||
}
|
||
if (insuredImpartDTO.impartItemDTOS) {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredImpartDTO.impartItemDTOS, impartType: insuredImpartDTO.impartType })
|
||
} else if (insuredPersionImpartDTO.impartItemDTOS && this.relationToAppnt == '1') {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredPersionImpartDTO.impartItemDTOS, impartType: insuredPersionImpartDTO.impartType })
|
||
}
|
||
if (this.relationToAppnt != '1') {
|
||
if (insuredPersionFinanceImpartDTO.impartItemDTOS) {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredPersionFinanceImpartDTO.impartItemDTOS, impartType: insuredPersionFinanceImpartDTO.impartType })
|
||
}
|
||
if (insuredPersonJobImpartDTO.impartItemDTOS) {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredPersonJobImpartDTO.impartItemDTOS, impartType: insuredPersonJobImpartDTO.impartType })
|
||
}
|
||
if (insuredPersionImpartDTO.impartItemDTOS) {
|
||
this.impartDTOS.push({ impartItemDTOS: insuredPersionImpartDTO.impartItemDTOS, impartType: insuredPersionImpartDTO.impartType })
|
||
}
|
||
}
|
||
this.impartDTOS.map(v => {
|
||
v.impartItemDTOS.map(i => {
|
||
i.isSelect =
|
||
this.formatDateTime() +
|
||
Math.random()
|
||
.toString(36)
|
||
.substr(2)
|
||
i.show = false
|
||
// 13-特定疾病险 被保人健康告知 第一题 换行展示 回显
|
||
if (insuredPersionImpartDTO.impartType == '13') {
|
||
i.impartContent = this.replaceNToBr(i.impartContent)
|
||
}
|
||
if (i.impartAnswer == '0') {
|
||
i.show = true
|
||
} else {
|
||
i.questions[0].answer = ''
|
||
}
|
||
})
|
||
})
|
||
} else {
|
||
// 获取告知消息
|
||
this.information()
|
||
}
|
||
|
||
//投被同人取到年纪和性别去判断是是否显示内容
|
||
this.saleInsuredAge = utilsAge.getAge(this.saleInsuredInfo.birthday, new Date())
|
||
this.saleInsuredSex = this.saleInsuredInfo.sex
|
||
//投被不同人取到年纪和性别去判断是是否显示内容
|
||
this.saleInsuredPersonAge = this.saleInsuredPersonInfo.age ? this.saleInsuredPersonInfo.age : this.saleInsuredPersonInfo.insuredAge
|
||
this.saleInsuredPersonSex = this.saleInsuredPersonInfo.sex
|
||
} else {
|
||
this.$toast(res.resultMessage)
|
||
}
|
||
// })
|
||
// this.relationToAppnt = `1`
|
||
this.productCodes = JSON.parse(localStorage.chooseProductCodes)
|
||
this.isSpecificMedicalInsurance = this.productCodes && this.productCodes.includes('GFRS_M0045')
|
||
//this.information()
|
||
},
|
||
mounted() {
|
||
setTimeout(() => {
|
||
// eslint-disable-next-line no-undef
|
||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
|
||
intercept: '1' //是否拦截原生返回事件 1是 其他否
|
||
})
|
||
}, 100)
|
||
window.appCallBack = this.appCallBack
|
||
document.body.style.backgroundColor = '#F5F5F5'
|
||
if (!this.$route.query.edit) {
|
||
//如果不是编辑/导航条跳转进来的
|
||
localStorage.setItem('salePageFlag', this.salePageFlag)
|
||
} else if (this.$route.query.edit && !this.$route.query.salePageFlag) {
|
||
//如果从保单列表点击编辑按钮进入
|
||
this.salePageFlag = '5'
|
||
localStorage.setItem('salePageFlag', this.salePageFlag)
|
||
} else if (this.$route.query.salePageFlag) {
|
||
//如果是从导航栏点击进入
|
||
this.salePageFlag = localStorage.salePageFlag
|
||
}
|
||
},
|
||
methods: {
|
||
appCallBack(data) {
|
||
if (data.trigger == 'left_button_click') {
|
||
return this.$dialog
|
||
.confirm({
|
||
className: 'dialog-delete',
|
||
title: '提示',
|
||
message: '退出流程可能会丢失部分数据,是否确认退出?',
|
||
cancelButtonColor: '#E9332E',
|
||
confirmButtonColor: '#FFFFFF'
|
||
})
|
||
.then(() => {
|
||
this.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
title: '电子投保单列表',
|
||
forbidSwipeBack: 1, //当前页面禁止右滑返回
|
||
url: location.origin + `/#/sale/list`
|
||
},
|
||
routerInfo: {
|
||
path: `/sale/list`,
|
||
type: '1'
|
||
}
|
||
})
|
||
})
|
||
.catch(() => {
|
||
return
|
||
})
|
||
}
|
||
},
|
||
// 返回电子投保单列表
|
||
cancel(){
|
||
this.$toast.clear()
|
||
this.$dialog
|
||
.alert({
|
||
className: 'dialog-alert',
|
||
title: '提示',
|
||
message: '健康告知选择【部分为是】,不符合投保规则,您当前不能投保。',
|
||
confirmButtonColor: '#ee0a24',
|
||
confirmButtonText: '确认'
|
||
})
|
||
.then(() => {})
|
||
},
|
||
// 一键全否
|
||
allFalse() {
|
||
let that = this
|
||
that.impartDTOS.map(it => {
|
||
console.log('it', it.impartItemDTOS)
|
||
it.impartItemDTOS.map(itm => {
|
||
itm.impartAnswer = '1'
|
||
})
|
||
})
|
||
},
|
||
isShowList() {
|
||
let that = this
|
||
console.log(that.saleInsuredAge)
|
||
that.impartDTOS.map(item => {
|
||
if (item.impartType == 0 || item.impartType == 4) {
|
||
item.impartItemDTOS.map((items, index, array) => {
|
||
if (items.extra3) {
|
||
let obj = JSON.parse(items.extra3)
|
||
if (obj.age && obj.sex == '') {
|
||
array.splice(index, 1, '')
|
||
}
|
||
if (obj.age && obj.sex) {
|
||
//15题性别为男或者女并且小于14岁不显示
|
||
if (that.saleInsuredSex != obj.sex || (that.saleInsuredSex == obj.sex && that.saleInsuredAge < obj.age)) {
|
||
array.splice(index, 1, '')
|
||
}
|
||
}
|
||
}
|
||
})
|
||
}
|
||
if (item.impartType == 1 || item.impartType == 5) {
|
||
item.impartItemDTOS.map((items, index, array) => {
|
||
if (items.extra3) {
|
||
let obj = JSON.parse(items.extra3)
|
||
if (obj.age && obj.sex == '') {
|
||
//被保险人年纪大于2岁不显示该题
|
||
if (that.saleInsuredPersonAge > obj.age) {
|
||
array.splice(index, 1, '')
|
||
}
|
||
}
|
||
if (obj.age && obj.sex) {
|
||
if (that.saleInsuredPersonSex != obj.sex || (that.saleInsuredPersonSex == obj.sex && that.saleInsuredPersonAge < obj.age)) {
|
||
array.splice(index, 1, '')
|
||
}
|
||
}
|
||
}
|
||
})
|
||
}
|
||
// 被保险人财务告知添加判断
|
||
if (item.impartType == 3 || item.impartType == 7 || item.impartType == 11) {
|
||
item.impartItemDTOS.map(items => {
|
||
if (items.extra3) {
|
||
let obj = JSON.parse(items.extra3)
|
||
if (obj.age && obj.sex == '2') {
|
||
//小于18岁显示
|
||
if (that.saleInsuredPersonAge < Number(obj.age)) {
|
||
this.isShow = true
|
||
}
|
||
}
|
||
}
|
||
})
|
||
}
|
||
})
|
||
//去除数组里面的空字符串
|
||
that.impartDTOS.map(item => {
|
||
if (item.impartType == 0 || item.impartType == 4) {
|
||
let array = item.impartItemDTOS
|
||
for (var i = 0; i < array.length; i++) {
|
||
if (array[i] == '' || array[i] == null || typeof array[i] == undefined) {
|
||
array.splice(i, 1)
|
||
i = i - 1
|
||
}
|
||
}
|
||
}
|
||
if (item.impartType == 1 || item.impartType == 5) {
|
||
let array = item.impartItemDTOS
|
||
// eslint-disable-next-line no-redeclare
|
||
for (var i = 0; i < array.length; i++) {
|
||
if (array[i] == '' || array[i] == null || typeof array[i] == undefined) {
|
||
array.splice(i, 1)
|
||
i = i - 1
|
||
}
|
||
}
|
||
}
|
||
if (item.impartType == 13) {
|
||
// 特定疾病险 第一题 换行展示
|
||
item.impartItemDTOS.map(items => {
|
||
if (items.impartContent) {
|
||
items.impartContent = that.replaceNToBr(items.impartContent)
|
||
}
|
||
})
|
||
}
|
||
})
|
||
},
|
||
// 单选改变时候
|
||
change(item, val, impartCode, impartType) {
|
||
// console.log(item)
|
||
// console.log(val)
|
||
let that = this
|
||
if (val == '0') {
|
||
that.impartDTOS.map(it => {
|
||
it.impartItemDTOS.map(itm => {
|
||
if (item == itm.isSelect) {
|
||
// itm.isTrue = val
|
||
itm.show = true
|
||
}
|
||
})
|
||
})
|
||
// that.impartItemDTOS[item].show = true
|
||
} else {
|
||
that.impartDTOS.map(it => {
|
||
it.impartItemDTOS.map(itm => {
|
||
if (item == itm.isSelect) {
|
||
// itm.isTrue = val
|
||
itm.show = false
|
||
}
|
||
})
|
||
})
|
||
}
|
||
if (impartType == '3' || impartType == '7' || impartType == '11') {
|
||
if (impartCode == '2a') {
|
||
if (val == '0') {
|
||
this.showFlag = true
|
||
that.impartDTOS.map(it => {
|
||
it.impartItemDTOS.map(itm => {
|
||
if (itm.impartCode == '2b') {
|
||
itm.impartAnswer = '0'
|
||
}
|
||
})
|
||
})
|
||
} else {
|
||
this.showFlag = false
|
||
that.impartDTOS.map(it => {
|
||
it.impartItemDTOS.map(itm => {
|
||
if (itm.impartCode == '2b') {
|
||
itm.impartAnswer = '1'
|
||
}
|
||
})
|
||
})
|
||
}
|
||
}
|
||
}
|
||
},
|
||
formatDateTime() {
|
||
var date = new Date()
|
||
var y = date.getFullYear()
|
||
var m = date.getMonth() + 1
|
||
m = m < 10 ? '0' + m : m
|
||
var d = date.getDate()
|
||
d = d < 10 ? '0' + d : d
|
||
var h = date.getHours()
|
||
var minute = date.getMinutes()
|
||
var second = date.getSeconds()
|
||
return y + m + d + h + minute + second
|
||
},
|
||
// 获取告知消息,
|
||
async information() {
|
||
let that = this
|
||
let data = {
|
||
productCodes: JSON.parse(localStorage.chooseProductCodes),
|
||
// productCodes: ['GFRS_M0001'],
|
||
platform: 'app',
|
||
type: '2'
|
||
}
|
||
await information(data).then(res => {
|
||
// console.log(res)
|
||
if (res.result == '0') {
|
||
this.$toast.loading({
|
||
duration:0,
|
||
forbidClick:true,
|
||
loadingType:'spinner',
|
||
message:'加载中……'
|
||
})
|
||
res.productImpartLstDTO.impartDTOS.map(item => {
|
||
item.impartItemDTOS.map(im => {
|
||
im.isSelect =
|
||
this.formatDateTime() +
|
||
Math.random()
|
||
.toString(36)
|
||
.substr(2)
|
||
im.impartAnswer = ''
|
||
if (im.questions) {
|
||
if (im.questions.length == '0') {
|
||
let obj = {
|
||
answer: ''
|
||
}
|
||
im.questions.push(obj)
|
||
}
|
||
}
|
||
if (this.noRisk == false && im.extra4 == 'noRisk') {
|
||
this.noRisk = true
|
||
}
|
||
})
|
||
})
|
||
// 展示被保险人项产品 noRis为true
|
||
if (this.noRisk) {
|
||
res.productImpartLstDTO.impartDTOS.map((item, index, array) => {
|
||
if (item.impartType == '0') {
|
||
array.splice(index, 1)
|
||
}
|
||
if (item.impartType == '2') {
|
||
array.splice(index, 1)
|
||
}
|
||
})
|
||
}
|
||
if (this.relationToAppnt == '1') {
|
||
// 展示被保险人项产品 noRis为true 保障型:去除投保人告知,其他不变
|
||
if (this.noRisk) {
|
||
res.productImpartLstDTO.impartDTOS.map((item, index, array) => {
|
||
if (item.impartType == '0') {
|
||
array.splice(index, 1)
|
||
}
|
||
if (item.impartType == '2') {
|
||
array.splice(index, 1)
|
||
}
|
||
})
|
||
} else {
|
||
// 展示被保险人项产品 noRis为false 保障型、意外型:去除被保人告知,其他不变
|
||
res.productImpartLstDTO.impartDTOS.map((item, index, array) => {
|
||
if (item.impartType == '1' || item.impartType == '5') {
|
||
array.splice(index, 1)
|
||
}
|
||
})
|
||
res.productImpartLstDTO.impartDTOS.map((item, index, array) => {
|
||
if (item.impartType == '3' || item.impartType == '7') {
|
||
array.splice(index, 1)
|
||
}
|
||
})
|
||
}
|
||
|
||
that.impartDTOS = res.productImpartLstDTO.impartDTOS
|
||
that.isShowList()
|
||
//投被同人时候判断
|
||
that.impartDTOS.map((item, index) => {
|
||
that.activeNames.push(index+1)
|
||
})
|
||
} else {
|
||
that.impartDTOS = res.productImpartLstDTO.impartDTOS
|
||
that.isShowList()
|
||
//投被不同人时候判断
|
||
that.impartDTOS.map((item, index) => {
|
||
that.activeNames.push(index+1)
|
||
})
|
||
}
|
||
}
|
||
})
|
||
// 此处重新折叠面板,避免未展开的面板中 健康告知内容无法校验必选的问题
|
||
this.activeNames = [this.impartDTOS.length];
|
||
setTimeout(()=>{
|
||
this.$toast.clear()
|
||
},800)
|
||
},
|
||
// 下一步
|
||
next() {
|
||
let that = this
|
||
that.$validator.validate().then(valid => {
|
||
if (valid) {
|
||
let obj = {}
|
||
let objInsured = {}
|
||
let financeImpartDTO = {}
|
||
let financeImpart = {}
|
||
let jobImpartDTO = {} //
|
||
let jobImpart = {} //
|
||
// let arr = []
|
||
that.impartDTOS.map(item => {
|
||
// 投保人健康告知
|
||
if (item.impartType == '0' || item.impartType == '4' || item.impartType == '8') {
|
||
item.impartItemDTOS.map(i => {
|
||
delete i.isSelect
|
||
delete i.show
|
||
})
|
||
obj = item
|
||
return obj
|
||
} else if (item.impartType == '2' || item.impartType == '6' || item.impartType == '10') {
|
||
// 投保人财富
|
||
item.impartItemDTOS.map(i => {
|
||
delete i.isSelect
|
||
delete i.show
|
||
})
|
||
// console.log(item.impartType)
|
||
financeImpartDTO = item
|
||
return financeImpartDTO
|
||
} else if (item.impartType == '1' || item.impartType == '5' || item.impartType == '9') {
|
||
// 被保险人健康
|
||
item.impartItemDTOS.map(i => {
|
||
delete i.isSelect
|
||
delete i.show
|
||
// if (i.impartCode == '14a') {
|
||
// i.questions.map(items => {
|
||
// items.questionType = '4'
|
||
// })
|
||
// }
|
||
})
|
||
objInsured = item
|
||
return objInsured
|
||
} else if (item.impartType == '3' || item.impartType == '7' || item.impartType == '11') {
|
||
// 被保险人财富
|
||
item.impartItemDTOS.map(i => {
|
||
delete i.isSelect
|
||
delete i.show
|
||
})
|
||
financeImpart = item
|
||
return financeImpart
|
||
} else if (item.impartType == '13') {
|
||
//特定疾病险 答案全否 换行符转换
|
||
item.impartItemDTOS.map(i => {
|
||
i.impartContent = that.replaceBrToNull(i.impartContent)
|
||
i.impartAnswer = '1'
|
||
})
|
||
objInsured = item
|
||
return objInsured
|
||
}else if ([14,15,16,17].includes(Number(item.impartType))){
|
||
item.impartItemDTOS.map(i => {
|
||
delete i.isSelect
|
||
delete i.show
|
||
})
|
||
return jobImpart = item
|
||
}else if ([18,19,20,21].includes(Number(item.impartType))){
|
||
item.impartItemDTOS.map(i => {
|
||
delete i.isSelect
|
||
delete i.show
|
||
})
|
||
return jobImpartDTO = item
|
||
}
|
||
})
|
||
console.log('zhenja',financeImpartDTO == {},financeImpartDTO == {})
|
||
if (financeImpartDTO == {}) {
|
||
let data = {
|
||
orderType: 'IMPART_ORDER',
|
||
orderDTO: {
|
||
orderInfoDTO: {
|
||
orderNo: this.$route.query.orderNo,
|
||
productCode: JSON.parse(localStorage.mainRiskCodes)[0]
|
||
},
|
||
|
||
// 投保人
|
||
appntDTO: {
|
||
impartDTO: obj
|
||
},
|
||
// 被保险人
|
||
insuredDTOs: [{ impartDTO: objInsured, financeImpartDTO: financeImpart }]
|
||
}
|
||
}
|
||
saveInformation(data).then(res => {
|
||
if (res.result == '0') {
|
||
localStorage.removeItem('changeCard')
|
||
if (!this.$route.query.salePageFlag) {
|
||
//不是从导航栏进入
|
||
localStorage.salePageFlag = '6'
|
||
}
|
||
if(this.isShowEvaluationPoint == '0'){
|
||
if(this.isUniversalRiskNotifyShowPoint == '1'){
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}else{
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/accountInformation?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/accountInformation?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}
|
||
}
|
||
// else {
|
||
// console.log('jinrule')
|
||
// that.$jump({
|
||
// flag: 'h5',
|
||
// extra: {
|
||
// url: location.origin + '/#/sale/answerPage?orderNo=' + this.$route.query.orderNo,
|
||
// },
|
||
// routerInfo: {
|
||
// path: '/sale/answerPage?orderNo=' + this.$route.query.orderNo
|
||
// }
|
||
// })
|
||
// }
|
||
|
||
// that.$jump({
|
||
// flag: 'h5',
|
||
// extra: {
|
||
// url: location.origin + '/#/sale/accountInformation',
|
||
// },
|
||
// routerInfo: {
|
||
// path: '/sale/accountInformation'
|
||
// }
|
||
// })
|
||
} else {
|
||
this.$toast(res.resultMessage)
|
||
}
|
||
})
|
||
}
|
||
else if (financeImpart == {}) {
|
||
let data = {
|
||
orderType: 'IMPART_ORDER',
|
||
orderDTO: {
|
||
orderInfoDTO: {
|
||
orderNo: this.$route.query.orderNo,
|
||
productCode: JSON.parse(localStorage.mainRiskCodes)[0]
|
||
},
|
||
|
||
// 投保人
|
||
appntDTO: {
|
||
impartDTO: obj,
|
||
financeImpartDTO: financeImpartDTO
|
||
},
|
||
// 被保险人
|
||
insuredDTOs: [{ impartDTO: objInsured }]
|
||
}
|
||
}
|
||
saveInformation(data).then(res => {
|
||
if (res.result == '0') {
|
||
localStorage.removeItem('changeCard')
|
||
if(this.isUniversalRiskNotifyShowPoint == '1'){
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}else{
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/AccountInformation?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/AccountInformation?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}
|
||
} else {
|
||
this.$toast(res.resultMessage)
|
||
}
|
||
})
|
||
}
|
||
else if(financeImpart == {}){
|
||
let data = {
|
||
orderType: 'IMPART_ORDER',
|
||
orderDTO: {
|
||
orderInfoDTO: {
|
||
orderNo: this.$route.query.orderNo,
|
||
productCode: JSON.parse(localStorage.mainRiskCodes)[0]
|
||
},
|
||
|
||
// 投保人
|
||
appntDTO: {
|
||
impartDTO: obj,
|
||
jobImpartDTO: jobImpartDTO
|
||
},
|
||
// 被保险人
|
||
insuredDTOs: [{ impartDTO: objInsured }]
|
||
}
|
||
}
|
||
saveInformation(data).then(res => {
|
||
if (res.result == '0') {
|
||
localStorage.removeItem('changeCard')
|
||
if(this.isUniversalRiskNotifyShowPoint == '1'){
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}else{
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/AccountInformation',
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/AccountInformation'
|
||
}
|
||
})
|
||
}
|
||
} else {
|
||
this.$toast(res.resultMessage)
|
||
}
|
||
})
|
||
}
|
||
else {
|
||
let data = {
|
||
orderType: 'IMPART_ORDER',
|
||
orderDTO: {
|
||
orderInfoDTO: {
|
||
orderNo: this.$route.query.orderNo,
|
||
productCode: JSON.parse(localStorage.mainRiskCodes)[0]
|
||
},
|
||
|
||
// 投保人
|
||
appntDTO: {
|
||
impartDTO: obj,
|
||
financeImpartDTO: financeImpartDTO,
|
||
jobImpartDTO: jobImpartDTO
|
||
},
|
||
// 被保险人
|
||
insuredDTOs: [{ impartDTO: objInsured, financeImpartDTO: financeImpart,jobImpartDTO: jobImpart }]
|
||
}
|
||
}
|
||
saveInformation(data).then(res => {
|
||
if (res.result == '0') {
|
||
localStorage.removeItem('changeCard')
|
||
if(this.isShowEvaluationPoint == '0'){
|
||
if(this.isUniversalRiskNotifyShowPoint == '1'){
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/universalRiskNotifyingMessage?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}else{
|
||
that.$jump({
|
||
flag: 'h5',
|
||
extra: {
|
||
url: location.origin + '/#/sale/accountInformation?orderNo=' + this.$route.query.orderNo,
|
||
},
|
||
routerInfo: {
|
||
path: '/sale/accountInformation?orderNo=' + this.$route.query.orderNo
|
||
}
|
||
})
|
||
}
|
||
}
|
||
// else {
|
||
// that.$jump({
|
||
// flag: 'h5',
|
||
// extra: {
|
||
// url: location.origin + '/#/sale/accountInformation?orderNo=' + this.$route.query.orderNo,
|
||
// },
|
||
// routerInfo: {
|
||
// path: '/sale/accountInformation?orderNo=' + this.$route.query.orderNo
|
||
// }
|
||
// })
|
||
// }
|
||
} else {
|
||
this.$toast(res.resultMessage)
|
||
}
|
||
})
|
||
}
|
||
} else {
|
||
this.$toast(this.$validator.errors.all()[0])
|
||
}
|
||
})
|
||
},
|
||
replaceNToBr(str){
|
||
if(str!=null) str = str.replace(/\n/g,"<br/>")
|
||
return str;
|
||
},
|
||
replaceBrToNull(str){
|
||
if(str!=null) str = str.replace(/<br\/>/g,"\n")
|
||
return str;
|
||
}
|
||
},
|
||
|
||
beforeRouteLeave(to, from, next) {
|
||
document.body.style.backgroundColor = ''
|
||
next()
|
||
},
|
||
components: {
|
||
[Collapse.name]: Collapse,
|
||
[CollapseItem.name]: CollapseItem,
|
||
[RadioGroup.name]: RadioGroup,
|
||
[Radio.name]: Radio,
|
||
[Field.name]: Field,
|
||
[CellGroup.name]: CellGroup,
|
||
[Icon.name]: Icon,
|
||
[IndexBar.name]: IndexBar
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
@import '@/assets/sass/variables.scss';
|
||
|
||
.notifyingMessage-text {
|
||
background: rgba(236, 249, 255, 1);
|
||
span {
|
||
color: #4a90e2;
|
||
}
|
||
}
|
||
/deep/ .van-field__label {
|
||
width: 38%;
|
||
}
|
||
/deep/ .van-cell__value {
|
||
margin-left: 20px;
|
||
}
|
||
/deep/.van-collapse-item__content {
|
||
padding: 0;
|
||
}
|
||
/deep/ .special .van-hairline--top-bottom:first-child::after {
|
||
border: none;
|
||
}
|
||
.allFalse {
|
||
/*position: fixed;*/
|
||
overflow: hidden;
|
||
z-index: 10;
|
||
width: 100%;
|
||
}
|
||
/*.content-all-info {*/
|
||
/* padding-top: 153px;*/
|
||
/*}*/
|
||
/*.content-all-info2 {*/
|
||
/* padding-top: 90px;*/
|
||
/*}*/
|
||
.pb5{
|
||
padding-bottom: 5px;
|
||
}
|
||
</style>
|