Commit 2706b98e by liang ce

系统对账时间组件修改,布局修改

parent 8cb9cbd3
<template> <template>
<div class="SystemReconciliation"> <div class="SystemReconciliation">
<div class="searchBox"> <div class="searchBox">
<a-range-picker <a-date-picker
:defaultValue="[moment(startTime, 'YYYY/MM/DD'), moment(endTime, 'YYYY/MM/DD')]" :disabledDate="disabledStartDate"
:disabledDate="disabledDate" format="YYYY-MM-DD"
@change="onChange" /> v-model="startValue"
placeholder="开始日期"
@change="onChangeStartValue"
@openChange="handleStartOpenChange"
/>
<a-date-picker
:disabledDate="disabledEndDate"
format="YYYY-MM-DD"
placeholder="结束日期"
@change="onChangeEndValue"
v-model="endValue"
:open="endOpen"
@openChange="handleEndOpenChange"
/>
<a-button type="primary" @click="getAccountCheck">查询</a-button> <a-button type="primary" @click="getAccountCheck">查询</a-button>
</div> </div>
<div class="title">账单汇总</div> <div class="title">账单汇总</div>
...@@ -41,7 +54,7 @@ ...@@ -41,7 +54,7 @@
</div> </div>
</div> </div>
</div> </div>
<div> <div style="margin-top: 110px">
<p>共计:<span>¥{{ returnConsumeCheck('total') }}</span></p> <p>共计:<span>¥{{ returnConsumeCheck('total') }}</span></p>
<p>津贴:<span>¥{{ returnConsumeCheck('subsidyAmount') }}</span></p> <p>津贴:<span>¥{{ returnConsumeCheck('subsidyAmount') }}</span></p>
<p>现金:<span>¥{{ returnConsumeCheck('realityAmount') }}</span></p> <p>现金:<span>¥{{ returnConsumeCheck('realityAmount') }}</span></p>
...@@ -60,6 +73,9 @@ export default { ...@@ -60,6 +73,9 @@ export default {
return { return {
startTime: '', startTime: '',
endTime: '', endTime: '',
startValue: null,
endValue: null,
endOpen: false,
systemReconciliationDetails: {} systemReconciliationDetails: {}
} }
}, },
...@@ -70,14 +86,39 @@ export default { ...@@ -70,14 +86,39 @@ export default {
let day = (new Date(year, month, 0).getDate().toString()).length > 1 ? new Date(year, month, 0).getDate() : '0' + new Date(year, month, 0).getDate() let day = (new Date(year, month, 0).getDate().toString()).length > 1 ? new Date(year, month, 0).getDate() : '0' + new Date(year, month, 0).getDate()
this.startTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-01` this.startTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-01`
this.endTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-${day}` this.endTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-${day}`
this.startValue = this.moment(`${year}-${month.toString().length > 1 ? month : '0' + month}-01`, 'YYYY-MM-DD')
this.endValue = this.moment(`${year}-${month.toString().length > 1 ? month : '0' + month}-${day}`, 'YYYY-MM-DD')
this.getAccountCheck() this.getAccountCheck()
}, },
methods: { methods: {
moment, moment,
onChange (date, dateString) { disabledStartDate (startValue) {
console.log(date, dateString) const endValue = this.endValue
this.startTime = dateString[0] if (!startValue || !endValue) {
this.endTime = dateString[1] return false
}
return startValue.valueOf() > endValue.valueOf() || startValue.valueOf() >= moment().endOf('day').valueOf()
},
disabledEndDate (endValue) {
const startValue = this.startValue
if (!endValue || !startValue) {
return false
}
return startValue.valueOf() > endValue.valueOf() || endValue.valueOf() > moment().endOf('day').valueOf()
},
handleStartOpenChange (open) {
if (!open) {
this.endOpen = true
}
},
handleEndOpenChange (open) {
this.endOpen = open
},
onChangeStartValue (date, dateString) {
this.startTime = dateString
},
onChangeEndValue (date, dateString) {
this.endTime = dateString
}, },
returnConsumeCheck (str) { returnConsumeCheck (str) {
let totalNum = 0 let totalNum = 0
...@@ -121,9 +162,6 @@ export default { ...@@ -121,9 +162,6 @@ export default {
return '' return ''
} }
}, },
disabledDate (current) {
return current && current > moment().endOf('day')
},
getAccountCheck () { getAccountCheck () {
let SubsidyListData = this.$qs.stringify({ let SubsidyListData = this.$qs.stringify({
startTime: this.startTime, startTime: this.startTime,
......
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