Browse Source

添加课酬为零时提示

lex-xin 4 years ago
parent
commit
957343ada2
1 changed files with 25 additions and 1 deletions
  1. 25 1
      src/views/teacher/VIP00Apply.vue

+ 25 - 1
src/views/teacher/VIP00Apply.vue

@@ -300,7 +300,8 @@
 					rows: 20
 				},
 				dataShow: true, // 是否有数据
-				dataList: []
+				dataList: [],
+				salaryStatus: true, // 是否跳过课酬二次确认
 			}
 		},
 		mounted() {
@@ -1052,6 +1053,16 @@
 						this.$toast('请输入线上课课酬')
 						return false
 					}
+
+					if(form.onlineClassesNums > 0 && form.onlineTeacherSalary <= 0 && this.salaryStatus) {
+						this.$dialog.confirm({
+							message: '当前课程课酬预计为0,是否继续?'
+						}).then(() => {
+							this.salaryStatus = false
+							this.onSubmit()
+						})
+						return
+					}
 				}
 
 				if (statusList.hasOffline) {
@@ -1063,6 +1074,16 @@
 						this.$toast('请输入线下课课酬')
 						return false
 					}
+
+					if(form.offlineClassesNums > 0 && form.offlineTeacherSalary <= 0 && this.salaryStatus) {
+						this.$dialog.confirm({
+							message: '当前课程课酬预计为0,是否继续?'
+						}).then(() => {
+							this.salaryStatus = false
+							this.onSubmit()
+						})
+						return
+					}
 				}
 
 				if (form.giveTeachMode == 'ONLINE') {
@@ -1106,9 +1127,12 @@
 						}, 500)
 					} else {
 						this.onSubmitStatus = true
+						this.salaryStatus = true
 						this.$toast(result.msg)
 					}
 				}).catch(() => {
+					this.onSubmitStatus = true
+					this.salaryStatus = true
 					setLoading(false)
 				})
 			},