|
@@ -216,7 +216,7 @@
|
|
|
<el-form-item label="每课时长" prop="classTime">
|
|
|
<el-select
|
|
|
v-model.trim="leftForm.classTime"
|
|
|
- :disabled="timeTable.length > 0"
|
|
|
+ :disabled="timeTable.length > 0 || classTimeDis"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in this.classTimeList"
|
|
@@ -850,6 +850,7 @@ export default {
|
|
|
courseTimeList: [],
|
|
|
isMusicTheory: false,
|
|
|
chioseStudent: [],
|
|
|
+ classTimeDis: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -894,6 +895,23 @@ export default {
|
|
|
// this.$refs["leftForm"].resetFields();
|
|
|
// }, 100);
|
|
|
// 判断一下有没有缓存
|
|
|
+ this.$router.beforeEach(async (to, from, next) => {
|
|
|
+ if (this.leftForm?.classOrganId && from.path == "/business/buildVip") {
|
|
|
+ console.log(this.leftForm?.classOrganId);
|
|
|
+ this.$confirm("检测到您有未提交的数据, 离开将丢失该数据!", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ closeOnClickModal: false,
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ next();
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
+ } else {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+ });
|
|
|
this.courseType = this.$route.query.courseType;
|
|
|
if (this.courseType == "PRACTICE") {
|
|
|
this.title = "网管课申请";
|
|
@@ -998,14 +1016,7 @@ export default {
|
|
|
// }, 100);
|
|
|
// this.init();
|
|
|
},
|
|
|
- async beforeDestroy() {
|
|
|
- this.$confirm("检测到您有未提交的数据, 是否恢复?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- closeOnClickModal: false,
|
|
|
- type: "warning",
|
|
|
- }).then(async () => {});
|
|
|
- },
|
|
|
+ async beforeDestroy() {},
|
|
|
methods: {
|
|
|
resetFrom() {
|
|
|
this.leftForm = {
|
|
@@ -1115,12 +1126,13 @@ export default {
|
|
|
return {
|
|
|
firstDayOfWeek: 1,
|
|
|
disabledDate: (time) => {
|
|
|
- if (self.leftForm.courseStart) {
|
|
|
+ if (self.leftForm.courseStart&&self.leftForm.courseEnd) {
|
|
|
let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
|
|
|
+ let endDate = new Date(self.leftForm.courseEnd.replace(/-/, "/"));
|
|
|
let nowDate = new Date();
|
|
|
- let changeDate =
|
|
|
- date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
|
|
|
- return time.getTime() < changeDate.getTime();
|
|
|
+ let changeDate =date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
|
|
|
+ let endChangeDate = endDate.getTime() - nowDate.getTime() > 0 ? endDate : nowDate;
|
|
|
+ return time.getTime() < changeDate.getTime() || time.getTime() > endChangeDate.getTime();
|
|
|
}
|
|
|
return;
|
|
|
},
|
|
@@ -1232,6 +1244,8 @@ export default {
|
|
|
this.rightForm.onlineCourse = "";
|
|
|
// this.rightForm.onlinePrice = '';
|
|
|
// this.rightForm.offlinePrice = '';
|
|
|
+ this.centerForm.onlineCourseNum = 0;
|
|
|
+ this.centerForm.offlineCourseNum = 0;
|
|
|
this.lookList = [];
|
|
|
this.timeTable = [];
|
|
|
this.attribute1 = "";
|
|
@@ -1249,11 +1263,13 @@ export default {
|
|
|
this.rightForm.discount = 100;
|
|
|
|
|
|
if (val) {
|
|
|
+ this.classTimeDis = true;
|
|
|
for (let i in this.courseTypeList) {
|
|
|
if (this.courseTypeList[i].id == this.leftForm.courseType) {
|
|
|
// 学生人数
|
|
|
this.leftForm.classNum = this.courseTypeList[i].studentNum;
|
|
|
// 每课时长
|
|
|
+
|
|
|
this.classTimeList =
|
|
|
this.courseTypeList[i].singleClassMinutes.split(",");
|
|
|
// this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
|
|
@@ -1279,6 +1295,7 @@ export default {
|
|
|
this.leftForm.courseStart = this.activeList[i].coursesStartTime;
|
|
|
this.leftForm.courseEnd = this.activeList[i].coursesEndTime;
|
|
|
this.rightForm.discount = this.activeList[i].discount;
|
|
|
+ this.leftForm.classTime = this.activeList[i].singleCourseTime;
|
|
|
// 获取活动种类并保存
|
|
|
this.hotType = this.activeList[i].type;
|
|
|
// 获取买赠必要参数
|
|
@@ -1330,9 +1347,30 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ this.classTimeDis = false;
|
|
|
+ for (let i in this.courseTypeList) {
|
|
|
+ if (this.courseTypeList[i].id == this.leftForm.courseType) {
|
|
|
+ // 学生人数
|
|
|
+ this.leftForm.classNum = this.courseTypeList[i].studentNum;
|
|
|
+ // 每课时长
|
|
|
+ this.classTimeList =
|
|
|
+ this.courseTypeList[i].singleClassMinutes.split(",");
|
|
|
+ // this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
|
|
|
+ this.leftForm.classTime = this.classTimeList[0];
|
|
|
+ // 线上课单节价格
|
|
|
+ this.rightForm.onlinePrice =
|
|
|
+ this.courseTypeList[i].onlineClassesUnitPrice;
|
|
|
+ // 线下课单节价格
|
|
|
+ this.rightForm.offlinePrice =
|
|
|
+ this.courseTypeList[i].offlineClassesUnitPrice;
|
|
|
+ this.rightForm.discount = this.courseTypeList[i].discount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.leftForm.classTime = null;
|
|
|
if (this.courseType == "PRACTICE") {
|
|
|
this.hasOffline = false;
|
|
|
this.hasOnline = true;
|
|
|
+ this.classTimeList = [25];
|
|
|
}
|
|
|
}
|
|
|
// 重置课程单价
|