Explorar el Código

1027

1027 18:03
mo hace 5 años
padre
commit
ce48d69bc7

+ 16 - 0
src/api/buildTeam.js

@@ -429,3 +429,19 @@ export function resetCourse (data) {
 }
 
 // 根据乐团id 和声部id获取学生列表
+export function teamSoundStudent (data) {
+  return request({
+    url: `/web-server/studentRegistration/getMusicGroupStu`,
+    method: 'get',
+    params: data
+  })
+}
+
+// 通过乐团编号获取乐团基本信息
+export function getTeamBaseInfo (data) {
+  return request({
+    url: `/web-server/musicGroup/findMusicGroupBasicInfo`,
+    method: 'POST',
+    data: qs.stringify(data)
+  })
+}

+ 4 - 1
src/router/index.js

@@ -76,6 +76,9 @@ export const asyncRoutes = {
   teamBuild: () => import('@/views/teamBuild/index'),
   // VIP管理
   vipList: () => import('@/views/vipClass/vipList'),
+  // vip详情
+  // @/views/buildVip/index   @/views/vipClass/vipDetail
+  vipDetail: () => import('@/views/vipClass/vipDetail'),
   buildVip: () => import('@/views/buildVip/index'),
   // 教师管理
   teacherList: () => import('@/views/teacherManager/teacherList'),
@@ -147,7 +150,7 @@ export const asyncRoutes = {
   //乐团详情
   teamDetails: () => import('@/views/teamDetail'),
   // 学生点名总汇
-  studentSignin: () => import('@/views/teamDetail/components/studentSignin')
+  studentSignin: () => import('@/views/teamDetail/components/studentSignin'),
 
 
 }

+ 12 - 7
src/utils/request.js

@@ -79,14 +79,19 @@ service.interceptors.response.use(
       let data = JSON.parse(JSON.stringify(res.data))
       // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
       if (data.code == 401 || data.code == 403) {
-        this.$message({
-          message: '登录超时请重新登录',
-          type: 'warning'
-        })
-        tryHideFullScreenLoading()
-        store.dispatch('user/resetToken').then(() => {
-          location.reload()
+        Message({
+          message: `登陆过期,请重新登录!`,
+          type: 'error',
+          duration: 5 * 1000
         })
+        setTimeout(() => {
+          tryHideFullScreenLoading()
+          store.dispatch('user/resetToken').then(() => {
+            location.reload()
+          })
+        }, 1000);
+
+        return;
       }
       if (data.code != 200) {
         Message({

+ 41 - 4
src/views/teamBuild/components/teamBaseInfo.vue

@@ -133,6 +133,17 @@
                        value="GRADIENT_SALARY"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="教学主任"
+                      v-if="activeTeam.length > 0"
+                      prop='head'>
+          <el-select v-model="topFrom.head"
+                     clearable>
+            <el-option v-for="(item,index) in teacherList"
+                       :key='index'
+                       :label="item.username"
+                       :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
       </el-form>
       <div class="checkList">
         <div class="head noMargin">课程组成形态:</div>
@@ -316,7 +327,7 @@
   </div>
 </template>
 <script>
-import { getSection, getType, getCooperation, getTeacher, getAddress, getPayMaster, getPayStatus } from '@/api/buildTeam'
+import { getSection, getType, getCooperation, getTeacher, getAddress, getPayMaster, getPayStatus, getTeamBaseInfo } from '@/api/buildTeam'
 import { scrollTo } from '@/utils/scroll-to'
 export default {
   data () {
@@ -388,12 +399,36 @@ export default {
       student: {
         ischeck: true,
         chiose: 'loop'
-      }
+      },
+      activeTeam: []
     }
   },
   created () {
+    //, { id: 191015094822001, name: '测试2团' }
     // 传过来的乐团信息
-    this.activeTeam = [{ id: 191014135135001, name: '测试1团' }, { id: 191015094822001, name: '测试2团' }]
+    this.activeTeam = [{ id: 191014135135001, name: '测试1团' }]
+    if (this.activeTeam && this.activeTeam.length == 1) {
+      getTeamBaseInfo({ musicGroupId: '191014135135001' }).then(res => {
+        if (res.code == 200) {
+          // 头部
+          this.topFrom.name = res.data.musicGroup.name;
+          this.topFrom.time = res.data.musicGroup.applyExpireDate;
+          this.topFrom.type = res.data.musicGroup.chargeTypeId;
+          this.topFrom.startClass = res.data.musicGroup.enrollClasses.split(',');
+          this.topFrom.section = res.data.musicGroup.organId;
+          this.topFrom.school = res.data.musicGroup.cooperationOrganId;
+          this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
+          this.topFrom.boss = res.data.musicGroup.teamTeacherId;
+          this.topFrom.address = res.data.musicGroup.schoolId;
+          this.topFrom.salary = res.data.musicGroup.settlementType;
+          this.topFrom.head = res.data.musicGroup.directorUserId;
+          // 课程组成形式
+          this.checkList = JSON.parse(res.data.musicGroup.courseForm);
+
+        }
+      })
+    }
+
   },
   mounted () {
     // 1.获取各个选项卡的数据内容
@@ -439,7 +474,9 @@ export default {
     //   }
     // })
     getPayStatus({ 'rows': 1000 }).then(res => {
-      console.log(res);
+      if (res.code == 200) {
+
+      }
     })
   },
   methods: {

+ 222 - 38
src/views/teamBuild/components/teamResetSound.vue

@@ -50,7 +50,7 @@
           <template slot-scope="scope">
             <div>
               <el-button type="text"
-                         @click="resetStudent">添加</el-button>
+                         @click="resetStudent(scope.row)">添加</el-button>
               <el-button type="text">删除</el-button>
             </div>
           </template>
@@ -84,7 +84,7 @@
                  id: this.activeSoundList[item].id, //声部id
                  visible: false, // 当前乐器提供方式的pop提示框显示隐藏 -->
               <el-checkbox :label="sound.id"
-                           @change="checkinlist({'id':sound.id,'sound':sound.name,'yuji':0,studentList:{}})"
+                           @change="checkinlist({'id':sound.id,'sound':sound.name,'yuji':0,studentList:[]})"
                            v-for="(sound,indexs) in item.subjects"
                            :key="indexs">{{sound.name }}</el-checkbox>
             </el-checkbox-group>
@@ -105,9 +105,12 @@
         <div class="left">
           <h4>当前已选学员</h4>
           <div class="chioseStudentList">
-            <div class="studentItem">
-              赵小雷
-              <el-button type="text">删除</el-button>
+            <div class="studentItem"
+                 v-for="(item,index) in activeListStudent"
+                 :key="index">
+              {{ item.name }}
+              <el-button type="text"
+                         @click="removeStudent(item)">删除</el-button>
             </div>
           </div>
         </div>
@@ -139,53 +142,78 @@
                      @click="searchStudent">搜索</el-button>
 
           <!--   列表开始  -->
-          <el-table tooltip-effect="dark"
-                    style="width: 100%; margin-top:10px;"
-                    :data='studentList'
-                    @selection-change="handleSelectionChange">
-            <el-table-column type="selection"
-                             width="55">
-            </el-table-column>
-            <el-table-column prop="name"
-                             label="姓名">
-            </el-table-column>
-            <el-table-column prop="name"
-                             label="性别">
-            </el-table-column>
-            <el-table-column prop="name"
-                             label="所在乐团">
-            </el-table-column>
-            <el-table-column prop="name"
-                             label="学员声部">
-            </el-table-column>
-          </el-table>
+          <div class="tableList">
+            <el-table tooltip-effect="dark"
+                      style="width: 100%; margin-top:10px;"
+                      :data='studentList'
+                      ref='studentList'
+                      @selection-change="SelectionStudent">
+              <el-table-column type="selection"
+                               align='center'
+                               width="55">
+              </el-table-column>
+              <el-table-column prop="name"
+                               align='center'
+                               width="80"
+                               label="姓名">
+              </el-table-column>
+              <el-table-column prop="gender"
+                               align='center'
+                               width="55"
+                               label="性别">
+              </el-table-column>
+              <el-table-column prop="musicGroupName"
+                               align='center'
+                               label="所在乐团">
+              </el-table-column>
+              <el-table-column prop="soundName"
+                               align='center'
+                               label="学员声部">
+              </el-table-column>
+            </el-table>
+          </div>
+
         </div>
       </div>
+      <div slot="footer"
+           class="dialog-footer">
+        <el-button @click="studentVisible = false">取 消</el-button>
+        <el-button type="primary"
+                   @click="studentVisible = false">确 定</el-button>
+      </div>
     </el-dialog>
-
+    <div class="btnWrap">
+      <div class="PrevBtn"
+           @click="goback">上一步</div>
+      <div class="submitBtn"
+           @click="submitInfo">提交</div>
+    </div>
   </div>
 </template>
 <script>
 import store from '@/store'
-import { getSubject, getDefaultSubject, getGoods, createTeam, getSoundTree, findSound } from '@/api/buildTeam'
+import { getSubject, getDefaultSubject, getGoods, createTeam, getSoundTree, findSound, teamSoundStudent } from '@/api/buildTeam'
 export default {
   props: ['getTeamList'],
   data () {
     return {
       dialogTableVisible: false,
-      studentVisible: true,
+      studentVisible: false,
       checkList: [],
       isLoop: '',
       activeSoundList: [],
       soundList: [],
       soundLists: [],
       changeList: [],
-      multipleSelection: [], // 列表选择的集合
+      multipleSelection: [], // 列表选择的集合 声部
       teamList: [], // 选择的乐团集合
       activeTeam: '', // 选中的乐团
       chioseSoundList: [],//根据选中的乐团id获取的声部集合
       activeChioseSound: '', // 选中声部的集合
-      studentList: [] // 选择列表中的学生
+      studentList: [], // 选择列表中的学生  展示中的列表
+      activeListStudent: [], // 列表中选中的学生,
+      allActiveStudent: [], // 所有选中的学生  全局
+      activeSoundId: '', //
     }
   },
   created () {
@@ -207,13 +235,14 @@ export default {
 
   },
   methods: {
-    handleSelectionChange () { },
+    handleSelectionChange (e) {
+      console.log(e);
+    },
     handleclick () { },
-    // 删除
+    // 删除声部
     removeListItem () {
       for (let i = 0; i < this.activeSoundList.length; i++) {
         for (let j = 0; j < this.multipleSelection.length; j++) {
-
           if (this.activeSoundList[i].id == this.multipleSelection[j].id) {
             this.activeSoundList.splice(i, 1);
             // 遍历循环所有的group 删除所选id
@@ -259,9 +288,14 @@ export default {
     // 点击添加学生
     resetStudent (row) {
       // 乐团id 声部id 
-    },
-    handleSelectionChange (val) {
+      this.studentVisible = true;
+      this.activeSoundId = row.id;
 
+      for (let i in this.activeSoundList) {
+        if (this.activeSoundList[i].id == row.id) {
+          this.activeListStudent = this.activeSoundList[i].studentList;
+        }
+      }
     },
     chioseTeam () {
       // console.log(this.activeTeam)
@@ -276,9 +310,138 @@ export default {
       // activeTeam activeChioseSound
       if (!this.activeTeam || !this.activeChioseSound) {
         this.$message.error('请先选择乐团以及声部进行搜索')
+        return;
+      }
+      console.log('开始搜素学生')
+      // activeSoundId 这个id里面的  studentList
+      // 在这里要同步当前已选学员的的状态=>  chioseStudentList里赋值
+      // 筛选学生1
+      for (let i in this.activeSoundList) {
+        if (this.activeSoundList[i].id == this.activeSoundId) {
+          console.log(this.activeSoundList[i].id);
+          console.log(this.activeSoundList[i].studentList);
+          this.activeListStudent = this.activeSoundList[i].studentList;
+        }
       }
-      // 筛选学生
+      teamSoundStudent({ musicGroupId: this.activeTeam, actualSubjectId: this.activeChioseSound }).then(res => {
+        if (res.code == 200) {
+          this.studentList = res.data.map(item => {
+            let teamName;
+            let soundName;
+            this.teamList.map(team => {
+              if (team.id == this.activeTeam) {
+                teamName = team.name
+              }
+            })
+            item.soundName = this.chioseSoundList.map(sound => {
+              if (sound.id == this.activeChioseSound) {
+                soundName = sound.name
+              }
+            })
+            item.soundName = soundName;
+            item.musicGroupName = teamName;
+            return item;
+          });
+          // 若学生在全局中被选中  则下次更新列表的时候不显示该学生
+          for (let i in this.studentList) {
+            for (let j in this.allActiveStudent) {
+              if (this.allActiveStudent[j].id == this.studentList[i].id) {
+                this.studentList.splice(i, 1);
+              }
+            }
+          }
+        }
+      })
+    },
+    SelectionStudent (e) {
+      // 先找到外面是哪一行的
+      for (let i in this.activeSoundList) {
+        if (this.activeSoundList[i].id == this.activeSoundId) {
+          if (this.activeSoundList[i].studentList.length > 0) {
+            this.activeSoundList[i].studentList = this.activeSoundList[i].studentList.concat(e);
+          } else {
+            this.activeSoundList[i].studentList = e;
+          }
+
+          // 去重
+          let result = this.objArrayRemoval(this.activeSoundList[i].studentList, 'id')
+          console.log(result);
+
+          // 不对
+          this.activeSoundList[i].studentList = result;
+          this.activeListStudent = result;
+          // // 添加全局 
+
+          if (this.allActiveStudent.length <= 0) {
+            console.log('第一次添加数据')
+            this.allActiveStudent = result;
+          } else {
+            this.allActiveStudent = this.allActiveStudent.concat(result);
+          }
+          this.allActiveStudent = this.objArrayRemoval(this.allActiveStudent, 'id');
+        }
+      }
+
+    },
+    // 点击删除按钮 重学生集合里删除
+    removeStudent (item) {
+      // 删除全局
+      for (let i in this.allActiveStudent) {
+        if (this.allActiveStudent[i].id == item.id) {
+          this.allActiveStudent.splice(i, 1);
+        }
+      }
+      // 删除当前
+      for (let i in this.activeSoundList) {
+        if (this.activeSoundList[i].id == this.activeSoundId) {
+          for (let j in this.activeSoundList[i].studentList) {
+            if (item.id == this.activeSoundList[i].studentList[j].id) {
+              this.activeSoundList[i].studentList.splice(j, 1);
+              // 这里做判断 this.studentList 里有没有这个学生(没有)=>判断学生的声部是不是和当前搜索的声部一样 添加
+              // 有..  则取消勾选
+              let flag = false;
+              for (let x in this.studentList) {
+                if (this.studentList[x].id == item.id) {
+                  flag = true;
+                }
+              }
+              if (flag) {
+                // 表里有这个学生
+                this.toggleSelection(item, this.studentList);
+              } else {
+                if (item.actualSubjectId == this.activeChioseSound) {
+                  this.studentList.unshift(item)
+                }
+              }
+              this.activeListStudent = this.activeSoundList[i].studentList;
+            }
+
+          }
+
+        }
+      }
+    },
+    toggleSelection (item, table) {
+      table.forEach(row => {
+        if (row.id == item.id) {
+          this.$refs['studentList'].toggleRowSelection(row, false);
+        }
+      })
+    },
+    // 对象数组去重
+    objArrayRemoval (arr, attr) {
+      let obj = {};
+      let result = [];
+      // console.log(this.allActiveStudent.length);
+      for (let x in arr) {
+        if (!obj[arr[x][attr]]) {
+          result.push(arr[x]);
+          obj[arr[x][attr]] = true;
+        }
+      }
+      return result;
     }
+
   },
   computed: {
     // 返回当前选中声部数量
@@ -290,6 +453,23 @@ export default {
       }
       return num;
     },
+    goback () {
+      this.$emit('chiosetab', 0);
+    },
+    submitInfo () { }
+  },
+  watch: {
+    studentVisible (val) {
+
+      if (!val) {
+        // 1.选择的团
+        this.activeTeam = ''
+        // 2.选择的声部
+        this.activeChioseSound = ''
+        // 3.选择的选中的列表
+        this.studentList = [];
+      }
+    }
   }
 }
 </script>
@@ -369,12 +549,16 @@ export default {
       overflow-y: auto;
       border: 1px solid #ccc;
       .studentItem {
-        padding: 10px;
+        padding-left: 10px;
+        line-height: 25px;
       }
     }
   }
   .right {
-    overflow-y: auto;
+    .tableList {
+      max-height: 500px;
+      overflow-y: auto;
+    }
   }
 }
 </style>

+ 1 - 1
src/views/vipClass/vipDetail/components/fnanceInfo.vue

@@ -125,7 +125,7 @@ export default {
   },
   methods: {
     getList () {
-      getVipGroupSalarys({ vipGroupId: this.id, organId: this.$store.getters.organ, pahe: this.rules.page, rows: this.rules.limit, startTime: this.searchForm.time[0], endTime: this.searchForm.time[1] }).then(res => {
+      getVipGroupSalarys({ vipGroupId: this.id, organId: this.$store.getters.organ, pahe: this.rules.page, rows: this.rules.limit, startTime: this.searchForm.time[0] || null, endTime: this.searchForm.time[1] || null }).then(res => {
         if (res.code == 200) {
           this.tableList = res.data.pageInfo.rows;
           this.totalFeeDeduction = res.data.baseInfo.totalFeeDeduction;

+ 2 - 2
src/views/vipClass/vipDetail/components/teacherRecord.vue

@@ -245,8 +245,8 @@ export default {
         vipGroupId: this.id,
         page: this.rules.page,
         rows: this.rules.limit,
-        status: this.searchForm.status,
-        teachMode: this.searchForm.type,
+        status: this.searchForm.status || null,
+        teachMode: this.searchForm.type || null,
         startTime,
         endTime
       }

+ 2 - 2
src/views/vipClass/vipList.vue

@@ -197,7 +197,7 @@ export default {
     },
     // 跳转到vip详情
     gotoVipDetail (id) {
-      this.$router.push({ path: '/vipClass/vipDetail', query: { id } })
+      this.$router.push({ path: '/business/vipDetail', query: { id } })
     },
     closeVip (id) {
       closeVip({ vipGroupId: id }).then(res => {
@@ -215,7 +215,7 @@ export default {
   filters: {
     formatterTime (val) {
       let result
-      if(val) {
+      if (val) {
         result = val.split(' ')[0];
       } else {
         result = ''

+ 2 - 2
vue.config.js

@@ -17,10 +17,10 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
 // http://47.99.212.176:8000
 // 
 // let target = 'http://192.168.3.27:8000' // 箭河
-let target = 'http://192.168.3.28:8000' //邹璇
+// let target = 'http://192.168.3.28:8000' //邹璇
 // let target = 'http://192.168.3.8:8000' //勇哥
 // let target = 'http://47.99.212.176:8000' // 测试服
-// let target = 'http://192.168.3.48:8000' // 乔
+let target = 'http://192.168.3.48:8000' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**