Browse Source

01/07 合班写一半

mo 4 years ago
parent
commit
3337b4cf63

+ 1 - 0
debug.log

@@ -13,3 +13,4 @@
 [0104/094020.609:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
 [0105/101053.212:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
 [0106/093923.589:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
+[0107/093708.765:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

+ 9 - 1
src/api/buildTeam.js

@@ -1450,4 +1450,12 @@ export function getOrganCourseDurationSettings (data) {
   })
 }
 
-
+// 获取分部所有乐团班级
+export function getClassGroupPage(data) {
+  return request2({
+    url: api + `/classGroup/queryClassGroupPage`,
+    method: 'get',
+    params:data,
+    data:{}
+  })
+}

+ 226 - 0
src/views/teamDetail/componentClass/classCompound.vue

@@ -0,0 +1,226 @@
+<template>
+  <div class="fixedBox">
+    <el-card>
+      <div class="boxWrap">
+        <p>
+          班级合并<span style="color: red"> {{ compoundList.length }} </span>
+        </p>
+        <el-popover placement="top" v-model="isLook" trigger="manual">
+          <div>
+            <p class="title">
+              班级合并列表
+              <i class="el-icon-minus minus" @click="isLook = false"></i>
+            </p>
+
+            <el-divider></el-divider>
+          </div>
+          <el-button type="text" style="float: right" @click="clearCom"
+            >清空列表</el-button
+          >
+          <div>
+            <el-radio-group v-model="radio">
+              <el-table
+                :data="dataList"
+                height="300px"
+                :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+              >
+                <el-table-column align="center" label="主班" width="110">
+                  <template slot-scope="scope">
+                    <el-radio :label="scope.row.id"></el-radio>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  align="center"
+                  width="180px"
+                  label="班级名称"
+                  prop="name"
+                ></el-table-column>
+                <el-table-column align="center" label="班级类型">
+                  <template slot-scope="scope">
+                    <div>{{ scope.row.type | coursesType }}</div>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  align="center"
+                  width="180px"
+                  prop="teacherName"
+                  label="已选学生数"
+                >
+                  <!--    -->
+                  <template slot-scope="scope">
+                    <div v-if="scope.row.studentList">
+                      {{ scope.row.studentList.length }}
+                    </div>
+                  </template>
+                </el-table-column>
+
+                <el-table-column align="center" label="操作" width="200px">
+                  <template slot-scope="scope">
+                    <el-button type="text" @click="cancleCom(scope.row)"
+                      >取消</el-button
+                    >
+                    <el-button type="text" @click="showStudentList(scope.row)"
+                      >添加学生</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-radio-group>
+          </div>
+          <el-button
+            type="primary"
+            size="mini"
+            style="float: right; margin-top: 20px"
+            @click="submitClass"
+            >确定</el-button
+          >
+          <i
+            class="el-icon-copy-document"
+            slot="reference"
+            @click="isLook = true"
+          ></i>
+        </el-popover>
+      </div>
+    </el-card>
+    <el-dialog
+      :visible.sync="studentListModalVisible"
+      title="学员列表"
+      append-to-body
+      width="800px"
+    >
+      <viewStudentList
+        :list="studentList"
+        :chioseList="activeRow.studentList"
+        v-if="studentListModalVisible"
+        :showOk="true"
+        :isChiose="true"
+        @close="closeStudentView"
+      />
+    </el-dialog>
+  </div>
+</template>
+<script>
+// import compoundClass from './compoundClass' compoundClass
+import viewStudentList from "../components/modals/view-student-list";
+import { getClassAllStudent } from "@/api/studentManager";
+export default {
+  props: ["compoundList"],
+  components: { viewStudentList },
+  data() {
+    return {
+      radio: "",
+      dataList: this.compoundList,
+      isLook: false,
+      show: false,
+      idList: "",
+      studentList: [],
+      studentListModalVisible: false,
+      activeRow: null,
+    };
+  },
+  methods: {
+    cancleCom(row) {
+      this.$emit("cancleCompound", row);
+    },
+    clearCom() {
+      this.$emit("clearCom");
+    },
+    submitClass() {
+      if (!this.radio) {
+        this.$message.error("请选择一个主班");
+        return;
+      }
+      // let arr = []
+      let idList = [];
+      let flag = false
+      this.dataList.forEach((com) => {
+        // arr.push(com.type)
+        if(!com.studentList || com.studentList.length<=0){
+          flag = true
+        }
+        idList.push(com.id);
+      });
+      if (this.dataList.length <= 1) {
+        this.$message.error("请至少选择2个班级");
+        return;
+      }
+      if(flag){
+         this.$message.error("请保证每个班至少勾选一名学员");
+        return
+      }
+      // 做判断
+      this.idList = idList.join(",");
+      this.show = true;
+      this.isLook = false;
+    },
+    getList() {},
+    closeReset() {
+      this.clearCom();
+      this.show = false;
+      this.$emit("getList");
+    },
+    showStudentList(row) {
+      // row.id
+      this.activeRow = row;
+      getClassAllStudent({ classGroupId: row.id }).then((res) => {
+        if (res.code == 200) {
+          this.studentList = res.data.map((item) => {
+            return {
+              userId: item.userId,
+              nickName: item.name,
+              gender: item.gender,
+              phone: item.parentsPhone,
+              subjectNames: item.subjectName,
+            };
+          });
+          this.studentListModalVisible = true;
+        }
+      });
+    },
+    closeStudentView(list) {
+      this.activeRow.studentList = list;
+      this.dataList.splice(1, 0);
+      this.studentListModalVisible = false;
+    },
+  },
+  watch: {
+    compoundList(val) {
+      this.dataList = val;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.title {
+  line-height: 44px;
+}
+.fixedBox {
+  position: fixed;
+  bottom: 20px;
+  right: 10px;
+  z-index: 100;
+  width: 200px;
+  background-color: #fff;
+  font-size: 14px;
+
+  .boxWrap {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    i {
+      font-size: 18px;
+      cursor: pointer;
+    }
+  }
+}
+/deep/.el-divider--horizontal {
+  margin: 0 !important;
+}
+.minus {
+  float: right;
+  line-height: 44px;
+  padding-right: 20px;
+  font-size: 20px;
+  cursor: pointer;
+}
+</style>

+ 1 - 1
src/views/teamDetail/components/modals/classList-item.vue

@@ -91,7 +91,7 @@ export default {
     return {
       studentList: [],
       studentListModalVisible: false,
-      organizationCourseUnitPriceSettingsByType: [], 
+      organizationCourseUnitPriceSettingsByType: [],
       eclass: [],
       isNoCourse: false,
       activeClassList: [],

+ 5 - 3
src/views/teamDetail/components/modals/view-student-list.vue

@@ -6,8 +6,9 @@
       style
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
       tooltip-effect="dark"
-      
+
        @selection-change="handleSelectionChange"
+       max-height='300px'
     >
      <el-table-column v-if="isChiose"
       type="selection"
@@ -45,7 +46,7 @@
       ></el-table-column>
       <el-table-column
         prop="subjectNames"
-        align="center"       
+        align="center"
         label="专业"
       ></el-table-column>
     </el-table>
@@ -87,6 +88,7 @@ export default {
 }
   .dialog-footer {
   float: right;
- 
+
 }
+
 </style>

+ 1 - 0
src/views/teamDetail/components/resetClass.vue

@@ -677,6 +677,7 @@ export default {
             d[item.courseType] = item;
           }
           this.courseTypesByType = d;
+          console.log(this.courseTypesByType)
         }
       } catch (error) {}
       // 根据乐团id获取乐团所属分部

+ 156 - 15
src/views/teamDetail/teamClassList.vue

@@ -24,6 +24,7 @@
           <el-select
             class="multiple"
             filterable
+            multiple
             style="width: 180px !important"
             v-model.trim="searchForm.organIdList"
             clearable
@@ -38,13 +39,8 @@
           </el-select>
         </el-form-item>
         <!-- musicClassTypeList -->
-         <el-form-item >
-          <el-select
-            v-model.trim="searchForm.type"
-            clearable
-            filterable
-            @change="changeMixClass"
-          >
+        <el-form-item>
+          <el-select v-model.trim="searchForm.type" clearable filterable>
             <el-option
               v-for="(item, index) in musicClassTypeList"
               :key="index"
@@ -64,11 +60,100 @@
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           :data="tableList"
         >
+          <el-table-column align="center" prop="musicGroupId" label="乐团编号">
+            <template slot-scope="scope">
+              <copy-text>{{ scope.row.musicGroupId }}</copy-text>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            prop="studentId"
-            label="分部"
+            prop="musicGroupName"
+            label="乐团名称"
           ></el-table-column>
+          <el-table-column align="center" prop="organName" label="分部名称">
+            <template slot-scope="scope">
+              <copy-text>{{ scope.row.organName }}</copy-text>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="name"
+            label="班级名称"
+          ></el-table-column>
+          <el-table-column align="center" prop="type" label="班级类型">
+            <template slot-scope="scope">
+              <div>{{ scope.row.type | classType }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="studentNum"
+            label="当前班级人数"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.studentNum }}人</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop label="主教老师">
+            <template slot-scope="scope">
+              <div v-if="scope.row.classGroupTeacherMapperList">
+                <p
+                  v-for="(item, index) in scope.row.classGroupTeacherMapperList"
+                  v-if="item.teacherRole == 'BISHOP'"
+                  :key="index"
+                >
+                  {{ item.userName }}
+                </p>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="助教老师">
+            <template slot-scope="scope">
+              <div v-if="scope.row.classGroupTeacherMapperList">
+                <p
+                  v-for="(item, index) in scope.row.classGroupTeacherMapperList"
+                  v-if="item.teacherRole == 'TEACHING'"
+                  :key="index"
+                >
+                  {{ item.userName }}
+                </p>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="已上课时">
+            <template slot-scope="scope">
+              <div>{{ scope.row.currentClassTimes }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="总课数">
+            <template slot-scope="scope">
+              <div>{{ scope.row.totalClassTimes }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="操作">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                @click="addCompound(scope.row)"
+                v-if="
+                  scope.row.type != 'MUSIC_NETWORK' &&
+                  scope.row.type != 'HIGH_ONLINE' &&
+                  !isAddCom(scope.row) &&
+                  permission('courseSchedule/courseMerge')
+                "
+                >添加合班</el-button
+              >
+              <el-button
+                type="text"
+                v-if="
+                  isAddCom(scope.row) &&
+                  permission('courseSchedule/courseMerge')
+                "
+                @click="cancleCompound(scope.row)"
+                >取消合班</el-button
+              >
+            </template>
+          </el-table-column>
         </el-table>
         <pagination
           sync
@@ -80,6 +165,10 @@
         />
       </div>
     </div>
+    <classCompound :compoundList='compoundList' v-if="permission('courseSchedule/courseMerge')"
+                 @clearCom='clearCom'
+                 @getList='getList'
+                 @cancleCompound='cancleCompound'/>
   </div>
 </template>
 
@@ -89,17 +178,21 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import { musicClassTypeList } from "@/utils/searchArray";
+import { getClassGroupPage } from "@/api/buildTeam";
+import { permission } from "@/utils/directivePage";
+import classCompound from "./componentClass/classCompound"
 export default {
-  components: { pagination },
+  components: { pagination,classCompound },
   data() {
     return {
       searchForm: {
         search: null,
-        organIdList:'',
-        type:''
+        organIdList: [],
+        type: "",
       },
       musicClassTypeList,
       tableList: [],
+      compoundList:[],
       rules: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -114,17 +207,65 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     // 获取分部
-
+    this.$store.dispatch("setBranchs");
     this.init();
   },
   methods: {
-    init() {},
-    getList() {},
+    init() {
+      this.getList();
+    },
+    async getList() {
+      try {
+        let { organIdList, result } = this.searchForm;
+
+        let obj = {
+          ...result,
+          organIdList: this.searchForm.organIdList.join(","),
+          page: this.rules.page,
+          rows: this.rules.limit,
+        };
+        const res = await getClassGroupPage(obj);
+        this.rules.total = res.data.total;
+        this.tableList = res.data.rows;
+      } catch (err) {
+        console.log(err);
+      }
+    },
     search() {
       this.rules.page = 1;
       this.getList();
     },
     onReSet() {},
+       addCompound (row) {
+      this.compoundList.push(row)
+      this.compoundList = [...new Set(this.compoundList)]
+    },
+    isAddCom (row) {
+      let flag = false
+      this.compoundList.forEach(com => {
+        if (com.id == row.id) {
+          flag = true
+        }
+      })
+      return flag
+    },
+    cancleCompound (row) {
+      let indexNum = null
+      this.compoundList.forEach((com, index) => {
+        if (com.id == row.id) {
+          indexNum = index
+        }
+      })
+      if (indexNum + '') {
+        this.compoundList.splice(indexNum, 1)
+      }
+    },
+    clearCom () {
+      this.compoundList = []
+    },
+    permission(str, parent) {
+      return permission(str, parent);
+    },
   },
 };
 </script>