浏览代码

vip修改

1
mo 4 年之前
父节点
当前提交
313ca82075

+ 5 - 5
src/api/vipSeting.js

@@ -220,7 +220,7 @@ export function getVipGroupCostCount (data) {
   return request({
     url: api + '/vipGroupManage/getVipGroupCostCount',
     method: 'POST',
-    params: data
+    data: data
   })
 }
 
@@ -310,8 +310,8 @@ export function getHaveCourseBalanceStudents (data) {
 export function addVipGroupStudents (data) {
   return request({
     url: api + '/vipGroupManage/addVipGroupStudents',
-    method: 'get',
-    params: data
+    method: 'post',
+    data
   })
 }
 // /courseSchedule/batchAppendVipGroupCourses
@@ -324,7 +324,7 @@ export function batchAppendVipGroupCourses (data) {
   })
 }
 
-// vip休学 
+// vip休学
 export function vipPauseForStudent (data) {
   return request({
     url: api + '/vipGroupManage/pauseForStudent',
@@ -384,4 +384,4 @@ export function vipGroupManageUpdate (data) {
     method: 'post',
     data: qs.stringify(data)
   })
-}
+}

+ 314 - 168
src/views/buildVip/index.vue

@@ -6,9 +6,15 @@
     </h2>
     <div class="m-core">
       <div class="vipLeft">
-        <h4>课程信息</h4>
+        <el-alert
+          title="课程信息"
+          type="info"
+          :closable="false"
+          class="vipMsg"
+        ></el-alert>
         <el-form
           ref="leftForm"
+          :inline="true"
           :rules="leftFormRules"
           :label-position="labelPosition"
           label-width="110px"
@@ -49,13 +55,14 @@
               />
             </el-select>
           </el-form-item>
-          <!--      @change="setSection($event)" -->
+          <!--       -->
           <el-form-item label="指导老师" prop="teacher">
             <el-select
               v-model.trim="leftForm.teacher"
               filterable
               clearable
               :disabled="!leftForm.subject"
+              @change="setSection($event)"
             >
               <el-option
                 v-for="(item, index) in teacherList"
@@ -112,34 +119,6 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="上课学员" prop="students">
-            <el-select
-              v-model.trim="leftForm.students"
-              multiple
-              clearable
-              placeholder="请输入上课学员"
-              remote
-              reserve-keyword
-              filterable
-              :multiple-limit="studentLimit"
-              :disabled="!leftForm.classOrganId || !leftForm.courseType"
-              :remote-method="remoteMethod"
-              :loading="remoteLoading"
-            >
-              <el-option
-                v-for="item in studentList"
-                :key="item.userId"
-                :label="item.username"
-                :value="item.userId"
-              >
-                <span style="float: left">{{ item.username }}</span>
-                <span style="float: right; color: #8492a6; font-size: 13px">{{
-                  item.parentsPhone
-                }}</span>
-              </el-option>
-            </el-select>
-          </el-form-item>
-
           <el-form-item label="活动方案" prop="activeType">
             <el-select
               v-model.trim="leftForm.activeType"
@@ -156,19 +135,7 @@
               />
             </el-select>
           </el-form-item>
-
-          <!-- <el-form-item label="每班人数">
-            <el-input
-              type="number"
-              @mousewheel.native.prevent
-              v-model.trim="leftForm.classNum"
-              disabled
-            />
-          </el-form-item> -->
           <el-form-item label="每课时长">
-            <!-- <el-input type="number"
-                      v-model.trim="leftForm.classTime"
-            disabled />-->
             <el-select
               v-model.trim="leftForm.classTime"
               :disabled="timeTable.length > 0"
@@ -181,11 +148,8 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item
-            label="
-                       报名开始时间"
-            prop="signUpStart"
-          >
+
+          <el-form-item label="报名开始时间" prop="signUpStart">
             <!-- @change="changeStartTime" -->
             <el-date-picker
               v-model.trim="leftForm.signUpStart"
@@ -194,6 +158,14 @@
               value-format="yyyy-MM-dd HH:mm:ss"
               placeholder="请选择时间"
             />
+            <!-- <el-date-picker
+              v-model="leftForm.signTimer"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            >
+            </el-date-picker> -->
           </el-form-item>
           <el-form-item label="报名结束时间" prop="signUpEnd">
             <el-date-picker
@@ -204,6 +176,49 @@
               placeholder="请选择时间"
             />
           </el-form-item>
