mo vor 2 Jahren
Ursprung
Commit
b01494f492

+ 73 - 70
src/components/Pagination/index.vue

@@ -1,151 +1,154 @@
 <template>
-  <div :class="{'hidden':hidden}"
-       class="pagination-container">
+  <div :class="{ hidden: hidden }" class="pagination-container">
     <!-- :background="background" -->
-    <el-pagination :current-page.sync="currentPage"
-    size="mini"
-                   :page-size.sync="pageSize"
-                   :layout="layout"
-                   :page-sizes="pageSizes"
-                   :total="total"
-                   v-bind="$attrs"
-                   @size-change="handleSizeChange"
-                   @current-change="handleCurrentChange" />
+    <el-pagination
+      :current-page.sync="currentPage"
+      size="mini"
+      :page-size.sync="pageSize"
+      :layout="layout"
+      :page-sizes="pageSizes"
+      :total="total"
+      v-bind="$attrs"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+    />
   </div>
 </template>
 
 <script>
-import { scrollTo } from '@/utils/scroll-to'
-import { Searchs } from '@/helpers'
+import { scrollTo } from "@/utils/scroll-to";
+import { Searchs } from "@/helpers";
 export default {
-  name: 'Pagination',
+  name: "Pagination",
   props: {
     total: {
       required: true,
-      type: Number
+      type: Number,
     },
     page: {
       type: Number,
-      default: 1
+      default: 1,
     },
     limit: {
       type: Number,
-      default: 10
+      default: 10,
     },
     pageSizes: {
       type: Array,
-      default () {
-        return [10, 20, 30, 50]
-      }
+      default() {
+        return [10, 20, 30, 50];
+      },
     },
     layout: {
       type: String,
-      default: 'total,sizes,prev, pager, next, jumper'
+      default: "total,sizes,prev, pager, next, jumper",
     },
     background: {
       type: Boolean,
-      default: true
+      default: true,
     },
     autoScroll: {
       type: Boolean,
-      default: true
+      default: true,
     },
     hidden: {
       type: Boolean,
-      default: false
+      default: false,
     },
     sync: {
       type: Boolean,
-      default: false
+      default: false,
     },
     saveKey: {
       type: String,
-      default: ''
-    }
+      default: "",
+    },
   },
   data() {
     return {
-      pageInformation: null
-    }
+      pageInformation: null,
+    };
   },
   computed: {
     currentPage: {
-      get () {
-        return this.page
+      get() {
+        return this.page;
+      },
+      set(val) {
+        this.$emit("update:page", val);
       },
-      set (val) {
-        this.$emit('update:page', val)
-      }
     },
     pageSize: {
-      get () {
-        return this.limit
+      get() {
+        return this.limit;
       },
-      set (val) {
-        this.$emit('update:limit', val)
-      }
-    }
+      set(val) {
+        this.$emit("update:limit", val);
+      },
+    },
   },
   watch: {
     currentPage() {
-      this.syncStore()
+      this.syncStore();
     },
     pageSize() {
-      this.syncStore()
-    }
+      this.syncStore();
+    },
   },
   mounted() {
     if (this.sync) {
-      const searchs = new Searchs(this.saveKey || this.$route.path)
-      const active = searchs.get()
-      this.pageInformation = active
+      const searchs = new Searchs(this.saveKey || this.$route.path);
+      const active = searchs.get();
+      this.pageInformation = active;
       if (active && active.page) {
         for (const key in active.page) {
           if (active.page.hasOwnProperty(key)) {
-            const item = active.page[key]
-            this.$emit('update:' + key, item)
+            const item = active.page[key];
+            this.$emit("update:" + key, item);
           }
         }
       }
 
       if (this.saveKey) {
-        searchs.update(this.$route.path, undefined, 'bind')
+        searchs.update(this.$route.path, undefined, "bind");
       }
     }
-    window.addEventListener('watchStorage', this.watchStorage)
+    window.addEventListener("watchStorage", this.watchStorage);
   },
   methods: {
     watchStorage() {
-      let page = this.pageInformation && this.pageInformation.page ? this.pageInformation.page : null
-      this.currentPage = page && page.page ? page.page : 1
-
+      let page =
+        this.pageInformation && this.pageInformation.page
+          ? this.pageInformation.page
+          : null;
+      this.currentPage = page && page.page ? page.page : 1;
     },
     syncStore() {
       if (this.sync) {
-        const searchs = new Searchs(this.saveKey || this.$route.path)
-        searchs.update(this._props, undefined, 'page')
+        const searchs = new Searchs(this.saveKey || this.$route.path);
+        searchs.update(this._props, undefined, "page");
       }
     },
-    handleSizeChange (val) {
-      this.currentPage = 1
-      this.$emit('pagination', { page: this.currentPage, limit: val })
+    handleSizeChange(val) {
+      this.currentPage = 1;
+      this.$emit("pagination", { page: this.currentPage, limit: val });
       if (this.autoScroll) {
-        scrollTo(0, 800)
+        scrollTo(0, 800);
       }
-      this.syncStore()
+      this.syncStore();
     },
-    handleCurrentChange (val) {
-      this.$emit('pagination', { page: val, limit: this.pageSize })
+    handleCurrentChange(val) {
+      this.$emit("pagination", { page: val, limit: this.pageSize });
       if (this.autoScroll) {
-        scrollTo(0, 800)
+        scrollTo(0, 800);
       }
-      this.syncStore()
-    }
+      this.syncStore();
+    },
   },
   destroyed() {
-    window.removeEventListener('watchStorage', this.watchStorage)
-  }
-}
+    window.removeEventListener("watchStorage", this.watchStorage);
+  },
+};
 </script>
 
 <style scoped lang="scss">
