领料办理-增加默认时间查询2个月内

This commit is contained in:
bb_pan 2025-07-09 14:14:09 +08:00
parent 0a831b2842
commit f6c384e163
1 changed files with 14 additions and 1 deletions

View File

@ -409,6 +409,10 @@ export default {
};
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
// this.getStatusList();
this.getList();
// this.getTypeList()
@ -422,6 +426,12 @@ export default {
// this.modelList = response.data
// })
// },
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}`
},
//
handleSelectionChange(selection) {
@ -468,9 +478,12 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = [];
this.resetForm("queryForm");
this.queryParams.keyWord = "";
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
this.handleQuery();
},
/** 新增按钮操作 */