Преглед изворни кода

Merge branch '01/06_classMerge' into online

mo пре 4 година
родитељ
комит
461d073fe2

+ 29 - 0
src/api/buildTeam.js

@@ -1450,4 +1450,33 @@ export function getOrganCourseDurationSettings (data) {
   })
 }
 
+// 获取分部所有乐团班级
+export function getClassGroupPage(data) {
+  return request2({
+    url: api + `/classGroup/queryClassGroupPage`,
+    method: 'get',
+    params:data,
+    data:{}
+  })
+}
+
+// 获取合班学员缴费金额
+export function getStudentPaymentCalenders(data) {
+  return request2({
+    url: api + `/classGroup/queryStudentPaymentCalenders`,
+    method: 'post',
+    params:{},
+    data:data
+  })
+}
 
+// 跨团合并班级
+
+export function spanGroupMergeClassSplitClassAffirm(data) {
+  return request2({
+    url: api + `/classGroup/spanGroupMergeClassSplitClassAffirm`,
+    method: 'post',
+    params:{},
+    data:data
+  })
+}

+ 2 - 1
src/views/resetTeaming/modals/payment-cycle.vue

@@ -7,6 +7,7 @@
     label-suffix=": "
   >
     <el-form-item
+    v-if="!hideMoney"
       label="缴费金额(元)"
       prop="paymentAmount"
       :rules="[{required: true, message: '请输入缴费金额', trigger: 'blur'}]"
