|
@@ -234,7 +234,9 @@
|
|
|
ref='maskForm'
|
|
|
width="500px"
|
|
|
:visible.sync="dialogFormVisible">
|
|
|
- <el-form :model="maskForm">
|
|
|
+ <el-form :model="maskForm"
|
|
|
+ label-position="right"
|
|
|
+ label-width="150px">
|
|
|
<el-form-item label="课程类型"
|
|
|
prop="type">
|
|
|
<el-radio v-if="hasOnline"
|
|
@@ -248,10 +250,22 @@
|
|
|
线下课
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-form-item label="线上课开课时间">
|
|
|
+ <el-date-picker v-model="maskForm.courseStartOnline"
|
|
|
+ type="date"
|
|
|
+ :picker-options="courseOption"
|
|
|
+ placeholder="请选择开课时间" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="线下课开课时间">
|
|
|
+ <el-date-picker v-model="maskForm.courseStartOffline"
|
|
|
+ type="date"
|
|
|
+ :picker-options="courseOption"
|
|
|
+ placeholder="请选择开课时间" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="循环周次"
|
|
|
prop="week">
|
|
|
- <el-select v-model="maskForm.week">
|
|
|
+ <el-select v-model="maskForm.week"
|
|
|
+ style="width:220px!important;">
|
|
|
<el-option label="星期日"
|
|
|
value="0" />
|
|
|
<el-option label="星期一"
|
|
@@ -278,6 +292,7 @@
|
|
|
}"
|
|
|
placeholder="选择时间" />
|
|
|
</el-form-item>
|
|
|
+
|
|
|
</el-form>
|
|
|
<div class="btnWrap">
|
|
|
<div class="okBtn"
|
|
@@ -311,14 +326,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="margin:20px 0">
|
|
|
- <el-date-picker v-model="maskForm.courseStart"
|
|
|
- type="date"
|
|
|
- :picker-options="courseOption"
|
|
|
- placeholder="请选择开课时间" />
|
|
|
- </div>
|
|
|
-
|
|
|
<div slot="footer"
|
|
|
+ style='margin-top:20px;'
|
|
|
class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">
|
|
|
取 消
|
|
@@ -360,7 +369,8 @@ export default {
|
|
|
classTime: '',
|
|
|
signUpStart: '',
|
|
|
signUpEnd: '',
|
|
|
- courseStart: '',
|
|
|
+ courseStartOnline: '',
|
|
|
+ courseStartOffline: '',
|
|
|
courseEnd: '',
|
|
|
section: ''
|
|
|
},
|
|
@@ -394,7 +404,9 @@ export default {
|
|
|
attribute1: '',
|
|
|
attribute2: '',
|
|
|
salaryReadonlyFlag: '', // 老师工资是否可配
|
|
|
- lookList: [], // 展示课表
|
|
|
+ lookList: [],
|
|
|
+ onlinelookList: [], // 展示课表线上
|
|
|
+ offlineLookList: [], // 展示课表线下
|
|
|
timeTable: [], // 真正的课表
|
|
|
giveNum: '',
|
|
|
weekDay: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
|
@@ -622,7 +634,7 @@ export default {
|
|
|
'id': Date.now()
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+ console.log(this.lookList)
|
|
|
// let courseType = this.maskForm.type;
|
|
|
// // let week = ;this.maskForm.week
|
|
|
// let startTime = this.maskForm.startTime;
|
|
@@ -682,14 +694,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
setTimeTable () {
|
|
|
- if (!this.maskForm.courseStart) {
|
|
|
- this.$message.error('请选择开课时间')
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
// 拿到线上课数与线下课数 以及
|
|
|
this.timeTable = [];
|
|
|
- let online = parseInt(this.centerForm.onlineCourseNum);
|
|
|
- let offline = parseInt(this.centerForm.offlineCourseNum);
|
|
|
+ let online = parseInt(this.centerForm.onlineCourseNum) || 0;
|
|
|
+ let offline = parseInt(this.centerForm.offlineCourseNum) || 0;
|
|
|
|
|
|
let giveNum = this.giveNum;
|
|
|
let giveClassType = this.centerForm.radio;
|
|
@@ -699,11 +709,20 @@ export default {
|
|
|
} else if (giveClassType == 'OFFLINE') {
|
|
|
offline += giveNum;
|
|
|
}
|
|
|
+ // 这里判断是否选择了排课开始时间
|
|
|
+ if (online && !this.maskForm.courseStartOnline) {
|
|
|
+ console.log(this.maskForm.courseStartOnline)
|
|
|
+ alert('选择了线上课 但没有线上课开始时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (offline && !this.maskForm.courseStartOffline) {
|
|
|
+ alert('选择了线下课 但没有线下课开始时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- let date = new Date(this.maskForm.courseStart.getTime());
|
|
|
- let date1 = new Date(this.maskForm.courseStart.getTime());
|
|
|
- let startWeekday = this.maskForm.courseStart.getDay();
|
|
|
+ let date = new Date(this.maskForm.courseStartOnline.getTime());
|
|
|
+ let date1 = new Date(this.maskForm.courseStartOffline.getTime());
|
|
|
+ // let startWeekday = this.maskForm.courseStart.getDay();
|
|
|
let onlineList = []; // 装线上课的数组
|
|
|
let offlineList = []; //装线下课的数组
|
|
|
if (this.lookList.length <= 0) {
|
|
@@ -804,14 +823,14 @@ export default {
|
|
|
},
|
|
|
// 计算课酬
|
|
|
computational () {
|
|
|
- let userId = this.leftForm.teacher;
|
|
|
- let giveTeachMode = this.centerForm.radio;
|
|
|
- let vipGroupCategoryId = this.leftForm.courseType;
|
|
|
- let vipGroupActivityId = this.leftForm.activeType;
|
|
|
- let onlineClassesUnitPrice = this.rightForm.onlinePrice;
|
|
|
- let offlineClassesUnitPrice = this.rightForm.offlinePrice;
|
|
|
- let onlineClassesNum = this.centerForm.onlineCourseNum;
|
|
|
- let offlineClassesNum = this.centerForm.offlineCourseNum;
|
|
|
+ let userId = this.leftForm.teacher || null;
|
|
|
+ let giveTeachMode = this.centerForm.radio || null;
|
|
|
+ let vipGroupCategoryId = this.leftForm.courseType || null;
|
|
|
+ let vipGroupActivityId = this.leftForm.activeType || null;
|
|
|
+ let onlineClassesUnitPrice = this.rightForm.onlinePrice || null;
|
|
|
+ let offlineClassesUnitPrice = this.rightForm.offlinePrice || null;
|
|
|
+ let onlineClassesNum = this.centerForm.onlineCourseNum || 0;
|
|
|
+ let offlineClassesNum = this.centerForm.offlineCourseNum || 0;
|
|
|
if (this.hotType == 'GIVE_CLASS') {
|
|
|
if (this.centerForm.radio == 'ONLINE') {
|
|
|
onlineClassesNum = parseInt(onlineClassesNum) + parseInt(this.giveNum)
|
|
@@ -861,8 +880,8 @@ export default {
|
|
|
coursesExpireDate: this.leftForm.courseEnd,
|
|
|
teacherSchoolId: this.leftForm.section,
|
|
|
name: this.leftForm.name,
|
|
|
- offlineClassesNum: offline,
|
|
|
- onlineClassesNum: online,
|
|
|
+ offlineClassesNum: offline || 0,
|
|
|
+ onlineClassesNum: online || 0,
|
|
|
offlineClassesUnitPrice: this.rightForm.offlinePrice,
|
|
|
onlineClassesUnitPrice: this.rightForm.onlinePrice,
|
|
|
paymentExpireDate: this.leftForm.signUpEnd,
|