【自保件需求】--- 增加签署承诺书

This commit is contained in:
dwq
2021-09-03 18:20:19 +08:00
parent 03f8920c7f
commit 3dd9b175de
2 changed files with 917 additions and 7 deletions

View File

@@ -21,6 +21,47 @@
</van-cell-group>
<div v-if="!isWeixin">
<!-- 不再微信 -->
<van-collapse v-model="activeNames" class="mt10">
<van-collapse-item name="0">
<div slot="title">
代理人
<span class="ml20">{{ recmd.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<div v-if="changeCard">
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ agentSign.documentName }}</span>
<img :src="src" v-if="agentSign.documentStatus == '1'" />
</p>
</div>
<div v-else>
<div v-for="(item, index) in agentSign" :key="index">
<p>{{ item.documentCode == '1' || item.documentCode == '8' || item.documentCode == '9' ? '需阅读' : '需签署' }}</p>
<p class="mb20">
<span class="text">{{ item.documentName }}</span>
<img :src="src" v-if="(item.documentCode == '1' || item.documentCode == '8' || item.documentCode == '9') && item.documentStatus == '1'" />
<img :src="src" v-if="!(item.documentCode == '1' || item.documentCode == '8' || item.documentCode == '9') && item.documentStatus == '3'" />
</p>
</div>
</div>
<p class="start" v-if="airSign != '1'">点击开始进行相关操作</p>
<div v-if="!isInvalid" class="flex justify-content-a mt20">
<van-button
type="danger"
size="normal"
class="w150"
plain
:disabled="changeCard ? agentSign.documentStatus == '1' : agentSignStatus == '3'"
v-no-more-click="1000"
@click="start_agent('3')"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
<van-collapse v-model="activeNames" class="mt10">
<van-collapse-item name="1">
<div slot="title">
@@ -313,10 +354,12 @@ export default {
insured: [],
// 投保人签名阅读信息
appntSign: [],
//代理人签名阅读信息
agentSign: [],
// 被保险人签名阅读信息
insuredSign: [],
// 折叠面板
activeNames: ['1', '2'],
activeNames: ['0','1', '2'],
// 图片路径
src: this.$assetsUrl + 'images/u6490.png',
// 被保险人信息
@@ -335,7 +378,7 @@ export default {
signInvalid: '',
// 微信分享链接是否失效 false 为未失效 true为已失效
isInvalid: false,
// 是谁分享的微信链接 1为被保险人 0或2为投保人
// 是谁分享的微信链接 1为被保险人 0或2为投保人 3代理人
shareCode: '',
// 是否从空签成功跳转过来 1为是 其他为不是
airSign: '',
@@ -354,6 +397,7 @@ export default {
// },
appntSignStatus: '', //投保人电子签名状态
insuredSignStatus: '', //被保险人电子签名状态
agentSignStatus:'', //代理人电子签名状态
changeCard: localStorage.changeCard,
salePageFlag: '-10',
recognizeResult: '', //微信端-人脸识别结果
@@ -501,7 +545,10 @@ export default {
if (sessionStorage.shareCode == '1') {
console.log('进来被保险人')
this.tipsName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
} else {
} else if(sessionStorage.shareCode == '3'){
console.log('进来代理人')
this.tipsName =this.recmd.name
}else {
console.log('进来投保人')
this.tipsName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
// console.log('localStorage.saleInsuredInfo', localStorage.saleInsuredInfo)
@@ -1190,7 +1237,10 @@ export default {
let shareName = ''
if (code == '1') {
shareName = '被保险人'
} else {
} else if(code == '3'){
shareName = '代理人'
}
else {
shareName = '投保人'
}
console.log('`````````````测试安卓url`````````````````')
@@ -1531,7 +1581,10 @@ export default {
that.appntSign = item //投保
}
}
} else {
} else if(item.signType == '3'){
that.agentSign.push(item)//代理人
that.addKey(item)
}else {
that.insuredSign.push(item) //被保
}
})
@@ -1555,6 +1608,11 @@ export default {
that.insuredSignStatus = item.documentStatus
}
})
that.agentSign.map((item) => {
if (item.documentCode == '10') {
that.agentSignStatus = item.documentStatus
}
})
}
resolve('success')
}
@@ -1563,7 +1621,7 @@ export default {
},
//自定义key值排序用
addKey(item) {
//ducumentCode 1投保须知 2投保单 3产品说明书 4提示书 6免除保险人责任条款说明书 7保险销售行为双录说明 8指定保单生效日 9短期险投保须知
//ducumentCode 1投保须知 2投保单 3产品说明书 4提示书 6免除保险人责任条款说明书 7保险销售行为双录说明 8指定保单生效日 9短期险投保须知 10国富人寿自保件承诺书
if (item.documentCode == '1') {
item.key = 2
item.routePath = 'insuranceInformation'
@@ -1588,6 +1646,9 @@ export default {
} else if (item.documentCode == '9') {
item.key = 3
item.routePath = 'shortPeriodProduct'
}else if (item.documentCode == '10') {
item.key = 1
item.routePath = 'commitmentSelfProtect'
}
},
getSignInvalid() {
@@ -1755,8 +1816,53 @@ export default {
saveCustomerRid(param).then((res) => {
console.log('saveCustomerRid', res)
})
}
},
//代理人签署 跳过人脸识别
async start_agent(val) {
// val 0投保人 1被保险人 2本人 3代理人
console.log(val)
let that = this
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-agent', JSON.stringify(that.agentSign))
that.agentUrl()
},
agentUrl() {
let that = this
let path = ''
console.log('that.agentSign 1 ==', that.agentSign)
if (that.changeCard) {
path = 'insuranceInformation'
} else {
console.log('that.agentSign.length ==', that.agentSign.length, typeof that.agentSign.length)
for (let i = 0; i < that.agentSign.length; i++) {
if ((that.agentSign[i].documentCode == '1' || that.agentSign[i].documentCode == '8' || that.agentSign[i].documentCode == '9') && that.agentSign[i].documentStatus == 0) {
//1投保须知 未读
path = that.agentSign[i].routePath
break
} else {
if (that.agentSign[i].documentStatus == 2) {
path = that.agentSign[i].routePath
break
}
}
}
}
console.log('跳转页面path', path)
if (path)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/' + path
},
routerInfo: {
path: '/sale/' + path
}
})
},
},
created() {
setTimeout(() => {
// eslint-disable-next-line no-undef

View File

@@ -0,0 +1,804 @@
<template>
<div class="redRadioCheckbox">
<div class="pb60" v-if="detailJump == '1'">
<!-- config.imgDomain + `/returnDirectStream?imgPath=${window.localStorage.getItem('insurance-policyUrl')}` -->
<iframe :src="src + pdfUrl" class="iframe"></iframe>
<van-radio-group v-model="radioSure" class="pb10 pt20 pl5 fs14">
<van-radio name="1">
我已充分了解上述提示内容并同意通过电子方式签收
</van-radio>
</van-radio-group>
<!-- <div id="pdf"></div>-->
<!-- <img :src="'data:image/jpeg;base64,' + url" /> -->
<!-- 我已充分了解上述提示内容并同意通过电子方式签收 -->
<div class="pt30 pl30 flex align-items-c">
<span class="mr10">本人签名 :</span>
<div>
<!-- <van-button type="danger" size="small" @click="chaolu('0')" v-no-more-click="1000">抄录</van-button> -->
<van-button type="danger" size="small" @click="sign('3')" :disabled="isSure" v-no-more-click="1000">{{ isSign ? '签名' : '已签名' }}</van-button>
</div>
</div>
</div>
<div class="pb60" v-else>
<van-notice-bar :scrollable="false" v-if="!Time" class="notice">{{ `提示阅读时长需在${this.Time ? this.time : this.number}秒以上` }}</van-notice-bar>
<iframe :src="src + pdfUrl" class="iframe"></iframe>
<!-- <img :src="'data:image/jpeg;base64,' + url" /> -->
<!-- <van-radio-group v-model="radio" class="pb10 pt20 pl30 fs14" v-if="!dayShow && chooseProductCodes[0] == 'GFRS_M0011'">
<van-radio name="1" @click="click" class="ml-25 pl10 pr10">
本人确认已阅读
<span>{{ `${pdfName}并指定本保险合同生效日为2020年1月1日` }}</span>
</van-radio>
</van-radio-group> -->
<van-radio-group v-model="radio" class="pb10 pt20 pl30 fs14">
<van-radio name="1" @click="click">
本人确认已阅读
<span>{{ `${pdfName}` }}</span>
</van-radio>
</van-radio-group>
<div class="pt20 pl30 flex align-items-c">
<span class="mr10">本人签名 :</span>
<div v-if="signVal == '3'">
<div >
<van-button type="danger" size="small" :disabled="signVal == '3' ? true : isDisable" @click="sign('3')" v-no-more-click="1000">{{
agentSign.documentStatus == '2' ? '签名' : '已签名'
}}</van-button>
</div>
</div>
</div>
</div>
<van-dialog v-model="show" title="提示" show-cancel-button @confirm="authConfirm(authCode)" @cancel="clearTimer">
<p class="p10 fs14">为确保是您本人操作短信验证码已发送至您手机号{{ encyCustomerMobile }}请您输入验证码以完成后续投保操作</p>
<van-cell-group class="flex align-items-c pr5 mb15">
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="authCode" clearable label-width="0" />
<van-button type="danger" plain size="small" class="w160 p0" @click="getAuthCode" :disabled="codeDisabled" v-no-more-click="2000">{{
codeDisabled ? `${countDown}s后重新获取` : '获取验证码'
}}</van-button>
</van-cell-group>
</van-dialog>
<div class="bottom-btn bg-white" v-if="detailJump == '1'">
<van-button type="danger" size="large" @click="submit" :disabled="isSubmit" v-no-more-click="1000">提交</van-button>
</div>
<div class="bottom-btn bg-white" v-else>
<van-button type="danger" size="large" @click="next" :disabled="isDisabledComplite" v-no-more-click="1000">完成</van-button>
</div>
</div>
</template>
<script>
import { RadioGroup, Radio, Dialog, NoticeBar, Cell, CellGroup, Button, Field } from 'vant'
import { getAuthCode, autchCodeCheck, getOrderDetail, saveInformation, submit } from '@/api/ebiz/sale/sale'
import { checkPhone } from '@/api/ebiz/customer/customer'
import config from '@/config'
export default {
data() {
let isWeixin = this.$utils.device().isWeixin //判断环境
return {
show: false, // 获取短信验证码
codeDisabled: false, // 获取验证码按钮是否禁用
timeId: null, // 计时器ID
countDown: 60, // 倒计时
authCode: '', // 验证码
pdfh5: null,
encyCustomerMobile:'',
pdfUrl: '',
// policyUrl: '',
src: location.origin + '/pdfjs/web/viewer.html?file=',
radio: '',
// 回执签收的radio
radioSure: '',
// 倒计时时间
number: '',
// // 定时器时间
time: '10',
// // 定时器名称
timer: null,
isOver: false,
// 判断验证码是否开始倒计时
Time: true,
// 按钮是否可以点击
isDisable: true,
// 被保险人是否可以点击
isDisableInsured: true,
// 投保人签名阅读信息
appntSign: {},
// 被保险人签名阅读信息
insuredSign: {},
// 代理人签名阅读信息
agentSign:{},
// 是投保人还是被保险人 0 投保人 1被保险人 2 投被同人
signVal: '',
// CA签字位置
caOffset: '-150', // 投保人签名位置
// 图片路径
url: '',
// sign加密码
base64: '',
// 是否可以点击
isDisabledComplite: true,
// local带来的被保险人信息
saleInsuredPersonInfo: {},
// local带来的投保人信息
saleInsuredInfo: {},
// 投被保险人是否同人 1为投被同人其他为不是
relationToAppnt: '',
// 是否在微信
isWeixin,
// 是否可以点击提交
isSubmit: true,
// 是否签名了 回执流程
isSign: true,
// 是否从详情跳过来 如果为1 是
detailJump: '',
// 是否是万能险
isComment: false,
// 判断回执里面签名是否可以点击
isSure: true,
// 判断时间展示不同pdf勾选不同话术
// dayShow: false,
// // 产品编码
// chooseProductCodes: '',
// pdf名字
pdfName: ''
}
},
components: {
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio,
[Dialog.name]: Dialog,
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Button.name]: Button,
[Field.name]: Field,
[NoticeBar.name]: NoticeBar
},
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
})
}
},
// 获取短信验证码
getAuthCode() {
this.codeDisabled = true
//倒计时
this.timeId = setInterval(() => {
this.countDown--
if (this.countDown <= 0) {
window.clearInterval(this.timeId)
this.codeDisabled = false
this.countDown = 60
}
}, 1000)
getAuthCode({
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.customerMobile,
system: 'agentApp',
operateCodeType: '0'
}).then(res => {
console.log(res)
if (res.result == 0) {
this.sid = res.sessionId
} else {
this.$toast(res.resultMessage)
}
})
},
// 验证码确认事件
async authConfirm() {
//清理计时器
this.clearTimer()
this.changeSubmit()
},
// 清理计时器
clearTimer() {
window.clearInterval(this.timeId)
this.timeId = null
this.countDown = 60
this.codeDisabled = false
},
//提交变更申请
async changeSubmit() {
if (null == this.sid) {
this.$toast('请先进行发送短信验证码')
return
}
let res = await autchCodeCheck({
smsId: this.sid,
code: this.authCode
})
if (res.result == 0) {
this.submit4detail()
} else {
this.$toast(res.resultMessage)
}
},
timeOut() {
let that = this
let time = that.time
that.Time = false
that.number = `${time}`
let timer = setInterval(() => {
time--
if (time <= 0) {
time = 0
clearInterval(timer)
that.Time = true
that.isOver = true
}
that.number = `${time}`
}, 1000)
},
// 获取签名状态
getOrderDetail() {
let that = this
let data = {
orderNo: window.localStorage.getItem('orderNo')
}
return new Promise((resolve, reject) => {
getOrderDetail(data).then(res => {
if (res.result == '0') {
res.orderDTO.ebizSignDTOS.map(item => {
if (item.documentCode == '2') {
this.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${item.policyUrl}`)
this.pdfName = item.documentName
if (item.signType == '0') {
that.appntSign = item
// this.policyUrl = item.policyUrl
} else if (item.signType == '1') {
that.insuredSign = item
}else if (item.signType == '3') {
that.agentSign = item
}
else {
that.appntSign = item
}
}
})
if (that.isWeixin) {
if (res.orderDTO.ebizSignDTOS.length > 1) {
if (that.agentSign.documentStatus == '3') {
that.isDisabledComplite = false
}
}
}
resolve('success')
}
})
})
},
// 单选框
click() {
let that = this
if (that.isOver == false) {
Dialog.confirm({
title: '提示',
message: '该内容涉及您的重大权益,请您仔细阅读',
showCancelButton: false
}).then(() => {
that.radio = ''
})
}
},
submit(){
if(this.detailJump == '1'){
this.submit4detailJump()
}else{
this.submit4detail()
}
},
submit4detailJump(){
// 如果是回执签收
// 则短信验证
this.customerMobile = this.saleInsuredInfo.mobile
this.encyCustomerMobile = this.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
this.authCode = null
this.show = true
},
// 点击提交
submit4detail() {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
contNo: window.localStorage.getItem('contNo'),
baseEncryp: this.base64,
pdfAddresss: window.localStorage.getItem('insurance-policyUrl'),
orderNo: localStorage.orderNo
}
submit(data).then(res => {
if (res.reslut == '0') {
this.$toast.clear()
window.localStorage.setItem('submitStatus', res.result)
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/serve/result',
backToFirst: '1'
},
routerInfo: {
path: '/serve/result'
}
})
} else {
window.localStorage.setItem('submitStatus', res.result)
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/serve/result',
backToFirst: '1'
},
routerInfo: {
path: '/serve/result'
}
})
}
})
},
// 点击完成
next() {
let that = this
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
if (that.signVal == '3' ) {
let data = {
orderType: 'SIGN_ORDER',
orderDTO: {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
},
ebizSignDTOS: [
{
signOrRead: 'sign',
signId: that.agentSign.signId,
orderNo: window.localStorage.getItem('orderNo'),
documentStatus: '3',
signType: that.signVal,
baseEncryp: that.base64,
documentType: that.agentSign.documentType,
documentCode: that.agentSign.documentCode
}
]
}
}
saveInformation(data).then(res => {
if (res.result == '0') {
this.$toast.clear()
window.localStorage.setItem('jumpFromSign', '1')
if (this.isWeixin) {
localStorage.removeItem('signInfo')
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/signatureConfirmation',
pullRefresh: '1',
backToFirst: '1'
},
routerInfo: {
path:
'/sale/signatureConfirmation?orderNo=' +
localStorage.orderNo +
'&token=' +
localStorage.token +
'&saleInsuredInfo=' +
this.$CacheUtils.getLocItem('saleInsuredInfo') +
'&saleInsuredPersonInfo=' +
this.$CacheUtils.getLocItem('saleInsuredPersonInfo') +
'&relationToAppnt=' +
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt +
'&attachmentShow=' +
window.localStorage.getItem('attachmentShow') +
'&signInvalid=' +
sessionStorage.getItem('signInvalid') +
'&airSign=1'
}
})
} else {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/signatureConfirmation',
pullRefresh: '1',
backToFirst: '1'
},
routerInfo: {
path: '/sale/signatureConfirmation'
}
})
}
} else {
that.$toast(res.resultMessage)
}
})
}
},
// 点击签名
sign(val) {
console.log(val, 'val值')
let that = this
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
// 代理人
if (val == '3') {
// 代理人且
if (this.detailJump != '1') {
// 代理人在微信
if (this.isWeixin) {
this.toAirSign('0', '申请日期', this.caOffset, '4')
} else {
// 代理人不在微信
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
number: this.saleInsuredInfo.idNo,
//姓名
name: this.saleInsuredInfo.name,
type: this.saleInsuredInfo.idType,
keyword: '申请日期',
pageNo: '1',
index: '1',
offset: this.caOffset,
pos: '3', //设置偏移量 3表示右侧
signatureWidth: this.$utils.signParams().signatureWidth,
signatureHeight: this.$utils.signParams().signatureHeight
}).then(data => {
let temp = JSON.parse(data)
// console.log(`--签名返回val:${val},this.detailJump:${this.detailJump},this.relationToAppnt:${this.relationToAppnt},CA_state:${temp.state}`)
this.$toast.clear()
if (JSON.parse(data).state == '1') {
this.base64 = decodeURI(JSON.parse(data).sign)
this.agentSign.documentStatus = '3'
this.isDisabledComplite = false
this.isSubmit = false
this.isSign = false
}
})
}
} else {
switch (that.saleInsuredInfo.idType) {
case '居民身份证':
that.saleInsuredInfo.idType = '1'
break
case '户口本':
that.saleInsuredInfo.idType = '2'
break
case '出生证':
that.saleInsuredInfo.idType = '3'
break
case '外国人护照':
that.saleInsuredInfo.idType = '4'
break
case '港澳居民来往内地通行证':
that.saleInsuredInfo.idType = '5'
break
case '台湾居民来往大陆通行证':
that.saleInsuredInfo.idType = '6'
break
// case '其他':
// that.saleInsuredInfo.idType = '7'
// break
case '外国人永久居留身份证':
that.saleInsuredInfo.idType = '8'
break
case '港澳台居民居住证':
that.saleInsuredInfo.idType = '9'
break
}
// 微信投保人且是回执签收
if (this.isWeixin) {
this.toAirSign('0', '代理人签字', '0', '4')
} else {
// 不是微信投保人且是回执签收
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
number: that.saleInsuredInfo.idNo,
//姓名
name: that.saleInsuredInfo.name,
type: that.saleInsuredInfo.idType,
keyword: '代理人签字',
pageNo: '1',
index: '1',
offset: '20',
pos: '3',
signatureWidth: this.$utils.signParams().signatureWidth,
signatureHeight: this.$utils.signParams().signatureHeight
}).then(data => {
// console.log(`--签名返回val:${val},this.detailJump:${this.detailJump},this.relationToAppnt:${this.relationToAppnt}`, JSON.stringify(data))
this.$toast.clear()
if (JSON.parse(data).state == '1') {
that.base64 = decodeURI(JSON.parse(data).sign)
that.agentSign.documentStatus = '3'
that.isDisabledComplite = false
that.isSubmit = false
that.isSign = false
}
})
}
}
}
},
toAirSign(status, keyword, offset, originStatus) {
localStorage.setItem(
'signInfo',
JSON.stringify({
originStatus: originStatus,
idNo: this.saleInsuredInfo.idNo,
name: this.saleInsuredInfo.name,
type: this.saleInsuredInfo.idType,
keyword: keyword,
status: status,
offset: offset,
originUrl: location.href
})
)
window.location.href = this.$mainUrl + '/sign/index.html'
},
},
async created() {
if (!this.isWeixin) {
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
}
let that = this
// 获取当前时间的时间戳
// var day2 = new Date()
// var day = day2.setTime(day2.getTime())
// console.log(day)
// console.log(new Date('2020-01-01 23:59:59').getTime())
// if (day > new Date('2020-01-01 23:59:59').getTime()) {
// this.dayShow = true
// }
// 获取产品编码
// this.chooseProductCodes = JSON.parse(localStorage.chooseProductCodes)
that.detailJump = window.localStorage.getItem('detailJump')
if (this.detailJump == '1') {
this.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${localStorage.getItem('insurance-policyUrl')}`)
}
that.signVal = window.localStorage.getItem('sign-val')
// 判断是不是万能险
let comment = window.localStorage.getItem('productCode')
// if (comment == 'GFRS_M0003') {
if (comment == 'GFRS_M0003' || comment == 'GFRS_M0015' || comment == 'GFRS_M0017') {
this.isComment = true
}
// 获取投保人信息
that.saleInsuredInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
// 在微信
if (this.isWeixin) {
// 在微信且不是回执签收
if (this.detailJump != '1') {
that.relationToAppnt = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt
let imgBase64Data = sessionStorage.getItem('imgBase64Data')
let wxSigned = sessionStorage.getItem('wxSigned')
let signInfo = JSON.parse(localStorage.getItem('signInfo'))
console.log('`````````````````````````````````')
console.log('imgBase64Data:twoimgBase64Data ' + imgBase64Data)
console.log('wxSigned: ' + wxSigned)
if (wxSigned) {
console.log('第二次进入电子保单!')
console.log('that222222222222', that)
this.getOrderDetail().then(() => {
this.Time = true
this.isOver = true
this.radio = '1'
this.base64 = imgBase64Data
this.isDisabledComplite = false
console.log('signInfo.status:' + signInfo.status)
if (signInfo.status == '0') {
// this.appntSign.documentStatus = '3'
console.log('``````````````````')
this.$set(this.appntSign, 'documentStatus', '3')
console.log('appntSign.documentStatus: ' + this.appntSign.documentStatus)
this.isSign = false
this.isDisabledComplite = false
// this.isDisable = false
} else {
this.$set(this.insuredSign, 'documentStatus', '3')
// this.insuredSign.documentStatus = '3'
this.isDisabledComplite = false
this.isSign = false
}
})
} else {
console.log('````````````````````````')
console.log('第一次进入电子保单')
this.timeOut()
this.getOrderDetail()
}
} else {
// 在微信而且是回执签收
document.title = '保险合同签收回执电子确认书签名'
let imgBase64Data = sessionStorage.getItem('imgBase64Data')
let wxSigned = sessionStorage.getItem('wxSigned')
let signInfo = JSON.parse(localStorage.getItem('signInfo'))
console.log('`````````````````````````````````')
console.log('imgBase64Data:twoimgBase64Data ' + imgBase64Data)
console.log('wxSigned: ' + wxSigned)
if (wxSigned) {
console.log('第二次进入电子保单!')
console.log('that222222222222', that)
this.Time = true
this.isOver = true
this.radioSure = '1'
this.base64 = imgBase64Data
this.isDisabledComplite = false
console.log('signInfo.status:' + signInfo.status)
if (signInfo.status == '0') {
// this.appntSign.documentStatus = '3'
console.log('``````````````````')
this.$set(this.appntSign, 'documentStatus', '3')
console.log('appntSign.documentStatus: ' + this.appntSign.documentStatus)
this.isSign = false
this.isDisabledComplite = false
this.isSubmit = false
} else {
this.$set(this.insuredSign, 'documentStatus', '3')
// this.insuredSign.documentStatus = '3'
this.isDisabledComplite = false
this.isSign = false
}
}
}
} else {
// 不在微信且不是回执签收
if (this.detailJump != '1') {
// 投被保险人是否同人
that.relationToAppnt = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt
// 获取被保险人信息
that.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
this.timeOut()
this.getOrderDetail()
} else {
// 不在微信但是在回执签收
document.title = '保险合同签收回执电子确认书签名'
}
}
},
computed: {
listenChange() {
const { isOver, radio, appntSign, insuredSign, radioSure } = this
return { isOver, radio, appntSign, insuredSign, radioSure }
}
},
watch: {
listenChange(val) {
let that = this
if (!that.isWeixin) {
if (that.signVal == '3' ) {
if (val.isOver == true && val.radio != '' && val.appntSign.documentStatus !== '3') {
that.isDisable = false
} else {
that.isDisable = true
}
} else {
if (val.isOver == true && val.radio != '' && val.insuredSign.documentStatus !== '3') {
that.isDisableInsured = false
} else {
that.isDisableInsured = true
}
}
if (val.appntSign.documentStatus == '3' && val.insuredSign.documentStatus == '3') {
that.isDisabledComplite = false
} else {
that.isDisabledComplite = true
}
if (val.appntSign.documentStatus == '3') {
that.isDisable = true
}
if (val.insuredSign.documentStatus == '3') {
that.isDisableInsured = true
}
if (val.radioSure != '') {
this.isSure = false
}
} else {
if (that.signVal == '3' ) {
if (val.isOver == true && val.radio != '') {
that.isDisable = false
} else {
that.isDisable = true
}
} else {
if (val.isOver == true && val.radio != '') {
that.isDisableInsured = false
} else {
that.isDisableInsured = true
}
}
if (val.radioSure != '') {
this.isSure = false
}
}
}
},
mounted() {
document.body.style.backgroundColor = '#fff'
// console.log('---签名投保单PDFurl:', this.pdfUrl, 'insurance-policyUrl', window.localStorage.getItem('insurance-policyUrl'))
// this.pdfUrl = "http://10.10.100.98:7012/updown/returnDirectStream?imgPath=Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoMMdje9Cf6YWX3FlAKn%2FwOBIMX%2BfXJaM6sn%0D%0AiUe41vurjQJ65teJQwdrc2wcOn%2FJtQSVGLphInLPv0HGtHpZ3OhD"
// this.src = 'http://139.199.50.151:7000/pdfjs/web/viewer.html?file='
// console.log('------pdf url:', this.src + this.pdfUrl)
//实例化
// this.pdfh5 = new Pdfh5('#pdf', {
// pdfurl: config.imgDomain + `/returnDirectStream?imgPath=${window.localStorage.getItem('insurance-policyUrl')}`
// // pdfurl: res.data.content.content
// })
// 获取签名信息
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
img {
width: 100%;
height: 100%;
}
.notice {
width: 100%;
position: fixed;
top: 0;
z-index: 20;
}
.iframe {
width: 100vw;
height: 70vh;
}
</style>