浏览代码

fix 课程数为题

wolyshaw 3 年之前
父节点
当前提交
4c61615c2a
共有 1 个文件被更改,包括 10 次插入1 次删除
  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;