wolyshaw 4 سال پیش
والد
کامیت
3ceafcbaec
3فایلهای تغییر یافته به همراه26 افزوده شده و 13 حذف شده
  1. 9 2
      src/views/main/abnormal/index.vue
  2. 11 3
      src/views/main/reminders/index.vue
  3. 6 8
      src/views/main/teamSchedule/index.vue

+ 9 - 2
src/views/main/abnormal/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="container">
-    <save-form inline :model="search" @submit="FetchList" @reset="FetchList" saveKey="/main/main/abnormal">
+    <save-form inline :model="search" @submit="FetchList" @reset="reset" saveKey="/main/main/abnormal">
       <el-form-item prop="organId">
         <el-select
           clearable
@@ -83,6 +83,9 @@ import { getIndexError } from '@/views/main/api'
 import { createNotification } from '@/helpers/notification'
 import { errorType } from '@/views/main/constant'
 import title from './title'
+const initSearch = {
+  organId: null
+}
 export default {
   components: {
     'title-item': title
@@ -90,7 +93,7 @@ export default {
   data() {
     return {
       search: {
-        organId: null
+        ...initSearch
       },
       listByType: {},
       list: [],
@@ -159,6 +162,10 @@ export default {
         this.listByType = data
       } catch (error) {}
     },
+    reset() {
+      this.search = {...initSearch}
+      this.FetchList()
+    },
     send() {
       createNotification({
         title: '测试发送通知',

+ 11 - 3
src/views/main/reminders/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="container">
-    <save-form inline :model="search" @submit="FetchList" @reset="FetchList" saveKey="/main/main/reminders">
+    <save-form inline :model="search" @submit="FetchList" @reset="reset" saveKey="/main/main/reminders">
       <el-form-item prop="organIds">
         <el-select
           clearable
@@ -42,6 +42,9 @@
 <script>
 import { getRemindMatterData } from '@/views/main/api'
 import title from '../abnormal/title'
+const initSearch = {
+  organId: null
+}
 export default {
   components: {
     'title-item': title
@@ -49,13 +52,14 @@ export default {
   data() {
     return {
       search: {
-        organId: null
+        ...initSearch
       },
       list: [],
     }
   },
   mounted() {
     this.FetchList()
+    this.$store.dispatch('setBranchs')
   },
   methods: {
     async FetchList() {
@@ -65,7 +69,11 @@ export default {
         })
         this.list = res.data
       } catch (error) {}
-    }
+    },
+    reset() {
+      this.search = {...initSearch}
+      this.FetchList()
+    },
   }
 }
 </script>

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

@@ -182,11 +182,6 @@ export default {
     };
   },
   mounted() {
-    if(this.$route.query.ids){
-      this.searchForm.ids = this.$route.query.ids
-    }else{
-       this.searchForm.ids = ''
-    }
     this.$store.dispatch("setBranchs");
     this.getList();
   },
@@ -204,9 +199,12 @@ export default {
     },
     async getList() {
       try {
-        this.searchForm.page = this.rules.page;
-        this.searchForm.rows = this.rules.limit;
-        const res = await getInspectionItem(this.searchForm);
+        const res = await getInspectionItem({
+          ...this.searchForm,
+          page: this.rules.page,
+          rows: this.rules.limit,
+          ids: this.$route.query.ids,
+        });
         this.tableList = res.data.rows;
         this.rules.total = res.data.total;
       } catch (e) {