guhongwei 4 年之前
父节点
当前提交
4bc8c1ade1
共有 1 个文件被更改,包括 17 次插入5 次删除
  1. 17 5
      src/views/train-plan/remind-detail.vue

+ 17 - 5
src/views/train-plan/remind-detail.vue

@@ -1,7 +1,14 @@
 <template>
   <div id="remind-detail">
     <detail-frame :title="pageTitle" returns="/train/plan/remind">
-      <data-table :fields="fields" :data="list" :opera="opera" :usePage="false"></data-table>
+      <el-tabs v-model="activeName" type="card">
+        <el-tab-pane label="学生" name="first">
+          <data-table :fields="fields" :data="stuList" :opera="opera" :usePage="false"></data-table>
+        </el-tab-pane>
+        <el-tab-pane label="非学生" name="second">
+          <data-table :fields="fields" :data="nostuList" :opera="opera" :usePage="false"></data-table>
+        </el-tab-pane>
+      </el-tabs>
       <!-- @msg="toSendMsg" @view="toView" -->
     </detail-frame>
   </div>
@@ -19,7 +26,10 @@ export default {
   components: { detailFrame, dataTable },
   data: function() {
     return {
-      list: [],
+      // 学生
+      stuList: [],
+      // 非学生
+      nostuList: [],
       opera: [
         {
           label: '发送确认通知',
@@ -37,6 +47,7 @@ export default {
         { label: '电话', prop: 'phone' },
         { label: '邮箱', prop: 'email' },
       ],
+      activeName: 'first',
     };
   },
   created() {
@@ -46,13 +57,14 @@ export default {
     ...notice({ getNoticeList: 'query', getClassInfo: 'classList' }),
     async search() {
       let t = await this.getNoticeList();
-      console.log(t);
       let res = await this.getClassInfo(this.id);
       if (this.$checkRes(res)) {
         let studList = _.get(res.data, `students`, []);
         let teaList = _.get(res.data, `teachers`, []);
-        let arr = [...studList, ...teaList];
-        this.$set(this, `list`, _.uniqBy(arr, '_id'));
+        this.$set(this, `stuList`, _.uniqBy(studList, '_id'));
+        this.$set(this, `nostuList`, _.uniqBy(teaList, '_id'));
+        // let arr = [...studList, ...teaList];
+        // this.$set(this, `list`, _.uniqBy(arr, '_id'));
       }
     },
   },