Browse Source

更新学校上传学生列表

wuhongyuq 5 years ago
parent
commit
af7d57a56e
2 changed files with 108 additions and 0 deletions
  1. 6 0
      src/router/index.js
  2. 102 0
      src/views/scganli/index.vue

+ 6 - 0
src/router/index.js

@@ -27,6 +27,12 @@ const routes = [
         meta: { title: '教师', sub: '管理' },
         meta: { title: '教师', sub: '管理' },
         component: () => import('@/views/teacher/index.vue'),
         component: () => import('@/views/teacher/index.vue'),
       },
       },
+      {
+        path: '/scganli/index',
+        name: 'teacher_list',
+        meta: { title: '上传学生', sub: '管理' },
+        component: () => import('@/views/scganli/index.vue'),
+      },
       {
       {
         path: '/teacher/detail',
         path: '/teacher/detail',
         name: 'teacher_detail',
         name: 'teacher_detail',

+ 102 - 0
src/views/scganli/index.vue

@@ -0,0 +1,102 @@
+<template>
+  <div id="index">
+    <list-frame :title="mainTitle" @query="search" :total="total" :needFilter="false" :needAdd="false">
+      <data-table :fields="fields" :data="list" :opera="opera" @edit="toEdit" @update="toUpdate"></data-table>
+    </list-frame>
+  </div>
+</template>
+
+<script>
+import listFrame from '@frame/layout/admin/list-frame';
+import dataTable from '@frame/components/data-table';
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('trainplan');
+const { mapActions: schPlan } = createNamespacedHelpers('schPlan');
+
+export default {
+  metaInfo: { title: '上班学生管理' },
+  name: 'index',
+  props: {},
+  components: { listFrame, dataTable },
+  data: () => ({
+    info: {},
+    opera: [
+      {
+        label: '添加',
+        icon: 'el-icon-date',
+        method: 'edit',
+      },
+      // {
+      //   label: '上报时间',
+      //   icon: 'el-icon-document',
+      //   method: 'update',
+      // },
+    ],
+    fields: [{ label: '批次', prop: 'newTermnum' }],
+    list: [{ term: {} }],
+    total: 0,
+  }),
+  created() {
+    this.search();
+  },
+  computed: {
+    mainTitle() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      let sub = meta.sub || '';
+      let title = main + sub;
+      return title;
+    },
+    keyWord() {
+      let meta = this.$route.meta;
+      let main = meta.title || '';
+      return main;
+    },
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    ...schPlan({
+      schQuery: 'query',
+      schPlanCreate: 'create',
+      schPlanUpdate: 'update',
+    }),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.schQuery({ planid: this.info.id, schid: '99991', skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        // console.log(res.data[0]);
+        if (res.data.length > 0) {
+          for (let val of res.data) {
+            console.log(val.term);
+            for (let lets of val.term) {
+              console.log(lets);
+              val.newTermnum = lets.termnum;
+            }
+          }
+          console.log(res.data);
+
+          this.$set(this, `list`, res.data);
+          // console.log(res.data);
+
+          this.$set(this, `total`, res.total);
+
+          this.$set(this, `list`, res.data);
+        }
+        console.log(res.data.length);
+        console.log(res.data);
+      }
+    },
+    toEdit({ data }) {
+      //TODO 该把详情做成什么样的比较好,是和大日历在一起选择还是其他形式
+      this.$router.push({ path: '/plan/detail', query: { id: data.id } });
+    },
+
+    async toUpdate({ data }) {
+      // const res = await this.delete(data.id);
+      // this.$checkRes(res, '删除成功', '删除失败');
+      // this.search();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>