Browse Source

Merge branch 'Nov16thResetMusic' into online

mo 4 years ago
parent
commit
374ddcdd57

+ 10 - 0
src/api/buildTeam.js

@@ -1440,3 +1440,13 @@ export function mergeClassSplitClassAffirm (data) {
   })
   })
 }
 }
 
 
+// 获取分部所有的课程类型时长
+export function getOrganCourseDurationSettings (data) {
+  return request2({
+    url: api + `/organizationCourseDurationSettings/queryByOrganId`,
+    method: 'get', 
+    params:data,
+    data:{}
+  })
+}
+

+ 1 - 1
src/api/specialSetting.js

@@ -323,7 +323,7 @@ export function addOrganizationCourseDurationSettings(data) {
   return request2({
   return request2({
     url: api + `/organizationCourseDurationSettings/insert`,
     url: api + `/organizationCourseDurationSettings/insert`,
     method: 'post',
     method: 'post',
-    data:data,
+    params:data,
   })
   })
 }
 }
 
 

+ 14 - 0
src/constant/index.js

@@ -160,3 +160,17 @@ export const updateAttendanceEnum = {
   SIGN_OUT:'修复签退',
   SIGN_OUT:'修复签退',
   ALL:'签到和签退',
   ALL:'签到和签退',
 }
 }
+export const classTime = {
+  SINGLE:"90",
+  MIX:"90",
+  HIGH:"45",
+  HIGH_ONLINE:"45",
+  COMPREHENSIVE:"90",
+  PRACTICE:"25",
+  MUSIC_NETWORK:"25",
+  TRAINING_SINGLE:'180',
+  TRAINING_MIX:'180',
+  CLASSROOM:'40'
+}
+
+

+ 2 - 13
src/utils/searchArray.js

@@ -1,5 +1,5 @@
 // 搜索用的下拉数据列表
 // 搜索用的下拉数据列表
-import { payOrderType, auditType, auditPaymentType, orderServerType, orderAuditType } from '../constant'
+import { payOrderType, auditType, auditPaymentType, orderServerType, orderAuditType,classTime } from '../constant'
 // 课程类型
 // 课程类型
 export const courseType = [
 export const courseType = [
   { label: "单技课", value: "SINGLE" },
   { label: "单技课", value: "SINGLE" },
@@ -195,18 +195,7 @@ export const stockType = [
   { value: 'EXTERNAL', label: '外部' },
   { value: 'EXTERNAL', label: '外部' },
   { value: 'ALL', label: '全部' }
   { value: 'ALL', label: '全部' }
 ]
 ]
-export const classTimeList = [
-  { label: "90", value: "SINGLE" },
-  { label: "90", value: "MIX" },
-  { label: "45", value: "HIGH" },
-  { label: "45", value: "HIGH_ONLINE" },
-  { label: "90", value: "COMPREHENSIVE" },
-  { label: "25", value: "PRACTICE" },
-  { label: "25", value: "MUSIC_NETWORK" },
-  { label: "180", value: "TRAINING_SINGLE" },
-  { label: "180", value: "TRAINING_MIX" },
-  { label: "40", value: "CLASSROOM" },
-]
+export const classTimeList = getValueForKey(classTime) 
 
 
 export const payOrderTypeList = getValueForKey(payOrderType)
 export const payOrderTypeList = getValueForKey(payOrderType)
 export const auditTypeList = getValueForKey(auditType)
 export const auditTypeList = getValueForKey(auditType)

+ 2 - 2
src/views/categroyManager/specialSetup/courseTimerSetting.vue

@@ -82,11 +82,11 @@
               type="text"
               type="text"
               >修改</el-button
               >修改</el-button
             >
             >
-            <!-- <el-button
+            <el-button
               @click="delCourseTime(scope.row)"
               @click="delCourseTime(scope.row)"
               v-permission="'courseHomeworkTemplate/del'"
               v-permission="'courseHomeworkTemplate/del'"
               type="text"
               type="text"
-              >删除</el-button> -->
+              >删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>

+ 0 - 1
src/views/categroyManager/specialSetup/modals/chargesForm.vue

@@ -87,7 +87,6 @@
               :prop="`details.${index}.courseTotalMinuties`"
               :prop="`details.${index}.courseTotalMinuties`"
               :rules="[
               :rules="[
                 { required: true, message: '请输入课程时长', trigger: 'blur' },
                 { required: true, message: '请输入课程时长', trigger: 'blur' },
-                { validator: validatorCourseTotalMinuties(index, item), trigger: 'blur' }
               ]">
               ]">
               <el-input-number size="mini"
               <el-input-number size="mini"
                                style="width: 90%!important;"
                                style="width: 90%!important;"

