From 3702be5f60a182cfa482efdd52175707196bb8e7 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Fri, 15 Aug 2025 17:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolsBack/back/component/home.vue | 15 ++++++++++++++- .../materialsStation/toolsBack/back/outRecord.vue | 14 ++++++++++++++ .../toolsLease/apply/component/homeApply.vue | 15 ++++++++++++++- .../toolsLease/apply/leaseRecord.vue | 14 ++++++++++++++ .../toolsLease/outBound/component/homeApply.vue | 15 ++++++++++++++- 5 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/views/materialsStation/toolsBack/back/component/home.vue b/src/views/materialsStation/toolsBack/back/component/home.vue index de6d6d78..7a2abfba 100644 --- a/src/views/materialsStation/toolsBack/back/component/home.vue +++ b/src/views/materialsStation/toolsBack/back/component/home.vue @@ -296,10 +296,20 @@ export default { } }, created() { + 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.initSelectData() }, 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}` + }, /** 转换菜单数据结构 */ normalizer(node) { if (node.children && !node.children.length) { @@ -372,7 +382,10 @@ export default { }, /** 重置按钮操作 */ 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.resetForm("queryForm"); this.queryParams.teamId = '' this.projectId = null diff --git a/src/views/materialsStation/toolsBack/back/outRecord.vue b/src/views/materialsStation/toolsBack/back/outRecord.vue index 0e7fae31..fb85669a 100644 --- a/src/views/materialsStation/toolsBack/back/outRecord.vue +++ b/src/views/materialsStation/toolsBack/back/outRecord.vue @@ -164,9 +164,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}` + }, // 获取列表 async getList() { this.loading = true @@ -237,6 +247,10 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.queryParams.timeRange = [this.format(start), this.format(end)] this.resetForm('queryForm') this.handleQuery() }, diff --git a/src/views/materialsStation/toolsLease/apply/component/homeApply.vue b/src/views/materialsStation/toolsLease/apply/component/homeApply.vue index a4de94ec..c6f7e91c 100644 --- a/src/views/materialsStation/toolsLease/apply/component/homeApply.vue +++ b/src/views/materialsStation/toolsLease/apply/component/homeApply.vue @@ -315,9 +315,19 @@ export default { } }, created() { + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.queryParams.time = [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}` + }, getList() { this.loading = true const params = { @@ -346,7 +356,10 @@ export default { }, /** 重置按钮操作 */ 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.resetForm('queryForm') this.queryParams.keyWord = '' this.handleQuery() diff --git a/src/views/materialsStation/toolsLease/apply/leaseRecord.vue b/src/views/materialsStation/toolsLease/apply/leaseRecord.vue index b5907450..5f50857b 100644 --- a/src/views/materialsStation/toolsLease/apply/leaseRecord.vue +++ b/src/views/materialsStation/toolsLease/apply/leaseRecord.vue @@ -165,9 +165,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}` + }, // 获取列表 async getList() { this.loading = true @@ -236,6 +246,10 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.queryParams.timeRange = [this.format(start), this.format(end)] this.resetForm('queryForm') this.handleQuery() }, diff --git a/src/views/materialsStation/toolsLease/outBound/component/homeApply.vue b/src/views/materialsStation/toolsLease/outBound/component/homeApply.vue index 93955e88..b9ba18c4 100644 --- a/src/views/materialsStation/toolsLease/outBound/component/homeApply.vue +++ b/src/views/materialsStation/toolsLease/outBound/component/homeApply.vue @@ -303,9 +303,19 @@ export default { } }, created() { + const end = new Date() + let start = new Date() + start.setMonth(start.getMonth() - 1) + this.queryParams.time = [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}` + }, getList() { this.loading = true const params = { @@ -335,7 +345,10 @@ export default { }, /** 重置按钮操作 */ 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.resetForm('queryForm') this.queryParams.keyWord = '' this.handleQuery()