Ver Fonte

12/10 20:28

11
mo há 4 anos atrás
pai
commit
b43d2e8577

+ 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({
     url: api + `/organizationCourseDurationSettings/insert`,
     method: 'post',
-    data:data,
+    params:data,
   })
 }
 

+ 14 - 0
src/constant/index.js

@@ -160,3 +160,17 @@ export const updateAttendanceEnum = {
   SIGN_OUT:'修复签退',
   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 = [
   { label: "单技课", value: "SINGLE" },
@@ -195,18 +195,7 @@ export const stockType = [
   { value: 'EXTERNAL', 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 auditTypeList = getValueForKey(auditType)

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

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

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

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

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

@@ -186,6 +186,7 @@ export default {
       // if (this.eclass.length < 1) {
       //   return this.$message.error("请至少选择一条加课信息");
       // }
+      console.log(valided.length,forms.length)
       if (valided.length === forms.length) {
         if(Object.keys(this.payItem).length > 0){
            const { leixing, ...rest } = {
@@ -233,7 +234,7 @@ export default {
        
       } else {
         this.$message.error("请填写必要信息");
-        return null;
+        return 'error';
       }
     },
   },

+ 76 - 7
src/views/teamDetail/components/modals/class-pay-list.vue

@@ -1,5 +1,19 @@
 <template>
   <div>
+     <el-alert
+    title="课程时长设置"
+    type="info" :closable='false'>
+  </el-alert>
+    <el-form :mode='courseTimeForm' :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
       :payInfo="payInfo"
       ref="base"
@@ -50,8 +64,11 @@ import classNewInfo from "./class-new-info";
 import classPayListItem from './class-pay-list-item'
 import classSetting from './classroom-setting'
 import  {getCourseType} from "@/utils/utils"
+import {courseType,classTime} from '@/constant'
+import { getOrganCourseDurationSettings} from '@/api/buildTeam'
+import MusicStore from '@/views/resetTeaming/store'
 export default {
-  props: ["form", "payInfo", "courseTypesByType","classIdList"],
+  props: ["form", "payInfo", "courseTypesByType","classIdList","addCourseType"],
   components: {
     classNewInfo,
     classPayListItem,
@@ -67,11 +84,34 @@ export default {
       activeType:'',
       courseTypeList:[],
       studentSubmitedData:{},
-      classGroupStudents:[]
+      classGroupStudents:[],
+      courseTimeForm:{
+        timeList:[]
+      },
+      organId:'',
+      organCourseTime:{}
     };
   },
+  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: {
     init(){
        this.$store.dispatch('setTeachers')
@@ -88,9 +128,7 @@ export default {
       this.classGroupStudents = classGroupStudents
       this.teamid = this.$route.query.id
       this.activeType = this.form.classList[0].type
-      console.log(this.form.classList)
       this.courseTypeList = getCourseType(this.activeType) 
-      console.log('courseTypeList:',this.courseTypeList)
       this.studentSubmitedData = {
         name:'',
         seleched:this.studentList.map(stu=> {return stu.userId})
@@ -109,16 +147,23 @@ export default {
     },
     gotoLast() {
       const forms = this.getForms();
+      
       let musicGroupPaymentCalenderDtos = []
       // 判断有没有缴费项目(因为又可能没有)
       // let flag = false
+      let arr = []
       for (const form of forms) {
          let data =  form.getData()
-        if(data){
+        if(data=='error'){
+          arr.push(data)
+        }
+        if(data&&data!='error'){
           musicGroupPaymentCalenderDtos.push(data)
-
         }
       }
+      if(arr.length>0){
+        return
+      }
       // 弹出最后一页
       this.musicGroupPaymentCalenderDtos = musicGroupPaymentCalenderDtos
       this.init()
@@ -126,6 +171,30 @@ export default {
     },
     submitResetClass(){
       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* this.payInfo[[k]][item.type].unitPrice
+         let courseTotalMinuties = val
+           this.$emit('resetPayInfo',item.type,courseCurrentPrice,courseTotalMinuties)
+        }
+      }
+
+    
     }
   },
 };

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

@@ -30,9 +30,11 @@
     >
       <classPayList
         :classIdList="classIdList"
+        :addCourseType='addCourseType'
         :courseTypesByType="courseTypesByType"
         :form="form"
         :payInfo="payInfo"
+        @resetPayInfo="resetPayInfo"
         @close="showSecondVisable = false"
         v-if="showSecondVisable"
       />
@@ -63,6 +65,7 @@ export default {
       showSecondVisable: false,
       classIdList: [],
       activeClassList: [],
+      addCourseType:[]
     };
   },
   mounted() {
@@ -101,6 +104,7 @@ export default {
           try {
             let result = await getDefaultPaymentCalender(this.classIdList);
             this.payInfo = result.data.defaultPaymentCalender;
+            this.addCourseType = result.data.groupTypeSet
             this.showSecondVisable = true;
           } 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>

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

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

+ 2 - 2
vue.config.js

@@ -19,9 +19,9 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://dyme.utools.club' //test环境
 // 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://dev.dayaedu.com' // 测试服
+let target = 'http://dev.dayaedu.com' // 测试服
 // let target = 'http://192.168.3.196' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {