Browse Source

乐理课人数为范围

wolyshaw 3 năm trước cách đây
mục cha
commit
de025ef076

+ 12 - 5
src/views/activeProgram/modal/studentList.vue

@@ -83,7 +83,7 @@ export default {
         MEmpty
     },
     // courseTypeIsVip 当前排课的类型,可能是赠送课程
-    props: ['studentList', 'activityId', 'courseTypeIsVip', 'typeStatus', 'studentNum'],
+    props: ['studentList', 'activityId', 'courseTypeIsVip', 'typeStatus', 'studentNum', 'isMusicTheory'],
     data() {
         return {
             params: {
@@ -159,9 +159,16 @@ export default {
             this.$listeners.close()
         },
         onPopupSubmit() {
-            if (this.checkboxSelect.length != this.studentNum) {
-                this.$toast(`请选择学生${this.studentNum}名,当前选择${this.checkboxSelect.length}名`);
-                return;
+            if (this.isMusicTheory) {
+                if (!(this.checkboxSelect.length >= 1 && this.checkboxSelect.length <= this.studentNum)) {
+                    this.$toast(`请选择1-${this.studentNum}名学生,当前选择${this.checkboxSelect.length}名`);
+                    return;
+                }
+            } else {
+                if (this.checkboxSelect.length != this.studentNum) {
+                    this.$toast(`请选择学生${this.studentNum}名,当前选择${this.checkboxSelect.length}名`);
+                    return;
+                }
             }
             let dataList = this.dataList || []
             let checkList = []
@@ -250,4 +257,4 @@ export default {
         margin-left: 0.1rem;
     }
 }
-</style>
+</style>

+ 5 - 1
src/views/activeProgram/program.vue

@@ -215,6 +215,7 @@
                 :studentNum="form.studentNum"
                 :courseTypeIsVip="courseTypeIsVip"
                 :typeStatus="typeStatus"
+                :isMusicTheory="isMusicTheory"
                 @submit="onSelectStudent" />
         </van-popup>
 
@@ -340,6 +341,7 @@ export default {
                 maxDate: new Date(2035, 10, 1),
                 currentDate: new Date(),
             },
+            isMusicTheory: false,
         }
     },
     computed: {
@@ -372,6 +374,8 @@ export default {
                 // 单课时长
                 form.singleClassMinutes = this.typeStatus ? vipGroup.singleCourseTime : vipGroup.giveSingleCourseTime
 
+                this.isMusicTheory = vipGroup.giveCategoryName === '乐理课'
+
                 if(this.courseTypeIsVip) {
                     // 每班人数
                     form.studentNum = this.typeStatus ? vipGroup.vipGroupCategoryNum : vipGroup.giveCategoryNum
@@ -940,4 +944,4 @@ export default {
     font-size: .14rem;
     border-radius: .05rem;
 }
-</style>
+</style>