diff --git a/src/views/material/repair/scrapManage/component/homeApply.vue b/src/views/material/repair/scrapManage/component/homeApply.vue index 6936cd34..d03b1bfa 100644 --- a/src/views/material/repair/scrapManage/component/homeApply.vue +++ b/src/views/material/repair/scrapManage/component/homeApply.vue @@ -140,6 +140,11 @@ export default { }; }, created() { + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.queryParams.startTime = this.format(start) + this.queryParams.endTime = this.format(end) // 设置默认状态为第一个选项(进行中) if (this.statusList.length > 0) { this.queryParams.taskStatus = this.statusList[0].value @@ -147,6 +152,12 @@ export default { 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}` + }, // 多选框选中数据 handleSelectionChange(selection) { this.passTemp = []; @@ -193,6 +204,11 @@ export default { /** 重置按钮操作 */ resetQuery() { this.queryParams.time = []; + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.queryParams.startTime = this.format(start) + this.queryParams.endTime = this.format(end) this.resetForm("queryForm"); this.queryParams.keyWord = ""; this.handleQuery();