lex пре 2 година
родитељ
комит
f35b783a35

+ 9 - 9
src/api/vipSeting.js

@@ -149,8 +149,8 @@ export function removeVipActive(data) {
 export function getVipList(data) {
   return request({
     url: api + "/vipGroupManage/queryAll",
-    method: "GET",
-    params: data
+    method: "post",
+    data
   });
 }
 // 根据id获取vip详情
@@ -175,8 +175,8 @@ export function getVipGroupDetailForAudit(data) {
 export function findVipGroupStudents(data) {
   return request({
     url: api + "/vipGroupManage/findVipGroupStudents",
-    method: "GET",
-    params: data
+    method: "post",
+    data
   });
 }
 
@@ -193,8 +193,8 @@ export function leaveSchool(data) {
 export function findVipGroupTeachingRecord(data) {
   return request({
     url: api + "/vipGroupManage/findVipGroupTeachingRecord",
-    method: "get",
-    params: data
+    method: "post",
+    data
   });
 }
 
@@ -202,8 +202,8 @@ export function findVipGroupTeachingRecord(data) {
 export function getVipGroupSalarys(data) {
   return request({
     url: api + "/vipGroupManage/findVipGroupSalarys",
-    method: "get",
-    params: data
+    method: "post",
+    data
   });
 }
 
@@ -292,7 +292,7 @@ export function findVipGroupCourseSchedules(data) {
   return request({
     url: api + "/courseSchedule/findVipGroupCourseSchedules",
     method: "POST",
-    data: qs.stringify(data)
+    data
   });
 }
 

+ 5 - 0
src/views/baseRulesClassSetting/live-class-setting.vue

@@ -79,6 +79,11 @@
           ]"
         >
           <el-input
+            @input="
+              val => {
+                form.val = val.replace(/[^\d]/g, '');
+              }
+            "
             :disabled="!liveForm.isAdd"
             v-model.trim="liveForm.singleClassMinutes"
             placeholder="请输入课程课时"

+ 552 - 161
src/views/liveClassManager/createLiveClass.vue

@@ -4,7 +4,7 @@
       <el-page-header @back="onCancel" :content="name"></el-page-header>
     </h2>
     <div class="m-core">
-      <el-form ref="accountForm">
+      <el-form ref="liveForm" :model="form" label-position="top">
         <el-alert
           title="课程规划"
           :closable="false"
@@ -13,123 +13,294 @@
         />
         <el-row :gutter="20">
           <el-col :span="10">
-            <el-form-item label="直播课标题" prop="memberId">
+            <el-form-item
+              label="直播课标题"
+              prop="roomTitle"
+              :rules="[{ required: true, message: '请输入直播课标题' }]"
+            >
               <el-input
+                v-model="form.roomTitle"
                 placeholder="请输入直播课标题"
                 maxlength="25"
               ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="直播课内容" prop="name">
+            <el-form-item
+              label="直播课内容"
+              prop="liveRemark"
+              :rules="[{ required: true, message: '请输入直播课内容' }]"
+            >
               <el-input
                 type="textarea"
+                v-model="form.liveRemark"
                 placeholder="请输入直播课内容"
                 maxlength="200"
+                show-word-limit
               ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="分部" prop="name">
-              <el-input placeholder="请输入分部"></el-input>
+            <el-form-item
+              label="分部"
+              prop="organIds"
+              :rules="[{ required: true, message: '请选择分部' }]"
+            >
+              <select-all
+                v-model.trim="form.organIds"
+                filterable
+                placeholder="请选择分部"
+                multiple
+                clearable
+              >
+                <el-option
+                  v-for="(item, index) in selects.branchs"
+                  :key="index"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </select-all>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="声部" prop="name">
-              <el-input placeholder="请输入声部"></el-input>
+            <el-form-item
+              label="声部"
+              prop="subjectIdList"
+              :rules="[{ required: true, message: '请选择声部' }]"
+            >
+              <el-select
+                v-model.trim="form.subjectIdList"
+                filterable
+                clearable
+                @change="onChangeSubject"
+                placeholder="请选择声部"
+                style="width: 100% !important"
+              >
+                <el-option
+                  v-for="(item, index) in subjectList"
+                  :key="index"
+                  :value="item.id"
+                  :label="item.name"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="指导老师" prop="name">
-              <el-input placeholder="请输入指导老师"></el-input>
+            <el-form-item
+              label="指导老师"
+              prop="teacher"
+              :rules="[{ required: true, message: '请选择指导老师' }]"
+            >
+              <el-select
+                v-model.trim="form.teacher"
+                filterable
+                clearable
+                placeholder="请选择指导老师"
+                style="width: 100% !important"
+                :disabled="!form.subjectIdList"
+              >
+                <el-option
+                  v-for="(item, index) in teacherList"
+                  :key="index"
+                  :label="item.realName"
+                  :value="item.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="乐团主管" prop="name">
-              <el-input placeholder="请输入乐团主管"></el-input>
+            <el-form-item
+              label="乐团主管"
+              prop="educationalTeacherId"
+              :rules="[{ required: true, message: '请选择乐团主管' }]"
+            >
+              <el-select
+                v-model.trim="form.educationalTeacherId"
+                filterable
+                clearable
+                style="width: 100% !important"
+                :rules="[{ required: true, message: '请选择乐团主管' }]"
+              >
+                <el-option
+                  v-for="(item, key) in educationList"
+                  :key="key"
+                  :label="item.userName"
+                  :value="item.userId"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="课程购买时间" prop="name">
+            <el-form-item
+              label="课程购买时间"
+              prop="signUpTimeList"
+              :rules="[{ required: true, message: '请选择课程购买时间' }]"
+            >
               <el-date-picker
                 style="width: 100%"
-                :picker-options="{ firstDayOfWeek: 1 }"
+                v-model="form.signUpTimeList"
+                :picker-options="pickerOptions"
                 type="datetimerange"
                 :default-time="['00:00:00', '23:59:59']"
                 range-separator="-"
-                start-placeholder="交易开始日期"
-                end-placeholder="交易结束日期"
+                start-placeholder="购买开始日期"
+                end-placeholder="购买结束日期"
               >
               </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="课时数" prop="name">
-              <el-input placeholder="请输入课时数"></el-input>
+            <el-form-item
+              label="课时数"
+              prop="onlineClassesNum"
+              :rules="[{ required: true, message: '请输入课时数' }]"
+            >
+              <el-input
+                v-model="form.onlineClassesNum"
+                placeholder="请输入课时数"
+                maxlength="2"
+                @input="
+                  val => {
+                    form.val = val.replace(/^[+]{0,1}(\d+)$/g, '');
+                  }
+                "
+                @change="
+                  () => {
+                    form.timeTable = []; // 课表重置
+                  }
+                "
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="课程时长" prop="name">
-              <el-input placeholder="请输入课程时长"></el-input>
+            <el-form-item
+              label="课程时长"
+              prop="singleClassMinuteId"
+              :rules="[{ required: true, message: '请选择课程时长' }]"
+            >
+              <el-select
+                v-model.trim="form.singleClassMinuteId"
+                filterable
+                clearable
+                style="width: 100% !important"
+                placeholder="请选择课程时长"
+                @change="onSingleClassChange"
+              >
+                <el-option
+                  v-for="(item, key) in liveGroupList"
+                  :key="key"
+                  :label="item.singleClassMinutes"
+                  :value="item.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="原价" prop="name">
-              <el-input placeholder="请输入原价"></el-input>
+            <el-form-item
+              label="现价"
+              prop="onlineClassesUnitPrice"
+              :rules="[{ required: true, message: '请输入现价' }]"
+            >
+              <el-input
+                v-model="form.onlineClassesUnitPrice"
+                placeholder="请输入现价"
+                @keyup.native="keyupEvent($event)"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="10">
-            <el-form-item label="现价" prop="name">
-              <el-input placeholder="请输入现价"></el-input>
+            <el-form-item
+              label="原价"
+              prop="offlineClassesUnitPrice"
+              :rules="[{ required: true, message: '请输入原价' }]"
+            >
+              <el-input
+                v-model="form.offlineClassesUnitPrice"
+                placeholder="请输入原价"
+                @keyup.native="keyupEvent($event)"
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
 
-        <el-button type="danger">点击排课</el-button>
+        <el-button type="danger" @click="onTimeTable">点击排课</el-button>
         <el-table
           style="width: 100%; margin-top: 20px;"
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="form.timeTable"
         >
+          <el-table-column align="center" label="课时">
+            <template slot-scope="scope">
+              第{{ scope.$index + 1 }}课
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            prop="id"
-            label="课时"
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="id"
             label="内容"
-          ></el-table-column>
+            width="150px"
+            prop="teachingContent"
+            key="teachingContent"
+          >
+            <template slot-scope="scope">
+              <!-- v-model="form.eclass[scope.$index].courseCurrentPrice" -->
+              <el-form-item
+                :prop="'timeTable.' + scope.$index + '.teachingContent'"
+                :rules="[{ required: true, message: '请输入内容' }]"
+              >
+                <el-input
+                  v-model="scope.row.teachingContent"
+                  placeholder="请输入内容"
+                >
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            prop="id"
             label="技能/知识点掌握"
-          ></el-table-column>
+            width="220px"
+            prop="teachingPoint"
+            key="teachingPoint"
+          >
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'timeTable.' + scope.$index + '.teachingPoint'"
+                :rules="[{ required: true, message: '请输入技能/知识点掌握' }]"
+              >
+                <!-- v-model="scope.row.teachingPoint" -->
+                <el-input
+                  v-model="form.timeTable[scope.$index].teachingPoint"
+                  placeholder="请输入技能/知识点掌握"
+                >
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            prop="id"
+            prop="singleClassMinutes"
             label="时长"
           ></el-table-column>
+          <el-table-column align="center" label="课程日期">
+            <template slot-scope="scope">
+              <div>{{ scope.row.classDate | formatTimer }}</div>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            prop="id"
-            label="课程日期"
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="id"
+            prop="startClassTimeStr"
             label="开始时间"
           ></el-table-column>
           <el-table-column
             align="center"
-            prop="id"
+            prop="endClassTimeStr"
             label="结束时间"
           ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="id"
-            label="课程类型"
-          ></el-table-column>
+          <el-table-column align="center" label="课程类型">
+            <template slot-scope="scope">
+              <div>{{ scope.row.teachMode | teachMode }}</div>
+            </template>
+          </el-table-column>
         </el-table>
 
         <el-alert
@@ -138,7 +309,6 @@
           type="info"
           style="margin: 20px 0"
         />
-
         <el-row :gutter="20">
           <el-col :span="10">
             <el-form-item
@@ -146,9 +316,16 @@
               prop="os"
               :rules="[{ required: true, message: '请选择推广类型' }]"
             >
-              <el-radio-group>
-                <el-radio label="pc">web</el-radio>
-                <el-radio label="client">客户端</el-radio>
+              <el-radio-group v-model="form.os">
+                <!-- 根据不同的模式,显示不同的直播设备 -->
+                <el-radio v-if="serviceProvider === 'rongCloud'" label="pc"
+                  >web</el-radio
+                >
+                <el-radio
+                  v-if="serviceProvider === 'tencentCloud'"
+                  label="client"
+                  >客户端</el-radio
+                >
                 <el-radio label="mobile">手机</el-radio>
               </el-radio-group>
             </el-form-item>
@@ -159,7 +336,7 @@
               prop="useScene"
               :rules="[{ required: true, message: '请选择直播场景' }]"
             >
-              <el-radio-group>
+              <el-radio-group v-model="form.useScene">
                 <el-radio label="NORMAL">普通模式</el-radio>
                 <el-radio label="MUSIC">音乐模式</el-radio>
               </el-radio-group>
@@ -172,7 +349,7 @@
               label="保存直播回放"
               :rules="[{ required: true, message: '是否保存直播回放' }]"
             >
-              <el-radio-group>
+              <el-radio-group v-model="form.roomConfig.whether_video">
                 <el-radio :label="0">是</el-radio>
                 <el-radio :label="1">否</el-radio>
               </el-radio-group>
@@ -184,7 +361,7 @@
               label="是否展示购物车"
               :rules="[{ required: true, message: '是否展示购物车' }]"
             >
-              <el-radio-group>
+              <el-radio-group v-model="form.roomConfig.whether_view_shop_cart">
                 <el-radio :label="0">是</el-radio>
                 <el-radio :label="1">否</el-radio>
               </el-radio-group>
@@ -197,91 +374,98 @@
               prop="preTemplate"
               :rules="[{ required: true, message: '请选择预热模板' }]"
             >
-              <el-checkbox-group v-model="checkList">
+              <el-radio-group v-model="form.preTemplate">
                 <div class="chioseWrap">
                   <div class="chioseItem" @click="setPreTemplate(1)">
                     <img src="./images/img1.png" alt="" />
-                    <div class="remberBox">
-                      <div class="wrap"></div>
-                      <el-checkbox
-                        class="chioseBox"
-                        :label="1"
-                        :checked="form.preTemplate == 1"
-                        ><br
-                      /></el-checkbox>
-                    </div>
+                    <i
+                      class="dotWrap"
+                      :class="form.preTemplate == 1 ? 'checked' : ''"
+                    ></i>
                   </div>
                   <div class="chioseItem" @click="setPreTemplate(2)">
                     <img src="./images/img2.png" alt="" />
-                    <div class="remberBox">
-                      <div class="wrap"></div>
-                      <el-checkbox
-                        name="2"
-                        class="chioseBox"
-                        :label="2"
-                        :checked="form.preTemplate == 2"
-                        ><br
-                      /></el-checkbox>
-                    </div>
+                    <i
+                      class="dotWrap"
+                      :class="form.preTemplate == 2 ? 'checked' : ''"
+                    ></i>
                   </div>
                   <div class="chioseItem" @click="setPreTemplate(3)">
                     <img src="./images/img3.png" alt="" />
-                    <div class="remberBox">
-                      <div class="wrap"></div>
-                      <el-checkbox
-                        class="chioseBox"
-                        :label="3"
-                        :checked="form.preTemplate == 3"
-                        ><br
-                      /></el-checkbox>
-                    </div>
+                    <i
+                      class="dotWrap"
+                      :class="form.preTemplate == 3 ? 'checked' : ''"
+                    ></i>
                   </div>
                 </div>
-              </el-checkbox-group>
+              </el-radio-group>
             </el-form-item>
           </el-col>
         </el-row>
 
         <el-row>
           <el-col :span="24">
-            <el-button type="primary">确定</el-button>
-            <el-button type="primary">重置</el-button>
+            <el-button type="primary" @click="onReset">重置</el-button>
+            <el-button type="primary" @click="onSubmit">确定</el-button>
           </el-col>
         </el-row>
       </el-form>
     </div>
+
+    <el-dialog
+      title="排课"
+      ref="maskForm"
+      width="500px"
+      :visible.sync="dialogFormVisible"
+    >
+      <addLiveCourse
+        :singleClassMinutes="form.singleClassMinutes"
+        :signUpTimeList="form.signUpTimeList"
+        :onlineCourseNum="form.onlineClassesNum"
+        @close="dialogFormVisible = false"
+        @confirm="onConfirm"
+      />
+    </el-dialog>
   </div>
 </template>
 <script>
+import dayjs from "dayjs";
+import deepClone from "@/helpers/deep-clone";
 import preview from "./modals/preview.vue";
-import { getToken, getTenantId } from "@/utils/auth";
+import addLiveCourse from "./modals/addLiveCourse.vue";
+import { sysTenantConfigAll } from "./api";
 import {
-  createLiveBroadcast,
-  resetLiveBroadcastRoomList,
-  getRoomInfo,
-  sysTenantConfigAll
-} from "./api";
-import { queryByOrganId } from "@/api/systemManage";
-import { getTeamList } from "@/api/teamServer";
+  getSubject,
+  findTeacherByOrganId,
+  getOrganRole
+} from "@/api/buildTeam";
+import { vipGroupCategory, createVip } from "@/api/vipSeting";
 export default {
-  components: { preview },
+  components: { preview, addLiveCourse },
   data() {
     return {
       name: "新建直播课",
-      preLookVisible: false,
+      dialogFormVisible: false,
       form: {
+        roomTitle: "", //
+        liveRemark: "", // 内容
         organIds: [],
-        schoolIds: [],
-        teamIds: [],
-        roomTitle: "",
-        useScene: "NORMAL",
-        speakerId: "",
-        liveStartTime: "",
-        liveRemark: "",
-        preTemplate: null,
-        popularizeType: "ALL",
-        clientType: "TEACHER",
-        os: "client",
+        subjectIdList: null, // 声部
+        teacher: "", // 指导老师列表
+        educationalTeacherId: null, // 乐团主管
+        preTemplate: 1, // 模板
+        signUpStart: null, // 开始时间
+        signUpEnd: null, // 结束时间
+        signUpTimeList: [], // 课程购买时间
+        onlineClassesNum: null,
+        singleClassMinuteId: null, //时长编号
+        singleClassMinutes: null, // 时长
+        onlineClassesUnitPrice: null, // 售价
+        offlineClassesUnitPrice: null, // 原价
+        os: "client", // 直播设备
+        useScene: "NORMAL", // 直播场景
+        popularizeType: "ALL", // 观看权限信息
+        viewMode: "LOGIN",
         roomConfig: {
           whether_like: 0,
           whether_chat: 0,
@@ -289,32 +473,254 @@ export default {
           whether_mic: 0,
           whether_view_shop_cart: 0
         },
-        checkList: [],
-        viewMode: "LOGIN"
+        checkList: [], //
+        timeTable: [], // 排课
+        clientType: "TEACHER" // 主讲人身份 默认[老师]
       },
-      serviceProvider: "tencentCloud",
-      remoteLoading: false,
-      teacherList: [],
+
+      serviceProvider: "tencentCloud", // 直播模式
       checkList: [],
-      cooperationList: [],
-      teamList: [],
-      isinit: true,
+      subjectList: [], // 声部列表
+      teacherList: [], // 指导老师
+      educationList: [], // 乐团主管
+      liveGroupList: [], // 课时列表
       pickerOptions: {
         firstDayOfWeek: 1,
         disabledDate(time) {
           return time.getTime() + 86400000 <= new Date().getTime();
         }
-      },
-      educationList: []
+      }
     };
   },
   async mounted() {
     this.$store.dispatch("setBranchs");
+    await this.__init();
   },
   methods: {
+    async onChangeSubject(val) {
+      try {
+        this.form.teacher = ""; // 重置指导老师
+        // 根据科目id获取相应的老师
+        await findTeacherByOrganId({
+          subjectIds: val <= 0 ? null : val
+        }).then(res => {
+          if (res.code == 200) {
+            this.teacherList = res.data;
+          }
+        });
+      } catch {}
+    },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push("/liveClassManager?tabrouter=2");
+    },
+    setPreTemplate(index) {
+      this.form.preTemplate = index;
+    },
+    async onSubmit() {
+      this.$refs.liveForm.validate(async flag => {
+        if (!flag) {
+          this.onScrollError();
+          return false;
+        }
+
+        try {
+          const form = this.form;
+          if (form.timeTable.length <= 0) {
+            this.$message.error("请点击排课");
+            return;
+          }
+          const timeTable = [];
+          form.timeTable.forEach(item => {
+            timeTable.push({
+              classDate: item.classDate,
+              actualTeacherId: form.teacher,
+              startClassTimeStr: item.startClassTimeStr,
+              endClassTimeStr: item.endClassTimeStr,
+              teachMode: item.teachMode,
+              teachingContent: item.teachingContent,
+              teachingPoint: item.teachingPoint
+            });
+          });
+
+          let obj = {
+            courseSchedules: timeTable,
+            vipGroupApplyBaseInfo: {
+              groupType: "LIVE",
+              vipGroupStudentCoursePrices: [],
+              // coursesExpireDate: this.leftForm.courseEnd,
+              // teacherSchoolId: this.leftForm.section,
+              studentIdList: "",
+              offlineClassesNum: 0,
+              onlineClassesNum: form.onlineClassesNum || 0,
+              offlineClassesUnitPrice: form.offlineClassesUnitPrice || 0,
+              onlineClassesUnitPrice: form.onlineClassesUnitPrice || 0,
+              registrationStartTime: dayjs(form.signUpTimeList[0]).format(
+                "YYYY-MM-DD"
+              ),
+              paymentExpireDate: dayjs(form.signUpTimeList[0]).format(
+                "YYYY-MM-DD"
+              ),
+              singleClassMinutes: form.singleClassMinutes,
+              userId: form.teacher,
+              // vipGroupActivityId: form.singleClassMinuteId,
+              vipGroupCategoryId: form.singleClassMinuteId,
+              onlineTeacherSalary: 0,
+              offlineTeacherSalary: 0,
+              giveTeachMode: "ONLINE",
+              subjectIdList: form.subjectIdList,
+              educationalTeacherId: form.educationalTeacherId,
+              organId: -1,
+              organIdList: form.organIds.join(",")
+            },
+            liveBroadcastRoom: {
+              speakerId: form.teacher,
+              clientType: "TEACHER",
+              roomTitle: form.roomTitle,
+              liveRemark: form.liveRemark,
+              preTemplate: form.preTemplate,
+              useScene: form.useScene,
+              os: form.os,
+              serviceProvider: form.serviceProvider,
+              viewMode: form.viewMode,
+              popularizeType: form.popularizeType,
+              roomConfig: form.roomConfig
+            }
+          };
+          console.log(obj, "obj");
+          createVip(obj).then(res => {
+            if (res.code == 200) {
+              this.$message.success("恭喜您创建成功");
+              this.$store.dispatch("delVisitedViews", this.$route);
+              this.$router.push({
+                path: "/liveClassManager",
+                query: {
+                  tabrouter: 2
+                }
+              });
+            }
+          });
+        } catch (e) {
+          console.log(e);
+        }
+      });
+    },
+    onReset() {
+      // 重置
+      this.form.timeTable = [];
+      this.$refs.liveForm.resetFields();
+      this.$nextTick(() => {
+        let isError = document.getElementsByClassName("el-alert");
+        isError[0].scrollIntoView({
+          block: "center",
+          behavior: "smooth"
+        });
+      });
+    },
+    // 点击排课
+    async onTimeTable() {
+      let count = 0;
+      this.$refs.liveForm.validateField(
+        ["signUpTimeList", "onlineClassesNum", "singleClassMinuteId"],
+        valid => {
+          count += 1;
+          if (valid) {
+            this.onScrollError();
+            return;
+          }
+
+          if (count >= 3) {
+            this.dialogFormVisible = true;
+          }
+        }
+      );
+    },
+    onScrollError() {
+      this.$nextTick(() => {
+        let isError = document.getElementsByClassName("is-error");
+        isError[0].scrollIntoView({
+          block: "center",
+          behavior: "smooth"
+        });
+      });
+    },
+    onSingleClassChange(val) {
+      // 设置 - 课程时长切换时
+      let onlinePrice = null;
+      let offLinePrice = null;
+      let minus = null;
+      this.liveGroupList.forEach(item => {
+        if (item.id === val) {
+          onlinePrice = item.onlineClassesUnitPrice;
+          offLinePrice = item.offlineClassesUnitPrice;
+          minus = item.singleClassMinutes;
+        }
+      });
+      this.form.onlineClassesUnitPrice = onlinePrice;
+      this.form.offlineClassesUnitPrice = offLinePrice;
+      this.form.singleClassMinutes = minus;
+
+      this.form.timeTable = []; // 课表重置
+    },
+    onConfirm(val) {
+      let tempVal = deepClone(val || []);
+      tempVal.forEach(item => {
+        item.teachingContent = "";
+        item.teachingPoint = "";
+        item.singleClassMinutes = this.form.singleClassMinutes;
+      });
+      this.form.timeTable = tempVal;
+      console.log(this.form.timeTable, "time table");
+      this.$forceUpdate();
+    },
+    async __init() {
+      try {
+        const findName = await sysTenantConfigAll({
+          group: "LIVE_CLIENT"
+        });
+        if (findName.data && findName.data.length > 0) {
+          findName.data.forEach(item => {
+            if (item.paramName == "live_client") {
+              this.serviceProvider = item.paranValue;
+              this.form.os =
+                this.serviceProvider == "tencentCloud" ? "client" : "pc";
+            }
+          });
+        }
+
+        // 获取 指导老师列表
+        await getSubject({
+          tenantId: 1
+        }).then(res => {
+          if (res.code == 200) {
+            this.subjectList = [
+              {
+                id: -1,
+                name: "乐理"
+              },
+              ...res.data
+            ];
+          }
+        });
+
+        // 获取乐团主管
+        await getOrganRole().then(ruselt => {
+          this.educationList = ruselt?.data?.EDUCATION;
+        });
+
+        // 获取课时数
+        // 获取默认左边参数
+        await vipGroupCategory({
+          groupType: "live"
+        }).then(res => {
+          if (res.code == 200) {
+            this.liveGroupList = res.data;
+          }
+        });
+      } catch (e) {
+        //
+        console.log(e, "e info");
+      }
     }
   }
 };
@@ -332,55 +738,40 @@ export default {
     width: 188px;
     height: 188px;
     cursor: pointer;
-    .remberBox {
-      .wrap {
-        width: 100px;
-        height: 100px;
-        z-index: 100;
-        position: absolute;
-      }
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      margin-bottom: 30px;
-      padding-top: 10px;
-      align-items: center;
-      position: relative;
-      color: #6d7278;
-      font-size: 16px;
+
+    .dotWrap {
+      width: 21px;
+      height: 21px;
+      background: url("../../assets/images/icon_checkbox_default.png") no-repeat
+        center;
+      background-size: contain;
+      display: block;
       position: absolute;
-      top: 1px;
-      right: 1px;
-      .chioseBox {
-        ::v-deep .el-checkbox__inner {
-          width: 20px;
-          height: 20px;
-          border-radius: 50%;
-          &::after {
-            height: 8px;
-            left: 6px;
-            position: absolute;
-            top: 3px;
-            width: 4px;
-          }
-        }
-      }
-      .dotWrap {
-        width: 21px;
-        height: 21px;
-        background: url("../../assets/images/icon_checkbox_default.png")
-          no-repeat center;
+      top: 10px;
+      right: 12px;
+      overflow: hidden;
+      &.checked {
+        background: url("../../assets/images/icon_checkbox.png") no-repeat
+          center;
         background-size: contain;
-        margin-right: 8px;
-        position: relative;
-        overflow: hidden;
-        &.checked {
-          background: url("../../assets/images/icon_checkbox.png") no-repeat
-            center;
-          background-size: contain;
-        }
       }
     }
   }
 }
+
+::v-deep .el-select > .el-input {
+  height: 36px !important;
+}
+::v-deep .select-all {
+  .select {
+    .el-input__inner {
+      height: 36px !important;
+      min-height: 36px !important;
+    }
+  }
+  .btn {
+    height: 36px !important;
+    min-height: 36px !important;
+  }
+}
 </style>

+ 103 - 42
src/views/liveClassManager/liveClassManager.vue

@@ -52,7 +52,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item prop="serviceProvider">
+      <!-- <el-form-item prop="serviceProvider">
         <el-select
           placeholder="课程类型"
           v-model="searchForm.serviceProvider"
@@ -61,7 +61,7 @@
           <el-option label="乐理" value="rongCloud"></el-option>
           <el-option label="乐器" value="tencentCloud"></el-option>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
 
       <el-form-item>
         <el-button native-type="submit" type="primary">搜索</el-button>
@@ -81,27 +81,27 @@
         ></el-table-column>
         <el-table-column
           align="center"
-          prop="roomTitle"
+          prop="name"
           label="课程名称"
         ></el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           align="center"
           prop="roomTitle"
           label="课程类型"
-        ></el-table-column>
-        <el-table-column
-          align="center"
-          prop="roomTitle"
-          label="课程状态"
-        ></el-table-column>
+        ></el-table-column> -->
+        <el-table-column align="center" label="课程状态">
+          <template slot-scope="scope">
+            <div>{{ scope.row.status | formatterStatus }}</div>
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
-          prop="speakerName"
+          prop="userName"
           label="指导老师"
         ></el-table-column>
         <el-table-column
           align="center"
-          prop="speakerName"
+          prop="educationalTeacherName"
           label="乐员主管"
         ></el-table-column>
 
@@ -112,19 +112,19 @@
         ></el-table-column>
         <el-table-column
           align="center"
-          prop="speakerName"
+          prop="totalClassTimes"
           label="课时数"
         ></el-table-column>
-        <el-table-column
-          align="center"
-          prop="speakerName"
-          label="分部"
-        ></el-table-column>
+        <el-table-column align="center" label="分部">
+          <template slot-scope="scope">
+            <copy-text>{{ scope.row.organName }}</copy-text>
+          </template>
+        </el-table-column>
 
         <el-table-column align="center" prop="liveStartTime" label="开课时间">
           <template slot-scope="scope">
             <div>
-              {{ scope.row.liveStartTime | dateForMinFormat }}
+              <p>{{ scope.row.courseStartDate | formatterTime }}</p>
             </div>
           </template>
         </el-table-column>
@@ -136,11 +136,37 @@
                   >详情</el-button
                 >
               </auth>
-              <auth auths="/liveBlackList">
-                <el-button type="text" @click="gotoBuylist(scope.row)"
+              <!-- <auth auths="vipGroupManage/stopVipGroup" v-if="scope.row.status < 3 &&
+                      scope.row.enableDelete != 1">
+                <el-button type="text" @click="onCloseVip(scope.row)"
                   >停止</el-button
                 >
-              </auth>
+              </auth> -->
+              <el-popover
+                placement="top"
+                width="160"
+                v-if="
+                  scope.row.status < 3 &&
+                    scope.row.enableDelete != 1 &&
+                    permission('vipGroupManage/stopVipGroup')
+                "
+                :ref="scope.$index"
+              >
+                <p style="margin-bottom: 10px">确定停止该vip课?</p>
+                <el-input
+                  v-model.trim="stopReason"
+                  placeholder="请输入关闭原因"
+                ></el-input>
+                <div style="text-align: right; margin-top: 20px">
+                  <el-button type="text" @click="onCancelVip(scope)"
+                    >取消</el-button
+                  >
+                  <el-button type="primary" @click="onCloseVip(scope)"
+                    >确定</el-button
+                  >
+                </div>
+                <el-button type="text" slot="reference">停止</el-button>
+              </el-popover>
             </div>
           </template>
         </el-table-column>
@@ -158,9 +184,8 @@
 </template>
 
 <script>
-import { getTimes } from "@/utils";
 import pagination from "@/components/Pagination/index";
-import { getLiveBroadcastList } from "./api";
+import { getVipList } from "@/api/vipSeting";
 export default {
   components: {
     pagination
@@ -170,9 +195,7 @@ export default {
       searchForm: {
         search: null,
         teacherId: null,
-        serviceProvider: null,
-        liveState: null,
-        popularize: null
+        status: null
       },
       tableList: [],
       rules: {
@@ -190,11 +213,12 @@ export default {
         { lable: "已结束", value: "4" },
         { lable: "取消", value: "3" },
         { lable: "暂停", value: "6" }
-      ]
+      ],
+      stopReason: ""
     };
   },
   mounted() {
-    // 获取分部
+    this.getList();
   },
   methods: {
     newLiveClass() {
@@ -205,29 +229,66 @@ export default {
         route.meta.title = "新建直播课";
       });
     },
+    onCancelVip(scope) {
+      this.stopReason = null;
+      scope._self.$refs[scope.$index].doClose();
+    },
+    onCloseVip(scope) {
+      let id = scope.row.id;
+      closeVip({ vipGroupId: id, stopReason: this.stopReason }).then(res => {
+        if (res.code == 200) {
+          this.$message.success("停止课程成功");
+          scope._self.$refs[scope.$index].doClose();
+          this.stopReason = "";
+          this.getList();
+        }
+      });
+    },
     async getList() {
-      const { timer, ...rest } = this.searchForm;
-      try {
-        const res = await getLiveBroadcastList({
-          ...rest,
-          ...getTimes(timer, ["startTime", "endTime"]),
-          rows: this.rules.limit,
-          page: this.rules.page
-        });
-        this.tableList = res.data.rows;
-        this.rules.total = res.data.total;
-      } catch (e) {
-        console.log(e);
-      }
+      await getVipList({
+        ...this.searchForm,
+        groupType: "LIVE",
+        page: this.rules.page,
+        rows: this.rules.limit
+      }).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+        }
+      });
     },
     search() {
       this.rules.page = 1;
       this.getList();
     },
     onReSet() {
+      this.searchForm.teacherId = "";
       this.$refs.searchForm.resetFields();
       this.search();
     }
