[IMP]【自助入司流程优化】签署过的协议自动跳过

This commit is contained in:
yuweiqi
2020-05-18 09:42:19 +08:00
parent c10798e7cc
commit 55d2589f51
9 changed files with 497 additions and 192 deletions

View File

@@ -5,22 +5,24 @@
<van-field readonly label-width="120px" label="入司申请时间" v-model="agentInfo.createdDate" />
<van-field readonly label-width="120px" label="所属分公司" v-model="referrerInfo.manageName" />
<van-field readonly label-width="120px" label="所属团队" v-model="referrerInfo.orgLabel" />
<p class="p15 line-height">
恭喜您的入司资料已经通过公司审核<br />
以下内容需要您按照顺序阅读并签字确认
</p>
<div class="p15 line-height">
需签署
<ul>
<li class="flex" v-for="(sign, index) in signList" :key="index">
<div class="w260 blue">{{ sign.name }}</div>
<van-icon v-if="sign.signState === '1'" color="green" name="checked" />
</li>
</ul>
点击开始按钮进行相关操作
</div>
<div class="text-center mt20">
<van-button @click="faceAuth" v-no-more-click="1000" :disabled="isSubmit" type="danger" size="normal" style="width:30%">开始</van-button>
<div v-if="!isWeixin" class="mb10">
<p class="p15 line-height">
恭喜您的入司资料已经通过公司审核<br />
以下内容需要您按照顺序阅读并签字确认
</p>
<div class="p15 line-height">
需签署
<ul>
<li class="flex" v-for="(sign, index) in agentSignList" :key="index">
<div class="w260 blue">{{ sign.name }}</div>
<van-icon v-if="sign.signState === '1'" color="green" name="checked" />
</li>
</ul>
点击开始按钮进行相关操作
</div>
<div class="text-center mt20">
<van-button @click="faceAuth('0')" v-no-more-click="1000" :disabled="isAgentSubmit" type="danger" size="normal" style="width:30%">开始</van-button>
</div>
</div>
<div class="ebizGuarantor">
<van-field readonly label-width="120px" label="担保人" v-model="ebizGuarantor.name"></van-field>
@@ -30,36 +32,171 @@
<div class="p15 line-height">
需签署
<ul>
<li class="flex" v-for="(sign, index) in signList" :key="index">
<li class="flex" v-for="(sign, index) in guaranteeSignList" :key="index">
<div class="w260 blue">{{ sign.name }}</div>
<van-icon v-if="sign.signState === '1'" color="green" name="checked" />
</li>
</ul>
点击开始分享进行相关操作
</div>
<div class="flex justify-content-a mb60 mt20">
<van-button v-if="!isWeixin" @click="faceAuth" v-no-more-click="1000" :disabled="isSubmit" type="danger" size="normal" style="width:30%"
<div v-if="!isInvalid" class="flex justify-content-a mb60 mt20">
<van-button v-if="!isWeixin" @click="share" v-no-more-click="1000" :disabled="isguranteeSubmit" type="danger" size="normal" style="width:30%"
>分享</van-button
>
<van-button @click="faceAuth" v-no-more-click="1000" :disabled="isSubmit" type="danger" size="normal" style="width:30%">开始</van-button>
<van-button @click="faceAuth('1')" v-no-more-click="1000" :disabled="isguranteeSubmit" type="danger" size="normal" style="width:30%">开始</van-button>
</div>
<div v-else class="ml15">操作时间已失效请联系销售人员</div>
</div>
<van-button v-if="isSubmit" class="fixed bottom0" type="danger" v-no-more-click="1000" @click="clickSubmit" size="large">提交</van-button>
<van-button
v-if="isAgentSubmit && isguranteeSubmit && !isWeixin"
class="fixed bottom0"
type="danger"
v-no-more-click="1000"
@click="clickSubmit"
size="large"
>提交</van-button
>
</div>
</template>
<script>
import { Field, Icon, Button } from 'vant'
import { agreementQuery, signAgreement } from '@/api/ebiz/agentEenter/agentEenter.js'
import { weixinShare } from '@/assets/js/utils/wxShare.js'
// import { weixinShare } from '@/assets/js/utils/wxShare.js'
import { checkSignInvalid, getSignInvalid } from '@/api/ebiz/sale/sale'
import { filtSignList } from './js/methods'
let devList = [
//调试专用
{
baseId: 25,
createdDate: '2019-12-03T10:06:07.000+0000',
documentType: '0',
id: 131,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《个险营销员健康告知书》',
order: 1,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MMJWxZmb0WpZD%0D%0AulNt4BhQ8csB7meSbA2DHPBrgbwsjpyVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:12:40.000+0000',
signState: '0',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MMJWxZmb0WpZD%0D%0AulNt4BhQ8bIABSerclzLkpZ7EfTo6fvUqooFPNUZSjGoZts28jTW',
type: '13'
},
{
baseId: 25,
createdDate: '2019-12-03T11:06:56.000+0000',
createdUser: '您猜',
documentType: '0',
id: 132,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《代理人基本福利保障知晓函》',
order: 6,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MSV3lH4t%2BZLOW%0D%0A%2Bvh3PMDFGhUp%2B%2BNak9FtguN1IiRXXlOVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:15:27.000+0000',
signState: '0',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MSV3lH4t%2BZLOW%0D%0A%2Bvh3PMDFGswBB9cueD%2BA0k1xQSPsVULUqooFPNUZSjGoZts28jTW',
type: '11'
},
{
baseId: 25,
createdDate: '2019-12-03T11:06:56.000+0000',
createdUser: '您猜',
documentType: '1',
id: 133,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《担保书》',
order: 5,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MvoM%2Bavw%2FHfcz%0D%0AbfDMyeVE1kaPZwJDrY%2FlR1IwDlrQe6KVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:14:38.000+0000',
signState: '0',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MvoM%2Bavw%2FHfcz%0D%0AbfDMyeVE1le4Yn85HeThhEgS3gEDBK7UqooFPNUZSjGoZts28jTW',
type: '12'
},
{
baseId: 25,
createdDate: '2019-12-03T11:06:56.000+0000',
createdUser: '您猜',
documentType: '0',
id: 134,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《保险代理合同》',
order: 7,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MEIikc%2FuBT5F3%0D%0AQSMZgyPFhfwM90EhMrUVYKzpUzovEqSVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:15:45.000+0000',
signState: '1',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MEIikc%2FuBT5F3%0D%0AQSMZgyPFhXRMc7sfWxHjWLq72jbia%2BbUqooFPNUZSjGoZts28jTW',
type: '14'
},
{
baseId: 25,
createdDate: '2019-12-03T11:06:56.000+0000',
createdUser: '您猜',
documentType: '0',
id: 135,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《销售从业人员拒绝非法集资、非法放贷、金融诈骗承诺书》',
order: 4,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MMkpxdFEhYfK%2B%0D%0Abwvndj%2FYzvVUdk3WnyEL89pneUR3egCVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:13:39.000+0000',
signState: '1',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7MMkpxdFEhYfK%2B%0D%0Abwvndj%2FYzuYCdy1qc3s6W6LR%2B8qHblbUqooFPNUZSjGoZts28jTW',
type: '15'
},
{
baseId: 25,
createdDate: '2019-12-03T11:06:56.000+0000',
createdUser: '您猜',
documentType: '0',
id: 136,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《广西保险销售从业人员信息公开承诺书》',
order: 3,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7M1Hy3YFswSMOJ%0D%0ACupujVjbOqtXdlQngjvfOgmQvLgdSxSVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:13:22.000+0000',
signState: '1',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7M1Hy3YFswSMOJ%0D%0ACupujVjbOuBhK0%2BNowNiEPFIM9yLXzvUqooFPNUZSjGoZts28jTW',
type: '16'
},
{
baseId: 25,
createdDate: '2019-12-03T11:06:56.000+0000',
createdUser: '您猜',
documentType: '0',
id: 137,
imgState: '3',
isDelete: 0,
modifiedDate: '2019-12-03T11:27:47.000+0000',
name: '《承诺书》',
order: 2,
rgssUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7M8RnQ86uoTRid%0D%0AjQKoadYQNoc9CWLNt%2BDRygNGLUuonZuVGLphInLPv0HGtHpZ3OhD',
signDate: '2019-12-03T11:13:04.000+0000',
signState: '1',
thirdUrl: 'Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoNhmz6pJzLpaFL1klLxAn7M8RnQ86uoTRid%0D%0AjQKoadYQNkVwQwzyltxrtR%2FT7NhB%2F%2FHUqooFPNUZSjGoZts28jTW',
type: '10'
}
]
export default {
data() {
let isWeixin = this.$utils.device().isWeixin //判断环境
return {
// 是否在微信
isWeixin,
// 微信分享链接是否失效 false 为未失效 true为已失效
isInvalid: false,
// 微信分享校验值
signInvalid: '',
agentInfo: {
name: '皮伟',
idNo: '422801199210070412',
@@ -68,26 +205,18 @@ export default {
referrerInfo: {
orgLabel: ''
},
signList: [
// { name: '《个险营销员履历表》', signState: '1' }, //0未签字1签字
// { name: '《个险营销员营销告知书》', signState: '0' },
// { name: '《个险销售人员代理合同》', signState: '1' }
],
isSubmit: false,
signList: [],
agentSignList: [], //申请人所需阅读签署文档集合
guaranteeSignList: [], //担保人所需阅读签署文档集合
isAgentSubmit: false,
isguranteeSubmit: false,
ebizGuarantor: {} //担保人信息
}
},
created() {
this.agreementQuery()
this.init()
},
mounted() {
//查看是否全部签署完成
if (this.signList.length > 0) {
this.isSubmit = this.signList.every(item => {
console.log('item', item)
return item.signState == '1'
})
}
document.body.style.backgroundColor = '#fff'
},
beforeRouteLeave(to, from, next) {
@@ -95,6 +224,27 @@ export default {
next()
},
methods: {
//初始化信息
async init() {
if (this.isWeixin) {
window.localStorage.setItem('token', this.$route.query.token)
if (this.$route.query.signInvalid) {
sessionStorage.setItem('signInvalid', this.$route.query.signInvalid)
}
let signInvalid = sessionStorage.getItem('signInvalid')
await this.agreementQuery()
let rs = await this.checkSignInvalid(signInvalid)
if (rs == '1') {
this.isInvalid = false
} else {
this.isInvalid = true
}
} else {
await this.agreementQuery()
this.getSignInvalid()
}
},
//获取签署协议人信息
agreementQuery() {
let data = {
@@ -106,103 +256,143 @@ export default {
loadingType: 'spinner',
message: '加载中……'
})
agreementQuery(data).then(res => {
console.log(res)
if (res.result == '0') {
this.$toast.clear()
this.agentInfo = res.content.ebizEnterCustomerDto
this.referrerInfo = res.content.ebizReferrerDto
this.signList = res.content.ebizAgreementDtoList
this.ebizGuarantor = res.content.ebizGuarantorDto
localStorage.idNoD = this.ebizGuarantor.idNo
localStorage.idNameD = this.ebizGuarantor.name
this.agentInfo.createdDate = this.agentInfo.createdDate.substring(0, 10)
this.signList.map(item => {
this.addKey(item)
})
this.signList.sort(function(a, b) {
return a.key - b.key
})
this.isSubmit = this.signList.every(item => {
return item.signState == '1'
})
} else {
this.$toast(res.resultMessage)
return new Promise(resolve => {
agreementQuery(data).then(res => {
if (res.result == '0') {
this.$toast.clear()
this.agentInfo = res.content.ebizEnterCustomerDto
this.referrerInfo = res.content.ebizReferrerDto
this.signList = res.content.ebizAgreementDtoList
this.ebizGuarantor = res.content.ebizGuarantorDto
localStorage.idNoD = this.ebizGuarantor.idNo
localStorage.idNameD = this.ebizGuarantor.name
this.agentInfo.createdDate = this.agentInfo.createdDate.substring(0, 10)
this.signList = devList //调试专用
this.agentSignList = filtSignList(this, this.signList).agentSignList
this.guaranteeSignList = filtSignList(this, this.signList).guaranteeSignList
this.isAgentSubmit = this.agentSignList.every(item => {
return item.signState == '1'
})
this.isguranteeSubmit = this.guaranteeSignList.every(item => {
return item.signState == '1'
})
resolve()
} else {
this.$toast(res.resultMessage)
}
})
})
},
//担保人分享到微信空签
share() {
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: '国富人寿入司申请(担保人签字)',
content: '签字进行',
url: location.origin + '/#/agentEenter/signContract?token=' + localStorage.token + '&signInvalid=' + this.signInvalid,
img: this.$assetsUrl + 'images/logo.png'
}
})
},
faceAuth() {
// /*
let that = this
localStorage.idNo = this.agentInfo.idNo
localStorage.idName = this.agentInfo.name
if (that.agentInfo.idType == '1') {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
EWebBridge.webCallAppInJs('face_auth', {
number: that.agentInfo.idNo, //身份证号码
name: that.agentInfo.name //姓名
}).then(data => {
console.log(data)
getSignInvalid() {
// let that = this
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {}
getSignInvalid(data).then(res => {
if (res.result == '0') {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
that.goUrl()
this.signInvalid = res.content.sign
}
})
},
//判断微信分享链接是否失效
async checkSignInvalid(signInvalid) {
let that = this
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
sign: signInvalid
}
return new Promise((resolve, reject) => {
checkSignInvalid(data).then(res => {
if (res.result == '0') {
that.$toast.clear()
let status = res.content.status
resolve(status)
}
})
})
},
faceAuth(code) {
localStorage.idNo = this.agentInfo.idNo
localStorage.idName = this.agentInfo.name
/*
if (code == '0') {
if (that.agentInfo.idType == '1') {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
EWebBridge.webCallAppInJs('face_auth', {
number: that.agentInfo.idNo, //身份证号码
name: that.agentInfo.name //姓名
}).then(data => {
console.log(data)
this.$toast.clear()
if (JSON.parse(data).state == '1') {
that.goUrl(code)
}
})
} else {
that.goUrl(code)
}
} else {
that.goUrl()
that.goUrl(code)
}
// */
// this.goUrl()//调试专用
*/
this.goUrl(code) //调试专用
},
//自定义key值排序用
addKey(item) {
//13保险代理申请人健康声明 10承诺书 16广西保险销售从业人员信息公开承诺书
//15销售从业人员拒绝非法集资、非法放贷、金融诈骗承诺书 12担保书 11代理人基本福利保障知晓函 14个险销售人员代理合同
if (item.type == '13') {
item.key = 1
} else if (item.type == '10') {
item.key = 2
} else if (item.type == '16') {
item.key = 3
} else if (item.type == '15') {
item.key = 4
} else if (item.type == '12') {
item.key = 5
} else if (item.type == '11') {
item.key = 6
} else if (item.type == '14') {
item.key = 7
}
},
goUrl() {
goUrl(code) {
let path = ''
if (this.signList[0].signState == 0) {
path = 'healthNotice'
} else if (this.signList[1].signState == 0) {
path = 'LetterOfCommitment'
} else if (this.signList[2].signState == 0) {
path = 'MessageLetterOfCommitment'
} else if (this.signList[3].signState == 0) {
path = 'IllegalLetterOfCommitment'
} else if (this.signList[4].signState == 0) {
path = 'Guarantee'
} else if (this.signList[5].signState == 0) {
path = 'LetterOfKnow'
} else if (this.signList[6].signState == 0) {
path = 'paction'
if (code == '0') {
path = this.agentSignList.filter(v => {
return v.signState == '0'
})[0].path
} else if (code == '1') {
path = this.guaranteeSignList.filter(v => {
return v.signState == '0'
})[0].path
}
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/agentEenter/` + path
// url: location.origin + `/#/agentEenter/` + path
url: `${location.origin}/#/agentEenter/${path}?code=${code}`
},
routerInfo: {
path: `/agentEenter/` + path
// path: `/agentEenter/` + path
path: `/agentEenter/${path}?code=${code}`
}
})
},