diff --git a/fuintAdmin_zt/src/views/financialStatement/dai_yunyingfenxi/tab/paym.vue b/fuintAdmin_zt/src/views/financialStatement/dai_yunyingfenxi/tab/paym.vue index b74b6cbaf..fc32e5853 100644 --- a/fuintAdmin_zt/src/views/financialStatement/dai_yunyingfenxi/tab/paym.vue +++ b/fuintAdmin_zt/src/views/financialStatement/dai_yunyingfenxi/tab/paym.vue @@ -229,12 +229,23 @@ export default { this.timeIndex = index this.disabled = true if (this.timeList[index] == '今日') { - let start = new Date() - start.setHours(0) - start.setMinutes(0) - start.setSeconds(0) - start.setMilliseconds(0) - this.value2 = [start, new Date()] + let start = new Date(); + start.setHours(0); + start.setMinutes(0); + start.setSeconds(0); + start.setMilliseconds(0); + let end = new Date(); + function formatDate(date) { + let year = date.getFullYear(); + let month = String(date.getMonth() + 1).padStart(2, '0'); + let day = String(date.getDate()).padStart(2, '0'); + let hours = String(date.getHours()).padStart(2, '0'); + let minutes = String(date.getMinutes()).padStart(2, '0'); + let seconds = String(date.getSeconds()).padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + } + this.value2 = [formatDate(start), formatDate(end)]; + console.log(this.value2); } else if (this.timeList[index] == '近一周') { let nowDate = new Date() let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)