Browse Source

1030 20:42

111
mo 5 years ago
parent
commit
a0d573f60b

+ 9 - 0
src/api/buildTeam.js

@@ -497,4 +497,13 @@ export function getTeamDetailList (data) {
     method: 'get',
     params: data
   })
+}
+
+// 提高班详情   data: qs.stringify(data),
+export function highClassGroups (data) {
+  return request({
+    url: `/web-server/classGroup/highClassGroups`,
+    method: 'get',
+    params: data
+  })
 }

+ 8 - 0
src/api/studentManager.js

@@ -139,3 +139,11 @@ export function getClassAllStudent (data) {
   })
 }
 
+// 添加学生 addStudents
+export function addStudents (data) {
+  return request({
+    url: `/web-server/classGroupStudent/addStudents`,
+    method: 'POST',
+    data: qs.stringify(data)
+  })
+}

+ 3 - 1
src/router/index.js

@@ -154,7 +154,9 @@ export const asyncRoutes = {
   // 班级调整
   resetClass: () => import('@/views/teamDetail/components/resetClass'),
   // 发放清单
-  teamDetailedList: () => import('@/views/teamDetail/teamDetailedList')
+  teamDetailedList: () => import('@/views/teamDetail/teamDetailedList'),
+  // 小班课设置
+  setImprovement: () => import('@/views/teamBuild/teamSeting/components/setImprovement')
 
 
 }

+ 5 - 4
src/views/teamBuild/teamSeting/components/improvementClass.vue

@@ -47,7 +47,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="studentNum"
+        <el-table-column prop="courseTimes"
                          label="班级人数">
         </el-table-column>
         <el-table-column prop="date"
@@ -222,7 +222,7 @@ export default {
     findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
       if (res.code == 200) {
         this.teacherList = res.data
-        console.log(res.data);
+        // console.log(res.data);
       }
     })
     // 获取乐团老师
