Commit af12fcb8 authored by linxin's avatar linxin

fixed

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