@@ -161,7 +164,7 @@ export default {
   display: none;
 }
 /deep/.el-select {
-    width: 100px!important;
-    margin: 0 5px;
+  width: 100px !important;
+  margin: 0 5px;
 }
 </style>

+ 25 - 6
src/views/smallStudentManager/components/tableList.vue

@@ -128,6 +128,22 @@
         ></el-date-picker>
       </el-form-item>
       <el-form-item>
+        <el-date-picker
+          key="visiList1"
+          v-model.trim="searchForm.lastTimer"
+          style="width: 420px"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          range-separator="至"
+          start-placeholder="最后回访开始日期"
+          end-placeholder="最后回访结束日期"
+          :picker-options="{
+            firstDayOfWeek: 1,
+          }"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
         <el-button native-type="submit" type="danger">搜索</el-button>
         <el-button native-type="reset" type="primary">重置</el-button>
         <el-button
@@ -403,7 +419,7 @@
         @getList="getList"
       />
     </el-dialog>
-    <div v-show='isSearchs'></div>
+    <div v-show="isSearchs"></div>
   </div>
 </template>
 
@@ -436,6 +452,7 @@ export default {
         musicDirectorId: "",
         courseConsumerError: "",
         timer: [],
+        lastTimer: [],
       },
       tableList: [],
       feedbackTypeList,
@@ -448,7 +465,7 @@ export default {
       },
       visitVisiable: false,
       activeRow: null,
-      flag:false
+      flag: false,
     };
   },
   async mounted() {
@@ -463,16 +480,18 @@ export default {
     },
     onReSet() {
       this.searchForm.timer = [];
+      this.searchForm.lastTimer = [];
       this.$refs.searchForm.resetFields();
       this.onSearch();
     },
     async getList() {
-      const { timer, ...rest } = this.searchForm;
+      const { timer, lastTimer, ...rest } = this.searchForm;
       try {
         let obj = {
           groupType: this.groupType,
           ...rest,
           ...getTimes(timer, ["firstCourseStartTime", "firstCourseEndTime"]),
+          ...getTimes(lastTimer, ["lastVisitStartTime", "lastVisitEndTime"]),
           rows: this.pageInfo.limit,
           page: this.pageInfo.page,
           organId: this.organIds,
@@ -544,10 +563,10 @@ export default {
     isSearchs: {
       get() {
         let flag = this.isSearch();
-        if(this.flag != flag){
-           this.onSearch()
+        if (this.flag != flag) {
+          this.onSearch();
         }
-       this.flag = flag
+        this.flag = flag;
 
         return flag;
       },

+ 4 - 27
src/views/smallStudentManager/components/visiList.vue

@@ -65,22 +65,7 @@
         >
         </el-date-picker>
       </el-form-item>
-      <el-form-item>
-        <el-date-picker
-          key="visiList1"
-          v-model.trim="searchForm.lastTimer"
-          style="width: 420px"
-          type="daterange"
-          value-format="yyyy-MM-dd"
-          range-separator="至"
-          start-placeholder="最后回访开始日期"
-          end-placeholder="最后回访结束日期"
-          :picker-options="{
-            firstDayOfWeek: 1,
-          }"
-        >
-        </el-date-picker>
-      </el-form-item>
+
       <el-form-item>
         <el-button type="danger" @click="search">搜索</el-button>
         <el-button type="primary" @click="onReSet">重置</el-button>
@@ -118,15 +103,7 @@
             </div>
           </template>
         </el-table-column>
-                <el-table-column align="center" prop="lastCourseTime" label="最后回访时间">
-          <template slot-scope="scope">
-            <div>
-              {{
-                scope.row.lastCourseTime ? scope.row.lastCourseTime.split(" ")[0] : "--"
-              }}
-            </div>
-          </template>
-        </el-table-column>
+
         <el-table-column align="center" prop="overview" label="学员情况">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.overview"></overflow-text>
@@ -250,14 +227,14 @@ export default {
     },
     getList() {
       // cleanDeep
-      let { timer,lastTimer, ...rest } = this.searchForm;
+      let { timer, ...rest } = this.searchForm;
       let params = {
         studentId: this.studentId,
         ...rest,
         page: this.rules.page,
         rows: this.rules.limit,
         ...getTimes(timer, ["startTime", "endTime"]),
-        ...getTimes(lastTimer, ["lastVisitStartTime", "lastVisitEndTime"]),
+
         purpose: this.useVisitType[1] ? this.useVisitType[1] : null,
         type: this.useVisitType[0] ? this.useVisitType[0] : null,
       };