Quellcode durchsuchen

修改tab切换 时间重置问题

1
Xiao_Mo vor 4 Jahren
Ursprung
Commit
58f5f8b4c7

+ 12 - 10
src/views/afterSchoolManager/afterSchoolList.vue

@@ -203,16 +203,8 @@ export default {
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
-  //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-    this.$store.dispatch("setBranchs");
-    // 获取分部
-    this.init();
-  },
-  methods: {
-    init() {
-      if (this.searchForm.listTimer && this.searchForm.listTimer.length <= 0) {
+  created() {
+     if (this.searchForm.listTimer && this.searchForm.listTimer.length <= 0) {
         let now = new Date();
         let startDate = new Date(
           Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
@@ -228,6 +220,16 @@ export default {
         this.searchForm.listTimer.push(startDate);
         this.searchForm.listTimer.push(endDate);
       }
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    this.$store.dispatch("setBranchs");
+    // 获取分部
+    this.init();
+  },
+  methods: {
+    init() {
+     
       this.getList();
     },
     getList() {

+ 1 - 1
src/views/businessManager/orderManager/backMoney.vue

@@ -238,7 +238,7 @@ export default {
     //   }
     // })
     this.$store.dispatch("setBranchs");
-    if (this.searchForm.orderDate.length < 1) {
+    if (this.searchForm?.orderDate?.length < 1) {
       var now = new Date();
       var startDate = new Date(
         Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())

+ 16 - 15
src/views/businessManager/orderManager/financeManager.vue

@@ -748,21 +748,7 @@ export default {
   },
   created() {
     that = this;
-  },
-  mounted() {
-    // getEmployeeOrgan().then((res) => {
-    //   if (res.code == 200) {
-    //     this.organList = res.data;
-    //   }
-    // });
-    this.$store.dispatch("setBranchs");
-    goodsQuery({ status: 1, rows: 99999 }).then((res) => {
-      if (res.code === 200) {
-        this.shopList = res.data.rows;
-      }
-    });
-
-    if (!(this.searchForm.orderDate?.length > 0)) {
+        if (!(this.searchForm.orderDate?.length > 0)) {
       var now = new Date();
       var startDate = new Date(
         Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
@@ -778,6 +764,21 @@ export default {
       this.searchForm.orderDate.push(startDate);
       this.searchForm.orderDate.push(endDate);
     }
+  },
+  mounted() {
+    // getEmployeeOrgan().then((res) => {
+    //   if (res.code == 200) {
+    //     this.organList = res.data;
+    //   }
+    // });
+    this.$store.dispatch("setBranchs");
+    goodsQuery({ status: 1, rows: 99999 }).then((res) => {
+      if (res.code === 200) {
+        this.shopList = res.data.rows;
+      }
+    });
+
+
 
     this.getList();
   },

+ 4 - 1
src/views/main/baseinfo/index.vue

@@ -131,8 +131,11 @@ export default {
       return !Object.keys(this.dataInfo).length
     }
   },
+  created(){
+     this.reset()
+  },
   mounted () {
-    this.reset()
+   
     this.$store.dispatch('setBranchs')
   },
   methods: {

+ 5 - 5
src/views/recodeManager/recodeList.vue

@@ -352,7 +352,10 @@ export default {
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+    if(this.courseTime.length >0)
+     this.courseTime = [nowTime, nowTime]
+  },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     // getTeacher().then(res => {
@@ -374,13 +377,10 @@ export default {
     if (query.start || query.end) {
       this.courseTime = [query.start, query.end]
     } else {
-      this.courseTime = [nowTime, nowTime]
+     
     }
     this.init();
   },
-  activated() {
-    this.init();
-  },
   methods: {
     init() {
       this.getList();

+ 8 - 5
src/views/stuRecodeManager/index.vue

@@ -377,15 +377,18 @@ export default {
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
-  //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-    const { query } = this.$route
-    if (this.searchForm.dates?.length < 1) {
+  created() {
+     const { query } = this.$route
+      if (this.searchForm.dates?.length < 1) {
         const start = query.start || new Date()
         const end = query.end || new Date()
         this.searchForm.dates = [start, end]
     }
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    const { query } = this.$route
+  
     if (query.visitFlag == 1 || query.visitFlag == 0) {
       this.searchForm.visitFlag = String(query.visitFlag)
     }

+ 3 - 5
src/views/teamDetail/teamCourseList.vue

@@ -686,8 +686,8 @@ export default {
     infoMsg,
     SchoolLocation,
   },
-  activated() {
-    this.init();
+  created(){
+      this.searchForm.timer = [nowTime, nowTime]
   },
   computed: {
     workTypeOptions() {
@@ -701,9 +701,7 @@ export default {
     const { query } = this.$route
     if (query.start || query.end) {
       this.searchForm.timer = [query.start, query.end]
-    } else {
-      this.searchForm.timer = [nowTime, nowTime]
-    }
+    } 
     if (query.organId) {
       this.searchForm.organIdList = Number(query.organId)
     }

+ 10 - 10
src/views/workBenchManager/classFeesIsOk.vue

@@ -434,7 +434,16 @@ export default {
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+        if (!this.searchForm.month) {
+        var now = new Date();
+        this.searchForm.month = new Date(
+          Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
+        )
+          .toISOString()
+          .slice(0, 7);
+      }
+  },
   //生命周期 - 挂载完成(可以访问DOM元素)
   async mounted() {
     await this.$store.dispatch('setBranchs')
@@ -445,15 +454,6 @@ export default {
   },
   methods: {
     init() {
-      if (!this.searchForm.month) {
-        var now = new Date();
-        this.searchForm.month = new Date(
-          Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
-        )
-          .toISOString()
-          .slice(0, 7);
-      }
-
       this.getList();
     },
     getList() {