mo 3 lat temu
rodzic
commit
b625370411

+ 101 - 52
src/views/smallStudentManager/auditionClass.vue

@@ -1,52 +1,101 @@
-<template>
-  <div class="auditionClass">
-    <Statistics :groupType='groupType' />
-
-    <TableList :groupType='groupType' />
-  </div>
-</template>
-
-<script>
-import Statistics from './components/index';
-import TableList from './components/tableList';
-export default {
-  name: "auditionClass",
-  components: {
-    Statistics,
-    TableList
-  },
-  data() {
-    return {
-      groupType: 'PRACTICE'
-    }
-  },
-  async mounted() {
-
-  },
-  methods: {
-    __init() {
-
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.rows {
-    > div {
-      margin-bottom: 20px;
-    }
-  }
-/deep/ .el-card__body .statistic {
-  margin-bottom: 15px;
-  padding: 0;
-}
-.statistic {
-  .statistic-content > span {
-    font-size: 22px !important;
-    &:first-child {
-      font-size: 14px !important;
-    }
-  }
-}
-</style>
+<template>
+  <div class="auditionClass">
+             <save-form
+      :inline="true"
+      class="searchForm"
+      ref="searchForm"
+      @submit="FetchList"
+      @reset="reset"
+      :model.sync="searchForm"
+    >
+      <el-form-item prop="organId">
+        <el-select
+          class="multiple"
+          filterable
+          v-model.trim="searchForm.organId"
+          multiple
+          collapse-tags
+          clearable
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </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-form-item>
+    </save-form>
+
+    <Statistics :groupType='groupType' />
+
+    <TableList :groupType='groupType' />
+  </div>
+</template>
+
+<script>
+import Statistics from './components/index';
+import TableList from './components/tableList';
+export default {
+  name: "auditionClass",
+  components: {
+    Statistics,
+    TableList
+  },
+    provide() {
+    return {
+      organId: () => this.searchForm.organId.join(","),
+      isSearch: ()=> this.isSearch,
+    };
+  },
+  data() {
+    return {
+      groupType: 'PRACTICE',
+        searchForm: {
+        organId: [],
+      },
+      isSearch: false,
+    }
+  },
+  async mounted() {
+
+  },
+  methods: {
+    __init() {
+
+    },
+        FetchList() {
+      this.isSearch = !this.isSearch;
+    },
+    reset() {
+      this.searchForm.organId = [];
+      this.FetchList();
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.rows {
+    > div {
+      margin-bottom: 20px;
+    }
+  }
+/deep/ .el-card__body .statistic {
+  margin-bottom: 15px;
+  padding: 0;
+}
+.statistic {
+  .statistic-content > span {
+    font-size: 22px !important;
+    &:first-child {
+      font-size: 14px !important;
+    }
+  }
+}
+</style>

+ 53 - 29
src/views/smallStudentManager/components/index.vue

@@ -1,15 +1,14 @@
 <template>
   <div class="statistics">
     <el-collapse v-model="activeNames" class="statisticsCollapse">
-      <el-collapse-item name="1" >
+      <el-collapse-item name="1">
         <template slot="title">
-          <div class="titleWrap">  数据总览
+          <div class="titleWrap">
+            数据总览
             <!-- <el-button type="primary">
 
             </el-button> -->
-
           </div>
-
         </template>
         <el-row class="rows" :gutter="20">
           <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
@@ -27,6 +26,7 @@
         </el-row>
       </el-collapse-item>
     </el-collapse>
+    <div v-show="false">{{ isSearchs }}</div>
   </div>
 </template>
 
@@ -39,6 +39,7 @@ import { studentSmallClassStatisticsSum } from "../api";
 export default {
   name: "Statistics",
   props: ["groupType"],
+    inject: ["organId", "isSearch"],
   components: {
     sleep,
     studyStudent,
@@ -49,15 +50,39 @@ export default {
     return {
       statistic: {},
       activeNames: "",
+      flag:null
     };
   },
   async mounted() {
-    try {
-      let res = await studentSmallClassStatisticsSum({
-        groupType: this.groupType,
-      });
-      this.statistic = res.data || {};
-    } catch {}
+    // this.getList();
+  },
+  methods: {
+    async getList() {
+      try {
+        let res = await studentSmallClassStatisticsSum({
+          groupType: this.groupType,
+          organId:this.organIds
+        });
+        this.statistic = res.data || {};
+      } catch {}
+    },
+  },
+  computed: {
+    organIds() {
+      return this.organId();
+    },
+    isSearchs: {
+      get() {
+        let flag = this.isSearch();
+        if(this.flag != flag){
+           this.getList()
+                 console.log('调用isSearchTable',flag)
+        }
+       this.flag = flag
+
+        return flag;
+      },
+    },
   },
 };
 </script>
@@ -80,26 +105,25 @@ export default {
       font-size: 14px !important;
     }
   }
-
 }
-  .statisticsCollapse {
-    margin-bottom: 20px;
-  }
-  /deep/.el-collapse-item__header {
-     background: rgb(237, 238, 240);
-    border-bottom:none!important;
-  }
+.statisticsCollapse {
+  margin-bottom: 20px;
+}
+/deep/.el-collapse-item__header {
+  background: rgb(237, 238, 240);
+  border-bottom: none !important;
+}
 
-  // /deep/.el-collapse {
-  //   border-top:none!important;
-  //   border-bottom:none!important
-  // }
+// /deep/.el-collapse {
+//   border-top:none!important;
+//   border-bottom:none!important
+// }
 
-  // /deep/.el-collapse-item__arrow {
-  //   display: none!important;
-  // }
-  .titleWrap {
-    padding-left: 20px;
-    font-weight: bold;
-  }
+// /deep/.el-collapse-item__arrow {
+//   display: none!important;
+// }
+.titleWrap {
+  padding-left: 20px;
+  font-weight: bold;
+}
 </style>

+ 35 - 23
src/views/smallStudentManager/components/sleep.vue

@@ -10,7 +10,11 @@
       <div
         class="wall"
         style="height: 68px"
-        v-if="JSON.stringify(items) == '{}'&&!data['CHARGE_STUDENT_CHANGE_RATE']&&!data['ACTIVATION_RATE']"
+        v-if="
+          JSON.stringify(items) == '{}' &&
+          !data['CHARGE_STUDENT_CHANGE_RATE'] &&
+          !data['ACTIVATION_RATE']
+        "
       >
         暂无数据
       </div>
@@ -28,12 +32,14 @@
         </statistic-item>
       </statistic>
     </el-card>
+
   </div>
 </template>
 <script>
 import countTo from "vue-count-to";
 export default {
   props: ["data"],
+
   components: {
     "count-to": countTo,
   },
@@ -47,37 +53,43 @@ export default {
       return !this.chartData.rows.length;
     },
     items() {
-      let tempArr = [{
-        text: '沉睡学员',
-        value: 0,
-        id: 'sleepStudentNum'
-      }, {
-        text: '有未排课',
-        value: 0,
-        id: 'sleepStudentHasNotSchedule'
-      }, {
-        text: '无未排课',
-        value: 0,
-        id: 'sleepStudentNoNotSchedule'
-      }]
-      tempArr.forEach(item => {
-        if(this.data[item.id]) {
-          item.value = this.data[item.id]
+      let tempArr = [
+        {
+          text: "沉睡学员",
+          value: 0,
+          id: "sleepStudentNum",
+        },
+        {
+          text: "有未排课",
+          value: 0,
+          id: "sleepStudentHasNotSchedule",
+        },
+        {
+          text: "无未排课",
+          value: 0,
+          id: "sleepStudentNoNotSchedule",
+        },
+      ];
+      tempArr.forEach((item) => {
+        if (this.data[item.id]) {
+          item.value = this.data[item.id];
         }
-      })
-      return tempArr
+      });
+      return tempArr;
     },
+
+
   },
 };
 </script>
 
 <style lang="scss" scoped>
 /deep/ .el-card__body .statistic {
-    margin-bottom: 15px;
-    padding: 0;
-  }
+  margin-bottom: 15px;
+  padding: 0;
+}
 /deep/.el-card__header {
-    padding: 0 20px!important;
+  padding: 0 20px !important;
 }
 .box {
   display: flex;

+ 21 - 1
src/views/smallStudentManager/components/studentChange.vue

@@ -32,6 +32,7 @@
         </statistic-item>
       </statistic>
     </el-card>
+     <div v-show='isSearchs'></div>
   </div>
 </template>
 <script>
@@ -41,6 +42,7 @@ import { studentSmallClassStatisticsSumForDate } from '../api';
 import { getTimes } from "@/utils";
 export default {
   props: ["groupType"],
+   inject: ["organId", "isSearch"],
   components: {
     "count-to": countTo,
     searchHeader
@@ -52,6 +54,7 @@ export default {
       mdate: [],
       endDate: '',
       data: {},
+      flag:null
     };
   },
   computed: {
@@ -83,6 +86,21 @@ export default {
       })
       return tempArr
     },
+          organIds() {
+      return this.organId();
+    },
+    isSearchs: {
+      get() {
+        let flag = this.isSearch();
+        if(this.flag != flag){
+           this.FetchDetail()
+             console.log('调用studentChange',flag)
+        }
+       this.flag = flag
+
+        return flag;
+      },
+    },
   },
   mounted() {
     this.init()
@@ -99,7 +117,7 @@ export default {
               .format("YYYY-MM-DD");
       this.mdate = [startTime, endTime];
       this.$refs.searchHeader.initStatue('month')
-      this.FetchDetail();
+      // this.FetchDetail();
     },
     getInitDate() {
       const end = this.$helpers.dayjs(new Date()).format("YYYY-MM-DD");
@@ -120,6 +138,7 @@ export default {
         const res = await studentSmallClassStatisticsSumForDate({
           groupType: this.groupType,
           ...getTimes(this.mdate, ["startDate", "endDate"]),
+          organId:this.organIds
         });
         this.data = res.data || {};
       } catch (error) {
@@ -128,6 +147,7 @@ export default {
       this.loading = false;
     },
   },
+
 };
 </script>
 

+ 27 - 15
src/views/smallStudentManager/components/tableList.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="tableList">
-    {{organIds+'1111'}}
     <save-form
       :inline="true"
       class="searchForm"
@@ -101,7 +100,7 @@
           :controls="false"
           :precision="0"
           :min="0"
-           v-model="searchForm.subCourseMinNum"
+          v-model="searchForm.subCourseMinNum"
           placeholder="请输入剩余课时最小数"
         ></el-input-number>
       </el-form-item>
@@ -404,6 +403,7 @@
         @getList="getList"
       />
     </el-dialog>
+    <div v-show='isSearchs'></div>
   </div>
 </template>
 
@@ -419,7 +419,7 @@ import qs from "qs";
 export default {
   name: "tableList",
   props: ["groupType"],
-  jnject:["organId"],
+  inject: ["organId", "isSearch"],
   components: {
     pagination,
     visiList,
@@ -428,7 +428,6 @@ export default {
     return {
       searchForm: {
         search: "",
-        organId: [],
         studentStatus: "",
         feedbackType: "",
         latelyCourseConsumer: "",
@@ -449,12 +448,12 @@ export default {
       },
       visitVisiable: false,
       activeRow: null,
+      flag:false
     };
   },
   async mounted() {
     this.$store.dispatch("setBranchs");
     this.$store.dispatch("setTeachers");
-
     await this.getList();
   },
   methods: {
@@ -465,12 +464,10 @@ export default {
     onReSet() {
       this.searchForm.timer = [];
       this.$refs.searchForm.resetFields();
-
       this.onSearch();
     },
     async getList() {
       const { timer, ...rest } = this.searchForm;
-      console.log(timer);
       try {
         let obj = {
           groupType: this.groupType,
@@ -478,14 +475,16 @@ export default {
           ...getTimes(timer, ["firstCourseStartTime", "firstCourseEndTime"]),
           rows: this.pageInfo.limit,
           page: this.pageInfo.page,
-          organId: organIds,
+          organId: this.organIds,
         };
         let res = await queryPage({
           ...obj,
         });
         this.tableList = res.data.rows || [];
         this.pageInfo.total = res.data.total;
-      } catch {}
+      } catch (e) {
+        console.log(e);
+      }
     },
     gotoStudent(search) {
       this.$router.push({
@@ -537,11 +536,24 @@ export default {
       );
     },
   },
-  computed:{
-    organIds(){
-      return this.organId
-    }
-  }
+
+  computed: {
+    organIds() {
+      return this.organId();
+    },
+    isSearchs: {
+      get() {
+        let flag = this.isSearch();
+        if(this.flag != flag){
+           this.getList()
+                 console.log('调用isSearchTable',flag)
+        }
+       this.flag = flag
+
+        return flag;
+      },
+    },
+  },
 };
 </script>
 
@@ -564,7 +576,7 @@ export default {
   }
 }
 .number-input {
-  width: 180px!important;
+  width: 180px !important;
   /deep/ .el-input__inner {
     text-align: left;
   }

+ 100 - 52
src/views/smallStudentManager/theoryClass.vue

@@ -1,52 +1,100 @@
-<template>
-  <div class="theoryClass">
-    <Statistics :groupType='groupType' />
-
-    <TableList :groupType='groupType' />
-  </div>
-</template>
-
-<script>
-import Statistics from './components/index';
-import TableList from './components/tableList';
-export default {
-  name: "theoryClass",
-  components: {
-    Statistics,
-    TableList
-  },
-  data() {
-    return {
-      groupType: 'THEORY'
-    }
-  },
-  async mounted() {
-    
-  },
-  methods: {
-    __init() {
-
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.rows {
-    > div {
-      margin-bottom: 20px;
-    }
-  }
-/deep/ .el-card__body .statistic {
-  margin-bottom: 15px;
-  padding: 0;
-}
-.statistic {
-  .statistic-content > span {
-    font-size: 22px !important;
-    &:first-child {
-      font-size: 14px !important;
-    }
-  }
-}
-</style>
+<template>
+  <div class="theoryClass">
+        <save-form
+      :inline="true"
+      class="searchForm"
+      ref="searchForm"
+      @submit="FetchList"
+      @reset="reset"
+      :model.sync="searchForm"
+    >
+      <el-form-item prop="organId">
+        <el-select
+          class="multiple"
+          filterable
+          v-model.trim="searchForm.organId"
+          multiple
+          collapse-tags
+          clearable
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </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-form-item>
+    </save-form>
+    <Statistics :groupType='groupType' />
+
+    <TableList :groupType='groupType' />
+  </div>
+</template>
+
+<script>
+import Statistics from './components/index';
+import TableList from './components/tableList';
+export default {
+  name: "theoryClass",
+  components: {
+    Statistics,
+    TableList
+  },
+  data() {
+    return {
+      groupType: 'THEORY',
+        searchForm: {
+        organId: [],
+      },
+      isSearch: false,
+    }
+  },
+    provide() {
+    return {
+      organId: () => this.searchForm.organId.join(","),
+      isSearch: ()=> this.isSearch,
+    };
+  },
+  async mounted() {
+
+  },
+  methods: {
+    __init() {
+
+    },
+        FetchList() {
+      this.isSearch = !this.isSearch;
+    },
+    reset() {
+      this.searchForm.organId = [];
+      this.FetchList();
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.rows {
+    > div {
+      margin-bottom: 20px;
+    }
+  }
+/deep/ .el-card__body .statistic {
+  margin-bottom: 15px;
+  padding: 0;
+}
+.statistic {
+  .statistic-content > span {
+    font-size: 22px !important;
+    &:first-child {
+      font-size: 14px !important;
+    }
+  }
+}
+</style>

+ 18 - 4
src/views/smallStudentManager/vipClass.vue

@@ -4,6 +4,8 @@
       :inline="true"
       class="searchForm"
       ref="searchForm"
+      @submit="FetchList"
+      @reset="reset"
       :model.sync="searchForm"
     >
       <el-form-item prop="organId">
@@ -13,7 +15,6 @@
           v-model.trim="searchForm.organId"
           multiple
           collapse-tags
-          @change="changeOrgan"
           clearable
           placeholder="请选择分部"
         >
@@ -25,6 +26,10 @@
           ></el-option>
         </el-select>
       </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-form-item>
     </save-form>
     <Statistics :groupType="groupType" />
 
@@ -42,21 +47,30 @@ export default {
     TableList,
   },
   provide() {
-    return { organId: () => this.searchForm.organId };
+    return {
+      organId: () => this.searchForm.organId.join(","),
+      isSearch: ()=> this.isSearch,
+    };
   },
+
   data() {
     return {
       groupType: "VIP",
       searchForm: {
         organId: [],
       },
+      isSearch: false,
     };
   },
   async mounted() {},
   methods: {
     __init() {},
-    changeOrgan(val){
-      console.log(this.searchForm.organId)
+    FetchList() {
+      this.isSearch = !this.isSearch;
+    },
+    reset() {
+      this.searchForm.organId = [];
+      this.FetchList();
     },
   },
 };