【fix】 卡单流程完成,提交给后端与核心联调

This commit is contained in:
tian.guangyuan
2020-04-21 11:37:00 +08:00
parent fcde3c97bd
commit d97bba7845
3 changed files with 112 additions and 78 deletions

View File

@@ -123,11 +123,11 @@ export default {
// trialList: JSON.parse(localStorage.trialList), // trialList: JSON.parse(localStorage.trialList),
// 核保数据 // 核保数据
underWriteData: { underWriteData: {
appntName: '国家安全富兴2.0', //产品名称 appntName: '', //产品名称
orderAmount: 0, //支付金额 orderAmount: '', //支付金额
name: '', name: '',
bankCode: '', //银行卡号 bankCode: '', //银行卡号
bankName: 'ABC' //开户银行 bankName: '' //开户银行
}, },
radio: '1', radio: '1',
result: [], result: [],
@@ -185,17 +185,18 @@ export default {
window.appCallBack = this.appCallBack window.appCallBack = this.appCallBack
// 获取银行卡 // 获取银行卡
this.getBankList() this.getBankList()
console.log('----保融form.action', config.payUrl) this.getOrderDetail()
// console.log('----保融form.action', config.payUrl)
// if (localStorage.salelist == '1') { // if (localStorage.salelist == '1') {
// // 第一次支付 调核保获取 // 第一次支付 调核保获取
// this.underWrite() // this.underWrite()
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData')) // this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
// } else { // } else {
// // 再次支付 调详情 获取信息 // 再次支付 调详情 获取信息
// this.twounderWrite() this.getOrderDetail()
// this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData')) // this.underWriteData = JSON.parse(window.localStorage.getItem('underWriteData'))
// } // }
console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData)) // console.log('--自核结果--支付信息:', JSON.stringify(this.underWriteData))
}, },
methods: { methods: {
//获取银行卡扫描信息 //获取银行卡扫描信息
@@ -282,18 +283,17 @@ export default {
that.show = false that.show = false
}, },
// 再次支付 // 再次支付
twounderWrite() { getOrderDetail() {
let _this = this
getOrderDetail({ orderNo: window.localStorage.getItem('orderNo') }).then(res => { getOrderDetail({ orderNo: window.localStorage.getItem('orderNo') }).then(res => {
console.log(res) console.log(res)
if (res.result == '0') { if (res.result == '0') {
this.$toast.clear() this.$toast.clear()
console.log(res.orderDTO.orderAccountDTO.bankCode) console.log(res.orderDTO.orderAccountDTO.bankCode)
let underWriteData = { this.underWriteData = {
accountName: res.orderDTO.orderAccountDTO.accountName, appntName: res.orderDTO.insuredDTOs[0].riskDTOLst[0].riskName,
appntName: res.orderDTO.appntDTO.name, name: res.orderDTO.orderAccountDTO.accountName,
bankCode: _this.typebank[res.orderDTO.orderAccountDTO.bankCode], bankCode: res.orderDTO.orderAccountDTO.cardBookCode,
bankName: res.orderDTO.orderAccountDTO.bankName, bankName: res.orderDTO.orderAccountDTO.bankCode,
cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode, cardBookCode: res.orderDTO.orderAccountDTO.cardBookCode,
orderAmount: res.orderDTO.orderInfoDTO.orderAmount, orderAmount: res.orderDTO.orderInfoDTO.orderAmount,
orderNo: res.orderDTO.orderAccountDTO.orderNo, orderNo: res.orderDTO.orderAccountDTO.orderNo,
@@ -301,9 +301,10 @@ export default {
resultMessage: '交易处理成功', resultMessage: '交易处理成功',
uwResult: '02' uwResult: '02'
} }
window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData)) this.bankListName = res.orderDTO.orderAccountDTO.bankName
// window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
} else { } else {
let underWriteData = { this.underWriteData = {
accountName: '', accountName: '',
appntName: '', appntName: '',
bankCode: '', bankCode: '',
@@ -315,13 +316,13 @@ export default {
resultMessage: '交易处理失败', resultMessage: '交易处理失败',
uwResult: '00' uwResult: '00'
} }
window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData)) // window.localStorage.setItem('underWriteData', JSON.stringify(underWriteData))
this.$toast(res.resultMessage) this.$toast(res.resultMessage)
} }
}) })
}, },
// 获取支付信息 // 获取支付信息
underWrite() { async underWrite() {
let data = { let data = {
platform: 'app', platform: 'app',
type: '1', type: '1',
@@ -331,28 +332,27 @@ export default {
} }
} }
} }
underWrite(data).then(res => { return underWrite(data)
if (res.result == '0') { // .then(res => {
this.$toast.clear() // console.log(res);
if (res.uwResult == '02') { // if (res.result == '0') {
// this.$toast.clear()
// if (res.uwResult == '33') {
// window.localStorage.setItem('uwResult', res.uwResult) // window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('underWriteData', JSON.stringify(res)) // window.localStorage.setItem('resultMessage', res.message)
} else if (res.uwResult == '33') { // } else {
window.localStorage.setItem('underWriteData', JSON.stringify(res)) // window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('uwResult', res.uwResult) // }
window.localStorage.setItem('resultMessage', res.message) // this.underWriteData = res
} else { // return true
window.localStorage.setItem('uwResult', res.uwResult) // } else {
window.localStorage.setItem('underWriteData', JSON.stringify(res)) // return false
// window.localStorage.setItem('resultMessage', res.resultMessage) // this.$toast(res.resultMessage)
} // }
} else { // })
this.$toast(res.resultMessage)
}
})
}, },
// 点击支付 // 点击支付
payMent() { async payMent() {
let that = this let that = this
let data = { let data = {
orderDTO: { orderDTO: {
@@ -380,7 +380,8 @@ export default {
/* /*
支付之前要先保存银行账户信息 支付之前要先保存银行账户信息
*/ */
saveOrUpdateAccount(data).then(res => { let res = await saveOrUpdateAccount(data)
// .then(res => {
console.log('res', res) console.log('res', res)
that.$toast.clear() that.$toast.clear()
if (res.result == '0') { if (res.result == '0') {
@@ -394,6 +395,13 @@ export default {
let data = { let data = {
orderNo: window.localStorage.getItem('orderNo') orderNo: window.localStorage.getItem('orderNo')
} }
let rs = await this.underWrite()
if (rs.result != '0') {
this.$toast.clear()
this.$toast(rs.resultMessage)
}
acceptInsurance(data).then(res => { acceptInsurance(data).then(res => {
console.log('----取支付参数结果:', JSON.stringify(res)) console.log('----取支付参数结果:', JSON.stringify(res))
// 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'}} // 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'}}
@@ -434,7 +442,7 @@ export default {
} else { } else {
this.$toast(res.resultMessage) this.$toast(res.resultMessage)
} }
}) // })
} }
} }
} }

View File

@@ -79,7 +79,7 @@
name="被保险人姓名" name="被保险人姓名"
label="被保险人姓名" label="被保险人姓名"
required required
:parentShowPicker.sync="customerShowPicker" :parentShowPicker.sync="customerShowPicker2"
:value.sync="insuredInfo.name" :value.sync="insuredInfo.name"
@nameChange="nameChanges" @nameChange="nameChanges"
@on-click="selectClick('1','1')" @on-click="selectClick('1','1')"
@@ -124,6 +124,7 @@
label="指定生效日期" label="指定生效日期"
name="指定生效日期" name="指定生效日期"
required required
:minDate="now"
:value.sync="userInfo.effectiveDate" :value.sync="userInfo.effectiveDate"
type="date" type="date"
:flag="true" :flag="true"
@@ -207,6 +208,7 @@ export default {
}, },
data() { data() {
return { return {
now : new Date(),
isScan: false, //是否显示证件扫描组件 isScan: false, //是否显示证件扫描组件
allPrice: 0, allPrice: 0,
result: [], result: [],
@@ -268,9 +270,11 @@ export default {
sex: '0', //被保人性别 sex: '0', //被保人性别
birthday: '' //被保人出生日期 birthday: '' //被保人出生日期
}, },
selectUser: '',
areaList: areaList, areaList: areaList,
currentPopupIndex: '', currentPopupIndex: '',
customerShowPicker: false, customerShowPicker: false,
customerShowPicker2: false,
occupationShowPicker: false, occupationShowPicker: false,
timeId: null, timeId: null,
chooseProducts: JSON.parse(localStorage.chooseProducts), chooseProducts: JSON.parse(localStorage.chooseProducts),
@@ -317,8 +321,11 @@ export default {
this.insuredInfo.name = name this.insuredInfo.name = name
}, },
selectClick(index, value) { selectClick(index, value) {
console.log(index, value) if(value !== undefined){
localStorage.setItem('value', value) this.selectUser = value
}
// console.log(index, value)
// localStorage.setItem('value', value)
selectComp(this, index, '1') selectComp(this, index, '1')
}, },
// closeBtn() { // closeBtn() {
@@ -345,7 +352,11 @@ export default {
} }
}) })
if (this.currentPopupIndex == 1) { if (this.currentPopupIndex == 1) {
if(this.selectUser == '1'){
this.customerShowPicker2 = false
}else{
this.customerShowPicker = false this.customerShowPicker = false
}
} else if (this.currentPopupIndex == 2) { } else if (this.currentPopupIndex == 2) {
this.occupationShowPicker = false this.occupationShowPicker = false
} else if (this.currentPopupIndex == 3) { } else if (this.currentPopupIndex == 3) {
@@ -518,20 +529,27 @@ export default {
{ {
//指定生效日期 //指定生效日期
//如果录入日期晚于当前日期 //如果录入日期晚于当前日期
if (Date.parse(val) < Date.parse(new Date())) { // if (Date.parse(val) < Date.parse(new Date())) {
this.userInfo.birthday = '' // this.userInfo.birthday = ''
this.$refs.birthday.date = '' // this.$refs.birthday.date = ''
return this.$toast('当前日期早于当日') // return this.$toast('当前日期早于当日')
} // }
} }
break break
} }
}, },
//选择客户 //选择客户
chooseCustomer(data) { chooseCustomer(data) {
data = data[0]
console.log(data) console.log(data)
console.log(data[0][0], data[0][1]) console.log(typeof this.selectUser)
if(this.selectUser == '1'){
this.customerShowPicker2 = false
}else{
this.customerShowPicker = false this.customerShowPicker = false
}
this.$jump({ this.$jump({
flag: 'navigation', flag: 'navigation',
extra: { extra: {
@@ -539,33 +557,35 @@ export default {
hiddenRight: '1' hiddenRight: '1'
} }
}) })
if (data[0][1] == '0') { if (this.selectUser == '0') {
let { customerName, customerSex } = data[0][0] let { customerName, customerSex } = data
this.userInfo.name = customerName //用户名 this.userInfo.name = customerName //用户名
this.userInfo.sex = String(customerSex) //性别 this.userInfo.sex = customerSex ? customerSex.toString() : '0' //性别
this.userInfo.birthday = data.birthday //出生日期
this.userInfo.idType = data.customerIdType //证件类型
this.userInfo.idNo = data.customerIdNumber //证件类别
this.userInfo.birthday = data[0][0].birthday //出生日期 this.userInfo.mobile = data.customerPhone //移动电话
this.userInfo.idType = data[0][0].customerIdType //证件类型 this.userInfo.homeProvince = data.homeProvince //家庭省
this.userInfo.idNo = data[0][0].customerIdNumber //证件类别 this.userInfo.homeCity = data.homeCity //家庭市
this.userInfo.homeArea = data.homeArea //家庭区
this.userInfo.mobile = data[0][0].customerPhone //移动电话 if(data.homeProvince && data.homeCity && data.homeArea){
this.userInfo.homeProvince = data[0][0].homeProvince //家庭 this.homeName = getAreaName([{ code: data.homeProvince }, { code: data.homeCity }, { code: data.homeArea }]) //家庭地址
this.userInfo.homeCity = data[0][0].homeCity //家庭市 }
this.userInfo.homeArea = data[0][0].homeArea //家庭 this.userInfo.homeAddress = data.homeAddress //家庭详细地址
this.userInfo.homeAddress = data[0][0].homeAddress //家庭详细地址
// 计算年龄 // 计算年龄
// let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // let age = utilsAge.getAge(this.userInfo.birthday, new Date())
this.getRelatedData(this.userInfo.idNo,'1') this.getRelatedData(this.userInfo.idNo,'1')
} else if (data[0][1] == '1') { } else if (this.selectUser == '1') {
let { customerName, customerSex } = data[0][0] let { customerName, customerSex } = data
this.insuredInfo.name = customerName //用户名 this.insuredInfo.name = customerName //用户名
this.insuredInfo.sex = String(customerSex) //性别 this.insuredInfo.sex = customerSex ? customerSex.toString() : '0' //性别
this.insuredInfo.birthday = data[0][0].birthday //出生日期 this.insuredInfo.birthday = data.birthday //出生日期
this.insuredInfo.idType = data[0][0].customerIdType //证件类型 this.insuredInfo.idType = data.customerIdType //证件类型
this.insuredInfo.idNo = data[0][0].customerIdNumber //证件类别 this.insuredInfo.idNo = data.customerIdNumber //证件类别
// 计算年龄 // 计算年龄
// let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // let age = utilsAge.getAge(this.userInfo.birthday, new Date())
@@ -829,7 +849,7 @@ export default {
let resultData = await saveOrUpdateCard(params) let resultData = await saveOrUpdateCard(params)
if (resultData.result == 0) { if (resultData.result == 0) {
console.log(' resultData.orderNo', resultData.orderNo) console.log(' resultData.orderNo', resultData.content.object)
//存储被保人信息 //存储被保人信息
// let age = utilsAge.getAge(this.userInfo.birthday, new Date()) // let age = utilsAge.getAge(this.userInfo.birthday, new Date())
// localStorage.saleInsuredInfo = JSON.stringify({ // localStorage.saleInsuredInfo = JSON.stringify({
@@ -843,11 +863,12 @@ export default {
// localStorage.saleInsuredInfo = JSON.stringify(this.userInfo) // localStorage.saleInsuredInfo = JSON.stringify(this.userInfo)
// console.log(this.userInfo) // console.log(this.userInfo)
localStorage.orderNo = resultData.orderNo localStorage.orderNo = resultData.content.object
this.$jump({ this.$jump({
flag: 'h5', flag: 'h5',
extra: { extra: {
url: location.origin + `/#/cardList/pay` url: location.origin + `/#/cardList/pay`,
forbidSwipeBack: 1
}, },
routerInfo: { routerInfo: {
path: `/cardList/pay` path: `/cardList/pay`

View File

@@ -3,7 +3,12 @@ export function selectComp(that, index, type = '') {
that.currentPopupIndex = index that.currentPopupIndex = index
let title = '' let title = ''
if (index == 1) { if (index == 1) {
if(that.selectUser == '1'){
;[that.customerShowPicker2, title] = [true, '客户列表']
}else{
;[that.customerShowPicker, title] = [true, '客户列表'] ;[that.customerShowPicker, title] = [true, '客户列表']
}
// ;[that.customerShowPicker, title] = [true, '客户列表']
} else if (index == 2) { } else if (index == 2) {
;[that.occupationShowPicker, title] = [true, '职业类别'] ;[that.occupationShowPicker, title] = [true, '职业类别']
} else if (index == 3) { } else if (index == 3) {