Explorar el Código

10/12

vip主流程完成
mo hace 5 años
padre
commit
6147b32e5b

+ 18 - 0
src/api/vipSeting.js

@@ -194,3 +194,21 @@ export function resetVipClass (data) {
     params: data
   })
 }
+
+// 计算vip课酬
+export function getVipGroupCostCount (data) {
+  return request({
+    url: '/web-server/vipGroupManage/getVipGroupCostCount',
+    method: 'POST',
+    params: data
+  })
+}
+
+// vip课申请
+export function createVip (data) {
+  return request({
+    url: '/web-server/vipGroupManage/vipGroupApply',
+    method: 'POST',
+    data
+  })
+}

+ 248 - 147
src/views/buildVip/index.vue

@@ -8,10 +8,16 @@
       <div class="vipLeft">
         <h4>课程信息</h4>
         <el-form ref='leftForm'
+                 :rules='leftFormRules'
                  :label-position='labelPosition'
                  label-width="100px"
                  :model="leftForm">
-          <el-form-item label="科目名称">
+          <el-form-item label="课程名称"
+                        prop="name">
+            <el-input v-model="leftForm.name"></el-input>
+          </el-form-item>
+          <el-form-item label="科目名称"
+                        prop="subject">
             <el-select v-model="leftForm.subject">
               <el-option v-for='(item,index) in subjectList'
                          :key='index'
@@ -19,7 +25,8 @@
                          :label="item.name"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="指导老师">
+          <el-form-item label="指导老师"
+                        prop="teacher">
             <el-select v-model="leftForm.teacher"
                        :disabled="!leftForm.subject">
               <el-option v-for="(item,index) in teacherList"
@@ -28,7 +35,8 @@
                          :value="item.id"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="课程形式">
+          <el-form-item label="课程形式"
+                        prop="courseType">
             <el-select v-model="leftForm.courseType"
                        @change="changeType">
               <el-option v-for="(item,index) in courseTypeList"
@@ -37,7 +45,8 @@
                          :value="item.id"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="活动方案">
+          <el-form-item label="活动方案"
+                        prop="activeType">
             <el-select v-model="leftForm.activeType"
                        :disabled="!leftForm.courseType"
                        @change='chioseActive'>
@@ -117,24 +126,10 @@
           <el-form-item label="赠课课程类型"
                         v-if="hotType=='GIVE_CLASS'">
             <el-radio v-model="centerForm.radio"
-                      label="online">线上课</el-radio>
+                      label="ONLINE">线上课</el-radio>
             <el-radio v-model="centerForm.radio"
-                      label="offline">线下课</el-radio>
+                      label="OFFLINE">线下课</el-radio>
           </el-form-item>
-          <!-- <el-form-item label="排课开始时间">
-            <el-date-picker v-model="centerForm.planStart"
-                            type="date"
-                            value-format="yyyy-MM-dd HH:mm:ss"
-                            placeholder="请选择时间">
-            </el-date-picker>
-          </el-form-item>
-          <el-form-item label="排课结束时间">
-            <el-date-picker v-model="centerForm.planEnd"
-                            type="date"
-                            value-format="yyyy-MM-dd HH:mm:ss"
-                            placeholder="请选择时间">
-            </el-date-picker>
-          </el-form-item> -->
         </el-form>
         <!-- 排课列表开始 -->
         <div class="planList">
@@ -144,12 +139,14 @@
                        @click="dialogFormVisible = true">点击排课</el-button>
           </div>
           <div class="planCore">
-            <div class="row">
-              <div class="name">线上课</div>
-              <div class="week">周一</div>
-              <div class="time">14:00-15:00</div>
+            <div class="row"
+                 v-for="(item,index) in this.lookList">
+              <div class="name">{{ item.type }}</div>
+              <div class="week">{{ item.week }}</div>
+              <div class="time">{{ item.time }}</div>
               <div class="operation">
-                <el-button type='text'>删除</el-button>
+                <el-button type='text'
+                           @click="removeWeekCourse(item.id)">删除</el-button>
               </div>
             </div>
           </div>