+  },
+  filters: {
+    formatterTime(val) {
+      let result;
+      if (val) {
+        result = val.split(" ")[0];
+      } else {
+        result = "";
+      }
+      return result;
+    },
+    formatterStatus(val) {
+      let arr = [
+        "未开始",
+        "报名中",
+        "进行中",
+        "取消",
+        "已结束",
+        "报名结束",
+        "暂停"
+      ];
+      return arr[val];
+    }
   }
 };
 </script>

+ 523 - 0
src/views/liveClassManager/modals/addLiveCourse.vue

@@ -0,0 +1,523 @@
+<template>
+  <div>
+    <el-form :model="maskForm" label-position="right" label-width="80px">
+      <el-form-item label="开课时间">
+        <el-date-picker
+          v-model.trim="maskForm.courseStartOnline"
+          type="date"
+          :picker-options="pickerOptions"
+          placeholder="请选择开课时间"
+          style="width: 100% !important"
+        />
+      </el-form-item>
+      <!-- <el-form-item label="课程类型" prop="type">
+        <el-radio v-if="hasOnline" v-model.trim="maskForm.type" label="ONLINE"
+          >线上课</el-radio
+        >
+        <el-radio v-if="hasOffline" v-model.trim="maskForm.type" label="OFFLINE"
+          >线下课</el-radio
+        >
+      </el-form-item> -->
+      <el-form-item label="循环周次" prop="week">
+        <el-select v-model.trim="maskForm.week" style="width: 100% !important">
+          <el-option label="星期一" value="1" />
+          <el-option label="星期二" value="2" />
+          <el-option label="星期三" value="3" />
+          <el-option label="星期四" value="4" />
+          <el-option label="星期五" value="5" />
+          <el-option label="星期六" value="6" />
+          <el-option label="星期日" value="0" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="上课时间" prop="startTime">
+        <el-time-picker
+          style="width: 100% !important"
+          v-model.trim="maskForm.startTime"
+          @change="getStartTime"
+          format="HH:mm"
+          value-format="HH:mm"
+          placeholder="选择时间"
+        />
+      </el-form-item>
+      <el-form-item label="下课时间" prop="endTime">
+        <el-time-picker
+          style="width: 100% !important"
+          v-model.trim="maskForm.endTime"
+          disabled
+          format="HH:mm"
+          value-format="HH:mm"
+          :picker-options="{
+            start: '04:30',
+            step: '00:05',
+            end: '23:30'
+          }"
+          placeholder="选择时间"
+        />
+      </el-form-item>
+    </el-form>
+    <div class="btnWrap">
+      <div class="okBtn" @click="addWeek">确认</div>
+    </div>
+
+    <div class="planList">
+      <div class="planTop">
+        <p>已排课程</p>
+      </div>
+      <div class="planCore" v-if="lookList.length > 0">
+        <div v-for="(item, index) in lookList" class="row" :key="index">
+          <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" @click="removeWeekCourse(item.id)"
+              >删除</el-button
+            >
+          </div>
+        </div>
+      </div>
+      <div class="nomore" v-else>暂无数据</div>
+      <div slot="footer" style="margin-top: 20px" class="dialog-footer">
+        <el-button @click="onClose">取 消</el-button>
+        <el-button type="primary" @click="setTimeTable">确 定</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import dayjs from "dayjs";
+import { addTimerFormMinute } from "@/utils/date";
+export default {
+  name: "add-live-course",
+  props: {
+    hasOnline: {
+      type: Boolean,
+      default: true
+    },
+    hasOffline: {
+      type: Boolean,
+      default: false
+    },
+    // 课时数
+    singleClassMinutes: {
+      type: [Number, String],
+      default: 0
+    },
+    signUpTimeList: {
+      type: Array,
+      default: []
+    },
+    // 指导老师
+    teacher: {
+      type: String,
+      default: ""
+    },
+    // 赠送课时数
+    // giveNum: {
+    //   type: Number,
+    //   default: 0
+    // },
+    onlineCourseNum: {
+      type: [Number, String],
+      default: 0
+    },
+    offlineCourseNum: {
+      type: Number,
+      default: 0
+    }
+  },
+  data() {
+    return {
+      maskForm: {
+        type: "ONLINE",
+        week: "",
+        startTime: "",
+        endTime: ""
+      },
+      weekDay: [
+        "星期日",
+        "星期一",
+        "星期二",
+        "星期三",
+        "星期四",
+        "星期五",
+        "星期六"
+      ],
+      courseOption: null,
+      lookList: [],
+      onlinelookList: [], // 展示课表线上
+      offlineLookList: [], // 展示课表线下
+      timeTable: [], // 排课数据
+      pickerOptions: {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          return time.getTime() + 86400000 <= new Date().getTime();
+        }
+      }
+    };
+  },
+  methods: {
+    onClose() {
+      this.$emit("close");
+    },
+    addWeek() {
+      let courseType = this.maskForm.type;
+      let startTime = this.maskForm.startTime;
+      if (!courseType || !this.maskForm.week || !startTime) {
+        this.$message.error("请填写完成信息");
+        return;
+      }
+      // 拿到相应的值插入数组
+      let endTime = this.MinutesTest(startTime, this.singleClassMinutes);
+      let str;
+      switch (courseType) {
+        case "ONLINE": {
+          str = "线上课";
+          break;
+        }
+        case "OFFLINE": {
+          str = "线下课";
+          break;
+        }
+      }
+      let flag = false;
+      for (let i in this.lookList) {
+        if (this.lookList[i].weekDay == this.maskForm.week) {
+          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.error("该时间段已排课请重选时间");
+          return;
+        }
+      } 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()
+        });
+      }
+      //  根据时间排序
+      this.maskForm.type = "ONLINE";
+      this.maskForm.week = "";
+      this.maskForm.startTime = "";
+      this.maskForm.endTime = "";
+    },
+    // 分钟小时相加减
+    MinutesTest(str, interval) {
+      let houer = str.split(":")[0];
+      let min = str.split(":")[1];
+      let sdate1 = new Date(1900, 1, 1, houer, min);
+      sdate1.setMinutes(sdate1.getMinutes() + parseInt(interval));
+      let H = sdate1.getHours();
+      let M = sdate1.getMinutes();
+      if (H < 10) H = "0" + H;
+      if (M < 10) M = "0" + M;
+      return H + ":" + M;
+    },
+    // 判断时间是否在时间段内
+    timeIsrange(beginTime, endTime, nowTime) {
+      var strb = beginTime.split(":");
+      if (strb.length != 2) {
+        return false;
+      }
+      var stre = endTime.split(":");
+      if (stre.length != 2) {
+        return false;
+      }
+      var strn = nowTime.split(":");
+      if (stre.length != 2) {
+        return false;
+      }
+      var b = new Date();
+      var e = new Date();
+      var n = new Date();
+      b.setHours(strb[0]);
+      b.setMinutes(strb[1]);
+      e.setHours(stre[0]);
+      e.setMinutes(stre[1]);
+      n.setHours(strn[0]);
+      n.setMinutes(strn[1]);
+
+      if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) {
+        // 在时间范围内
+        return true;
+      } else {
+        // 不在时间范围内
+        return false;
+      }
+    },
+    removeWeekCourse(id) {
+      for (let i in this.lookList) {
+        if (this.lookList[i].id == id) {
+          this.lookList.splice(i, 1);
+        }
+      }
+    },
+    setTimeTable() {
+      // 拿到线上课数与线下课数 以及
+      this.timeTable = [];
+      let online = parseInt(this.onlineCourseNum) || 0;
+      let offline = parseInt(this.offlineCourseNum) || 0;
+
+      if (!this.maskForm.courseStartOnline) {
+        this.$message.error("请选择课程开始时间");
+        return;
+      }
+      let date, date1;
+      date = new Date(this.maskForm.courseStartOnline.getTime());
+      date1 = new Date(this.maskForm.courseStartOnline.getTime());
+
+      let onlineList = []; // 装线上课的数组
+      let offlineList = []; //装线下课的数组
+      if (this.lookList.length <= 0) {
+        this.$message.error("请先排课后再点击确认按钮");
+        return;
+      }
+
+      for (let i in this.lookList) {
+        if (this.lookList[i].type == "线上课") {
+          onlineList.push({
+            week: this.lookList[i].weekDay,
+            date: this.lookList[i]
+          });
+        }
+        if (this.lookList[i].type == "线下课") {
+          offlineList.push({
+            week: this.lookList[i].weekDay,
+            date: this.lookList[i]
+          });
+        }
+      }
+
+      if (online > 0 && onlineList.length <= 0) {
+        this.$message.error("选择了线上课但未排线上课");
+        this.timeTable = [];
+        return;
+      }
+      if (offline > 0 && offlineList.length <= 0) {
+        this.$message.error("选择了线下课但未排线下课");
+        this.timeTable = [];
+        return;
+      }
+
+      // 获取要排课的总数  获取每周要排多少次
+      while (online && online > 0) {
+        // 排线上课g
+        for (let i in onlineList) {
+          let num;
+          onlineList[i].week - date.getDay() >= 0
+            ? (num = onlineList[i].week - date.getDay())
+            : (num = onlineList[i].week - date.getDay() + 7); // +差值的天数://差值的天数+7
+          //  (num);
+          let dataStr = this.getThinkDate(date, num);
+          this.timeTable.push({
+            classDate: dataStr + " 00:00:00",
+            actualTeacherId: this.teacher,
+            startClassTimeStr: onlineList[i].date.startTime,
+            endClassTimeStr: onlineList[i].date.endTime,
+            teachMode: "ONLINE"
+          });
+          online--;
+          if (online == 0) break;
+        }
+        if (onlineList.length == 1 || this.isAllEqual(onlineList)) {
+          date.setDate(date.getDate() + 7);
+        }
+
+        // 加一周
+      }
+
+      //  (date1)
+      while (offline && offline > 0) {
+        // 排线下课
+        for (let i in offlineList) {
+          let num;
+          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);
+          this.timeTable.push({
+            classDate: dataStr + " 00:00:00",
+            actualTeacherId: this.teacher,
+            startClassTimeStr: offlineList[i].date.startTime,
+            endClassTimeStr: offlineList[i].date.endTime,
+            teachMode: "OFFLINE"
+          });
+          offline--;
+          if (offline == 0) break;
+        }
+        // 加一周
+        if (offlineList.length == 1 || this.isAllEqual(offlineList)) {
+          date1.setDate(date1.getDate() + 7);
+        }
+      }
+      //  (this.timeTable);
+
+      this.timeTable.sort((a, b) => {
+        let aStr = dayjs(
+          dayjs(a.classDate).format("YYYY-MM-DD") +
+            " " +
+            a.startClassTimeStr +
+            ":00"
+        ).valueOf();
+        let bStr = dayjs(
+          dayjs(b.classDate).format("YYYY-MM-DD") +
+            " " +
+            b.startClassTimeStr +
+            ":00"
+        ).valueOf();
+        return aStr - bStr;
+      });
+
+      this.onClose();
+      this.$emit("confirm", this.timeTable);
+    },
+    // coursesDate() {
+    //   let self = this;
+    //   return {
+    //     firstDayOfWeek: 1,
+    //     disabledDate: time => {
+    //       if (self.leftForm.courseStart && self.leftForm.courseEnd) {
+    //         let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
+    //         let endDate = new Date(self.leftForm.courseEnd.replace(/-/, "/"));
+    //         let nowDate = new Date();
+    //         let changeDate =
+    //           date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
+    //         let endChangeDate =
+    //           endDate.getTime() - nowDate.getTime() > 0 ? endDate : nowDate;
+    //         return (
+    //           time.getTime() < changeDate.getTime() ||
+    //           time.getTime() > endChangeDate.getTime()
+    //         );
+    //       }
+    //       return;
+    //     }
+    //   };
+    // },
+    getThinkDate(date, num) {
+      let Stamp = date;
+      Stamp.setDate(date.getDate() + num); // 获取当前月数的第几天
+      //  (date.getMonth() + 1)
+      //  (Stamp.getMonth() + 1)
+      var year = Stamp.getFullYear(); //获取完整的年份(4位,1970-????)
+      var month = Stamp.getMonth() + 1; //获取当前月份(0-11,0代表1月)
+      var mvar = "";
+      if (month < 10) {
+        mvar = "0" + month;
+      } else {
+        mvar = month + "";
+      }
+      var day = Stamp.getDate();
+      var dvar = "";
+      if (day < 10) {
+        dvar = "0" + day;
+      } else {
+        dvar = day + "";
+      }
+      //  (year + "-" + mvar + '-' + dvar);
+      return year + "-" + mvar + "-" + dvar;
+    },
+    getStartTime(val) {
+      if (val) {
+        let date = dayjs(new Date()).format("YYYY-MM-DD");
+        this.maskForm.endTime = addTimerFormMinute(
+          date,
+          val,
+          this.singleClassMinutes
+        );
+      } else {
+        this.maskForm.endTime = "";
+      }
+      if (!this.maskForm.endTime) {
+        this.maskForm.startTime = "";
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.planList {
+  padding: 0 25px;
+
+  .planTop {
+    height: 40px;
+    line-height: 40px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    border-bottom: 1px solid #ccc;
+    margin-top: 20px;
+
+    > p {
+      font-size: 14px;
+    }
+  }
+
+  .planCore {
+    .row {
+      width: 100%;
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      flex-wrap: nowrap;
+      height: 40px;
+      line-height: 40px;
+      font-size: 14px;
+      text-align: center;
+
+      div {
+        width: 87px;
+      }
+    }
+  }
+  .nomore {
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    height: 40px;
+  }
+}
+</style>

+ 33 - 22
src/views/teacherManager/teacherDetail/components/courseInfo1.vue

@@ -1,22 +1,32 @@
 <template>
   <div class="courseInfo">
-    <save-form :inline="true" @submit="search" :model="searchList" ref="searchForm" save-key='teacherDetail-courseInfo1'>
+    <save-form
+      :inline="true"
+      @submit="search"
+      :model="searchList"
+      ref="searchForm"
+      save-key="teacherDetail-courseInfo1"
+    >
       <el-form-item>
         <el-input
           placeholder="vip编号/名称"
           clearable
-            @keyup.enter.native="
-              (e) => {
-                e.target.blur();
-                $refs.searchForm.save();
-                search();
-              }
-            "
+          @keyup.enter.native="
+            e => {
+              e.target.blur();
+              $refs.searchForm.save();
+              search();
+            }
+          "
           v-model.trim="searchList.search"
         ></el-input>
       </el-form-item>
-      <el-form-item >
-        <el-select v-model.trim="searchList.status" clearable placeholder="请选择课程状态">
+      <el-form-item>
+        <el-select
+          v-model.trim="searchList.status"
+          clearable
+          placeholder="请选择课程状态"
+        >
           <el-option
             v-for="(item, index) in vipGroupStatus"
             :key="index"
@@ -42,7 +52,7 @@
           </template>
         </el-table-column>
         <el-table-column label="VIP课名称" prop="name">
-              <template slot-scope="scope">
+          <template slot-scope="scope">
             <copy-text>
               {{ scope.row.name }}
             </copy-text>
@@ -93,8 +103,8 @@
         </el-table-column>
       </el-table>
       <pagination
-      save-key='teacherDetail-courseInfo1'
-      sync
+        save-key="teacherDetail-courseInfo1"
+        sync
         :total.sync="pageInfo.total"
         :page.sync="pageInfo.page"
         :limit.sync="pageInfo.limit"
@@ -113,13 +123,13 @@ import store from "@/store";
 export default {
   name: "courseInfo1",
   components: {
-    pagination,
+    pagination
   },
   data() {
     return {
       searchList: {
         status: "",
-        search: "",
+        search: ""
       },
       teamList: [],
       organId: null,
@@ -130,8 +140,8 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 1, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
-      },
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      }
     };
   },
   activated() {
@@ -152,7 +162,8 @@ export default {
         teacherId: this.teacherId,
         status: this.searchList.status || null,
         search: this.searchList.search || null,
-      }).then((res) => {
+        groupType: "VIP"
+      }).then(res => {
         if (res.code == 200) {
           this.teamList = res.data.rows;
           this.pageInfo.total = res.data.total;
@@ -162,7 +173,7 @@ export default {
     search() {
       this.pageInfo.page = 1;
       this.getList();
-    },
+    }
   },
   filters: {
     formatterTime(val) {
@@ -182,11 +193,11 @@ export default {
         "取消",
         "已结束",
         "报名结束",
-        "暂停",
+        "暂停"
       ];
       return arr[val];
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scope>

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

@@ -162,7 +162,8 @@ export default {
         page: this.rules.page,
         rows: this.rules.limit,
         startTime: this.searchForm.time[0] || null,
-        endTime: this.searchForm.time[1] || null
+        endTime: this.searchForm.time[1] || null,
+        groupType: 'VIP'
       }).then(res => {
         if (res.code == 200) {
           this.tableList = res.data.pageInfo.rows;

+ 47 - 41
src/views/vipClass/vipDetail/components/teacherRecord.vue

@@ -1,4 +1,4 @@
-<template >
+<template>
   <div>
     <!-- 头部展示 -->
     <statistic>
@@ -21,7 +21,7 @@
     </statistic>
     <!-- 搜索标题 -->
     <save-form
-      save-key='vipDetail-record'
+      save-key="vipDetail-record"
       :inline="true"
       label-position="right"
       label-width="120px"
@@ -60,7 +60,7 @@
           start-placeholder="课程开始日期"
           end-placeholder="课程结束日期"
           :picker-options="{
-            firstDayOfWeek: 1,
+            firstDayOfWeek: 1
           }"
         >
         </el-date-picker>
@@ -71,7 +71,10 @@
     </save-form>
     <!-- 列表 -->
     <div class="tableWrap">
-      <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
         <el-table-column align="center" label="课程编号" prop="id">
         </el-table-column>
         <el-table-column
@@ -150,8 +153,8 @@
               <el-button
                 v-if="
                   scope.row.status == 'OVER' &&
-                  !scope.row.isSalary &&
-                  permission('teacherAttendance/updateTeacherAttendance/3361')
+                    !scope.row.isSalary &&
+                    permission('teacherAttendance/updateTeacherAttendance/3361')
                 "
                 type="text"
                 @click="onMarkAttendance(scope.row)"
@@ -160,7 +163,7 @@
               <el-button
                 v-if="
                   scope.row.status == 'OVER' &&
-                  permission('studentAttendance/updateStudentAttendances')
+                    permission('studentAttendance/updateStudentAttendances')
                 "
                 type="text"
                 @click="onCallName(scope.row)"
@@ -174,7 +177,7 @@
       </el-table>
     </div>
     <pagination
-      save-key='vipDetail-record'
+      save-key="vipDetail-record"
       sync
       :total.sync="rules.total"
       :page.sync="rules.page"
@@ -296,7 +299,10 @@
     </el-dialog>
 
     <el-dialog title="点名表" width="800px" :visible.sync="rollCall.status">
-      <el-table :data="rollCall.gridData" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+      <el-table
+        :data="rollCall.gridData"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
         <el-table-column
           align="center"
           property="userName"
@@ -364,12 +370,12 @@ import { getSchool } from "@/api/systemManage";
 import {
   findVipGroupTeachingRecord,
   getStudyStudents,
-  resetVipClass,
+  resetVipClass
 } from "@/api/vipSeting";
 import {
   findAttendanceStudentByCourseWithPage,
   updateStudentAttendances,
-  updateTeacherAttendance,
+  updateTeacherAttendance
 } from "@/api/buildTeam";
 import { permission } from "@/utils/directivePage";
 export default {
@@ -380,7 +386,7 @@ export default {
       searchForm: {
         type: "",
         status: "",
-        time: [],
+        time: []
       },
       searchLsit: [],
       tableList: [],
@@ -399,26 +405,26 @@ export default {
         endTime: "",
         status: "",
         type: "",
-        cooperation: "",
+        cooperation: ""
       },
       markAttendance: {
         // 考勤状态
         status: false,
-        dataInfo: {},
+        dataInfo: {}
       },
       activeId: "",
       activeRow: null, //
       maskrules: {
         date: [{ required: true, message: "请选择修改日期", trigger: "blur" }],
         startTime: [{ required: true, message: "请选择开始", trigger: "blur" }],
-        endTime: [{ required: true, message: "请选择结束", trigger: "blur" }],
+        endTime: [{ required: true, message: "请选择结束", trigger: "blur" }]
       },
       rules: {
         // 分页规则
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       rollCall: {
         // 点名表
@@ -428,8 +434,8 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
-      },
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      }
     };
   },
   mounted() {
@@ -446,7 +452,7 @@ export default {
       // 获取vip教学记录
       this.getList();
       // 获取分部教学点
-      getSchool({ organId: null }).then((res) => {
+      getSchool({ organId: null }).then(res => {
         if (res.code == 200) {
           this.cooperationList = res.data;
         }
@@ -472,10 +478,11 @@ export default {
         rows: this.rules.limit,
         status: this.searchForm.status || null,
         teachMode: this.searchForm.type || null,
+        groupType: "VIP",
         startTime,
-        endTime,
+        endTime
       };
-      findVipGroupTeachingRecord(obj).then((res) => {
+      findVipGroupTeachingRecord(obj).then(res => {
         if (res.code == 200) {
           this.complaintsNum = res.data.baseInfo.complaintsNum;
           // 当前课数
@@ -494,9 +501,9 @@ export default {
       let params = {
         courseScheduleId: tempData.id,
         signInStatus: 1,
-        signOutStatus: 1,
+        signOutStatus: 1
       };
-      updateTeacherAttendance(params).then((res) => {
+      updateTeacherAttendance(params).then(res => {
         if (res.code == 200) {
           this.$message.success("补卡成功");
           this.markAttendance.status = false;
@@ -510,7 +517,7 @@ export default {
       // 补考勤
       this.markAttendance = {
         status: true,
-        dataInfo: item,
+        dataInfo: item
       };
     },
     onCallName(item) {
@@ -524,9 +531,9 @@ export default {
       let params = {
         page: rollCall.page,
         rows: rollCall.limit,
-        courseScheduleId: rollCall.selectItem.id,
+        courseScheduleId: rollCall.selectItem.id
       };
-      findAttendanceStudentByCourseWithPage(params).then((res) => {
+      findAttendanceStudentByCourseWithPage(params).then(res => {
         let result = res.data;
         rollCall.status = true;
         if (res.code == 200) {
@@ -542,11 +549,11 @@ export default {
         studentAttendances: [
           {
             userId: row.studentId,
-            status: type,
-          },
-        ],
+            status: type
+          }
+        ]
       };
-      updateStudentAttendances(params).then((res) => {
+      updateStudentAttendances(params).then(res => {
         if (res.code == 200) {
           this.$message.success("修改成功");
           row.status = type;
@@ -558,7 +565,7 @@ export default {
     },
     lookStudents(row) {
       let id = row.id;
-      getStudyStudents({ courseScheduleId: id }).then((res) => {
+      getStudyStudents({ courseScheduleId: id }).then(res => {
         if (res.code == 200) {
           this.studentList = res.data;
           this.studentVisible = true;
@@ -581,7 +588,7 @@ export default {
     },
     resetCourse() {
       // 点击弹窗效验
-      this.$refs["maskForm"].validate((valid) => {
+      this.$refs["maskForm"].validate(valid => {
         if (valid) {
           // 效验成功
           resetVipClass({
@@ -589,8 +596,8 @@ export default {
             classDate: this.maskForm.date,
             startClassTime: this.maskForm.date + " " + this.maskForm.startTime,
             endClassTime: this.maskForm.date + " " + this.maskForm.endTime,
-            schoolId: this.maskForm.cooperation,
-          }).then((res) => {
+            schoolId: this.maskForm.cooperation
+          }).then(res => {
             if (res.code == 200) {
               this.$message.success("调整成功");
               this.getList();
@@ -602,7 +609,7 @@ export default {
           });
         }
       });
-    },
+    }
   },
   filters: {
     fitterisSalary(val) {
@@ -632,19 +639,18 @@ export default {
         return val;
       }
     },
-    studentCallName: (value) => {
+    studentCallName: value => {
       let template = {
         NORMAL: "到课",
         TRUANT: "未到",
         LEAVE: "请假",
         DROP_OUT: "退学",
         LATE: "迟到",
-        "": "未到",
+        "": "未到"
       };
       return template[value];
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang="scss" scope>
-</style>
+<style lang="scss" scope></style>

+ 43 - 43
src/views/vipClass/vipDetail/components/vipBaseInfo.vue

@@ -91,7 +91,7 @@ import {
   getVipGroupDetail,
   findVipGroupStudents,
   leaveSchool,
-  updateVipBaseInfo,
+  updateVipBaseInfo
 } from "@/api/vipSeting";
 export default {
   props: ["vipDetail"],
@@ -108,17 +108,17 @@ export default {
         onlineClass: "", //线上课数
         offlineClass: "", //线下课数
         startTime: "", // 报名开始时间
-        endTime: "",
+        endTime: ""
       },
       rightForm: {
         allClass: "",
         onlineClass: "",
         offlineClass: "",
         allPrice: "",
-        progress: "",
+        progress: ""
       },
       tableList: [],
-      isreset: false,
+      isreset: false
     };
   },
   mounted() {
@@ -132,13 +132,13 @@ export default {
 
       // 根据id 获取vip学员
       this.getStudents();
-      this.getVipGroupDetail()
+      this.getVipGroupDetail();
     },
     getVipGroupDetail() {
       let id = this.$route.query.id;
-        getVipGroupDetail({ vipGroupId: id }).then((res) => {
-          if (res.code == 200) {
-            /**
+      getVipGroupDetail({ vipGroupId: id }).then(res => {
+        if (res.code == 200) {
+          /**
            *  teacherCount: '',
           subject: '', // 科目名称
           active: '', // 活动名称
@@ -151,44 +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;
-
-            // 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;
+          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;
+        }
+      });
     },
     getStudents() {
-      findVipGroupStudents({ vipGroupId: this.id }).then((res) => {
-        if (res.code == 200) {
-          this.tableList = res.data.rows;
+      findVipGroupStudents({ vipGroupId: this.id, groupType: "VIP" }).then(
+        res => {
+          if (res.code == 200) {
+            this.tableList = res.data.rows;
+          }
         }
-      });
+      );
     },
     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();
@@ -210,18 +210,18 @@ export default {
       updateVipBaseInfo({
         id: this.id,
         onlineClassesUnitPrice,
-        offlineClassesUnitPrice,
-      }).then((res) => {
+        offlineClassesUnitPrice
+      }).then(res => {
         if (res.code == 200) {
           this.$message.success("修改成功");
           this.isreset = false;
-          this.$emit('getVipGroupDetail')
+          this.$emit("getVipGroupDetail");
           // this.getVipGroupDetail(this.id);
         }
       });
-    },
+    }
   },
-  watch:{
+  watch: {
     // vipDetail(val){
     //   if(val){
     //     this.getVipGroupDetail();

+ 82 - 82
src/views/vipClass/vipDetail/components/vipStudentList.vue

@@ -174,16 +174,14 @@
             </div>
           </template>
         </el-table-column>
-                <el-table-column
+        <el-table-column
           label="剩余排课数"
           align="center"
           prop="totalClassTimes"
         >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.totalClassTimes}}节
-          </div>
-        </template>
+          <template slot-scope="scope">
+            <div>{{ scope.row.totalClassTimes }}节</div>
+          </template>
         </el-table-column>
         <el-table-column prop="studentId" label="线上课单价">
           <!--    v-if="activeStudent == scope.row.id" 202109/10跟辜经理确认过所有乐理课也不能改钱-->
@@ -327,7 +325,7 @@
               :picker-options="{
                 start: '04:30',
                 step: '00:05',
-                end: '23:55',
+                end: '23:55'
               }"
             >
             </el-time-select>
@@ -390,7 +388,7 @@ import {
   recoverForStudent,
   findTeacherWithVipGroupOrganAndSubject,
   vipGroupManageUpdate,
-  getVipGroupDetail,
+  getVipGroupDetail
 } from "@/api/vipSeting";
 import { permission } from "@/utils/directivePage";
 export default {
@@ -399,12 +397,12 @@ export default {
     return {
       expireVisible: false,
       expireForm: {
-        coursesExpireDate: "",
+        coursesExpireDate: ""
       },
       expireRules: {
         coursesExpireDate: [
-          { required: true, message: "请选择课程结束时间", trigger: "blur" },
-        ],
+          { required: true, message: "请选择课程结束时间", trigger: "blur" }
+        ]
       },
       adjustmentVisible: false,
       tableList: [],
@@ -416,11 +414,11 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       activeStudent: "",
       maskForm: {
-        search: "",
+        search: ""
       },
       adjustmentForm: {
         count: "",
@@ -431,7 +429,7 @@ export default {
         fee: "",
         teacher: "",
 
-        expireDate: "",
+        expireDate: ""
       },
       adjustmentRules: {
         courseTime: [{ required: true, message: "请选择开始时间" }],
@@ -440,7 +438,7 @@ export default {
         fee: [{ required: true, message: "请输入费用" }],
         teacher: [{ required: true, message: "请选择老师" }],
 
-        expireDate: [{ required: true, message: "请输入有效期截止" }],
+        expireDate: [{ required: true, message: "请输入有效期截止" }]
       },
       weekDateList: [
         { value: "1", label: "星期一" },
@@ -449,26 +447,26 @@ export default {
         { value: "4", label: "星期四" },
         { value: "5", label: "星期五" },
         { value: "6", label: "星期六" },
-        { value: "7", label: "星期日" },
+        { value: "7", label: "星期日" }
       ],
       weekList: [
         {
           dayOfWeek: "",
           startTime: "",
           endTime: "",
-          moid: new Date().getTime(),
-        },
+          moid: new Date().getTime()
+        }
       ],
       pickerOptions: {
         firstDayOfWeek: 1,
         disabledDate(time) {
           return time.getTime() + 86400000 <= new Date().getTime();
-        },
+        }
       },
       teacherList: [],
       vipDetail: {},
       deleteList: [],
-      isDetele: false,
+      isDetele: false
     };
   },
   mounted() {
@@ -488,13 +486,13 @@ export default {
       this.rules.page = 1;
       this.getStudents();
       findTeacherWithVipGroupOrganAndSubject({ vipGroupId: this.id }).then(
-        (res) => {
+        res => {
           if (res.code == 200) {
             this.teacherList = res.data;
           }
         }
       );
-      getVipGroupDetail({ vipGroupId: id }).then((res) => {
+      getVipGroupDetail({ vipGroupId: id }).then(res => {
         if (res.code == 200) {
           this.vipDetail = res.data;
         }
@@ -511,15 +509,17 @@ export default {
       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;
+      findVipGroupStudents({ vipGroupId: this.id, groupType: "VIP" }).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;
+            }
           }
         }
-      });
+      );
     },
     // 删除循环周
     removeWeek(item) {
@@ -533,7 +533,7 @@ export default {
       let studentId = scope.row.id;
       let vipGroupId = this.id;
       let amount = scope.row.fee;
-      leaveSchool({ studentId, vipGroupId, amount }).then((res) => {
+      leaveSchool({ studentId, vipGroupId, amount }).then(res => {
         if (res.code == 200) {
           this.$message.success("退学成功");
           this.getStudents();
@@ -541,14 +541,14 @@ export default {
         if (res.code == 206) {
           this.$confirm(res.msg, "提示", {
             confirmButtonText: "确定",
-            cancelButtonText: "取消",
+            cancelButtonText: "取消"
           }).then(() => {
             leaveSchool({
               studentId,
               vipGroupId,
               amount,
-              confirmReturnActivityGive: true,
-            }).then((res) => {
+              confirmReturnActivityGive: true
+            }).then(res => {
               if (res.code == 200) {
                 this.$message.success("退学成功");
                 this.getStudents();
@@ -562,7 +562,7 @@ export default {
       this.$confirm(`确定是否退学?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           let id = scope.row.id;
@@ -571,8 +571,8 @@ export default {
           } else {
             getStudentSurplusCourseFee({
               studentId: id,
-              vipGroupId: this.id,
-            }).then((res) => {
+              vipGroupId: this.id
+            }).then(res => {
               if (res.code == 200) {
                 // this.$prompt("请输入退课金额", "提示", {
                 //   confirmButtonText: "确定",
@@ -595,22 +595,22 @@ export default {
                       class: "el-input__inner",
                       attrs: { value: res.data.suplusCourseFee },
                       on: {
-                        input: function (event) {
+                        input: function(event) {
                           scope.row.fee = event.target.value;
                           this.$emit("input", event.target.value);
-                        }.bind(this),
-                      },
+                        }.bind(this)
+                      }
                     }),
                     h(
                       "p",
                       { style: "color: red;marginTop:20px" },
                       "退费金额暂不进入账户余额"
-                    ),
+                    )
                   ]),
                   showCancelButton: true,
                   confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                }).then((action) => {
+                  cancelButtonText: "取消"
+                }).then(action => {
                   this.leaveSchool(scope);
                 });
               }
@@ -628,7 +628,7 @@ export default {
           {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
-            type: "warning",
+            type: "warning"
           }
         )
           .then(() => {
@@ -646,17 +646,17 @@ export default {
         organId: null,
         page: this.rules.page,
         rows: this.rules.limit,
-        search,
-      }).then((res) => {
+        search
+      }).then(res => {
         if (res.code == 200) {
           this.rules.total = res.data.total;
           this.maskStudentList = res.data.rows;
-          let idList = this.deleteList.map((course) => {
+          let idList = this.deleteList.map(course => {
             return course.id;
           });
           this.isDetele = true;
           this.$nextTick(() => {
-            this.maskStudentList.forEach((course) => {
+            this.maskStudentList.forEach(course => {
               if (idList.indexOf(course.id) != -1) {
                 this.$refs.maskStudentList.toggleRowSelection(course, true);
               }
@@ -664,15 +664,13 @@ export default {
             this.isDetele = false;
           });
 
-          this.maskStudentList.forEach((stu) => {
+          this.maskStudentList.forEach(stu => {
             stu.offlineClassesUnitPrice
               ? stu.offlineClassesUnitPrice
-              : (stu.offlineClassesUnitPrice =
-                  this.vipDetail?.offlineClassesUnitPrice);
+              : (stu.offlineClassesUnitPrice = this.vipDetail?.offlineClassesUnitPrice);
             stu.onlineClassesUnitPrice
               ? stu.onlineClassesUnitPrice
-              : (stu.onlineClassesUnitPrice =
-                  this.vipDetail?.onlineClassesUnitPrice);
+              : (stu.onlineClassesUnitPrice = this.vipDetail?.onlineClassesUnitPrice);
           });
           this.maskVisible = true;
         }
@@ -690,12 +688,12 @@ export default {
         if (this.isDetele) return;
         // 有2种 1是新页
         // 2是点击反选
-        let idList = this.deleteList.map((course) => {
+        let idList = this.deleteList.map(course => {
           return course.id;
         });
         this.$nextTick(() => {
           let tableIdList = [];
-          this.maskStudentList.forEach((course) => {
+          this.maskStudentList.forEach(course => {
             tableIdList.push(course.id);
             if (idList.indexOf(course.id) != -1) {
               this.$refs.maskStudentList.toggleRowSelection(course, false);
@@ -704,7 +702,7 @@ export default {
           });
           this.deleteList = this.$helpers.lodash.remove(
             this.deleteList,
-            function (item) {
+            function(item) {
               return tableIdList.indexOf(item.id) == -1;
             }
           );
@@ -715,7 +713,7 @@ export default {
       }
     },
     onTableSelect(rows, row) {
-      let idList = this.deleteList.map((course) => {
+      let idList = this.deleteList.map(course => {
         return course.id;
       });
       if (idList.indexOf(row.id) != -1) {
@@ -743,13 +741,13 @@ export default {
         return;
       }
       let str = "";
-      let arr = this.deleteList.map((stu) => {
+      let arr = this.deleteList.map(stu => {
         str += stu.userName + ",";
         return {
           vipGroupId: this.id,
           studentId: stu.id,
           offlineClassesUnitPrice: stu.offlineClassesUnitPrice,
-          onlineClassesUnitPrice: stu.onlineClassesUnitPrice,
+          onlineClassesUnitPrice: stu.onlineClassesUnitPrice
         };
       });
       str = str.slice(0, str.length - 1);
@@ -777,10 +775,10 @@ export default {
       this.$confirm(`是否将${str}加入课程组?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
-        .then(async (res) => {
-          addVipGroupStudents(arr).then((res) => {
+        .then(async res => {
+          addVipGroupStudents(arr).then(res => {
             if (res.code == 200) {
               this.$message.success("添加成功");
               this.getStudents();
@@ -788,7 +786,7 @@ export default {
             }
           });
         })
-        .catch((e) => {
+        .catch(e => {
           console.log(e);
         });
     },
@@ -796,14 +794,14 @@ export default {
       this.$confirm("是否休学?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           // 发请求 申请休学
           vipPauseForStudent({
             vipGroupId: this.id,
-            studentId: scope.row.id,
-          }).then((res) => {
+            studentId: scope.row.id
+          }).then(res => {
             if (res.code == 200) {
               this.$message.success("休学成功");
               this.getStudents();
@@ -815,8 +813,8 @@ export default {
     recoveryCourse(scope) {
       getStudentPauseInfo({
         studentId: scope.row.id,
-        vipGroupId: this.id,
-      }).then((res) => {
+        vipGroupId: this.id
+      }).then(res => {
         if (res.code == 200) {
           if (res.data.isPause == 0) {
             // vip状态没暂停 不需要排课
@@ -825,20 +823,20 @@ export default {
             this.$msgbox({
               title: "提示",
               message: h("p", null, [
-                h("p", null, "将按照当前剩余课时安排上课"),
+                h("p", null, "将按照当前剩余课时安排上课")
                 // h("span", null, `排课截至时间:`),
                 // h("span", { style: "color: red" }, `${res.data.expireDate}`), 辜经理同意注释
               ]),
               confirmButtonText: "确定",
               cancelButtonText: "取消",
-              showCancelButton: true,
+              showCancelButton: true
             })
               .then(() => {
                 // 发请求 恢复上课
                 recoverForStudent({
                   vipGroupId: this.id,
-                  userId: scope.row.id,
-                }).then((res) => {
+                  userId: scope.row.id
+                }).then(res => {
                   if (res.code == 200) {
                     this.adjustmentVisible = false;
                     this.getStudents();
@@ -850,7 +848,9 @@ export default {
             this.activeStudent = res.data.studentId;
             this.adjustmentVisible = true;
             this.adjustmentForm.teacher = res.data.teacherId;
-            this.adjustmentForm.count = `${res.data.totalCourseTimes}+${res.data.giveCourseTimes}`;
+            this.adjustmentForm.count = `${res.data.totalCourseTimes}+${
+              res.data.giveCourseTimes
+            }`;
             this.adjustmentForm.expireDate = res.data.expireDate;
           }
         }
@@ -877,7 +877,7 @@ export default {
         dayOfWeek: "",
         startClassTime: "",
         endClassTime: "",
-        id: new Date(),
+        id: new Date()
       });
     },
     submieRecover() {
@@ -885,7 +885,7 @@ export default {
         this.$message.error("排课循环次数不能为空");
         return;
       }
-      this.$refs["adjustmentForm"].validate((res) => {
+      this.$refs["adjustmentForm"].validate(res => {
         if (res) {
           // 发请求
           let obj = {};
@@ -897,7 +897,7 @@ export default {
           obj.courseTimes = this.weekList;
           obj.vipGroupId = this.id;
           obj.expireDate = this.adjustmentForm.expireDate;
-          recoverForStudent(obj).then((res) => {
+          recoverForStudent(obj).then(res => {
             if (res.code == 200) {
               this.adjustmentVisible = false;
               this.getStudents();
@@ -910,12 +910,12 @@ export default {
       this.activeStudent;
     },
     submitExpireDate() {
-      this.$refs.expireForm.validate((some) => {
+      this.$refs.expireForm.validate(some => {
         if (some) {
           vipGroupManageUpdate({
             id: this.id,
-            coursesExpireDate: this.expireForm.coursesExpireDate,
-          }).then((res) => {
+            coursesExpireDate: this.expireForm.coursesExpireDate
+          }).then(res => {
             if (res.code == 200) {
               this.$message.success("有效期修改成功");
               this.expireVisible = false;
@@ -928,7 +928,7 @@ export default {
           return;
         }
       });
-    },
+    }
   },
   watch: {
     maskVisible(val) {
@@ -939,11 +939,11 @@ export default {
           limit: 10, // 限制显示条数
           page: 1, // 当前页
           total: 0, // 总条数
-          page_size: [10, 20, 40, 50], // 选择限制显示条数
+          page_size: [10, 20, 40, 50] // 选择限制显示条数
         };
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 68 - 71
src/views/vipClass/vipList.vue

@@ -111,7 +111,8 @@
       </save-form>
       <!-- 查询列表 -->
       <el-button
-        v-permission="'/buildVip'" @click="gotoBuildVip"
+        v-permission="'/buildVip'"
+        @click="gotoBuildVip"
         type="primary"
         style="margin-bottom:20px"
       >
@@ -126,7 +127,8 @@
         导出
       </el-button>
       <el-button
-        v-permission="'export/vipGroup'" @click="onStudentExport"
+        v-permission="'export/vipGroup'"
+        @click="onStudentExport"
         type="primary"
         style="margin-bottom:20px"
       >
@@ -220,8 +222,8 @@
                 <p>
                   {{
                     scope.row.currentClassTimes +
-                    "/" +
-                    scope.row.totalClassTimes
+                      "/" +
+                      scope.row.totalClassTimes
                   }}
                 </p>
               </div>
@@ -306,8 +308,8 @@
                   width="160"
                   v-if="
                     scope.row.status < 3 &&
-                    scope.row.enableDelete != 1 &&
-                    permission('vipGroupManage/stopVipGroup')
+                      scope.row.enableDelete != 1 &&
+                      permission('vipGroupManage/stopVipGroup')
                   "
                   :ref="scope.$index"
                 >
@@ -317,16 +319,10 @@
                     placeholder="请输入关闭原因"
                   ></el-input>
                   <div style="text-align: right; margin-top: 20px">
-                    <el-button
-
-                      type="text"
-                      @click="onCancelVip(scope)"
+                    <el-button type="text" @click="onCancelVip(scope)"
                       >取消</el-button
                     >
-                    <el-button
-                      type="primary"
-
-                      @click="closeVip(scope)"
+                    <el-button type="primary" @click="closeVip(scope)"
                       >确定</el-button
                     >
                   </div>
@@ -337,7 +333,7 @@
                   @click="onVipDelete(scope.row)"
                   v-if="
                     scope.row.enableDelete == 1 &&
-                    permission('vipGroupManage/deleteVipGroup')
+                      permission('vipGroupManage/deleteVipGroup')
                   "
                   >删除</el-button
                 >
@@ -355,8 +351,8 @@
                   type="text"
                   v-if="
                     scope.row.vipGroupCategoryName == '乐理课' &&
-                    permission('vipGroupManage/update') &&
-                    scope.row.status == 1
+                      permission('vipGroupManage/update') &&
+                      scope.row.status == 1
                   "
                   @click="isStartCourse(scope.row)"
                   >确认成课</el-button
@@ -385,7 +381,7 @@ import {
   vipGroupActivity,
   closeVip,
   vipGroupManageUpdate,
-  deleteVipGroup,
+  deleteVipGroup
 } from "@/api/vipSeting";
 import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
 import store from "@/store";
@@ -405,7 +401,7 @@ export default {
         search: null,
         orgin: null,
         status: null,
-        hasEducationalTeacherId: null,
+        hasEducationalTeacherId: null
       },
       teacherList: [],
       activeList: [],
@@ -416,7 +412,7 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       statusList: [
         { lable: "未开始", value: "0" },
@@ -425,9 +421,9 @@ export default {
         { lable: "进行中", value: "2" },
         { lable: "已结束", value: "4" },
         { lable: "取消", value: "3" },
-        { lable: "暂停", value: "6" },
+        { lable: "暂停", value: "6" }
       ],
-      stopReason: null, // 停止原因
+      stopReason: null // 停止原因
     };
   },
   created() {},
@@ -443,7 +439,7 @@ export default {
   },
   methods: {
     init() {
-      getEmployeeOrgan().then((res) => {
+      getEmployeeOrgan().then(res => {
         if (res.code == 200) {
           this.organList = res.data;
         }
@@ -456,7 +452,7 @@ export default {
       //   }
       // });
       // 获取活动方案
-      vipGroupActivity({ organId: this.organId, rows: 9999 }).then((res) => {
+      vipGroupActivity({ organId: this.organId, rows: 9999 }).then(res => {
         if (res.code == 200) {
           this.activeList = res.data.rows;
         }
@@ -473,7 +469,7 @@ export default {
         activityId: null,
         search: null,
         orgin: null,
-        status: null,
+        status: null
       };
       this.getList();
     },
@@ -485,7 +481,8 @@ export default {
         this.searchForm.hasEducationalTeacherId || null;
       params.organId = this.searchForm.orgin || null;
       params.status = this.searchForm.status || null;
-      getVipList(params).then((res) => {
+      params.groupType = "VIP";
+      getVipList(params).then(res => {
         if (res.code == 200) {
           // this.tableData = [];
           setTimeout(() => {
@@ -508,18 +505,20 @@ export default {
       let startTimeStr = row.courseStartDate;
       this.$router.push({
         path: "/business/vipDetail",
-        query: {  id,
+        query: {
+          id,
           educationalTeacherId,
           organId,
           userId,
           name,
           endTimeStr,
-          startTimeStr,},
+          startTimeStr
+        }
       });
     },
     closeVip(scope) {
       let id = scope.row.id;
-      closeVip({ vipGroupId: id, stopReason: this.stopReason }).then((res) => {
+      closeVip({ vipGroupId: id, stopReason: this.stopReason }).then(res => {
         if (res.code == 200) {
           this.$message.success("停止课程成功");
           scope._self.$refs[scope.$index].doClose();
@@ -533,7 +532,7 @@ export default {
     },
     gotoBuildVip() {
       this.$router.push({
-        path: "/business/buildVip",
+        path: "/business/buildVip"
       });
     },
     onVIPCourseExport() {
@@ -544,7 +543,7 @@ export default {
         activityId: searchForm.activityId || null,
         organId: searchForm.orgin || null,
         status: searchForm.status || null,
-        search: searchForm.search || null,
+        search: searchForm.search || null
       };
       let url = "/api-web/export/vipGroupList";
       const options = {
@@ -555,36 +554,36 @@ export default {
         },
         params: data,
         url,
-        responseType: "blob",
+        responseType: "blob"
       };
       this.$confirm("您确定导出VIP课吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           load.startLoading();
           axios(options)
-            .then((res) => {
+            .then(res => {
               let blob = new Blob([res.data], {
                 // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
-                type: "application/vnd.ms-excel;charset=utf-8",
+                type: "application/vnd.ms-excel;charset=utf-8"
                 //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
               });
 
               let text = new Response(blob).text();
-              text.then((res) => {
+              text.then(res => {
                 // 判断是否报错
                 if (res.indexOf("code") != -1) {
                   let json = JSON.parse(res);
-                  if(json.code == 403) {
-                    this.$message.error(`登录过期,请重新登录!`)
+                  if (json.code == 403) {
+                    this.$message.error(`登录过期,请重新登录!`);
                     setTimeout(() => {
-                      this.$store.dispatch('user/resetToken').then(() => {
-                        location.reload()
-                      })
+                      this.$store.dispatch("user/resetToken").then(() => {
+                        location.reload();
+                      });
                     }, 1000);
-                    return
+                    return;
                   }
                   this.$message.error(json.msg);
                 } else {
@@ -599,7 +598,7 @@ export default {
               });
               load.endLoading();
             })
-            .catch((error) => {
+            .catch(error => {
               this.$message.error("导出数据失败,请联系管理员");
               load.endLoading();
             });
@@ -619,36 +618,36 @@ export default {
         },
         params: data,
         url,
-        responseType: "blob",
+        responseType: "blob"
       };
       this.$confirm("VIP课程续费提醒导出?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           load.startLoading();
           axios(options)
-            .then((res) => {
+            .then(res => {
               let blob = new Blob([res.data], {
                 // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
-                type: "application/vnd.ms-excel;charset=utf-8",
+                type: "application/vnd.ms-excel;charset=utf-8"
                 //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
               });
 
               let text = new Response(blob).text();
-              text.then((res) => {
+              text.then(res => {
                 // 判断是否报错
                 if (res.indexOf("code") != -1) {
                   let json = JSON.parse(res);
-                  if(json.code == 403) {
-                    this.$message.error(`登录过期,请重新登录!`)
+                  if (json.code == 403) {
+                    this.$message.error(`登录过期,请重新登录!`);
                     setTimeout(() => {
-                      this.$store.dispatch('user/resetToken').then(() => {
-                        location.reload()
-                      })
+                      this.$store.dispatch("user/resetToken").then(() => {
+                        location.reload();
+                      });
                     }, 1000);
-                    return
+                    return;
                   }
                   this.$message.error(json.msg);
                 } else {
@@ -663,7 +662,7 @@ export default {
               });
               load.endLoading();
             })
-            .catch((error) => {
+            .catch(error => {
               this.$message.error("导出数据失败,请联系管理员");
               load.endLoading();
             });
@@ -690,8 +689,8 @@ export default {
           userId,
           name,
           endTimeStr,
-          startTimeStr,
-        },
+          startTimeStr
+        }
       });
     },
     // 删除VIP
@@ -699,10 +698,10 @@ export default {
       this.$confirm("您确定删除该VIP课吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
-          deleteVipGroup({ vipGroupId: row.id }).then((res) => {
+          deleteVipGroup({ vipGroupId: row.id }).then(res => {
             if (res.code == 200) {
               this.$message.success("删除成功");
               this.getList();
@@ -719,20 +718,18 @@ export default {
       this.$confirm("确定开启乐理课", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
-          vipGroupManageUpdate({ id: row.id, status: "PROGRESS" }).then(
-            (res) => {
-              if (res.code == 200) {
-                this.$message.success("提交成功");
-                this.getList();
-              }
+          vipGroupManageUpdate({ id: row.id, status: "PROGRESS" }).then(res => {
+            if (res.code == 200) {
+              this.$message.success("提交成功");
+              this.getList();
             }
-          );
+          });
         })
         .catch(() => {});
-    },
+    }
   },
   filters: {
     formatterTime(val) {
@@ -752,11 +749,11 @@ export default {
         "取消",
         "已结束",
         "报名结束",
-        "暂停",
+        "暂停"
       ];
       return arr[val];
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 2 - 1
src/views/vipClass/vipReset.vue

@@ -672,7 +672,8 @@ export default {
       findVipGroupCourseSchedules({
         vipGroupId: this.vipid,
         rows: this.rules.limit,
-        page: this.rules.page
+        page: this.rules.page,
+        gorupType: 'VIP'
       }).then(res => {
         if (res.code == 200) {
           this.tableList = res.data.pageInfo.rows;

+ 1 - 4
vue.config.js

@@ -16,13 +16,10 @@ const name = defaultSettings.title || "管乐迷后台管理系统"; // page tit
 // http://47.99.212.176:8000
 //  https://online.dayaedu.com
 // let target = "https://online.dayaedu.com"; //线上
-// let target = 'http://192.168.3.251:8000' // 何国威
 // let target = 'http://192.168.3.20:8000' //邹璇
 // let target = 'http://192.168.3.161:8000' //勇哥
-// let target = 'http://192.168.3.146:8000' //王昭
-// let target = 'http://dev.dayaedu.com' // 开发环境
+// let target = "http://192.168.3.143:8000"; //
 let target = "https://test.dayaedu.com"; //测试环境
-// let target = "https://online.dayaedu.com"; //测试环境
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**