Merge branch 'PC保全' into feature/【保全】

# Conflicts:
#	src/api/ebiz/preserve/preserve.js
This commit is contained in:
阳华祥
2020-06-04 18:01:59 +08:00
10 changed files with 324 additions and 778 deletions

View File

@@ -51,6 +51,16 @@ export function queryEdorList(data) {
data
})
}
//受益人变更提交
export function queryConfirmDetail(data) {
return request({
url: getUrl('/edor/edor/queryConfirmDetail', 1),
method: 'post',
data
})
}
//签名信息保存
export function edorSignSave(data) {
return request({

View File

@@ -5,6 +5,7 @@ const handleResult = () => import('@/views/ebiz/preserve/common/HandleResult')
const submitResult = () => import('@/views/ebiz/preserve/common/SubmitResult')
const policyList = () => import('@/views/ebiz/preserve/common/PolicyList')
const renewalInfo = () => import('@/views/ebiz/preserve/pc/RenewalInfo')
const pcImageUpload = () => import('@/views/ebiz/preserve/pc/ImageUpload')
const renewalConfirmation = () => import('@/views/ebiz/preserve/pc/RenewalConfirmation')
const autopayAuthorization = () => import('@/views/ebiz/preserve/pc/AutopayAuthorization')
const contactInfo = () => import('@/views/ebiz/preserve/bb/ContactInfo')
@@ -72,6 +73,15 @@ export default [
index: 4
}
},
{
path: '/preserve/pc/imageUpload',
name: 'pcImageUpload',
component: pcImageUpload,
meta: {
title: '续期账号图片上传',
index: 41
}
},
{
path: '/preserve/bc/beneficiaryInfo',
name: 'beneficiaryInfo',

View File

@@ -137,7 +137,7 @@ export default {
break
case 'renewal':
surrenderType = '3'
url = `/preserve/common/policyList?entry=PC`
url = `/preserve/pc/RenewalInfo?entry=PC`
break
case 'surrender':
surrenderType = '4'

View File

@@ -39,7 +39,7 @@ export default {
this.path = '/preserve/BeneficiaryConfirmation?entry=beneficiary&'
break
case 'renewal':
this.path = '2'
this.path = '/preserve/pc/renewalConfirmation?entry=renewal'
break
case 'bonus':
this.path = '3'

View File

@@ -80,6 +80,72 @@ export default {
id: 'd',
text: '强制终止'
}
],
// 续期缴费方式 1-现金、4-银行自动转账、8-银行回单 A-支付宝 W-微信 P-POS收费
pcPayMode: [
{
label: '现金',
type: '1'
},
{
label: '银行自动转账',
id: '4'
},
{
label: '银行回单',
id: '8'
},
{
label: '支付宝',
id: 'A'
},
{
label: '微信',
id: 'W'
},
{
label: 'POS收费',
id: 'P'
}
],
// 银行卡类型
edorBankType: [
{
id: 'ABC',
label: '农业银行'
},
{
id: 'BOC',
label: '中国银行'
},
{
id: 'BOCOM',
label: '交通银行'
},
{
id: 'CCB',
label: '建设银行'
},
{
id: 'CEB',
label: '光大银行'
},
{
id: 'CIB',
label: '兴业银行'
},
{
id: 'ICBC',
label: '工商银行'
},
{
id: 'PSBC',
label: '邮储银行'
},
{
id: 'CMB',
label: '招商银行'
}
]
/*
preserveUserType: {

View File

@@ -1,4 +1,6 @@
//点击弹出组件
import DataDictionary from '@/assets/js/utils/data-dictionary'
export function selectComp(that, index, type = '') {
that.currentPopupIndex = index
let title = ''
@@ -93,3 +95,28 @@ export function getIdentityInfo(that, data, type) {
}
})
}
// 数据字典 id 转 text
// eslint-disable-next-line no-unused-vars
function idToTextEdor(id, type) {
let text = ''
DataDictionary[type].some(item => {
if (item.id == id) {
text = item.label
}
})
return text
}
//json 数组分组
function groupBy(array, f) {
const groups = {}
array.forEach(function(o) {
const group = JSON.stringify(f(o))
groups[group] = groups[group] || []
groups[group].push(o)
})
return Object.keys(groups).map(function (group) {
return groups[group]
})
}

View File

@@ -3,27 +3,16 @@
<div class="auto-pay-container">
<div class="pb20 pt20">
<van-notice-bar :scrollable="false" v-if="time != 0" class="notice">{{ `提示阅读时长需在${time}秒以上` }}</van-notice-bar>
<div class="fs14 p10 signature-confirm-content pb20 pt25 mb20">
<h1 class="text-center fs18 mb10">自动转账授权书</h1>
<p>本人授权本人所在企业或国富人寿保险有限公司 (下称"国富人寿") 以下事项:</p>
<p>1本人所在企业或国富人寿可从本投保页面上"银行信息"栏中的结算账户 (下称"结算账户") 中划扣本人应交付的保险费</p>
<p>2本人授权指定银行按本人所在企业或国富人寿保险费划转要求划扣保险费时,免于核对密码或签名就上述授权转账事宜,本人声明确知并保证遵守如下规定:</p>
<p class="fwb">
1因账户内余额不足或其他非国富人寿原因导致保险费转账不成功的, 被保人应存入足够金额或重新提供有效结算账户,未及时支付保险费将导致当次投保申请失效
</p>
<p class="fwb">2本授权书为本人所在企业或国富人寿从本人指定的结算账户中扣款的授权证明,不作为收取现金的凭据</p>
</div>
<van-radio-group v-model="radio" class="pb10 pt20 pl30">
<van-radio name="1" @click="readConfirm" v-no-more-click="2000" class="fs12">
<iframe :src="src + pdfUrl" class="iframe"></iframe>
<van-radio-group v-model="radio" class="pb10 pt20 pl30 fs14">
<van-radio name="1">
本人确认已阅读
<span class="green">国富人寿自动转账授权书</span>
</van-radio>
</van-radio-group>
</div>
<div class="bottom-btn bg-white">
<van-button type="danger" size="large" @click="next" :disabled="isDisabledComplite" v-no-more-click="2000">完成</van-button>
<div class="bg-white bottom-btn">
<van-button type="danger" size="large" :disabled="isDisabledComplite" @click="next" v-no-more-click="2000">下一步</van-button>
</div>
</div>
</div>
</template>
@@ -58,6 +47,7 @@ export default {
this.time--
if (this.time <= 0) {
this.time = 0
this.radio = '0'
clearInterval(timer)
}
}, 1000)
@@ -104,7 +94,7 @@ export default {
}
.iframe {
width: 100vw;
height: 70vh;
height: 80vh;
}
.signature-confirm-content {
text-indent: 2em;

View File

@@ -4,70 +4,19 @@
<div class=" pb80">
<div class="m20 bg-white">
<div>
<!-- 身份证 -->
<div v-if="entry == 'surrender' || entry == 'hesitateSurrender'">
<van-cell-group>
<van-field required label="身份证正面" disabled />
</van-cell-group>
<div @click="test('fileListIdFront', idType)" class="flex align-items-e">
<van-uploader
name="fileListIdFront"
v-model="fileListIdFront"
:after-read="afterRead"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
@delete="deleteImg"
/>
</div>
<van-cell-group>
<van-field required label="身份证反面" disabled />
</van-cell-group>
<div @click="test('fileListIdBack', idType)">
<van-uploader
name="fileListIdBack"
v-model="fileListIdBack"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
/>
</div>
</div>
<!-- 银行卡 -->
<div v-if="entry == 'renewal' || ((entry == 'surrender' || entry == 'hesitateSurrender') && accountType == '1')">
<div v-for="(item, index) in fileList" :key="index">
<van-cell-group>
<van-field required label="银行卡" disabled />
<van-field required :label="item.label" disabled />
</van-cell-group>
<div @click="test('fileListBank', idType)">
<div @click="test(item)">
<van-uploader
name="fileListBank"
v-model="fileListBank"
:name="item.name"
v-model="item.realFileList"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
/>
</div>
</div>
<!-- 纸质保单 -->
<div v-if="(entry == 'surrender' || entry == 'hesitateSurrender') && conTractType == '1'">
<van-cell-group>
<van-field required label="纸质保单" disabled />
</van-cell-group>
<div @click="test('fileListContract ', idType)">
<van-uploader
name="fileListContract"
v-model="fileListContract"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
:max-count="20"
/>
</div>
</div>
@@ -75,7 +24,7 @@
</div>
</div>
<div class="bg-white bottom-btn">
<van-button type="danger" size="large" :disabled="isDisabled" @click="nextStep" v-no-more-click="2000">下一步</van-button>
<van-button type="danger" size="large" @click="nextStep" v-no-more-click="2000">下一步</van-button>
</div>
</div>
</template>
@@ -83,8 +32,7 @@
<script>
import { Cell, CellGroup, Field, Uploader, RadioGroup, Radio, Dialog, Picker, Popup } from 'vant'
import { uploadImg } from '@/api/ebiz/sale/sale'
import config from '@/config'
import { customerInfoChange, preserveHangUp } from '@/api/ebiz/preserve/preserve'
import { changeEdor } from '@/api/ebiz/preserve/preserve'
export default {
components: {
[Cell.name]: Cell,
@@ -103,157 +51,44 @@ export default {
id: '',
idType: '1',
type: '',
fileListIdFront: [], //身份证正面
fileListIdBack: [], //身份证反面
fileListBank: [], // 银行账户
fileListContract: [], //纸质保单
file: '', // 图片流
imgName: '', // 图片名称
list: [],
fileList: [
{
name: 'bank',
label: '银行卡',
imageInfoType: '3', // 影像类型
subBusinessType: '3', // 影像归属 0 投保人 1 被保人 2 受益人 3 代理人
realFileList: [],
popList: []
}
],
uploadCheck: {},
entry: '',
surrenderType: '',
accountType: '', //退款银行账号类型 0-原银行 1-新银行
conTractType: '' //保单类型 0-电子 1-纸质
customerInfo: JSON.parse(localStorage.getItem('preserve-customerInfo'))
}
},
created() {
this.entry = JSON.parse(localStorage.customerInfo).entry
this.accountType = this.$route.query.accountType
this.conTractType = this.$route.query.conTractType
switch (this.entry) {
case 'contact': //联系方式变更
this.surrenderType = '1'
break
case 'beneficiary': //受益人变更
this.surrenderType = '2'
break
case 'renewal': //续期账户变更
this.surrenderType = '3'
break
case 'surrender': //退保
this.surrenderType = '4'
break
case 'hesitateSurrender': //犹豫期退保
this.surrenderType = '5'
break
default:
break
}
// 银行卡
if (window.localStorage.getItem('bankCardUrlPath') != null) {
let bankCardUrl = {
url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${window.localStorage.getItem('bankCardUrlPath')}`
}
this.fileListBank.push(bankCardUrl)
//续期账号变更
if (this.surrenderType == '2') {
let policyList = JSON.parse(localStorage.accountDTOList)
policyList.forEach(item => {
let obj = {
businessNo: JSON.parse(localStorage.customerInfo).edorApplyNo,
businessType: '2',
imageInfoType: '3',
rgssUrl: window.localStorage.getItem('bankCardUrlPath'),
subBusinessType: '3',
subBusinessNo: item.contNo
}
this.list.push(obj)
})
} else {
//累计红利领取
let obj = {
businessNo: JSON.parse(localStorage.customerInfo).edorApplyNo,
businessType: '2',
imageInfoType: '3',
rgssUrl: window.localStorage.getItem('bankCardUrlPath'),
subBusinessType: '3',
subBusinessNo: JSON.parse(localStorage.customerInfo).edorApplyNo
}
this.list.push(obj)
}
} else {
this.fileListBank = []
}
// 初始化 上传影像数据
},
methods: {
test(type, id) {
this.id = id
this.type = type
test(item) {
this.uploadCheck = item
},
afterRead(file) {
console.log('afterRead')
// 此时可以自行将文件上传至服务器
this.file = file.content
this.imgName = file.file.name
this.upload()
},
// 上传图片
upload() {
this.$toast.loading({
// 持续展示 toast
duration: 0,
// 禁用背景点击
forbidClick: true,
loadingType: 'spinner',
message: '加载中……'
})
let formdata = new FormData()
formdata.append('imgPath', this.dataURLtoFile(this.file, this.imgName))
formdata.append('imgPath', this.dataURLtoFile(file.content, file.file.name))
uploadImg(formdata).then(res => {
this.$toast.clear()
if (res.result == '0') {
this.$toast.clear()
// 是投保人
// 证件类型
let imageInfoType = ''
if (this.type == 'fileListIdFront' && this.id == '1') {
imageInfoType = '1'
} else if (this.type == 'fileListIdBack' && this.id == '1') {
imageInfoType = '2'
} else if (this.type == 'fileListBank') {
imageInfoType = '3'
}
//续期账号变更 subBusinessNo 传保单号, 其他传申请号
if (this.surrenderType == '2') {
let policyList = JSON.parse(localStorage.accountDTOList)
policyList.forEach(item => {
let obj = {
businessNo: JSON.parse(localStorage.customerInfo).edorApplyNo,
businessType: '2',
imageInfoType,
rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'),
subBusinessType: '3',
fileName: this.imgName,
subBusinessNo: item.contNo
}
this.list.push(obj)
})
} else {
let subBusinessNo = JSON.parse(localStorage.customerInfo).edorApplyNo
let obj = {
businessNo: JSON.parse(localStorage.customerInfo).edorApplyNo,
businessType: '2',
imageInfoType,
rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'),
subBusinessType: '3',
fileName: this.imgName,
subBusinessNo
}
this.list.push(obj)
}
this.uploadCheck.popList.push({ name: file.file.name, imgPath: res.path })
console.log(this.fileList)
} else {
switch (this.type) {
case 'fileListIdFront':
this.fileListIdFront = []
break
case 'fileListIdBack':
this.fileListIdBack = []
break
case 'fileListBank':
this.fileListBank = []
break
}
this.$toast.clear()
this.$toast(res.resultMessage)
}
})
@@ -278,29 +113,25 @@ export default {
message: '您确定要删除吗'
})
.then(() => {
if (detail.name == 'fileListIdFront') {
this.fileListIdFront = []
} else if (detail.name == 'fileListIdBack') {
this.fileListIdBack = []
} else if (detail.name == 'fileListBank') {
this.fileListBank = []
}
this.deleteImg(file)
this.fileList.map(item => {
if (item.name == detail.name) {
// 处理
let deleteIndex = null
for (let i = 0; i < item.realFileList.length; i++) {
if (item.realFileList[i].file == file.file) {
deleteIndex = i
break
}
}
item.realFileList.splice(deleteIndex, 1)
item.popList.splice(deleteIndex, 1)
}
})
})
.catch(() => {
// cancel
})
},
// 删除图片
deleteImg(file) {
this.list.map((item, index, array) => {
if (item.fileName.indexOf(file.file.name) == -1) {
return
} else {
array.splice(index, 1)
}
})
},
// 点击下一步
nextStep() {
this.$toast.loading({
@@ -311,98 +142,50 @@ export default {
loadingType: 'spinner',
message: '加载中……'
})
delete this.list.fileName
let hangUpData = {
surrenderDTO: {
surrenderId: JSON.parse(localStorage.customerInfo).surrenderId,
edorapplyNo: JSON.parse(localStorage.customerInfo).edorapplyNo,
edoracceptNo: '',
surrenderType: this.surrenderType,
mediaDTOList: [],
customerInfoDTOList: [
{
customerNo: JSON.parse(localStorage.customerInfo).customerNo
}
],
accountDTOList: [],
recommendDTO: {},
bonusDTOList: [],
signDTOList: []
}
//
let saveMediaDTO = {
platformType: 'app',
edorType: 'PC',
operateType: '02',
customerNo: this.customerInfo.customerNo,
name: this.customerInfo.customerName,
iDNo: this.customerInfo.idNo,
mobile: this.customerInfo.customerMobile,
surrenderId: this.customerInfo.surrenderId,
edorApplyNo: this.customerInfo.edorApplyNo,
mediaUploadDTOS: []
}
if (this.surrenderType == '2') {
let hangUpList = JSON.parse(localStorage.accountDTOList)
let surrenderId = JSON.parse(localStorage.customerInfo).surrenderId.split(',')
hangUpList.forEach((item, index) => {
preserveHangUp({
surrenderDTO: {
surrenderId: surrenderId[index],
edorapplyNo: JSON.parse(localStorage.customerInfo).edorapplyNo,
edoracceptNo: '',
surrenderType: this.surrenderType,
mediaDTOList: [],
customerInfoDTOList: [
{
customerNo: JSON.parse(localStorage.customerInfo).customerNo
}
],
accountDTOList: [item],
recommendDTO: {},
bonusDTOList: [],
signDTOList: []
}
}).then(backData => {
if (backData.result == 0) {
if (index >= hangUpList.length - 1) {
this.customerInfoChange()
console.log(this.fileList);
this.fileList.forEach(item => {
item.popList.forEach(subItem => {
saveMediaDTO.mediaUploadDTOS.push(
Object.assign(
{},
{
businessNo: this.customerInfo.edorApplyNo,
businessType: item.imageInfoType,
imageInfoType: item.imageInfoType,
rgssUrl: subItem.imgPath,
subBusinessType: item.imageInfoType,
subBusinessNo: item.imageInfoType,
manageComCode: item.imageInfoType
}
} else {
return this.$toast(backData.resultMessage)
}
})
)
)
})
} else {
preserveHangUp(hangUpData).then(backData => {
this.$toast.clear()
if (backData.result == '0') {
let customerInfo = JSON.parse(localStorage.customerInfo)
customerInfo.edoracceptNo = backData.content
localStorage.customerInfo = JSON.stringify(customerInfo)
localStorage.bankCardUrl && localStorage.removeItem('bankCardUrl')
this.customerInfoChange()
} else {
this.$toast(backData.resultMessage)
}
})
}
},
customerInfoChange() {
customerInfoChange({
surrenderDTOList: [
{
// surrenderType: JSON.parse(localStorage.customerInfo).surrenderType, //"1","基本信息变更" "2","续期账号变更" "3","红利领取"
surrenderType: this.surrenderType,
customerInfoDTOList: [],
mediaDTOList: this.list,
surrenderId: JSON.parse(localStorage.customerInfo).surrenderId,
recommendDTO: {},
bonusDTOList: [],
signDTOList: []
}
]
}).then(res => {
})
changeEdor(saveMediaDTO).then(res => {
this.$toast.clear()
if (res.result == 0) {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/preserve/handleResult',
url: location.origin + '/#/preserve/common/handleResult?entry=renewal',
pullRefresh: '1',
backToFirst: '1'
},
routerInfo: {
path: '/preserve/handleResult'
path: '/preserve/common/handleResult'
}
})
} else {
@@ -410,36 +193,6 @@ export default {
}
})
}
},
computed: {
listenChange() {
const { fileListIdFront, fileListIdBack, fileListBank } = this
return {
fileListIdFront,
fileListIdBack,
fileListBank
}
}
},
watch: {
listenChange(val) {
if (
(val.fileListIdFront.length != '0' &&
val.fileListIdBack.length != '0' &&
val.fileListBank.length != '0' &&
(this.entry == 'surrender' || this.entry == 'hesitateSurrender') &&
this.accountType == '1') ||
(this.entry == 'renewal' && val.fileListBank.length != '0') ||
(val.fileListIdFront.length != '0' &&
val.fileListIdBack.length != '0' &&
(this.entry == 'surrender' || this.entry == 'hesitateSurrender') &&
this.accountType == '0')
) {
this.isDisabled = false
} else {
this.isDisabled = true
}
}
}
}
</script>

View File

@@ -15,89 +15,61 @@
<van-cell-group class="mt10 cont-info-container">
<!-- 保单信息 -->
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">保单信息</p>
<van-collapse v-model="activeNames" @change="collapseChange">
<van-collapse v-model="activeNames" v-if="list.length > 0">
<div v-for="(item, index) in list" :key="index">
<van-collapse-item @click.native="changeCollapse(111)" v-no-more-click="2000" :title="`保单号:${item.contNo}`" :name="index">
<!-- <div slot="value" class="text-right collapse-value red fs12">{{ item.surrenderStatus == '5' ? '已撤销' : '' }}</div> -->
<van-collapse-item :title="`保单号:${item.contNo}`" :name="index" v-if="item.isNewInfo == '1'">
<van-cell title="产品名称" :value="item.riskName" />
<van-cell title="投保人" :value="item.appntName" />
<van-cell title="被保险人" :value="item.insuredName" />
<van-cell title="交费方式" :value="item.insuPayType | idToText('payIntv')" />
<van-cell title="保单生效日期" :value="item.cvaliDate" />
<van-cell title="保单状态" :value="item.contState | idToText('contState')" />
<van-cell title="交费方式" :value="item.tradeAbstract | idToText('pcPayMode')" />
<van-cell title="保单生效日期" :value="item.cvalidate" />
<van-cell title="保单状态" :value="item.contState" />
<van-cell title="开户人姓名" :value="item.accountName" />
<van-cell title="原银行名称" :value="item.bankCode | idToText('preserveBank')" />
<van-cell title="原银行号" :value="item.bankNo" />
<van-cell title="原开户银行" :value="item.bankCode | idToText('edorBankType')" />
<van-cell title="原银行号" :value="item.bankNo" />
</van-collapse-item>
</div>
</van-collapse>
</van-cell-group>
<!-- 以上变更后续账号信息 -->
<van-cell-group class="mt10 cont-info-container">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">以上变更后续账号信息</p>
<van-cell title="开户人姓名" :value="list[0].accountName" v-if="list.length" />
<van-cell title="新开户银行">
<div class="red" slot="default">{{ newBank }}</div>
</van-cell>
<van-cell title="新银行账号">
<div class="red" slot="default">{{ newBankNo }}</div>
</van-cell>
<div v-for="(item, index) in list" :key="index">
<div v-if="item.isNewInfo == '0'">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">以上变更后续账号信息</p>
<van-cell title="开户人姓名" :value="item.accountName" />
<van-cell title="新开户银行">
<div class="red" slot="default">{{ item.bankCode | idToText('edorBankType') }}</div>
</van-cell>
<van-cell title="新银行账号">
<div class="red" slot="default">{{ item.bankNo }}</div>
</van-cell>
</div>
</div>
</van-cell-group>
<van-cell-group class="fs14 mt10 pl15 pr15 pb20">
<p class="pt20 pb20">以下内容需要您阅读确认:</p>
<p>需阅读</p>
<p class="mb10 mt10">
<span class="red">自动转账授权书</span>
<img :src="src" v-if="documentStatus == '3'" />
</p>
<div v-for="(item, index) in pdfList" :key="index">
<p>需阅读</p>
<div class="mb10 mt10 flex align-items-c justify-content-fs">
<span class="red">{{ item.documentName }}</span>
<img :src="src" v-if="item.documentStatus == '0'" />
</div>
</div>
<p class="start">点击开始按钮进行相关操作</p>
</van-cell-group>
<!-- 短信验证 -->
<van-dialog
v-model="show"
title="短信确认"
show-cancel-button
cancelButtonColor="#4FC6B3"
class="dialog-delete"
confirmButtonColor="#FFFFFF"
@confirm="authConfirm(authCode)"
@cancel="clearTimer"
>
<p class="p10 fs14">向此手机发送验证码确认用户身份</p>
<p class="p10 fs14" style="border-bottom: 1px solid #ebedf0">{{ customerMobile }}</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">
<van-button
:type="submitForbidden ? '' : 'danger'"
:color="submitForbidden ? 'gray' : ''"
v-if="isSigned || submitForbidden"
size="large"
:disabled="nextDisabled || submitForbidden"
@click="show = true"
v-no-more-click="2000"
>提交申请</van-button
>
<!-- <van-button color="gray" v-else-if="submitForbidden" size="large" disabled>提交申请失败</van-button> -->
<!-- <van-button color="gray" v-else-if="linkInvalid" size="large" disabled>链接已失效</van-button>
<van-button color="gray" v-else-if="isCanceled" size="large" disabled>代理人已撤销</van-button> -->
<van-button type="danger" v-else size="large" @click="start" v-no-more-click="2000">开始</van-button>
<van-button type="danger" size="large" @click="startPage" v-no-more-click="2000">开始</van-button>
</div>
</div>
</template>
<script>
import { Field, Cell, Collapse, CollapseItem, CellGroup, Dialog } from 'vant'
import { customerInfoShare, orderDetail, authCode, changeStatus, queryCancel } from '@/api/ebiz/preserve/preserve'
import { checkSignInvalid } from '@/api/ebiz/sale/sale'
import { queryConfirmDetail } from '@/api/ebiz/preserve/preserve'
import DataDictionary from '../js/data-dictionary'
export default {
name: 'RenewalConfirmation',
components: {
@@ -110,86 +82,37 @@ export default {
},
data() {
return {
show: false, // 获取短信验证码
codeDisabled: false, // 获取验证码按钮是否禁用
timeId: null, // 计时器ID
countDown: 60, // 倒计时
authCode: '', // 验证码
activeNames: [0],
src: this.$assetsUrl + 'images/u6490.png', // 图片路径
policyList: [],
list: [
// {
// contNo: 'HL052019110010001047',
// riskName: '鼎诚人寿重大疾病险',
// appntName: '嘿嘿',
// insuredName: '狗乐',
// insuPayType: '11',
// cvaliDate: '2020-12-31',
// contState: '001',
// accountName: '彭小芳',
// bankCode: '102',
// bankNo: '374198274319824389127341'
// },
// {
// contNo: 'HL052019110010001047',
// riskName: '鼎诚人寿重大疾病险',
// appntName: '嘿嘿',
// insuredName: '狗乐',
// insuPayType: '11',
// cvaliDate: '2020-12-31',
// contState: '001',
// accountName: '彭小芳',
// bankCode: '102',
// bankNo: '374198274319824389127341'
// }
],
newBank: '', //新开户银行
newBankNo: '', //新银行卡号
customerMobile: '',
sessionId: '',
nextDisabled: true,
signInvalid: '',
isSigned: false, //是否签完名了
submitForbidden: false, //是否提交申请失败
linkInvalid: false, //链接是否失效
isCanceled: false, //是否撤销
documentStatus: '' //签名状态
list: [],
pdfList: [],
customerInfo: JSON.parse(localStorage.getItem('preserve-customerInfo'))
}
},
filters: {
idToText: function idToTextEdor(id, type) {
let text = ''
DataDictionary[type].some(item => {
if (item.id == id) {
text = item.label
}
})
return text
}
},
async created() {
this.$route.query.customerInfo && (localStorage.customerInfo = decodeURI(this.$route.query.customerInfo))
this.$route.query.token && (localStorage.token = this.$route.query.token)
this.customerMobile = JSON.parse(localStorage.customerInfo).customerMobile
//是否已经签名
if (sessionStorage.customerSign && JSON.parse(sessionStorage.customerSign).isSign) {
this.isSigned = true
} else {
this.isSigned = false
//token签名
if (this.$route.query.signInvalid) {
localStorage.signInvalid = this.$route.query.signInvalid
this.signInvalid = this.$route.query.signInvalid
//token是否过期
let resData = await this.checkSignInvalid(this.signInvalid)
if (resData == '1') {
this.linkInvalid = false
} else {
this.linkInvalid = true
}
}
}
// 获取基本信息
this.init()
},
methods: {
start() {
startPage() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/preserve/autopayAuthorization'
url: location.origin + '/#/preserve/pc/autopayAuthorization'
},
routerInfo: {
path: '/preserve/autopayAuthorization'
path: '/preserve/pc/autopayAuthorization'
}
})
},
@@ -202,241 +125,22 @@ export default {
loadingType: 'spinner',
message: '加载中……'
})
// await this.isPreserveCancel()
//如果没有被撤销
// if (backData == 'notCanceled') {
let params = {
surrenderType: '2', //"1","基本信息变更" "2","续期账号变更" "3","红利领取"
customerInfoDTOList: [],
mediaDTOList: [],
surrenderId: JSON.parse(localStorage.customerInfo).surrenderId,
edorapplyNo: JSON.parse(localStorage.customerInfo).edorapplyNo || JSON.parse(localStorage.customerInfo).edorApplyNo
edorType: 'PC',
surrenderId: this.customerInfo.surrenderId,
edorapplyNo: this.customerInfo.edorapplyNo
}
let res = await customerInfoShare(params)
this.$toast.clear()
if (res.result == 0) {
if (!JSON.parse(localStorage.customerInfo).contNo) {
res.content.accountResList.forEach(item => {
// this.policyList.push(item.contNo)
if (item.isNewInfo == '0') {
this.policyList.push({
contNo: item.contNo,
surrenderStatus: item.surrenderStatus
})
this.newBank = item.bankName
this.newBankNo = item.bankNo
}
})
localStorage.policyList = JSON.stringify(this.policyList)
} else {
//如果是从保全进度查询分享进来(只有一个单)
res.content.accountResList.forEach(item => {
// this.policyList.push(item.contNo)
if (item.contNo == JSON.parse(localStorage.customerInfo).contNo && item.isNewInfo == '0') {
this.policyList.push({
contNo: item.contNo,
surrenderStatus: item.surrenderStatus
})
this.newBank = item.bankName
this.newBankNo = item.bankNo
}
})
}
//未签名并且链接有效的情况下
if (!this.isSigned && !this.linkInvalid) {
//撤销
this.isCanceled = res.content.accountResList.every(item => {
return item.surrenderStatus == 5
})
}
//未签名并且链接有效的情况下
if (!this.linkInvalid) {
//已提交
this.submitForbidden = res.content.accountResList.every(item => {
return item.surrenderStatus == 3 || item.surrenderStatus == 6 || item.surrenderStatus == 9 || item.surrenderStatus == 7
})
}
//未签名&链接有效&未撤销
// if (!this.isSigned && !this.linkInvalid && !this.isCanceled) {
// //提交申请失败
// this.submitForbidden = res.content.accountResList.every(item => {
// return item.surrenderStatus == 7
// })
// }
// localStorage.signList = JSON.stringify(res.content.signList[0])
if (!sessionStorage.customerSign) {
let customerSign = {
baseEncryp: '',
policyUrl: res.content.signList[0].policyUrl
}
sessionStorage.customerSign = JSON.stringify(customerSign)
}
this.documentStatus = res.content.signList[0].documentStatus
this.getOrderDetail({
contNo: this.policyList[0].contNo
})
} else {
this.$toast(res.resultMessage)
}
// }
},
// 获取短信验证码
getAuthCode() {
this.codeDisabled = true
//倒计时
this.timeId = setInterval(() => {
this.countDown--
if (this.countDown <= 0) {
window.clearInterval(this.timeId)
this.codeDisabled = false
this.countDown = 60
}
}, 1000)
authCode({
operateType: 'smslogin',
sessionId: '',
validateCode: '',
operateCode: this.customerMobile,
system: '',
operateCodeType: '0'
}).then(res => {
queryConfirmDetail(params).then(res => {
this.$toast.clear()
if (res.result == 0) {
this.sessionId = res.sessionId
// 处理
this.list = res.content.content
this.pdfList = res.content.surrenderSignList
} else {
this.$toast(res.resultMessage)
}
})
},
// 验证码确认事件
async authConfirm() {
//清理计时器
this.clearTimer()
changeStatus({
surrenderId: JSON.parse(localStorage.customerInfo).surrenderId,
surrenderStatus: '3',
smsCodeDTO: {
smsId: this.sessionId,
code: this.authCode
}
}).then(resDdata => {
if (resDdata.result == 0) {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/preserve/submitResult`
},
routerInfo: {
path: `/preserve/submitResult`
}
})
} else {
this.$toast(resDdata.resultMessage)
}
})
},
// 清理计时器
clearTimer() {
window.clearInterval(this.timeId)
this.timeId = null
this.countDown = 60
this.codeDisabled = false
},
changeCollapse(params) {
console.log(params)
},
//展开保单详情
collapseChange(val) {
if (val.length) {
let flag = true
this.list.forEach(item => {
if (item.contNo == this.policyList[val[val.length - 1]].contNo && item.riskName) {
return (flag = false)
}
})
if (flag) {
this.getOrderDetail({
contNo: this.policyList[val[val.length - 1]].contNo
})
}
}
},
//获取保单详情
async getOrderDetail(data) {
let res = await orderDetail(data)
if (res.result == 0) {
this.nextDisabled = false
let flag = true
this.list.forEach((item, index) => {
if (item.contNo == data.contNo) {
flag = false
console.info(index, item, res.content)
// this.list.splice(index, 1, res.content)
this.list.splice(index, 1, Object.assign(this.policyList[index], res.content))
}
})
if (flag) {
// this.list.push(res.content)
this.list.push(Object.assign(this.policyList[0], res.content))
this.policyList.forEach((item, index) => {
if (index != 0) {
this.list.push(item)
}
})
}
} else {
this.$toast(res.resultMessage)
}
},
//提交申请
submit() {},
// 在微信中校验token是否失效
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)
} else {
reject()
}
})
})
},
//查询撤销
async isPreserveCancel() {
return new Promise((resolve, reject) => {
let data = {
surrenderId: JSON.parse(localStorage.customerInfo).surrenderId
}
queryCancel(data).then(res => {
//result=0 已撤销
if (res.result == 0) {
this.isCanceled = true
resolve()
} else {
this.isCanceled = false
reject()
}
})
})
}
},
beforeDestroy() {
//清理计时器
this.clearTimer()
}
}
</script>

View File

@@ -4,18 +4,18 @@
<van-cell-group class="mt10 cont-info-container">
<!-- 保单信息 -->
<p style="border-bottom: 1px solid #ebedf0" class=" fs15 fwb pl10 pv12">保单信息</p>
<van-collapse v-model="activeNames" @change="collapseChange">
<van-collapse v-model="activeNames">
<div v-for="(item, index) in list" :key="index">
<van-collapse-item :title="`保单号:${item.policyNo}`" :name="index">
<van-collapse-item :title="`保单号:${item.contNo}`" :name="index">
<van-cell title="产品名称" :value="item.riskName" />
<van-cell title="投保人" :value="item.appntName" />
<van-cell title="被保险人" :value="item.insuredName" />
<van-cell title="交费方式" :value="item.tradeAbstract" />
<van-cell title="保单生效日期" :value="item.cvaliDate" />
<van-cell title="交费方式" :value="item.tradeAbstract | idToText('pcPayMode')" />
<van-cell title="保单生效日期" :value="item.cvalidate" />
<van-cell title="保单状态" :value="item.contState" />
<van-cell title="开户人姓名" :value="item.accountDTO.accountName" />
<van-cell title="原开户银行" :value="item.accountDTO.bankName" />
<van-cell title="原银行卡号" :value="item.accountDTO.bankNo" />
<van-cell title="开户人姓名" :value="item.accountName" />
<van-cell title="原开户银行" :value="item.bankCode | idToText('edorBankType')" />
<van-cell title="原银行卡号" :value="item.bankNo" />
</van-collapse-item>
</div>
</van-collapse>
@@ -68,8 +68,10 @@
<script>
import { Field, Collapse, CollapseItem, Cell, CellGroup, Dialog, Popup, List } from 'vant'
import BankCardScan from '@/components/ebiz/sale/BankCardScan'
import { policyList, renewalChange } from '@/api/ebiz/preserve/preserve'
import { pcPolicyInfo, renewalChange, changeEdor } from '@/api/ebiz/preserve/preserve'
import { getBankList } from '@/api/ebiz/sale/sale'
import DataDictionary from '../js/data-dictionary'
export default {
name: 'renewalInfo',
components: {
@@ -92,49 +94,39 @@ export default {
isScan: false, // 是否扫描银行卡
activeNames: [0],
show: true,
list: [
// {
// contNo: 'HL052019110010001047',
// riskName: '鼎诚人寿重大疾病险',
// appntName: '嘿嘿',
// insuredName: '狗乐',
// insuPayType: '11',
// cvaliDate: '2020-12-31',
// contState: '001',
// accountName: '彭小芳',
// bankCode: '102',
// bankNo: '374198274319824389127341'
// },
// {
// contNo: 'HL052019110010001047',
// riskName: '鼎诚人寿重大疾病险',
// appntName: '嘿嘿',
// insuredName: '狗乐',
// insuPayType: '11',
// cvaliDate: '2020-12-31',
// contState: '001',
// accountName: '彭小芳',
// bankCode: '102',
// bankNo: '374198274319824389127341'
// }
],
list: [],
customerInfo: JSON.parse(localStorage.getItem('preserve-customerInfo'))
}
},
filters: {
idToText: function idToTextEdor(id, type) {
let text = ''
DataDictionary[type].some(item => {
if (item.id == id) {
text = item.label
}
})
return text
}
},
created() {
this.getPolicyList({
customerNo: this.customerInfo.customerNo
customerNo: this.customerInfo.customerNo,
edorType: 'PC', //续期账号变更
idno: this.customerInfo.idNo,
mobile: this.customerInfo.customerMobile,
name: this.customerInfo.customerName
})
this.getBank()
},
mounted() {
// 筛选按钮的点击事件
window.appCallBack = this.appCallBack
Dialog.confirm({
/*Dialog.confirm({
title: '提示',
message: '该客户涉及到的所有保单相应信息将变更',
showCancelButton: false
})
})*/
},
methods: {
// 选择银行
@@ -159,7 +151,6 @@ export default {
// 银行卡扫描
cardScanning(cardScanningType) {
window.localStorage.setItem('cardScanningType', cardScanningType)
document.body.style.backgroundColor = '#F5F5F5'
let title = ''
this.isclear = false
;[this.isScan, title] = [true, '银行卡扫描']
@@ -213,18 +204,22 @@ export default {
},
//获取保单详情
async getPolicyList(data) {
policyList(data).then(res => {
pcPolicyInfo(data).then(res => {
if (res.result == 0) {
this.list = res.content.policyListDTOList
this.list = res.content
} else {
this.$toast(res.resultMessage)
if (res.content) {
this.$toast(res.content)
} else {
this.$toast(res.resultMessage)
}
}
})
},
// 获取银行卡列表
async getBank() {
let data = {
operateType: 'edor_bank_type'
operateType: 'bank_type'
}
let res = await getBankList(data)
if (res.result == '0') {
@@ -234,57 +229,48 @@ export default {
}
},
change() {
//续期账号变更参数
// let params = {
// surrenderDTOList: []
// }
let originList = []
let policyListDTO = []
let surrenderDTOList = {
platformType: 'app',
edorType: 'PC',
operateType: '01',
customerNo: this.customerInfo.customerNo,
name: this.customerInfo.customerName,
iDNo: this.customerInfo.idNo,
mobile: this.customerInfo.customerMobile,
pcAccountDTOList: []
}
this.list.forEach(item => {
originList.push(Object.assign({}, item.accountDTO))
policyListDTO.push(
surrenderDTOList.pcAccountDTOList.push(
Object.assign(
{},
{
riskName: item.riskName,
policyNo: item.policyNo,
accountName: item.accountName,
bankName: item.bankName,
accountType: item.accountType,
bankCode: item.bankCode,
bankNo: item.bankNo,
bankProvince: item.bankProvince,
isNewInfo: item.isNewInfo,
contNo: item.bankNo,
appntName: item.appntName,
insuredName: item.insuredName,
cvaliDate: item.cvaliDate,
tradeAbstract: item.tradeAbstract,
cvalidate: item.cvalidate,
contState: item.contState,
surrenderReason: item.surrenderReason,
surrenderRate: item.surrenderRate,
surrenderMoney: item.surrenderMoney
riskName: item.riskName,
tradeAbstract: item.tradeAbstract
}
)
)
})
let surrenderDTOList = []
this.list.forEach((item, index) => {
surrenderDTOList[index] = {
surrenderId: '',
edorapplyNo: '',
surrenderType: '3', //保全项1-联系方式变更 2-受益人变更 3-续期账号变更 4-犹退 5-退保
policyListDTOList: policyListDTO[index],
accountDTOList: []
}
surrenderDTOList[index].accountDTOList.push(
Object.assign(item.accountDTO, {
isNewInfo: '0',
bankName: this.bank,
bankNo: this.bankNo,
bankCode: this.bankCode
})
)
surrenderDTOList[index].accountDTOList.push(
Object.assign(originList[index], {
isNewInfo: '1'
})
)
})
renewalChange({ surrenderDTOList }).then(res => {
let changeItem = {
isNewInfo: '0',
bankCode: this.bankCode,
bankName: this.bank,
bankNo: this.bankNo,
accountName: this.list[0].accountName
}
surrenderDTOList.pcAccountDTOList.push(changeItem)
changeEdor(surrenderDTOList).then(res => {
if (res.result == 0) {
this.customerInfo.surrenderId = res.content.surrenderId
this.customerInfo.edorApplyNo = res.content.edorApplyNo
@@ -293,10 +279,10 @@ export default {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/preserve/imageUpload`
url: location.origin + `/#/preserve/pc/imageUpload`
},
routerInfo: {
path: `/preserve/imageUpload`
path: `/preserve/pc/imageUpload`
}
})
} else {