瀏覽代碼

配方统计修改筛选时间为7天

duanxiaoduan 1 年之前
父節點
當前提交
9fa1b5f370
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      src/views/statisticalAnalysis/formulaStatistics/index.vue

+ 12 - 2
src/views/statisticalAnalysis/formulaStatistics/index.vue

@@ -91,11 +91,21 @@
     },
 
     created() {
-      // this.getChart1()
+      this.getTimeFn()
       this.getChart1()
     },
 
-    methods: {
+    methods: {
+      getTimeFn() {
+        const that = this
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+        that.startTime = parseTime(start, '{y}-{m}-{d}')
+        that.endTime = parseTime(end, '{y}-{m}-{d}')
+        that.inputDatetime = [start, end]
+      },
       handleBefore() {
         if (this.inputDatetime !== '' && this.inputDatetime !== null) {
           var start = new Date(this.inputDatetime[0].setDate(this.inputDatetime[0].getDate() - 1))