Commit 29a71db8 authored by 5359's avatar 5359

dev测试环境跳转接口调整

parent 98ca0260
......@@ -7,7 +7,9 @@
</div>
<div class="search" style="height:40%; width:100%">
<div class="searchInput">
<input v-model="searchCondition.input" placeholder="请输入机号信息" onfocus="this.placeholder=''" onblur="this.placeholder='请输入机号信息'">
<input
v-model="searchCondition.input" placeholder="请输入机号信息" onfocus="this.placeholder=''"
onblur="this.placeholder='请输入机号信息'">
<button style="position:absolute;right:10px" @click="detectSearchCondition()">搜索</button>
</div>
</div>
......@@ -24,17 +26,19 @@
<div class="cont-type" style="color: #5a5959;font-size: 14px">机号:{{ item.serialno }}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">租金总额:{{ item.contractamt }}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">租赁开始日:{{ item.leasebgndt }}</div>
<div class="cont-type" style="color: #5a5959;font-size: 14px">状态:<span style="font-weight: 700;
<div class="cont-type" style="color: #5a5959;font-size: 14px">状态:<span
style="font-weight: 700;
color: rgba(198, 0, 0, 0.5);">{{ item.status }}</span></div>
</div>
<router-link :to="{name:'CmbPolyPayDetail',query:{contractno:item.contractno}}" class="more">
<router-link :to="{ name: 'CmbPolyPayDetail', query: { contractno: item.contractno } }" class="more">
<img src="../../../assets\image\right-arrow@2x.png" alt="">
</router-link>
<button @click="download(index)">账单下载</button>
</article>
</div>
<div v-else-if="ListNum == 0" class="billList">
<div style="
<div
style="
width: 200px;
height: 160px;
position: relative;
......@@ -64,67 +68,64 @@ export default {
},
created () {
if (window.localStorage.openId) {
this.searchBill(window.localStorage.openId);
this.searchBill(window.localStorage.openId)
}
},
mounted () { },
methods: {
searchBill (openId) {
let vm = this;
let value = vm.searchCondition.input;
let url = process.env.basePath + 'getCmbConList';
console.log("请求数据")
// http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName=getCmbConList
let vm = this
let value = vm.searchCondition.input
let url = process.env.basePath + 'getCmbConList'
// console.log('请求数据')
let params = {
openId:"oBdoRwAgUiwsQvNGYhBYks6JJLPE",
serialno:"JAEB0T100610",
openId: 'oBdoRwAgUiwsQvNGYhBYks6JJLPE',
// openId: openId,
// serialno: value,
};
serialno: value,
}
// console.log("请求");
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, params).then(function (res) {
vm.hlsPopup.hideLoading();
console.log(res)
vm.hlsPopup.hideLoading()
// console.log(res)
if (res.result.respCode === 'S') {
console.log(params);
console.log(res);
var dataInfo = JSON.parse(res.result.json)
// console.log('请求成功', dataInfo.lists)
vm.ListNum = dataInfo.lists.length;
vm.massages = dataInfo.lists;
vm.ListNum = dataInfo.lists.length
vm.massages = dataInfo.lists
} else {
vm.ListNum = 0;
vm.ListNum = 0
vm.hlsPopup.showLongCenter('查询合同列表失败' + res.result.respMsg)
}
})
},
download (index) {
console.log('下载')
download (contractno) {
// console.log('下载')
window.open('http://sign.hitachics.com:8091/report/ReportServer?reportlet=/report/PAR015.cpt&CONTRACTNO=' + contractno + '&format=PDF&extype=simple', '_system')
},
detectSearchCondition () {
this.searchBill(window.localStorage.openId)
},
detectSearchCondition(){
this.searchBill (window.localStorage.openId);
}
},
}
</script>
<style lang="less" type="text/less" scoped>
.title{
.title {
border-radius: 5px;
background-color: #ddd;
display: flex;
justify-content: space-around;
align-items: center;
div{
div {
height: 20px;
line-height: 20px;
font-size: 16px;
font-weight:bolder;
font-weight: bolder;
color: #11111187;
}
}
.search {
display: flex;
//height: 50px;
......@@ -134,6 +135,7 @@ export default {
position: relative;
border: 1px solid #cccccc;
border-radius: 20px;
.searchInput {
margin-left: 5%;
display: -webkit-flex;
......@@ -145,6 +147,7 @@ export default {
-webkit-box-align: center;
align-items: center;
-webkit-align-items: center;
input {
text-align: center;
width: 90%;
......@@ -158,7 +161,8 @@ export default {
//padding-left: 11px;
}
}
button{
button {
margin-right: -10px;
background-color: rgb(230, 230, 230);
border: 1px solid #cccccc;
......@@ -169,11 +173,13 @@ export default {
padding: 0px;
}
}
// 账单卡片列表
.billList {
//账单卡片
width: 100%;
padding-bottom: 30px;
.article {
position: relative;
border: 1px solid #d0d0d0;
......@@ -181,20 +187,23 @@ export default {
margin: 0 auto 12px;
height: 200px;
width: 98%;
.text {
float: left;
line-height: 16px;
margin-left: 5px;
margin-right: 0px;
position: relative;
top:50%;
top: 50%;
transform: translateY(-50%);
.cont-type{
.cont-type {
padding-top: 2px;
width: 97%;
word-wrap:break-word;
word-wrap: break-word;
}
}
.icon {
//左侧图标
position: relative;
......@@ -204,11 +213,13 @@ export default {
margin-right: 0;
top: 50%;
transform: translateY(-20px);
img {
width: 40px;
height: 40px;
}
}
button {
position: absolute;
bottom: 12px;
......@@ -220,14 +231,17 @@ export default {
background-color: rgb(0, 200, 0);
border: 2px solid rgb(0, 200, 0);
border-radius: 5px;
};
padding-right: 1px;
padding-left: 1px;
}
.more {
top:50%;
top: 50%;
transform: translateY(-50%);
position: relative;
float: left;
};
}
box-shadow: 3px 3px 3px 3px #b6b6b6;
};
}
}
</style>
<template>
<h-view style="overflow:auto;" title="还款明细">
<div class="page-box" style="width:100% height:100%" >
<div class="page-box" style="width:100% height:100%">
<ul id="box" style="margin-bottom: 150px;">
<li v-for="(item, index) in Lists" :key="index" class="items">
<input v-model="checked[index]" class="" type="checkbox" @mouseup="onClickHander(index)">
......@@ -19,7 +19,9 @@
<div v-if="bottomType == 0" class="bottomBox">
<div class="total">
<div class="counter"><span>合计还款金额:{{ total }}</span></div>
<input id="payamount" type="number" placeholder="请输入支付金额" required oninvalid="setCustomValidity('请输入支付金额!');"
<input
id="payamount" type="number" placeholder="请输入支付金额" required
oninvalid="setCustomValidity('请输入支付金额!');"
oninput="setCustomValidity('');" onfocus="this.placeholder=''" onblur="this.placeholder='请输入支付金额'">
</div>
<button @click="pay">支付</button>
......@@ -34,7 +36,14 @@
</button>
<p>扫码支付</p>
</div>
<div id="qrcode"></div>
<div class="ermTotal"><span>{{ showPayamount }}</span></div>
<div id="qrcode" />
<div class="ermBottom"><span>支持微信/支付宝/银联支付</span></div>
<div class="ermImage">
<img src="../../../assets\image\wechart.png" alt="">
<img src="../../../assets\image\wechart.png" alt="">
<img src="../../../assets\image\wechart.png" alt="">
</div>
</div>
</div>
</h-view>
......@@ -42,6 +51,7 @@
<script>
import QRCode from 'qrcodejs2'
export default {
data () {
return {
......@@ -52,27 +62,30 @@ export default {
total: 0, // 总计金额
ListNum: 0, // 总共有多少项
Lists: [], // 原始数据
payamount: 0, //支付金额
showPayamount: 0, //后续支付结果页面显示
payamount: 0, // 支付金额
showPayamount: 0, // 后续支付结果页面显示
recamt_id: '', // 获得的账单二维码
counter:[15,30,1],//前十次请求间隔,后十次请求间隔,间隔一/二
counter: [10, 10, 1], // 前十次请求间隔,后十次请求间隔,间隔一/二
timer: '',
timer2: '',
}
},
created () {
// 当数据拿到之后给checked初始值;
var name = this.$route.query.contractno;
console.log('传值', name);
var name = this.$route.query.contractno
// console.log('传值', name)
// this.contractno = "L20RJ00313";
this.contractno = name;
this.getData();
this.contractno = name
this.getData()
},
beforeMount () {
},
methods: {
getData () {
console.log("获取最新账单");
// console.log('获取最新账单')
let vm = this
let url = process.env.basePath + 'getCmbConDetail'
let params = {
// L20RJ00313
'contractno': this.contractno,
}
// console.log("请求");
......@@ -84,11 +97,10 @@ export default {
// 给checked和unchecked初始值
for (let i = 0; i < vm.ListNum; i++) {
// console.log('给checked初始值');
vm.checked[i] = false;
vm.unchecked[i] = dataInfo.lists[i].select_flag === 'N';
vm.checked[i] = false
vm.unchecked[i] = dataInfo.lists[i].select_flag === 'N'
}
vm.Lists = dataInfo.lists;
console.log(vm.Lists);
vm.Lists = dataInfo.lists
} else {
vm.hlsPopup.showLongCenter('获取合同还款计划失败,请联系管理员')
}
......@@ -98,7 +110,7 @@ export default {
})
// console.log(vm.Lists);
},
//点击支付
// 点击支付
pay () {
let vm = this
let $input = document.getElementById('payamount')
......@@ -106,6 +118,7 @@ export default {
if ($input.value <= this.total && $input.value != 0) {
// console.log($input.value);
this.payamount = $input.value
this.showPayamount = $input.value
// 请求支付
let vm = this
let url = process.env.basePath + 'createLd037'
......@@ -114,22 +127,26 @@ export default {
'amount': this.payamount,
}
vm.$post(url, params).then(function (res) {
if (res.result.return_status === 'S') {
if (res.result.return_status == 'S') {
var dataInfo = res.result
vm.recamt_id = dataInfo.recamt_id
// console.log('获取支付id', vm.recamt_id)
vm.bottomType = 1;
vm.showRecamt();
vm.bottomType = 1
$input.value = ''
$input.placeholder = '请输入支付金额'
vm.payamount = 0
vm.total = 0
vm.showRecamt()
} else {
vm.hlsPopup.showLongCenter(res.result.return_message)
}
})
} else if (this.total === 0) {
} else if (this.total == 0) {
$input.value = ''
$input.placeholder = '请选择要支付的款项'
} else if ($input.value > this.total) {
$input.value = ''
$input.placeholder = '您输入的支付金额过多!'
$input.placeholder = '您输入的支付过多!'
} else if ($input.value === '') {
$input.placeholder = '请输入支付金额'
} else if ($input.value === 0) {
......@@ -138,125 +155,181 @@ export default {
},
showRecamt () {
let vm = this
let url = 'http://sign.hitachics.com/core/r/api/cmb/poly/get/qrcode'
console.log('支付id', this.recamt_id)
let url = process.env.rootPath + '/cmb/poly/get/qrcode'
// console.log('支付id', this.recamt_id)
let params = {
'recamt_id': this.recamt_id,
}
console.log('params', params);
// console.log('params', params)
vm.$post(url, params).then(function (res) {
console.log(res);
document.getElementById("qrcode").innerHTML = "";
// console.log(res)
document.getElementById('qrcode').innerHTML = ''
if (res.respCode == 'SUCCESS') {
let dataInfo = res.qrCode;
let qrcode = new QRCode("qrcode",
let dataInfo = res.qrCode
let qrcode = new QRCode('qrcode',
{
text: dataInfo,
width: 128,
height: 128,
colorDark : '#000000',
colorLight : '#ffffff',
correctLevel: QRCode.CorrectLevel.H // 容错等级
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H, // 容错等级
}
);
console.log(qrcode);
)
// console.log(qrcode)
} else {
vm.hlsPopup.showLongCenter(res.respMsg);
vm.hlsPopup.showLongCenter(res.respMsg)
}
}).then(function(res){
vm.waitResult(params);
}).then(function (res) {
vm.waitResult(params)
})
},
waitResult(params){
var number = this.counter[0];
var num = number;
var frequency = 0;//记录一种间隔请求次数
clearInterval(this.timer);
let vm = this;
let url = 'http://sign.hitachics.com/core/r/api/cmb/poly/query/order/status';
let urlp = "http://sign.hitachics.com/core/r/api/cmb/poly/close/order";
this.timer = setInterval(()=>{
waitResult (params) {
var num = this.counter[0]// 记录请求次数
var frequency = this.counter[1]// 记录请求次数
clearInterval(this.timer)
clearInterval(this.timer2)
let vm = this
let url = process.env.rootPath + '/cmb/poly/query/order/status'
let urlp = process.env.rootPath + '/cmb/poly/close/order'
// this.timer = setInterval(() => {
// // console.log(num);
// num--
// if (num === 0) {
// num = number
// frequency++
// // 间隔x秒请求结果
// console.log(this.counter[2], frequency)
// vm.$post(url, params).then(function (res) {
// if (res.respCode == 'SUCCESS') {
// console.log('成功')
// // 接口文档上有状态,但实际没有;
// if (res.tradeState != 'P') {
// clearInterval(vm.timer)// 判断订单已支付暂停定时器
// };
// // 支付成功应该不需要前端主动关闭订单吧;
// // vm.closeBill(urlp, params);
// console.log(res.respMsg)
// } else {
// console.log(res.respMsg)
// }
// })
// };
// // 每15/30秒请求一次,每种间隔请求frequency次
// if (frequency === 10) {
// if (this.counter[2] === 1) {
// number = this.counter[1]
// frequency = 0
// this.counter[2] = 2
// } else {
// this.counter[2] = 1
// console.log('停止查询')
// clearInterval(this.timer)
// this.closeBill(urlp, params)// 关闭订单
// }
// }
// }, 1000)
// },
this.timer = setInterval(() => {
// console.log(num);
num -- ;
if(num === 0){
num = number;
frequency++;
//间隔x秒请求结果
console.log(this.counter[2],frequency)
if (num !== 0) {
num--
// 间隔15秒请求结果
// console.log('查询1', num)
vm.$post(url, params).then(function (res) {
if (res.respCode == 'SUCCESS') {
console.log("成功");
clearInterval(vm.timer);//判断订单已支付暂停定时器
// if(res.tradeState != "P"){};//接口文档上有状态,但实际没有;
//支付成功应该不需要前端主动关闭订单吧;
// console.log('成功')
// 接口文档上有状态,但实际没有;
if (res.tradeState != 'P') {
clearInterval(vm.timer)// 判断订单已支付暂停定时器
if (res.tradeState == 'S') {
vm.hlsPopup.showLongCenter('支付完成')
}
};
// 支付成功应该不需要前端主动关闭订单吧;
// vm.closeBill(urlp, params);
console.log(res.respMsg);
}else{
console.log(res.respMsg);
console.log(res.respMsg)
// vm.hlsPopup.showLongCenter(res.respMsg)
} else {
console.log(res.respMsg)
// vm.hlsPopup.showLongCenter(res.respMsg)
}
});
})
} else {
// 运行10次关闭定时器
clearInterval(vm.timer)// 判断订单已支付暂停定时器
this.timer2 = setInterval(() => {
if (frequency !== 0) {
frequency--
// 间隔x秒请求结果
// console.log('查询2', frequency)
vm.$post(url, params).then(function (res) {
if (res.respCode == 'SUCCESS') {
// console.log('成功')
// 接口文档上有状态,但实际没有;
if (res.tradeState != 'P') {
clearInterval(vm.timer2)// 判断订单已支付暂停定时器
};
//每15/30秒请求一次,每种间隔请求frequency次
if(frequency === 10){
if(this.counter[2] === 1){
number = this.counter[1];
frequency = 0 ;
this.counter[2] = 2;
}else{
this.counter[2] = 1;
console.log("停止查询");
clearInterval(this.timer) ;
this.closeBill(urlp, params);//关闭订单
}
}
},1000);
console.log(res.respMsg)
// vm.hlsPopup.showLongCenter(res.respMsg)
} else {
console.log(res.respMsg)
// vm.hlsPopup.showLongCenter(res.respMsg)
}
})
} else { clearInterval(vm.timer2) }
}, 30000)
}
}, 15000)
},
closeBill(urlp, params){
let vm = this;
closeBill (urlp, params) {
let vm = this
vm.$post(urlp, params).then(function (res) {
console.log(res,"订单关闭");
if(res.respCode == 'SUCCESS'){
console.log(res.respMsg);
// console.log(res, '订单关闭')
if (res.respCode == 'SUCCESS') {
// console.log(res.respMsg)
vm.hlsPopup.showLongCenter(res.respMsg)
}
});
})
},
close () {
// 点击关闭二维码页面;
this.bottomType = 0
this.getData();
this.total= 0;
this.total = 0
this.showPayamount = 0
this.payamount = 0
clearInterval(this.timer)
clearInterval(this.timer2)
this.getData()
},
//选择账单后把总计金额显示在底部
// 选择账单后把总计金额显示在底部
onClickHander (index) {
if (this.Lists[index].select_flag == 'N') {
return
}
var num = this.total;
var num = this.total
// 计算
if (this.checked[index] == false) {
num += this.Lists[index].recdueamt_total;
num = Math.round((num + this.Lists[index].recdueamt_total) * 100) / 100
} else if (this.checked[index] == true) {
num -= this.Lists[index].recdueamt_total;
num = Math.round((num - this.Lists[index].recdueamt_total) * 100) / 100
}
num = Number(num.toFixed(2));
// console.log(Number(num.toFixed(2)));
this.total = num;
document.getElementById('payamount').value = num;
console.log(index);
this.total = num
document.getElementById('payamount').value = this.total
// console.log(index)
},
//根据getData时 生成的 unchecked:[] 给checkbox添加样式,true为不可选
// 根据getData时 生成的 unchecked:[] 给checkbox添加样式,true为不可选
addClass () {
// console.log("add");
for (var i = 0; i < this.ListNum; i++) {
let $input = document.getElementById('box').children[i].children[0];
let $ul = document.getElementById('box').children[i].children[1];
let $input = document.getElementById('box').children[i].children[0]
let $ul = document.getElementById('box').children[i].children[1]
// console.log($input.className);
if (this.unchecked[i] === true) {
$input.className = 'uncheck-box';
$ul.className = 'uncheck-ul';
if (this.unchecked[i] == true) {
$input.className = 'uncheck-box'
$ul.className = 'uncheck-ul'
} else {
$input.className = 'check-box';
$ul.className = 'check-ul';
$input.className = 'check-box'
$ul.className = 'check-ul'
}
}
},
......@@ -279,22 +352,27 @@ export default {
border: 2px solid #afafaf;
border-radius: 8px;
background-color: #ffffff;
li {
padding-left: 8px;
padding-top: 15px;
float: left;
width: 50%;
span {
font-weight: 700;
}
}
}
.uncheck-ul{
.uncheck-ul {
background-color: #ffffff;
}
.check-ul{
.check-ul {
background-color: #ffffff;
}
//复选框样式
input[type="checkbox"] {
......@@ -308,6 +386,7 @@ export default {
transform: translateY(-5px);
visibility: hidden;
}
//可选时选中和未选中两种状态
.check-box[type="checkbox"]:checked::after {
height: 18px;
......@@ -319,6 +398,7 @@ export default {
font-size: 15px;
font-weight: bold;
}
.check-box[type="checkbox"]::after {
position: absolute;
background-color: #ffffff;
......@@ -331,6 +411,7 @@ export default {
content: " ";
border-radius: 50%;
}
//不可选的样式
.uncheck-box[type="checkbox"]::after {
position: absolute;
......@@ -345,6 +426,7 @@ export default {
border-radius: 50%;
}
}
.bottomBox {
position: absolute;
bottom: 0px;
......@@ -352,21 +434,24 @@ export default {
height: 18%;
background-color: #fffffe;
border-top: 2px solid #7aae3b;
.total {
font-size: 14px;
font-weight: bolder;
color: rgb(180, 0, 0);
width: 90%;
// height: 20%;
// height: 20 %;
margin: 20px auto;
display: flex;
justify-content: space-around;
align-items: flex-end;
.counter{
.counter {
vertical-align: bottom;
position: relative;
bottom: 0px;
}
input {
font-size: 12px;
position: relative;
......@@ -379,11 +464,12 @@ export default {
padding-right: 2%;
}
}
button{
button {
position: relative;
width: 20%;
height: 25%;
// top: -10px;
//top: - 10 px;
left: 50%;
transform: translateX(-50%);
font-size: 16px;
......@@ -393,18 +479,21 @@ export default {
background-color: rgb(0, 200, 0);
}
}
.ermPage {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
.topBlack {
width: 100%;
height: 70%;
background-color: rgb(140, 140, 140);
opacity: 0.7;
}
.bottomErm {
position: absolute;
bottom: 0px;
......@@ -414,6 +503,7 @@ export default {
border: 1px solid #dab2b2;
border-top-left-radius: 18px;
border-top-right-radius: 18px;
p {
font-weight: 700;
margin-top: 15px;
......@@ -421,6 +511,7 @@ export default {
font-size: 16px;
text-align: center;
}
.close {
position: relative;
float: left;
......@@ -432,6 +523,7 @@ export default {
border-radius: 50%;
border: 3px solid #dab2b2;
font-size: 14px;
p {
position: relative;
top: 0px;
......@@ -444,16 +536,42 @@ export default {
text-align: center;
}
}
#qrcode{
.ermTotal {
font-weight: 700;
margin-top: 10px;
font-size: 16px;
text-align: center;
}
.ermBottom {
font-weight: 700;
margin-top: 40%;
font-size: 16px;
text-align: center;
color: rgb(55, 69, 197);
}
.ermImage {
position: absolute;
left: 38%;
margin-top: 1%;
img {
width: 12%;
height: 11%;
}
}
#qrcode {
position: absolute;
width: 128px;
height: 128px;
top: 30%;
top: 25%;
left: 50%;
transform: translateX(-50%);
// background-color:#72a03c ;
//background-color: #72a03c;
}
}
}
</style>
......@@ -225,7 +225,8 @@ export default {
// vm.getWxUserInfo(window.localStorage.openId);
vm.hlsHttp.post(url, param).then(function (res) {
if (res.resultCode == '00') {
window.localStorage.openId = res.result
//window.localStorage.openId = res.result
window.localStorage.openId = 'oBdoRwAgUiwsQvNGYhBYks6JJLPE'
if (window.localStorage.openId) {
vm.getWxUserInfo(window.localStorage.openId)
vm.getUserInfo(window.localStorage.openId)
......
......@@ -44,6 +44,7 @@ import UploadImage from '@/pages/applications/userRegisters/uploadImage'
import ChinaUnionPay from '@/pages/applications/chinaUnionPay/chinaUnionPay'
// 招行聚合支付
import CmbPolyPay from '@/pages/applications/cmbPolyPay/cmbPolyPay'
// 招行聚合支付明细
import CmbPolyPayDetail from '@/pages/applications/cmbPolyPay/cmbPolyPayDetail'
Vue.use(Router)
......@@ -225,6 +226,7 @@ export default new Router({
keepAlive: false,
},
},
// 招行聚合支付合同明细
{
path: '/CmbPolyPayDetail',
component: CmbPolyPayDetail,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment