|
@@ -494,6 +494,7 @@ export default {
|
|
|
this.form.giveTeachMode = value.value
|
|
|
this.formName.giveTeachModeName = value.name
|
|
|
this.statusList.giveTeachModeStatus = false
|
|
|
+ this.getCalcClass()
|
|
|
},
|
|
|
onClickSingleClass() {
|
|
|
if(!this.formName.vipGroupCategoryName) {
|
|
@@ -519,10 +520,19 @@ export default {
|
|
|
let tempMonth = selectDate.getMonth() + 1 >= 10 ? selectDate.getMonth() + 1 : '0' + (selectDate.getMonth() + 1)
|
|
|
let tempDay = selectDate.getDate() >= 10 ? selectDate.getDate() : '0' + selectDate.getDate()
|
|
|
let enlistForm = this.enlistForm
|
|
|
+ let form = this.form
|
|
|
if(enlistForm.updateStatus == 'start') {
|
|
|
- this.form.registrationStartTime = selectDate.getFullYear() + '-' + tempMonth + '-' + tempDay
|
|
|
+ form.registrationStartTime = selectDate.getFullYear() + '-' + tempMonth + '-' + tempDay
|
|
|
+ if(form.coursesExpireDate) {
|
|
|
+ let temps = new Date(form.registrationStartTime.replace(/-/ig, '/')).getTime()
|
|
|
+ let tempe = new Date(form.coursesExpireDate.replace(/-/ig, '/')).getTime()
|
|
|
+ // 如果开始时间大于结束时间,结束时间制空
|
|
|
+ if(temps > tempe){
|
|
|
+ form.coursesExpireDate = null
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if(enlistForm.updateStatus == 'end') {
|
|
|
- this.form.coursesExpireDate = selectDate.getFullYear() + '-' + tempMonth + '-' + tempDay
|
|
|
+ form.coursesExpireDate = selectDate.getFullYear() + '-' + tempMonth + '-' + tempDay
|
|
|
}
|
|
|
enlistForm.status = false
|
|
|
},
|
|
@@ -712,8 +722,9 @@ export default {
|
|
|
vcs = loadData.vipGroupCategorySelect, // 课程形式
|
|
|
tc = loadData.teacherCategory, // 老师基本信息
|
|
|
oncn = form.onlineClassesNums ? form.onlineClassesNums : 0, // 线上课次数
|
|
|
- offcn = form.offlineClassesNums ? form.offlineClassesNums : 0 // 线下课次数
|
|
|
- // giveTeachMode = form.giveTeachMode // 线下或线下
|
|
|
+ offcn = form.offlineClassesNums ? form.offlineClassesNums : 0, // 线下课次数
|
|
|
+ giveNum = parseInt(this.other.giveNum),
|
|
|
+ giveTeachMode = form.giveTeachMode // 线下或线下
|
|
|
// 优惠活动
|
|
|
// ...
|
|
|
if(vas.salarySettlementJson) {
|
|
@@ -721,6 +732,18 @@ export default {
|
|
|
// 获取每课时长
|
|
|
// 每45Min计算一些课酬
|
|
|
// let b = form.singleClassMinutes ? (form.singleClassMinutes / 45) : 0
|
|
|
+ let tempPrice= 0
|
|
|
+ if((Number(oncn) + Number(offcn)) > 0) {
|
|
|
+ let countPrice = (oncn * form.onlineClassesUnitPrice) + (offcn * form.offlineClassesUnitPrice)
|
|
|
+ if(giveNum > 0 && !giveTeachMode) {
|
|
|
+ countPrice = 0
|
|
|
+ }
|
|
|
+ tempPrice = countPrice * form.studentNum / (Number(oncn) + Number(offcn) + Number(giveNum))
|
|
|
+ if(vas.type == 'DISCOUNT') {
|
|
|
+ tempPrice = tempPrice * (vas.attribute1 ? Number(vas.attribute1) : 100) / 100
|
|
|
+ }
|
|
|
+ console.log(tempPrice)
|
|
|
+ }
|
|
|
// 课程按课来计算
|
|
|
if (obj && obj.onlineSalarySettlement) {
|
|
|
let onss = obj.onlineSalarySettlement
|
|
@@ -729,7 +752,9 @@ export default {
|
|
|
form.onlineTeacherSalary = Math.round(tc.onlineClassesSalary) // 线上课酬
|
|
|
} else if(onss.salarySettlementType == 'RATIO_DISCOUNT') {
|
|
|
// 老师课酬的折扣 如果有则不打折
|
|
|
- form.onlineTeacherSalary = Math.round(vcs.onlineClassesUnitPrice * (onss.settlementValue ? onss.settlementValue : 100) / 100)
|
|
|
+ // form.onlineTeacherSalary = Math.round(vcs.onlineClassesUnitPrice * (onss.settlementValue ? onss.settlementValue : 100) / 100)
|
|
|
+
|
|
|
+ form.onlineTeacherSalary = Math.round(tempPrice ? (tempPrice * (onss.settlementValue ? onss.settlementValue : 100) / 100) : 0)
|
|
|
} else if(onss.salarySettlementType == 'FIXED_SALARY') {
|
|
|
form.onlineTeacherSalary = Math.round(onss.settlementValue)
|
|
|
}
|
|
@@ -742,7 +767,9 @@ export default {
|
|
|
form.offlineTeacherSalary = Math.round(tc.offlineClassesSalary) // 线上课酬
|
|
|
} else if(offss.salarySettlementType == 'RATIO_DISCOUNT') {
|
|
|
// 老师课酬的折扣
|
|
|
- form.offlineTeacherSalary = Math.round((vcs.offlineClassesUnitPrice * (offss.settlementValue ? offss.settlementValue : 100) / 100))
|
|
|
+ // form.offlineTeacherSalary = Math.round((vcs.offlineClassesUnitPrice * (offss.settlementValue ? offss.settlementValue : 100) / 100))
|
|
|
+
|
|
|
+ form.offlineTeacherSalary = Math.round(tempPrice ? (tempPrice * (offss.settlementValue ? offss.settlementValue : 100) / 100) : 0)
|
|
|
} else if(offss.salarySettlementType == 'FIXED_SALARY') {
|
|
|
form.offlineTeacherSalary = Math.round(offss.settlementValue)
|
|
|
}
|