From b6c21f05c93271d7c093bd7e16cac3f11f8a31a8 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Fri, 5 Sep 2025 11:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99=E9=A2=86=E9=80=80?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=BB=98=E8=AE=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/totalLeaseRecord/index.vue | 14 ++++++++++++++ .../equipment/totalReturnRecord/index.vue | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/views/materialsStation/equipment/totalLeaseRecord/index.vue b/src/views/materialsStation/equipment/totalLeaseRecord/index.vue index 22332b12..589ba5e1 100644 --- a/src/views/materialsStation/equipment/totalLeaseRecord/index.vue +++ b/src/views/materialsStation/equipment/totalLeaseRecord/index.vue @@ -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() }, // 获取列表 diff --git a/src/views/materialsStation/equipment/totalReturnRecord/index.vue b/src/views/materialsStation/equipment/totalReturnRecord/index.vue index e777bb69..727837a5 100644 --- a/src/views/materialsStation/equipment/totalReturnRecord/index.vue +++ b/src/views/materialsStation/equipment/totalReturnRecord/index.vue @@ -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() }, // 获取列表