【人管处20220302-关于贵州分公司(筹)电子入司签订材料的需求】担保书分为被担保人(保险代理人)签名,担保人签名,还有空签

This commit is contained in:
li.yuetong
2022-03-23 14:44:29 +08:00
parent d0da6d78c4
commit b55983bd9d

View File

@@ -1,8 +1,9 @@
<template>
<div>
<van-notice-bar :scrollable="false" v-if="!Time" class="notice">{{ `提示阅读时长需在${time}秒以上` }}</van-notice-bar>
<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>
<div class="fixed bottom0 left0 bg-white" style="width:100%">
<!-- <van-checkbox class="p15 pt20" v-model="radio" @click="click" shape="square">本人确认已阅读<span class="blue">个险营销员健康告知书</span></van-checkbox> -->
<van-radio-group v-model="radio" class="pb10 pt20 pl30">
<van-radio name="1" @click="click" class="fs12">
本人确认已阅读
@@ -11,11 +12,24 @@
</van-radio-group>
<div class="pl30 pb15">
本人签字
<van-button type="danger" size="small" @click="sign" :disabled="isDisable" v-no-more-click="1000">{{
appntSign.signState == '0' ? '签名' : '已签名'
<van-button v-if="code == '1'" type="danger" size="small" @click="sign" disabled="disabled" v-no-more-click="1000">{{
agentSign.signState == '0' ? '签名' : '已签名'
}}</van-button>
<van-button v-else type="danger" size="small" @click="sign" :disabled="isDisable" v-no-more-click="1000">{{
agentSign.signState == '0' ? '签名' : '已签名'
}}</van-button>
</div>
<van-button type="danger" :disabled="isDisabledComplite" @click="goNext" v-no-more-click="1000" size="large">下一步</van-button>
<div class="pl30 pb15">
担保人签字
<van-button v-if="code == '0'" type="danger" size="small" @click="signD" disabled="disabled" v-no-more-click="1000">{{
guaranteeSign.signState == '0' ? '未签名' : '已签名'
}}</van-button>
<van-button v-else type="danger" size="small" @click="signD" :disabled="isDisableD" v-no-more-click="1000">{{
guaranteeSign.signState == '0' ? '签名' : '已签名'
}}</van-button>
</div>
<van-button v-if="!isWeixin" type="danger" :disabled="isDisabledComplite" @click="goNext" v-no-more-click="1000" size="large">下一步</van-button>
<van-button v-if="isWeixin" type="danger" :disabled="isDisabledCompliteD" @click="goNext" v-no-more-click="1000" size="large">提交</van-button>
</div>
</div>
</template>
@@ -28,10 +42,15 @@ import { filtSignList, getAgreementNextPagePath } from './js/methods'
export default {
data() {
let isWeixin = this.$utils.device().isWeixin //判断环境
return {
// 是否在微信
isWeixin,
src: location.origin + '/pdfjs/web/viewer.html?file=',
pdfUrl: '',
radio: '',
// 倒计时时间
number: '',
// 定时器时间
time: '10',
// 定时器名称
@@ -41,10 +60,14 @@ export default {
Time: false,
// 签名是否可以点击
isDisable: true,
isDisableD: true,
// 是否可以点击下一步
isDisabledComplite: true,
//是否可以点击提交
isDisabledCompliteD: true,
// 是否签名 true 签名 false 未签名
isSign: false,
isSignD: false,
//协议list
signList: [],
//当前页面协议签署后下一页路由
@@ -53,12 +76,21 @@ export default {
code: '',
//推荐人信息
agentInfo: {},
// 推荐人签名信息
//担保人签名信息
guaranteeSign: {},
//申请人签名信息
agentSign: {},
// 签名信息
appntSign: {
signState: '0'
signState: '',
signStateD: ''
},
//原生返回的加密包
base64: ''
base64: '',
//担保人原生返回的加密包
base64D: ''
// 是否重复签名
// isReSign: '0'
}
},
components: {
@@ -67,55 +99,115 @@ export default {
[Button.name]: Button,
[Radio.name]: Radio,
[RadioGroup.name]: RadioGroup,
// [CheckboxGroup.name]: CheckboxGroup,
[NoticeBar.name]: NoticeBar,
[Dialog.name]: Dialog
},
created() {
if (!this.Time) {
this.timeOut()
}
this.agreementQuery()
async created() {
this.code = this.$route.query.code
if (this.isWeixin) {
let imgBase64Data = sessionStorage.getItem('oneimgBase64Data')
let wxSigned = sessionStorage.getItem('onewxSigned')
let signInfo = JSON.parse(localStorage.getItem('signInfo'))
console.log('`````````````````````````````````')
console.log('imgBase64Data: twoimgBase64Data:' + imgBase64Data)
console.log('wxSigned: ' + wxSigned)
if (wxSigned) {
console.log('第二次进入电子保单')
console.log('````````````````````````````````')
await this.agreementQuery()
this.Time = true
this.isOver = true
this.radio = '1'
this.base64D = imgBase64Data
this.isDisabledComplite = false
console.log('signInfo.status:' + signInfo.status)
if (signInfo.status == '0') {
this.$set(this.appntSign, 'signStateD', '1')
this.$set(this.guaranteeSign, 'signState', '1')
this.isSignD = false
// this.isDisabledComplite = false
// this.isDisableD = false
} else {
this.$set(this.appntSign, 'signStateD', '0')
this.$set(this.guaranteeSign, 'signState', '0')
// this.isDisabledComplite = false
this.isSignD = false
}
} else {
console.log('第一次进入电子保单')
this.timeOut()
this.agreementQuery()
}
} else {
this.timeOut()
this.agreementQuery()
}
},
methods: {
//获取签署协议人信息
agreementQuery() {
let that = this
let data = {}
this.$toast.loading({
let data = {
// userModel: { //线上去掉
// mobile: '13000000000'
// }
}
that.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
agreementQuery(data).then(res => {
console.log(res)
if (res.result == '0') {
this.$toast.clear()
that.signList = res.content.ebizAgreementDtoList
res.content.ebizAgreementDtoList.map(item => {
console.log(item)
if (item.type == '21') {
that.appntSign = item
}
})
filtSignList(that, that.signList)
that.nextPagePath = getAgreementNextPagePath(that.signList, that.code, that.appntSign)
that.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${that.appntSign.rgssUrl}`)
} else {
this.$toast(res.resultMessage)
}
return new Promise((resolve, reject) => {
agreementQuery(data).then(res => {
that.$toast.clear()
if (res.result == '0') {
that.signList = res.content.ebizAgreementDtoList
res.content.ebizAgreementDtoList.map(item => {
if (item.type == '21') {
if (item.documentType == '0') {
that.agentSign = item //申请人签名信息
} else {
that.guaranteeSign = item //担保人签名信息
}
if (item.documentType == that.code) {
that.appntSign = Object.assign({}, item)
}
}
that.appntSign.signState = that.agentSign.signState == '0' ? '0' : '1'
that.isDisable = that.agentSign.signState == '0' ? false : true
that.appntSign.signStateD = that.guaranteeSign.signState == '0' ? '0' : '1'
that.isDisableD = that.guaranteeSign.signState == '0' ? false : true
})
console.log('that.appntSign=', that.appntSign)
filtSignList(that, that.signList)
that.nextPagePath = getAgreementNextPagePath(that.signList, that.code, that.appntSign)
that.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${that.appntSign.rgssUrl}`)
resolve()
} else {
this.$toast(res.resultMessage)
reject()
}
})
})
},
timeOut() {
let that = this
let time = that.time
that.Time = false
that.number = `${time}`
let timer = setInterval(() => {
this.time--
if (this.time <= 0) {
this.time = 0
time--
if (time <= 0) {
time = 0
clearInterval(timer)
this.Time = true
this.isOver = true
that.Time = true
that.isOver = true
// window.localStorage.setItem('step', '1')
}
that.number = `${time}`
}, 1000)
},
// 点击阅读时
@@ -158,20 +250,88 @@ export default {
if (JSON.parse(data).state == '1') {
this.base64 = decodeURI(JSON.parse(data).sign)
this.appntSign.signState = '1'
this.isDisabledComplite = false
this.isSign = false
this.agentSign.signState = '1'
if (this.appntSign.signState == '1') {
this.isDisabledComplite = false
this.isSign = true
} else {
this.isDisabledComplite = true
this.isSign = false
}
}
})
},
//担保人签名
signD() {
let that = this
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
if (this.isWeixin) {
this.toAirSign('0', '担保人签名', '5', '1')
} else {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
number: localStorage.idNoD,
//姓名
name: localStorage.idNameD,
//身份证号码id
type: '1',
keyword: '担保人签名',
pageNo: '1',
index: '1',
offset: '5',
pos: '3',
signatureWidth: this.$utils.signParams().signatureWidth,
signatureHeight: this.$utils.signParams().signatureHeight
}).then(data => {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
that.base64D = decodeURI(JSON.parse(data).sign)
that.appntSign.signStateD = '1'
that.guaranteeSign.signState = '1'
if (that.appntSign.signStateD == '1') {
this.isDisabledComplite = false
this.isSignD = true
} else {
this.isDisabledComplite = true
this.isSignD = false
}
}
})
}
},
//微信空签
toAirSign(status, keyword, offset, originStatus) {
console.log('offset == ', offset)
localStorage.setItem(
'signInfo',
JSON.stringify({
originStatus: originStatus,
idNo: localStorage.idNoD,
name: localStorage.idNameD,
type: '1',
keyword: keyword,
status: status,
offset: offset,
originUrl: location.href
})
)
window.location.href = this.$mainUrl + '/sign/index.html'
},
goNext() {
if (this.$route.query.isChange && !this.base64) {
if ((this.$route.query.isChange && !this.base64 && this.code == '0') || (this.$route.query.isChange && !this.base64D && this.code == '1')) {
this.goBack()
} else {
let that = this
let data = {
baseEncryp: that.base64,
ebizAgreementDto: that.appntSign
baseEncryp: this.code == '0' ? this.base64 : this.base64D,
ebizAgreementDto: this.appntSign
}
console.log('baseEncryp', data.baseEncryp)
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
@@ -179,20 +339,22 @@ export default {
message: '加载中……'
})
signAgreement(data).then(res => {
console.log(res)
this.$toast.clear()
if (res.result == '0') {
let path = !this.isWeixin
? `/agentEenter/${this.nextPagePath}?code=${this.code}`
: `/agentEenter/signContract?token=${localStorage.token}&dialogFlag=1`
if (this.$route.query.isChange) {
this.goBack()
} else {
this.$toast.clear()
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/agentEenter/${that.nextPagePath}?code=${that.code}`,
pullRefresh: that.nextPagePath == 'signContract' ? '1' : '0'
url: location.origin + '/#' + path,
pullRefresh: this.nextPagePath == 'signContract' ? '1' : '0'
},
routerInfo: {
path: `/agentEenter/${that.nextPagePath}?code=${that.code}`
path: path
}
})
}
@@ -220,8 +382,8 @@ export default {
},
computed: {
listenChange() {
const { isOver, radio, appntSign } = this
return { isOver, radio, appntSign }
const { isOver, radio, appntSign, code, isWeixin } = this
return { isOver, radio, appntSign, code, isWeixin }
}
},
watch: {
@@ -233,12 +395,45 @@ export default {
that.isDisable = true
}
if (that.radio == '1' && val.appntSign.signState == '1') {
//线上改为1
that.isDisabledComplite = false
if (val.isOver == true && val.radio != '') {
that.isDisableD = false
} else {
that.isDisabledComplite = true
that.isDisableD = true
}
if (that.code == '0') {
if (that.radio == '1' && val.appntSign.signState == '1') {
//线上改为1
that.isDisabledComplite = false
} else {
that.isDisabledComplite = true
}
} else {
if (that.radio == '1' && val.appntSign.signStateD == '1') {
//线上改为1
that.isDisabledComplite = false
if (that.isWeixin) {
that.isDisabledCompliteD = false
}
} else {
that.isDisabledComplite = true
if (that.isWeixin) {
that.isDisabledCompliteD = true
}
}
}
// if (that.radio == '1' && val.appntSign.signState == '1' && val.appntSign.signStateD == '1') {
// //线上改为1
// that.isDisabledComplite = false
// } else {
// that.isDisabledComplite = true
// }
/*
if (val.appntSign.signState == '1' && val.appntSign.signStateD == '1') {
that.isDisable = true
that.isDisableD = true
}
*/
}
},
beforeRouteLeave(to, from, next) {