lex 2 سال پیش
والد
کامیت
e48fb8c1eb

+ 13 - 2
src/views/baseRulesClassSetting/index.vue

@@ -72,6 +72,14 @@
         >
           <practiceRules v-if="activeIndex == '5'" />
         </el-tab-pane>
+        <el-tab-pane
+          label="直播课设置"
+          lazy
+          name="9"
+          v-if="permissionList.liveCourseType"
+        >
+          <liveClassSetting v-if="activeIndex == '9'" />
+        </el-tab-pane>
       </tab-router>
     </div>
   </div>
@@ -84,6 +92,7 @@ import chargesList from "@/views/categroyManager/specialSetup/chargesList";
 import vipCourseType from "@/views/categroyManager/generalSettings/vipCourseType";
 import discountManage from "@/views/categroyManager/specialSetup/discountManage";
 import vipChargeSeting from "@/views/categroyManager/vipChargeSeting";
+import liveClassSetting from "./live-class-setting";
 import auditionSetting from "./audition";
 import practiceRules from "./practiceRules";
 import { permission } from "@/utils/directivePage";
@@ -97,7 +106,8 @@ export default {
     typesManager,
     discountManage,
     vipChargeSeting,
-    practiceRules
+    practiceRules,
+    liveClassSetting
   },
   name: "baseRulersManager",
   data() {
@@ -111,7 +121,8 @@ export default {
         typesManager: permission("/globalConfig/typesManager"),
         discountManage: permission("/specialSetup/discountManage"),
         vipChargeSeting: permission("/vipChargeSeting"),
-        practiceRules: permission("/practiceRules")
+        practiceRules: permission("/practiceRules"),
+        liveCourseType: permission("//liveCourseType")
       }
     };
   },

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

