Selaa lähdekoodia

修改经营数据

mo 4 vuotta sitten
vanhempi
commit
7545c264a9

+ 20 - 9
src/views/main/baseinfo/management.vue

@@ -6,6 +6,7 @@
         :title="'经营数据'"
         @changeValue="changeValue"
         :isShowQuert="true"
+        :endDate='endDate'
       />
     </div>
     <statistic :col="5" class="statistic" :cols="0">
@@ -29,9 +30,7 @@
             />
           </el-tooltip>
         </span>
-        <span>
-          <count-to :endVal="item.percent" :decimals="2" />元
-        </span>
+        <span> <count-to :endVal="item.percent" :decimals="2" />元 </span>
       </statistic-item>
     </statistic>
     <!-- 按月/按天 -->
@@ -103,7 +102,7 @@ export default {
         },
         yAxis: {
           //纵轴标尺固定
-          minInterval:1,
+          minInterval: 1,
           type: "value",
           scale: true,
           min: 0,
@@ -157,7 +156,6 @@ export default {
     },
     chartDataForMoth() {
       const values = Object.values(this.items);
-      console.log(values);
       const months = {};
       for (const item of values) {
         for (const row of item.indexMonthData || []) {
@@ -193,12 +191,17 @@ export default {
     return {
       active: "SHOULD_INCOME_MONEY",
       timer: "day",
-      mdate: this.search?.dates,
+      mdate:[],
       loading: false,
+      endDate:''
     };
   },
   created() {
-    console.log(this.search?.dates);
+    this.mdate = this.getInitDate()
+    this.endDate = this.$helpers
+        .dayjs(new Date())
+        .format("YYYY-MM-DD");
+    this.changeValue(this.mdate)
   },
   methods: {
     changeValue(date) {
@@ -232,14 +235,12 @@ export default {
       } catch (error) {
         console.log(error);
       }
-      console.log(data);
       this.dataInfo = data;
       this.loading = false;
       this.$emit("resetDate", data);
     },
 
     isDayOrMoth(arr) {
-      console.log(arr);
       if (!arr || arr.length < 1) {
         this.timer = "day";
       } else {
@@ -251,6 +252,16 @@ export default {
           : (this.timer = "day");
       }
     },
+    getInitDate() {
+      const end = this.$helpers
+        .dayjs(new Date())
+        .format("YYYY-MM-DD");
+      const start = this.$helpers
+        .dayjs(new Date())
+        .set("date", 1)
+        .format("YYYY-MM-DD");
+      return [start, end];
+    },
   },
 };
 </script>

+ 3 - 3
src/views/main/baseinfo/modals/searchHeader.vue

@@ -51,7 +51,7 @@ import {
   getNowDateAndMonday,
 } from "@/utils/date";
 export default {
-  props:['title','dates','isShowQuert'],
+  props:['title','dates','isShowQuert','endDate'],
   data() {
     return {
       timer: "",
@@ -77,7 +77,7 @@ export default {
           .dayjs(new Date())
           .set("date", 1)
           .format("YYYY-MM-DD");
-        endDate = this.$helpers.dayjs(new Date()).subtract(1, 'day').format("YYYY-MM-DD");
+          this.endDate?endDate=this.endDate: endDate = this.$helpers.dayjs(new Date()).subtract(1, 'day').format("YYYY-MM-DD");
         this.date = [startDate, endDate];
         this.submitDate( this.date)
       } else if (val == "year") {
@@ -86,7 +86,7 @@ export default {
           .set("month", 0)
           .set("date", 1)
           .format("YYYY-MM-DD");
-        endDate = this.$helpers.dayjs(new Date()).subtract(1, 'day').format("YYYY-MM-DD");
+        this.endDate?endDate=this.endDate: endDate = this.$helpers.dayjs(new Date()).subtract(1, 'day').format("YYYY-MM-DD");
         this.date = [startDate, endDate];
         this.submitDate( this.date)
       } else if (val == "lastYear") {

+ 0 - 3
src/views/main/baseinfo/student.vue

@@ -153,7 +153,6 @@ export default {
     },
     chartDataForMoth() {
       const values = Object.values(this.items);
-      console.log(values);
       const months = {};
       for (const item of values) {
         for (const row of item.indexMonthData || []) {
@@ -235,14 +234,12 @@ export default {
       } catch (error) {
         console.log(error);
       }
-      console.log(data);
       this.loading = false;
       this.dataInfo = data;
       this.$emit("resetDate", data);
     },
 
     isDayOrMoth(arr) {
-      console.log(arr);
       if (!arr || arr.length < 1) {
         this.timer = "day";
       } else {