|
@@ -96,7 +96,7 @@
|
|
|
v-model.trim="leftForm.courseType"
|
|
|
clearable
|
|
|
filterable
|
|
|
- :disabled="!leftForm.classOrganId"
|
|
|
+ :disabled="!leftForm.classOrganId || !leftForm.teacher"
|
|
|
@change="changeType"
|
|
|
>
|
|
|
<el-option
|
|
@@ -266,6 +266,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="centerForm.onlineCourseNum"
|
|
|
@mousewheel.native.prevent
|
|
|
+ @input="onCourseNumChange('online')"
|
|
|
type="number"
|
|
|
>
|
|
|
<template slot="append">节</template>
|
|
@@ -275,6 +276,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="centerForm.offlineCourseNum"
|
|
|
@mousewheel.native.prevent
|
|
|
+ @input="onCourseNumChange('offline')"
|
|
|
type="number"
|
|
|
>
|
|
|
<template slot="append">节</template>
|
|
@@ -683,6 +685,7 @@ export default {
|
|
|
hotType: "",
|
|
|
attribute1: "",
|
|
|
attribute2: "",
|
|
|
+ attribute3: "",
|
|
|
salaryReadonlyFlag: "", // 老师课酬是否可配
|
|
|
paymentReadonlyFlag: "", // 课程单价是否可配
|
|
|
lookList: [],
|
|
@@ -814,6 +817,8 @@ export default {
|
|
|
this.giveNum = giveNum || 0;
|
|
|
|
|
|
return parseInt(offline) + parseInt(online) + "+" + giveNum || "";
|
|
|
+ } else if(this.hotType == 'DISCOUNT') {
|
|
|
+ return parseInt(this.attribute3)
|
|
|
}
|
|
|
return parseInt(offline) + parseInt(online) || "";
|
|
|
},
|
|
@@ -863,6 +868,20 @@ export default {
|
|
|
this.pickerOptions1 = this.processDate();
|
|
|
this.courseOption = this.coursesDate();
|
|
|
},
|
|
|
+ onCourseNumChange(type) {
|
|
|
+ let centerForm = this.centerForm
|
|
|
+ if(this.hotType == 'DISCOUNT') {
|
|
|
+ // 判断线上或线下总和等于排课次数
|
|
|
+ console.log((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)), this.attribute3)
|
|
|
+ if((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)) > this.attribute3) {
|
|
|
+ if(type == 'online') {
|
|
|
+ this.$message.error('线上课数加线下课数必须等于待排课数')
|
|
|
+ } else if(type == 'offline') {
|
|
|
+ this.$message.error('线上课数加线下课数必须等于待排课数')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
coursesDate() {
|
|
|
let self = this;
|
|
|
return {
|
|
@@ -951,7 +970,7 @@ export default {
|
|
|
}
|
|
|
// teacherId
|
|
|
|
|
|
- if (this.leftForm.courseType) {
|
|
|
+ if (this.leftForm.courseType && this.leftForm.teacher) {
|
|
|
// 根据课程类型获取活动方案
|
|
|
vipGroupActivityFind({
|
|
|
categoryId: this.leftForm.courseType,
|
|
@@ -973,6 +992,7 @@ export default {
|
|
|
this.timeTable = [];
|
|
|
this.attribute1 = "";
|
|
|
this.attribute2 = "";
|
|
|
+ this.attribute3 = ""
|
|
|
this.giveNum = 0;
|
|
|
this.isGiveClass = false;
|
|
|
this.leftForm.courseStart = "";
|
|
@@ -1003,6 +1023,7 @@ export default {
|
|
|
// 根须活动id获取 相应的值
|
|
|
for (let i in this.activeList) {
|
|
|
if (this.activeList[i].id == val) {
|
|
|
+ console.log(this.activeList[i])
|
|
|
// 如果是买赠就必须选择赠课类型
|
|
|
// 报名开始 报名结束 课程开始 课程结束 // 判断是否有线上,线下课 并同步状态
|
|
|
// this.leftForm.signUpStart = this.activeList[i].startTime;
|
|
@@ -1014,6 +1035,7 @@ export default {
|
|
|
// 获取买赠必要参数
|
|
|
this.attribute1 = this.activeList[i].attribute1;
|
|
|
this.attribute2 = this.activeList[i].attribute2;
|
|
|
+ this.attribute3 = this.activeList[i].attribute3;
|
|
|
// 存储课酬是否可配置
|
|
|
this.salaryReadonlyFlag = this.activeList[i].salaryReadonlyFlag;
|
|
|
this.paymentReadonlyFlag = this.activeList[i].paymentReadonlyFlag;
|
|
@@ -1630,8 +1652,18 @@ export default {
|
|
|
this.$message.error("您还未选择赠课类型");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
this.$refs["leftForm"].validate((vali) => {
|
|
|
if (vali) {
|
|
|
+
|
|
|
+ let centerForm = this.centerForm
|
|
|
+ if(this.hotType == 'DISCOUNT') {
|
|
|
+ // 判断线上或线下总和大于排课次数
|
|
|
+ if((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)) != this.attribute3) {
|
|
|
+ this.$message.error('线上课数加线下课数必须等于待排课数')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.dialogFormVisible = true;
|
|
|
}
|
|
|
});
|