Ver Fonte

Merge branch '03/18VipActive' into test

lex-xin há 4 anos atrás
pai
commit
2f9fcdcc66
1 ficheiros alterados com 35 adições e 5 exclusões
  1. 35 5
      src/views/teacher/VIP00Apply.vue

+ 35 - 5
src/views/teacher/VIP00Apply.vue

@@ -834,6 +834,13 @@
 						forMark++
 					}
 				}
+
+				 this.timeTable.sort((a,b)=>{
+					 let aStr = dayjs(dayjs(a.classDate).format('YYYY-MM-DD')+' '+a.startClassTimeStr+':00').valueOf()
+					let bStr =  dayjs(dayjs(b.classDate).format('YYYY-MM-DD')+' '+b.startClassTimeStr+':00').valueOf()
+					return aStr-bStr
+      			})
+				// console.log(this.timeTable)
 			},
 			onGiveMode() { // 赠送课改变时
 				this.statusList.giveTeachModeStatus = true
@@ -1002,8 +1009,6 @@
 			async onSubmit() {
 				let form = this.form
 				let statusList = this.statusList
-				// 排课
-				this.setTimeTable()
 
 				// if (!(form.name)) {
 				// 	this.$toast('请输入课程班名称')
@@ -1083,11 +1088,16 @@
 					// debugger
 					let tempCourseCount = (parseInt(form.onlineClassesNums) + parseInt(form.offlineClassesNums))
 					if(vipGroupActivitySelect.minCourseNum > tempCourseCount || tempCourseCount > vipGroupActivitySelect.maxCourseNum) {
-						this.$toast('课时总数最小课时为:' + vipGroupActivitySelect.minCourseNum + '节,最大课时为:' + vipGroupActivitySelect.maxCourseNum + '节')
+						this.$toast(`课时总数为${vipGroupActivitySelect.minCourseNum}~${vipGroupActivitySelect.maxCourseNum}节`)
 						return
 					}
 				}
-				// if(form.onlineClassesNums + form.offlineClassesNums )
+
+				if(!this.checkCourseList()) {
+					return
+				}
+				// 排课
+				this.setTimeTable()
 
 				// 如果线上和线下课酬都为0时
 				if(statusList.hasOnline && statusList.hasOffline) {
@@ -1210,8 +1220,22 @@
 				let statusList = this.statusList
 				let onlineClassesStatus = !form.onlineClassesNums && form.onlineClassesNums <= 0 ? true : false
 				let offlineClassesStatus = !form.offlineClassesNums && form.offlineClassesNums <= 0 ? true : false
+				// let onlineClassesStatus = false
+				// if(form.onlineClassesNums || form.onlineClassesNums >= 0) {
+				// 	onlineClassesStatus = true
+				// }
+				// let offlineClassesStatus = false
+				// if(form.offlineClassesNums || form.offlineClassesNums >= 0) {
+				// 	offlineClassesStatus = true
+				// }
 				if (statusList.hasOnline) {
-					if (!onlineClassesStatus && !hasOnLine) {
+					if(onlineClassesStatus) {
+						if(isShowToast) {
+							this.$toast('请输入线上课次数')
+						}
+						return false
+					}
+					if ((!onlineClassesStatus && !hasOnLine)) {
 						if(isShowToast) {
 							this.$toast('课时安排缺少线上课类型')
 						}
@@ -1222,6 +1246,12 @@
 				}
 
 				if (statusList.hasOffline) {
+					if(offlineClassesStatus) {
+						if(isShowToast) {
+							this.$toast('请输入线下课次数')
+						}
+						return false
+					}
 					if (!offlineClassesStatus && !hasOffLine) {
 						if(isShowToast) {
 							this.$toast('课时安排缺少线下课类型')