材料站领退记录默认时间

This commit is contained in:
bb_pan 2025-09-05 11:42:05 +08:00
parent 4a1252fbff
commit b6c21f05c9
2 changed files with 28 additions and 0 deletions

View File

@ -167,9 +167,19 @@ export default {
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.timeRange = [this.format(start), this.format(end)]
this.getList()
},
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}`
},
//
handleQuery() {
this.queryParams.pageNum = 1
@ -180,6 +190,10 @@ export default {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.timeRange = [this.format(start), this.format(end)]
this.getList()
},
//

View File

@ -163,9 +163,19 @@ export default {
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.timeRange = [this.format(start), this.format(end)]
this.getList()
},
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}`
},
//
handleQuery() {
this.queryParams.pageNum = 1
@ -176,6 +186,10 @@ export default {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.timeRange = [this.format(start), this.format(end)]
this.getList()
},
//