|
@@ -244,6 +244,13 @@
|
|
|
:closable="false"
|
|
|
class="vipMsg"
|
|
|
></el-alert>
|
|
|
+
|
|
|
+ <p class="submitP" v-if="minCourseNum&&maxCourseNum&&this.hotType == 'DISCOUNT'">
|
|
|
+ 该活动最小课时数:<span style="color: red">{{ minCourseNum }}</span
|
|
|
+ >节 最大课时数:<span style="color: red">{{ maxCourseNum }}</span
|
|
|
+ >节
|
|
|
+ </p>
|
|
|
+
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
:model="centerForm"
|
|
@@ -872,23 +879,20 @@ export default {
|
|
|
this.courseOption = this.coursesDate();
|
|
|
},
|
|
|
onCourseNumChange(type) {
|
|
|
- let centerForm = this.centerForm;
|
|
|
// 折扣类型,并且设置的排课数有值
|
|
|
+ let centerForm = this.centerForm;
|
|
|
if (
|
|
|
this.hotType == "DISCOUNT" &&
|
|
|
- this.attribute3 &&
|
|
|
- this.attribute3 > 0
|
|
|
+ this.maxCourseNum &&
|
|
|
+ this.minCourseNum
|
|
|
) {
|
|
|
- // 判断线上或线下总和等于排课次数
|
|
|
- // console.log((parseInt(centerForm.onlineCourseNum) + parseInt(centerForm.offlineCourseNum)), this.attribute3)
|
|
|
+ // 判断线上或线下总和大于排课次数
|
|
|
let onlineNum = centerForm.onlineCourseNum || 0;
|
|
|
let offlineNum = centerForm.offlineCourseNum || 0;
|
|
|
- if (parseInt(onlineNum) + parseInt(offlineNum) > this.attribute3) {
|
|
|
- if (type == "online") {
|
|
|
- this.$message.error("线上课数加线下课数必须等于待排课数");
|
|
|
- } else if (type == "offline") {
|
|
|
- this.$message.error("线上课数加线下课数必须等于待排课数");
|
|
|
- }
|
|
|
+ let allNUm = parseInt(onlineNum) + parseInt(offlineNum);
|
|
|
+ if (allNUm > this.maxCourseNum || allNUm < this.minCourseNum) {
|
|
|
+ this.$message.error("待排课数不可超过该活动限制");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -994,7 +998,6 @@ export default {
|
|
|
},
|
|
|
// 选择活动方案
|
|
|
chioseActive(val) {
|
|
|
- console.log(val);
|
|
|
this.rightForm.offlineCourse = "";
|
|
|
this.rightForm.onlineCourse = "";
|
|
|
// this.rightForm.onlinePrice = '';
|
|
@@ -1004,8 +1007,7 @@ export default {
|
|
|
this.attribute1 = "";
|
|
|
this.attribute2 = "";
|
|
|
this.attribute3 = "";
|
|
|
- this.maxCourseNum = val.maxCourseNum || 0;
|
|
|
- this.minCourseNum = val.minCourseNum || 0;
|
|
|
+
|
|
|
this.giveNum = 0;
|
|
|
this.isGiveClass = false;
|
|
|
this.leftForm.courseStart = "";
|
|
@@ -1036,11 +1038,12 @@ 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;
|
|
|
// this.leftForm.signUpEnd = this.activeList[i].endTime;
|
|
|
+ this.maxCourseNum = this.activeList[i].maxCourseNum || 0;
|
|
|
+ this.minCourseNum = this.activeList[i].minCourseNum || 0;
|
|
|
this.leftForm.courseStart = this.activeList[i].coursesStartTime;
|
|
|
this.leftForm.courseEnd = this.activeList[i].coursesEndTime;
|
|
|
// 获取活动种类并保存
|
|
@@ -1671,14 +1674,16 @@ export default {
|
|
|
let centerForm = this.centerForm;
|
|
|
if (
|
|
|
this.hotType == "DISCOUNT" &&
|
|
|
- this.attribute3 &&
|
|
|
- this.attribute3 > 0
|
|
|
+ this.maxCourseNum &&
|
|
|
+ this.minCourseNum
|
|
|
) {
|
|
|
// 判断线上或线下总和大于排课次数
|
|
|
let onlineNum = centerForm.onlineCourseNum || 0;
|
|
|
let offlineNum = centerForm.offlineCourseNum || 0;
|
|
|
- if (parseInt(onlineNum) + parseInt(offlineNum) != this.attribute3) {
|
|
|
- this.$message.error("线上课数加线下课数必须等于待排课数");
|
|
|
+ let allNUm = parseInt(onlineNum) + parseInt(offlineNum);
|
|
|
+ if (allNUm > this.maxCourseNum || allNUm < this.minCourseNum) {
|
|
|
+ this.$message.error("待排课数不可超过该活动限制");
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -1936,4 +1941,9 @@ export default {
|
|
|
background-color: #f97215;
|
|
|
float: right;
|
|
|
}
|
|
|
+.submitP {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ font-size: 14px;
|
|
|
+ padding-left: 24px;
|
|
|
+}
|
|
|
</style>
|