+          <el-form-item label="上课学员" prop="students">
+            <el-select
+              v-model.trim="leftForm.students"
+              multiple
+              clearable
+              placeholder="请输入上课学员"
+              remote
+              reserve-keyword
+              @change="changeStudent"
+              filterable
+              :multiple-limit="studentLimit"
+              :disabled="!leftForm.classOrganId || !leftForm.courseType"
+              :remote-method="remoteMethod"
+              :loading="remoteLoading"
+            >
+              <el-option
+                v-for="item in studentList"
+                :key="item.userId"
+                :label="item.username"
+                :value="item.userId"
+              >
+                <span style="float: left">{{ item.username }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{
+                  item.parentsPhone
+                }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="center">
+        <el-alert
+          title="排课设置"
+          type="info"
+          :closable="false"
+          class="vipMsg"
+        ></el-alert>
+        <el-form
+          :inline="true"
+          :model="centerForm"
+          label-width="100px"
+          :label-position="labelPosition"
+        >
           <el-form-item v-if="leftForm.courseStart" label="最早排课时间">
             <el-date-picker
               v-model.trim="leftForm.courseStart"
@@ -222,15 +237,6 @@
               placeholder="请选择时间"
             />
           </el-form-item>
-        </el-form>
-      </div>
-      <div class="center">
-        <h4>排课设置</h4>
-        <el-form
-          :model="centerForm"
-          label-width="100px"
-          :label-position="labelPosition"
-        >
           <el-form-item v-if="hasOnline" label="线上课数">
             <el-input
               v-model.trim="centerForm.onlineCourseNum"
@@ -259,23 +265,60 @@
               >线下课</el-radio
             >
           </el-form-item>
+          <el-form-item label="">
+            <el-button type="danger" @click="setCourse">点击排课</el-button>
+          </el-form-item>
         </el-form>
-        <!-- 排课列表开始 -->
-        <div class="planList">
-          <div class="planTop">
+        <!-- 排课列表开始 planList-->
+        <div class="">
+          <!-- <div class="planTop">
             <p>已排课程</p>
             <el-button type="text" @click="setCourse">{{
               id ? "新增排课" : "点击排课"
             }}</el-button>
-          </div>
-          <div class="planCore">
-            <div class="row">
+          </div> -->
+          <!-- <div class="planCore"> -->
+          <el-table
+            style="width: 100%"
+            :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            :data="timeTable"
+          >
+            <el-table-column align="center" prop="studentId" label="课程时间">
+              <template slot-scope="scope">
+                <div>{{ scope.row.classDate | formatTimer }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="studentId"
+              label="课程开始时间"
+            >
+              <template slot-scope="scope">
+                <div>{{ scope.row.startClassTimeStr }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="studentId"
+              label="课程结束时间"
+            >
+              <template slot-scope="scope">
+                <div>{{ scope.row.endClassTimeStr }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="studentId" label="课程类型">
+              <template slot-scope="scope">
+                <div>{{ scope.row.teachMode | teachMode }}</div>
+              </template>
+            </el-table-column>
+          </el-table>
+          <!-- <div class="row">
               <div class="name">时间</div>
               <div class="week">开始时间</div>
               <div class="time">结束时间</div>
               <div class="time">课程类型</div>
-            </div>
-            <div
+            </div> -->
+          <!-- <div
               v-for="(item, index) in this.timeTable"
               :key="index"
               class="row"
@@ -284,16 +327,22 @@
               <div class="week">{{ item.startClassTimeStr }}</div>
               <div class="time">{{ item.endClassTimeStr }}</div>
               <div class="time">{{ item.teachMode | teachMode }}</div>
-            </div>
-          </div>
+            </div> -->
+          <!-- </div> -->
         </div>
       </div>
       <div class="right">
-        <h4>课酬设置</h4>
+        <el-alert
+          title="课酬&缴费设置"
+          type="info"
+          :closable="false"
+          class="vipMsg"
+        ></el-alert>
         <el-form
           :model="rightForm"
           label-width="100px"
           :label-position="labelPosition"
+          :inline="true"
         >
           <el-form-item v-if="hasOnline" label="线上课课酬">
             <el-input v-model.trim="rightForm.onlineCourse" :disabled="true" />
@@ -303,7 +352,7 @@
             <el-input v-model.trim="rightForm.offlineCourse" :disabled="true" />
             <!--  || offlineSalary!='TEACHER_DEFAULT' salaryReadonlyFlag==0 -->
           </el-form-item>
-          <el-form-item v-if="hasOnline" label="线上课单价">
+          <!-- <el-form-item v-if="hasOnline" label="线上课单价">
             <el-input
               v-model.trim="rightForm.onlinePrice"
               :disabled="paymentReadonlyFlag == 0"
@@ -314,14 +363,75 @@
               v-model.trim="rightForm.offlinePrice"
               :disabled="paymentReadonlyFlag == 0"
             />
-          </el-form-item>
-          <el-form-item label="课程总价">
+          </el-form-item> -->
+          <!-- <el-form-item label="课程总价">
             <el-input v-model.trim="rightForm.allPrice" disabled />
+          </el-form-item> -->
+          <el-form-item>
+            <el-button type="primary" @click="computational">计算</el-button>
           </el-form-item>
         </el-form>
-        <el-button type="primary" style="float: right" @click="computational"
-          >计算</el-button
-        >
+        <div style="width: 700px">
+          <el-table
+            :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            :data="activeStudentList"
+          >
+            <el-table-column align="center" prop="studentId" label="学员编号">
+            </el-table-column>
+            <el-table-column align="center" prop="userName" label="学员名称">
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="studentId"
+              v-if="hasOnline"
+              label="线上课单价"
+            >
+              <template slot-scope="scope">
+                <el-input-number
+                  size="mini"
+                  style="width: 90% !important"
+                  class="number-input"
+                  v-model="scope.row.onlineClassesUnitPrice"
+                  :controls="false"
+                  :min="0"
+                  placeholder="线上课单价"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="studentId"
+              v-if="hasOffline"
+              label="线下课单价"
+            >
+              <template slot-scope="scope">
+                <el-input-number
+                  size="mini"
+                  style="width: 90% !important"
+                  class="number-input"
+                  v-model="scope.row.offlineClassesUnitPrice"
+                  :controls="false"
+                  :min="0"
+                  placeholder="线下课单价"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="studentId" label="缴费总额">
+              <template slot-scope="scope">
+                <el-input-number
+                  size="mini"
+                  style="width: 90% !important"
+                  class="number-input"
+                  v-model="scope.row.paymentPrice"
+                  :controls="false"
+                  :min="0"
+                  :disabled="true"
+                  placeholder="缴费总额"
+                />
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
       </div>
     </div>
     <!-- 弹窗 -->
@@ -471,18 +581,20 @@ export default {
         activeType: "",
         classNum: "",
         classTime: "",
+        // signTimer:[],
         signUpStart: "",
         signUpEnd: "",
         courseStartOnline: "",
         courseStartOffline: "",
-        courseEnd: "",
         section: "",
         courseStart: "",
         courseEnd: "",
         educationalTeacherId: "",
         students: [],
+
         classOrganId: "", // 课程分部
       },
+      activeStudentList: [],
       studentLimit: 0,
       classTimeList: [],
       centerForm: {
@@ -512,8 +624,8 @@ export default {
       // classOrganList: [], // 公用分部
       courseTypeList: [], // 课程类型集合
       activeList: [], //活动集合
-      hasOnline: false,
-      hasOffline: false,
+      hasOnline: true,
+      hasOffline: true,
       onlineSalary: "", // 线上课课酬结算方式
       offlineSalary: "", // 线下课课酬结算方式
       hotType: "",
@@ -597,13 +709,13 @@ export default {
             trigger: "change",
           },
         ],
-        activeType: [
-          {
-            required: true,
-            message: "请选择活动",
-            trigger: "change",
-          },
-        ],
+        // activeType: [
+        //   {
+        //     required: true,
+        //     message: "请选择活动",
+        //     trigger: "change",
+        //   },
+        // ],
         signUpStart: [
           {
             required: true,
@@ -809,68 +921,74 @@ export default {
       this.attribute2 = "";
       this.giveNum = 0;
       this.isGiveClass = false;
-      // 重置课程单价
-      for (let i in this.courseTypeList) {
-        if (this.courseTypeList[i].id == this.leftForm.courseType) {
-          // 学生人数
-          this.leftForm.classNum = this.courseTypeList[i].studentNum;
-          // 每课时长
-          this.classTimeList = this.courseTypeList[i].singleClassMinutes.split(
-            ","
-          );
-          // this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
-          this.leftForm.classTime = this.classTimeList[0];
-          // 线上课单节价格
-          this.rightForm.onlinePrice = this.courseTypeList[
-            i
-          ].onlineClassesUnitPrice;
-          // 线下课单节价格
-          this.rightForm.offlinePrice = this.courseTypeList[
-            i
-          ].offlineClassesUnitPrice;
+      this.leftForm.courseStart = "";
+      this.leftForm.courseEnd = "";
+      this.hasOnline = true;
+      this.hasOffline = true;
+      if (val) {
+        for (let i in this.courseTypeList) {
+          if (this.courseTypeList[i].id == this.leftForm.courseType) {
+            // 学生人数
+            this.leftForm.classNum = this.courseTypeList[i].studentNum;
+            // 每课时长
+            this.classTimeList = this.courseTypeList[
+              i
+            ].singleClassMinutes.split(",");
+            // this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
+            this.leftForm.classTime = this.classTimeList[0];
+            // 线上课单节价格
+            this.rightForm.onlinePrice = this.courseTypeList[
+              i
+            ].onlineClassesUnitPrice;
+            // 线下课单节价格
+            this.rightForm.offlinePrice = this.courseTypeList[
+              i
+            ].offlineClassesUnitPrice;
+          }
         }
-      }
-      // 根须活动id获取 相应的值
-      for (let i in this.activeList) {
-        if (this.activeList[i].id == val) {
-          // 如果是买赠就必须选择赠课类型
-          // 报名开始 报名结束 课程开始 课程结束 // 判断是否有线上,线下课 并同步状态
-          // 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.hotType = this.activeList[i].type;
-          // 获取买赠必要参数
-          this.attribute1 = this.activeList[i].attribute1;
-          this.attribute2 = this.activeList[i].attribute2;
-          // 存储课酬是否可配置
-          this.salaryReadonlyFlag = this.activeList[i].salaryReadonlyFlag;
-          this.paymentReadonlyFlag = this.activeList[i].paymentReadonlyFlag;
-          //  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;
+        // 根须活动id获取 相应的值
+        for (let i in this.activeList) {
+          if (this.activeList[i].id == val) {
+            // 如果是买赠就必须选择赠课类型
+            // 报名开始 报名结束 课程开始 课程结束 // 判断是否有线上,线下课 并同步状态
+            // 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.hotType = this.activeList[i].type;
+            // 获取买赠必要参数
+            this.attribute1 = this.activeList[i].attribute1;
+            this.attribute2 = this.activeList[i].attribute2;
+            // 存储课酬是否可配置
+            this.salaryReadonlyFlag = this.activeList[i].salaryReadonlyFlag;
+            this.paymentReadonlyFlag = this.activeList[i].paymentReadonlyFlag;
+            //  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;
+              }
             }
           }
         }
       }
+      // 重置课程单价
     },
     // 点击确插入课表
     addWeek() {
@@ -1192,11 +1310,17 @@ export default {
         userId,
         giveTeachMode,
         singleClassMinutes,
+        vipGroupStudentCoursePrices: this.activeStudentList,
       }).then((res) => {
         if (res.code == 200) {
           this.rightForm.onlineCourse = res.data.onlineTeacherSalary;
           this.rightForm.offlineCourse = res.data.offlineTeacherSalary;
           this.rightForm.allPrice = res.data.totalPrice;
+          this.activeStudentList.forEach((stu) => {
+            if (res.data.hasOwnProperty(stu.studentId)) {
+              stu.paymentPrice = res.data[stu.studentId];
+            }
+          });
         }
       });
     },
@@ -1214,7 +1338,7 @@ export default {
         this.$message.error("请点击计算按钮计算课酬");
         return;
       }
-      if (this.leftForm.students.length !== this.studentLimit) {
+      if (this.leftForm.students.length > this.studentLimit) {
         this.$message.error(`请选择上课学生为${this.studentLimit}人`);
         return;
       }
@@ -1248,6 +1372,7 @@ export default {
       let studentIdList = this.leftForm.students.join(",") || null;
       obj.vipGroupApplyBaseInfo = {
         studentIdList, // 这个不要了
+        vipGroupStudentCoursePrices:this.activeStudentList,
         coursesExpireDate: this.leftForm.courseEnd,
         teacherSchoolId: this.leftForm.section,
         // name: this.leftForm.name,
@@ -1341,7 +1466,7 @@ export default {
       //     );
       //   }
       // }
-      this.getClassOrgan(); // 获取公用部分
+      // this.getClassOrgan(); // 获取公用部分
     },
     // getClassOrgan() {
     //   // 获取公用分部
@@ -1378,7 +1503,10 @@ export default {
       this.leftForm.teacherId = "";
       this.leftForm.educationalTeacherId = "";
       this.courseTypeList = [];
-      this.$set(this.leftForm, "courseType", null);
+      if (this.leftForm.courseType) {
+        this.$set(this.leftForm, "courseType", null);
+      }
+
       // this.leftForm.courseType = null;
       if (val) {
         vipGroupCategory({
@@ -1428,7 +1556,7 @@ export default {
       this.changeSubject(parseInt(data.subjectIdList));
       // 设置老师
       this.leftForm.teacher = data.userId;
-      // this.setSection(data.userId);
+      this.setSection(data.userId);
       // 课程形式
       this.leftForm.courseType = data.vipGroupCategoryId;
       // 获取课程形式下的活动方案
@@ -1506,6 +1634,21 @@ export default {
         // });
       }
     },
+    changeStudent(val) {
+      console.log(val, this.studentList);
+      this.activeStudentList = [];
+      this.studentList.forEach((stu) => {
+        if (val.indexOf(stu.userId) != -1) {
+          this.activeStudentList.push({
+            studentId: stu.userId,
+            userName: stu.username,
+            onlineClassesUnitPrice: this.rightForm.onlinePrice,
+            offlineClassesUnitPrice: this.rightForm.offlinePrice,
+            paymentPrice: "",
+          });
+        }
+      });
+    },
     // 制定属性去重
     deweight(arr, key) {
       let res = [];
@@ -1549,9 +1692,9 @@ export default {
 <style lang="scss" scoped>
 .m-core {
   margin-top: 30px;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-around;
+  // display: flex;
+  // flex-direction: row;
+  // justify-content: space-around;
 
   .el-input {
     width: 180px;
@@ -1561,36 +1704,39 @@ export default {
     font-size: 16px;
     background-color: #ccc;
     color: #fff;
-    text-align: center;
+    // text-align: center;
     width: 100%;
     height: 40px;
     line-height: 40px;
     margin-bottom: 20px;
+    padding: 0 20px;
   }
 
-  .vipLeft {
-    width: 400px;
-    // h4 {
-    //   font-size: 16px;
-    //   background-color: #ccc;
-    //   color: #fff;
-    //   text-align: center;
-    //   width: 100%;
-    //   height: 40px;
-    //   line-height: 40px;
-    //   margin-bottom: 20px;
-    // }
-  }
+  // .vipLeft {
+  //   width: 400px;
+  //   // h4 {
+  //   //   font-size: 16px;
+  //   //   background-color: #ccc;
+  //   //   color: #fff;
+  //   //   text-align: center;
+  //   //   width: 100%;
+  //   //   height: 40px;
+  //   //   line-height: 40px;
+  //   //   margin-bottom: 20px;
+  //   // }
+  // }
 
-  .center {
-    width: 400px;
-  }
+  // .center {
+  //   width: 400px;
+  // }
 
-  .right {
-    width: 400px;
-  }
+  // .right {
+  //   width: 400px;
+  // }
+}
+.vipMsg {
+  margin-bottom: 20px;
 }
-
 .planList {
   padding: 0 25px;
 

+ 40 - 5
src/views/categroyManager/generalSettings/vipCourseType.vue

@@ -12,10 +12,18 @@
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
     >
       <el-table-column label="课程形式" prop="name"> </el-table-column>
+      <el-table-column label="课程类型" prop="singleClassMinutes">
+        <template slot-scope="scope">
+          <div>
+            {{ scope.row.musicTheory ? "乐理课" : "VIP课" }}
+          </div>
+        </template>
+      </el-table-column>
       <el-table-column label="班级人数(人)" prop="studentNum">
       </el-table-column>
       <el-table-column label="课程课时(分钟)" prop="singleClassMinutes">
       </el-table-column>
+
       <el-table-column label="操作">
         <template slot-scope="scope">
           <div>
@@ -75,10 +83,29 @@
           ></el-input>
         </el-form-item>
         <el-form-item
+          label="课程类型"
+          :rules="[
+            { required: true, message: '请输入课程形式', trigger: 'blur' },
+          ]"
+          :label-width="formLabelWidth"
+          prop="musicTheory"
+        >
+        <el-select v-model="vipStatusFrom.musicTheory" style="width:100%!important">
+          <el-option label="VIP" :value="false"></el-option>
+          <el-option label="乐理课" :value="true"></el-option>
+        </el-select>
+        </el-form-item>
+        <el-form-item
           label="班级人数"
           prop="num"
           :rules="[
             { required: true, message: '请输入班级人数', trigger: 'blur' },
+            {
+              required: true,
+              message: '班级人数最大6人',
+              trigger: 'blur',
+              pattern: /^[0-6]$/,
+            }, //辜经理要求vip人数最大6人
           ]"
           :label-width="formLabelWidth"
         >
@@ -147,20 +174,25 @@
   </div>
 </template>
 <script>
-import { removeVipGroupCategory, vipGroupCategory, addVipGroupCategory,
-  resetVipGroupCategory, } from "@/api/vipSeting";
+import {
+  removeVipGroupCategory,
+  vipGroupCategory,
+  addVipGroupCategory,
+  resetVipGroupCategory,
+} from "@/api/vipSeting";
 export default {
   data() {
     return {
       leftList: [],
       vipStatus: false, // 课程形态弹窗状态
       formLabelWidth: "120px",
-      inputValue:'',
+      inputValue: "",
       vipStatusFrom: {
         name: "",
         num: "",
         dynamicTags: [],
         isAdd: true,
+        musicTheory:false,
         id: "",
       }, // 弹窗内容
       inputVisible: false,
@@ -181,6 +213,7 @@ export default {
         vipStatusFrom.num = row.studentNum;
         vipStatusFrom.id = row.id;
         vipStatusFrom.isAdd = false;
+        vipStatusFrom.musicTheory = row.musicTheory
       });
     },
     async removeGroupCategory(scope) {
@@ -188,7 +221,7 @@ export default {
         id: scope.row.id,
       }).then((res) => {
         if (res.code == 200) {
-            scope._self.$refs[scope.row.id].doClose()
+          scope._self.$refs[scope.row.id].doClose();
           this.$message.success("删除成功");
           this.getVipGroupCategoryList();
         }
@@ -230,6 +263,7 @@ export default {
               name: vipStatusFrom.name,
               singleClassMinutes: vipStatusFrom.dynamicTags.join(","),
               studentNum: vipStatusFrom.num,
+              musicTheory:vipStatusFrom.musicTheory
             }).then((res) => {
               if (res.code == 200) {
                 this.$message.success("添加成功");
@@ -243,6 +277,7 @@ export default {
               singleClassMinutes: vipStatusFrom.dynamicTags.join(","),
               studentNum: vipStatusFrom.num,
               id: vipStatusFrom.id,
+               musicTheory:vipStatusFrom.musicTheory
             }).then((res) => {
               this.$message.success("修改成功");
               this.getVipGroupCategoryList();
@@ -270,4 +305,4 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
-</style>
+</style>

+ 92 - 99
src/views/vipClass/vipDetail/components/vipBaseInfo.vue

@@ -1,86 +1,76 @@
 <template>
   <div class="vip-base">
     <div class="left">
-      <el-form label-position="right"
-               label-width="120px"
-               :model="topForm">
+      <el-form label-position="right" label-width="120px" :model="topForm">
         <el-form-item label="指导老师">
-          <el-input v-model.trim="topForm.teacherCount"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.teacherCount" disabled></el-input>
         </el-form-item>
         <el-form-item label="乐团主管">
-          <el-input v-model.trim="topForm.educationalTeacherName"
-                    disabled></el-input>
+          <el-input
+            v-model.trim="topForm.educationalTeacherName"
+            disabled
+          ></el-input>
         </el-form-item>
         <el-form-item label="科目名称">
-          <el-input v-model.trim="topForm.subject"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.subject" disabled></el-input>
         </el-form-item>
         <el-form-item label="活动方案">
-          <el-input v-model.trim="topForm.active"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.active" disabled></el-input>
         </el-form-item>
         <el-form-item label="课程形式">
-          <el-input v-model.trim="topForm.status"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.status" disabled></el-input>
         </el-form-item>
         <el-form-item label="每班人数">
-          <el-input v-model.trim="topForm.classNum"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.classNum" disabled></el-input>
         </el-form-item>
         <el-form-item label="每课时长">
-          <el-input v-model.trim="topForm.classTime"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.classTime" disabled></el-input>
         </el-form-item>
         <el-form-item label="教学点名称">
-          <el-input v-model.trim="topForm.address"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.address" disabled></el-input>
         </el-form-item>
         <el-form-item label="线上课数">
-          <el-input v-model.trim="topForm.onlineClass"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.onlineClass" disabled></el-input>
         </el-form-item>
         <el-form-item label="线下课数">
-          <el-input v-model.trim="topForm.offlineClass"
-                    disabled></el-input>
+          <el-input v-model.trim="topForm.offlineClass" disabled></el-input>
         </el-form-item>
         <el-form-item label="报名开始时间">
-          <div class="disBox">{{topForm.startTime | dateForMinFormat}}</div>
+          <div class="disBox">{{ topForm.startTime | dateForMinFormat }}</div>
           <!-- <el-input v-model.trim="topForm.startTime" disabled></el-input> -->
         </el-form-item>
         <el-form-item label="报名结束时间">
-          <div class="disBox">{{topForm.endTime | dateForMinFormat}}</div>
+          <div class="disBox">{{ topForm.endTime | dateForMinFormat }}</div>
           <!-- <el-input v-model.trim="topForm.endTime" disabled></el-input> -->
         </el-form-item>
       </el-form>
     </div>
     <div class="right">
-      <el-form label-position="right"
-               label-width="120px"
-               :model="rightForm">
+      <el-form label-position="right" label-width="120px" :model="rightForm">
         <el-form-item label="总课时数">
-          <el-input v-model.trim="rightForm.allClass"
-                    disabled></el-input>
+          <el-input v-model.trim="rightForm.allClass" disabled></el-input>
         </el-form-item>
         <el-form-item label="课程单价(线上)">
-          <el-input v-model.trim="rightForm.onlineClass"
-                    type="number"
-                    @mousewheel.native.prevent
-                    :disabled="!isreset"></el-input>
+          <el-input
+            v-model.trim="rightForm.onlineClass"
+            type="number"
+            @mousewheel.native.prevent
+            :disabled="!isreset"
+          ></el-input>
         </el-form-item>
         <el-form-item label="课程单价(线下)">
-          <el-input v-model.trim="rightForm.offlineClass"
-                    type="number"
-                    @mousewheel.native.prevent
-                    :disabled="!isreset"></el-input>
+          <el-input
+            v-model.trim="rightForm.offlineClass"
+            type="number"
+            @mousewheel.native.prevent
+            :disabled="!isreset"
+          ></el-input>
         </el-form-item>
         <el-form-item label="课程总价">
-          <el-input v-model.trim="rightForm.allPrice"
-                    disabled></el-input>
+          <el-input v-model.trim="rightForm.allPrice" disabled></el-input>
         </el-form-item>
         <el-form-item label="当前课程进度">
-          <el-input v-model.trim="rightForm.progress"
-                    disabled></el-input>
+          <el-input v-model.trim="rightForm.progress" disabled></el-input>
         </el-form-item>
       </el-form>
       <!-- <el-button v-if="!isreset"
@@ -101,10 +91,11 @@ import {
   getVipGroupDetail,
   findVipGroupStudents,
   leaveSchool,
-  updateVipBaseInfo
+  updateVipBaseInfo,
 } from "@/api/vipSeting";
 export default {
-  data () {
+  props: ["vipDetail"],
+  data() {
     return {
       topForm: {
         teacherCount: "",
@@ -117,38 +108,37 @@ export default {
         onlineClass: "", //线上课数
         offlineClass: "", //线下课数
         startTime: "", // 报名开始时间
-        endTime: ""
+        endTime: "",
       },
       rightForm: {
         allClass: "",
         onlineClass: "",
         offlineClass: "",
         allPrice: "",
-        progress: ""
+        progress: "",
       },
       tableList: [],
-      isreset: false
+      isreset: false,
     };
   },
-  mounted () {
-    this.__init();
-  },
-  activated () {
+  mounted() {
     this.__init();
   },
   methods: {
-    __init () {
-      let id = this.$route.query.id;
-      this.id = id;
+    __init() {
+      // let id = this.$route.query.id;
+      // this.id = id;
       // 根据id 获取vip详情
-      this.getVipGroupDetail(id);
+
       // 根据id 获取vip学员
       this.getStudents();
+      this.getVipGroupDetail()
     },
-    getVipGroupDetail (id) {
-      getVipGroupDetail({ vipGroupId: id }).then(res => {
-        if (res.code == 200) {
-          /**
+    getVipGroupDetail() {
+      let id = this.$route.query.id;
+        getVipGroupDetail({ vipGroupId: id }).then((res) => {
+          if (res.code == 200) {
+            /**
            *  teacherCount: '',
           subject: '', // 科目名称
           active: '', // 活动名称
@@ -161,49 +151,44 @@ export default {
           startTime: '', // 报名开始时间
            *
            */
-          this.topForm.teacherCount = res.data.userName;
-          this.topForm.educationalTeacherName = res.data.educationalTeacherName
-          this.topForm.subject = res.data.subjectName; //科目名称
-          this.topForm.active = res.data.vipGroupActivityName;
-          this.topForm.status = res.data.categoryName;
-          this.topForm.classNum = res.data.studentNum;
+            this.topForm.teacherCount = res.data.userName;
+            this.topForm.educationalTeacherName =
+              res.data.educationalTeacherName;
+            this.topForm.subject = res.data.subjectName; //科目名称
+            this.topForm.active = res.data.vipGroupActivityName;
+            this.topForm.status = res.data.categoryName;
+            this.topForm.classNum = res.data.studentNum;
 
-          // totalClassTimes; 总课时数
-          this.topForm.classTime = res.data.singleClassMinutes;
-          //  教学点
-          this.topForm.address = res.data.teacherSchoolName;
-          this.topForm.onlineClass = res.data.onlineClassesNum;
-          this.topForm.offlineClass = res.data.offlineClassesNum;
-          // endTime
-          this.topForm.startTime = res.data.registrationStartTime;
-          this.topForm.endTime = res.data.paymentExpireDate;
-          this.rightForm.allClass = res.data.totalClassTimes;
-          this.rightForm.onlineClass = res.data.onlineClassesUnitPrice;
-          this.rightForm.offlineClass = res.data.offlineClassesUnitPrice;
-          this.rightForm.allPrice = res.data.totalPrice;
-          this.rightForm.progress =
-            res.data.currentClassTimes + "/" + res.data.totalClassTimes;
-          /**
-           * allClass: '',
-          onlineClass: '',
-          offlineClass: '',
-          allPrice: '',
-          progress: ''
-           */
-        }
-      });
+            // totalClassTimes; 总课时数
+            this.topForm.classTime = res.data.singleClassMinutes;
+            //  教学点
+            this.topForm.address = res.data.teacherSchoolName;
+            this.topForm.onlineClass = res.data.onlineClassesNum;
+            this.topForm.offlineClass = res.data.offlineClassesNum;
+            // endTime
+            this.topForm.startTime = res.data.registrationStartTime;
+            this.topForm.endTime = res.data.paymentExpireDate;
+            this.rightForm.allClass = res.data.totalClassTimes;
+            this.rightForm.onlineClass = res.data.onlineClassesUnitPrice;
+            this.rightForm.offlineClass = res.data.offlineClassesUnitPrice;
+            this.rightForm.allPrice = res.data.totalPrice;
+            this.rightForm.progress =
+              res.data.currentClassTimes + "/" + res.data.totalClassTimes;
+
+          }
+        });
     },
-    getStudents () {
-      findVipGroupStudents({ vipGroupId: this.id }).then(res => {
+    getStudents() {
+      findVipGroupStudents({ vipGroupId: this.id }).then((res) => {
         if (res.code == 200) {
           this.tableList = res.data.rows;
         }
       });
     },
-    leaveSchool (scope) {
+    leaveSchool(scope) {
       let studentId = scope.row.id;
       let vipGroupId = this.id;
-      leaveSchool({ studentId, vipGroupId }).then(res => {
+      leaveSchool({ studentId, vipGroupId }).then((res) => {
         if (res.code == 200) {
           this.$message.success("退学成功");
           scope._self.$refs[scope.$index].doClose();
@@ -211,10 +196,10 @@ export default {
         }
       });
     },
-    resetPrice () {
+    resetPrice() {
       this.isreset = true;
     },
-    submitBtn () {
+    submitBtn() {
       // 提交
       /**
        * this.rightForm.onlineClass = res.data.onlineClassesUnitPrice;
@@ -225,15 +210,23 @@ export default {
       updateVipBaseInfo({
         id: this.id,
         onlineClassesUnitPrice,
-        offlineClassesUnitPrice
-      }).then(res => {
+        offlineClassesUnitPrice,
+      }).then((res) => {
         if (res.code == 200) {
           this.$message.success("修改成功");
           this.isreset = false;
-          this.getVipGroupDetail(this.id);
+          this.$emit('getVipGroupDetail')
+          // this.getVipGroupDetail(this.id);
         }
       });
-    }
+    },
+  },
+  watch:{
+    // vipDetail(val){
+    //   if(val){
+    //     this.getVipGroupDetail();
+    //   }
+    // }
   }
 };
 </script>

+ 74 - 4
src/views/vipClass/vipDetail/components/vipStudentList.vue

@@ -8,7 +8,11 @@
       >
         新增学员
       </el-button>
-      <el-button v-permission="'vipGroupManage/update'" @click="expireVisible = true"  type="primary">
+      <el-button
+        v-permission="'vipGroupManage/update'"
+        @click="expireVisible = true"
+        type="primary"
+      >
         有效期调整
       </el-button>
     </div>
@@ -126,7 +130,49 @@
           label="手机号"
           width="200"
         ></el-table-column>
-        <el-table-column prop="courseSalary" label="课程余额"></el-table-column>
+        <el-table-column prop="courseSalary" label="课程余额" width="150">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.courseSalary | moneyFormat }}
+            </div>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="balance" label="账户余额">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.balance | moneyFormat }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="studentId" label="线上课单价">
+          <template slot-scope="scope">
+            <el-input-number
+              v-if="activeStudent == scope.row.id"
+              size="mini"
+              style="width: 90% !important"
+              class="number-input"
+              v-model="scope.row.onlineClassesUnitPrice"
+              :controls="false"
+              :min="0"
+              placeholder="线上课单价"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column prop="studentId" label="线下课单价">
+          <template slot-scope="scope">
+            <el-input-number
+              v-if="activeStudent == scope.row.id"
+              size="mini"
+              style="width: 90% !important"
+              class="number-input"
+              v-model="scope.row.offlineClassesUnitPrice"
+              :controls="false"
+              :min="0"
+              placeholder="线下课单价"
+            />
+          </template>
+        </el-table-column>
       </el-table>
       <pagination
         save-key="vipDetail-vipStudentList"
@@ -306,6 +352,7 @@ import {
   recoverForStudent,
   findTeacherWithVipGroupOrganAndSubject,
   vipGroupManageUpdate,
+  getVipGroupDetail
 } from "@/api/vipSeting";
 import { permission } from "@/utils/directivePage";
 export default {
@@ -381,6 +428,7 @@ export default {
         },
       },
       teacherList: [],
+      vipDetail:{}
     };
   },
   mounted() {
@@ -406,6 +454,11 @@ export default {
           }
         }
       );
+        getVipGroupDetail({ vipGroupId: id }).then((res) => {
+          if (res.code == 200) {
+            this.vipDetail = res.data
+          }
+        })
     },
     search() {
       this.rules.page = 1;
@@ -511,6 +564,10 @@ export default {
         if (res.code == 200) {
           this.rules.total = res.data.total;
           this.maskStudentList = res.data.rows;
+          this.maskStudentList.forEach(stu=>{
+            stu.offlineClassesUnitPrice = this.vipDetail?.offlineClassesUnitPrice
+            stu.onlineClassesUnitPrice =this.vipDetail?.onlineClassesUnitPrice
+          })
           this.maskVisible = true;
         }
       });
@@ -523,10 +580,23 @@ export default {
         this.$message.error("请选择一名学生");
         return;
       }
-      addVipGroupStudents({
+      let offlineClassesUnitPrice,onlineClassesUnitPrice;
+      this.maskStudentList.forEach(stu=>{
+        if(stu.id == this.activeStudent){
+          offlineClassesUnitPrice = stu.offlineClassesUnitPrice
+          onlineClassesUnitPrice = stu.onlineClassesUnitPrice
+        }
+      })
+      if(!offlineClassesUnitPrice || !onlineClassesUnitPrice){
+          this.$message.error("请填写线上课单价或线下课单价");
+        return
+      }
+      addVipGroupStudents([{
         vipGroupId: this.id,
         studentIds: this.activeStudent,
-      }).then((res) => {
+        onlineClassesUnitPrice,
+        offlineClassesUnitPrice
+      }]).then((res) => {
         if (res.code == 200) {
           this.$message.success("添加成功");
           this.getStudents();

+ 12 - 5
src/views/vipClass/vipDetail/index.vue

@@ -14,7 +14,7 @@
         lazy
                      v-if="permissionList.vipBase"
                      name="1">
-          <vipBase v-if="activeName == 1" />
+          <vipBase  />
         </el-tab-pane>
         <el-tab-pane label="教学记录"
                      v-if="permissionList.teacherRecord"
@@ -32,7 +32,7 @@
                      v-if="permissionList.vipStudentList"
                      lazy
                      name="4">
-          <vipStudentList v-if="activeName == 4" />
+          <vipStudentList v-if="activeName == 4"  :vipDetail='vipDetail'/>
         </el-tab-pane>
       </tab-router>
     </div>
@@ -44,6 +44,9 @@ import teacherRecord from '@/views/vipClass/vipDetail/components/teacherRecord'
 import fnanceInfo from '@/views/vipClass/vipDetail/components/fnanceInfo'
 import vipStudentList from '@/views/vipClass/vipDetail/components/vipStudentList'
 import { permission } from '@/utils/directivePage' // 权限
+import {
+  getVipGroupDetail,
+} from "@/api/vipSeting";
 export default {
   components: { teacherRecord, vipBase, fnanceInfo, vipStudentList },
   name: 'vipDetail',
@@ -53,6 +56,7 @@ export default {
       className: '',
       rules: null,
       searchForm: null,
+      vipDetail:null,
       permissionList: {
         vipBase: permission('/vipDetail/vipBase'),
         teacherRecord: permission('/vipDetail/teacherRecord'),
@@ -64,9 +68,6 @@ export default {
   mounted () {
     this.__init()
   },
-  activated () {
-    this.__init()
-  },
   methods: {
     __init () {
       let querys = this.$route.query
@@ -77,9 +78,15 @@ export default {
         this.searchForm = querys.searchForm
       }
       this.className = querys.name
+      // 获取vip基本信息
+        let id = this.$route.query.id;
+      // 根据id 获取vip详情
+
     },
+
     handleClick (val, event) {
       this.activeName = val.name;
+
     },
     onCancel () {
       this.$router.push({ path: '/business/vipList', query: { rules: this.rules, searchForm: this.searchForm } })

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

@@ -186,13 +186,13 @@
             prop="studentNum"
             label="班级人数"
           ></el-table-column>
-          <el-table-column align="center" label="课程单价">
+          <!-- <el-table-column align="center" label="课程单价">
             <template slot-scope="scope">
               <div>
                 <p>{{ scope.row.courseUnitPrice | moneyFormat }} 元</p>
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
             align="center"
             prop="vipGroupActivityName"