From 707fc1ad268ab5eb3d6c4decea00fb2aa6a975dc Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Thu, 5 Feb 2026 13:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repair/scrapManage/component/homeApply.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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();