@@ -161,37 +158,50 @@
         <el-form :model="rightForm"
                  label-width="100px"
                  :label-position="labelPosition">
-          <el-form-item label="线上课课酬">
-            <el-input v-model="rightForm.onlineCourse"></el-input>
+          <el-form-item label="线上课课酬"
+                        v-if="hasOnline">
+            <el-input v-model="rightForm.onlineCourse"
+                      :disabled="salaryReadonlyFlag==0 || onlineSalary!='TEACHER_DEFAULT'"></el-input>
           </el-form-item>
-          <el-form-item label="线下课课酬">
-            <el-input v-model="rightForm.offlineCourse"></el-input>
+          <el-form-item label="线下课课酬"
+                        v-if="hasOffline">
+            <el-input v-model="rightForm.offlineCourse"
+                      :disabled="salaryReadonlyFlag==0 || offlineSalary!='TEACHER_DEFAULT'"></el-input>
           </el-form-item>
-          <el-form-item label="线上课单价">
-            <el-input v-model="rightForm.onlinePrice"></el-input>
+          <el-form-item label="线上课单价"
+                        v-if="hasOnline">
+            <el-input v-model="rightForm.onlinePrice"
+                      :disabled="salaryReadonlyFlag==0"></el-input>
           </el-form-item>
-          <el-form-item label="线下课单价">
-            <el-input v-model="rightForm.offlinePrice"></el-input>
+          <el-form-item label="线下课单价"
+                        v-if="hasOffline">
+            <el-input v-model="rightForm.offlinePrice"
+                      :disabled="salaryReadonlyFlag==0"></el-input>
           </el-form-item>
           <el-form-item label="课程总价">
-            <el-input v-model="rightForm.allPrice"></el-input>
+            <el-input v-model="rightForm.allPrice"
+                      disabled></el-input>
           </el-form-item>
         </el-form>
+        <el-button type="primary"
+                   style="float:right"
+                   @click="computational">计算</el-button>
       </div>
     </div>
     <!-- 弹窗 -->
     <el-dialog title="VIP排课"
                width="500px"
+               ref='maskForm'
                :visible.sync="dialogFormVisible">
       <el-form :model="maskForm">
         <el-form-item label="课程类型"
                       prop="type">
           <el-radio v-model="maskForm.type"
                     v-if="hasOnline"
-                    label="online">线上课</el-radio>
+                    label="ONLINE">线上课</el-radio>
           <el-radio v-model="maskForm.type"
                     v-if="hasOffline"
-                    label="offline">线下课</el-radio>
+                    label="OFFLINE">线下课</el-radio>
         </el-form-item>
 
         <el-form-item label="循环周次"
@@ -234,11 +244,6 @@
       <div class="planList">
         <div class="planTop">
           <p>已排课程</p>
-          <!-- <el-button type='text'>点击排课</el-button> -->
-          <!--   'type': str,
-        'week': week,
-        'time': stratTime + '-' + endtime,
-        'id': Date.now() -->
         </div>
         <div class="planCore">
           <div class="row"
@@ -255,6 +260,7 @@
         <div style="margin:20px 0">
           <el-date-picker v-model="maskForm.courseStart"
                           type="date"
+                          :picker-options="courseOption"
                           placeholder="请选择开课时间">
           </el-date-picker>
         </div>
@@ -269,26 +275,27 @@
     </el-dialog>
     <div class="btnWrap">
       <div class="closeBtn">取消</div>
-      <div class="okBtn">确定</div>
+      <div class="okBtn"
+           @click="submitInfo">确定</div>
     </div>
   </div>
 </template>
 <script>
 import { getTeacher, getSubject } from '@/api/buildTeam'
