mo пре 5 година
родитељ
комит
094058e112

+ 28 - 1
src/api/vipSeting.js

@@ -258,4 +258,31 @@ export function appendVipGroupCourseSchedules (data) {
     method: 'POST',
     data
   })
-}
+}
+
+// vip退费查询
+export function getStudentSurplusCourseFee (data) {
+  return request({
+    url: api + '/vipGroupManage/getStudentSurplusCourseFee',
+    method: 'get',
+    params: data
+  })
+}
+
+// vip搜索课程余额的学生
+export function getHaveCourseBalanceStudents (data) {
+  return request({
+    url: api + '/vipGroupManage/findHaveCourseBalanceStudents',
+    method: 'get',
+    params: data
+  })
+}
+
+// vip添加学员 addVipGroupStudents
+export function addVipGroupStudents (data) {
+  return request({
+    url: api + '/vipGroupManage/addVipGroupStudents',
+    method: 'get',
+    params: data
+  })
+}

+ 7 - 5
src/views/resetTeaming/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="m-container">
     <h2>
-      <el-page-header @back="onCancel" content="乐团修改"></el-page-header>
-      
+      <el-page-header @back="onCancel"
+                      content="乐团修改"></el-page-header>
+
     </h2>
     <div class="m-core">
       <!-- navMenu -->
