Browse Source

12/09 14:03

111
mo 4 years ago
parent
commit
c47ae2116d

+ 21 - 1
src/views/categroyManager/globalConfig.vue

@@ -10,57 +10,74 @@
                @tab-click="handleClick">
 
         <el-tab-pane label="声部设置(对内)"
+        lazy
                      name="0"
                      v-if="permissionList.musicalManager">
           <musicalManager v-if="activeIndex == 0" />
         </el-tab-pane>
         <el-tab-pane label="声部设置(对外)"
+        lazy
                      name="1"
                      v-if="permissionList.musicalManagerOut">
           <musicalManagerOut v-if="activeIndex == 1" />
         </el-tab-pane>
         <el-tab-pane label="乐团收费类型"
+        lazy
                      name="2"
                      v-if="permissionList.typesManager">
           <typesManager v-if="activeIndex == 2" />
         </el-tab-pane>
+          <el-tab-pane label="课程时长"
+          lazy
+                     name="11"
+                     v-if="permissionList.musicalManagerOut">
+          <courseTimerSetting v-if="activeIndex == 11" />
+        </el-tab-pane>
         <el-tab-pane label="商品折扣和声部设置"
+        lazy
                      name="9"
                      v-if="permissionList.discountManage">
           <discountManage v-if="activeIndex == 9" />
         </el-tab-pane>
         <el-tab-pane label="乐团收费标准"
+        lazy
                      name="3"
                      v-if="permissionList.chargesList">
           <chargesList v-if="activeIndex == 3" />
         </el-tab-pane>
         <el-tab-pane label="乐团课程费用"
+        lazy
                      name="10"
                      v-if="permissionList.musicCourseFee">
           <musicCourseFee v-if="activeIndex == 10" />
         </el-tab-pane>
         <el-tab-pane label="乐团作业模板"
+        lazy
                      name="4"
                      v-if="permissionList.jobTemplateSetting">
           <jobTemplateSetting v-if="activeIndex == 4" />
         </el-tab-pane>
         <el-tab-pane label="热词标签"
+        lazy
                      name="5"
                      v-if="permissionList.errorManager">
           <errorManager v-if="activeIndex == 5" />
         </el-tab-pane>
         <el-tab-pane label="参数设置"
+        lazy
                      name="6"
                      v-if="permissionList.overallManager">
           <overallManager v-if="activeIndex == 6" />
         </el-tab-pane>
         <el-tab-pane label="收费分润配置"
+        lazy
                      name="7"
                      v-if="permissionList.overallManagerTwo">
           <overallManagerTwo v-if="activeIndex == 7" />
         </el-tab-pane>
         <!-- holiday_setting -->
         <el-tab-pane label="节假日设置"
+        lazy
                      name="8"
                      v-if="permissionList.holidaySetting">
           <holidaySetting v-if="activeIndex == 8" />
@@ -82,6 +99,7 @@ import jobTemplateSetting from './specialSetup/jobTemplateSetting'
 import errorManager from './generalSettings/errorManager'
 import chargesList from './specialSetup/chargesList'
 import musicCourseFee from './specialSetup/musicCourseFee'