+ 1 - 1
src/views/resetTeaming/api.js

@@ -55,7 +55,7 @@ export const makesureSchoolePaid = data => request2({
 })
 })
 
 
 export const queryByOrganIdAndCourseType = data => request2({
 export const queryByOrganIdAndCourseType = data => request2({
-  url: '/api-web/organizationCourseDurationSettings/queryByOrganIdAndCourseType',
+  url: '/api-web/organizationCourseDurationSettings/queryByOrganId',
   data: {},
   data: {},
   params: data,
   params: data,
   method: 'get',
   method: 'get',

+ 0 - 13
src/views/resetTeaming/modals/extra-class.vue

@@ -76,7 +76,6 @@
             :prop="'form.' + scope.$index + '.courseTotalMinuties'"
             :prop="'form.' + scope.$index + '.courseTotalMinuties'"
             :rules="[
             :rules="[
               { required: true, message: '请输入课程时长', trigger: 'blur' },
               { required: true, message: '请输入课程时长', trigger: 'blur' },
-              { validator: validatorCourseTotalMinuties(scope.$index), trigger: 'blur' }
             ]"
             ]"
           >
           >
             <el-input-number
             <el-input-number
@@ -174,7 +173,6 @@ import { objectToOptions } from '@/utils'
 import { classTimeList, array2object } from '@/utils/searchArray'
 import { classTimeList, array2object } from '@/utils/searchArray'
 import numeral from 'numeral'
 import numeral from 'numeral'
 import MusicStore from '@/views/resetTeaming/store'
 import MusicStore from '@/views/resetTeaming/store'
-import { queryByOrganIdAndCourseType } from '../api'
 export default {
 export default {
   props: ['form', 'isCommon', 'isDisabled', 'isUserType', 'courseUnitPriceSettingsByType', 'clearable'],
   props: ['form', 'isCommon', 'isDisabled', 'isUserType', 'courseUnitPriceSettingsByType', 'clearable'],
   data() {
   data() {
@@ -186,7 +184,6 @@ export default {
   },
   },
   computed: {
   computed: {
     list() {
     list() {
-      console.log(this.prices)
       return {
       return {
         form: this.form
         form: this.form
       }
       }
@@ -194,16 +191,6 @@ export default {
     classTimeList() {
     classTimeList() {
       return array2object(classTimeList)
       return array2object(classTimeList)
     },
     },
-    async prices() {
-      let list = []
-      try {
-        const res = await queryByOrganIdAndCourseType({
-          organId: MusicStore.state.musicGroup.organId
-        })
-        list = res.data
-      } catch (error) {}
-      return list
-    }
   },
   },
   methods: {
   methods: {
     change(val) {
     change(val) {

+ 38 - 6
src/views/teamDetail/components/courseList.vue

@@ -255,12 +255,17 @@
         <el-form-item label="课程时长"
         <el-form-item label="课程时长"
                       v-if="courseVisible"
                       v-if="courseVisible"
                       prop="timer">
                       prop="timer">
-          <el-input type='number'
+          <!-- <el-input type='number'
                     disabled
                     disabled
                     v-model="maskForm.timer">
                     v-model="maskForm.timer">
                         <template slot="append">分钟</template>
                         <template slot="append">分钟</template>
-                    </el-input>
-
+                    </el-input> -->
+          <el-select v-model="maskForm.timer" @change="changeTime">
+              <el-option v-for="(item,index) in typeTimeList"
+                       :key="index"
+                       :value="parseInt(item)"
+                       :label="item"></el-option>
+          </el-select>
         </el-form-item>
         </el-form-item>
         <el-form-item label="开始时间"
         <el-form-item label="开始时间"
                       v-if="courseVisible"
                       v-if="courseVisible"
@@ -440,7 +445,8 @@ import {
   updateTeacherAttendance,
   updateTeacherAttendance,
   findAttendanceStudentByCourseWithPage,
   findAttendanceStudentByCourseWithPage,
   updateStudentAttendances,
   updateStudentAttendances,
-  cleanAttendance
+  cleanAttendance,
+  getOrganCourseDurationSettings
 } from "@/api/buildTeam";
 } from "@/api/buildTeam";
 import { permission } from "@/utils/directivePage";
 import { permission } from "@/utils/directivePage";
 import { diffTimerFormMinute, addTimerFormMinute } from '@/utils/date'
 import { diffTimerFormMinute, addTimerFormMinute } from '@/utils/date'
@@ -541,7 +547,9 @@ export default {
         page_size: [10, 20, 40, 50] // 选择限制显示条数
         page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       },
       organId: '',
       organId: '',
-      schoolList: []
+      schoolList: [],
+      courseTimeList:{},
+      typeTimeList:[]
     };
     };
   },
   },
   components: {
   components: {
@@ -560,9 +568,20 @@ export default {
     this.init();
     this.init();
   },
   },
   methods: {
   methods: {
-    init () {
+   async init () {
       this.teamid = this.$route.query.id;
       this.teamid = this.$route.query.id;
       this.organId = this.$route.query.organId
       this.organId = this.$route.query.organId
+      try{
+        const res = await getOrganCourseDurationSettings({organId:this.organId})
+        this.courseTimeList = res.data
+       
+      }catch{}
+     
+      // MusicStore.dispatch('getBaseInfo', {
+      //     data: { musicGroupId: this.teamid }
+      //   }).then((res) => {
+      //     console.log(res)
+      //   })
       this.getList();
       this.getList();
       // 获取所有老师
       // 获取所有老师
       // findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
       // findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
@@ -666,6 +685,13 @@ export default {
     resetClass (row) {
     resetClass (row) {
       this.maskForm.teacher = parseInt(row.masterTeacherId);
       this.maskForm.teacher = parseInt(row.masterTeacherId);
       this.maskForm.courseScheduleType = row.courseScheduleType;
       this.maskForm.courseScheduleType = row.courseScheduleType;
+            // this.courseTimeList
+      for(let key in this.courseTimeList){
+        if(key == row.courseScheduleType){
+          this.typeTimeList = this.courseTimeList[key].split(',')
+        }
+      }
+      console.log(this.typeTimeList)
       // this.maskForm.type = row.courseScheduleType;
       // this.maskForm.type = row.courseScheduleType;
       this.maskForm.assistant = [];
       this.maskForm.assistant = [];
       for (let i in row.teachingTeachers) {
       for (let i in row.teachingTeachers) {
@@ -828,6 +854,7 @@ export default {
       this.typeForm.id = row.courseScheduleId;
       this.typeForm.id = row.courseScheduleId;
       this.typeForm.teacher = parseInt(row.masterTeacherId);
       this.typeForm.teacher = parseInt(row.masterTeacherId);
       // this.maskForm.type = row.courseScheduleType;
       // this.maskForm.type = row.courseScheduleType;
+
       this.typeForm.assistant = [];
       this.typeForm.assistant = [];
       for (let i in row.teachingTeachers) {
       for (let i in row.teachingTeachers) {
         if (row.teachingTeachers[i].teacherRole == "TEACHING") {
         if (row.teachingTeachers[i].teacherRole == "TEACHING") {
@@ -897,6 +924,11 @@ export default {
         this.maskForm.endTime = addTimerFormMinute(this.maskForm.date, val, this.maskForm.timer);
         this.maskForm.endTime = addTimerFormMinute(this.maskForm.date, val, this.maskForm.timer);
       })
       })
     },
     },
+    changeTime(val){
+        this.$nextTick(res => {
+        this.maskForm.endTime = addTimerFormMinute(this.maskForm.date,this.maskForm.startTime ,val );
+      })
+    }
 
 
   },
   },
   filters: {
   filters: {

+ 15 - 2
src/views/teamDetail/components/modals/class-pay-list-item.vue

@@ -113,6 +113,7 @@ export default {
         paymentPattern: null,
         paymentPattern: null,
       },
       },
       other: {},
       other: {},
+      
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -140,7 +141,7 @@ export default {
         }
         }
       }
       }
     }
     }
-    this.syncAllMoney();
+    // this.syncAllMoney();
   },
   },
   methods: {
   methods: {
     priceChange(item, index) {
     priceChange(item, index) {
@@ -186,6 +187,7 @@ export default {
       // if (this.eclass.length < 1) {
       // if (this.eclass.length < 1) {
       //   return this.$message.error("请至少选择一条加课信息");
       //   return this.$message.error("请至少选择一条加课信息");
       // }
       // }
+      console.log(valided.length,forms.length)
       if (valided.length === forms.length) {
       if (valided.length === forms.length) {
         if(Object.keys(this.payItem).length > 0){
         if(Object.keys(this.payItem).length > 0){
            const { leixing, ...rest } = {
            const { leixing, ...rest } = {
@@ -233,10 +235,21 @@ export default {
        
        
       } else {
       } else {
         this.$message.error("请填写必要信息");
         this.$message.error("请填写必要信息");
-        return null;
+        return 'error';
       }
       }
     },
     },
+   
   },
   },
+   watch:{
+      'payInfo':{
+        deep:true,
+        immediate:true,
+         handler(newName, oldName) {
+          this.syncAllMoney();
+          // this.priceChange()
+        },
+      }
+    }
 };
 };
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 90 - 9
src/views/teamDetail/components/modals/class-pay-list.vue

@@ -1,5 +1,17 @@
 <template>
 <template>
   <div>
   <div>
+     <el-alert
+    title="课程时长设置"
+    type="info" :closable='false'>
+  </el-alert>
+    <el-form :model='courseTimeForm' ref='courseTimeForms' :inline='true' style="margin-top:20px;">
+      <el-form-item v-for="(item,index) in courseTimeForm.timeList" :key="index" :label="item.label" 
+       :prop="'timeList.' + index + '.value'" :rules="[{required: true, message: '请选择课程时长', trigger: 'blur'}]" label-width="80px">
+        <el-select clearable v-model="item.value" placeholder="请选择课程时长" @change="(val)=>setCourseTime(item,val)">
+          <el-option v-for="(time,index) in item.list" :key='index' :value='time' :label="time"></el-option>
+        </el-select>
+       </el-form-item>
+    </el-form>
     <classPayListItem
     <classPayListItem
       :payInfo="payInfo"
       :payInfo="payInfo"
       ref="base"
       ref="base"
@@ -33,6 +45,8 @@
         :studentSubmitedData="studentSubmitedData"
         :studentSubmitedData="studentSubmitedData"
         :classIdList="classIdList"
         :classIdList="classIdList"
         :classGroupStudents="classGroupStudents"
         :classGroupStudents="classGroupStudents"
+        
+        :selectPrices='classCourseMinuteMap'
         @close="showLastVisable = false"
         @close="showLastVisable = false"
         v-if="showLastVisable"
         v-if="showLastVisable"
 
 
@@ -50,8 +64,11 @@ import classNewInfo from "./class-new-info";
 import classPayListItem from './class-pay-list-item'
 import classPayListItem from './class-pay-list-item'
 import classSetting from './classroom-setting'
 import classSetting from './classroom-setting'
 import  {getCourseType} from "@/utils/utils"
 import  {getCourseType} from "@/utils/utils"
+import {courseType,classTime} from '@/constant'
+import { getOrganCourseDurationSettings} from '@/api/buildTeam'
+import MusicStore from '@/views/resetTeaming/store'
 export default {
 export default {
-  props: ["form", "payInfo", "courseTypesByType","classIdList"],
+  props: ["form", "payInfo", "courseTypesByType","classIdList","addCourseType"],
   components: {
   components: {
     classNewInfo,
     classNewInfo,
     classPayListItem,
     classPayListItem,
@@ -67,11 +84,35 @@ export default {
       activeType:'',
       activeType:'',
       courseTypeList:[],
       courseTypeList:[],
       studentSubmitedData:{},
       studentSubmitedData:{},
-      classGroupStudents:[]
+      classGroupStudents:[],
+      courseTimeForm:{
+        timeList:[]
+      },
+      organId:'',
+      organCourseTime:{},
+      classCourseMinuteMap:{}
     };
     };
   },
   },
+  async mounted(){
+    // 1.查询该分部下得所有课程时长
+    // 2.组成select需要得选项并且指定
 
 
-
+  
+         this.teamid = this.$route.query.id;
+        MusicStore.dispatch('getBaseInfo', {
+          data: { musicGroupId: this.teamid }
+        }).then(async (res) => {
+          this.organId =res.data.musicGroup.organId
+        
+          try{
+           const res = await getOrganCourseDurationSettings({organId:this.organId})
+           this.organCourseTime = res.data;
+             
+           this.setTimeList(res.data)
+           
+          }catch{}
+        })
+  },
   methods: {
   methods: {
     init(){
     init(){
        this.$store.dispatch('setTeachers')
        this.$store.dispatch('setTeachers')
@@ -88,13 +129,15 @@ export default {
       this.classGroupStudents = classGroupStudents
       this.classGroupStudents = classGroupStudents
       this.teamid = this.$route.query.id
       this.teamid = this.$route.query.id
       this.activeType = this.form.classList[0].type
       this.activeType = this.form.classList[0].type
-      console.log(this.form.classList)
       this.courseTypeList = getCourseType(this.activeType) 
       this.courseTypeList = getCourseType(this.activeType) 
-      console.log('courseTypeList:',this.courseTypeList)
       this.studentSubmitedData = {
       this.studentSubmitedData = {
         name:'',
         name:'',
         seleched:this.studentList.map(stu=> {return stu.userId})
         seleched:this.studentList.map(stu=> {return stu.userId})
       }
       }
+    this.courseTimeForm.timeList.map(item=>{
+     this.classCourseMinuteMap[item.type]=item.value
+    })
+    console.log(this.classCourseMinuteMap)
     this.showLastVisable = true
     this.showLastVisable = true
     },
     },
     close() {
     close() {
@@ -108,24 +151,62 @@ export default {
         .map((item) => item.$refs.form || item);
         .map((item) => item.$refs.form || item);
     },
     },
     gotoLast() {
     gotoLast() {
+       this.$refs.courseTimeForms.validate(_=>{
+        if(_){
       const forms = this.getForms();
       const forms = this.getForms();
+      
       let musicGroupPaymentCalenderDtos = []
       let musicGroupPaymentCalenderDtos = []
       // 判断有没有缴费项目(因为又可能没有)
       // 判断有没有缴费项目(因为又可能没有)
       // let flag = false
       // let flag = false
+      let arr = []
       for (const form of forms) {
       for (const form of forms) {
          let data =  form.getData()
          let data =  form.getData()
-        if(data){
+        if(data=='error'){
+          arr.push(data)
+        }
+        if(data&&data!='error'){
           musicGroupPaymentCalenderDtos.push(data)
           musicGroupPaymentCalenderDtos.push(data)
-
         }
         }
       }
       }
-      // 弹出最后一页
-      this.musicGroupPaymentCalenderDtos = musicGroupPaymentCalenderDtos
+      if(arr.length>0){
+        return
+      }
+     
+           this.musicGroupPaymentCalenderDtos = musicGroupPaymentCalenderDtos
       this.init()
       this.init()
+        }
+      })
+      // 弹出最后一页
+     
            
            
     },
     },
     submitResetClass(){
     submitResetClass(){
       this.$refs.classSetting.submit()
       this.$refs.classSetting.submit()
+    },
+    setTimeList(organCourseTime){
+
+      this.addCourseType.map(course=>{
+        let arr = []
+      if(organCourseTime[course]){
+         arr =organCourseTime[course].split(',')
+      }else {
+        arr = [classTime[course]]
+      } 
+        this.courseTimeForm.timeList.push({type:course,value:'',label:courseType[course],list:arr})
+      })
+    },
+    setCourseTime(item,val){
+      console.log(this.payInfo)
+      
+      for(let k in this.payInfo){
+        if( this.payInfo[k][item.type]){
+         let courseCurrentPrice =val?val* this.payInfo[[k]][item.type].unitPrice:0
+         let courseTotalMinuties = val?val*this.payInfo[[k]][item.type].courseTotalNum:0
+           this.$emit('resetPayInfo',item.type,courseCurrentPrice,courseTotalMinuties)
+        }
+      }
+
+    
     }
     }
   },
   },
 };
 };

+ 15 - 0
src/views/teamDetail/components/modals/classList-group.vue

@@ -30,9 +30,11 @@
     >
     >
       <classPayList
       <classPayList
         :classIdList="classIdList"
         :classIdList="classIdList"
+        :addCourseType='addCourseType'
         :courseTypesByType="courseTypesByType"
         :courseTypesByType="courseTypesByType"
         :form="form"
         :form="form"
         :payInfo="payInfo"
         :payInfo="payInfo"
+        @resetPayInfo="resetPayInfo"
         @close="showSecondVisable = false"
         @close="showSecondVisable = false"
         v-if="showSecondVisable"
         v-if="showSecondVisable"
       />
       />
@@ -63,6 +65,7 @@ export default {
       showSecondVisable: false,
       showSecondVisable: false,
       classIdList: [],
       classIdList: [],
       activeClassList: [],
       activeClassList: [],
+      addCourseType:[]
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -101,6 +104,7 @@ export default {
           try {
           try {
             let result = await getDefaultPaymentCalender(this.classIdList);
             let result = await getDefaultPaymentCalender(this.classIdList);
             this.payInfo = result.data.defaultPaymentCalender;
             this.payInfo = result.data.defaultPaymentCalender;
+            this.addCourseType = result.data.groupTypeSet
             this.showSecondVisable = true;
             this.showSecondVisable = true;
           } catch {}
           } catch {}
         }
         }
@@ -148,6 +152,17 @@ export default {
         };
         };
       });
       });
     },
     },
+    resetPayInfo(key,value,time){
+       console.log(value,time)
+      for(let k in this.payInfo){
+        if( this.payInfo[k][key]){
+          this.payInfo[k][key].courseCurrentPrice=value
+          this.payInfo[k][key].courseTotalMinuties= parseInt(time) 
+        }
+      }
+     
+    }
+    
   },
   },
 };
 };
 </script>
 </script>

+ 0 - 1
src/views/teamDetail/components/modals/classList-item.vue

@@ -145,7 +145,6 @@ export default {
       this.studentListModalVisible = false;
       this.studentListModalVisible = false;
     },
     },
     setClassCourse(data) {
     setClassCourse(data) {
-      console.log(data);
       if (Object.keys(data).length > 0) {
       if (Object.keys(data).length > 0) {
         this.item.courseList = data;
         this.item.courseList = data;
         this.isNoCourse = false;
         this.isNoCourse = false;

+ 29 - 10
src/views/teamDetail/components/modals/classroom-setting-item.vue

@@ -66,7 +66,21 @@
           <el-form-item
           <el-form-item
             :prop="'classs.' + type + '.cycle.' + scope.$index + '.time'"
             :prop="'classs.' + type + '.cycle.' + scope.$index + '.time'"
             inline-message>
             inline-message>
-            <el-input disabled v-model="scope.row.time" placeholder="请输入课程时长"/>
+            <el-select v-model.trim="scope.row.time"
+              style="width:100%!important"
+              placeholder="请选择课程时长"
+              clearable
+              :disabled="!!selectPrice"
+              @change="startTimeChange(scope.row)"
+              filterable>
+              <el-option v-for="(item,index) in pricesArray"
+                :key="index"
+                :disabled="surplustime < item"
+                :label="item"
+                :value="item">
+              </el-option>
+            </el-select>
+            <!-- <el-input disabled v-model="scope.row.time" placeholder="请输入课程时长"/> -->
           </el-form-item>
           </el-form-item>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
@@ -84,7 +98,7 @@
               format='HH:mm'
               format='HH:mm'
               value-format='HH:mm'
               value-format='HH:mm'
               placeholder="请选择时间"
               placeholder="请选择时间"
-              @change="val => startTimeChange(val, scope.row)"
+              @change="startTimeChange(scope.row)"
               :picker-options="{
               :picker-options="{
                 selectableRange: ['04:30:00 - 23:59:59']
                 selectableRange: ['04:30:00 - 23:59:59']
               }">
               }">
@@ -127,7 +141,7 @@
       type="info"
       type="info"
       size="small"
       size="small"
       plain
       plain
-      :disabled="surplustime < classTimeListByType[type]"
+      :disabled="surplustime < ((selectPrice || 0) || Math.min(...pricesArray))"
       @click="create"
       @click="create"
       style="margin-top: 10px;width: 100%;"
       style="margin-top: 10px;width: 100%;"
     >添加循环</el-button>
     >添加循环</el-button>
@@ -144,7 +158,7 @@ for (const item of classTimeList) {
 }
 }
 
 
 export default {
 export default {
-  props: ['form', 'type', 'surplustime'],
+  props: ['form', 'type', 'surplustime', 'prices', 'selectPrice'],
   data() {
   data() {
     return {
     return {
       classTimeListByType,
       classTimeListByType,
@@ -169,21 +183,26 @@ export default {
         { value: "6", label: "星期六" },
         { value: "6", label: "星期六" },
         { value: "7", label: "星期日" }
         { value: "7", label: "星期日" }
       ]
       ]
+    },
+    pricesArray() {
+      return (this.prices[this.type] || '').split(',').filter(item => !!item)
     }
     }
   },
   },
   methods: {
   methods: {
     create() {
     create() {
-      this.form.cycle.push({
-        time: classTimeListByType[this.type]
-      })
+      const initVal = {}
+      if (this.selectPrice) {
+        initVal.time = this.selectPrice
+      }
+      this.form.cycle.push(initVal)
     },
     },
     remove(index) {
     remove(index) {
       this.form.cycle.splice(index, 1)
       this.form.cycle.splice(index, 1)
     },
     },
-    startTimeChange(val, item) {
-      if (val) {
+    startTimeChange(item) {
+      if (item.time && item.startClassTime) {
         let str = dayjs(new Date()).format('YYYY-MM-DD')
         let str = dayjs(new Date()).format('YYYY-MM-DD')
-        this.$set(item, 'endClassTime', addTimerFormMinute(str, val, item.time))
+        this.$set(item, 'endClassTime', addTimerFormMinute(str, item.startClassTime, item.time))
       } else {
       } else {
         this.$set(item, 'endClassTime', '')
         this.$set(item, 'endClassTime', '')
       }
       }

+ 40 - 36
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -1,12 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <el-form
-      :model="form"
-      inline
-      ref="form"
-      label-suffix=": "
-      label-width="130px"
-    >
+    <el-form :model="form" inline ref="form" label-suffix=": " label-width="130px">
       <el-row v-if="classType == 5">
       <el-row v-if="classType == 5">
         <el-form-item
         <el-form-item
           label="班级名称"
           label="班级名称"
@@ -82,15 +76,15 @@
             :surplustime="surplustime[key]"
             :surplustime="surplustime[key]"
             :type="key"
             :type="key"
             :form="item"
             :form="item"
+            :prices="prices"
+            :selectPrice="selectPrices ? selectPrices[key] : ''"
           />
           />
         </el-collapse-item>
         </el-collapse-item>
       </el-collapse>
       </el-collapse>
     </el-form>
     </el-form>
     <div slot="footer" class="dialog-footer" v-if="classType != 5">
     <div slot="footer" class="dialog-footer" v-if="classType != 5">
       <el-button @click="$listeners.close">取 消</el-button>
       <el-button @click="$listeners.close">取 消</el-button>
-      <el-button type="primary" v-if="!isEmpty" @click="submit"
-        >确 定</el-button
-      >
+      <el-button type="primary" v-if="!isEmpty" @click="submit">确 定</el-button>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -105,6 +99,8 @@ import {
 } from "@/api/buildTeam";
 } from "@/api/buildTeam";
 import courseItem from "./classroom-setting-item";
 import courseItem from "./classroom-setting-item";
 import { classTimeList } from "@/utils/searchArray";
 import { classTimeList } from "@/utils/searchArray";
+import MusicStore from "@/views/resetTeaming/store";
+import { queryByOrganIdAndCourseType } from "@/views/resetTeaming/api";
 import { isEmpty } from "lodash";
 import { isEmpty } from "lodash";
 
 
 const classTimeListByType = {};
 const classTimeListByType = {};
@@ -137,7 +133,7 @@ export default {
   props: [
   props: [
     "teacherList",
     "teacherList",
     "activeType",
     "activeType",
-    "courseTypeList", 
+    "courseTypeList",
     "cooperationList",
     "cooperationList",
     "musicGroupId",
     "musicGroupId",
     "detail",
     "detail",
@@ -145,7 +141,8 @@ export default {
     "classType",
     "classType",
     "musicGroupPaymentCalenderDtos",
     "musicGroupPaymentCalenderDtos",
     "classIdList",
     "classIdList",
-    "classGroupStudents"
+    "classGroupStudents",
+    "selectPrices",
   ],
   ],
   components: {
   components: {
     courseItem,
     courseItem,
@@ -157,6 +154,7 @@ export default {
         assistant: "",
         assistant: "",
         classs: {},
         classs: {},
       },
       },
+      prices: {},
       collapses: [0],
       collapses: [0],
       courseTimes: {},
       courseTimes: {},
       courseTypeListByName: {},
       courseTypeListByName: {},
@@ -164,7 +162,6 @@ export default {
       musicCourseSettings: {},
       musicCourseSettings: {},
     };
     };
   },
   },
-
   watch: {
   watch: {
     courseTypeList() {
     courseTypeList() {
       this.setCourseTypeListByName();
       this.setCourseTypeListByName();
@@ -190,16 +187,22 @@ export default {
     isEmpty() {
     isEmpty() {
       return isEmpty(this.form.classs);
       return isEmpty(this.form.classs);
     },
     },
+    musicGroup() {
+      return MusicStore.state.musicGroup;
+    },
   },
   },
   async mounted() {
   async mounted() {
+    try {
+      await MusicStore.dispatch("getBaseInfo", {
+        data: { musicGroupId: this.musicGroupId },
+      });
+      const res = await queryByOrganIdAndCourseType({
+        organId: this.musicGroup.organId,
+      });
+      this.prices = res.data;
+    } catch (error) {}
     this.setCourseTypeListByName();
     this.setCourseTypeListByName();
     this.formatClasss();
     this.formatClasss();
-    // console.log("activeType", this.activeType);
-    // console.log("courseTypeList", this.courseTypeList);
-    // console.log("detail", this.detail);
-    // console.log("studentSubmitedData", this.studentSubmitedData);
-    // console.log("classType", this.classType);
-    // console.log("cooperationList", this.cooperationList);
   },
   },
   methods: {
   methods: {
     setCourseTypeListByName() {
     setCourseTypeListByName() {
@@ -210,6 +213,7 @@ export default {
       this.courseTypeListByName = courseTypeListByName;
       this.courseTypeListByName = courseTypeListByName;
     },
     },
     async formatClasss() {
     async formatClasss() {
+     
       if (this.detail) {
       if (this.detail) {
         let coreid = "";
         let coreid = "";
         const assistant = [];
         const assistant = [];
@@ -233,23 +237,27 @@ export default {
         return;
         return;
       }
       }
 
 
-      try {
-        let res;
-        if (this.classType == 5) {
-          res = await findClassCourseMinute(this.classIdList);
-        } else {
+      let res = {};
+      if (this.classType == 5) {
+        // res = await findClassCourseMinute(this.classIdList);
+        res.data = this.selectPrices;
+        
+      } else {
+        try {
           res = await getMusicCourseSettingsWithStudents({
           res = await getMusicCourseSettingsWithStudents({
             musicGroupId: this.musicGroupId,
             musicGroupId: this.musicGroupId,
             studentIds,
             studentIds,
             classGroupId,
             classGroupId,
           });
           });
+        } catch (error) {
+          console.log(error);
         }
         }
-
-        if (!res) return;
+        }
+        console.log(res);
+        if (Object.keys(res).length <= 0) return;
         this.musicCourseSettings = res.data;
         this.musicCourseSettings = res.data;
 
 
         const classs = {};
         const classs = {};
-          console.log(this.courseTypeList)
         for (const item of this.courseTypeList) {
         for (const item of this.courseTypeList) {
           const key = item.value;
           const key = item.value;
           if (res.data[key]) {
           if (res.data[key]) {
@@ -257,18 +265,15 @@ export default {
               courseTotalMinuties: res.data[key],
               courseTotalMinuties: res.data[key],
               cycle: [
               cycle: [
                 {
                 {
-                  time: classTimeListByType[key],
+                  time: this.selectPrices ? this.selectPrices[key] : undefined,
                 },
                 },
               ],
               ],
             };
             };
           }
           }
         }
         }
-        console.log(classs)
         this.$set(this.form, "classs", classs);
         this.$set(this.form, "classs", classs);
         // this.courseTimes = courseTimes
         // this.courseTimes = courseTimes
-      } catch (error) {
-        console.log(error);
-      }
+      
     },
     },
     submit() {
     submit() {
       this.$refs.form.validate(async (valid) => {
       this.$refs.form.validate(async (valid) => {
@@ -326,11 +331,10 @@ export default {
                 obj.classGroup4MixDtos = list;
                 obj.classGroup4MixDtos = list;
                 obj.classGroupIds = this.classIdList;
                 obj.classGroupIds = this.classIdList;
                 obj.studentIds = this.studentSubmitedData.seleched;
                 obj.studentIds = this.studentSubmitedData.seleched;
-                obj.classGroupStudents = this.classGroupStudents
-                // console.log(obj);
+                obj.classGroupStudents = this.classGroupStudents;
+                obj.classCourseMinuteMap  = this.selectPrices
                 await mergeClassSplitClassAffirm(obj);
                 await mergeClassSplitClassAffirm(obj);
-                let grend = this.$parent.$parent.$parent.$parent.$parent.$parent
-                  .$parent;
+                let grend = this.$parent.$parent.$parent.$parent.$parent.$parent.$parent;
                 grend.closeStudentReset();
                 grend.closeStudentReset();
                 grend.getList();
                 grend.getList();
                 return;
                 return;

+ 2 - 2
vue.config.js

@@ -19,9 +19,9 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://dyme.utools.club' //test环境
 // let target = 'http://dyme.utools.club' //test环境
 // let target = 'http://192.168.3.139:8000' // 箭河
 // let target = 'http://192.168.3.139:8000' // 箭河
-let target = 'http://192.168.3.38:8000' //邹璇
+// let target = 'http://192.168.3.38:8000' //邹璇
 // let target = 'http://192.168.3.57:8000' //勇哥
 // let target = 'http://192.168.3.57:8000' //勇哥
-// let target = 'http://dev.dayaedu.com' // 测试服
+let target = 'http://dev.dayaedu.com' // 测试服
 // let target = 'http://192.168.3.196' // 乔
 // let target = 'http://192.168.3.196' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
 module.exports = {