Commit 2ae51281 authored by 786817560's avatar 786817560

Merge branch 'develop' of https://hel.hand-china.com/xugong/hls-xcmg-vue-app into develop

parents 6c8f4828 5d397e41
......@@ -18,9 +18,7 @@
</div>
</div>
</div>
<scroll
ref="scroll" :updateData="[prj_lists]" :pullUp="true" class="pay-content"
@pullingUp="getDetail">
<section class="pay-content">
<section v-for="(item,index) in prj_lists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/payment/file.png" >
......@@ -42,7 +40,7 @@
</div>
</div>
</section>
</scroll>
</section>
</div>
<div class="prompt has-footer">
<div>
......@@ -55,7 +53,7 @@
</div>
</div>
<bottom-tab>
<tab-button class="footer" @click.native="createDetail">&nbsp;&nbsp;</tab-button>
<tab-button class="footer" @click.native="checkPay">&nbsp;&nbsp;</tab-button>
</bottom-tab>
</h-view>
</template>
......@@ -108,42 +106,23 @@ export default {
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.pagenum = 1
vm.prj_lists = []
vm.getDetail()
})
},
mounted () {
console.log(this.prj_lists)
},
methods: {
getDetail () {
let vm = this
let url = process.env.basePath + 'payment_prj_list_query'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
pagenum: vm.pagenum,
pagesize: 10,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
let returnData = []
returnData = res.prj_lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.prj_lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.prj_lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(false)
}
vm.prj_lists = res.prj_lists
vm.prj_lists.forEach(i => {
i.cf_lists.forEach(j => {
let num = parseFloat(j.due_amount) - parseFloat(j.received_amount)
......@@ -172,6 +151,18 @@ export default {
})
return data
},
checkPay () {
let money = parseFloat(this.money)
// let theDefault = parseFloat(this.defaultMoney)
if (money > 0) {
this.createDetail()
} else if (money === 0) {
hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
}
// else if (money > theDefault) {
// hlsPopup.showLongCenter('当前支付金额超出应还金额!')
// }
},
createDetail () {
let vm = this
let url = process.env.basePath + 'create_detail_0_part'
......@@ -245,7 +236,7 @@ export default {
margin:auto;
width: 355px;
//margin-top:-60px;
height:9rem;
height:8rem;
overflow: scroll;
//background-color: #FFF;
.contract-item {
......
......@@ -75,7 +75,15 @@ export default {
}
})
},
watch: {},
watch: {
'money': {
handler (newVal, oulVal) {
if (newVal === null) {
this.money = 0
}
},
},
},
methods: {
getDownPayment () {
let vm = this
......@@ -100,17 +108,16 @@ export default {
})
},
pay () {
this.payProtocol()
// let money = parseFloat(this.money)
// let theDefault = parseFloat(this.default)
// if (money > 0 && money <= theDefault) {
// this.payProtocol()
// } else if (money > theDefault) {
// hlsPopup.showLongCenter('当前支付金额超出应还金额!')
// } else if (money === 0) {
// hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
// }
// this.payProtocol()
let money = parseFloat(this.money)
let theDefault = parseFloat(this.default)
if (money > 0 && money <= theDefault) {
this.payProtocol()
} else if (money > theDefault) {
hlsPopup.showLongCenter('当前支付金额超出应还金额!')
} else if (money === 0) {
hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
}
},
payProtocol () {
let vm = this
......
......@@ -22,9 +22,7 @@
<input v-model="keyWords" type="text" placeholder="请输入合同号/车架号/承租人名称" >
<img src="@/assets/payment/search.png" alt >
</div>
<scroll
ref="scroll" :updateData="[showList]" :pullUp="true" class="pay-content"
@pullingUp="loadMore">
<section class="pay-content">
<section v-for="(item,index) in showList" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/payment/file.png" alt >
......@@ -77,15 +75,17 @@
</div>
</div>
</div>
<list-item :item-height="44">
<item>
<div slot="name">逾期利息</div>
<span slot="content">{{ money|currency }}</span>
</item>
</list-item>
</div>
</section>
</scroll>
<list-item :item-height="44" class="rate">
<item>
<div slot="name">逾期利息</div>
<span slot="content">{{ money|currency }}</span>
</item>
</list-item>
</section>
<div class="prompt has-footer">
<div>
<img src="@/assets/payment/prompt.png" alt >
......@@ -97,7 +97,7 @@
</div>
</div>
<bottom-tab>
<tab-button class="footer" @click.native="payDetail()">&nbsp;&nbsp;</tab-button>
<tab-button class="footer" @click.native="checkPay()">&nbsp;&nbsp;</tab-button>
</bottom-tab>
</div>
</h-view>
......@@ -116,6 +116,7 @@ export default {
vm.getRentInfo()
vm.money = vm.$route.params.money
vm.sumMoney = vm.money
vm.keyWords = ''
vm.info = []
vm.showList = []
vm.searchList = []
......@@ -163,7 +164,6 @@ export default {
vm.sumMoney = a
}
}
vm.money = a
})
} else {
if (vm.money !== '') {
......@@ -177,61 +177,31 @@ export default {
deep: true,
},
keyWords (newVal, oldVal) {
this.search()
this.getRentInfo()
},
'sumMoney': {
handler (newVal, oulVal) {
if (newVal === null || isNaN(newVal) || newVal === '') {
this.sumMoney = 0
}
},
},
},
methods: {
loadMore () {
if (this.keyWords) {
this.searchMore()
} else {
this.getRentInfo()
}
},
searchMore () {
let vm = this
let url = process.env.basePath + 'payment_con_list_query'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
pagesize: 10,
pagenum: vm.searchPagenum,
searchInput: vm.keyWords,
checkPay () {
let money = parseFloat(this.sumMoney)
// let theDefault = parseFloat(this.defaultMoney)
if (money > 0) {
this.payDetail()
} else if (money === 0) {
hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
}
vm.hlsPopup.showLoading('数据加载中,请稍后!')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
let returnData = []
returnData = res.prj_lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.searchList.push(array[index])
})
vm.searchPagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.searchList.push(array[index])
})
vm.searchPagenum++
vm.$refs.scroll.update(false)
}
vm.searchList.forEach(i => {
i.con_lists.forEach(j => {
let num = (parseFloat(j.due_amount) - parseFloat(j.received_amount))
vm.$set(j, 'amount', num)
})
})
vm.showList = vm.searchList
}
})
// else if (money > theDefault) {
// hlsPopup.showLongCenter('当前支付金额超出应还金额!')
// }
},
search () {
getRentInfo () {
let vm = this
vm.searchPagenum = 2
vm.$refs.scroll.scrollToTop()
let randomString = Math.floor(Math.random() * 21)
let url =
process.env.basePath +
......@@ -241,55 +211,12 @@ export default {
let param = {
bp_id: window.localStorage.getItem('bp_id'),
searchInput: vm.keyWords,
pagesize: 10,
pagenum: 1,
}
vm.hlsPopup.showLoading('数据加载中,请稍后!')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.searchList = res.prj_lists
vm.searchList.forEach(i => {
i.con_lists.forEach(j => {
let num = (parseFloat(j.due_amount) - parseFloat(j.received_amount))
vm.$set(j, 'amount', num)
})
})
vm.showList = vm.searchList
vm.$refs.scroll.update(false)
}
})
},
getRentInfo () {
let vm = this
let url = process.env.basePath + 'payment_con_list_query'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
pagesize: 10,
pagenum: vm.pagenum,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
// vm.info = res.prj_lists
let returnData = []
returnData = res.prj_lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.info.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.info.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(false)
}
vm.info = res.prj_lists
vm.info.forEach(i => {
i.con_lists.forEach(j => {
let num = (parseFloat(j.due_amount) - parseFloat(j.received_amount))
......@@ -348,6 +275,12 @@ export default {
</script>
<style lang='less' >
#payment-contract-record {
.list{
span{
overflow: hidden;
text-overflow: ellipsis;
}
}
.none {
display: flex;
justify-content: center;
......@@ -425,9 +358,10 @@ export default {
width: 95%;
position: absolute;
bottom: 150px;
left:0; right:0;
left:0;
right:0;
margin:auto;
height: 50%;
height: 53%;
overflow: scroll;
.contract-item {
background-color: #fff;
......@@ -550,12 +484,12 @@ export default {
}
}
}
.rate{
position: absolute;
width: 100%;
bottom: 134px;
box-shadow: -2px -2px 10px #ccc;
}
// .rate{
// position: absolute;
// width: 100%;
// bottom: 134px;
// box-shadow: -2px -2px 10px #ccc;
// }
.prompt {
position: absolute;
width: 100%;
......
......@@ -26,7 +26,7 @@
</div>
<div class="pay-input">
<span>应还租金</span>
<CurrencyInput v-model="pay_rent" class="currencyInput" type="text" placeholder="请输入支付金额" />
<CurrencyInput v-model="amount" class="currencyInput" type="text" placeholder="请输入支付金额" />
<div @click="createOrder">
<img src="@/assets/payment/into.png" >
</div>
......@@ -58,7 +58,7 @@
</div>
</h-content>
<bottom-tab>
<tab-button class="footer" @click.native="toPay">&nbsp;&nbsp;</tab-button>
<tab-button class="footer" @click.native="checkPay">&nbsp;&nbsp;</tab-button>
</bottom-tab>
</h-view>
</template>
......@@ -74,7 +74,7 @@ export default {
return {
money: 0,
liquidated_damages: 0,
pay_rent: 0,
amount: 0,
}
},
beforeRouteEnter (to, from, next) {
......@@ -84,18 +84,25 @@ export default {
} else if (from.name === 'Success') {
vm.money = parseInt(vm.default) - parseInt(window.localStorage.getItem('money'))
vm.default = vm.money
vm.pay_rent = vm.money
vm.amount = vm.money
}
})
},
computed: {},
watch: {
'pay_rent': {
'amount': {
handler () {
this.money = parseFloat(parseFloat(this.pay_rent) + parseFloat(this.liquidated_damages))
this.money = parseFloat(parseFloat(this.amount) + parseFloat(this.liquidated_damages))
},
immediate: true,
},
'money': {
handler (newVal, oulVal) {
if (newVal === null || isNaN(newVal)) {
this.money = 0
}
},
},
},
activated () {
// this.money = this.pay_rent
......@@ -117,19 +124,31 @@ export default {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.default = parseFloat(res.info.rental_amount) + parseFloat(res.info.overdue_amount)
vm.pay_rent = parseFloat(res.info.rental_amount).toFixed(2)
vm.amount = parseFloat(res.info.rental_amount).toFixed(2)
vm.liquidated_damages = parseFloat(res.info.overdue_amount).toFixed(2)
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
checkPay () {
let money = parseFloat(this.money)
let theDefault = parseFloat(this.default)
if (money > 0 && money <= theDefault) {
this.toPay()
} else if (money > theDefault) {
hlsPopup.showLongCenter('当前支付金额超出应还金额!')
} else if (money === 0) {
hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
}
},
toPay () {
let vm = this
let url = process.env.basePath + 'create_order_1_amount'
let param = {
info: {
bp_id: window.localStorage.getItem('bp_id'),
amount: vm.amount,
},
}
hlsPopup.showLoading('请稍候')
......
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