Commit 2706b98e by liang ce

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

parent 8cb9cbd3
<template>
<div class="SystemReconciliation">
<div class="searchBox">
<a-range-picker
:defaultValue="[moment(startTime, 'YYYY/MM/DD'), moment(endTime, 'YYYY/MM/DD')]"
:disabledDate="disabledDate"
@change="onChange" />
<a-date-picker
:disabledDate="disabledStartDate"
format="YYYY-MM-DD"
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>
</div>
<div class="title">账单汇总</div>
......@@ -41,7 +54,7 @@
</div>
</div>
</div>
<div>
<div style="margin-top: 110px">
<p>共计:<span>¥{{ returnConsumeCheck('total') }}</span></p>
<p>津贴:<span>¥{{ returnConsumeCheck('subsidyAmount') }}</span></p>
<p>现金:<span>¥{{ returnConsumeCheck('realityAmount') }}</span></p>
......@@ -60,6 +73,9 @@ export default {
return {
startTime: '',
endTime: '',
startValue: null,
endValue: null,
endOpen: false,
systemReconciliationDetails: {}
}
},
......@@ -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()
this.startTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-01`
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()
},
methods: {
moment,
onChange (date, dateString) {
console.log(date, dateString)
this.startTime = dateString[0]
this.endTime = dateString[1]
disabledStartDate (startValue) {
const endValue = this.endValue
if (!startValue || !endValue) {
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) {
let totalNum = 0
......@@ -121,9 +162,6 @@ export default {
return ''
}
},
disabledDate (current) {
return current && current > moment().endOf('day')
},
getAccountCheck () {
let SubsidyListData = this.$qs.stringify({
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