增加默认查询时间

This commit is contained in:
bb_pan 2025-07-28 09:16:25 +08:00
parent ce1618bb85
commit 02771f4edb
1 changed files with 14 additions and 1 deletions

View File

@ -555,9 +555,19 @@ export default {
if (this.$route.query.code) { if (this.$route.query.code) {
this.queryParams.keyWord = this.$route.query.code this.queryParams.keyWord = this.$route.query.code
} }
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList() this.getList()
}, },
methods: { methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
getList() { getList() {
this.loading = true this.loading = true
const params = { const params = {
@ -586,7 +596,10 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams.time = [] const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.queryParams.taskStatus = '' this.queryParams.taskStatus = ''
this.queryParams.keyWord = '' this.queryParams.keyWord = ''
this.queryParams.isConfirm = '' this.queryParams.isConfirm = ''