lrf402788946 4 年之前
父节点
当前提交
26d259716a
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      src/views/train-plan/bedroom.vue

+ 15 - 0
src/views/train-plan/bedroom.vue

@@ -18,6 +18,10 @@
           <el-link :underline="false" type="success" style="font-size:18px">女:{{ getGender('女') }}人</el-link>
         </el-col>
       </el-row>
+      <el-row :gutter="10" style="padding:10px">
+        <el-col :span="4">本班学生来源:</el-col>
+        <el-col :span="4" v-for="(sch, index) in schList" :key="index">{{ sch }}</el-col>
+      </el-row>
       <el-row>
         <el-col :span="2">
           <el-button type="primary" size="mini" @click="toSelect">批量分配选择寝室</el-button>
@@ -102,6 +106,7 @@ export default {
       options: undefined,
       ostuList: [],
       assignList: [],
+      schList: [],
     };
   },
   created() {},
@@ -128,6 +133,16 @@ export default {
     async getSL() {
       let res = await this.getStuList();
       if (this.$checkRes(res)) {
+        // 获取班级里的学生的学校列表
+        let schGroup = _.groupBy(res.data, 'schid');
+        const schkeys = Object.keys(schGroup);
+        let schList = [];
+        for (const key of schkeys) {
+          const sg = schGroup[key];
+          const h = _.head(sg);
+          if (h) schList.push(_.get(h, 'school_name'));
+        }
+        this.$set(this, `schList`, schList);
         let group = _.groupBy(res.data, 'bedroomid');
         let keys = Object.keys(group);
         // 组织数据