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

View File

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

View File

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