Browse Source

修改课酬计算和日期选择优化

lex-xin 5 years ago
parent
commit
c325d68adf

File diff suppressed because it is too large
+ 0 - 0
dist/css/VIPApply.ae588c75.css


File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 0 - 0
dist/js/Approval~Attendance~CallNames~IStarted~Leave~PeriodAdjust~PeriodChange~TeachingSchool~TeachingSet~VI~0d4456f6.e1b7d5f8.js → dist/js/Approval~Attendance~CallNames~IStarted~Leave~PeriodAdjust~PeriodChange~TeachingSchool~TeachingSet~VI~0d4456f6.8d78c334.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/VIPApply.2ecf32c3.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/VIPApply.c5c2d0ec.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.c1f13edc.js


+ 0 - 0
dist/js/privacy.faf0622d.js → dist/js/privacy.7a771c42.js


+ 1 - 1
src/common/axios.js

@@ -1,5 +1,5 @@
 "use strict";
-
+/* eslint-disable */
 import axios from "axios"
 // import router from '../router/index'
 import { browser }  from '@/common/common'

+ 33 - 6
src/views/teacher/VIPApply.vue

@@ -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)
                     }

+ 1 - 0
src/views/teacher/studyReport.vue

@@ -79,6 +79,7 @@
   </div>
 </template>
 <script>
+/* eslint-disable */
 import { browser } from "@/common/common";
 import { addStudyReport } from "@/api/teacher";
 // addStudyReport

Some files were not shown because too many files changed in this diff