@@ -301,8 +301,9 @@ export default {
     fitterTeacher (val) {
       if (that.teacherList) {
         for (let i in that.teacherList) {
-          if (that.teacherList[i].id == val) {
-            return that.teacherList[i].username
+          if (that.teacherList[i].userId == val) {
+
+            return that.teacherList[i].name
           }
         }
       } else {

+ 1 - 1
src/views/teamBuild/teamSeting/components/salarySet.vue

@@ -216,7 +216,7 @@ export default {
 
           for (let j in this.defaultTableList[i].classGroupTeacherMapperList) {
             if (this.defaultTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList.length <= 0 || this.defaultTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList) {
-              this.$message.error('还有老师课酬未确认')
+              this.$message.error('还有老师课酬未设置')
               this.isok = false;
               return
             }

+ 197 - 0
src/views/teamBuild/teamSeting/components/setImprovement.vue

@@ -0,0 +1,197 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <div class='squrt'></div>提高班报名详情
+    </h2>
+    <div class='m-core'>
+      <div class="tableWrap">
+        <el-table :header-cell-style="{background:'#EDEEF0',color:'#444'}"
+                  :data='tableList'>
+          <el-table-column label="班级名称"
+                           prop="name">
+          </el-table-column>
+          <el-table-column label="声部"
+                           prop="subjectName">
+          </el-table-column>
+          <el-table-column label="预计人数"
+                           prop="expectStudentNum">
+          </el-table-column>
+          <el-table-column label="实际人数"
+                           prop="studentNum">
+          </el-table-column>
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <div>
+                <el-button type="text"
+                           @click='lookDeatil(scope.row)'>查看</el-button>
+                <el-button type="text"
+                           @click="addstudentBtn(scope.row)">添加学员</el-button>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    <el-dialog title="添加学员"
+               width="600px"
+               :visible.sync="addStudentVisible">
+      <el-table :data="studentList"
+                ref='studentList'
+                @selection-change="selectStudent"
+                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+        <el-table-column type="selection"
+                         width="55"></el-table-column>
+        <el-table-column prop='name'
+                         label="学生姓名"></el-table-column>
+        <el-table-column property="classGroupName"
+                         label="所在班级"></el-table-column>
+      </el-table>
+      <div slot="footer"
+           class="dialog-footer">
+        <el-button type="primary"
+                   @click="addStudnt">确 定</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="小班课学员详情"
+               width="600px"
+               :visible.sync="lookDeatilVisible">
+      <el-table :header-cell-style="{background:'#EDEEF0',color:'#444'}"
+                :data='classList'>
+        <el-table-column label="学员姓名"
+                         prop="name">
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div>
+              <el-popover placement="top"
+                          width="160"
+                          :ref="scope.$index">
+                <p>确定删除该学生?</p>
+                <div style="text-align: right; margin-top: 20px">
+                  <el-button size="mini"
+                             type="text"
+                             @click="scope._self.$refs[scope.$index].doClose()">取消</el-button>
+                  <el-button type="primary"
+                             size="mini"
+                             @click="removeStudent(scope)">确定</el-button>
+                </div>
+                <el-button type="text"
+                           slot="reference">删除</el-button>
+              </el-popover>
+              <el-button type="text">调整班级</el-button>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+
+    </el-dialog>
+    <el-dialog title="学员班级调整"
+               width="600px"
+               append-to-body
+               :visible.sync="resetVisible">
+      <div class="radioBox">
+        <el-radio v-model="studentRadio"
+                  label="1">备选项</el-radio>
+        <div>预计人数:</div>
+        <div>实际人数:</div>
+      </div>
+
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { highClassGroups, teamSoundStudent } from '@/api/buildTeam'
+import { getClassAllStudent, addStudents } from '@/api/studentManager'
+export default {
+  data () {
+    return {
+      tableList: [],
+      teamid: '',
+      lookDeatilVisible: false,
+      addStudentVisible: false,
+      resetVisible: false,
+      studentList: [], // 乐团所有学生
+      activeStudentList: [], // 选中的学生集合
+      activeClass: '',  // 选中的班级id
+      classList: [],
+      activeStudent: null,
+      studentRadio: '' // 学生新选择的班级
+    }
+  },
+  mounted () {
+    this.teamid = this.$route.query.id;
+    // console.log(this.teamid)
+
+    this.getList();
+    teamSoundStudent({ musicGroupId: this.teamid }).then(res => {
+      if (res.code == 200) {
+        this.studentList = res.data;
+      }
+    })
+
+  },
+  methods: {
+    getList () {
+      highClassGroups({ musicGroupId: this.teamid }).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data;
+        }
+      })
+    },
+    lookDeatil (row) {
+      this.lookDeatilVisible = true;
+      console.log(row.id);
+      getClassAllStudent({ classGroupId: row.id }).then(res => {
+        if (res.code == 200) {
+          this.classList = res.data;
+        }
+      })
+
+      return
+
+    },
+    addstudentBtn (row) {
+      this.activeClass = row.id;
+      this.addStudentVisible = true;
+    },
+    addStudnt () {
+      // 发请求添加学生
+      let classGroupId = this.activeClass;
+      let userIdsStr = this.activeStudentList.map(item => {
+        return item.id
+      }).join(',')
+      addStudents({ userIdsStr, classGroupId }).then(res => {
+        if (res.code == 200) {
+          this.$message.success('添加成功')
+          this.activeStudentList = [];
+          this.addStudentVisible = false;
+          // 取消列表的勾选
+          this.$refs.studentList.clearSelection();
+          this.getList();
+        }
+      })
+    },
+    selectStudent (val) {
+      this.activeStudentList = val;
+    },
+    // 删除学生
+    removeStudent (scope) {
+      console.log(scope.row.id);
+
+      scope._self.$refs[scope.$index].doClose();
+    }
+
+  },
+}
+</script>
+<style lang="scss">
+.radioBox {
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+  margin-bottom: 20px;
+  div {
+    margin-right: 30px;
+  }
+}
+</style>

+ 6 - 1
src/views/teamDetail/teamList.vue

@@ -132,7 +132,8 @@
             <template slot-scope="scope">
               <div>
                 <el-button type="text"
-                           v-if="scope.row.status == 'PREPARE'">小班课设置</el-button>
+                           v-if="scope.row.status == 'PREPARE'"
+                           @click="gotoImprovement(scope.row)">小班课设置</el-button>
                 <el-button type="text"
                            v-if="scope.row.status == 'PREPARE'"
                            @click="gotodetailList(scope.row)">发放清单</el-button>
@@ -345,6 +346,10 @@ export default {
     gotodetailList (row) {
       // row.id
       this.$router.push({ path: '/business/teamDetailedList', query: { id: row.id } })
+    },
+    // setImprovement 设置小班课
+    gotoImprovement (row) {
+      this.$router.push({ path: '/business/setImprovement', query: { id: row.id } })
     }
   },
   watch: {