wuhongyu пре 4 година
родитељ
комит
32fc4ba25c

+ 2 - 9
src/layout/user/clickBtn.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24">
         <el-col :span="24" class="native" v-if="this.user.type === '1'">
-          <van-cell is-link @click="$router.push({ path: '/user/teaLeave' })">请假管理</van-cell>
+          <van-cell is-link @click="$router.push({ path: '/user/teaLeave' })">请假&退出管理</van-cell>
         </el-col>
         <el-col :span="24" class="native" v-if="this.user.type === '4'">
           <van-cell is-link @click="$router.push({ path: '/user/leave' })">请假</van-cell>
@@ -14,19 +14,12 @@
         <el-col :span="24" class="native" v-if="this.user.type === '4'">
           <van-cell is-link @click="$router.push({ path: '/user/homework' })">作业管理</van-cell>
         </el-col>
-
-        <el-col :span="24" class="native">
+        <el-col :span="24" class="native" v-if="this.user.type === '1'">
           <van-cell is-link @click="$router.push({ path: '/user/pingfenclass' })">评分</van-cell>
         </el-col>
         <el-col :span="24" class="native" v-if="this.user.type === '4'">
           <van-cell is-link @click="$router.push({ path: '/user/quit' })">退出</van-cell>
         </el-col>
-        <el-col :span="24" class="native" v-if="this.user.type === '1'">
-          <van-cell is-link @click="$router.push({ path: '/user/teaquit' })">退出</van-cell>
-        </el-col>
-        <el-col :span="24" class="native" v-if="this.user.type === '1'">
-          <van-cell is-link @click="$router.push({ path: '/user/teacher' })">查看任课教师</van-cell>
-        </el-col>
         <!-- <el-col :span="24" class="native" v-if="this.user.type === '3'">
           <van-cell is-link @click="$router.push({ path: '/user/terstudent' })">查看任课教师</van-cell>
         </el-col> -->

+ 211 - 0
src/layout/user/headteaInfo.vue

