|
|
@@ -42,13 +42,13 @@
|
|
|
<div class="date-wrap">
|
|
|
<label>
|
|
|
<i class="iconfont icon-ico-date"></i>
|
|
|
- <input type="date" v-model="filterParams.fromDate" @change="setDate('fromDate')">
|
|
|
+ <input type="date" v-model="dateObj.fromDate" @change="setDate('fromDate')">
|
|
|
<p v-if="filterParams.fromDate">{{filterParams.fromDate | date}}</p>
|
|
|
</label>
|
|
|
<span>—</span>
|
|
|
<label>
|
|
|
<i class="iconfont icon-ico-date"></i>
|
|
|
- <input type="date" v-model="filterParams.toDate" @change="setDate('toDate')">
|
|
|
+ <input type="date" v-model="dateObj.toDate" @change="setDate('toDate')">
|
|
|
<p v-if="filterParams.toDate">{{filterParams.toDate | date}}</p>
|
|
|
</label>
|
|
|
</div>
|
|
|
@@ -193,7 +193,11 @@
|
|
|
},
|
|
|
showSelectMethod: false,
|
|
|
showSelectCurrency: false,
|
|
|
- showSelectStatus: false
|
|
|
+ showSelectStatus: false,
|
|
|
+ dateObj: {
|
|
|
+ fromDate: '',
|
|
|
+ toDate: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -344,20 +348,25 @@
|
|
|
this.filterRecord(this.filterParams.currencyName)
|
|
|
},
|
|
|
setDate (type) {
|
|
|
- // 00:00:00
|
|
|
- this.filterParams[type] = new Date(this.filterParams[type]).getTime() - 8 * 60 * 60 * 1000
|
|
|
- if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
|
|
|
- if (type === 'fromDate') {
|
|
|
- this.setRemindText('起始时间不能大于结束时间')
|
|
|
+ if (this.dateObj[type]) {
|
|
|
+ this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
|
|
|
+ if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
|
|
|
+ if (type === 'fromDate') {
|
|
|
+ this.setRemindText('起始时间不能大于结束时间')
|
|
|
+ } else {
|
|
|
+ this.setRemindText('结束时间不能小于起始时间')
|
|
|
+ }
|
|
|
+ this.filterParams[type] = null
|
|
|
+ this.dateObj[type] = null
|
|
|
} else {
|
|
|
- this.setRemindText('结束时间不能小于起始时间')
|
|
|
+ if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
|
|
|
+ // 23:59:59
|
|
|
+ this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
|
|
|
+ }
|
|
|
+ this.filterRecord()
|
|
|
}
|
|
|
- this.filterParams[type] = null
|
|
|
} else {
|
|
|
- if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
|
|
|
- // 23:59:59
|
|
|
- this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
|
|
|
- }
|
|
|
+ this.filterParams[type] = null
|
|
|
this.filterRecord()
|
|
|
}
|
|
|
},
|