Ver código fonte

03/20 13:50

课外训练 改版
Xiao_Mo 5 anos atrás
pai
commit
3a12e0b791

+ 1 - 0
src/router/index.js

@@ -273,5 +273,6 @@ export const asyncRoutes = {
   // afterWorkList:()=>import('@/views/afterSchoolManager/afterWorkList'),
   // 课外管理
   afterSchoolManager:()=>import('@/views/afterSchoolManager'),
+  afterSchoolDetail:()=>import('@/views/afterSchoolManager/afterSchoolDetail')
 }
 export default router

+ 51 - 0
src/views/afterSchoolManager/afterSchoolDetail.vue

@@ -0,0 +1,51 @@
+<!--  -->
+<template>
+  <div class="m-container">
+    <h2>
+      <!-- <div class='squrt'></div> {{ pageName }} -->
+      <el-page-header @back="goBack" :content="title"></el-page-header>
+    </h2>
+    <afterWorkList />
+  </div>
+</template>
+
+<script>
+import afterWorkList from "@/views/afterSchoolManager/afterWorkList";
+export default {
+  components: { afterWorkList },
+  data() {
+    return {
+      FsearchForm: null,
+      Frules: null,
+      title:''
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    this.init();
+  },
+  activated() {
+    this.init();
+  },
+  methods: {
+    init() {
+      if (this.$route.query.searchForm) {
+        this.FsearchForm = this.$route.query.searchForm;
+      }
+      if (this.$route.query.rules) {
+        this.Frules = this.$route.query.rules;
+      }
+          this.title = this.$route.query.title
+    },
+    goBack() {
+      this.$router.push({ path: "/business/afterSchoolManager", query: { rules: this.Frules, searchForm: this.FsearchForm } });
+    }
+  }
+};
+</script>
+<style lang='scss' scoped>
+</style>

+ 15 - 3
src/views/afterSchoolManager/afterSchoolList.vue

@@ -186,6 +186,16 @@ export default {
       this.searchForm.timer = [];
       this.searchForm.timer.push(startDate);
       this.searchForm.timer.push(endDate);
+      if (this.$route.query.searchForm) {
+      this.$route.query.searchForm instanceof Object
+        ? (this.searchForm = this.$route.query.searchForm)
+        : (this.searchForm = JSON.parse(this.$route.query.searchForm));
+    }
+    if (this.$route.query.rules) {
+      this.$route.query.rules instanceof Object
+        ? (this.rules = this.$route.query.rules)
+        : (this.rules = JSON.parse(this.$route.query.rules));
+    } 
       this.getList();
     },
     getList() {
@@ -213,11 +223,13 @@ export default {
     onReSet() {},
     lookDetail(row) {
       // this.afterSchoolVisible = true;
-      // console.log(row.id);
-      // this.$router.push({path:'/business/afterWorkList',query:{extracurricularExercisesId:row.id}})
+
+      let rules = JSON.stringify(this.rules);
+      let searchForm = JSON.stringify(this.searchForm);
+      this.$router.push({path:'/business/afterSchoolDetail',query:{extracurricularExercisesId:row.id,rules,searchForm,title:row.title}})
       // this.extracurricularExercisesId
       // getExtracurricularExercisesId
-      this.$emit('getExtracurricularExercisesId',row.id)
+      // this.$emit('getExtracurricularExercisesId',row.id)
     }
   }
 };

+ 4 - 11
src/views/afterSchoolManager/afterWorkList.vue

@@ -5,7 +5,7 @@
       <div class="squrt"></div>课外作业
     </h2> -->
     <div class="m-core">
-      <el-form :inline="true" :model="searchForm">
+      <el-form :inline="true" :model="searchForm" v-if="!extracurricularExercisesId">
         <el-form-item>
           <el-input
             v-model.trim="searchForm.search"
@@ -201,8 +201,6 @@ export default {
       afterSchoolVisible: false,
       workVisible: false,
       activeSrc: "",
-      Fsearch:null,
-      Frules:null,
       extracurricularExercisesId:null
     };
   },
@@ -237,13 +235,8 @@ export default {
       //   this.searchForm.timer = [];
       //   this.searchForm.timer.push(startDate);
       //   this.searchForm.timer.push(endDate);
-    if (this.$route.query.search) {
-      this.Fsearch = this.$route.query.search;
-    }
-    if (this.$route.query.rules) {
-      this.Frules = this.$route.query.rules
-    }
-    this.extracurricularExercisesId = this.id;
+ 
+    this.extracurricularExercisesId = this.$route.query.extracurricularExercisesId;
       this.getList();
     },
     getList() {
@@ -259,7 +252,7 @@ export default {
           ? (obj.teacherId = this.searchForm.teacherId)
           : null;
       this.searchForm.search ? (obj.search = this.searchForm.search) : null;
-      this.id
+      this.extracurricularExercisesId
         ? (obj.extracurricularExercisesId = this.extracurricularExercisesId)
         : null;
       extracurricularExercisesReply(obj).then(res => {

+ 3 - 8
src/views/afterSchoolManager/index.vue

@@ -2,17 +2,17 @@
 <template>
   <div class="m-container">
     <h2>
-      <div class="squrt"></div>课外管理
+      <div class="squrt"></div>课外训练
     </h2>
     <div class="m-core">
       <el-tabs v-model.trim="activeIndex" type="card" @tab-click="handleClick">
         <el-tab-pane label="课外训练" name="1">
-          <afterSchoolList v-if="activeIndex == 1" @getExtracurricularExercisesId='getExtracurricularExercisesId'></afterSchoolList>
+          <afterSchoolList v-if="activeIndex == 1" ></afterSchoolList>
         </el-tab-pane>
         <el-tab-pane label="课外训练(学员)" name="2">
           <afterWorkList
             v-if="activeIndex == 2"
-            :id="extracurricularExercisesId"
+            
           ></afterWorkList>
         </el-tab-pane>
       </el-tabs>
@@ -44,11 +44,6 @@ export default {
         ? (this.activeIndex = this.$route.query.activeIndex)
         : this.activeIndex;
     },
-    getExtracurricularExercisesId(val){
-        console.log(val);
-        this.extracurricularExercisesId = val;
-        this.activeIndex = '2'
-    },
     handleClick(){}
   }
 };