guhongwei 4 years ago
parent
commit
da1f2cb38b

+ 43 - 4
src/layout/class/classInfo.vue

@@ -38,6 +38,26 @@
           <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">{{ dirInfo.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">
+            <a :href="`tel:${dirInfo.phone}`">{{ dirInfo.phone }}</a>
+          </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>
@@ -87,9 +107,7 @@
         <el-col :span="22" class="info">
           <p class="title">班级类型</p>
           <p class="name">
-            <template slot-scope="scope">
-              <span style="margin-left: 10px" v-if="classinfo.type">{{ scope.row.type === '0' ? '正常班级' : scope.row.type === '1' ? '特殊班级' : '' }}</span>
-            </template>
+            <span>{{ getType(classinfo.type) }}</span>
           </p>
         </el-col>
         <el-col :span="2" class="icon">
@@ -103,24 +121,45 @@
 <script>
 import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
 const { mapActions: classes } = createNamespacedHelpers('classes');
+const { mapActions: director } = createNamespacedHelpers('director');
+const { mapActions: classtype } = createNamespacedHelpers('classtype');
+
 export default {
   name: 'classInfo',
   props: {},
   components: {},
   data: () => ({
     classinfo: {},
+    classTypeList: [],
+    dirInfo: {},
   }),
-  created() {
+  async created() {
+    await this.getOtherList();
     this.search();
   },
   computed: {
     ...mapState(['user', 'classid']),
   },
   methods: {
+    ...director({ getDir: 'fetch' }),
     ...classes(['fetch']),
+    ...classtype({ getClassType: 'query' }),
     async search() {
       const classinfo = (await this.fetch(this.classid)).data;
       this.$set(this, `classinfo`, classinfo);
+      if (_.get(classinfo, 'headteacherid')) {
+        const dirInfo = await this.getDir(_.get(classinfo, 'headteacherid'));
+        if (this.$checkRes(dirInfo)) this.$set(this, `dirInfo`, dirInfo.data);
+      }
+    },
+    async getOtherList() {
+      const res = await this.getClassType();
+      if (this.$checkRes(res)) this.$set(this, `classTypeList`, res.data);
+    },
+    getType(type) {
+      console.log(type);
+      const r = this.classTypeList.find(f => f.code == type);
+      if (r) return r.name;
     },
   },
 };

+ 1 - 1
src/layout/user/headteaInfo.vue

@@ -43,7 +43,7 @@
           <el-col :span="24" class="mess">
             <el-col :span="22" class="info">
               <p class="title">学校名称</p>
-              <p class="name">{{ jianshiinfo.schname }}</p>
+              <p class="name">{{ jianshiinfo.jobaddress }}</p>
             </el-col>
             <el-col :span="2" class="icon">
               <van-icon name="arrow" />

+ 6 - 0
src/store/index.js

@@ -3,6 +3,7 @@ import Vuex from 'vuex';
 import login from '@frame/store/login';
 import trainplan from '@frame/store/trainplan';
 import classes from '@frame/store/classes';
+import classtype from '@frame/store/classtype';
 import director from '@frame/store/director';
 import lesson from '@frame/store/lesson';
 import dirPlan from '@frame/store/dir-plan';
@@ -26,6 +27,8 @@ import uploadtask from '@frame/store/uploadtask';
 import setting from '@frame/store/setting';
 import notice from '@frame/store/notice';
 import task from '@frame/store/task';
+import groupscore from '@frame/store/groupscore';
+import personalscore from '@frame/store/personalscore';
 import * as ustate from '@frame/store/user/state';
 import * as umutations from '@frame/store/user/mutations';
 import * as dostate from '@frame/store/setting/state';
@@ -45,6 +48,8 @@ export default new Vuex.Store({
   actions: {},
   modules: {
     trainplan,
+    groupscore,
+    personalscore,
     login,
     classes,
     director,
@@ -70,5 +75,6 @@ export default new Vuex.Store({
     setting,
     notice,
     task,
+    classtype,
   },
 });

+ 58 - 0
src/views/class/info/groupscore.vue

@@ -0,0 +1,58 @@
+<template>
+  <div id="groupscore">
+    <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o" text="确认修改的分数无误后,点击保存" />
+    <van-field v-for="(group, index) in groupList" :key="index" :label="group.name" v-model="group.score"></van-field>
+    <el-row type="flex" justify="center" align="middle" style="padding:20px 0;">
+      <el-col :span="4">
+        <el-button size="mini" type="primary" @click="toSave">保存</el-button>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'groupscore',
+  props: {
+    data: { type: Array, default: () => [] },
+  },
+  components: {},
+  data: function() {
+    return {
+      groupList: [],
+    };
+  },
+  created() {},
+  methods: {
+    getScore(groupid) {
+      return 0;
+    },
+    toSave() {
+      this.$emit('save', _.cloneDeep(this.groupList));
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  watch: {
+    data: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        console.log('in function:');
+        if (val && val.length > 0) this.$set(this, `groupList`, _.cloneDeep(val));
+      },
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 6 - 10
src/views/class/info/headStuList.vue

@@ -1,12 +1,5 @@
 <template>
   <div id="headStuList">
-    <!-- <el-row type="flex" justify="center" style="padding:10px 0">
-      <el-col :span="6">
-        <el-button type="primary" plain size="mini" @click.native="$router.push({ path: '/class/achieve', query: { classid: $attrs.classid } })">
-          查看平时成绩
-        </el-button>
-      </el-col>
-    </el-row> -->
     <el-row>
       <el-col :span="24" class="info">
         <el-col v-for="item in groupStuList" :key="item.id">
@@ -49,14 +42,17 @@
         <el-form-item label="寝室号">
           {{ assignForm.bedroom }}
         </el-form-item>
-        <el-form-item label="手机号码">
+        <!-- <el-form-item label="手机号码">
           {{ assignForm.phone }}
-        </el-form-item>
-        <el-form-item label="学生职务">
+        </el-form-item> -->
+        <el-form-item label="学生职务" v-if="user.type != '3'">
           <el-select v-model="assignForm.job" placeholder="请选择学生职务">
             <el-option :disabled="disabled" v-for="(item, index) in job_list" :key="index" :label="item.name" :value="item.name"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="学生职务" v-else>
+          {{ assignForm.job }}
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer" v-if="this.user.type === '1'">
         <el-button @click="outAssignShow">取 消</el-button>

+ 1 - 0
src/views/index.vue

@@ -68,6 +68,7 @@ export default {
     ...setting({ settingFetch: 'fetch' }),
     async search() {
       const setting = await this.settingFetch();
+      console.log(setting);
       if (setting.data.planid) {
         this.toClass(setting.data.planid);
       } else {

+ 4 - 4
src/views/task/stutask.vue

@@ -35,7 +35,7 @@
             </van-col>
           </template>
           <template v-else-if="tasktype === 'pic'">
-            <van-image :src="picrul"></van-image>
+            <van-image :src="picurl"></van-image>
           </template>
           <van-field v-model="score" type="number" label="作业成绩:" placeholder="请输入学生成绩" />
           <van-button round type="info" @click="onSubmit">提交成绩</van-button>
@@ -62,7 +62,7 @@ export default {
     display: 'list',
     task: {},
     tasktype: '',
-    picrul: '',
+    picurl: '',
     score: '',
     uploadtask: {},
   }),
@@ -95,9 +95,9 @@ export default {
         }
         this.$set(this, `task`, task.data);
         console.log(task.data);
-      } else if (item.picrul) {
+      } else if (item.picurl) {
         this.tasktype = 'pic';
-        this.picrul = item.picrul;
+        this.picurl = item.picurl;
       }
       if (item.score) {
         this.score = item.score;