wuhongyu 5 年之前
父節點
當前提交
321263dd2b

+ 16 - 1
src/layout/class/jiaoshistu.vue

@@ -2,9 +2,17 @@
   <div id="stuleaveList">
     <el-row>
       <el-col :span="24">
+        <el-col :span="24" class="list">
+          <el-col :span="18" class="name">
+            <p>班主任姓名:{{ teacherinfo.name }}</p>
+          </el-col>
+          <el-col :span="6" class="btn">
+            <el-link :underline="false" @click="clicktea(teacherinfo.id)">详情</el-link>
+          </el-col>
+        </el-col>
         <el-col :span="24" class="list" v-for="(item, index) in newclassList" :key="index">
           <el-col :span="18" class="name">
-            <p>{{ item.name }}</p>
+            <p>学生姓名:{{ item.name }}</p>
           </el-col>
           <el-col :span="6" class="btn">
             <el-link :underline="false" @click="clickShows(item.id)">详情</el-link>
@@ -21,6 +29,8 @@ export default {
     newclassList: null,
     leaveInfo: null,
     show: null,
+    headinfo: null,
+    teacherinfo: null,
   },
   components: {},
   data: () => ({}),
@@ -30,6 +40,11 @@ export default {
     clickShows(id) {
       this.$router.push({ path: '/class/stuDetail', query: { id } });
     },
+    clicktea(id) {
+      console.log(id);
+
+      this.$router.push({ path: '/class/stuDetail', query: { id } });
+    },
   },
 };
 </script>

+ 67 - 1
src/layout/class/studentteainfo.vue

@@ -7,7 +7,7 @@
             <div class="block"><el-avatar :size="163" :src="circleUrl"></el-avatar></div>
           </div>
         </el-col>
-        <span>
+        <span v-if="messInfo">
           <el-col :span="24" class="mess">
             <el-col :span="22" class="info">
               <p class="title">姓名</p>
@@ -135,6 +135,72 @@
             </el-col>
           </el-col>
         </span>
+
+        <span v-else>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">姓名</p>
+              <p class="name">{{ teainfo.name }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">性别</p>
+              <p class="name">{{ teainfo.gender }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">年龄</p>
+              <p class="name">{{ teainfo.age }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">出生年月</p>
+              <p class="name">{{ teainfo.birthday }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">手机号</p>
+              <p class="name">{{ teainfo.phone }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">所在部门</p>
+              <p class="name">{{ teainfo.department }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">是否可讲礼仪课</p>
+              <p class="name">{{ teainfo.islyteacher === 0 ? '否' : '是' }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
+          </el-col>
+        </span>
       </el-col>
     </el-row>
   </div>

+ 3 - 1
src/layout/class/teacherClassList.vue

@@ -8,7 +8,9 @@
             <p>班级人数:{{ item.number }}</p>
           </el-col>
           <el-col :span="6" class="btn">
-            <el-link :underline="false" @click="$router.push({ path: '/class/teaclass', query: { id: item.id } })">班级名单</el-link>
+            <el-link :underline="false" @click="$router.push({ path: '/class/teaclass', query: { id: item.id, headteacherid: item.headteacherid } })"
+              >班级名单</el-link
+            >
           </el-col>
         </el-col>
       </el-col>

+ 2 - 0
src/layout/user/studentInfo.vue

@@ -286,6 +286,8 @@
           </el-col>
         </span>
       </el-col>
+
+      
     </el-row>
   </div>
 </template>

+ 1 - 1
src/router/index.js

@@ -68,7 +68,7 @@ const routes = [
 
   {
     path: '/class/teaclass',
-    meta: { title: '班级成绩', isleftarrow: true },
+    meta: { title: '班级信息', isleftarrow: true },
     component: () => import('../views/class/teaclass.vue'),
   },
   //教师学生详情

+ 1 - 1
src/views/class/index.vue

@@ -256,7 +256,7 @@ export default {
       console.log(item);
       const res = await this.create(item);
     },
-
+    //教师查看班级列表
     async class() {
       const res = await this.classList();
       console.log(res.data);

+ 9 - 2
src/views/class/stuDetail.vue

@@ -7,7 +7,7 @@
         </el-col>
 
         <el-col :span="24" class="main">
-          <studentteainfo :messInfo="messInfo"></studentteainfo>
+          <studentteainfo :messInfo="messInfo" :teainfo="teainfo"></studentteainfo>
         </el-col>
       </el-col>
     </el-row>
@@ -63,10 +63,17 @@ export default {
     ...mapStudent({ studentQuery: 'query', studentFetch: 'fetch' }),
     ...mapDept({ deptFetch: 'fetch' }),
     ...mapteacher({ teacherFether: 'fetch' }),
-    // 1:班主任,4:学生
+
     async searchInfo() {
       const res = await this.studentFetch(this.id);
       this.$set(this, `messInfo`, res.data);
+      const val = await this.directorFetch(this.id);
+      console.log(val);
+      if (val.data != null) {
+        const arr = await this.deptFetch(val.data.department);
+        val.data.department = arr.data.name;
+        this.$set(this, `teainfo`, val.data);
+      }
     },
   },
 };

+ 19 - 3
src/views/class/teaclass.vue

@@ -6,7 +6,7 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <jiaoshistu :newclassList="newclassList"></jiaoshistu>
+          <jiaoshistu :newclassList="newclassList" :teacherinfo="teacherinfo"></jiaoshistu>
         </el-col>
       </el-col>
     </el-row>
@@ -19,6 +19,8 @@ import jiaoshistu from '@/layout/class/jiaoshistu.vue';
 import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
 const { mapActions: mapClass } = createNamespacedHelpers('classes');
 const { mapActions: mapStudent } = createNamespacedHelpers('student');
+const { mapActions: mapHeadteacher } = createNamespacedHelpers('director');
+
 export default {
   name: 'leave',
   props: {},
@@ -31,6 +33,8 @@ export default {
     isleftarrow: '',
     title: '',
     isleftarrow: '',
+    teacherinfo: {},
+
     navShow: true,
   }),
   created() {
@@ -41,6 +45,9 @@ export default {
     id() {
       return this.$route.query.id;
     },
+    headteacherid() {
+      return this.$route.query.headteacherid;
+    },
   },
   mounted() {
     this.title = this.$route.meta.title;
@@ -53,12 +60,21 @@ export default {
     },
   },
   methods: {
-    ...mapClass({ classinfo: 'query' }),
+    ...mapClass({ classinfo: 'query', classFetch: 'fetch' }),
     ...mapStudent({ stuQuery: 'query', stuFetch: 'fetch' }),
+    ...mapHeadteacher({ teaQuery: 'query', stuFetch: 'fetch' }),
+
     async searchInfo({ ...info } = {}) {
       let classid = this.id;
       const res = await this.stuQuery({ classid });
-
+      console.log(this.headteacherid);
+      let headteacherid = this.headteacherid;
+      if (headteacherid) {
+        const val = await this.teaQuery({ headteacherid });
+        for (const acc of val.data) {
+          this.$set(this, `teacherinfo`, acc);
+        }
+      }
       this.$set(this, `newclassList`, res.data);
     },
   },