fix(bonus): 修复奖金查询跨月查询日期区间不正确的问题

This commit is contained in:
woody 2025-09-01 10:55:49 +08:00
parent 7c45082ca8
commit 7dac4daa72
1 changed files with 6 additions and 8 deletions

View File

@ -131,15 +131,13 @@ export default {
}, },
methods: { methods: {
setDefaultDateRange() { setDefaultDateRange() {
const end = new Date() const end = dayjs().subtract(1, 'day')
const start = new Date() const start = dayjs().subtract(15, 'day')
end.setDate(end.getDate() - 1) this.startDate = start.format('YYYY-MM-DD')
start.setDate(start.getDate() - 15) // 15 this.endDate = end.format('YYYY-MM-DD')
this.startDate = this.formatDate(start) this.startDateValue = Number(start.toDate())
this.endDate = this.formatDate(end) this.endDateValue = Number(end.toDate())
this.startDateValue = Number(start)
this.endDateValue = Number(end)
}, },
formatDate(date) { formatDate(date) {
return dayjs(date).format('YYYY-MM-DD') return dayjs(date).format('YYYY-MM-DD')