mo 2 år sedan
förälder
incheckning
197af2804e

+ 11 - 9
src/views/indexErrDataRecord/components/visitError.vue

@@ -109,7 +109,7 @@
       <el-table-column align="center" label="异常产生时间">
         <template slot-scope="scope">
           <div>
-            {{ scope.row.generateTime | dayjsFormat}}
+            {{ scope.row.generateTime | dayjsFormat }}
           </div>
         </template>
       </el-table-column>
@@ -148,7 +148,7 @@
     <pagination
       sync
       :total.sync="rules.total"
-       :saveKey="`indexErrDataRecord-${searchType}`"
+      :saveKey="`indexErrDataRecord-${searchType}`"
       :page.sync="rules.page"
       :limit.sync="rules.limit"
       :page-sizes="rules.page_size"
@@ -202,13 +202,6 @@ export default {
     };
   },
   mounted() {
-    const { query } = this.$route;
-    if (query.organId) {
-      this.searchForm.organId = query.organId;
-    }
-    if (query.start && query.end) {
-      this.searchForm.month = [query.start, query.end];
-    }
     this.$store.dispatch("setBranchs");
     this.getList();
   },
@@ -225,6 +218,15 @@ export default {
       this.getList();
     },
     async getList() {
+      const { query } = this.$route;
+      if (query.organId) {
+        this.searchForm.organId = query.organId;
+      }
+      console.log(query.start, query.end)
+      if (query.start && query.end) {
+        this.$set(this.searchForm,'month',[query.start, query.end])
+      }
+
       let { month, ...rest } = this.searchForm;
       let params = {
         ...rest,

+ 3 - 1
src/views/main/constant.js

@@ -86,7 +86,7 @@ export const titles = {
 
 
 const dates = {
-  start: dayjs().subtract(2, 'month').set('date', 1).format('YYYY-MM-DD'),
+  start: dayjs().subtract(1, 'month').set('date', 1).format('YYYY-MM-DD'),
   end: dayjs().format('YYYY-MM-DD'),
 }
 
@@ -342,6 +342,8 @@ export const errorType = {
     query: {
       tabrouter: 'teamSchedule',
       searchType: 'INSPECTION_ITEM',
+      start:dayjs().subtract(1, 'month').set('date', 1).format('YYYY-MM'),
+      end:dayjs().format('YYYY-MM')
     },
   },
   INSPECTION_ITEM_PLAN: {

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

@@ -6,7 +6,7 @@
       <filter-search
         v-if="$route.query.tabrouter === 'teamSchedule'&&permission('/teamSchedule/abnormal')"
         :keys="['searchType']"
-        :moreKeys="['organId']"
+        :moreKeys="['organId','start','end']"
         @reload="reloadItem"
       />
     </h2>

+ 8 - 7
src/views/main/teamSchedule/index.vue

@@ -186,13 +186,7 @@ export default {
     };
   },
  async mounted() {
-    const { query } = this.$route;
-    if (query.organId) {
-      this.searchForm.organId = query.organId;
-    }
-    if (query.start && query.end) {
-      this.searchForm.month = [query.start, query.end];
-    }
+
   await  this.$store.dispatch("setBranchs");
   this.$set(this.searchForm,'organId',this.selects.branchs[0].id)
     this.getList();
@@ -210,6 +204,13 @@ export default {
       this.getList();
     },
     async getList() {
+      const { query } = this.$route;
+    if (query.organId) {
+      this.searchForm.organId = query.organId;
+    }
+    if (query.start && query.end) {
+      this.searchForm.month = [query.start, query.end];
+    }
       let { month, ...rest } = this.searchForm;
       let params = {
         ...rest,