@@ -0,0 +1,357 @@
+<template>
+  <div>
+    <!-- 列表 -->
+    <div>
+      <el-alert
+        title="时长设置"
+        :closable="false"
+        type="info"
+        style="margin: 0px 0 20px"
+      />
+      <el-table
+        :data="topList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" label="课程类型">
+          <template slot-scope="scope">
+            直播课
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="singleClassMinutes"
+          label="课程时长(分钟)"
+        >
+        </el-table-column>
+        <el-table-column align="center" label="操作">
+          <template slot-scope="scope">
+            <el-button
+              v-permission="'vipGroupCategory/update'"
+              @click="resetGroupCategory(scope.row)"
+              type="text"
+              >修改</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div class="tableWrap">
+      <el-alert
+        title="收费设置"
+        :closable="false"
+        type="info"
+        style="margin: 20px 0"
+      />
+      <save-form
+        :inline="true"
+        ref="searchForm"
+        class="searchForm"
+        @submit="search"
+        :model.sync="searchForm"
+        save-key="/baseRulesClassSetting/vipChargeSetting"
+      >
+        <el-form-item prop="organId">
+          <el-select
+            class="multiple"
+            style="width: 180px !important"
+            v-model.trim="searchForm.organId"
+            filterable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+        </el-form-item>
+      </save-form>
+      <el-table
+        :data="tableList"
+        style="width: 100% !important"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column prop="name" label="课程类型">
+          <template slot-scope="scope">
+            直播课
+          </template></el-table-column
+        >
+        <el-table-column prop="onlineClassesUnitPrice" label="售价">
+          <template slot-scope="scope">
+            <div>
+              <el-input v-model.trim="scope.row.onlineClassesUnitPrice">
+                <template slot="append"
+                  >元/节</template
+                >
+              </el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="offlineClassesUnitPrice" label="原价">
+          <template slot-scope="scope">
+            <div>
+              <el-input v-model.trim="scope.row.offlineClassesUnitPrice">
+                <template slot="append"
+                  >元/节</template
+                ></el-input
+              >
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div>
+              <el-button
+                type="text"
+                v-if="
+                  $helpers.permission('vipGroupDefaultClassesUnitPrice/add')
+                "
+                @click="saveSeting(scope.row)"
+                >保存</el-button
+              >
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <!-- 课程类型新增弹窗 -->
+    <el-dialog
+      title="修改直播课时长"
+      class="courseMask"
+      width="500px"
+      @close="onVipStatusClose('vipStatus')"
+      :visible.sync="liveStatus"
+    >
+      <el-form :model="liveStatusFrom" ref="vipStatus">
+        <el-form-item
+          label="课程类型"
+          :rules="[
+            { required: true, message: '请输入课程形式', trigger: 'blur' }
+          ]"
+          :label-width="formLabelWidth"
+          prop="musicTheory"
+        >
+          <el-select
+            v-model="liveStatusFrom.musicTheory"
+            style="width:100%!important"
+          >
+            <el-option label="直播课" :value="false"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="课程课时"
+          prop="dynamicTags"
+          :rules="[
+            {
+              required: true,
+              message: '请输入课程课时',
+              trigger: 'blur, change'
+            }
+          ]"
+          :label-width="formLabelWidth"
+        >
+          <el-tag
+            :key="index"
+            effect="dark"
+            type="info"
+            v-for="(tag, index) in liveStatusFrom.dynamicTags"
+            closable
+            :disable-transitions="false"
+            @close="handleClose(tag)"
+          >
+            {{ tag }}
+          </el-tag>
+          <el-input
+            class="input-new-tag"
+            v-if="inputVisible"
+            v-model.trim="inputValue"
+            ref="saveTagInput"
+            style="width: 100px"
+            @keyup.enter.native="handleInputConfirm"
+          >
+          </el-input>
+          <el-button
+            v-if="!inputVisible"
+            class="button-new-tag"
+            @click="showInput"
+            >+ 添加</el-button
+          >
+          <el-button
+            v-if="inputVisible"
+            class="button-new-tag"
+            @click="handleInputConfirm"
+            >保存</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="liveStatus = false">取 消</el-button>
+        <el-button type="primary" @click="addLiveStatus('vipStatus')"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { Searchs } from "@/helpers";
+import {
+  vipGroupCategory,
+  resetVipGroupCategory,
+  defaultClassesUnitPrice
+} from "@/api/vipSeting";
+export default {
+  name: "practiceRules",
+  data() {
+    return {
+      formLabelWidth: "120px",
+      activeRow: null,
+      topList: [],
+      inputVisible: false,
+      inputValue: "",
+      liveStatus: false,
+      liveStatusFrom: {
+        name: "",
+        num: "",
+        dynamicTags: [],
+        isAdd: true,
+        musicTheory: false,
+        id: ""
+      }, // 弹窗内容
+      tableList: [],
+      searchForm: {
+        organId: null
+      }
+    };
+  },
+  async mounted() {
+    await this.$store.dispatch("setBranchs");
+    // 获取缓存的分部编号
+    const searchs = new Searchs(this.$route.fullPath);
+    const branchId = searchs.searchs[searchs.key]?.form.organId;
+    this.searchForm.organId = branchId
+      ? branchId
+      : this.selects?.branchs[0]["id"];
+
+    this.getVipGroupCategoryList();
+    this.getList();
+  },
+  methods: {
+    resetGroupCategory(row) {
+      // 修改课程形式
+      const liveStatusFrom = this.liveStatusFrom;
+      this.$nextTick(() => {
+        liveStatusFrom.name = row.name;
+        liveStatusFrom.timer = row.singleClassMinutes.split(",");
+        liveStatusFrom.dynamicTags = row.singleClassMinutes.split(",");
+        liveStatusFrom.num = row.studentNum;
+        liveStatusFrom.id = row.id;
+        liveStatusFrom.isAdd = false;
+        liveStatusFrom.musicTheory = row.musicTheory;
+      });
+      this.liveStatus = true;
+    },
+    onVipStatusClose(formName) {
+      this.inputVisible = false;
+      this.inputValue = "";
+      this.$refs[formName].resetFields();
+    },
+    showInput() {
+      this.inputVisible = true;
+      this.$nextTick(_ => {
+        this.$refs.saveTagInput.$refs.input.focus();
+      });
+    },
+    handleInputConfirm() {
+      let inputValue = this.inputValue;
+      if (inputValue) {
+        this.liveStatusFrom.dynamicTags.push(inputValue);
+      }
+      this.inputVisible = false;
+      this.inputValue = "";
+    },
+    handleClose(tag) {
+      this.liveStatusFrom.dynamicTags.splice(
+        this.liveStatusFrom.dynamicTags.indexOf(tag),
+        1
+      );
+    },
+    addLiveStatus(formName) {
+      this.$refs[formName].validate(async valid => {
+        if (valid) {
+          const liveStatusFrom = this.liveStatusFrom;
+          await resetVipGroupCategory({
+            name: liveStatusFrom.name,
+            singleClassMinutes: liveStatusFrom.dynamicTags.join(","),
+            studentNum: liveStatusFrom.num,
+            id: liveStatusFrom.id,
+            musicTheory: liveStatusFrom.musicTheory
+          }).then(res => {
+            this.$message.success("修改成功");
+            this.getVipGroupCategoryList();
+            this.liveStatus = false;
+          });
+        }
+      });
+    },
+    async getVipGroupCategoryList() {
+      // 获取默认左边参数
+      await vipGroupCategory({
+        groupType: "live"
+      }).then(res => {
+        if (res.code == 200) {
+          this.topList = res.data;
+        }
+      });
+    },
+    search() {
+      this.$refs.searchForm.validate(valid => {
+        this.getList();
+      });
+    },
+    saveSeting(row) {
+      defaultClassesUnitPrice({
+        offlineClassesUnitPrice: row.offlineClassesUnitPrice,
+        onlineClassesUnitPrice: row.onlineClassesUnitPrice,
+        organId: this.searchForm.organId,
+        vipGroupCategoryId: row.id
+      }).then(res => {
+        if (res.code == 200) {
+          // 保存成功提示=> 刷新列表
+          this.$message.success("保存成功");
+        } else {
+          // 保存失败
+          this.$message.error("保存失败,请重试");
+        }
+      });
+    },
+    getList() {
+      vipGroupCategory({
+        organId: this.searchForm.organId,
+        groupType: "live"
+      }).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data;
+        }
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.createForm {
+  ::v-deep .el-input {
+    width: 340px !important;
+  }
+}
+
+.el-tag--info {
+  margin-right: 4px;
+}
+</style>

+ 35 - 42
src/views/categroyManager/generalSettings/vipCourseType.vue

@@ -4,15 +4,13 @@
       v-permission="'vipGroupCategory/add'"
       @click="addGroupCategory"
       type="primary"
-      
       style="margin-bottom: 20px"
-       icon="el-icon-plus"
+      icon="el-icon-plus"
       >新建</el-button
     >
     <el-table
       :data="leftList"
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
-      
     >
       <el-table-column label="课程形式" prop="name"> </el-table-column>
       <el-table-column label="课程类型" prop="singleClassMinutes">
@@ -34,7 +32,6 @@
               type="text"
               v-permission="'vipGroupCategory/update'"
               @click="resetGroupCategory(scope.row)"
-              
               >修改</el-button
             >
             <el-popover
@@ -46,19 +43,15 @@
               <p>您确定删除该课程形态吗?</p>
               <div style="text-align: right; margin: 0">
                 <el-button
-                  
                   type="text"
                   @click="scope._self.$refs[scope.row.id].doClose()"
                   >取消</el-button
                 >
-                <el-button
-                  type="primary"
-                  
-                  @click="removeGroupCategory(scope)"
+                <el-button type="primary" @click="removeGroupCategory(scope)"
                   >确定</el-button
                 >
               </div>
-              <el-button type="text" slot="reference" >删除</el-button>
+              <el-button type="text" slot="reference">删除</el-button>
             </el-popover>
           </div>
         </template>
@@ -72,12 +65,12 @@
       @close="onVipStatusClose('vipStatus')"
       :visible.sync="vipStatus"
     >
-      <el-form :model="vipStatusFrom" ref="vipStatus" >
+      <el-form :model="vipStatusFrom" ref="vipStatus">
         <el-form-item
           label="课程形式"
           prop="name"
           :rules="[
-            { required: true, message: '请输入课程形式', trigger: 'blur' },
+            { required: true, message: '请输入课程形式', trigger: 'blur' }
           ]"
           :label-width="formLabelWidth"
         >
@@ -89,15 +82,18 @@
         <el-form-item
           label="课程类型"
           :rules="[
-            { required: true, message: '请输入课程形式', trigger: 'blur' },
+            { required: true, message: '请输入课程形式', trigger: 'blur' }
           ]"
           :label-width="formLabelWidth"
           prop="musicTheory"
         >
