Browse Source

添加时长不足提示

wolyshaw 4 năm trước cách đây
mục cha
commit
260194ad64
1 tập tin đã thay đổi với 10 bổ sung5 xóa
  1. 10 5
      src/views/teamDetail/components/modals/classroom-setting.vue

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

@@ -345,12 +345,17 @@ export default {
       this.$set(this.form, "classs", clas);
     },
     submit(type) {
-      // for (const key in this.musicCourseSettings) {
-      //   if (Object.hasOwnProperty.call(this.musicCourseSettings, key)) {
-      //     const item = this.musicCourseSettings[key];
+      for (const key in this.musicCourseSettings) {
+        if (Object.hasOwnProperty.call(this.musicCourseSettings, key)) {
+          const allTime = this.musicCourseSettings[key];
+          const useTime = this.musicSurplus[key]
 
-      //   }
-      // }
+          if (useTime > allTime) {
+            this.$message.error(this.courseTypeListByName[key] + ' 课程时长不足')
+            return
+          }
+        }
+      }
       this.$refs.form.validate(async (valid) => {
         if (valid) {
           const list = [];