@@ -0,0 +1,211 @@
+<template>
+  <div id="studentInfo">
+    <el-row>
+      <el-col :span="24" class="messageInfo">
+        <span v-if="this.user.type === '3'">
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">姓名</p>
+              <p class="name">{{ jianshiinfo.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">{{ jianshiinfo.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">{{ jianshiinfo.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">{{ jianshiinfo.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">{{ jianshiinfo.schname }}</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">{{ jianshiinfo.email }}</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">{{ jianshiinfo.zlscore }}</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">{{ jianshiinfo.msscore }}</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">{{ jianshiinfo.xsscore }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </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>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+export default {
+  name: 'studentInfo',
+  props: {
+    messInfo: null,
+    teainfo: null,
+    jianshiinfo: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {
+    ...mapState(['user']),
+  },
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.messageInfo {
+  margin: 0 0 10px 0;
+}
+.images {
+  text-align: center;
+  padding: 15px 0;
+}
+.mess {
+  min-height: 50px;
+  border-bottom: 1px solid #efeff4;
+}
+.info {
+  padding: 0 15px;
+}
+.info .title {
+  font-size: 14px;
+  color: #92a1b1;
+  padding: 4px 0;
+}
+.info .name {
+  font-size: 16px;
+  color: #000;
+}
+.icon {
+  padding: 11px 0;
+  font-size: 20px;
+  color: #ccc;
+}
+</style>

+ 0 - 1
src/main.js

@@ -12,7 +12,6 @@ import '@/plugins/loading';
 import '@/plugins/setting';
 import InitStomp from '@/plugins/stomp';
 import moment from 'moment';
-moment.lang('zh-cn');
 Vue.prototype.$moment = moment;
 Vue.config.productionTip = false;
 

+ 14 - 0
src/router/index.js

@@ -54,6 +54,19 @@ const routes = [
     meta: { title: '班级信息', isleftarrow: true },
     component: () => import('../views/class/classStuList.vue'),
   },
+  // 个人中心-请假&退出管理
+  {
+    path: '/user/teaLeave',
+    name: 'user_teaLeave',
+    meta: { title: '请假&退出管理', isleftarrow: true },
+    component: () => import('../views/user/teaLeave.vue'),
+  },
+  {
+    path: '/user/personalDetail',
+    name: 'user_personalDetail',
+    meta: { title: '个人信息', isleftarrow: true },
+    component: () => import('../views/user/personalDetail.vue'),
+  },
 ];
 
 const router = new VueRouter({
@@ -62,6 +75,7 @@ const router = new VueRouter({
 
 router.beforeEach((to, form, next) => {
   store.commit('setUser');
+  store.commit('setClass');
   let user = store.state.user;
   if (user) {
     console.log('已登录');

+ 36 - 4
src/store/index.js

@@ -5,17 +5,36 @@ import trainplan from '@frame/store/trainplan';
 import classes from '@frame/store/classes';
 import director from '@frame/store/director';
 import lesson from '@frame/store/lesson';
+import dirPlan from '@frame/store/dir-plan';
+import location from '@frame/store/location';
 import teacher from '@frame/store/teacher';
+import dept from '@frame/store/dept';
+import subject from '@frame/store/subject';
+import teaPlan from '@frame/store/tea-plan';
 import student from '@frame/store/student';
+import completion from '@frame/store/question-completion';
+import nation from '@frame/store/nation';
+import school from '@frame/store/school';
+import termquest from '@frame/store/termquest';
+import questionnaire from '@frame/store/questionnaire';
+import bedroom from '@frame/store/bedroom';
+import util from '@frame/store/util';
+import attendance from '@frame/store/attendance';
+import leave from '@frame/store/leave';
 
-import dept from '@frame/store/dept';
 import * as ustate from '@frame/store/user/state';
 import * as umutations from '@frame/store/user/mutations';
 Vue.use(Vuex);
 
 export default new Vuex.Store({
-  state: { ...ustate },
-  mutations: { ...umutations },
+  state: { ...ustate, classid: undefined },
+  mutations: {
+    ...umutations,
+    setClass(state) {
+      let classid = sessionStorage.getItem('classid');
+      if (classid) state.classid = classid;
+    },
+  },
   actions: {},
   modules: {
     trainplan,
@@ -23,8 +42,21 @@ export default new Vuex.Store({
     classes,
     director,
     lesson,
+    dirPlan,
+    location,
     teacher,
-    student,
     dept,
+    subject,
+    teaPlan,
+    student,
+    completion,
+    nation,
+    school,
+    termquest,
+    questionnaire,
+    bedroom,
+    util,
+    attendance,
+    leave,
   },
 });

+ 1 - 0
src/views/index.vue

@@ -15,6 +15,7 @@
           <span v-else>
             <el-col :span="24" class="list" v-for="(item, index) in classList" :key="index" @click.native="classBtn(item.id)">
               <p>班级时间:{{ item.startdate }}~{{ item.enddate }}</p>
+              <p>第{{ item.term }}期-第{{ item.batch }}批</p>
               <p>
                 班级名称:{{ item.name }}<span style="margin-left:20px;">班级人数:{{ item.number }}</span>
               </p>

+ 106 - 0
src/views/question/dir/dir-quest.vue

@@ -0,0 +1,106 @@
+<template>
+  <div id="dir-quest">
+    <template v-if="view == 'list'">
+      <el-card style="margin:10px" v-for="(i, index) in questList" :key="index" @click.native="toDetail(i, 'detail')">
+        <p>{{ i.name }}</p>
+        <p>类型:{{ i.type == 0 ? '常用问卷' : '非常用问卷' }}</p>
+      </el-card>
+    </template>
+    <template v-else>
+      <el-row>
+        <el-col :span="3" style="margin:5px 10px">
+          <el-button type="text" size="mini" icon="el-icon-arrow-left" @click="view = 'list'">返回班级列表</el-button>
+        </el-col>
+      </el-row>
+      <van-panel title="进度" :status="`${student.answertotal || 0}/${student.alltotal || 0}`">
+        <van-cell-group>
+          <van-cell v-for="(i, index) in student.list" :key="index" :title="i.name" :value="i.completion" />
+        </van-cell-group>
+      </van-panel>
+    </template>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: completion } = createNamespacedHelpers('completion');
+const { mapActions: classes } = createNamespacedHelpers('classes');
+const { mapActions: termquest } = createNamespacedHelpers('termquest');
+const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
+const { mapActions: util } = createNamespacedHelpers('util');
+export default {
+  name: 'dir-quest',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      view: 'list', //detail
+      questList: [],
+      classInfo: {},
+      student: {
+        list: [],
+      },
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...completion({ getCompletion: 'query' }),
+    ...classes({ getClass: 'fetch' }),
+    ...termquest({ getTermQuestList: 'query' }),
+    ...questionnaire({ getQuestionnaireList: 'query', allFetch: 'mergeRequest' }),
+    ...util({ modelFetch: 'fetch' }),
+    async search() {
+      //查询班级信息,获得期,批次
+      let res = await this.getClass(this.classid);
+      if (!this.$checkRes(res)) {
+        this.$notify({ type: 'danger', message: '没有查询到班级' });
+        return;
+      } else this.$set(this, `classInfo`, res.data);
+      let ql = [];
+      //查询所有问卷
+      const quest = await this.getQuestionnaireList({ type: 0 });
+      if (this.$checkRes(quest)) {
+        ql = ql.concat(quest.data);
+      }
+      //查询这期的所有问卷,id=>数据
+      let rql = await this.modelFetch({ model: 'termquest', termid: res.data.termid });
+      if (this.$checkRes(rql)) {
+        let ids = _.get(rql.data, `questionnaireid`);
+        if (ids) {
+          let questList = await this.allFetch({ method: 'fetch', data: ids });
+          ql = ql.concat(questList.filter(f => f.status == 1));
+        }
+      }
+      this.$set(this, `questList`, ql);
+    },
+    async toDetail(data, type) {
+      this.view = type;
+      let { id: questionnaireid } = data;
+      let { id: batch } = this.classInfo;
+      let res = await this.getCompletion({ type: '2', typeid: batch, questionnaireid });
+      if (this.$checkRes(res)) {
+        let { data: completion, answertotal, alltotal, completiontotal } = res;
+        completion = completion.map(i => {
+          i.completion.includes('NaN') ? (i.completion = '-') : '';
+          return i;
+        });
+        this.$set(this, `student`, { list: completion, answertotal, alltotal, completiontotal });
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'classid']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 6 - 1
src/views/question/index.vue

@@ -6,7 +6,7 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          調查問卷
+          <dir-quest v-if="user.type == 1"></dir-quest>
         </el-col>
         <el-col :span="24" class="foot">
           <footInfo></footInfo>
@@ -17,15 +17,20 @@
 </template>
 
 <script>
+import dirQuest from './dir/dir-quest.vue';
 import NavBar from '@/layout/common/topInfo.vue';
 import footInfo from '@/layout/common/footInfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
   name: 'index',
   props: {},
   components: {
     NavBar,
     footInfo,
+    dirQuest,
   },
   data: function() {
     return {

+ 94 - 0
src/views/user/personalDetail.vue

@@ -0,0 +1,94 @@
+<template>
+  <div id="personalDetail">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+
+        <el-col :span="24" class="main">
+          <headteaInfo :messInfo="messInfo" :teainfo="teainfo" :jianshiinfo="jianshiinfo"></headteaInfo>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import headteaInfo from '@/layout/user/headteaInfo.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapDirectors } = createNamespacedHelpers('director');
+const { mapActions: mapStudent } = createNamespacedHelpers('student');
+const { mapActions: mapteacher } = createNamespacedHelpers('teacher');
+const { mapActions: mapDept } = createNamespacedHelpers('dept');
+export default {
+  name: 'personalDetail',
+  props: {},
+  components: {
+    NavBar, //头部导航
+    headteaInfo, //学生详细信息
+  },
+  data: () => ({
+    messInfo: {},
+    teainfo: {},
+    stulist: {},
+    title: '',
+    isleftarrow: '',
+    navShow: true,
+    jianshiinfo: {},
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    ...mapState(['user']),
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {
+    $route(to, from) {
+      this.title = to.meta.title;
+      this.isleftarrow = to.meta.isleftarrow;
+    },
+  },
+  methods: {
+    ...mapDirectors({ directorQuery: 'query', directorFetch: 'fetch' }),
+    ...mapDept({ deptFetch: 'fetch' }),
+    ...mapteacher({ teacherFether: 'fetch' }),
+    // 1:班主任,4:学生
+    async searchInfo() {
+      if (this.user.type === '1') {
+        const res = await this.directorFetch(this.id);
+        const arr = await this.deptFetch(res.data.department);
+        res.data.department = arr.data.name;
+        this.$set(this, `teainfo`, res.data);
+      } else if (this.user.type === '3') {
+        const res = await this.teacherFether(this.id);
+        this.$set(this, `jianshiinfo`, res.data);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+</style>

+ 102 - 0
src/views/user/teaLeave.vue

@@ -0,0 +1,102 @@
+<template>
+  <div id="teaLeave">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="list" v-for="(item, index) in leaveList" :key="index">
+            <el-col :span="14" class="time">
+              <p>开始时间:{{ item.starttime }}</p>
+              <p>结束时间:{{ item.endtime }}</p>
+            </el-col>
+            <el-col :span="10" class="status">
+              <p>结果:{{ item.status === '0' ? '审核中' : item.status === '1' ? '通过' : item.status === '2' ? '未通过' : '' }}</p></el-col
+            >
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapLeave } = createNamespacedHelpers('leave');
+export default {
+  name: 'teaLeave',
+  props: {},
+  components: {
+    NavBar, //头部导航
+  },
+  data: function() {
+    return {
+      title: '',
+      isleftarrow: '',
+      navShow: true,
+      // 班级请假退出列表
+      leaveList: [],
+    };
+  },
+  created() {
+    this.searchInfo();
+  },
+  methods: {
+    ...mapLeave(['query']),
+    async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, classid: this.classid, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `leaveList`, res.data);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user', 'classid']),
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {
+    $route(to, from) {
+      this.title = to.meta.title;
+      this.isleftarrow = to.meta.isleftarrow;
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+p {
+  padding: 0;
+  margin: 0;
+}
+.list {
+  width: 97%;
+  padding: 15px;
+  background-color: #fff;
+  border-radius: 15px;
+  margin: 0 5px 5px 5px;
+}
+.list .time p {
+  padding: 5px 0;
+}
+.list .status {
+  padding: 20px 0;
+}
+</style>