-import { vipGroupCategory, vipGroupActivityFind } from '@/api/vipSeting'
+import { vipGroupCategory, vipGroupActivityFind, getVipGroupCostCount, createVip } from '@/api/vipSeting'
 export default {
   data () {
     return {
       dialogFormVisible: false,
       labelPosition: 'right',
       leftForm: {
+        name: '',
         teacher: '',
         subject: '',
         courseType: '',
         activeType: '',
         classNum: '',
         classTime: '',
-
         signUpStart: '',
         signUpEnd: '',
         courseStart: '',
@@ -309,6 +316,7 @@ export default {
         onlineCourse: '',
         offlineCourse: '',
         onlinePrice: '',
+        offlinePrice: '',
         allPrice: ''
       },
       subjectList: [], // 科目列表
@@ -317,13 +325,46 @@ export default {
       activeList: [], //活动集合
       hasOnline: false,
       hasOffline: false,
+      onlineSalary: '', // 线上课课酬结算方式
+      offlineSalary: '',// 线下课课酬结算方式
       hotType: '',
       attribute1: '',
       attribute2: '',
+      salaryReadonlyFlag: '', // 老师工资是否可配
       lookList: [], // 展示课表
       timeTable: [], // 真正的课表
       giveNum: '',
       weekDay: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
+      courseOption: {
+        disabledDate: time => {
+          let startTime = this.leftForm.courseStart;
+          if (startTime) {
+            let date = new Date(startTime.replace(/-/, "/"))
+            return time.getTime() < date.getTime()
+          }
+          return;
+        }
+      },
+      leftFormRules: {
+        /**?
+         * teacher: '',
+        subject: '',
+        courseType: '',
+        activeType: '',
+         */
+        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+        teacher: [
+          { required: true, message: '请选择老师', trigger: 'blur' },],
+        subject: [{
+          required: true, message: '请选择科目', trigger: 'blur'
+        }],
+        courseType: [{
+          required: true, message: '请选择课程类型', trigger: 'blur'
+        }],
+        activeType: [{
+          required: true, message: '请选择活动', trigger: 'blur'
+        }]
+      }
     }
   },
   mounted () {
@@ -355,10 +396,11 @@ export default {
       let online, offline;
       this.centerForm.onlineCourseNum ? online = this.centerForm.onlineCourseNum : online = 0;
       this.centerForm.offlineCourseNum ? offline = this.centerForm.offlineCourseNum : offline = 0;
-
       let giveNum;
       if (this.hotType == 'GIVE_CLASS') {
-        giveNum = parseInt((parseInt(offline) + parseInt(online)) / this.attribute1 * this.attribute2);
+        //  this.attribute1  从多少节开始送
+        //  this.attribute2  送多少节
+        giveNum = parseInt((parseInt(offline) + parseInt(online)) - this.attribute1 >= 0 ? giveNum = this.attribute2 : giveNum = 0);
         this.giveNum = giveNum || 0;
         return (parseInt(offline) + parseInt(online) + '+' + giveNum) || '';
       }
@@ -403,24 +445,30 @@ export default {
           this.leftForm.signUpStart = this.activeList[i].startTime;
           this.leftForm.signUpEnd = this.activeList[i].endTime;
           this.leftForm.courseStart = this.activeList[i].coursesStartTime;
-          this.leftForm.courseEnd = this.activeList[i].coursesEndTime
+          this.leftForm.courseEnd = this.activeList[i].coursesEndTime;
           // 获取活动种类并保存
           this.hotType = this.activeList[i].type;
           // 获取买赠必要参数
           this.attribute1 = this.activeList[i].attribute1;
           this.attribute2 = this.activeList[i].attribute2;
+          // 存储课酬是否可配置
+          this.salaryReadonlyFlag = this.activeList[i].salaryReadonlyFlag
           //  hasOnline: false, hasOffline: false 还需要判断type类型 根据活动id获取
           if (this.activeList[i].salarySettlementJson) {
             let obj = JSON.parse(this.activeList[i].salarySettlementJson)
             if (obj && obj.onlineSalarySettlement) {
               // 有线上课
               this.hasOnline = true;
+              this.onlineSalary = obj.onlineSalarySettlement.salarySettlementType;
+              console.log('线上:' + this.onlineSalary)
             } else {
               this.hasOnline = false;
             }
             if (obj && obj.offlineSalarySettlement) {
               // 有线下课
               this.hasOffline = true;
+              this.offlineSalary = obj.offlineSalarySettlement.salarySettlementType;
+              console.log('线下:' + this.offlineSalary)
             } else {
               this.hasOffline = false;
             }
@@ -432,7 +480,7 @@ export default {
     // 点击确插入课表
     addWeek () {
       let courseType = this.maskForm.type;
-      // let week = ;
+      // let week = ;this.maskForm.week 
       let startTime = this.maskForm.startTime;
       if (!courseType || !this.maskForm.week || !startTime) {
         this.$message({
@@ -446,93 +494,72 @@ export default {
 
       let str;
       switch (courseType) {
-        case 'online': {
+        case 'ONLINE': {
           str = '线上课'
           break;
         }
-        case 'offline': {
+        case 'OFFLINE': {
           str = '线下课'
           break;
         }
       }
-      // if (this.lookList.length == 0) {
-      //   this.lookList.push({
-      //     'type': str,
-      //     'week': this.weekDay[this.maskForm.week],
-      //     'weekDay': this.maskForm.week,
-      //     'startTime': startTime,
-      //     'endTime': endTime,
-      //     'time': startTime + '-' + endTime,
-      //     'id': Date.now()
-      //   })
-
-      // } else {
-      //   let flag = false;
-      //   for (let i in this.lookList) {
-      //     // 判断周几相等
-      //     if (this.lookList[i].weekDay == this.maskForm.week && !this.timeIsrange(this.lookList[i].startTime, this.lookList[i].endTime, startTime) && !this.timeIsrange(this.lookList[i].startTime, this.lookList[i].endTime, endTime)) {
-      //       this.lookList.push({
-      //         'type': str,
-      //         'week': this.weekDay[this.maskForm.week],
-      //         'weekDay': this.maskForm.week,
-      //         'startTime': startTime,
-      //         'endTime': endTime,
-      //         'time': startTime + '-' + endTime,
-      //         'id': Date.now()
-      //       })
-      //     } else if (this.lookList[i].weekDay == this.maskForm.week && (this.timeIsrange(this.lookList[i].startTime, this.lookList[i].endTime, startTime) || this.timeIsrange(this.lookList[i].startTime, this.lookList[i].endTime, endTime))) {
-      //       this.$message({
-      //         type: 'error',
-      //         message: '该时间段已排课请重选时间'
-      //       })
-      //       return
-      //     }
-      //     // 如果相等  判断时间 是否在时间段
-      //     // if () {
-      //     //   // 提示语 不添加
-
-      //     // } else {
-
-      //     //   console.log('周相等但时间段不等添加');
-      //     //   return
-      //     // }
-      //     // } else {
-      //     //   // 不等就直接添加
-      //     //   // 判断一下当前星期 有没有 没有就添加
-      //     //   let arr = [];
-      //     //   for (let j in this.lookList) {
-      //     //     arr.push(parseInt(this.lookList[j].weekDay))
-      //     //   }
-      //     //   // 去重
-      //     //   arr = Array.from(new Set(arr))
-      //     //   console.log(arr, this.maskForm.week);
-      //     //   if (arr.indexOf(parseInt(this.maskForm.week)) == -1) {
-      //     //     this.lookList.push({
-      //     //       'type': str,
-      //     //       'week': this.weekDay[this.maskForm.week],
-      //     //       'weekDay': this.maskForm.week,
-      //     //       'startTime': startTime,
-      //     //       'endTime': endTime,
-      //     //       'time': startTime + '-' + endTime,
-      //     //       'id': Date.now()
-      //     //     })
-      //     //   } else {
-
-      //     //   }
-
-      //     //   return
-      //     // }
-
-      //   }
-      // }
       let flag = false;
       for (let i in this.lookList) {
         if (this.lookList[i].weekDay == this.maskForm.week) {
-          //  f
+          flag = true;
+        }
+      }
+      // true=> 说明有这一周 那么循环找到这一周 在判断时间
+      // flase=> 说明没有这一周的时间 直接添加
+      if (flag) {
+        // 有相同的周日
+        let arr = [];
+        for (let i in this.lookList) {
+          if (this.lookList[i].weekDay == this.maskForm.week) { // 找到这一天的所有元素
+            //  && !this.timeIsrange(this.lookList[i].startTime, this.lookList[i].endTime, startTime) && !this.timeIsrange(this.lookList[i].startTime, this.lookList[i].endTime, endTime)
+            let isStartTime = this.timeIsrange(startTime, endTime, this.lookList[i].startTime);
+            let isEndTime = this.timeIsrange(startTime, endTime, this.lookList[i].endTime);
+            arr.push(!isEndTime && !isStartTime)
+          }
+        }
+        let isAdd = true;
+        for (let j = 0; j < arr.length; j++) {
+          isAdd = isAdd && arr[j]
+        }
+        if (isAdd) {
+          this.lookList.push({
+            'type': str,
+            'week': this.weekDay[this.maskForm.week],
+            'weekDay': this.maskForm.week,
+            'startTime': startTime,
+            'endTime': endTime,
+            'time': startTime + '-' + endTime,
+            'id': Date.now()
+          })
+        } else {
+          this.$message({
+            type: 'error',
+            message: '该时间段已排课请重选时间'
+          })
         }
+      } else {
+        this.lookList.push({
+          'type': str,
+          'week': this.weekDay[this.maskForm.week],
+          'weekDay': this.maskForm.week,
+          'startTime': startTime,
+          'endTime': endTime,
+          'time': startTime + '-' + endTime,
+          'id': Date.now()
+        })
       }
 
-      // console.log(this.lookList);
+      // let courseType = this.maskForm.type;
+      // // let week = ;this.maskForm.week 
+      // let startTime = this.maskForm.startTime;
+      this.maskForm.type = '';
+      this.maskForm.week = '';
+      this.maskForm.startTime = '';
     },
     // 分钟小时相加减
     MinutesTest (str, interval) {
@@ -548,7 +575,6 @@ export default {
     },
     // 判断时间是否在时间段内
     timeIsrange (beginTime, endTime, nowTime) {
-      console.log(beginTime, endTime, nowTime)
       var strb = beginTime.split(":");
       if (strb.length != 2) {
         return false;
@@ -587,24 +613,24 @@ export default {
       }
     },
     setTimeTable () {
+      if (!this.maskForm.courseStart) {
+        this.$message.error('请选择开课时间')
+        return;
+      }
       // 拿到线上课数与线下课数 以及
       let online = parseInt(this.centerForm.onlineCourseNum);
       let offline = parseInt(this.centerForm.offlineCourseNum);
+
       let giveNum = this.giveNum;
       let giveClassType = this.centerForm.radio;
-      if (giveClassType == 'online') {
+      if (giveClassType == 'ONLINE') {
         // 线上
         online += giveNum;
-      } else {
+      } else if (giveClassType == 'OFFLINE') {
         offline += giveNum;
       }
 
-      // 根据周算课
-      // 获取选择到的时间是周几
-      // 获取looklist里 线上课是周几上 周一 周二
-      // 线下课时周几上  周三周四
-      // 找到最近的周几的日期 排课 判断当前所排的课时线上或者线下
-      // 没生成一条上课记录 所对应的 线上线下课次数-1; 当线上 线下课都为0时 这个数组生成
+
       let date = this.maskForm.courseStart;
       let date1 = this.maskForm.courseStart;
       let startWeekday = this.maskForm.courseStart.getDay();
@@ -618,10 +644,9 @@ export default {
           offlineList.push({ week: this.lookList[i].weekDay, date: this.lookList[i] })
         }
       }
+
       // 获取要排课的总数  获取每周要排多少次
-      console.log(offline)
-      console.log(online)
-      while (online >= 1) {
+      while (online && online > 0) {
         // 排线上课g
         for (let i in onlineList) {
           let num;
@@ -629,38 +654,40 @@ export default {
           // console.log(num);
           let dataStr = this.getThinkDate(date, num);
           this.timeTable.push({
-            'classDate': dataStr,
+            'classDate': dataStr + ' 00:00:00',
             'actualTeacherId': this.leftForm.teacher,
-            'startClassTime': dataStr + ' ' + onlineList[i].date.startTime,
-            "endClassTime": dataStr + ' ' + onlineList[i].date.endTime,
+            'startClassTime': dataStr + ' ' + onlineList[i].date.startTime + ':00',
+            "endClassTime": dataStr + ' ' + onlineList[i].date.endTime + ':00',
             "teachMode": 'ONLINE'
           })
           online--;
-          if (online == 0) return
+          if (online == 0) break
         }
         // 加一周
         date.setDate(date.getDate() + 7);
       }
-      while (offline >= 1) {
+
+      while (offline && offline > 0) {
         // 排线下课
         for (let i in offlineList) {
           let num;
-          offlineList[i].week - startWeekday > 0 ? num = offlineList[i].week - startWeekday : num = offlineList[i].week - startWeekday + 7// +差值的天数://差值的天数+7
+          offlineList[i].week - date1.getDay() >= 0 ? num = offlineList[i].week - date1.getDay() : num = offlineList[i].week - date1.getDay() + 7// +差值的天数://差值的天数+7
           let dataStr = this.getThinkDate(date1, num);
+          console.log(dataStr);
           this.timeTable.push({
-            'classDate': dataStr,
+            'classDate': dataStr + ' 00:00:00',
             'actualTeacherId': this.leftForm.teacher,
-            'startClassTime': dataStr + ' ' + offlineList[i].date.startTime,
-            "endClassTime": dataStr + ' ' + offlineList[i].date.endTime,
-            "teachMode": 'ONLINE'
+            'startClassTime': dataStr + ' ' + offlineList[i].date.startTime + ':00',
+            "endClassTime": dataStr + ' ' + offlineList[i].date.endTime + ':00',
+            "teachMode": 'OFFNLINE'
           })
           offline--;
-          if (offline == 0) return
+          if (offline == 0) break
         }
         // 加一周
         date1.setDate(date1.getDate() + 7);
       }
-      console.log(this.timeTable);
+      this.dialogFormVisible = false;
     },
     getThinkDate (date, num) {
 
@@ -683,8 +710,82 @@ export default {
       } else {
         dvar = day + '';
       }
-      console.log(year + "-" + mvar + '-' + dvar);
+      // console.log(year + "-" + mvar + '-' + dvar);
       return year + "-" + mvar + '-' + dvar;
+    },
+    // 计算课酬
+    computational () {
+      let userId = this.leftForm.teacher;
+      let giveTeachMode = this.centerForm.radio;
+      let vipGroupCategoryId = this.leftForm.courseType;
+      let vipGroupActivityId = this.leftForm.activeType;
+      let onlineClassesUnitPrice = this.rightForm.onlinePrice;
+      let offlineClassesUnitPrice = this.rightForm.offlinePrice;
+      let onlineClassesNum = this.centerForm.onlineCourseNum;
+      let offlineClassesNum = this.centerForm.offlineCourseNum;
+      if (this.hotType == 'GIVE_CLASS') {
+        if (this.centerForm.radio == 'ONLINE') {
+          onlineClassesNum = parseInt(onlineClassesNum) + parseInt(this.giveNum)
+        } else if (this.centerForm.radio == 'OFFLINE') {
+          offlineClassesNum = parseInt(offlineClassesNum) + parseInt(this.giveNum)
+        }
+      }
+      getVipGroupCostCount({ vipGroupActivityId, onlineClassesUnitPrice, vipGroupCategoryId, offlineClassesUnitPrice, onlineClassesNum, offlineClassesNum, userId, giveTeachMode }).then(res => {
+        if (res.code == 200) {
+          this.rightForm.onlineCourse = res.data.onlineTeacherSalary;
+          this.rightForm.offlineCourse = res.data.offlineTeacherSalary;
+          this.rightForm.allPrice = res.data.totalPrice;
+        }
+      })
+
+    },
+    submitInfo () {
+      let online = parseInt(this.centerForm.onlineCourseNum);
+      let offline = parseInt(this.centerForm.offlineCourseNum);
+
+      let giveNum = this.giveNum;
+      let giveClassType = this.centerForm.radio;
+      if (giveClassType == 'ONLINE') {
+        // 线上
+        online += giveNum;
+      } else if (giveClassType == 'OFFLINE') {
+        offline += giveNum;
+      }
+      let obj = {};
+      obj.courseSchedules = this.timeTable;
+      /**
+       * 
+       * teacher: '',
+        subject: '',
+        courseType: '',
+        activeType: '',
+        classNum: '',
+        classTime: '',
+        signUpStart: '',
+        signUpEnd: '',
+        courseStart: '',
+        courseEnd: ''
+       */
+      obj.vipGroupApplyBaseInfo = {
+        coursesExpireDate: this.leftForm.courseEnd,
+        name: this.leftForm.name,
+        offlineClassesNum: offline,
+        onlineClassesNum: online,
+        offlineClassesUnitPrice: this.rightForm.offlinePrice,
+        onlineClassesUnitPrice: this.rightForm.onlinePrice,
+        paymentExpireDate: this.leftForm.signUpEnd,
+        registrationStartTime: this.leftForm.signUpStart,
+        singleClassMinutes: this.leftForm.classTime,
+        studentNum: this.leftForm.classNum,
+        userId: this.leftForm.teacher,
+        vipGroupActivityId: this.leftForm.activeType,
+        vipGroupCategoryId: this.leftForm.courseType,
+        onlineTeacherSalary: this.rightForm.onlineCourse,
+        offlineTeacherSalary: this.rightForm.offlineCourse,
+        giveTeachMode: this.centerForm.radio,
+        subjectIdList: this.leftForm.subject,
+      }
+      createVip(obj).then(res => { })
     }
   },
 }

+ 23 - 5
src/views/vipClass/vipDetail/components/teacherRecord.vue

@@ -21,10 +21,13 @@
     </div>
     <!-- 搜索标题 -->
     <el-form :inline="true"
+             label-position="right"
+             label-width="120px"
              class="searchForm"
              v-model="searchForm">
       <el-form-item>
         <el-select v-model="searchForm.type"
+                   clearable
                    placeholder="课程类型">
           <el-option label="线上课"
                      value="ONLINE"></el-option>
@@ -34,6 +37,7 @@
       </el-form-item>
       <el-form-item>
         <el-select v-model="searchForm.status"
+                   clearable
                    placeholder="课程状态">
           <el-option label="未开始"
                      value="NOT_START"></el-option>
@@ -47,6 +51,7 @@
         <el-date-picker v-model="searchForm.time"
                         style="width:400px"
                         type="daterange"
+                        value-format="yyyy-MM-dd"
                         range-separator="至"
                         start-placeholder="开始日期"
                         end-placeholder="结束日期">
@@ -184,7 +189,7 @@ export default {
       searchForm: {
         type: '',
         status: '',
-        timer: []
+        time: []
       },
       searchLsit: [],
       tableList: [],
@@ -227,14 +232,27 @@ export default {
 
   }, methods: {
     getList () {
-      findVipGroupTeachingRecord({
+      let startTime;
+      let endTime;
+      if (this.searchForm.time) {
+        startTime = this.searchForm.time[0]
+        endTime = this.searchForm.time[1]
+      } else {
+        startTime = '';
+        endTime = '';
+      }
+      let obj = {
         vipGroupId: this.id,
         page: this.rules.page,
         rows: this.rules.limit,
-        startTime: this.searchForm.startTime,
-        endTime: this.searchForm.endTime,
         status: this.searchForm.status,
-        teachMode: this.searchForm.type      }).then(res => {
+        teachMode: this.searchForm.type,
+        startTime,
+        endTime
+      }
+
+
+      findVipGroupTeachingRecord(obj).then(res => {
         if (res.code == 200) {
           this.complaintsNum = res.data.baseInfo.complaintsNum;
           this.currentClassTimes = res.data.baseInfo.currentClassTimes;