@@ -72,7 +73,7 @@
 import { paymentPatternType } from '@/constant'
 import { objectToOptions } from '@/utils'
 export default {
-  props: ['form', 'className', 'isUserType', 'isDisabled', 'isCommon', 'hidePaymentPattern'],
+  props: ['form', 'className', 'isUserType', 'isDisabled', 'isCommon', 'hidePaymentPattern','hideMoney'],
   data() {
     return {
       paymentPatternTypeOptions: objectToOptions(paymentPatternType),

+ 221 - 0
src/views/teamDetail/componentClass/calenderStudentList.vue

@@ -0,0 +1,221 @@
+<template>
+  <div>
+    <paymentCycle
+      ref="cycle"
+      :form="cycle"
+      :isUserType="true"
+      :isCommon="true"
+      :isDisabled="true"
+      :hideMoney="true"
+    />
+    <otherform :form="other" ref="other" />
+    <el-table
+      :data="mergeInfoList"
+      :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      max-height="300px"
+      height="300px"
+    >
+      <el-table-column
+        prop="userId"
+        align="center"
+        width="120"
+        label="学员编号"
+      ></el-table-column>
+      <el-table-column
+        prop="username"
+        align="center"
+        width="120"
+        label="学员姓名"
+      ></el-table-column>
+      <el-table-column prop="phone" align="center" width="120" label="课程类型">
+        <template slot-scope="scope">
+          <div>
+            {{ scope.row.courseType | coursesType }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column prop="subjectNames" align="center" label="原价">
+        <template slot-scope="scope">
+          <div>
+            <el-input v-model="scope.row.courseOriginalPrice"></el-input>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="现价">
+        <template slot-scope="scope">
+          <div>
+            <el-input v-model="scope.row.courseCurrentPrice"></el-input>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+<script>
+import paymentCycle from "@/views/resetTeaming/modals/payment-cycle";
+import otherform from "@/views/resetTeaming/modals/other";
+import { getTimes } from "@/utils";
+import { spanGroupMergeClassSplitClassAffirm } from "@/api/buildTeam";
+export default {
+  props: [
+    "studentIds",
+    "masterClassGroupId",
+    "classGroupStudents",
+    "classList",
+    "mergeInfo",
+  ],
+  components: {
+    paymentCycle,
+    otherform,
+  },
+  data() {
+    return {
+      activeNames: [],
+      mergeInfoList: [],
+      cycle: {
+        paymentAmount: null,
+        paymentPattern: null,
+      },
+      other: {},
+    };
+  },
+  mounted() {
+    // console.log(this.studentIds, this.masterClassGroupId, this.classGroupStudents)
+    // for (let item in this.mergeInfo) {
+    //   this.activeNames.push(item);
+    // }
+    this.mergeInfoList = [];
+    for (let merge in this.mergeInfo) {
+      this.mergeInfoList = this.mergeInfoList.concat(this.mergeInfo[merge]);
+    }
+  },
+  methods: {
+    getCLassName(key) {
+      let str = "";
+      this.classList.forEach((classes) => {
+        if (classes.id == key) {
+          str = classes.name;
+        }
+      });
+      return str;
+    },
+    async submit() {
+      let obj = {};
+      let some = this.getData()
+      if(some){
+        obj.musicGroupPaymentCalenderDtos = [some];
+
+      }else{
+        return
+      }
+
+      obj.classGroupIds = this.classList.map((classes) => {
+        return classes.id;
+      });
+      obj.masterClassGroupId = this.masterClassGroupId;
+      obj.classGroupStudents = this.classGroupStudents;
+      obj.studentIds = this.studentIds
+      // console.log(obj);
+      try {
+        const reset = await spanGroupMergeClassSplitClassAffirm(obj);
+        this.$message.success("合并成功");
+        // 1.关闭弹窗
+        // 2.清空合并班
+        // 3.刷新列表
+        this.$emit('refresh')
+        console.log(reset);
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    getForms() {
+      const { $refs: refs } = this;
+      // [refs.base, refs.eclass, refs.cycle, ...(refs.cycles || []), refs.other, refs.payment]
+      return [refs.cycle, refs.other]
+        .filter((item) => !!item)
+        .map((item) => item.$refs.form || item);
+    },
+    getData() {
+      const forms = this.getForms();
+      const valided = [];
+      for (const form of forms) {
+        form.validate((valid) => {
+          if (valid) {
+            valided.push(form);
+          }
+        });
+      }
+      if (valided.length === forms.length) {
+        const { leixing, ...rest } = {
+          ...this.form,
+          ...this.other,
+        };
+
+        if (this.$refs.cycle) {
+          const {
+            paymentDate,
+            paymentValid,
+            paymentPattern,
+            ...other
+          } = this.cycle;
+          rest.paymentPattern = paymentPattern;
+          rest.payUserType = "STUDENT";
+          rest.paymentType = "SPAN_GROUP_CLASS_ADJUST";
+          rest.musicGroupPaymentCalenderStudentDetails = this.mergeInfoList;
+          rest.musicGroupPaymentDateRangeList = [
+            {
+              ...other,
+              ...getTimes(paymentDate, [
+                "startPaymentDate",
+                "deadlinePaymentDate",
+              ]),
+              ...getTimes(paymentValid, [
+                "paymentValidStartDate",
+                "paymentValidEndDate",
+              ]),
+            },
+          ];
+        }
+        const data = {
+          ...rest,
+        };
+        return data;
+
+        // 说明验证通过
+      } else {
+        this.$message.error("请填写必要信息");
+        return "error";
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+/deep/ .header {
+  display: flex;
+  align-items: center;
+  width: 100%;
+  justify-content: space-between;
+  // margin-bottom: 10px;
+  > span:first-child {
+    display: flex;
+    &::before {
+      content: "";
+      display: block;
+      width: 5px;
+      background-color: #14928a;
+      margin-right: 10px;
+      border-radius: 2px;
+      height: 48px;
+    }
+  }
+  .icon {
+    font-size: 18px;
+    font-weight: normal;
+    margin-right: 20px;
+  }
+  /deep/.el-collapse-item__wrap {
+    border-bottom: none !important;
+  }
+}
+</style>

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

@@ -0,0 +1,335 @@
+<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" @change="changeMasterClass">
+              <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>
+                      {{
+                        scope.row.studentList ? scope.row.studentList.length : 0
+                      }}
+                    </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)"
+                      :disabled="scope.row.id == radio"
+                      >添加学生</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
+        :classId="activeRow.id"
+        :disabledList="allStudentList"
+        :list="studentList"
+        :chioseList="activeRow.studentList"
+        v-if="studentListModalVisible"
+        :showOk="true"
+        :isChiose="true"
+        @close="closeStudentView"
+      />
+    </el-dialog>
+
+    <el-dialog
+      :visible.sync="calenderStudentVisible"
+      title="学员缴费列表"
+      append-to-body
+      width="800px"
+    >
+      <!--   studentIds:[],
+      masterClassGroupId:'',
+      classGroupStudents:[] -->
+      <calenderStudentList
+      ref='calenderStudentList'
+        v-if="calenderStudentVisible"
+        :classList="dataList"
+        :studentIds="studentIds"
+        :masterClassGroupId="masterClassGroupId"
+        :classGroupStudents="classGroupStudents"
+        :mergeInfo="mergeInfo"
+        @refresh='refresh'
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="calenderStudentVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitInfo"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+// import compoundClass from './compoundClass' compoundClass
+import viewStudentList from "./student-list";
+import calenderStudentList from "./calenderStudentList";
+import { getClassAllStudent } from "@/api/studentManager";
+import { getStudentPaymentCalenders } from "@/api/buildTeam";
+let that;
+export default {
+  props: ["compoundList"],
+  components: { viewStudentList, calenderStudentList },
+  data() {
+    return {
+      radio: "",
+      dataList: this.compoundList,
+      isLook: false,
+      show: false,
+      idList: "",
+      studentList: [],
+      studentListModalVisible: false,
+      activeRow: null,
+      calenderStudentVisible: false,
+      studentIds: [],
+      masterClassGroupId: "",
+      classGroupStudents: [],
+      mergeInfo: {},
+    };
+  },
+  created() {
+    that = this;
+  },
+  methods: {
+    cancleCom(row) {
+      this.$emit("cancleCompound", row);
+    },
+    clearCom() {
+      this.$emit("clearCom");
+
+    },
+    async submitClass() {
+      if (!this.radio) {
+        this.$message.error("请选择一个主班");
+        return;
+      }
+      // let arr = []
+      // 主班id
+      // 第一个是所有学员 this.radio
+      // 班级和学生id的键值对
+      // 第三个是主班编号 this.radio
+      let idList = []; // 所有的班级id
+      this.classGroupStudents = [];
+      let flag = false;
+      this.dataList.forEach((com) => {
+        // arr.push(com.type)
+        if (
+          (!com.studentList && com.id != this.radio) ||
+          (com.studentList?.length <= 0 && com.id != this.radio)
+        ) {
+          flag = true;
+        }
+        if (com.id != this.radio) {
+          this.classGroupStudents.push({
+            [com.id]: com.studentList.map((stu) => stu.userId).join(","),
+          });
+        }
+        idList.push(com.id);
+      });
+      if (this.dataList.length <= 1) {
+        this.$message.error("请至少选择2个班级");
+        return;
+      }
+      if (flag) {
+        this.$message.error("请保证每个班至少勾选一名学员");
+        return;
+      }
+      // 做判断
+      this.show = true;
+      this.isLook = false;
+      this.masterClassGroupId = this.radio;
+      this.studentIds = this.allStudentList.map((stu) => {
+        return stu.userId;
+      });
+
+      try {
+        const rest = await getStudentPaymentCalenders({
+          studentIds: this.studentIds,
+          masterClassGroupId: this.masterClassGroupId,
+          classGroupStudents: this.classGroupStudents,
+        });
+        this.mergeInfo = rest.data;
+        this.calenderStudentVisible = true;
+      } catch (e) {
+        console.log(e);
+      }
+
+      // 试着请求
+    },
+    getList() {
+       this.$emit("getList");
+    },
+    refresh(){
+      this.clearCom()
+      this.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;
+    },
+    changeMasterClass(val) {
+      this.dataList.forEach((classes) => {
+        if (classes.id == val) {
+          classes.studentList = null;
+          this.dataList.splice(1, 0);
+        }
+      });
+    },
+    submitInfo(){
+      this.$refs.calenderStudentList.submit()
+    }
+  },
+  watch: {
+    compoundList(val) {
+      this.dataList = val;
+    },
+  },
+  computed: {
+    allStudentList() {
+      let arr = [];
+      that.dataList.forEach((classes) => {
+        if (classes.studentList) {
+          arr = arr.concat(
+            classes.studentList.map((stu) => {
+              stu.classId = classes.id;
+              return stu;
+            })
+          );
+        }
+      });
+      return arr;
+    },
+  },
+};
+</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>

+ 106 - 0
src/views/teamDetail/componentClass/student-list.vue

@@ -0,0 +1,106 @@
+<template>
+  <div>
+    <el-table
+      :data="list"
+      ref='studentTable'
+      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"
+      :selectable="checkSelectable"
+      width="55">
+    </el-table-column>
+      <el-table-column
+        prop="userId"
+        align="center"
+        width="120"
+        label="学员编号"
+      ></el-table-column>
+      <el-table-column
+        prop="nickName"
+        align="center"
+        width="120"
+        label="学员姓名"
+      ></el-table-column>
+      <el-table-column
+        prop="name"
+        align="center"
+        width="120"
+        label="性别"
+      >
+      <template slot-scope="scope">
+        <div>
+          {{scope.row.gender| sex}}
+        </div>
+      </template>
+      </el-table-column>
+      <el-table-column
+        prop="phone"
+        align="center"
+        width="120"
+        label="联系电话"
+      ></el-table-column>
+      <el-table-column
+        prop="subjectNames"
+        align="center"
+        label="专业"
+      ></el-table-column>
+    </el-table>
+    <div slot="footer" class="dialog-footer" v-if="showOk">
+      <el-button type="primary" @click="$listeners.close(selectList)">确 定</el-button>
+    </div>
+    <div style="clear: both;" v-if="showOk"></div>
+  </div>
+</template>
+<script>
+export default {
+  props: ['list','isChiose','chioseList','showOk','disabledList','classId'],
+  data(){
+    return{
+      selectList:this.chioseList
+    }
+  },mounted(){
+    if(this.chioseList){
+          let idList = this.chioseList.map((item,index)=>{
+      return item.userId
+    })
+    this.list.forEach((item,index)=>{
+      if(idList.indexOf(item.userId)!= -1){
+        this.$refs.studentTable.toggleRowSelection(item,true);
+      }
+    })
+    }
+  },
+  methods:{
+    handleSelectionChange(val){
+      this.selectList = val
+    },
+    checkSelectable(row){
+      let flag = true
+      if(this.disabledList&&this.disabledList.length >0){
+        this.disabledList.forEach(stu=>{
+          if(stu.userId == row.userId &&stu.classId!=this.classId){
+            flag = false
+          }
+        })
+      }
+      return flag
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+/deep/.dialog-footer{
+  margin-top: 10px;
+}
+  .dialog-footer {
+  float: right;
+
+}
+
+</style>

+ 16 - 18
src/views/teamDetail/components/modals/class-pay-list.vue

@@ -5,7 +5,7 @@
     type="info" :closable='false'>
   </el-alert>
     <el-form :model='courseTimeForm' ref='courseTimeForms' :inline='true' style="margin-top:20px;">
-      <el-form-item v-for="(item,index) in courseTimeForm.timeList" :key="index" :label="item.label"  
+      <el-form-item v-for="(item,index) in courseTimeForm.timeList" :key="index" :label="item.label"
        :prop="'timeList.' + index + '.value'" :rules="[{required: true, message: '请选择课程时长', trigger: 'blur'}]" label-width="100px">
         <el-select clearable v-model="item.value" placeholder="请选择课程时长" @change="(val)=>setCourseTime(item,val)">
           <el-option v-for="(time,index) in item.list" :key='index' :value='time' :label="time"></el-option>
@@ -15,7 +15,7 @@
     <classPayListItem
       :payInfo="payInfo"
       ref="base"
-      :courseTypesByType="courseTypesByType" 
+      :courseTypesByType="courseTypesByType"
       v-for="(item, index) in form.classList"
       :key="index"
       :item="item"
@@ -37,11 +37,9 @@
       ref="classSetting"
         :musicGroupPaymentCalenderDtos="musicGroupPaymentCalenderDtos"
         :classType="5"
-        :teacherList="selects.teachers"
         :musicGroupId="teamid"
         :activeType="activeType"
         :courseTypeList="courseTypeList"
-        :cooperationList="selects.teachers"
         :studentSubmitedData="studentSubmitedData"
         :classIdList="classIdList"
         :classGroupStudents="classGroupStudents"
@@ -55,7 +53,7 @@
         <el-button @click="showLastVisable = false">上一步</el-button>
         <el-button type="primary" @click="submitResetClass">确 定</el-button>
       </div>
-          
+
     </el-dialog>
   </div>
 </template>
@@ -97,25 +95,25 @@ export default {
     // 1.查询该分部下得所有课程时长
     // 2.组成select需要得选项并且指定
 
-  
+
          this.teamid = this.$route.query.id;
         MusicStore.dispatch('getBaseInfo', {
           data: { musicGroupId: this.teamid }
         }).then(async (res) => {
           this.organId =res.data.musicGroup.organId
-        
+
           try{
            const res = await getOrganCourseDurationSettings({organId:this.organId})
            this.organCourseTime = res.data;
-             
+
            this.setTimeList(res.data)
-           
+
           }catch{}
         })
   },
   methods: {
     init(){
-       this.$store.dispatch('setTeachers')
+      //  this.$store.dispatch('setTeachers')
       this.studentList = []
       let classGroupStudents = []
       this.form.classList.forEach(classes=>{
@@ -129,7 +127,7 @@ export default {
       this.classGroupStudents = classGroupStudents
       this.teamid = this.$route.query.id
       this.activeType = this.form.classList[0].type
-      this.courseTypeList = getCourseType(this.activeType) 
+      this.courseTypeList = getCourseType(this.activeType)
       this.studentSubmitedData = {
         name:'',
         seleched:this.studentList.map(stu=> {return stu.userId})
@@ -159,7 +157,7 @@ export default {
        this.$refs.courseTimeForms.validate(_=>{
         if(_){
       const forms = this.getForms();
-      
+
       let musicGroupPaymentCalenderDtos = []
       // 判断有没有缴费项目(因为又可能没有)
       // let flag = false
@@ -176,14 +174,14 @@ export default {
       if(arr.length>0){
         return
       }
-     
+
            this.musicGroupPaymentCalenderDtos = musicGroupPaymentCalenderDtos
       this.init()
         }
       })
       // 弹出最后一页
-     
-           
+
+
     },
     submitResetClass(){
       this.$refs.classSetting.submit()
@@ -196,7 +194,7 @@ export default {
          arr =organCourseTime[course].split(',')
       }else {
         arr = [classTime[course]]
-      } 
+      }
         this.courseTimeForm.timeList.push({type:course,value:'',label:courseType[course],list:arr})
       })
     },
@@ -211,7 +209,7 @@ export default {
         }
       }
       this.payInfo = obj;
-    
+
     }
   },
 
@@ -228,4 +226,4 @@ export default {
   text-align: right;
 }
 
-</style>
+</style>

+ 8 - 8
src/views/teamDetail/components/modals/classList-group.vue

@@ -12,16 +12,16 @@
         @filterClassList="filterClassList"
       />
     </el-form>
-    <el-button
+    <!-- <el-button
       icon="el-icon-circle-plus-outline"
       plain
       type="info"
       size="small"
       style="width: 100%; margin: 20px 0"
       @click="addClass"
-      :disabled="form.classList.length >= classList.length" 
+      :disabled="form.classList.length >= classList.length"
       >添加班级</el-button
-    >
+    > -->
     <el-dialog
       :visible.sync="showSecondVisable"
       title="缴费信息设置"
@@ -159,19 +159,19 @@ export default {
        console.log(this.payInfo)
        let obj = {...this.payInfo}
       for(let k in obj){
-        
+
         if( obj[k][key]){
 
          obj[k][key].courseCurrentPrice=value
          obj[k][key].courseOriginalPrice=value
-        obj[k][key].courseTotalMinuties= parseInt(time) 
+        obj[k][key].courseTotalMinuties= parseInt(time)
         }
       }
       this.payInfo = obj
-   
-     
+
+
     }
-    
+
   },
 };
 </script>

+ 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: [],

+ 9 - 9
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -21,7 +21,7 @@
         label-width="88px"
         :rules="[{ required: true, message: '请选择主教老师' }]"
       >
-        <el-select
+        <!-- <el-select
           v-model.trim="form.coreTeacher"
           placeholder="请选择主教老师"
           clearable
@@ -34,10 +34,12 @@
             :label="item.realName"
             :value="String(item.id)"
           ></el-option>
-        </el-select>
+        </el-select> -->
+         <remote-search :commit="'setTeachers'" v-model="form.coreTeacher"  />
       </el-form-item>
       <el-form-item label="助教老师" prop="assistant">
-        <el-select
+         <remote-search :commit="'setTeachers'" v-model="form.assistant"  :multiple='true'/>
+        <!-- <el-select
           v-model.trim="form.assistant"
           placeholder="请选择助教老师"
           filterable
@@ -50,7 +52,7 @@
             :label="item.realName"
             :value="item.id"
           ></el-option>
-        </el-select>
+        </el-select> -->
       </el-form-item>
       <el-alert
         v-if="isEmpty"
@@ -131,10 +133,8 @@ const plusNum = (items = [], key) => {
 
 export default {
   props: [
-    "teacherList",
     "activeType",
     "courseTypeList",
-    "cooperationList",
     "musicGroupId",
     "detail",
     "studentSubmitedData",
@@ -214,7 +214,7 @@ export default {
       this.courseTypeListByName = courseTypeListByName;
     },
     async formatClasss() {
-     
+
       if (this.detail) {
         let coreid = "";
         const assistant = [];
@@ -242,7 +242,7 @@ export default {
       if (this.classType == 5) {
         // res = await findClassCourseMinute(this.classIdList);
         res.data = this.classCouresTimeList;
-        
+
       } else {
         try {
           res = await getMusicCourseSettingsWithStudents({
@@ -274,7 +274,7 @@ export default {
         }
         this.$set(this.form, "classs", classs);
         // this.courseTimes = courseTimes
-      
+
     },
     submit() {
       this.$refs.form.validate(async (valid) => {

+ 18 - 4
src/views/teamDetail/components/modals/view-student-list.vue

@@ -6,11 +6,13 @@
       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"
+      :selectable="checkSelectable"
       width="55">
     </el-table-column>
       <el-table-column
@@ -45,7 +47,7 @@
       ></el-table-column>
       <el-table-column
         prop="subjectNames"
-        align="center"       
+        align="center"
         label="专业"
       ></el-table-column>
     </el-table>
@@ -57,7 +59,7 @@
 </template>
 <script>
 export default {
-  props: ['list','isChiose','chioseList','showOk'],
+  props: ['list','isChiose','chioseList','showOk','disabledList'],
   data(){
     return{
       selectList:this.chioseList
@@ -77,6 +79,17 @@ export default {
   methods:{
     handleSelectionChange(val){
       this.selectList = val
+    },
+    checkSelectable(row){
+      let flag = true
+      if(this.disabledList&&this.disabledList.length >0){
+        this.disabledList.forEach(stu=>{
+          if(stu.userId == row.userId){
+            flag = false
+          }
+        })
+      }
+      return flag
     }
   }
 };
@@ -87,6 +100,7 @@ export default {
 }
   .dialog-footer {
   float: right;
- 
+
 }
+
 </style>

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

@@ -157,7 +157,7 @@
               @click="studentResetVisiable = true"
               v-if="permission('classGroup/mergeClassSplitClassAffirm')"
             >
-              学员班级调整
+              拆分班级
             </div>
           </div>
           <div class="right">
@@ -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('classGroup/spanGroupMergeClassSplitClassAffirm')
+                "
+                >添加合班</el-button
+              >
+              <el-button
+                type="text"
+                v-if="
+                  isAddCom(scope.row) &&
+                  permission('classGroup/spanGroupMergeClassSplitClassAffirm')
+                "
+                @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('classGroup/spanGroupMergeClassSplitClassAffirm')"
+                 @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>