@@ -54,22 +55,23 @@ export default {
   created () {
     this.activeIndex = sessionStorage.getItem('resetCode') || '1';
     this.teamid = this.$route.query.id;
-    console.log(this.teamid)
   },
   beforeDestroy () {
     sessionStorage.setItem('setStep', 0)
     sessionStorage.setItem('resetCode', 1)
   },
   mounted () {
+    let obj = {}
+    obj.name = this.activeIndex
+    this.handleClick(obj)
 
   }, methods: {
-    onCancel() {
+    onCancel () {
       this.$router.push('/business/teamDetail')
     },
     handleClick (val) {
       this.activeIndex = val.name
       this.acitveStatus[val.name - 1] = true
-
     }
   },
 }

+ 4 - 0
src/views/teamBuild/teamSeting/components/coursePlan.vue

@@ -62,6 +62,7 @@
                            :value="item.value"></el-option>
               </el-select>
               <el-time-select placeholder="起始"
+                              @change='changeTimer(item)'
                               v-model="item.startTime"
                               :picker-options="{
                              start: '06:30',
@@ -375,6 +376,9 @@ export default {
 
   },
   methods: {
+    changeTimer (item) {
+      item.endTime = '';
+    },
     // 勾选table触发
     handleSelectionChange (val) {
       this.activeList = val;

+ 28 - 28
src/views/teamDetail/components/resetClass.vue

@@ -8,19 +8,16 @@
     <div class="m-core">
       <el-form :inline="true"
                :model="topForm">
-        <el-form-item label="合奏班">
-          <el-select v-model="topForm.mixClass"
+        <el-form-item label="班级类型">
+          <el-select v-model="topForm.classType"
+                     clearable
                      @change="changeMixClass">
-            <el-option v-for="(item,index) in maxClassList"
-                       :key='index'
-                       :value="item.id"
-                       :label="item.name"></el-option>
+            <el-option v-for='(item,index) in classTypeList'
+                       :key="index"
+                       :label="item.label"
+                       :value="item.value"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="当前单技班数量">
-          <el-input disabled
-                    v-model="topForm.count"></el-input>
-        </el-form-item>
       </el-form>
       <div class="tableWrap"
            style=" width: 800px;">
@@ -356,8 +353,7 @@ export default {
     return {
       teamid: '',
       topForm: {
-        mixClass: '',
-        count: ''
+        classType: ''
       },
       tableList: [],
       maxClassList: [],
@@ -414,6 +410,13 @@ export default {
         { value: '5', label: '星期五' },
         { value: '6', label: '星期六' },
         { value: '7', label: '星期日' },
+      ],
+      // 班级类型
+      classTypeList: [
+        { value: 'NORMAL', label: '单技班' },
+        { value: 'MIX', label: '合奏班' },
+        { value: 'HIGH', label: '基础技能班' },
+        { value: 'SNAP', label: '临时班' },
       ]
     }
   },
@@ -421,22 +424,26 @@ export default {
     this.teamid = this.$route.query.id;
   },
   mounted () {
-    sessionStorage.setItem('resetCode', '3')
+    sessionStorage.setItem('resetCode', 3)
     // 1.获取乐团下所有的合奏班
     // 2.根据合奏班获取所有的单技班
     // 3.根据乐团id 查询 此乐团所有的合奏班
     // 4.获取当年的所有节假日
-    getAllClass({ musicGroupId: this.teamid }).then(res => {
-      if (res.code == 200) {
-        this.maxClassList = res.data;
-      }
-    })
+    // getAllClass({ musicGroupId: this.teamid }).then(res => {
+    //   if (res.code == 200) {
+    //     this.maxClassList = res.data;
+    //   }
+    // })
     // let year = new Date().getFullYear();
     // axios.post('/jiari/', qs.stringify({ d: year })).then(res => {
     //   this.holidayList = Object.keys(res.data[year])
     // })
     // getNoClassStudentAll({ musicGroupId: this.teamid }).then(res => {
     // })
+
+
+    // 获取默认乐团内的所有班
+    this.changeMixClass()
     // 根据乐团id获取乐团的所有声部
     findSound({ musicGroupId: this.teamid }).then(res => {
       if (res.code == 200) {
@@ -461,19 +468,16 @@ export default {
       this.activeMixClass = val;
     },
     getList (val) {
-      getAllSignClassandTeacher({ classGroupId: val }).then(res => {
+      getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(res => {
         if (res.code == 200) {
           this.activeSingleList = res.data;
-          this.topForm.count = this.activeSingleList.length
+          // this.topForm.count = this.activeSingleList.length
         }
       })
     },
     // 临时调整
     temporary () {
-      if (!this.topForm.mixClass) {
-        this.$message.error('请先选择合奏班')
-        return
-      }
+
       this.activeClass = '';
       this.activeListStudent = [];
       this.studentList = [];
@@ -487,10 +491,6 @@ export default {
 
     // 新增班级 
     addNewClass () {
-      if (!this.topForm.mixClass) {
-        this.$message.error('请先选择合奏班')
-        return
-      }
       this.activeClass = '';
       this.activeListStudent = [];
       this.studentList = [];

+ 8 - 2
src/views/teamDetail/components/salaryList.vue

@@ -35,8 +35,13 @@
                          label="班级名称">
         </el-table-column>
         <el-table-column align='center'
-                         prop="mixClassGroupName"
+                         prop="courseScheduleType"
                          label="课程类型">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.courseScheduleType |  coursesType}}
+            </div>
+          </template>
         </el-table-column>
         <el-table-column align='center'
                          prop="teacherNum"
@@ -63,7 +68,8 @@
     <el-dialog title="课酬调整"
                width="800px"
                :visible.sync="dialogTableVisible">
-      <el-table :data="activeTeacherList">
+      <el-table :data="activeTeacherList"
+                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
         <el-table-column label="老师姓名"
                          prop="teacherName"></el-table-column>
         <el-table-column label="老师角色">

+ 159 - 7
src/views/vipClass/vipDetail/components/vipStudentList.vue

@@ -1,5 +1,7 @@
 <template>
   <div>
+    <div class="newBand"
+         @click="addStudentList">新增学员</div>
     <div class="tableWrap">
       <el-table :data='tableList'
                 :header-cell-style="{background:'#EDEEF0',color:'#444'}">
@@ -8,16 +10,20 @@
                          width="180">
         </el-table-column>
         <el-table-column label="手机号"
-                         prop="userName"
+                         prop="phone"
                          width="180">
         </el-table-column>
         <el-table-column label="操作">
           <template slot-scope="scope">
             <div>
-              <el-popover placement="top"
+              <!-- <el-popover placement="top"
                           width="160"
+                          trigger="click"
                           :ref="scope.$index">
-                <p>确定退学吗?</p>
+                <p>请输入退费金额</p>
+                <el-input style="margin:10px 0;"
+                          type="number"
+                          v-model="scope.row.fee"></el-input>
                 <div style="text-align: right; margin-top: 20px">
                   <el-button size="mini"
                              type="text"
@@ -27,22 +33,90 @@
                              @click="leaveSchool(scope)">确定</el-button>
                 </div>
                 <el-button type="text"
-                           slot="reference">退学</el-button>
-              </el-popover>
+                           slot="reference"
+                           @click="lookFee(scope)">退学</el-button>
+              </el-popover> -->
+              <el-button type="text"
+                         @click="lookFee(scope)">退学</el-button>
             </div>
           </template>
         </el-table-column>
       </el-table>
     </div>
+    <el-dialog title="学员列表"
+               :visible.sync="maskVisible">
+      <el-form :model="maskForm"
+               :inline="true">
+        <el-form-item>
+          <el-input placeholder="请输入学生姓名或手机号"
+                    v-model='maskForm.search'></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="danger"
+                     @click="search">搜索</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary"
+                     @click="reset">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table :data="maskStudentList"
+                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+        <el-table-column label=""
+                         width="55">
+          <template slot-scope="scope">
+            <el-radio v-model="activeStudent"
+                      :label="scope.row.id"
+                      @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp</el-radio>
+          </template>
+        </el-table-column>
+        <el-table-column prop="userName"
+                         align="center"
+                         label="学生姓名"
+                         width="150"></el-table-column>
+        <el-table-column prop="phone"
+                         align="center"
+                         label="手机号"
+                         width="200"></el-table-column>
+        <el-table-column prop="courseSalary"
+                         label="剩余费用"></el-table-column>
+      </el-table>
+      <pagination :total="rules.total"
+                  :page.sync="rules.page"
+                  :limit.sync="rules.limit"
+                  :page-sizes="rules.page_size"
+                  @pagination="getList" />
+      <div slot="footer"
+           class="dialog-footer">
+        <el-button @click="maskVisible = false">取 消</el-button>
+        <el-button type="primary"
+                   @click="addStudent">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
-import { findVipGroupStudents, leaveSchool } from '@/api/vipSeting'
+import pagination from '@/components/Pagination/index'
+import { findVipGroupStudents, leaveSchool, getStudentSurplusCourseFee, getHaveCourseBalanceStudents, addVipGroupStudents } from '@/api/vipSeting'
 export default {
+  components: { pagination },
   data () {
     return {
       tableList: [],
-      id: ''
+      id: '',
+      maskStudentList: [],
+      maskVisible: false,
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      },
+      activeStudent: '',
+      maskForm: {
+        search: ''
+      }
     }
   },
   mounted () {
@@ -51,13 +125,91 @@ export default {
     this.getStudents()
   },
   methods: {
+    search () {
+      this.rules.page = 1;
+      this.getList()
+    },
+    reset () {
+      this.rules.page = 1;
+      this.rules.search = null;
+      this.activeStudent = '';
+      this.getList();
+    },
     getStudents () {
       findVipGroupStudents({ vipGroupId: this.id }).then(res => {
         if (res.code == 200) {
           this.tableList = res.data.rows;
+          for (let i in this.tableList) {
+            this.tableList[i].fee = 0;
+            this.tableList[i].visible = false;
+          }
+        }
+      })
+    },
+    leaveSchool (scope) {
+      let studentId = scope.row.id;
+      let vipGroupId = this.id;
+      let amount = scope.row.fee;
+      leaveSchool({ studentId, vipGroupId, amount }).then(res => {
+        if (res.code == 200) {
+          this.$message({
+            type: 'success',
+            message: '退学成功'
+          })
+          this.getStudents();
+
+        }
+      })
+
+    },
+    lookFee (scope) {
+      let id = scope.row.id;
+      getStudentSurplusCourseFee({ studentId: id, vipGroupId: this.id }).then(res => {
+        if (res.code == 200) {
+          // scope.row.fee =
+          this.$prompt('请输入退课金额', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            inputValue: res.data.suplusCourseFee
+          }).then(({ value }) => {
+            scope.row.fee = value;
+            this.leaveSchool(scope);
+          }).catch(res => {
+
+          })
         }
       })
     },
+    addStudentList () {
+      // 发请求 搜索学生
+      this.getList();
+    },
+    getList () {
+      let search = this.maskForm.search || null;
+      getHaveCourseBalanceStudents({ organId: this.$store.getters.organ, page: this.rules.page, rows: this.rules.limit, search }).then(res => {
+        if (res.code == 200) {
+          this.rules.total = res.data.total;
+          this.maskStudentList = res.data.rows;
+          this.maskVisible = true;
+        }
+      })
+    },
+    getTemplateRow (index, row) {
+      // console.log(row);
+      this.activeStudent = row.id;
+    },
+    addStudent () {
+      if (!this.activeStudent) {
+        this.$message.error('请选择一名学生');
+        return
+      }
+      addVipGroupStudents({ vipGroupId: this.id, studentIds: this.activeStudent }).then(res => {
+        if (res.code == 200) {
+          this.$message.success('添加成功')
+          this.getList();
+        }
+      })
+    }
   },
 }
 </script>

+ 2 - 2
vue.config.js

@@ -16,11 +16,11 @@ const name = defaultSettings.title || '大雅后台管理系统' // page title
 // const port = process.env.port || process.env.npm_config_port || 9528 // dev port
 // http://47.99.212.176:8000 
 // 
-// let target = 'http://192.168.3.27:8000' // 箭河
+let target = 'http://192.168.3.27: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 = {
   /**