Browse Source

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-director

lrf402788946 5 years ago
parent
commit
a0a0af3985

+ 0 - 6
src/router/index.js

@@ -83,12 +83,6 @@ const routes = [
         meta: { title: '班级', sub: '考勤' },
         meta: { title: '班级', sub: '考勤' },
         component: () => import('@/views/classes/attendance.vue'),
         component: () => import('@/views/classes/attendance.vue'),
       },
       },
-      {
-        path: '/classes/leave',
-        name: 'classes_leave',
-        meta: { title: '班级', sub: '请假' },
-        component: () => import('@/views/classes/leave.vue'),
-      },
       {
       {
         path: '/student/detail',
         path: '/student/detail',
         name: 'student_detail',
         name: 'student_detail',

+ 2 - 0
src/store/index.js

@@ -20,6 +20,7 @@ import bedroom from '@frame/store/bedroom';
 import login from '@frame/store/login';
 import login from '@frame/store/login';
 import util from '@frame/store/util';
 import util from '@frame/store/util';
 import attendance from '@frame/store/attendance';
 import attendance from '@frame/store/attendance';
+import leave from '@frame/store/leave';
 import * as ustate from '@frame/store/user/state';
 import * as ustate from '@frame/store/user/state';
 import * as umutations from '@frame/store/user/mutations';
 import * as umutations from '@frame/store/user/mutations';
 Vue.use(Vuex);
 Vue.use(Vuex);
@@ -46,6 +47,7 @@ export default new Vuex.Store({
     util,
     util,
     attendance,
     attendance,
     bedroom,
     bedroom,
+    leave,
   },
   },
   state: { ...ustate },
   state: { ...ustate },
   mutations: { ...umutations },
   mutations: { ...umutations },

+ 12 - 2
src/views/classes/attendance.vue

@@ -1,18 +1,22 @@
 <template>
 <template>
   <div id="attendance">
   <div id="attendance">
-    <attendanceInfo :classId="classId"></attendanceInfo>
+    <listFrame :title="pageTitle" @query="search" :total="total" :needFilter="false" :returns="toreturn" :needAdd="false">
+      <attendanceInfo :classId="classId" @initTotal="initTotal"></attendanceInfo>
+    </listFrame>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import attendanceInfo from '@frame/parts/attendance';
 import attendanceInfo from '@frame/parts/attendance';
+import listFrame from '@frame/layout/admin/list-frame';
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
 export default {
   name: 'attendance',
   name: 'attendance',
   props: {},
   props: {},
-  components: { attendanceInfo },
+  components: { attendanceInfo, listFrame },
   data: () => ({
   data: () => ({
     classId: {},
     classId: {},
+    total: 0,
   }),
   }),
   created() {
   created() {
     this.initId();
     this.initId();
@@ -26,6 +30,12 @@ export default {
     async initId() {
     async initId() {
       this.classId = this.id;
       this.classId = this.id;
     },
     },
+    toreturn() {
+      window.history.go(-1);
+    },
+    initTotal(total) {
+      this.$set(this, `total`, total);
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 10 - 1
src/views/classes/classes.vue

@@ -27,6 +27,7 @@
           @lesson="toLesson"
           @lesson="toLesson"
           @bedRoom="toBedRoom"
           @bedRoom="toBedRoom"
           @qingjia="toQj"
           @qingjia="toQj"
+          @attendance="toAtt"
         ></data-table>
         ></data-table>
       </el-card>
       </el-card>
     </list-frame>
     </list-frame>
@@ -75,9 +76,14 @@ export default {
       },
       },
       {
       {
         label: '请假管理',
         label: '请假管理',
-        icon: 'iconfont iconqingjia',
+        icon: 'el-icon-timer',
         method: 'qingjia',
         method: 'qingjia',
       },
       },
+      {
+        label: '考勤管理',
+        icon: 'el-icon-map-location',
+        method: 'attendance',
+      },
     ],
     ],
     fields: [
     fields: [
       { label: '班级名称', prop: 'name' },
       { label: '班级名称', prop: 'name' },
@@ -137,6 +143,9 @@ export default {
     toQj({ data }) {
     toQj({ data }) {
       this.$router.push({ path: '/classes/qingjia', query: { id: data.id } });
       this.$router.push({ path: '/classes/qingjia', query: { id: data.id } });
     },
     },
+    toAtt({ data }) {
+      this.$router.push({ path: '/classes/attendance', query: { id: data.id } });
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 0 - 19
src/views/classes/leave.vue

@@ -1,19 +0,0 @@
-<template>
-  <div id="leave">
-    <p>leave</p>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'leave',
-  props: {},
-  components: {},
-  data: () => ({}),
-  created() {},
-  computed: {},
-  methods: {},
-};
-</script>
-
-<style lang="less" scoped></style>

+ 25 - 4
src/views/classes/qingjia.vue

@@ -1,29 +1,50 @@
 <template>
 <template>
   <div id="qingjia">
   <div id="qingjia">
-    <list-frame :title="pageTitle" @query="search" :total="total" :needFilter="false" :returns="toreturn" :needAdd="false"> </list-frame>
+    <listFrame :title="pageTitle" @query="search" :total="total" :needFilter="false" :returns="toreturn" :needAdd="false">
+      <leaveInfo :classId="classId" @initTotal="initTotal"></leaveInfo>
+    </listFrame>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import _ from 'lodash';
 import _ from 'lodash';
+import listFrame from '@frame/layout/admin/list-frame';
+import leaveInfo from '@frame/parts/leave';
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: mapLeave } = createNamespacedHelpers('leave');
 const { mapActions: mapLeave } = createNamespacedHelpers('leave');
 export default {
 export default {
   name: 'qingjia',
   name: 'qingjia',
   props: {},
   props: {},
-  components: {},
+  components: { leaveInfo, listFrame },
   data: function() {
   data: function() {
-    return {};
+    return {
+      classId: {},
+      total: 0,
+    };
+  },
+  created() {
+    this.initId();
   },
   },
-  created() {},
   methods: {
   methods: {
+    async initId() {
+      this.classId = this.id;
+    },
     async search({ skip = 0, limit = 10, ...info } = {}) {},
     async search({ skip = 0, limit = 10, ...info } = {}) {},
+    toreturn() {
+      window.history.go(-1);
+    },
+    initTotal(total) {
+      this.$set(this, `total`, total);
+    },
   },
   },
   computed: {
   computed: {
     ...mapState(['user']),
     ...mapState(['user']),
     pageTitle() {
     pageTitle() {
       return `${this.$route.meta.title}`;
       return `${this.$route.meta.title}`;
     },
     },
+    id() {
+      return this.$route.query.id;
+    },
   },
   },
   metaInfo() {
   metaInfo() {
     return { title: this.$route.meta.title };
     return { title: this.$route.meta.title };