Files
ebiz-h5/src/views/ebiz/sale/List.vue
2025-11-18 14:56:53 +08:00

897 lines
32 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="sale-list-container pb50 text-center" v-if="isCheck == 1">
<p class="f10 gray mt60">您暂无使用权限</p>
<p class="f10 gray mt5">如有问题咨询请联系个险业务部</p>
</div>
<div class="sale-list-container pb50" v-else-if="isCheck == 0">
<van-search placeholder="请输入投保人姓名" v-model="searchName" @change="searchList" @keyup.enter="searchList" />
<van-sticky>
<van-tabs :line-width="45" v-model="active" @change="tabChange" sticky>
<van-tab name="uncommit" title="未提交"></van-tab>
<van-tab name="commit" title="已提交"></van-tab>
<van-tab name="waitUnderwritten" title="待承保"></van-tab>
</van-tabs>
</van-sticky>
<van-list v-model="loading" :immediate-check="false" :finished="finished" :finished-text="finishedText"
error-text="请求失败点击重新加载" :error.sync="error" @load="loadMore" class="pb45">
<div v-if="isSuccess">
<div v-if="saleList.length > 0">
<div v-for="(order, index) in saleList" :key="index">
<div class="fs12 mt20 mb5 text-center">{{ order.orderInfoDTO.createDate }}</div>
<div class="bg-white m15 pv15 pr15 pl10">
<div class="flex justify-content-s align-items-c">
<div>
<div class="w45 inline-b">
<van-tag plain color="#5CA7DE">投保</van-tag>
</div>
<span class="fs15 c-gray-dark">{{ order.appntDTO.name }}</span>
</div>
</div>
<div v-for="(insured, insuredIndex) in order.insuredDTOs" :key="insuredIndex">
<div class="mv15">
<div class="w45 inline-b">
<van-tag plain color="#DD9C56">被保</van-tag>
</div>
<span class="fs15 c-gray-dark">{{ insured.name }}</span>
</div>
<div v-for="(main, mainIndex) in insured.mainRisk" :key="mainIndex">
<div class="mv10">
<span class="w45 inline-b">
<van-tag plain type="danger">主险</van-tag>
</span>
<span class="fs15 c-gray-dark">{{ main.riskName }}</span>
</div>
<div class="mv10 pl45 flex" v-for="(addtional, addtionIndex) in main.addtion" :key="addtionIndex">
<span class="mr10" style="flex-shrink: 0">
<van-tag mark color="#DDF2EF" text-color="#E9332E">附加</van-tag>
</span>
<span class="fs13">{{ addtional.riskName }}</span>
</div>
</div>
</div>
<div class="flex fs15 justify-content-s mt15 mb15">
<span class="c-gray-darker fwb">首期总保费</span>
<span class="yellow fwb">{{ order.firstPrem == 0 ? '0.00' : order.firstPrem | moneyFormat }}</span>
</div>
<div class="pt15" v-if="active == 'commit' || active == 'waitUnderwritten'"
style="border-top:1px solid #dadada">
<div>
<div class="w80 inline-b">
<van-tag plain color="#999999">投保单号</van-tag>
</div>
<span class="fs14 c-gray-dark">{{ order.orderInfoDTO.orderNo }}</span>
</div>
<div class="mt10" v-if="active == 'commit' || active == 'waitUnderwritten'" >
<div class="w80 inline-b">
<van-tag plain color="#999999">状态</van-tag>
</div>
<span class="fs14 c-gray-dark">{{ order.stateName }}</span>
</div>
</div>
<div v-if="!!order.orderInfoDTO.doubleFlag && order.orderInfoDTO.doubleFlag == '0'" class="fs12 mt15">
<div v-if="branchType =='14' && order.insuredDTOs[0].riskDTOLst[0].insuYear > 1">
温馨提示一年期以上保险产品需按监管要求双录请及时双录
</div>
<div v-else>
温馨提示本投保单满足双录条件需要双录质检通过后才能承保
</div>
</div>
<div class="text-right mt15 ">
<van-button round @click="goInsuredInform(order)" size="small" v-if="buttonShow == '14'"
:disabled="order.emailStatus == 'disable'" class="mr5" type="danger" v-no-more-click="1000">
获取投保资料
</van-button>
<van-button v-if="active == 'uncommit'" round @click="goDetail(order)" size="small" class="mr5"
type="danger" v-no-more-click="1000">
编辑
</van-button>
<van-button v-if="active == 'uncommit'" plain round @click.stop="del(order, index)" size="small"
class="mr5" type="danger" v-no-more-click="1000">
删除
</van-button>
<van-button @click="againPay(order)" v-if="active == 'commit' && order.orderInfoDTO.orderStatus == '19'"
size="small" class="mr5" type="danger" round>
重新支付
</van-button>
<van-button @click="changeCard(order)"
v-if="(active == 'commit' && order.orderInfoDTO.orderStatus == '48') || (active == 'commit' && order.orderInfoDTO.orderStatus == '49')"
size="small" class="mr5" type="danger" round>
修改卡号
</van-button>
<template v-if="active == 'commit' && order.orderInfoDTO.orderStatus == '55'">
<van-button @click="changeCard(order)" size="small" class="mr5" type="danger" round>
修改卡号
</van-button>
<van-button @click="againPay(order)" size="small" class="mr5" type="danger" round>
重新支付
</van-button>
</template>
<template
v-if="active == 'commit' && (order.orderInfoDTO.orderStatus == '02' || order.orderInfoDTO.orderStatus == '58')">
<van-button @click="goPay(order)" size="small" class="mr5" type="danger" round>
支付
</van-button>
</template>
<!-- doubleFlag 1- 0-doubleFlag为0双录时canRevokeDouble加 orderStatus 16 -->
<van-button @click="revokeOrder(order)"
v-if="active == 'commit' && ((canRevoke[order.orderInfoDTO.orderStatus] && (order.orderInfoDTO.doubleFlag == '1' || order.orderInfoDTO.doubleFlag == null || order.orderInfoDTO.doubleFlag == '')) || (canRevokeDouble[order.orderInfoDTO.orderStatus] && order.orderInfoDTO.doubleFlag == '0'))"
size="small" class="mr5" type="danger" round>
撤单
</van-button>
<van-button @click="seePolicy(order)" v-if="active == 'commit'" size="small" type="danger" round>
查看投保单
</van-button>
</div>
</div>
</div>
</div>
<div v-else class="text-center">
<img class="mt40" src="@/assets/images/pic_page-non.png" />
<div class="fs17 mt40">暂无订单</div>
</div>
</div>
</van-list>
<van-button type="danger" class="bottom-btn" @click="add" v-no-more-click="1000">点我新增</van-button>
<van-dialog class="dialog-delete" @confirm="checkCaptchaCode" @cancel="cancelCaptchaCode"
:before-close="beforeClose" confirm-button-color="#fff" v-model="revokePanelShow" title="短信验证" show-cancel-button>
<p class="captchaReceiver">投保人手机号: {{ captchaReceiver | phoneNumFilter }}</p>
<van-field v-model="sms" center clearable placeholder="请输入短信验证码">
<template #button>
<van-button :disabled="sendTime !== 0" v-no-more-click="1000" @click="getCaptchaCode" size="small"
type="danger">{{
sendTime ? `${sendTime}s后获取` : '获取验证码'
}}</van-button>
</template>
</van-field>
</van-dialog>
<!-- <van-dialog class="dialog-getInform" @confirm="checkCaptchaCode" @cancel="cancelCaptchaCode" :before-close="beforeClose" confirm-button-color="#fff" v-model="getInformShow" title="获取投保资料">
<p class="captchaReceiver">请输入您获取投保资料的邮箱</p>
<van-field v-model="sms" center clearable placeholder="请输入短信验证码">
</van-field>
</van-dialog> -->
<van-popup v-model="getInformShow" round closeable class="insure-popup">
<div class="insure-email">
<div class="email-box">
<div class="email-title">获取投保资料</div>
<div class="email-content">
<div v-if="inputShow">
<div class="email-c">请输入您获取投保资料的邮箱</div>
<van-field class="email-input" v-model="emailForm.email" placeholder="请输入邮箱"
v-validate="'required|email'" />
</div>
<div v-if="contentShow">
{{ emailContent }}
</div>
</div>
<div class="email-btn">
<van-button type="danger" @click="inputShow ? getInformOk() : tipOk()" round>确定</van-button>
</div>
</div>
</div>
</van-popup>
<!-- 短信验证 -->
<check-agent @checModelSuccessMethod="initThisPage" />
</div>
</template>
<script>
import { Search, Tabs, Tab, List, Tag, Sticky, Toast, Dialog, Field } from 'vant'
import { orderList, deleteOrderInfo, getAuthCode, revokeOrder, getBankCardSignState, getSendEmail, getDownloadZip } from '@/api/ebiz/sale/sale'
import { funcPermCheck } from '@/api/ebiz/common/common'
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
import CheckAgent from '@/components/common/CheckAgent'
import { getAgentInfo } from '@/api/ebiz/my/my'
export default {
name: 'saleList',
components: {
[CheckAgent.name]: CheckAgent,
[Field.name]: Field,
[Search.name]: Search,
[Tabs.name]: Tabs,
[Tab.name]: Tab,
[List.name]: List,
[Tag.name]: Tag,
[Sticky.name]: Sticky,
[Dialog.name]: Dialog
},
data() {
return {
isCheck: 0, //查看是否有权限
showFlag: true,
searchName: '',
active: 'uncommit', //uncommit 表示未提交 commit表示已提交
saleList: [],
loading: false,
finished: false,
total: '', //总页数
currentPage: 1, //当前页数
error: false,
finishedText: '没有更多了',
pageSize: 5, //每页数据条数
isSuccess: false,
canRevoke: {
'19': true,
'02': true,
'48': true,
'49': true,
'55': true,
'58': true,
'46': true,
'50': true,
'51': true
},
canRevokeDouble: {
'19': true,
'02': true,
'48': true,
'49': true,
'55': true,
'58': true,
'46': true,
'50': true,
'51': true,
'16': true,
},
revokePanelShow: false,
sms: '',
smsId: '',
sendTime: 0,
getCaptcha: false,
captchaTimer: null,
captchaReceiver: '',
revokeOrderNo: '',
captchaMaped: false,
getInformShow: false,
emailForm: { email: '' },
inputShow: true,
contentShow: false,
buttonShow: '',
emailContent: '系统将会将投保资料发送至您录入邮箱,解压密码为投保人身份证号的后六位,请您稍后进行查看',
branchType: ''
}
},
created() {
if(this.$CacheUtils.getLocItem('branchType')) {
this.branchType = this.$CacheUtils.getLocItem('branchType')
}else{
this.getAgentInfo()
}
},
mounted() {
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
funcPermCheck({}).then(res => {
this.isCheck = res.result
})
if (window.localStorage.getItem('branchType') == '14') {
this.buttonShow = localStorage.getItem('branchType')
}
},
methods: {
async getAgentInfo() {
const result = await getAgentInfo({})
if (result.result === '0') {
this.branchType = result.branchType
localStorage.setItem('branchType', this.branchType)
this.$CacheUtils.setLocItem('branchType', this.branchType)
}
},
beforeClose(action, done) {
this.captchaMaped ? done() : done(false)
},
async getCaptchaCode() {
if (this.sendTime !== 0) return
this.getCaptcha = true
this.sendTime = 60
let data = {
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.captchaReceiver,
system: 'agentApp',
operateCodeType: '0'
}
let res = await getAuthCode(data)
if (res.result === '0') {
this.$toast('获取验证码成功')
}
this.smsId = res.sessionId
this.captchaTimer = setInterval(() => {
this.sendTime--
if (this.sendTime === 0) {
clearInterval(this.captchaTimer)
this.captchaTimer = null
}
}, 1000)
},
async checkCaptchaCode() {
if (!this.getCaptcha) {
return this.$toast('请先获取验证码')
}
if (!this.sms.trim()) {
return this.$toast('请输入验证码')
}
clearInterval(this.captchaTimer)
this.captchaTimer = null
let revokeResult = await revokeOrder({
id: this.revokeOrderNo,
smsId: this.smsId,
code: this.sms
})
if (revokeResult.result == 0) {
this.$toast('撤单成功!')
setTimeout(() => {
this.saleList = []
this.isSuccess = false
this.currentPage = 1
;[this.loading, this.finished] = [true, false]
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active
}
this.loadMore(pageInfo)
}, 1000)
} else {
Toast.fail(revokeResult.resultMessage)
}
this.cancelCaptchaCode()
this.sms = ''
},
cancelCaptchaCode() {
this.sendTime = 0
this.revokePanelShow = false
clearInterval(this.captchaTimer)
this.captchaTimer = null
this.getCaptcha = false
this.captchaMaped = false
this.captchaReceiver = ''
},
initThisPage(showFlag) {
this.showFlag = showFlag
if (this.showFlag) {
return
}
this.loadMore()
},
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.$jump({
flag: 'home'
})
}
},
//分页用
loadMore() {
if (this.showFlag) {
return
}
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active,
name: this.searchName,
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.getOrderList(pageInfo)
},
//再次支付
againPay(order) {
localStorage.orderNo = order.orderInfoDTO.orderNo
// 再次支付 salelist为 0
localStorage.salelist = '0'
localStorage.removeItem('changeCard')
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/payMent?orderNo=' + order.orderInfoDTO.orderNo
},
routerInfo: { path: '/sale/payMent?orderNo=' + order.orderInfoDTO.orderNo }
})
},
//支付失败去换卡
changeCard(order) {
let url = ''
let orderStatus = order.orderInfoDTO.orderStatus
localStorage.orderNo = order.orderInfoDTO.orderNo
if (order.insuredDTOs[0].riskDTOLst[0]) {
localStorage.setItem('productCode', order.insuredDTOs[0].riskDTOLst[0].mainRiskCode)
}
localStorage.setItem('changeCard', true)
switch (orderStatus) {
case '55': //账户信息页
url = '/sale/AccountInformation?orderNo=' + order.orderInfoDTO.orderNo
break
case '48': //账户信息填写成功,跳到影像上传页
url = '/sale/AttachmentManagement?orderNo=' + order.orderInfoDTO.orderNo
break
case '49': //影像上传页填写成功,跳到银行卡号确认页
url = '/sale/SignatureConfirmation?orderNo=' + order.orderInfoDTO.orderNo + '&branchType=' + this.branchType
break
}
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#${url}`
},
routerInfo: { path: url }
})
},
//去支付
goPay(order) {
localStorage.orderNo = order.orderInfoDTO.orderNo
localStorage.setItem('AppntidType', order.appntDTO.idType)
localStorage.salelist = '1'
localStorage.removeItem('changeCard')
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/payMent?orderNo=' + order.orderInfoDTO.orderNo
},
routerInfo: { path: '/sale/payMent?orderNo=' + order.orderInfoDTO.orderNo }
})
},
//查看保单
seePolicy(order) {
localStorage.orderNo = order.orderInfoDTO.orderNo
localStorage.removeItem('changeCard')
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/detail?type=1&orderNo=' + order.orderInfoDTO.orderNo
},
routerInfo: {
path: '/sale/detail?orderNo=' + order.orderInfoDTO.orderNo,
query: {
type: 1
}
}
})
},
//初始化保单列表
getOrderList(pageInfo) {
orderList(pageInfo).then(res => {
if (res.result == '0') {
this.isSuccess = true
this.currentPage++
if (res.orderDTOPageInfo == null || res.orderDTOPageInfo == '' || res.orderDTOPageInfo == undefined) {
this.finished = true
this.loading = false
this.finishedText = ''
return
}
let list = res.orderDTOPageInfo.list
if (list.length == 0) {
this.finishedText = ''
} else {
this.finishedText = '已经全部加载'
}
list = formatRiskList(list, 'insuredDTOs', 'riskDTOLst') //根据后面两个参数 来格式化数据
dataDictionary.policyState.forEach(state => {
list.forEach(order => {
if (state.id == order.orderInfoDTO.orderStatus) {
order.stateName = state.text
}
})
})
this.saleList = this.saleList.concat(list)
if (this.saleList.length == 0) {
this.isSuccess = false
}
this.loading = false
if (res.orderDTOPageInfo.nextPage == 0) {
//当下一页为0时 表示全部数据加载完毕
this.finished = true
}
} else {
this.finished = true
this.loading = false
this.finishedText = res.resultMessage
}
})
},
tabChange(name) {
this.currentPage = 1
this.active = name
this.saleList = []
;[this.loading, this.finished] = [true, false]
this.finishedText = '正在加载...'
this.loadMore()
},
searchList() {
this.currentPage = 1
this.saleList = []
;[this.loading, this.finished] = [true, false]
this.finishedText = '正在加载...'
this.loadMore()
},
//投保单详情
async goDetail(order) {
let thisToken = this.$CacheUtils.getLocItem('token')
let thisbranchType = ''
if (this.$CacheUtils.getLocItem('branchType') == '13') {
thisbranchType = this.$CacheUtils.getLocItem('branchType')
}
window.localStorage.clear()
this.$CacheUtils.setLocItem('token', thisToken)
if (thisbranchType) {
this.$CacheUtils.setLocItem('branchType', thisbranchType)
}
window.localStorage.setItem('detailJump', '')
if (order.insuredDTOs[0]) {
if (order.insuredDTOs[0].riskDTOLst[0]) {
localStorage.setItem('productCode', order.insuredDTOs[0].riskDTOLst[0].mainRiskCode)
}
}
let orderStatus = order.orderInfoDTO.orderStatus
console.log(order,'order')
let orderNo = order.orderInfoDTO.orderNo
let url = ''
//保存对应的订单号
localStorage.orderNo = orderNo
localStorage.isFrom = 'sale'
localStorage.removeItem('changeCard')
if(orderStatus == '01'){ //已签名待客户确认, 跳到签名确认页面
url = '/sale/SignatureConfirmation?edit=1&orderNo='+orderNo + '&branchType=' + this.branchType
}else if(orderStatus == '43'){//未签名待客户确认, 跳到签名确认页面
url = '/sale/SignatureConfirmation?edit=1&orderNo='+orderNo + '&branchType=' + this.branchType
}else if(orderStatus == '35'){//投保人保存成功, 跳到被保险人页面
url = '/sale/insuredPerson?edit=1&orderNo='+orderNo + '&branchType=' + this.branchType
}else if(orderStatus == '36'){//被保险人保存成功, 跳到已选产品列表
url = '/common/selectedProduct?edit=1&orderNo='+orderNo + '&branchType=' + this.branchType
}else if(orderStatus == '37'){//受益人保存成功, 跳到告知信息--
url = '/sale/NotifyingMessage?edit=1&orderNo='+orderNo
}else if(orderStatus == '38'){ //账户信息保存成功, 跳到附件管理--
if(order.orderInfoDTO.activeType == 'KMH') {
let params = {
orderNo: order.orderInfoDTO.orderNo
}
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……',
})
await getBankCardSignState(params).then(res => {
this.$toast.clear()
if (res.result == 0) {
if (res.content.needSign == '0' || res.content.needSign == null) {
if (res.content.signState == '0' || res.content.signState == '2') {
url = '/sale/AttachmentManagement?edit=1&orderNo=' + orderNo
} else {
url = '/sale/AccountInformation?edit=1&orderNo=' + orderNo
}
} else {
url = '/sale/AccountInformation?edit=1&orderNo=' + orderNo
}
} else {
this.$toast(res.resultMessage)
}
})
} else {
url = '/sale/AttachmentManagement?edit=1&orderNo=' + orderNo
}
}else if(orderStatus == '39'){ //险种信息保存成功, 跳到已选产品列表
url = '/common/selectedProduct?edit=1&orderNo='+orderNo+ '&branchType=' + this.branchType
}else if(orderStatus == '40'){//告知信息保存成功, 跳到风险测评--
//if( order.riskEvaluationDTO.isShowEvaluationPoint != '1'){
if(order.universalRiskNotifyDTO && order.universalRiskNotifyDTO.isUniversalRiskNotifyShowPoint == '1'){
url = '/sale/universalRiskNotifyingMessage?edit=1&orderNo='+orderNo
}else{
url = '/sale/AccountInformation?edit=1&orderNo='+orderNo
}
// } else {
// url = '/sale/answerPage?edit=1&orderNo=' + orderNo
// }
} else if(orderStatus == '' || (orderStatus == '66' && this.branchType == '14')){
/*
*跳到投保人
*银保渠道特殊情况66投保人信息填写不完整
*/
url = '/sale/insuredInfo?edit=1&orderNo='+orderNo
}else if(orderStatus == '44'){//建议书转投保, 跳到投保人
url = '/sale/insuredInfo?edit=1&orderNo='+orderNo
}
// else if(orderStatus == '62'){//风险测评保存成功, 跳到账户信息--
// if(order.universalRiskNotifyDTO && order.universalRiskNotifyDTO.isUniversalRiskNotifyShowPoint != '1'){
// url = '/sale/AccountInformation?edit=1&orderNo='+orderNo
// }else{
// url = '/sale/universalRiskNotifyingMessage?edit=1&orderNo='+orderNo
// }
// }
else if (orderStatus == '63') {//风险测评保存成功, 跳到账户信息--
url = '/sale/AccountInformation?edit=1&orderNo=' + orderNo
//}
// else {
// url = '/sale/answerPage?edit=1&orderNo='+orderNo
// }
}
// else if(orderStatus == ''){//跳到投保人
// url = '/sale/insuredInfo?edit=1&orderNo='+orderNo
// }
// else if(orderStatus == '44'){//建议书转投保, 跳到投保人
// url = '/sale/insuredInfo?edit=1&orderNo='+orderNo
// }
// else if(orderStatus == '62'){//风险测评保存成功, 跳到账户信息--
// if(order.universalRiskNotifyDTO && order.universalRiskNotifyDTO.isUniversalRiskNotifyShowPoint != '1'){
// url = '/sale/AccountInformation?edit=1&orderNo='+orderNo
// }else{
// url = '/sale/universalRiskNotifyingMessage?edit=1&orderNo='+orderNo
// }
// }
// else if(orderStatus == '63'){//风险测评保存成功, 跳到账户信息--
// url = '/sale/AccountInformation?edit=1&orderNo='+orderNo
// }
this.$jump({
flag: 'h5',
extra: {
forbidSwipeBack: '1',
url: location.origin + `/#${url}`
},
routerInfo: { path: url }
})
},
//删除投保单
del(order) {
let params = {
orderType: 'DEL_ORDER', //列表页 此值为固定
id: order.orderInfoDTO.orderNo,
orderDTO: {
orderInfo: {
orderNo: order.orderNo
}
}
}
this.$dialog
.confirm({
className: 'dialog-delete',
title: '提示',
message: '确认删除投保单吗?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF'
})
.then(() => {
deleteOrderInfo(params).then(res => {
if (res.result == 0) {
this.saleList = []
this.isSuccess = false
this.currentPage = 1
;[this.loading, this.finished] = [true, false]
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active
}
this.loadMore(pageInfo)
} else {
Toast.fail(res.resultMessage)
}
})
})
.catch(() => { })
},
//新增
add() {
let thisToken = this.$CacheUtils.getLocItem('token')
let thisbranchType = ''
if (this.$CacheUtils.getLocItem('branchType') == '13') {
thisbranchType = this.$CacheUtils.getLocItem('branchType')
}
window.localStorage.clear()
this.$CacheUtils.setLocItem('token', thisToken)
if (thisbranchType) {
this.$CacheUtils.setLocItem('branchType', thisbranchType)
}
localStorage.orderNo = ''
localStorage.chooseProductCodes = '' //置空所选险种
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuredInfo'
},
routerInfo: { path: '/sale/insuredInfo' }
})
},
revokeOrder(order) {
console.dir(order)
this.$dialog
.confirm({
className: 'dialog-delete',
title: '提示',
message: '撤单后,数据将不可恢复,您确定要撤单吗?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF'
})
.then(() => {
this.revokePanelShow = true
this.captchaReceiver = order.appntDTO.mobile
this.revokeOrderNo = order.orderInfoDTO.orderNo
})
},
// 获取投保资料
goInsuredInform(order) {
this.getInformShow = true
this.inputShow = true
this.contentShow = false
this.revokeOrderNo = order.orderInfoDTO.orderNo
if (order.appntDTO.email) {
this.emailForm.email = order.appntDTO.email
} else {
this.emailForm.email = ''
}
},
// 确定邮件发送
getInformOk() {
let params = {
orderNo: this.revokeOrderNo,
emailUrl: this.emailForm.email
}
this.$validator.validate().then(valid => {
if (true === valid) {
Toast.loading({
message: '加载中...',
loadingType: 'spinner',
forbidClick: true,
duration: 0
});
getSendEmail(params).then(res => {
Toast.clear();
if (res.result == '0') {
// Toast.loading({
// message: '加载中...',
// loadingType: 'spinner',
// forbidClick: true,
// duration: 2000
// });
// 调用下载方法
// getDownloadZip({ orderNo: this.revokeOrderNo }).then(downRes => {、
// this.handleDownload(downRes)
this.inputShow = false
this.contentShow = true
this.emailContent = '系统将会将投保资料发送至您录入邮箱,解压密码为投保人身份证号的后六位,请您稍后进行查看'
// })
} else if (res.result == '1' && res.resultMessage == '2') {
this.inputShow = false
this.contentShow = true
this.emailContent = '该保单近期已经获取过投保资料,请您移步邮箱进行查看'
} else if (res.result == '1') {
Toast.fail(res.resultMessage)
}
}).catch(error => {
Toast.clear();
throw error;
})
}
else {
this.$toast(this.$validator.errors.all()[0])
}
})
},
// 提示弹窗按钮
tipOk() {
this.getInformShow = false
},
handleDownload(data) {
// 处理接口返回的文件流
const blob = new Blob([data], { type: 'application/zip' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = this.revokeOrderNo + '_appnt_insured.zip'; // 设置下载文件名
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
},
filters: {
encryCheckModelMobile(code) {
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
},
phoneNumFilter(phoneNum) {
let num = phoneNum.split('')
num.splice(3, 4, '****')
return num.join('')
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .dialog-delete .van-dialog__header {
padding: 0.5em;
margin-bottom: 0;
border-bottom: 1px solid #eaeaea;
}
/deep/ .van-cell {
padding: 0;
padding-bottom: 0.5em;
border-bottom: 1px solid #eaeaea;
}
/deep/ .van-dialog__content {
padding: 1em;
}
.captchaReceiver {
margin-bottom: 1em;
padding-bottom: 1em;
border-bottom: 1px solid #eaeaea;
font-size: 14px;
}
.van-search__content {
background: #fff !important;
border-radius: 10px;
}
.van-search {
background: none !important;
}
.insure-popup {
width: 80%;
max-width: 500px;
margin: auto;
max-height: 80vh;
overflow-y: auto;
}
.insure-email {
position: relative;
padding: 20px;
}
.email-box {
width: 100%;
}
.email-title {
text-align: center;
color: #ee0a24;
font-size: 18px;
margin-bottom: 20px;
}
.email-content {
width: 100%;
margin: 0 auto 20px;
font-size: 14px;
}
.email-c {
margin-bottom: 10px;
text-align: center;
}
.email-input {
width: 100%;
margin: 10px auto;
}
.email-btn {
text-align: center;
margin-top: 20px;
.van-button--danger {
width: 180px;
}
}
</style>