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 @@ ...@@ -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>
...@@ -116,6 +116,7 @@ export default { ...@@ -116,6 +116,7 @@ export default {
vm.getRentInfo() vm.getRentInfo()
vm.money = vm.$route.params.money vm.money = vm.$route.params.money
vm.sumMoney = vm.money vm.sumMoney = vm.money
vm.keyWords = ''
vm.info = [] vm.info = []
vm.showList = [] vm.showList = []
vm.searchList = [] vm.searchList = []
...@@ -163,7 +164,6 @@ export default { ...@@ -163,7 +164,6 @@ export default {
vm.sumMoney = a vm.sumMoney = a
} }
} }
vm.money = a
}) })
} else { } else {
if (vm.money !== '') { if (vm.money !== '') {
...@@ -177,61 +177,31 @@ export default { ...@@ -177,61 +177,31 @@ export default {
deep: true, deep: true,
}, },
keyWords (newVal, oldVal) { keyWords (newVal, oldVal) {
this.search() this.getRentInfo()
},
'sumMoney': {
handler (newVal, oulVal) {
if (newVal === null || isNaN(newVal) || newVal === '') {
this.sumMoney = 0
}
},
}, },
}, },
methods: { methods: {
loadMore () { checkPay () {
if (this.keyWords) { let money = parseFloat(this.sumMoney)
this.searchMore() // let theDefault = parseFloat(this.defaultMoney)
} else { if (money > 0) {
this.getRentInfo() this.payDetail()
} } else if (money === 0) {
}, hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
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('数据加载中,请稍后!') // else if (money > theDefault) {
vm.hlsHttp.post(url, param).then(function (res) { // hlsPopup.showLongCenter('当前支付金额超出应还金额!')
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 () { getRentInfo () {
let vm = this let vm = this
vm.searchPagenum = 2
vm.$refs.scroll.scrollToTop()
let randomString = Math.floor(Math.random() * 21) let randomString = Math.floor(Math.random() * 21)
let url = let url =
process.env.basePath + process.env.basePath +
...@@ -241,55 +211,12 @@ export default { ...@@ -241,55 +211,12 @@ export default {
let param = { let param = {
bp_id: window.localStorage.getItem('bp_id'), bp_id: window.localStorage.getItem('bp_id'),
searchInput: vm.keyWords, 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('请稍候') 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') {
// 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 => { vm.info.forEach(i => {
i.con_lists.forEach(j => { i.con_lists.forEach(j => {
let num = (parseFloat(j.due_amount) - parseFloat(j.received_amount)) let num = (parseFloat(j.due_amount) - parseFloat(j.received_amount))
...@@ -348,6 +275,12 @@ export default { ...@@ -348,6 +275,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 +358,10 @@ export default { ...@@ -425,9 +358,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 +484,12 @@ export default { ...@@ -550,12 +484,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