Browse Source

fix 课程数为题

wolyshaw 3 years ago
parent
commit
4c61615c2a
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/views/activeProgram/program.vue

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

@@ -547,7 +547,7 @@ export default {
                 return false;
             }
 
-            if (statusList.hasOffline) {
+            if (statusList.hasOffline && !statusList.hasOnline) {
                 if (offlineClassesStatus) {
                     this.$toast("请输入线下课次数");
                     return false;
@@ -560,6 +560,15 @@ export default {
                 }
             }
 
+            if (
+                statusList.hasOffline &&
+                statusList.hasOnline &&
+                (form.onlineClassesNums || 0) + (form.offlineClassesNums || 0) != this.form.totalClassTime
+            ) {
+                this.$toast('线上课次数+线下课次数不等于总课次数')
+                return
+            }
+
             if (this.scheduleList.length <= 0) {
                 this.$toast("课时安排不能为空");
                 return false;