浏览代码

Merge branch '01/21VipReset' into online

mo 4 年之前
父节点
当前提交
0bad7815ad
共有 2 个文件被更改,包括 17 次插入8 次删除
  1. 1 0
      src/views/main/constant.js
  2. 16 8
      src/views/main/teamSchedule/index.vue

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

@@ -165,6 +165,7 @@ export const errorType = {
     query: {
       tabrouter: 'teamSchedule',
       searchType: 'STUDENT_VISIT',
+      ...dates
     },
   },
 }

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

@@ -31,7 +31,7 @@
         <el-date-picker
           v-model="searchForm.month"
           value-format="yyyy-MM"
-          type="month"
+          type="monthrange"
           placeholder="请选择月"
         >
         </el-date-picker>
@@ -156,6 +156,7 @@ import { getInspectionItem, resetInspectionItem } from "../api";
 import { permission } from "@/utils/directivePage";
 import pagination from "@/components/Pagination/index";
 import dayjs from "dayjs";
+import { getTimes } from "@/utils";
 export default {
   components: { pagination },
   data() {
@@ -163,7 +164,7 @@ export default {
       searchForm: {
         userId: "",
         organId: "",
-        month: "",
+        month: [],
         searchType:''
       },
       handleForm: {
@@ -186,6 +187,9 @@ export default {
     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();
   },
@@ -202,13 +206,17 @@ export default {
       this.getList();
     },
     async getList() {
+             let { month, ...rest } = this.searchForm;
+      let params = {
+        ...rest,
+        page: this.rules.page,
+        rows: this.rules.limit,
+        ...getTimes(month, ["startTime", "endTime"],"YYYY-MM"),
+        searchType: this.$route.query.searchType,
+      };
       try {
-        const res = await getInspectionItem({
-          ...this.searchForm,
-          page: this.rules.page,
-          rows: this.rules.limit,
-          searchType: this.$route.query.searchType,
-        });
+        const res = await getInspectionItem(params
+      );
         this.tableList = res.data.rows;
         this.rules.total = res.data.total;
       } catch (e) {