-        <el-select v-model="vipStatusFrom.musicTheory" style="width:100%!important">
-          <el-option label="VIP" :value="false"></el-option>
-          <el-option label="乐理课" :value="true"></el-option>
-        </el-select>
+          <el-select
+            v-model="vipStatusFrom.musicTheory"
+            style="width:100%!important"
+          >
+            <el-option label="VIP" :value="false"></el-option>
+            <el-option label="乐理课" :value="true"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item
           label="班级人数"
@@ -108,8 +104,8 @@
               required: true,
               message: '班级人数最大6人',
               trigger: 'blur',
-              pattern: /^[0-6]$/,
-            }, //辜经理要求vip人数最大6人
+              pattern: /^[0-6]$/
+            } //辜经理要求vip人数最大6人
           ]"
           :label-width="formLabelWidth"
         >
@@ -126,8 +122,8 @@
             {
               required: true,
               message: '请输入课程课时',
-              trigger: 'blur, change',
-            },
+              trigger: 'blur, change'
+            }
           ]"
           :label-width="formLabelWidth"
         >
@@ -148,29 +144,26 @@
             v-model.trim="inputValue"
             ref="saveTagInput"
             style="width: 100px"
-            
             @keyup.enter.native="handleInputConfirm"
           >
           </el-input>
           <el-button
             v-if="!inputVisible"
             class="button-new-tag"
