From 2179d65337358a1e0862f3fca2e0d925580938a6 Mon Sep 17 00:00:00 2001 From: yechenhao Date: Sat, 30 May 2020 23:23:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8A=E4=BC=A0=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/analysis/AddCustomerTable.vue | 12 ++++++++++-- src/pages/analysis/ApplyCustomerTable.vue | 16 +++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/pages/analysis/AddCustomerTable.vue b/src/pages/analysis/AddCustomerTable.vue index 2a81a04..b38f932 100644 --- a/src/pages/analysis/AddCustomerTable.vue +++ b/src/pages/analysis/AddCustomerTable.vue @@ -232,14 +232,22 @@ this.endTime = this.$moment(new Date()).add(-1, "days").format("YYYY-MM-DD HH:mm:ss"); break; case '本周': - this.viewDate = nowDate.startOf('week').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); + if (nowDate.startOf('week').format("YYYY-MM-DD") === this.$moment(new Date()).format("YYYY-MM-DD")){ + this.viewDate = nowDate.startOf('week').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); + }else{ + this.viewDate = nowDate.startOf('week').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).add(-1, "days").format("YYYY-MM-DD"); + } this.selectStartTime = this.$moment(new Date()).startOf("week").format("YYYY-MM-DD 00:00:00"); this.selectEndTime = this.$moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); this.startTime = this.selectStartTime; this.endTime = this.$moment(new Date()).endOf("week").format("YYYY-MM-DD HH:mm:ss"); break; case '本月': - this.viewDate = nowDate.startOf('month').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); + if (nowDate.startOf('month').format("YYYY-MM-DD") === this.$moment(new Date()).format("YYYY-MM-DD")){ + this.viewDate = nowDate.startOf('month').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); + }else{ + this.viewDate = nowDate.startOf('month').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).add(-1, "days").format("YYYY-MM-DD"); + } this.selectStartTime = this.$moment(new Date()).startOf("month").format("YYYY-MM-DD 00:00:00"); this.selectEndTime = this.$moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); this.startTime = this.selectStartTime; diff --git a/src/pages/analysis/ApplyCustomerTable.vue b/src/pages/analysis/ApplyCustomerTable.vue index 3c75e61..c0eaf13 100644 --- a/src/pages/analysis/ApplyCustomerTable.vue +++ b/src/pages/analysis/ApplyCustomerTable.vue @@ -35,7 +35,7 @@ 累计拓客报表 - 拓客以内门店数量 + 拓客以内门店数量 @@ -200,15 +200,21 @@ this.endTime = this.$moment(new Date()).add(-1, "days").format("YYYY-MM-DD HH:mm:ss"); break; case '本周': - this.viewDate = nowDate.startOf('week').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); - this.selectStartTime = this.$moment(new Date()).startOf("week").format("YYYY-MM-DD 00:00:00"); + if (nowDate.startOf('week').format("YYYY-MM-DD") === this.$moment(new Date()).format("YYYY-MM-DD")){ + this.viewDate = nowDate.startOf('week').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); + }else{ + this.viewDate = nowDate.startOf('week').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).add(-1, "days").format("YYYY-MM-DD"); + } this.selectStartTime = this.$moment(new Date()).startOf("week").format("YYYY-MM-DD 00:00:00"); this.selectEndTime = this.$moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); this.startTime = this.selectStartTime; this.endTime = this.$moment(new Date()).endOf("week").format("YYYY-MM-DD HH:mm:ss"); break; case '本月': - this.viewDate = nowDate.startOf('month').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); - this.selectStartTime = this.$moment(new Date()).startOf("month").format("YYYY-MM-DD 00:00:00"); + if (nowDate.startOf('month').format("YYYY-MM-DD") === this.$moment(new Date()).format("YYYY-MM-DD")){ + this.viewDate = nowDate.startOf('month').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).format("YYYY-MM-DD"); + }else{ + this.viewDate = nowDate.startOf('month').format("YYYY-MM-DD") + ' 至 ' + this.$moment(new Date()).add(-1, "days").format("YYYY-MM-DD"); + } this.selectStartTime = this.$moment(new Date()).startOf("month").format("YYYY-MM-DD 00:00:00"); this.selectEndTime = this.$moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); this.startTime = this.selectStartTime; this.endTime = this.$moment(new Date()).endOf("month").format("YYYY-MM-DD HH:mm:ss");