mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 03:26:45 +08:00
【国富惠桂保团体医疗保险产品上线金掌桂投保开发需求】被保人列表页面,删除被保险人
This commit is contained in:
@@ -199,7 +199,6 @@ import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
|
||||
import DataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import areaList from '@/assets/js/utils/areaForSale'
|
||||
import { saveOrUpdateCard } from '@/api/ebiz/cardList/cardList.js'
|
||||
import { underWrite } from '@/api/ebiz/sale/sale'
|
||||
import utilsAge from '@/assets/js/utils/age'
|
||||
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
|
||||
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
|
||||
@@ -424,76 +423,6 @@ export default {
|
||||
this.areaCode = this.userInfo.homeArea
|
||||
}
|
||||
},
|
||||
underWrite(orderNo) {
|
||||
let data = {
|
||||
platform: 'app',
|
||||
type: '1',
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: orderNo
|
||||
}
|
||||
}
|
||||
}
|
||||
underWrite(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.$toast.clear()
|
||||
window.localStorage.setItem('underWriteData', JSON.stringify(res))
|
||||
if (res.uwResult == '33') {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
window.localStorage.setItem('resultMessage', res.message)
|
||||
} else {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
}
|
||||
if (res.uwResult == '02') {
|
||||
this.underWriteData = res
|
||||
window.localStorage.setItem('underWriteData', JSON.stringify(res))
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/cardList/pay`,
|
||||
forbidSwipeBack: 1
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/cardList/pay`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
window.localStorage.setItem('resultMessage', res.message)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/cardList/result',
|
||||
backToFirst: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/cardList/result'
|
||||
}
|
||||
})
|
||||
}
|
||||
return true
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
goDocu(url, name) {
|
||||
// let pdfUrl = //encodeURIComponent(url)
|
||||
localStorage.setItem('cardListPDF', JSON.stringify({ documentUrl: url, title: name }))
|
||||
console.log('url', url)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
title: name,
|
||||
// url: 'http://47.96.143.111/pdfjs/web/viewer.html?file=' + url //测试代码
|
||||
url: location.origin + '/#/cardList/ShowPDF'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/cardList/ShowPDF'
|
||||
}
|
||||
})
|
||||
},
|
||||
//监听名字变化
|
||||
nameChange(name) {
|
||||
// console.log('name',name)
|
||||
@@ -875,8 +804,6 @@ export default {
|
||||
let resultData = await saveOrUpdateCard(params)
|
||||
if (resultData.result == 0) {
|
||||
console.log('resultData.orderNo', resultData.content.object)
|
||||
let orderNo = (localStorage.orderNo = resultData.content.object)
|
||||
this.underWrite(orderNo)
|
||||
} else {
|
||||
console.error(resultData.resultMessage)
|
||||
this.$toast(resultData.resultMessage)
|
||||
|
||||
@@ -346,19 +346,6 @@
|
||||
</van-radio-group>
|
||||
</van-cell>
|
||||
</div>
|
||||
<!-- <van-checkbox-group v-model="result" ref="checkboxGroup" style="box-sizing:border-box;" class="pl8 pr20 pt10 pb10 bg-white">
|
||||
<van-checkbox name="a" shape="square" icon-size="13px"
|
||||
>本人已仔细阅读并了解
|
||||
<span class="blue" @click.stop="goDocu($assetsUrl + 'product/GFRS_M0022/M0022Notice.pdf', '短期交通卡投保须知')">《投保须知》</span>
|
||||
<span class="blue" @click.stop="goDocu($assetsUrl + 'product/GFRS_M0022/M0022Explain.pdf', '短期交通卡投保声明')">《投保声明》</span>
|
||||
和
|
||||
<span class="blue" @click.stop="goDocu($assetsUrl + 'product/GFRS_M0022/M0022.pdf', '国富人寿综合交通意外保险2020')"
|
||||
>《国富人寿综合交通工具意外伤害保险(2020版)条款》</span
|
||||
>
|
||||
等内容,自愿为被保险人投保本保险。<br />
|
||||
为未成年子女投保的人身保险,在被保险人成年之前,因被保险人身故给付的保险金总和不得超过国务院保险监督管理机构规定的限额,身故给付的保险金额总和的约定也不得超过前述限额。但航空意外死亡保险金额及重大自然灾害意外死亡保险金额不计算在上述规定限额之中。</van-checkbox
|
||||
>
|
||||
</van-checkbox-group> -->
|
||||
<!-- <div class="tips" v-if="cvaliDate.length > 0">注:2020年04月03日0时至2021年04月02日24时止。</div> -->
|
||||
<div class='tips'
|
||||
v-if="this.itemProductDTOS.productCode === 'GFRS_M0048'||this.itemProductDTOS.productCode === 'GFRS_M0049'||this.itemProductDTOS.productCode === 'GFRS_M0050'||this.itemProductDTOS.productCode === 'GFRS_M0052'">
|
||||
@@ -417,7 +404,6 @@ import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
|
||||
import DataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import areaList from '@/assets/js/utils/areaForSale'
|
||||
import { saveOrUpdateCard } from '@/api/ebiz/cardList/cardList.js'
|
||||
import { underWrite } from '@/api/ebiz/sale/sale'
|
||||
import utilsAge from '@/assets/js/utils/age'
|
||||
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
|
||||
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
|
||||
@@ -783,76 +769,6 @@ export default {
|
||||
this.areaCode = this.insuredInfo.homeArea
|
||||
}
|
||||
},
|
||||
underWrite(orderNo) {
|
||||
let data = {
|
||||
platform: 'app',
|
||||
type: '1',
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: orderNo
|
||||
}
|
||||
}
|
||||
}
|
||||
underWrite(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.$toast.clear()
|
||||
window.localStorage.setItem('underWriteData', JSON.stringify(res))
|
||||
if (res.uwResult == '33') {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
window.localStorage.setItem('resultMessage', res.message)
|
||||
} else {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
}
|
||||
if (res.uwResult == '02') {
|
||||
this.underWriteData = res
|
||||
window.localStorage.setItem('underWriteData', JSON.stringify(res))
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/cardList/pay`,
|
||||
forbidSwipeBack: 1
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/cardList/pay`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
window.localStorage.setItem('resultMessage', res.message)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/cardList/result',
|
||||
backToFirst: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/cardList/result'
|
||||
}
|
||||
})
|
||||
}
|
||||
return true
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
goDocu(url, name) {
|
||||
// let pdfUrl = //encodeURIComponent(url)
|
||||
localStorage.setItem('cardListPDF', JSON.stringify({ documentUrl: url, title: name }))
|
||||
console.log('url', url)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
title: name,
|
||||
// url: 'http://47.96.143.111/pdfjs/web/viewer.html?file=' + url //测试代码
|
||||
url: location.origin + '/#/cardList/ShowPDF'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/cardList/ShowPDF'
|
||||
}
|
||||
})
|
||||
},
|
||||
//监听名字变化
|
||||
nameChange(name) {
|
||||
// console.log('name',name)
|
||||
@@ -1762,9 +1678,16 @@ export default {
|
||||
|
||||
let resultData = await saveOrUpdateCard(params)
|
||||
if (resultData.result == 0) {
|
||||
console.log('resultData.orderNo', resultData.content.object)
|
||||
let orderNo = (localStorage.orderNo = resultData.content.object)
|
||||
this.underWrite(orderNo)
|
||||
let url = `/cardList/GroupInsuredList?cardEdit=1&cardOrderNo=${this.cardOrderNo}`
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#${url}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: url
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.error(resultData.resultMessage)
|
||||
this.$toast(resultData.resultMessage)
|
||||
|
||||
@@ -15,18 +15,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="flex pv15 ph10 bg-white align-items-c" style="flex-wrap: wrap;border-top:1px solid #DADADA" v-for="(choose, index) in chooseList" :key="index">
|
||||
<img class="w35 mr10 radius50" :src="choose.icon" />
|
||||
<span class="mr20 fs15">{{ choose.relationName }}</span>
|
||||
<li class="flex pv15 ph10 bg-white align-items-c" style="flex-wrap: wrap;border-bottom:1px solid #dadada" v-for="(choose, index) in chooseList" :key="index">
|
||||
<span class="ml10 mr20 fs15">{{ choose.relationName }}</span>
|
||||
<div v-if="choose.hasRisk" class="fs15 c-gray-dark">
|
||||
<div>姓名: {{ choose.name }}</div>
|
||||
<div v-if="choose.totalPrem != '0.00'">首期总保费(元): {{ choose.totalPrem | moneyFormat }}</div>
|
||||
<div v-if="choose.totalPrem != '0.00'">保费(元): {{ choose.totalPrem | moneyFormat }}</div>
|
||||
</div>
|
||||
<div class="mr10 fs15 c-gray-dark" @click="insure(choose)" v-else>点击为他/她投保</div>
|
||||
<div style="flex-grow:1" :class="[choose.totalAmt == '0.00' || choose.hasRisk == false ? '' : 'mt10', 'flex', 'justify-content-fe']">
|
||||
<van-button v-if="choose.code > 3" round class="ph0 w40" hairline type="danger" size="small" style="margin-right:5px;" @click="addPerson(choose)"
|
||||
<!-- <van-button v-if="choose.code > 3" round class="ph0 w40" hairline type="danger" size="small" style="margin-right:5px;" @click="addPerson(choose)"
|
||||
>添加</van-button
|
||||
>
|
||||
> -->
|
||||
<van-button v-if="choose.hasRisk" round class="ph0 w40" hairline type="danger" size="small" style="margin-right:5px;" @click="edit(choose)"
|
||||
>编辑</van-button
|
||||
>
|
||||
@@ -34,14 +33,28 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<van-button type="danger" @click="produceProposal" class="bottom-btn fs16">生成建议书</van-button>
|
||||
<van-goods-action style='z-index: 99'>
|
||||
<van-button type='default' style='width: 50%; font-size: 14px; height: 40px; background: white'
|
||||
>总保费:<span style='color: red; font-weight: bold; font-size: 18px; font-weight: 400'>{{ allPrice }}</span
|
||||
>元
|
||||
</van-button
|
||||
>
|
||||
<van-goods-action-button type='danger' text='立即投保' @click='nextStep' v-no-more-click='1000'
|
||||
style='border-radius: 0em; width: 50%; height: 40px' />
|
||||
</van-goods-action>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Icon, Dialog, Toast } from 'vant'
|
||||
import { getDetail, saveProposal, deleteProposal } from '@/api/ebiz/proposal/proposal.js'
|
||||
import BreadcrumbNavigator from '@/components/ebiz/proposal/BreadcrumbNavigator'
|
||||
import { getDetail, deleteProposal } from '@/api/ebiz/proposal/proposal.js'
|
||||
// import BreadcrumbNavigator from '@/components/ebiz/proposal/BreadcrumbNavigator'
|
||||
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
|
||||
import { underWrite } from '@/api/ebiz/sale/sale'
|
||||
|
||||
import Vue from 'vue'
|
||||
Vue.use(GoodsAction)
|
||||
.use(GoodsActionIcon)
|
||||
.use(GoodsActionButton)
|
||||
import data from '@/assets/js/utils/data-dictionary.js'
|
||||
let relation = data.relationToAppnt
|
||||
export default {
|
||||
@@ -52,7 +65,7 @@ export default {
|
||||
{
|
||||
relationName: '本人',
|
||||
code: 0,
|
||||
check: false,
|
||||
check: true,
|
||||
relation: relation[0].id
|
||||
},
|
||||
{
|
||||
@@ -74,9 +87,19 @@ export default {
|
||||
relation: relation[3].id
|
||||
}
|
||||
],
|
||||
chooseList: [], //添加上的被保险人
|
||||
//与被保险人关系默认为本人。
|
||||
chooseList: [
|
||||
{
|
||||
check: true,
|
||||
code: 0,
|
||||
hasRisk: false,
|
||||
relation: 1,
|
||||
relationName: "本人"
|
||||
}
|
||||
], //添加上的被保险人
|
||||
proposalInfo: '', //查询中的建议书信息
|
||||
proposalOrderNo: ''
|
||||
cardOrderNo: '',
|
||||
allPrice:0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -89,14 +112,14 @@ export default {
|
||||
[Toast.name]: Toast
|
||||
},
|
||||
mounted() {
|
||||
if (this.$route.query.proposalOrderNo) {
|
||||
this.proposalOrderNo = this.$route.query.proposalOrderNo
|
||||
if (this.$route.query.cardOrderNo) {
|
||||
this.cardOrderNo = this.$route.query.cardOrderNo
|
||||
}else if (this.$CacheUtils.getLocItem('orderNo')) {
|
||||
this.proposalOrderNo = this.$CacheUtils.getLocItem('orderNo')
|
||||
this.cardOrderNo = this.$CacheUtils.getLocItem('orderNo')
|
||||
}
|
||||
//根据后台数据来展示
|
||||
let proposalInfoDTO = {
|
||||
orderNo: this.proposalOrderNo
|
||||
orderNo: this.cardOrderNo
|
||||
}
|
||||
getDetail(proposalInfoDTO).then(res => {
|
||||
if (res.result == '0') {
|
||||
@@ -105,31 +128,31 @@ export default {
|
||||
this.proposalInfo = res.content[0]
|
||||
if (this.chooseList != null) {
|
||||
this.chooseList.forEach(v => {
|
||||
relation.forEach(r => {
|
||||
if (r.id == v.relationToAppnt) {
|
||||
//根据关系id 获取关系name
|
||||
v.relationName = r.text
|
||||
if (v.relationToAppnt == '3' && v.sex == '0') {
|
||||
//判断父亲和母亲
|
||||
v.relationName = '父亲'
|
||||
} else if (v.relationToAppnt == '3' && v.sex == '1') {
|
||||
v.relationName = '母亲'
|
||||
}
|
||||
}
|
||||
})
|
||||
// relation.forEach(r => {
|
||||
// if (r.id == v.relationToAppnt) {
|
||||
// //根据关系id 获取关系name
|
||||
// v.relationName = r.text
|
||||
// if (v.relationToAppnt == '3' && v.sex == '0') {
|
||||
// //判断父亲和母亲
|
||||
// v.relationName = '父亲'
|
||||
// } else if (v.relationToAppnt == '3' && v.sex == '1') {
|
||||
// v.relationName = '母亲'
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
if (v.insuredId) {
|
||||
//判断是否已经添加被保险人及险种
|
||||
v.hasRisk = true
|
||||
}
|
||||
this.persons.forEach(p => {
|
||||
if (v.relationToAppnt == p.relation) {
|
||||
v.icon = p.icon
|
||||
// v.icon = p.icon
|
||||
v.code = p.code
|
||||
if (v.sex == '0' && v.relationToAppnt == '3') {
|
||||
v.icon = icon3
|
||||
// v.icon = icon3
|
||||
v.code = 2
|
||||
} else if (v.sex == '1' && v.relationToAppnt == '3') {
|
||||
v.icon = icon4
|
||||
// v.icon = icon4
|
||||
v.code = 3
|
||||
}
|
||||
}
|
||||
@@ -150,25 +173,26 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
stepIn() {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/proposal/appnt',
|
||||
needRefresh: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/proposal/appnt'
|
||||
}
|
||||
})
|
||||
},
|
||||
//生成建议书
|
||||
produceProposal() {
|
||||
// stepIn() {
|
||||
// this.$jump({
|
||||
// flag: 'h5',
|
||||
// extra: {
|
||||
// url: location.origin + '/#/proposal/appnt',
|
||||
// needRefresh: '1'
|
||||
// },
|
||||
// routerInfo: {
|
||||
// path: '/proposal/appnt'
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
//立即投保
|
||||
nextStep() {
|
||||
let chooseList = this.chooseList
|
||||
let result = false
|
||||
let hasRisk = true
|
||||
if (chooseList.length == 0) {
|
||||
return Toast.fail('请选择被保险人')
|
||||
//被保险人小于3人时,点击【立即投保】提示“被保险人不得少于3人。
|
||||
if (chooseList.length < 3) {
|
||||
return Toast.fail('被保险人不得少于3人。')
|
||||
}
|
||||
|
||||
chooseList.forEach(insured => {
|
||||
@@ -185,89 +209,123 @@ export default {
|
||||
if (!hasRisk) {
|
||||
return Toast.fail('请选择保险产品信息')
|
||||
}
|
||||
//请选择保险产品信息
|
||||
|
||||
let params = {
|
||||
let data = {
|
||||
platform: 'app',
|
||||
type: '1',
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderStatus: '02',
|
||||
orderNo: this.proposalInfo.orderInfoDTO.orderNo
|
||||
}
|
||||
}
|
||||
}
|
||||
saveProposal(params).then(res => {
|
||||
//核保
|
||||
underWrite(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.$CacheUtils.setLocItem('orderNo', res.content.orderNo)
|
||||
let url = `/proposal/proposalInfo?proposalNo=${res.content.orderNo}`
|
||||
//调用保存接口
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#${url}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: url
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$toast.clear()
|
||||
window.localStorage.setItem('underWriteData', JSON.stringify(res))
|
||||
if (res.uwResult == '33') {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
window.localStorage.setItem('resultMessage', res.message)
|
||||
} else {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
}
|
||||
if (res.uwResult == '02') {
|
||||
this.underWriteData = res
|
||||
window.localStorage.setItem('underWriteData', JSON.stringify(res))
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/cardList/pay`,
|
||||
forbidSwipeBack: 1
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/cardList/pay`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
window.localStorage.setItem('uwResult', res.uwResult)
|
||||
window.localStorage.setItem('resultMessage', res.message)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/cardList/result',
|
||||
backToFirst: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/cardList/result'
|
||||
}
|
||||
})
|
||||
}
|
||||
return true
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
return
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//从页头选择被保险人
|
||||
//从页头选择被保险人,本人1 配偶2 父母3 子女4
|
||||
handleChoose(item) {
|
||||
if (!item.check) {
|
||||
console.log(item)
|
||||
console.log(this.chooseList,'this.chooseList')
|
||||
if(this.chooseList.length >= 10){
|
||||
return this.$toast('被保险人不得多于10人。')
|
||||
}
|
||||
if(item.relation == '1' && item.check){
|
||||
return this.$toast('与被保险人关系为本人,仅允许录入一次。')
|
||||
}else if(item.relation == '2' && item.check){
|
||||
return this.$toast('与被保险人关系为配偶,仅允许录入一次。')
|
||||
}
|
||||
// if (!item.check) {
|
||||
//增加
|
||||
item.check = !item.check
|
||||
item.hasRisk = false
|
||||
this.chooseList.push(item)
|
||||
this.sortarr(this.chooseList, 'code')
|
||||
} else {
|
||||
//删除
|
||||
Dialog.confirm({
|
||||
className: 'dialog-delete',
|
||||
title: '提示',
|
||||
message: '确认删除该被保险人?',
|
||||
cancelButtonColor: '#E9332E',
|
||||
confirmButtonColor: '#FFFFFF'
|
||||
})
|
||||
.then(() => {
|
||||
let deletePerson = []
|
||||
let hasRisk = false
|
||||
this.chooseList.forEach(v => {
|
||||
if (item.code == v.code) {
|
||||
if (v.hasRisk) {
|
||||
hasRisk = true
|
||||
v.insuredNo = v.insuredId
|
||||
deletePerson.push(v)
|
||||
}
|
||||
}
|
||||
})
|
||||
if (!hasRisk) {
|
||||
item.check = !item.check
|
||||
this.chooseList = this.chooseList.filter(v => item.code != v.code)
|
||||
}
|
||||
let parans = {
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: this.$CacheUtils.getLocItem('orderNo')
|
||||
},
|
||||
insuredDTOs: deletePerson
|
||||
},
|
||||
type: '2'
|
||||
}
|
||||
deleteProposal(parans).then(res => {
|
||||
//删除从接口中获取的
|
||||
if (res.result == '0') {
|
||||
item.check = !item.check
|
||||
this.chooseList = this.chooseList.filter(v => item.code != v.code)
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
console.log("添加")
|
||||
// } else {
|
||||
// //删除
|
||||
// Dialog.confirm({
|
||||
// className: 'dialog-delete',
|
||||
// title: '提示',
|
||||
// message: '确认删除该被保险人?',
|
||||
// cancelButtonColor: '#E9332E',
|
||||
// confirmButtonColor: '#FFFFFF'
|
||||
// })
|
||||
// .then(() => {
|
||||
// let deletePerson = []
|
||||
// let hasRisk = false
|
||||
// this.chooseList.forEach(v => {
|
||||
// if (item.code == v.code) {
|
||||
// if (v.hasRisk) {
|
||||
// hasRisk = true
|
||||
// v.insuredNo = v.insuredId
|
||||
// deletePerson.push(v)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// if (!hasRisk) {
|
||||
// item.check = !item.check
|
||||
// this.chooseList = this.chooseList.filter(v => item.code != v.code)
|
||||
// }
|
||||
// let parans = {
|
||||
// orderDTO: {
|
||||
// orderInfoDTO: {
|
||||
// orderNo: this.$CacheUtils.getLocItem('orderNo')
|
||||
// },
|
||||
// insuredDTOs: deletePerson
|
||||
// },
|
||||
// type: '2'
|
||||
// }
|
||||
// deleteProposal(parans).then(res => {
|
||||
// //删除从接口中获取的
|
||||
// if (res.result == '0') {
|
||||
// item.check = !item.check
|
||||
// this.chooseList = this.chooseList.filter(v => item.code != v.code)
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// .catch(() => {})
|
||||
// }
|
||||
},
|
||||
//删除被保险人
|
||||
deletePerson(choose, index) {
|
||||
@@ -314,18 +372,19 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(arr,'arr')
|
||||
return arr
|
||||
},
|
||||
//为他投保
|
||||
insure(person) {
|
||||
let saleInsuredPersonInfo = {
|
||||
let cardInsuredPersonInfo = {
|
||||
relationToAppnt: person.relation,
|
||||
relationName: person.relationName
|
||||
}
|
||||
this.$CacheUtils.setLocItem('saleInsuredPersonInfo', JSON.stringify(saleInsuredPersonInfo)) //存储被保险人信息
|
||||
this.$CacheUtils.setLocItem('cardInsuredPersonInfo', JSON.stringify(cardInsuredPersonInfo)) //存储被保险人信息
|
||||
localStorage.chooseProductCodes = '' //置空所选险种
|
||||
|
||||
let url = `/proposal/insuredPerson?proposalOrderNo=${this.proposalOrderNo}`
|
||||
let url = `/cardList/GroupInsuredInfo?cardEdit=1&cardOrderNo=${this.cardOrderNo}`
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
@@ -340,9 +399,9 @@ export default {
|
||||
edit(item) {
|
||||
item.birthday = item.birthdayLabel
|
||||
item.age = item.insuredAge
|
||||
this.$CacheUtils.setLocItem('saleInsuredPersonInfo', JSON.stringify(item)) //存储被保险人信息
|
||||
localStorage.isFrom = 'proposal'
|
||||
let url = `/common/selectedProduct?proposalEdit=1&proposalOrderNo=${item.orderNo}`
|
||||
this.$CacheUtils.setLocItem('cardInsuredPersonInfo', JSON.stringify(item)) //存储被保险人信息
|
||||
// localStorage.isFrom = 'proposal'
|
||||
let url = `/cardList/GroupInsuredInfo?cardEdit=1&cardOrderNo=${item.orderNo}`
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
@@ -354,18 +413,17 @@ export default {
|
||||
})
|
||||
},
|
||||
//添加被保险人 添加一个没有险种的被保险人
|
||||
addPerson(item) {
|
||||
let code = item.code
|
||||
let persons = this.persons
|
||||
persons.forEach(p => {
|
||||
if (p.code == code) {
|
||||
p.hasRisk = false
|
||||
this.chooseList.push(p)
|
||||
}
|
||||
})
|
||||
this.sortarr(this.chooseList, 'code')
|
||||
},
|
||||
|
||||
// addPerson(item) {
|
||||
// let code = item.code
|
||||
// let persons = this.persons
|
||||
// persons.forEach(p => {
|
||||
// if (p.code == code) {
|
||||
// p.hasRisk = false
|
||||
// this.chooseList.push(p)
|
||||
// }
|
||||
// })
|
||||
// this.sortarr(this.chooseList, 'code')
|
||||
// },
|
||||
formatChoose(choose, index) {
|
||||
let has = false //判断当前是否有相同的已经选中的
|
||||
this.chooseList.splice(index, 1)
|
||||
@@ -391,7 +449,7 @@ export default {
|
||||
padding: 2px 20px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
li:last-child {
|
||||
border-bottom: 1px solid #dadada;
|
||||
}
|
||||
// li:last-child {
|
||||
// border-bottom: 1px solid #dadada;
|
||||
// }
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,853 @@
|
||||
<template>
|
||||
<div class="pay">
|
||||
<div v-if="!isScan">
|
||||
<van-cell-group>
|
||||
<van-field v-model="underWriteData.riskName" type="textarea" autosize readonly label="产品名称:" class="projuct" />
|
||||
<van-field v-model="underWriteData.schemeName" readonly label="保障方案:" class="projuct" />
|
||||
<van-field v-if="!isWeixin" v-model="underWriteData.appntName" readonly label="投保人姓名:" class="projuct" />
|
||||
<van-field v-if="!isWeixin" v-model="underWriteData.insuredName" readonly label="被保人姓名:" class="projuct" />
|
||||
<van-field :value="underWriteData.orderAmount == undefined ? '' : `${underWriteData.orderAmount} 元`" readonly label="支付金额:" />
|
||||
</van-cell-group>
|
||||
<!-- 银行卡支付开始 -->
|
||||
<!-- <div class="money">
|
||||
<div>
|
||||
<img src="../../../assets/images/u10280.png" alt style="margin-top:-5px;margin-right:10px;" />
|
||||
<span class="oi">银行卡支付</span>
|
||||
</div>
|
||||
<div class="i mr20">
|
||||
<van-radio-group v-model="radio" class="flex justify-content-fe"><van-radio name="1"></van-radio></van-radio-group>
|
||||
</div>
|
||||
</div> -->
|
||||
<div v-if="isWeixin">
|
||||
<van-cell-group class="flex align-items-c">
|
||||
<img :src="src" class="pl10" />
|
||||
<van-cell title="银行卡支付" clickable>
|
||||
<!-- <van-checkbox v-model="checked" class="flex justify-content-fe"></van-checkbox> -->
|
||||
<van-radio-group v-model="radio" class="flex justify-content-fe">
|
||||
<van-radio name=""></van-radio>
|
||||
</van-radio-group>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
<van-cell-group class="flex align-items-c">
|
||||
<img :src="vxSrc" class="vximg" />
|
||||
<van-cell title="微信支付" clickable>
|
||||
<van-radio-group v-model="radio" class="flex justify-content-fe">
|
||||
<van-radio name="3" @click="vxVerify"></van-radio>
|
||||
</van-radio-group>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</div>
|
||||
|
||||
<!-- 银行卡支付结束 -->
|
||||
<van-cell-group v-if="radio != '3'">
|
||||
<van-field
|
||||
v-model="underWriteData.appntName"
|
||||
label="姓名"
|
||||
name="姓名"
|
||||
readonly
|
||||
placeholder="请输入"
|
||||
v-validate="'required|name'"
|
||||
maxlength="6"
|
||||
clearable
|
||||
required
|
||||
/>
|
||||
|
||||
<template v-if="noEdit">
|
||||
<van-field
|
||||
v-model="underWriteData.bankCode"
|
||||
maxlength="19"
|
||||
readonly
|
||||
label="银行卡号"
|
||||
name="银行卡号"
|
||||
placeholder="请输入"
|
||||
required
|
||||
clearable
|
||||
v-validate="'required|bankCard'"
|
||||
data-vv-name="银行卡号"
|
||||
>
|
||||
</van-field>
|
||||
<van-field
|
||||
:value="bankListName"
|
||||
label="开户银行"
|
||||
name="开户银行"
|
||||
placeholder="请输入"
|
||||
v-validate="'required'"
|
||||
readonly
|
||||
right-icon="arrow"
|
||||
data-vv-name="开户银行"
|
||||
required
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<van-field
|
||||
v-model="underWriteData.bankCode"
|
||||
maxlength="19"
|
||||
label="银行卡号"
|
||||
name="银行卡号"
|
||||
placeholder="请输入"
|
||||
required
|
||||
clearable
|
||||
v-validate="'required|bankCard'"
|
||||
data-vv-name="银行卡号"
|
||||
>
|
||||
<van-button v-if="!isWeixin" slot="button" size="small" type="danger" round @click="cardScanning('0')">银行卡扫描</van-button>
|
||||
</van-field>
|
||||
<van-field
|
||||
:value="bankListName"
|
||||
label="开户银行"
|
||||
name="开户银行"
|
||||
placeholder="请输入"
|
||||
v-validate="'required'"
|
||||
readonly
|
||||
@click="focus"
|
||||
right-icon="arrow"
|
||||
data-vv-name="开户银行"
|
||||
required
|
||||
/>
|
||||
<van-field
|
||||
v-model="areaStr"
|
||||
label="开户银行省市"
|
||||
placeholder="请选择"
|
||||
required
|
||||
@click="areaSelect"
|
||||
readonly
|
||||
v-validate="'required'"
|
||||
data-vv-name="开户银行省市"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<!-- <van-field v-model="bank" label="开户银行" placeholder="请选择" required @click="focus" readonly v-validate="'required'" data-vv-name="开户银行" /> -->
|
||||
</van-cell-group>
|
||||
<!-- 第三方支付所需表单 -->
|
||||
<form ref="payForm" :action="formActionUrl" method="post">
|
||||
<input name="TransSource" type="hidden" v-model="payParam.TransSource" />
|
||||
<input name="TransDate" type="hidden" v-model="payParam.TransDate" />
|
||||
<input name="TransTime" type="hidden" v-model="payParam.TransTime" />
|
||||
<input name="TransSeq" type="hidden" v-model="payParam.TransSeq" />
|
||||
<input name="Version" type="hidden" v-model="payParam.Version" />
|
||||
<input name="RdSeq" type="hidden" v-model="payParam.RdSeq" />
|
||||
<input name="PaymentCode" type="hidden" v-model="payParam.PaymentCode" />
|
||||
<input name="PayType" type="hidden" v-model="payParam.PayType" />
|
||||
<input name="SettleMode" type="hidden" v-model="payParam.SettleMode" />
|
||||
<input name="ApplyEntity" type="hidden" v-model="payParam.ApplyEntity" />
|
||||
<input name="Cur" type="hidden" v-model="payParam.Cur" />
|
||||
<input name="OurAmount" type="hidden" v-model="payParam.OurAmount" />
|
||||
<input name="FixUser" type="hidden" v-model="payParam.FixUser" />
|
||||
<input name="Insurer" type="hidden" v-model="payParam.Insurer" />
|
||||
<input name="CertType" type="hidden" v-model="payParam.CertType" />
|
||||
<input name="CertNum" type="hidden" v-model="payParam.CertNum" />
|
||||
<input name="OppBank" type="hidden" v-model="payParam.OppBank" />
|
||||
<input name="OppAct" type="hidden" v-model="payParam.OppAct" />
|
||||
<input name="OppActName" type="hidden" v-model="payParam.OppActName" />
|
||||
<input name="CellPhone" type="hidden" v-model="payParam.CellPhone" />
|
||||
<input name="ExpireDate" type="hidden" v-model="payParam.ExpireDate" />
|
||||
<input name="Purpose" type="hidden" v-model="payParam.Purpose" />
|
||||
<input name="Memo" type="hidden" v-model="payParam.Memo" />
|
||||
<input name="Description" type="hidden" v-model="payParam.Description" />
|
||||
<input name="SourceNotecode" type="hidden" v-model="payParam.SourceNotecode" />
|
||||
<input name="ReturnURL" type="hidden" v-model="payParam.ReturnURL" />
|
||||
<input name="NotifyURL" type="hidden" v-model="payParam.NotifyURL" />
|
||||
<input name="SaleChannel" type="hidden" v-model="payParam.SaleChannel" />
|
||||
<input name="ReqReserved1" type="hidden" v-model="payParam.ReqReserved1" />
|
||||
<input name="ReqReserved2" type="hidden" v-model="payParam.ReqReserved2" />
|
||||
<input name="ReqReserved3" type="hidden" v-model="payParam.ReqReserved3" />
|
||||
<input name="ReqReserved4" type="hidden" v-model="payParam.ReqReserved4" />
|
||||
<input name="ReqReserved5" type="hidden" v-model="payParam.ReqReserved5" />
|
||||
<input name="S3Sign" type="hidden" v-model="payParam.S3Sign" />
|
||||
</form>
|
||||
<div class="bg-white bottom-btn" v-if="!isWeixin">
|
||||
<!-- <van-button type="danger" style="width: 100vw;height: 13vw" @click="pay" v-no-more-click="1000">支付</van-button> -->
|
||||
<van-button type="danger" style="width: 100vw; height: 13vw" @click="share" v-no-more-click="1000">支付分享</van-button>
|
||||
</div>
|
||||
<div class="bg-white bottom-btn" v-else>
|
||||
<van-button type="danger" size="large" @click="pay" v-no-more-click="1000">支付</van-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 银行卡扫描按钮 -->
|
||||
<van-popup v-model="isScan" style="height: 100vh" position="bottom">
|
||||
<BankCardScan :scanShow="isScan" :clear="isClear" @getScanInfo="getBankCardInfo"></BankCardScan>
|
||||
</van-popup>
|
||||
<!-- 开户银行选择 -->
|
||||
<van-popup v-model="show" position="bottom" style="height: 354px">
|
||||
<van-list>
|
||||
<van-cell v-for="item in bankList" :key="item.code" :title="item.bankName" class="text-center" @click="clickList(item.bankName, item.code)" />
|
||||
</van-list>
|
||||
</van-popup>
|
||||
<van-popup position="bottom" v-model="isAreaListShow" :lazy-render="false">
|
||||
<van-area
|
||||
ref="areaSelect"
|
||||
title="请选择省市"
|
||||
:visible-item-count="4"
|
||||
:columns-num="2"
|
||||
:area-list="areaList"
|
||||
@confirm="setBankArea"
|
||||
@cancel="isAreaListShow = false"
|
||||
/>
|
||||
</van-popup>
|
||||
<!-- 分享到微信的页面loading -->
|
||||
<!-- <Loading :isLoading="isLoading"></Loading> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { Field, Checkbox, CheckboxGroup, RadioGroup, Radio, Popup, CellGroup, Button, List, Cell, Dialog } from 'vant'
|
||||
Vue.use(Checkbox).use(CheckboxGroup)
|
||||
Vue.use(Field)
|
||||
Vue.use(Button)
|
||||
import { acceptInsurance, getBankList, underWrite, getOrderDetail } from '@/api/ebiz/sale/sale'
|
||||
import { saveOrUpdateAccount, getPayTemp, getShareParam } from '@/api/ebiz/cardList/cardList.js'
|
||||
import BankCardScan from '@/components/ebiz/sale/BankCardScan'
|
||||
import areaList from '@/assets/js/utils/area'
|
||||
import Loading from '@/components/ebiz/Loading'
|
||||
import config from '@/config'
|
||||
export default {
|
||||
name: 'pay',
|
||||
components: {
|
||||
BankCardScan,
|
||||
[Popup.name]: Popup,
|
||||
[CellGroup.name]: CellGroup,
|
||||
[Field.name]: Field,
|
||||
[List.name]: List,
|
||||
[Cell.name]: Cell,
|
||||
[RadioGroup.name]: RadioGroup,
|
||||
[Radio.name]: Radio,
|
||||
Loading
|
||||
},
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
// 银行卡支付图片地址
|
||||
src: this.$assetsUrl + 'images/cardImg.png',
|
||||
// 微信支付图片地址
|
||||
vxSrc: this.$assetsUrl + 'images/vxImg.png',
|
||||
// trialList: JSON.parse(localStorage.trialList),
|
||||
// 核保数据
|
||||
orderStatus: '',
|
||||
underWriteData: {
|
||||
appntName: '', //产品名称
|
||||
orderAmount: '', //支付金额
|
||||
name: '',
|
||||
bankCode: '', //银行卡号
|
||||
bankName: '', //开户银行
|
||||
schemeName: '' //保障金额
|
||||
},
|
||||
radio: '3',
|
||||
result: [],
|
||||
isScan: false, //是否显示证件扫描组件
|
||||
isClear: false, //是否清空
|
||||
show: false, // 银行列表弹框
|
||||
bankList: [], // 银行卡列表
|
||||
bankListName: '', // 银行列表ID
|
||||
formActionUrl: config.payUrl, // 支付表单
|
||||
payParam: {
|
||||
TransSource: '', // 对接系统
|
||||
TransDate: '', // 请求日期
|
||||
TransTime: '', // 请求时间
|
||||
TransSeq: '', // 时间戳
|
||||
Version: '', // 版本号
|
||||
RdSeq: '', // 指令流水号
|
||||
PaymentCode: '', // 业务唯一号
|
||||
PayType: '', // 交易类型
|
||||
SettleMode: '', // 支付方式
|
||||
ApplyEntity: '', // 业务发生机构
|
||||
Cur: '', // 币种
|
||||
OurAmount: '', // 金额
|
||||
FixUser: '', // 实名认证标识
|
||||
Insurer: '', // 对接系统
|
||||
CertType: '', // 证件类型
|
||||
CertNum: '', // 证件号码
|
||||
OppBank: '', // 交易方银行
|
||||
OppAct: '', // 交易方账号
|
||||
OppActName: '', // 交易方名称
|
||||
CellPhone: '', // 手机号码
|
||||
ExpireDate: '', // 订单失效时间
|
||||
Purpose: '', // 用途
|
||||
Memo: '', // 备注
|
||||
Description: '', // 描述
|
||||
SourceNotecode: '', // 外部系统业务单据号
|
||||
ReturnURL: '', // 页面跳转同步通知地址
|
||||
NotifyURL: '', // 后台通知地址
|
||||
SaleChannel: '', // 销售渠道
|
||||
ReqReserved1: '', // 备用字段1
|
||||
ReqReserved2: '', // 备用字段2
|
||||
ReqReserved3: '', // 备用字段3
|
||||
ReqReserved4: '', // 备用字段4
|
||||
ReqReserved5: '', // 备用字段5
|
||||
S3Sign: '', // 验签信息
|
||||
tradeState: '' // 状态
|
||||
},
|
||||
gotPayParam: false, // 是否已正确获取支付参数,
|
||||
payStatus: '', // 接口返回的支付状态
|
||||
noEdit: false, //是否为编辑
|
||||
isWeixin, // 是否为微信环境
|
||||
isLoading: false, // 分享到微信后的页面loading
|
||||
areaList,
|
||||
isAreaListShow: false,
|
||||
accBankProvince: '',
|
||||
accBankCity: '',
|
||||
areaStr: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isWeixin) {
|
||||
let orderDetail = JSON.parse(sessionStorage.orderDetail)
|
||||
this.underWriteData = {
|
||||
riskName: orderDetail.insuredDTOs[0].riskDTOLst[0].riskName,
|
||||
appntName: orderDetail.appntDTO.name,
|
||||
insuredName: orderDetail.insuredDTOs[0].name,
|
||||
orderAmount: orderDetail.insuredDTOs[0].riskDTOLst[0].prem,
|
||||
schemeName: orderDetail.insuredDTOs[0].riskDTOLst[0].proScheme,
|
||||
idType: orderDetail.appntDTO.idType,
|
||||
bankCode: orderDetail.orderAccountDTO.cardBookCode,
|
||||
cardBookCode: orderDetail.orderAccountDTO.cardBookCode,
|
||||
bankName: orderDetail.orderAccountDTO.bankCode
|
||||
}
|
||||
this.bankListName = orderDetail.orderAccountDTO.bankName
|
||||
this.orderStatus = orderDetail.orderInfoDTO.orderStatus
|
||||
localStorage.orderNo = orderDetail.orderInfoDTO.orderNo
|
||||
// this.radio = '3'
|
||||
// this.isLoading = true
|
||||
// this.$toast.loading({
|
||||
// duration: 0, // 持续展示 toast
|
||||
// forbidClick: true, // 禁用背景点击
|
||||
// loadingType: 'spinner',
|
||||
// message: '加载中……'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// this.pay()
|
||||
// }, 500)
|
||||
} else {
|
||||
document.title = '支付分享'
|
||||
// 再次支付 调详情 获取信息
|
||||
this.getOrderDetail()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
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
|
||||
// console.log('trialList', this.trialList[0].prem)
|
||||
// this.underWrite.orderAmount = this.trialList[0].prem
|
||||
document.body.style.backgroundColor = '#fff'
|
||||
window.appCallBack = this.appCallBack
|
||||
// 获取银行卡
|
||||
this.getBankList()
|
||||
// 不在微信环境下
|
||||
if (!this.isWeixin) {
|
||||
// this.getOrderDetail()
|
||||
// console.log('----保融form.action', config.payUrl)
|
||||
// if (localStorage.salelist == '1') {
|
||||
// 第一次支付 调核保获取
|
||||
// this.underWrite()
|
||||
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
|
||||
// } else {
|
||||
// 再次支付 调详情 获取信息
|
||||
this.getOrderDetail()
|
||||
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
|
||||
// }
|
||||
// console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData))
|
||||
this.getPayTemp()
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
document.body.style.backgroundColor = ''
|
||||
next()
|
||||
},
|
||||
destroyed() {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
intercept: '0' //是否拦截原生返回事件 1是 其他否
|
||||
})
|
||||
// window.appCallBack = this.appCallBack
|
||||
}, 100)
|
||||
},
|
||||
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 + `/#/cardList/CardTotreasure`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/cardList/CardTotreasure`,
|
||||
type: '1'
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
return
|
||||
})
|
||||
} else {
|
||||
// 筛选按钮的点击事件
|
||||
this.$jump({
|
||||
flag: 'navigation',
|
||||
extra: {
|
||||
title: '支付',
|
||||
hiddenRight: '1'
|
||||
}
|
||||
})
|
||||
this.isScan = false
|
||||
}
|
||||
},
|
||||
areaSelect() {
|
||||
this.isAreaListShow = true
|
||||
this.$refs['areaSelect'].reset('450000')
|
||||
},
|
||||
//选择开户银行省市
|
||||
setBankArea(areaInfo) {
|
||||
let province = areaInfo[0]
|
||||
let city = areaInfo[1]
|
||||
this.accBankProvince = province.code
|
||||
this.accBankCity = city.code
|
||||
this.isAreaListShow = false
|
||||
this.areaStr = `${province.name}-${city.name}`
|
||||
},
|
||||
//获取银行卡扫描信息
|
||||
getBankCardInfo(data) {
|
||||
this.underWriteData.bankCode = data.name
|
||||
this.$jump({
|
||||
flag: 'navigation',
|
||||
extra: {
|
||||
title: '账户信息',
|
||||
hiddenRight: '1'
|
||||
}
|
||||
})
|
||||
this.isScan = false
|
||||
},
|
||||
// 银行卡扫描
|
||||
cardScanning(cardScanningType) {
|
||||
window.localStorage.setItem('cardScanningType', cardScanningType)
|
||||
document.body.style.backgroundColor = '#F5F5F5'
|
||||
let title = ''
|
||||
this.isclear = false
|
||||
;[this.isScan, title] = [true, '银行卡扫描']
|
||||
setTimeout(() => {
|
||||
this.$jump({
|
||||
flag: 'navigation',
|
||||
extra: {
|
||||
title,
|
||||
hiddenLeft: '1'
|
||||
}
|
||||
})
|
||||
this.closeBtn()
|
||||
}, 400)
|
||||
},
|
||||
closeBtn() {
|
||||
// 筛选按钮的显示
|
||||
this.$jump({
|
||||
flag: 'webview_right_button',
|
||||
extra: {
|
||||
btns: [
|
||||
{
|
||||
img: this.$assetsUrl + 'images/del-close.png',
|
||||
route: { flag: '', extra: {} }
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取银行列表的focus
|
||||
focus() {
|
||||
// if (this.orderStatus == '56') {
|
||||
this.show = true
|
||||
// }
|
||||
},
|
||||
// 获取银行卡列表
|
||||
getBankList() {
|
||||
let self = this
|
||||
let data = {
|
||||
operateType: 'bank_type'
|
||||
}
|
||||
getBankList(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
console.log('银行卡列表', res.content)
|
||||
self.bankList = res.content
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择银行卡
|
||||
clickList(item, bankCode) {
|
||||
console.log('英航卡', item, bankCode)
|
||||
this.bankListName = item
|
||||
this.underWriteData.bankName = bankCode
|
||||
this.show = false
|
||||
},
|
||||
getPayTemp() {
|
||||
getPayTemp({ orderNo: window.localStorage.getItem('orderNo') })
|
||||
.then(res => {
|
||||
if (res.result == '0') {
|
||||
this.noEdit = res.content.flag != 'false'
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
console.error(e)
|
||||
})
|
||||
},
|
||||
// 获取支付详情
|
||||
getOrderDetail() {
|
||||
getOrderDetail({ orderNo: window.localStorage.getItem('orderNo') }).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.orderStatus = res.orderDTO.orderInfoDTO.orderStatus
|
||||
try {
|
||||
if (this.noEdit) {
|
||||
if (res.orderDTO.paymentDTO.cardBookType == '3') {
|
||||
this.radio = '3'
|
||||
} else {
|
||||
this.radio = ''
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.$toast.clear()
|
||||
this.underWriteData = {
|
||||
riskName: res.orderDTO.insuredDTOs[0].riskDTOLst[0].riskName,
|
||||
appntName: res.orderDTO.appntDTO.name,
|
||||
insuredName: res.orderDTO.insuredDTOs[0].name,
|
||||
// bankName: res.orderDTO.orderAccountDTO.bankCode,
|
||||
// bankCode: res.orderDTO.orderAccountDTO.cardBookCode,
|
||||
// cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
|
||||
schemeName: res.orderDTO.insuredDTOs[0].riskDTOLst[0].proScheme,
|
||||
idType: res.orderDTO.appntDTO.idType,
|
||||
orderAmount: res.orderDTO.insuredDTOs[0].riskDTOLst[0].prem,
|
||||
orderNo: res.orderDTO.orderAccountDTO.orderNo,
|
||||
result: '',
|
||||
resultMessage: '交易处理成功',
|
||||
uwResult: '02'
|
||||
}
|
||||
// this.bankListName = res.orderDTO.orderAccountDTO.bankName
|
||||
this.underWriteData.bankCode =
|
||||
res.orderDTO.orderAccountDTO.cardBookCode !== null ? res.orderDTO.orderAccountDTO.cardBookCode : this.$route.query.bankCode
|
||||
this.underWriteData.bankName = res.orderDTO.orderAccountDTO.bankCode !== null ? res.orderDTO.orderAccountDTO.bankCode : this.$route.query.bankName
|
||||
this.underWriteData.cardBookCode =
|
||||
res.orderDTO.orderAccountDTO.cardBookCode !== null ? res.orderDTO.orderAccountDTO.cardBookCode : this.$route.query.bankCode
|
||||
this.bankListName = res.orderDTO.orderAccountDTO.bankName !== null ? res.orderDTO.orderAccountDTO.bankName : this.$route.query.bankListName
|
||||
// if (this.isWeixin) {
|
||||
// this.pay()
|
||||
// }
|
||||
} else {
|
||||
this.underWriteData = {
|
||||
accountName: '',
|
||||
riskName: '',
|
||||
appntName: '',
|
||||
insuredName: '',
|
||||
idType: '',
|
||||
bankCode: '',
|
||||
bankName: '',
|
||||
cardBookCode: '',
|
||||
orderAmount: '',
|
||||
orderNo: '',
|
||||
result: '',
|
||||
resultMessage: '交易处理失败',
|
||||
uwResult: '00'
|
||||
}
|
||||
// window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取支付信息
|
||||
// async underWrite() {
|
||||
// let data = {
|
||||
// platform: 'app',
|
||||
// type: '1',
|
||||
// orderDTO: {
|
||||
// orderInfoDTO: {
|
||||
// orderNo: window.localStorage.getItem('orderNo')
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return underWrite(data)
|
||||
// // .then(res => {
|
||||
// // console.log(res);
|
||||
// // if (res.result == '0') {
|
||||
// // this.$toast.clear()
|
||||
// // if (res.uwResult == '33') {
|
||||
// // window.localStorage.setItem('uwResult', res.uwResult)
|
||||
// // window.localStorage.setItem('resultMessage', res.message)
|
||||
// // } else {
|
||||
// // window.localStorage.setItem('uwResult', res.uwResult)
|
||||
// // }
|
||||
// // this.underWriteData = res
|
||||
// // return true
|
||||
// // } else {
|
||||
// // return false
|
||||
// // this.$toast(res.resultMessage)
|
||||
// // }
|
||||
// // })
|
||||
// },
|
||||
async pay() {
|
||||
let valid = await this.$validator.validate()
|
||||
if (true !== valid) {
|
||||
return this.$toast(this.$validator.errors.all()[0])
|
||||
}
|
||||
switch (this.orderStatus) {
|
||||
case '56':
|
||||
case '57':
|
||||
this.payMent()
|
||||
break
|
||||
// case '02':
|
||||
// break
|
||||
default:
|
||||
if (!this.noEdit) {
|
||||
this.payMent(true)
|
||||
return true
|
||||
} else {
|
||||
this.acceptInsurance()
|
||||
return this.$toast('当前不可支付')
|
||||
}
|
||||
}
|
||||
},
|
||||
acceptInsurance() {
|
||||
let data = {
|
||||
orderNo: window.localStorage.getItem('orderNo'),
|
||||
cardOrder: 'cardOrder',
|
||||
payType: this.radio
|
||||
}
|
||||
acceptInsurance(data).then(res => {
|
||||
// this.$jump({
|
||||
// flag: 'h5',
|
||||
// extra: {
|
||||
// forbidSwipeBack: 1, //当前页面禁止右滑返回
|
||||
// url: location.origin + `/#/cardList/payLoser`,
|
||||
// },
|
||||
// routerInfo: {
|
||||
// path: `/cardList/payLoser`,
|
||||
// type: '1',
|
||||
// },
|
||||
// })
|
||||
// return;
|
||||
// this.$jump({
|
||||
// flag: 'h5',
|
||||
// extra: {
|
||||
// forbidSwipeBack: 1, //当前页面禁止右滑返回
|
||||
// url: location.origin + `/#/cardList/PayResult`,
|
||||
// },
|
||||
// routerInfo: {
|
||||
// path: `/cardList/PayResult`,
|
||||
// type: '1',
|
||||
// },
|
||||
// })
|
||||
// return
|
||||
// res = {'result':'0','resultMessage':'','content':null,'prtNo':'8186270000000008','payStatus':'4','amnt':'63700.00','appntName':'投保人','message':null,'brPayReturnData':{'result':'','resultMessage':'','content':null,'businessId':'1569125393518','businessNo':'8186270000000008','tradeSubType':'COMM','businessType':'SALE','systemType':'GF','money':63700,'businessSubType':'XDCB','thirdType':'0002','thirdName':null,'bankCode':'ABC','epayOrderNo':'1909221209536259999900','companyAccount':null,'tradeState':'TRADING','standardCode':'DEALING','standardMsg':null,'thirdOrderNo':null,'respRemark':null,'tradeTime':'2019-09-22T04:09:53.518+0000','description':'','version':'1','sourceNotecode':'8186270000000008','payType':'MIT01','expireDate':'20191010101010','transSeq':'20190922120953782','transSource':'MIT','applyEntity':'11860000','paymentCode':'8186270000000008','transDate':'20190922','rdSeq':'1909221209536259999900','settleMode':null,'cur':'CNY','transTime':'120953','ourAmount':63700,'fixUser':'1','insurer':'投保人','certType':'0','certNum':'110101199009210011','oppBank':'ABC','oppAct':'6228481200290317812','oppActName':'投保人','cellPhone':null,'purpose':null,'memo':null,'returnURL':'http://139.199.50.151/#/sale/payResult','notifyURL':'http://139.199.50.151:7000/api/v1/epay/epay/payResult','s3Sign':'e3f0581ec6b751337e8eca360a0746bc'}}
|
||||
if (res.result == '0') {
|
||||
// 1成 4支付中 2支付失败 8转批扣(无此情况)
|
||||
this.payStatus = res.payStatus
|
||||
if (this.payStatus == '1') {
|
||||
this.$toast({ message: '当前投保单已支付成功,请返回列表页查询', duration: 5000 })
|
||||
return
|
||||
}
|
||||
// 支付参数大小写转换
|
||||
let keyMap = {}
|
||||
for (let key in this.payParam) {
|
||||
keyMap[key.toLowerCase()] = key
|
||||
}
|
||||
let paramKey
|
||||
for (let rKey in res.brPayReturnData) {
|
||||
if (keyMap.hasOwnProperty(rKey.toLowerCase())) {
|
||||
paramKey = keyMap[rKey.toLowerCase()]
|
||||
this.payParam[paramKey] = res.brPayReturnData[rKey]
|
||||
}
|
||||
}
|
||||
console.log('----支付参数:this.payParam:', JSON.stringify(this.payParam))
|
||||
this.gotPayParam = true
|
||||
this.$forceUpdate()
|
||||
window.localStorage.setItem('resMessage', res.resultMessage)
|
||||
window.localStorage.setItem('payStatus', res.payStatus)
|
||||
window.localStorage.setItem('payInfo', JSON.stringify(res))
|
||||
this.underWriteData.bankListName = this.bankListName
|
||||
if (this.radio == '3') {
|
||||
this.underWriteData.bankCode = ''
|
||||
}
|
||||
localStorage['cardList-detail'] = JSON.stringify(this.underWriteData)
|
||||
let thisRef = this
|
||||
this.$nextTick(() => {
|
||||
thisRef.$refs.payForm.submit() // 表单提交,发起支付,跳至收银台
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
intercept: '0' //是否拦截原生返回事件 1是 其他否
|
||||
})
|
||||
}, 100)
|
||||
})
|
||||
} else {
|
||||
if (!this.isWeixin) {
|
||||
this.$toast.clear()
|
||||
} else {
|
||||
this.isLoading = false
|
||||
}
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击支付
|
||||
async payMent(flag) {
|
||||
if (this.radio == '') {
|
||||
let data = {
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: window.localStorage.getItem('orderNo')
|
||||
},
|
||||
orderAccountDTO: {
|
||||
accountType: '0',
|
||||
accountName: this.underWriteData.appntName,
|
||||
bankName: this.bankListName,
|
||||
bankCode: this.underWriteData.bankName,
|
||||
cardBookType: '1',
|
||||
cardBookCode: this.underWriteData.bankCode,
|
||||
isAutoPay: '0',
|
||||
isAutoRenewal: '1',
|
||||
accBankProvince: this.accBankProvince,
|
||||
accBankCity: this.accBankCity
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
/*
|
||||
支付之前要先保存银行账户信息
|
||||
*/
|
||||
let res = await saveOrUpdateAccount(data)
|
||||
// .then(res => {
|
||||
console.log('res', res)
|
||||
this.$toast.clear()
|
||||
if (res.result == '0') {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
|
||||
// if (!flag) {
|
||||
// let rs = await this.underWrite()
|
||||
|
||||
// if (rs.result != '0') {
|
||||
// this.$toast.clear()
|
||||
// return this.$toast(rs.resultMessage)
|
||||
// }
|
||||
|
||||
// if (rs.uwResult != '02') {
|
||||
// return this.$toast(rs.message)
|
||||
// }
|
||||
// }
|
||||
|
||||
this.acceptInsurance()
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
this.isLoading = false
|
||||
}
|
||||
// })
|
||||
} else {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
|
||||
// if (!flag) {
|
||||
// let rs = await this.underWrite()
|
||||
|
||||
// if (rs.result != '0') {
|
||||
// this.$toast.clear()
|
||||
// return this.$toast(rs.resultMessage)
|
||||
// }
|
||||
|
||||
// if (rs.uwResult != '02') {
|
||||
// return this.$toast(rs.message)
|
||||
// }
|
||||
// }
|
||||
|
||||
this.acceptInsurance()
|
||||
}
|
||||
},
|
||||
// 选择微信支付校验身份证类型
|
||||
vxVerify() {
|
||||
if (this.underWriteData.idType != '1') {
|
||||
this.$dialog
|
||||
.confirm({
|
||||
message: '证件类型不是身份证,无法使用微信支付',
|
||||
showCancelButton: false
|
||||
})
|
||||
.then(() => {
|
||||
this.radio = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
async share() {
|
||||
let valid = await this.$validator.validate()
|
||||
console.log(valid)
|
||||
if (true !== valid) {
|
||||
console.log(this.$validator)
|
||||
return this.$toast(this.$validator.errors.all()[0])
|
||||
}
|
||||
let shareName = this.underWriteData.appntName
|
||||
localStorage.name = this.underWriteData.appntName
|
||||
localStorage.bankName = this.underWriteData.bankName
|
||||
localStorage.bankCode = this.underWriteData.bankCode
|
||||
localStorage.bankListName = this.bankListName
|
||||
let res = await getShareParam({ shareType: 'card_pay' })
|
||||
let url = location.origin + '/#/cardList/phoneCode?orderNo=' + localStorage.orderNo + '&token=' + res.content
|
||||
if (res.result == '0') {
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
title: `国富人寿卡单投保(${shareName})付款`,
|
||||
shareScene: '0',
|
||||
content: '付款进行',
|
||||
url: url,
|
||||
img: this.$assetsUrl + 'images/logo.png'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return this.$toast(res.resultMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style lang="scss" scoped>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.vximg {
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
padding-left: 13px;
|
||||
padding-right: 3px;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.bottom-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user