-            
             @click="showInput"
             >+ 添加</el-button
           >
           <el-button
             v-if="inputVisible"
             class="button-new-tag"
-            
             @click="handleInputConfirm"
             >保存</el-button
           >
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button  @click="vipStatus = false">取 消</el-button>
-        <el-button  type="primary" @click="addVipStatus('vipStatus')"
+        <el-button @click="vipStatus = false">取 消</el-button>
+        <el-button type="primary" @click="addVipStatus('vipStatus')"
           >确 定</el-button
         >
       </div>
@@ -182,7 +175,7 @@ import {
   removeVipGroupCategory,
   vipGroupCategory,
   addVipGroupCategory,
-  resetVipGroupCategory,
+  resetVipGroupCategory
 } from "@/api/vipSeting";
 export default {
   data() {
@@ -196,10 +189,10 @@ export default {
         num: "",
         dynamicTags: [],
         isAdd: true,
-        musicTheory:false,
-        id: "",
+        musicTheory: false,
+        id: ""
       }, // 弹窗内容
-      inputVisible: false,
+      inputVisible: false
     };
   },
   mounted() {
@@ -217,13 +210,13 @@ export default {
         vipStatusFrom.num = row.studentNum;
         vipStatusFrom.id = row.id;
         vipStatusFrom.isAdd = false;
-        vipStatusFrom.musicTheory = row.musicTheory
+        vipStatusFrom.musicTheory = row.musicTheory;
       });
     },
     async removeGroupCategory(scope) {
       await removeVipGroupCategory({
-        id: scope.row.id,
-      }).then((res) => {
+        id: scope.row.id
+      }).then(res => {
         if (res.code == 200) {
           scope._self.$refs[scope.row.id].doClose();
           this.$message.success("删除成功");
@@ -238,7 +231,7 @@ export default {
     },
     showInput() {
       this.inputVisible = true;
-      this.$nextTick((_) => {
+      this.$nextTick(_ => {
         this.$refs.saveTagInput.$refs.input.focus();
       });
     },
@@ -249,7 +242,7 @@ export default {
     },
     async getVipGroupCategoryList() {
       // 获取默认左边参数
-      await vipGroupCategory().then((res) => {
+      await vipGroupCategory().then(res => {
         if (res.code == 200) {
           this.leftList = res.data;
         }
@@ -258,7 +251,7 @@ export default {
     addVipStatus(formName) {
       // 点击添加后 发送请求单独添加=> 刷新列表
       // 判断是添加还是修改
-      this.$refs[formName].validate(async (valid) => {
+      this.$refs[formName].validate(async valid => {
         console.log(valid);
         if (valid) {
           const vipStatusFrom = this.vipStatusFrom;
@@ -267,8 +260,8 @@ export default {
               name: vipStatusFrom.name,
               singleClassMinutes: vipStatusFrom.dynamicTags.join(","),
               studentNum: vipStatusFrom.num,
-              musicTheory:vipStatusFrom.musicTheory
-            }).then((res) => {
+              musicTheory: vipStatusFrom.musicTheory
+            }).then(res => {
               if (res.code == 200) {
                 this.$message.success("添加成功");
                 this.getVipGroupCategoryList();
@@ -281,8 +274,8 @@ export default {
               singleClassMinutes: vipStatusFrom.dynamicTags.join(","),
               studentNum: vipStatusFrom.num,
               id: vipStatusFrom.id,
-               musicTheory:vipStatusFrom.musicTheory
-            }).then((res) => {
+              musicTheory: vipStatusFrom.musicTheory
+            }).then(res => {
               this.$message.success("修改成功");
               this.getVipGroupCategoryList();
               this.vipStatus = false;
@@ -304,8 +297,8 @@ export default {
         this.vipStatusFrom.dynamicTags.indexOf(tag),
         1
       );
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 29 - 22
src/views/categroyManager/specialSetup/modals/courseTimeForm.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-form :model="courseTimeForm" ref="courseTimeForm" >
+    <el-form :model="courseTimeForm" ref="courseTimeForm">
       <el-form-item
         label="分部"
         prop="organId"
@@ -28,7 +28,7 @@
         prop="courseType"
         :label-width="formLabelWidth"
         :rules="[
-          { required: true, message: '请选择课程类型', trigger: 'blur' },
+          { required: true, message: '请选择课程类型', trigger: 'blur' }
         ]"
       >
         <el-select
@@ -47,7 +47,11 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="单课时时长" prop="timer" :label-width="formLabelWidth">
+      <el-form-item
+        label="单课时时长"
+        prop="timer"
+        :label-width="formLabelWidth"
+      >
         <el-tag
           :key="index"
           effect="dark"
@@ -68,7 +72,9 @@
           @keyup.enter.native="handleInputConfirm"
           @blur="handleInputConfirm"
         >
-         <template slot="append">分钟</template>
+          <template slot="append"
+            >分钟</template
+          >
         </el-input>
         <el-button
           v-if="!inputVisible"
@@ -88,7 +94,10 @@
   </div>
 </template>
 <script>
-import { resetOrganizationCourseDurationSettings,addOrganizationCourseDurationSettings } from "@/api/specialSetting";
+import {
+  resetOrganizationCourseDurationSettings,
+  addOrganizationCourseDurationSettings
+} from "@/api/specialSetting";
 export default {
   props: ["activeRow", "organList", "courseType"],
   data() {
@@ -97,12 +106,12 @@ export default {
         organId: "",
         courseType: "",
         timer: [],
-        id: "",
+        id: ""
       },
       inputVisible: false,
       formLabelWidth: "100px",
       dynamicTags: [],
-      inputValue: "",
+      inputValue: ""
     };
   },
   mounted() {
@@ -130,13 +139,13 @@ export default {
 
     showInput() {
       this.inputVisible = true;
-      this.$nextTick((_) => {
+      this.$nextTick(_ => {
         this.$refs.saveTagInput.$refs.input.focus();
       });
     },
     async submitInfo(str) {
       console.log(str);
-      this.$refs.courseTimeForm.validate(async (_) => {
+      this.$refs.courseTimeForm.validate(async _ => {
         if (_) {
           if (this.dynamicTags.length <= 0) {
             this.$message.error("请至少填写一个课程课时");
@@ -148,33 +157,31 @@ export default {
                 organId: this.courseTimeForm.organId,
                 duration: this.dynamicTags.join(","),
                 courseType: this.courseTimeForm.courseType,
-                id: this.courseTimeForm.id,
+                id: this.courseTimeForm.id
               });
-                this.$message.success("修改成功");
-                this.$emit('close')
+              this.$message.success("修改成功");
+              this.$emit("close");
             } catch {}
-          }else if(str == "create"){
-                   try {
+          } else if (str == "create") {
+            try {
               const res = await addOrganizationCourseDurationSettings({
                 organId: this.courseTimeForm.organId,
                 duration: this.dynamicTags.join(","),
-                courseType: this.courseTimeForm.courseType,
+                courseType: this.courseTimeForm.courseType
               });
-                this.$message.success("新建成功");
-                this.$emit('close')
+              this.$message.success("新建成功");
+              this.$emit("close");
             } catch {}
           }
         }
       });
-
-
-    },
+    }
   },
   watch: {
     dynamicTags(val) {
       this.courseTimeForm.timer = val;
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>