+import courseTimerSetting from './specialSetup/courseTimerSetting'
 import { permission } from '@/utils/directivePage'
 export default {
   components: {
@@ -95,7 +113,8 @@ export default {
     jobTemplateSetting,
     errorManager,
     chargesList,
-    musicCourseFee
+    musicCourseFee,
+    courseTimerSetting
   },
   name: 'globalConfig',
   data () {
@@ -113,6 +132,7 @@ export default {
         holidaySetting: permission('/globalConfig/holidaySetting'),
         musicCourseFee: permission('/globalConfig/musicCourseFee'),
         discountManage: permission('/globalConfig/discountManage'),
+        courseTimerSetting:permission('/globalConfig/courseTimerSetting'),
       }
     }
   },

+ 17 - 0
src/views/categroyManager/specialSetup/courseTimerSetting.vue

@@ -0,0 +1,17 @@
+<template>
+    <div>
+        课程时长设置
+    </div>
+</template>
+<script>
+export default {
+    data(){
+        return{
+
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+    
+</style>

+ 8 - 8
src/views/teamBuild/components/soundSetComponents/chioseMusic.vue

@@ -15,15 +15,15 @@
                        :label="item.name"
                        :value="item.id"></el-option>
           </el-select>
-          <el-checkbox-group v-model="music.type"
+          <el-radio-group v-model="music.type"
                              class="marginLeft10">
-            <el-checkbox :disabled='basdisabled'
-                         label="GROUP">团购</el-checkbox>
-            <el-checkbox :disabled='basdisabled'
-                         label="LEASE">租赁</el-checkbox>
-            <el-checkbox :disabled='basdisabled'
-                         label="FREE">免费</el-checkbox>
-          </el-checkbox-group>
+            <el-radio :disabled='basdisabled'
+                         label="GROUP">团购</el-radio>
+            <el-radio :disabled='basdisabled'
+                         label="LEASE">租赁</el-radio>
+            <el-radio :disabled='basdisabled'
+                         label="FREE">免费</el-radio>
+          </el-radio-group>
         </div>
 
         <div class="flexRow">

+ 91 - 91
src/views/teamBuild/components/soundSetComponents/soundSetCore.vue

@@ -1,64 +1,80 @@
 <template>
   <div>
     <div class="soundBtnWrap">
-      <el-button type="primary"
-                 @click="allin"
-                 v-if="teamStatus != 'resetTeam'&&!basdisabled">全选</el-button>
-      <el-button type="danger"
-                 @click="deleteRow"
-                 v-if="teamStatus != 'resetTeam'&&!basdisabled">删除</el-button>
-      <el-button type="primary"
-                 @click="soundVisible = true"
-                 v-if="!basdisabled">添加</el-button>
+      <el-button
+        type="primary"
+        @click="allin"
+        v-if="teamStatus != 'resetTeam' && !basdisabled"
+        >全选</el-button
+      >
+      <el-button
+        type="danger"
+        @click="deleteRow"
+        v-if="teamStatus != 'resetTeam' && !basdisabled"
+        >删除</el-button
+      >
+      <el-button type="primary" @click="soundVisible = true" v-if="!basdisabled"
+        >添加</el-button
+      >
     </div>
     <div class="coreWrap">
-      <el-checkbox-group v-model="checkList"
-                         @change="lookCheck">
+      <el-checkbox-group v-model="checkList" @change="lookCheck">
         <el-collapse v-model="chioseActiveSound">
-          <el-collapse-item v-for="(item, index) in activeSoundList"
-                            :name="item.id"
-                            :key="index">
+          <el-collapse-item
+            v-for="(item, index) in activeSoundList"
+            :name="item.id"
+            :key="index"
+          >
             <template slot="title">
               <div class="coreItemTitle">
-                <el-checkbox :label="item.id"
-                             :disabled='basdisabled'>{{ item.sound }}</el-checkbox>
+                <el-checkbox :label="item.id" :disabled="basdisabled">{{
+                  item.sound
+                }}</el-checkbox>
               </div>
             </template>
             <div class="coreItem">
               <div class="coreItemRow">
                 <p class="title">计划招生人数:</p>
-                <el-input :disabled='basdisabled'
-                          style="width: 180px"
-                          v-model="item.expectedStudentNum"></el-input>
+                <el-input
+                  :disabled="basdisabled"
+                  style="width: 180px"
+                  v-model="item.expectedStudentNum"
+                ></el-input>
               </div>
             </div>
-            <chioseMusic :item="item"
-                         @lookMusic="lookMusic"
-                         :basdisabled="basdisabled" />
+            <chioseMusic
+              :item="item"
+              @lookMusic="lookMusic"
+              :basdisabled="basdisabled"
+            />
             <div class="coreItemRow">
               <p class="title">教辅:</p>
-              <el-select style="width: 558px !important"
-                         v-model="item.markChioseList"
-                         :disabled='basdisabled'
-                         clearable
-                         filterable
-                         multiple>
-                <el-option v-for="(item, index) in item.markList"
-                           :key="index"
-                           :label="item.name"
-                           :value="item.id"></el-option>
+              <el-select
+                style="width: 558px !important"
+                v-model="item.markChioseList"
+                :disabled="basdisabled"
+                clearable
+                filterable
+                multiple
+              >
+                <el-option
+                  v-for="(item, index) in item.markList"
+                  :key="index"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
               </el-select>
             </div>
           </el-collapse-item>
         </el-collapse>
       </el-checkbox-group>
     </div>
-    <el-dialog title="声部选择"
-               :visible.sync="soundVisible"
-               destroy-on-close>
-      <chioseSoundList :soundList="soundList"
-                       :activeSound="activeSound"
-                       @chioseSound="chioseSound" />
+    <el-dialog title="声部选择" :visible.sync="soundVisible" destroy-on-close>
+      <chioseSoundList
+        :soundList="soundList"
+        :activeSound="activeSound"
+        @chioseSound="chioseSound"
+      />
     </el-dialog>
   </div>
 </template>
@@ -81,10 +97,10 @@ import dayjs from "dayjs";
 import chioseSoundList from "./chioseSoundList";
 import chioseMusic from "./chioseMusic";
 import { findIndex } from "lodash";
-import numeral from 'numeral'
+import numeral from "numeral";
 export default {
   components: { chioseSoundList, chioseMusic },
-  data () {
+  data() {
     return {
       soundList: [], // 接口返回的一级二级声部
       soundVisible: false, // 设置声部弹窗
@@ -96,17 +112,17 @@ export default {
       childSoundList: [],
       teamStatus: "", // 乐团状态
       checkList: [],
-      basdisabled: false
+      basdisabled: false,
     };
   },
-  mounted () {
+  mounted() {
     this.init();
   },
-  activated () {
+  activated() {
     this.init();
   },
   methods: {
-    init () {
+    init() {
       // 获取第一页的数据
       this.topfor = this.$store.getters.topinfo;
       let type = this.topfor.type;
@@ -118,7 +134,11 @@ export default {
       if (this.$route.query.rules) {
         this.Frules = this.$route.query.rules;
       }
-      if (this.teamStatus == "look" || this.teamStatus == "teamAudit" || this.teamStatus == "feeAudit") {
+      if (
+        this.teamStatus == "look" ||
+        this.teamStatus == "teamAudit" ||
+        this.teamStatus == "feeAudit"
+      ) {
         this.basdisabled = true;
       } else {
         this.basdisabled = false;
@@ -146,8 +166,6 @@ export default {
           } else {
             this.teamid = this.$route.query.id;
             if (this.teamid) {
-
-
               findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(
                 (res) => {
                   if (res.code == 200) {
@@ -210,10 +228,10 @@ export default {
         }
       });
     },
-    lookCheck (val) {
+    lookCheck(val) {
       this.checkList = [...new Set(val)];
     },
-    chioseSound (activeSound) {
+    chioseSound(activeSound) {
       // 同步数据
       this.activeSound = [...new Set(activeSound)];
       let newSoundList = [];
@@ -242,7 +260,7 @@ export default {
       this.changeActiveSound(newActiveSound.join(","));
       this.soundVisible = false;
     },
-    initSound (item) {
+    initSound(item) {
       let obj = {
         id: item.id,
         sound: item.name,
@@ -256,7 +274,7 @@ export default {
       };
       return obj;
     },
-    changeActiveSound (val) {
+    changeActiveSound(val) {
       // 写入声部商品和辅件
       getSubjectGoods({
         subjectIds: val,
@@ -281,45 +299,20 @@ export default {
               }
             });
           }
-
         }
       });
     },
 
-    // return
-    // if (item.id == val) {
-    //   if (item.goodsList.length < 1 || item.markList.length < 1) {
-    //     getSubjectGoods({
-    //       subjectIds: item.id,
-    //       chargeTypeId: this.topfor.type,
-    //     }).then((res) => {
-    //       if (res.code == 200) {
-    //         let goodList = [];
-    //         let markList = [];
-    //         res.data.forEach((item) => {
-    //           if (item.type == "INSTRUMENT") {
-    //             goodList.push(item);
-    //           } else if (item.type == "ACCESSORIES") {
-    //             markList.push(item);
-    //           }
-    //         });
-    //         item.goodsList = goodList;
-    //         item.markList = markList;
-    //       }
-    //     });
-    //   }
-    // }
+    lookMusic() {},
 
-    lookMusic () { },
-
-    submitInfo (type) {
+    submitInfo(type) {
       // 计划招生人数
       // 可选乐器
       // 教辅
 
       if (this.activeSoundList.length <= 0) {
         this.$message.error(`请至少设置一个声部`);
-        return
+        return;
       }
       let flag = true;
       this.activeSoundList.forEach((item) => {
@@ -333,14 +326,14 @@ export default {
           flag = false;
           return;
         }
-        item.chioseMusic.forEach(music => {
+        item.chioseMusic.forEach((music) => {
           if (music.type.indexOf("LEASE") != -1) {
             if (!music.borrowPrice || parseFloat(music.borrowPrice) <= 0) {
               this.$message.error(`请填写正确的${item.sound}租赁押金`);
               flag = false;
             }
           }
-        })
+        });
       });
       if (!flag) return;
       // 新建团
@@ -371,9 +364,17 @@ export default {
             goodsItem = active.goodsList[index];
           }
           let kitGroupPurchaseTypeJson = {};
-          music.type.forEach((type) => {
-            kitGroupPurchaseTypeJson[type] = 0;
-          });
+          if (Array.isArray(music.type)) {
+            music.type.forEach((type) => {
+              kitGroupPurchaseTypeJson[type] = 0;
+            });
+          }else{
+            // 字符串
+            let arr = [ music.type]
+              arr.forEach((type) => {
+              kitGroupPurchaseTypeJson[type] = 0; 
+            });
+          }
           kitGroupPurchaseTypeJson = JSON.stringify(kitGroupPurchaseTypeJson);
           if (goodsItem) {
             let some = {
@@ -411,7 +412,6 @@ export default {
             obj.musicGroupSubjectGoodsGroups.push(some);
           }
         });
-
       });
       if (this.teamStatus == "newTeam") {
         createTeam(obj).then((res) => {
@@ -426,7 +426,7 @@ export default {
               },
             });
             this.$emit("chiosetab", 2);
-            this.$emit('getBaseInfo', obj)
+            this.$emit("getBaseInfo", obj);
             //  zheli
           }
         });
@@ -447,7 +447,7 @@ export default {
         });
       }
     },
-    deleteRow () {
+    deleteRow() {
       if (this.checkList.length < 1) {
         this.$message.error("请至少勾选一个");
         return;
@@ -462,14 +462,14 @@ export default {
       }
       this.checkList = [];
     },
-    allin () {
+    allin() {
       this.checkList = [];
       this.activeSoundList.forEach((item, index) => {
         this.checkList.push(item.id);
       });
     },
 
-    initCreateTeam (obj) {
+    initCreateTeam(obj) {
       let enrollClasses;
       this.topfor.startClass
         ? (enrollClasses = this.topfor.startClass.join(","))
@@ -495,7 +495,7 @@ export default {
         schoolId: this.topfor.address,
         expectStartGroupDate: this.topfor.startTime,
         isClassroomLessons: this.topfor.isClass,
-        status: 'DRAFT',
+        status: "DRAFT",
         ownershipType: this.topfor.ownershipType,
         repairUserId: this.topfor.repairUserId,
         feeType: this.topfor.feeType,
@@ -507,7 +507,7 @@ export default {
     activeSoundList: {
       immediate: true,
       deep: true,
-      handler (n) {
+      handler(n) {
         let chioseSoundNum = 0;
         let PlannedCount = 0;
         let activeSoundList = this.activeSoundList;