1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["VIPApply"],{3354:function(e,t,a){},"37ad":function(e,t,a){"use strict";var s=a("a6cc"),i=a.n(s);i.a},"38f5":function(e,t,a){"use strict";a.r(t);for(var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"vipapply"},[e.statusList.headerStatus?a("m-header"):e._e(),a("div",{staticClass:"vip-title"},[e._v("课程信息")]),a("van-cell-group",[a("van-field",{attrs:{label:"课程班名称","input-align":"right",size:"large",placeholder:"请输入班级名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}}),a("van-field",{attrs:{label:"科目名称",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onGetSheetList("subjectList")}},model:{value:e.formName.subjectListName,callback:function(t){e.$set(e.formName,"subjectListName",t)},expression:"formName.subjectListName"}}),a("van-field",{attrs:{label:"课程形式",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onGetSheetList("vipGroupCategory")}},model:{value:e.formName.vipGroupCategoryName,callback:function(t){e.$set(e.formName,"vipGroupCategoryName",t)},expression:"formName.vipGroupCategoryName"}}),a("van-field",{attrs:{label:"活动方案",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onGetSheetList("vipGroupActivity")}},model:{value:e.formName.vipGroupActivityName,callback:function(t){e.$set(e.formName,"vipGroupActivityName",t)},expression:"formName.vipGroupActivityName"}}),e.statusList.hasOffline?a("van-field",{attrs:{label:"线下课地址",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onGetSheetList("teacherSchool")}},model:{value:e.formName.teacherSchoolName,callback:function(t){e.$set(e.formName,"teacherSchoolName",t)},expression:"formName.teacherSchoolName"}}):e._e()],1),a("div",{staticClass:"vip-title"},[e._v("课时组成")]),a("van-cell-group",[a("van-field",{attrs:{label:"每班人数",disabled:"","input-align":"right",size:"large",placeholder:"每班预计招收人数"},model:{value:e.form.studentNum,callback:function(t){e.$set(e.form,"studentNum",t)},expression:"form.studentNum"}}),a("van-field",{attrs:{label:"每课时长",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请输入每课时长"},on:{click:e.onClickSingleClass},model:{value:e.form.singleClassMinutes,callback:function(t){e.$set(e.form,"singleClassMinutes",t)},expression:"form.singleClassMinutes"}}),e.statusList.hasOnline?a("van-field",{attrs:{label:"线上课","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:e.onClassKeyUp},model:{value:e.form.onlineClassesNums,callback:function(t){e.$set(e.form,"onlineClassesNums",t)},expression:"form.onlineClassesNums"}}):e._e(),e.statusList.hasOffline?a("van-field",{attrs:{label:"线下课","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:e.onClassKeyUp},model:{value:e.form.offlineClassesNums,callback:function(t){e.$set(e.form,"offlineClassesNums",t)},expression:"form.offlineClassesNums"}}):e._e()],1),a("div",{staticClass:"vip-title"},[e._v("时间安排")]),a("van-cell-group",[a("van-field",{attrs:{label:"报名开始时间",disabled:"","input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onEnListShow("start",e.form.registrationStartTime)}},model:{value:e.form.registrationStartTime,callback:function(t){e.$set(e.form,"registrationStartTime",t)},expression:"form.registrationStartTime"}}),a("van-field",{attrs:{label:"报名截止时间",disabled:"","input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onEnListShow("end",e.form.coursesExpireDate)}},model:{value:e.form.coursesExpireDate,callback:function(t){e.$set(e.form,"coursesExpireDate",t)},expression:"form.coursesExpireDate"}})],1),a("div",{staticClass:"vip-title"},[e._v("课时安排")]),a("van-cell-group",[a("van-field",{attrs:{label:"课时总数",disabled:"","input-align":"right",size:"large",placeholder:"请输入次数"},model:{value:e.form.totalClassTime,callback:function(t){e.$set(e.form,"totalClassTime",t)},expression:"form.totalClassTime"}}),e.statusList.teachOnOrOff?a("van-field",{attrs:{label:"赠课类型",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:e.onGiveMode},model:{value:e.formName.giveTeachModeName,callback:function(t){e.$set(e.formName,"giveTeachModeName",t)},expression:"formName.giveTeachModeName"}}):e._e(),a("van-field",{attrs:{label:"排课开始时间",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){e.dataForm.status=!0}},model:{value:e.form.courseStart,callback:function(t){e.$set(e.form,"courseStart",t)},expression:"form.courseStart"}}),e._l(e.scheduleList,function(t,s){return a("van-cell",{key:s,attrs:{"title-class":"title-time"}},[a("template",{slot:"title"},[a("span",{staticClass:"online"},[e._v(e._s(t.type))]),a("span",{staticClass:"week"},[e._v(e._s(t.weekStr))]),a("span",{staticClass:"timer"},[e._v(e._s(t.startTime+"-"+t.endTime))])]),a("template",{slot:"default"},[a("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(a){return e.onScheduleRemove(t)}}},[e._v("删除")])],1)],2)}),a("div",{staticClass:"add-plan van-cell",on:{click:e.onCourseShedule}},[a("van-icon",{attrs:{name:"add-o"}}),e._v("课时安排\n ")],1),e.scheduleList.length>0?a("van-field",{attrs:{label:"排课列表",disabled:"","input-align":"right","is-link":"",size:"large"},on:{click:e.onShowTimeTable}}):e._e()],2),a("div",{staticClass:"vip-title"},[e._v("课酬设置")]),a("van-cell-group",[e.statusList.hasOnline?a("van-field",{attrs:{label:"线上课单价",type:"number","input-align":"right",size:"large",disabled:0==e.loadData.vipGroupActivitySelect.paymentReadonlyFlag,placeholder:"金额(每课时)"},on:{keyup:e.getCalcClass},model:{value:e.form.onlineClassesUnitPrice,callback:function(t){e.$set(e.form,"onlineClassesUnitPrice",t)},expression:"form.onlineClassesUnitPrice"}}):e._e(),e.statusList.hasOffline?a("van-field",{attrs:{label:"线下课单价",type:"number","input-align":"right",size:"large",disabled:0==e.loadData.vipGroupActivitySelect.paymentReadonlyFlag,placeholder:"金额(每课时)"},on:{keyup:e.getCalcClass},model:{value:e.form.offlineClassesUnitPrice,callback:function(t){e.$set(e.form,"offlineClassesUnitPrice",t)},expression:"form.offlineClassesUnitPrice"}}):e._e(),e.statusList.hasOnline?a("van-field",{attrs:{label:"线上课课酬","input-align":"right",size:"large",disabled:0==e.loadData.vipGroupActivitySelect.salaryReadonlyFlag,placeholder:"金额(每课时)",type:"number"},model:{value:e.form.onlineTeacherSalary,callback:function(t){e.$set(e.form,"onlineTeacherSalary",t)},expression:"form.onlineTeacherSalary"}}):e._e(),e.statusList.hasOffline?a("van-field",{attrs:{label:"线下课课酬","input-align":"right",size:"large",disabled:0==e.loadData.vipGroupActivitySelect.salaryReadonlyFlag,placeholder:"金额(每课时)",type:"number"},model:{value:e.form.offlineTeacherSalary,callback:function(t){e.$set(e.form,"offlineTeacherSalary",t)},expression:"form.offlineTeacherSalary"}}):e._e(),a("van-field",{attrs:{disabled:"",label:"课程总价","input-align":"right",size:"large",placeholder:"金额(每课时)"},model:{value:e.form.totalCount,callback:function(t){e.$set(e.form,"totalCount",t)},expression:"form.totalCount"}})],1),a("div",{staticClass:"button-group"},[a("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:e.onSubmit}},[e._v("确认")])],1),a("van-action-sheet",{attrs:{actions:e.loadData.classTimer,"cancel-text":"取消"},on:{cancel:function(t){e.statusList.classTimerStatus=!1},select:e.onClassTimerSelect},model:{value:e.statusList.classTimerStatus,callback:function(t){e.$set(e.statusList,"classTimerStatus",t)},expression:"statusList.classTimerStatus"}}),a("van-popup",{attrs:{position:"bottom"},model:{value:e.enlistForm.status,callback:function(t){e.$set(e.enlistForm,"status",t)},expression:"enlistForm.status"}},[a("van-datetime-picker",{attrs:{type:"date","min-date":e.enlistForm.minDate,"max-date":e.enlistForm.maxDate,formatter:e.formatter},on:{cancel:function(t){e.enlistForm.status=!1},confirm:e.onEnlistConfirm},model:{value:e.enlistForm.currentDate,callback:function(t){e.$set(e.enlistForm,"currentDate",t)},expression:"enlistForm.currentDate"}})],1),a("van-action-sheet",{attrs:{actions:e.loadData.giveTeachMode,"cancel-text":"取消"},on:{cancel:function(t){e.statusList.giveTeachModeStatus=!1},select:e.onModeSelect},model:{value:e.statusList.giveTeachModeStatus,callback:function(t){e.$set(e.statusList,"giveTeachModeStatus",t)},expression:"statusList.giveTeachModeStatus"}}),a("van-popup",{attrs:{position:"bottom"},model:{value:e.sheetForm.sheetStatus,callback:function(t){e.$set(e.sheetForm,"sheetStatus",t)},expression:"sheetForm.sheetStatus"}},[a("van-picker",{attrs:{loading:e.sheetForm.loading,"default-index":e.sheetForm.index,columns:e.sheetForm.columns,"show-toolbar":""},on:{cancel:function(t){e.sheetForm.sheetStatus=!1},confirm:e.onSheetConfirm}})],1),a("van-popup",{attrs:{position:"bottom"},model:{value:e.dataForm.status,callback:function(t){e.$set(e.dataForm,"status",t)},expression:"dataForm.status"}},[a("van-datetime-picker",{attrs:{type:"date","min-date":e.dataForm.minDate,"max-date":e.dataForm.maxDate,formatter:e.formatter},on:{cancel:function(t){e.dataForm.status=!1},confirm:e.onCurrentConfirm},model:{value:e.dataForm.currentDate,callback:function(t){e.$set(e.dataForm,"currentDate",t)},expression:"dataForm.currentDate"}})],1),a("van-popup",{attrs:{position:"bottom"},model:{value:e.courseForm.teachingStatus,callback:function(t){e.$set(e.courseForm,"teachingStatus",t)},expression:"courseForm.teachingStatus"}},[a("van-picker",{attrs:{columns:e.courseForm.columns,"show-toolbar":""},on:{cancel:function(t){e.courseForm.teachingStatus=!1},confirm:e.onTeachinConfirm}})],1),a("van-popup",{attrs:{position:"bottom"},model:{value:e.statusList.classTime,callback:function(t){e.$set(e.statusList,"classTime",t)},expression:"statusList.classTime"}},[a("van-row",[a("van-col",{attrs:{span:"12"}},[e._v("上课类型")]),a("van-col",{attrs:{span:"12"}},[e._v("上课时间")])],1),a("div",{staticClass:"tableContainer"},e._l(e.timeTable,function(t,s){return a("van-row",{key:s},[a("van-col",{attrs:{span:"12"}},[e._v("\n "+e._s("ONLINE"==t.teachMode?"线上":"线下")+"\n ")]),a("van-col",{attrs:{span:"12"}},[e._v("\n "+e._s(t.classDate)+" "+e._s(t.startClassTimeStr)+"\n ")])],1)}),1)],1)],1)},i=[],n=(a("a481"),a("c5f6"),a("28a5"),a("ac6a"),a("7f7f"),a("6e6e")),r=a("ff51"),o=a("9afb"),l=[],u=0;u<60;u++){var c=u<10?"0"+u:u;l.push(c+"分")}var m={name:"vipapply",components:{MHeader:n["a"]},data:function(){return{dataForm:{status:!1,minDate:new Date,maxDate:new Date(2025,10,1),currentDate:new Date},enlistForm:{updateStatus:"",status:!1,minDate:new Date,maxDate:new Date(2025,10,1),currentDate:new Date},statusList:{giveTeachModeStatus:!1,teachOnOrOff:!1,hasOnline:!1,hasOffline:!1,classTime:!1,headerStatus:!1,classTimerStatus:!1},loadData:{subjectList:[],subjectListSelect:[],vipGroupCategory:[],vipGroupCategorySelect:[],vipGroupActivity:[],vipGroupActivitySelect:[],teacherSchool:[],teacherSchoolSelect:[],giveTeachMode:[{name:"线上课",value:"ONLINE"},{name:"线下课",value:"OFFLINE"}],giveTeachModeSelect:[],teacherCategory:[],classTimer:[]},sheetForm:{currentType:null,sheetStatus:!1,loading:!0,index:0,columns:[]},courseForm:{teachingStatus:!1,columns:[{values:["线上","线下"],className:"type"},{values:["周一","周二","周三","周四","周五","周六","周日"],className:"week"},{values:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],className:"hours",defaultIndex:7},{values:l,className:"minutes"}]},form:{name:null,subjectIdList:null,vipGroupCategoryId:null,vipGroupActivityId:null,teacherSchoolId:null,studentNum:null,singleClassMinutes:null,onlineClassesNums:null,offlineClassesNums:null,registrationStartTime:null,coursesExpireDate:null,totalClassTime:null,courseStart:null,giveTeachMode:null,onlineClassesUnitPrice:null,offlineClassesUnitPrice:null,onlineTeacherSalary:null,offlineTeacherSalary:null,totalCount:null},formName:{subjectListName:null,subjectListIndex:0,vipGroupCategoryName:null,vipGroupCategoryIndex:0,vipGroupActivityName:null,vipGroupActivityIndex:0,teacherSchoolName:null,teacherSchoolIndex:0,giveTeachModeName:null},other:{onlineSalary:null,offlineSalary:null,giveNum:0},scheduleList:[],timeTable:[],onSubmitStatus:!0}},mounted:function(){var e=this.$route.query;e.Authorization&&(localStorage.setItem("Authorization",decodeURI(e.Authorization)),localStorage.setItem("userInfo",decodeURI(e.Authorization))),document.title="VIP课程班申请",Object(r["a"])().android&&(this.headerStatus=!0)},methods:{onGetSheetList:function(e){var t=this.sheetForm;if(t.columns=[],this.form.vipGroupCategoryId||"vipGroupActivity"!=e){t.sheetStatus=!0,t.loading=!0,t.currentType=e,t.index=0;var a=this.loadData[e];a.length>0?(t.columns=a,t.index=this.formName[e+"Index"],t.loading=!1):this.onLoadingData(e)}else this.$toast("请选择课程形式")},onLoadingData:function(){var e=this,t=this.sheetForm;"subjectList"==t.currentType?Object(o["i"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(e){e.value=e.id,e.text=e.name,i.push(e)}),e.loadData.subjectList=i,t.columns=i,t.loading=!1}else e.$toast("暂无科目列表"),t.loading=!1}):"vipGroupCategory"==t.currentType?Object(o["M"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(e){e.value=e.id,e.text=e.name,i.push(e)}),e.loadData.vipGroupCategory=i,t.columns=i,t.loading=!1}else e.$toast("暂无课程形式"),t.loading=!1}):"vipGroupActivity"==t.currentType?Object(o["h"])({categoryId:this.form.vipGroupCategoryId}).then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(e){e.value=e.id,e.text=e.name,e.startTime=e.startTime?e.startTime.split(" ")[0]:null,e.endTime=e.endTime?e.endTime.split(" ")[0]:null,i.push(e)}),e.loadData.vipGroupActivity=i,t.columns=i,t.loading=!1}else e.$toast("暂无活动文案"),t.loading=!1}):"teacherSchool"==t.currentType&&Object(o["l"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(e){e.value=e.id,e.text=e.name,i.push(e)}),e.loadData.teacherSchool=i,t.columns=i,t.loading=!1}else e.$toast("暂无教学点"),t.loading=!1})},findTeacherCategory:function(e){var t=this;Object(o["g"])({categoryId:e}).then(function(e){var a=e.data;200==a.code&&(t.loadData.teacherCategory=a.data)})},onSheetConfirm:function(e,t){var a=this,s=this.sheetForm,i=this.form,n=this.formName,r=this.loadData;if("subjectList"==s.currentType)i.subjectIdList=e.value,n.subjectListName=e.text,n.subjectListIndex=t,r.subjectListSelect=e;else if("vipGroupCategory"==s.currentType){r.vipGroupCategorySelect.id!=e.id&&this.findTeacherCategory(e.id),i.vipGroupCategoryId=e.value,n.vipGroupCategoryName=e.text,n.vipGroupCategoryIndex=t,r.vipGroupCategorySelect=e,i.studentNum=e.studentNum,i.onlineClassesUnitPrice=Math.ceil(e.onlineClassesUnitPrice),i.offlineClassesUnitPrice=Math.ceil(e.offlineClassesUnitPrice),i.singleClassMinutes=null,r.classTimer=[];var o=e.singleClassMinutes.split(",");o.forEach(function(e){a.loadData.classTimer.push({name:e,value:e})}),i.vipGroupActivityId=null,n.vipGroupActivityName=null,n.vipGroupActivityIndex=0,r.vipGroupActivity=[],r.vipGroupActivitySelect=[]}else"vipGroupActivity"==s.currentType?(i.vipGroupActivityId!=e.value&&(i.offlineClassesNums=null,i.onlineClassesNums=null),i.vipGroupActivityId=e.value,n.vipGroupActivityName=e.text,n.vipGroupActivityIndex=t,r.vipGroupActivitySelect=e,i.onlineClassesUnitPrice=Math.ceil(r.vipGroupCategorySelect.onlineClassesUnitPrice),i.offlineClassesUnitPrice=Math.ceil(r.vipGroupCategorySelect.offlineClassesUnitPrice),this.onCalcClassTimes(e),this.getCalcClass(),this.setTimeTable()):"teacherSchool"==s.currentType&&(i.teacherSchoolId=e.value,n.teacherSchoolName=e.text,n.teacherSchoolIndex=t);s.sheetStatus=!1},onClassKeyUp:function(){var e=this.loadData.vipGroupActivitySelect;this.onCalcClassTimes(e),this.getCalcClass(),this.setTimeTable()},onCalcClassTimes:function(e){var t=this.form,a=this.other,s=this.statusList,i=Number(t.onlineClassesNums)+Number(t.offlineClassesNums);if(e.salarySettlementJson){var n=JSON.parse(e.salarySettlementJson);n&&n.onlineSalarySettlement?s.hasOnline=!0:s.hasOnline=!1,n&&n.offlineSalarySettlement?s.hasOffline=!0:s.hasOffline=!1}"GIVE_CLASS"==e.type?(this.statusList.teachOnOrOff=!0,i>=Number(e.attribute1)?(t.totalClassTime=i+"+"+e.attribute2,a.giveNum=e.attribute2):(t.totalClassTime=i,a.giveNum=0)):(t.totalClassTime=i,a.giveNum=0,this.statusList.teachOnOrOff=!1)},onModeSelect:function(e){this.form.giveTeachMode=e.value,this.formName.giveTeachModeName=e.name,this.statusList.giveTeachModeStatus=!1,this.getCalcClass()},onClickSingleClass:function(){this.formName.vipGroupCategoryName?this.statusList.classTimerStatus=!0:this.$toast("请选择课程形式")},onClassTimerSelect:function(e){this.form.singleClassMinutes=e.value,this.statusList.classTimerStatus=!1,this.getCalcClass()},onCurrentConfirm:function(e){var t=new Date(e),a=t.getMonth()+1>=10?t.getMonth()+1:"0"+(t.getMonth()+1),s=t.getDate()>=10?t.getDate():"0"+t.getDate();this.form.courseStart=t.getFullYear()+"-"+a+"-"+s,this.dataForm.status=!1},onEnlistConfirm:function(e){var t=new Date(e),a=t.getMonth()+1>=10?t.getMonth()+1:"0"+(t.getMonth()+1),s=t.getDate()>=10?t.getDate():"0"+t.getDate(),i=this.enlistForm,n=this.form;if("start"==i.updateStatus){if(n.registrationStartTime=t.getFullYear()+"-"+a+"-"+s,n.coursesExpireDate){var r=new Date(n.registrationStartTime.replace(/-/gi,"/")).getTime(),o=new Date(n.coursesExpireDate.replace(/-/gi,"/")).getTime();r>o&&(n.coursesExpireDate=null)}}else"end"==i.updateStatus&&(n.coursesExpireDate=t.getFullYear()+"-"+a+"-"+s);i.status=!1},onEnListShow:function(e,t){var a=this.enlistForm;"end"==e?this.form.registrationStartTime?a.minDate=new Date(this.form.registrationStartTime.replace(/-/gi,"/")):a.minDate=new Date:"start"==e&&(a.minDate=new Date),a.currentDate=t?new Date(t.replace(/-/gi,"/")):new Date,a.updateStatus=e,a.status=!0},onCourseShedule:function(){this.form.singleClassMinutes?this.other.giveNum>0&&!this.form.giveTeachMode?this.$toast("请选择赠课类型"):this.form.courseStart?this.courseForm.teachingStatus=!0:this.$toast("请选择排课开始时间"):this.$toast("请选每课时长")},onScheduleRemove:function(e){var t=this.scheduleList.indexOf(e);-1!==t&&this.scheduleList.splice(t,1)},onTeachinConfirm:function(e){var t=this,a=this.scheduleList,s=(e[2]>=10?e[2]:"0"+e[2])+":"+e[3].split("分")[0],i=this.MinutesTest(e[2],e[3],this.form.singleClassMinutes),n=!0;a.forEach(function(a){var r=t.timeIsrange(s,i,a.startTime),o=t.timeIsrange(s,i,a.endTime);n&&(e[1]==a.weekStr?n=!r&&!o:e[1]!=a.weekStr&&(n=!0))}),n?(a.push({type:e[0],weekStr:e[1],weekIndex:this.getWeek(e[1]),startTime:s,endTime:i,id:Date.now()}),this.courseForm.teachingStatus=!1,this.setTimeTable()):this.$toast("该时间段已排课请重选时间")},onShowTimeTable:function(){this.statusList.classTime=!0,this.setTimeTable()},setTimeTable:function(){this.timeTable=[];var e=this.form,t=this.scheduleList,a=parseInt(e.onlineClassesNums?e.onlineClassesNums:0),s=parseInt(e.offlineClassesNums?e.offlineClassesNums:0),i=parseInt(this.other.giveNum),n=e.giveTeachMode;if("ONLINE"==n?a+=i:"OFFLINE"==n&&(s+=i),!(t.length<=0)){var r=Number(a)+Number(s),o=e.courseStart.replace(/-/gi,"/"),l=new Date(o),u=0;while(r&&r>0){for(var c=0;c<t.length;c++){if(0==a&&0==s)break;var m=t[c].weekIndex-l.getDay();u>0&&0==m&&0==c&&(m+=7),m<0&&(m+=7);var f=this.getThinkDate(l,m),h=(new Date).getTime(),d=new Date(f.replace(/-/gi,"/")+" "+t[c].startTime+":00").getTime();if(h<d){var p={classDate:f,startClassTimeStr:t[c].startTime,endClassTimeStr:t[c].endTime};"线上"==t[c].type&&a>0?(p.teachMode="ONLINE",this.timeTable.push(p),a--):"线下"==t[c].type&&s>0?(p.teachMode="OFFLINE",this.timeTable.push(p),s--):a>0?(p.teachMode="ONLINE",this.timeTable.push(p),a--):s>0&&(p.teachMode="OFFLINE",this.timeTable.push(p),s--),r--}}1==t.length?l.setDate(l.getDate()+7):t.every(function(e){return e.weekStr===t[0].weekStr})&&u++}}},onGiveMode:function(){this.statusList.giveTeachModeStatus=!0,this.getCalcClass()},getCalcClass:function(){var e=this.loadData,t=this.form,a=e.vipGroupActivitySelect,s=(e.vipGroupCategorySelect,e.teacherCategory),i=t.onlineClassesNums?t.onlineClassesNums:0,n=t.offlineClassesNums?t.offlineClassesNums:0,r=parseInt(this.other.giveNum),o=t.giveTeachMode;if(a.salarySettlementJson){var l=JSON.parse(a.salarySettlementJson),u=0;if(Number(i)+Number(n)>0){var c=i*t.onlineClassesUnitPrice+n*t.offlineClassesUnitPrice;r>0&&!o&&(c=0),u=c*t.studentNum/(Number(i)+Number(n)+Number(r)),"DISCOUNT"==a.type&&(u=u*(a.attribute1?Number(a.attribute1):100)/100),console.log(u)}if(l&&l.onlineSalarySettlement){var m=l.onlineSalarySettlement;"TEACHER_DEFAULT"==m.salarySettlementType?t.onlineTeacherSalary=Math.round(s.onlineClassesSalary):"RATIO_DISCOUNT"==m.salarySettlementType?t.onlineTeacherSalary=Math.round(u?u*(m.settlementValue?m.settlementValue:100)/100:0):"FIXED_SALARY"==m.salarySettlementType&&(t.onlineTeacherSalary=Math.round(m.settlementValue)),t.onlineTeacherSalary=Number(t.onlineTeacherSalary)}if(l&&l.offlineSalarySettlement){var f=l.offlineSalarySettlement;"TEACHER_DEFAULT"==f.salarySettlementType?t.offlineTeacherSalary=Math.round(s.offlineClassesSalary):"RATIO_DISCOUNT"==f.salarySettlementType?t.offlineTeacherSalary=Math.round(u?u*(f.settlementValue?f.settlementValue:100)/100:0):"FIXED_SALARY"==f.salarySettlementType&&(t.offlineTeacherSalary=Math.round(f.settlementValue)),t.offlineTeacherSalary=Number(t.offlineTeacherSalary)}}"GIVE_CLASS"==a.type||"BASE_ACTIVITY"==a.type?t.totalCount=Math.round(i*t.onlineClassesUnitPrice+n*t.offlineClassesUnitPrice):"DISCOUNT"==a.type&&(t.totalCount=Math.round((i*t.onlineClassesUnitPrice+n*t.offlineClassesUnitPrice)*Number(a.attribute1)/100)),t.totalCount=Number(t.totalCount)},getThinkDate:function(e,t){var a=e;a.setDate(e.getDate()+t);var s=a.getFullYear(),i=a.getMonth()+1,n="";n=i<10?"0"+i:i+"";var r=a.getDate(),o="";return o=r<10?"0"+r:r+"",s+"-"+n+"-"+o},MinutesTest:function(e,t,a){var s=t.split("分")[0],i=new Date(1900,1,1,e,s);i.setMinutes(i.getMinutes()+parseInt(a));var n=i.getHours(),r=i.getMinutes();return n<10&&(n="0"+n),r<10&&(r="0"+r),n+":"+r},timeIsrange:function(e,t,a){var s=e.split(":");if(2!=s.length)return!1;var i=t.split(":");if(2!=i.length)return!1;var n=a.split(":");if(2!=i.length)return!1;var r=new Date,o=new Date,l=new Date;return r.setHours(s[0]),r.setMinutes(s[1]),o.setHours(i[0]),o.setMinutes(i[1]),l.setHours(n[0]),l.setMinutes(n[1]),l.getTime()-r.getTime()>=0&&l.getTime()-o.getTime()<=0},getWeek:function(e){var t={"周一":1,"周二":2,"周三":3,"周四":4,"周五":5,"周六":6,"周日":0};return t[e]},formatter:function(e,t){return"year"===e?"".concat(t,"年"):"month"===e?"".concat(t,"月"):"day"===e?"".concat(t,"日"):t},onSubmit:function(){var e=this,t=this.form,a=this.statusList;if(this.setTimeTable(),!t.name)return this.$toast("请输入课程班名称"),!1;if(!t.subjectIdList)return this.$toast("请选择科目"),!1;if(!t.vipGroupCategoryId)return this.$toast("请选择课程形式"),!1;if(!t.vipGroupActivityId)return this.$toast("请选择活动方案"),!1;if(a.hasOffline&&!t.teacherSchoolId)return this.$toast("请选择线下课地址"),!1;if(!t.singleClassMinutes)return this.$toast("请选择每课时长"),!1;var s=!t.onlineClassesNums&&t.onlineClassesNums<=0,i=!t.offlineClassesNums&&t.offlineClassesNums<=0;if(a.hasOnline&&s)return this.$toast("请输入线上课次数"),!1;if(a.hasOffline&&i)return this.$toast("请输入线下课次数"),!1;if(!t.registrationStartTime)return this.$toast("请选择报名开始时间"),!1;if(!t.coursesExpireDate)return this.$toast("请选择报名结束时间"),!1;var n=this.loadData.vipGroupActivitySelect;if("GIVE_CLASS"==n.type&&!t.giveTeachMode)return this.$toast("请选择赠课类型"),!1;if(this.scheduleList.length<=0)return this.$toast("课时安排不能为空"),!1;if(a.hasOnline){if(!t.onlineClassesUnitPrice)return this.$toast("请输入线上课单价"),!1;if(!t.onlineTeacherSalary)return this.$toast("请输入线上课课酬"),!1}if(a.hasOffline){if(!t.offlineClassesUnitPrice)return this.$toast("请输入线下课单价"),!1;if(!t.offlineTeacherSalary)return this.$toast("请输入线下课课酬"),!1}"ONLINE"==t.giveTeachMode?(t.onlineClassesNum=Number(t.onlineClassesNums)+Number(this.other.giveNum),t.offlineClassesNum=Number(t.offlineClassesNums)):(t.onlineClassesNum=Number(t.onlineClassesNums),t.offlineClassesNum=Number(t.offlineClassesNums)+Number(this.other.giveNum)),t.totalClassTimes=Number(t.onlineClassesNums)+Number(t.offlineClassesNums)+Number(this.other.giveNum),t.paymentExpireDate=t.coursesExpireDate;var l={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:t};this.onSubmitStatus&&(this.onSubmitStatus=!1,Object(o["L"])(l).then(function(t){var a=t.data;200==a.code?(e.$toast("申请成功"),setTimeout(function(){e.onSubmitStatus=!0,Object(r["a"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(r["a"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):e.$router.push("/business")},500)):(e.onSubmitStatus=!0,e.$toast(a.msg))}))}}},f=m,h=(a("37ad"),a("2877")),d=Object(h["a"])(f,s,i,!1,null,"03ebde64",null);t["default"]=d.exports},5115:function(e,t,a){"use strict";var s=a("3354"),i=a.n(s);i.a},"6e6e":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mheader"},[a("header",{staticClass:"m-nav-header",class:[e.isFixed?"fixed":""]},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:e.goBack}},[a("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),a("div",{staticClass:"m-nav-bar__title"},[e._t("default",[e._v(e._s(e.name?e.name:this.$route.meta.descrition))])],2),a("div",{staticClass:"m-nav-bar__right"},[e._t("right")],2)])])},i=[],n={name:"mheader",props:{name:String,isBack:{type:Boolean,default:!0},isFixed:{type:Boolean,default:!0},backUrl:{type:Object,default:function(){return{callBack:null,path:"",params:{}}}}},methods:{goBack:function(){var e=this.backUrl;"function"==typeof e.callBack?e.callBack():e.path?this.$router.push({path:e.path,query:e.params}):history.go(-1)}}},r=n,o=(a("5115"),a("2877")),l=Object(o["a"])(r,s,i,!1,null,"61d0e2e4",null);t["a"]=l.exports},"9afb":function(e,t,a){"use strict";a.d(t,"w",function(){return o}),a.d(t,"B",function(){return l}),a.d(t,"x",function(){return u}),a.d(t,"I",function(){return m}),a.d(t,"i",function(){return c}),a.d(t,"M",function(){return f}),a.d(t,"h",function(){return h}),a.d(t,"k",function(){return d}),a.d(t,"C",function(){return v}),a.d(t,"D",function(){return g}),a.d(t,"E",function(){return S}),a.d(t,"g",function(){return y}),a.d(t,"L",function(){return C}),a.d(t,"A",function(){return b}),a.d(t,"v",function(){return T}),a.d(t,"c",function(){return N}),a.d(t,"o",function(){return D}),a.d(t,"n",function(){return k}),a.d(t,"d",function(){return L}),a.d(t,"f",function(){return x}),a.d(t,"F",function(){return G}),a.d(t,"G",function(){return I}),a.d(t,"y",function(){return M}),a.d(t,"z",function(){return w}),a.d(t,"K",function(){return F}),a.d(t,"l",function(){return p}),a.d(t,"p",function(){return O}),a.d(t,"u",function(){return A}),a.d(t,"a",function(){return $}),a.d(t,"H",function(){return E}),a.d(t,"j",function(){return j}),a.d(t,"t",function(){return U}),a.d(t,"q",function(){return P}),a.d(t,"b",function(){return _}),a.d(t,"r",function(){return R}),a.d(t,"m",function(){return z}),a.d(t,"e",function(){return B}),a.d(t,"J",function(){return V}),a.d(t,"s",function(){return q});var s=a("4328"),i=a.n(s),n=a("981f").default,r="/api-teacher",o=function(e){return n({url:r+"/snaker/task/queryMyCreatedList",method:"get",params:e})},l=function(e){return n({url:r+"/snaker/task/queryWaitList",method:"get",params:e})},u=function(e){return n({url:r+"/snaker/task/queryProcessedList",method:"get",params:e})},c=function(e){return n({url:r+"/subject/findTeacherSubjets",method:"get",params:e})},m=function(e){return n({url:r+"/subject/findSubSubjects",method:"get",params:e})},f=function(e){return n({url:r+"/vipGroupCategory/queryAll",method:"get",params:e})},h=function(e){return n({url:r+"/vipGroupActivity/findByVipGroupCategory",method:"get",params:e})},d=function(e){return n({url:r+"/school/findVipSchoolByTeacher",method:"get",params:e})},p=function(e){return n({url:r+"/school/findVipSchoolByTeacher2",method:"get",params:e})},v=function(e){return n({url:r+"/school/add",method:"post",data:i.a.stringify(e)})},g=function(e){return n({url:r+"/school/del",method:"post",data:i.a.stringify(e)})},S=function(e){return n({url:r+"/school/update",method:"post",data:i.a.stringify(e)})},y=function(e){return n({url:r+"/teacherDefaultVipGroupSalary/findByTeacherAndCategory",method:"get",params:e})},C=function(e){return n({url:r+"/teacherVipGroup/vipGroupApply",method:"post",data:e})},b=function(e){return n({url:r+"/teacherLeaveRecord/queryVipCourseScheduleList",method:"get",params:e})},T=function(e){return n({url:r+"/leaveCategory/queryPage",method:"post",data:e})},N=function(e){return n({url:r+"/teacherLeaveRecord/askForLeave",method:"post",data:i.a.stringify(e)})},D=function(e){return n({url:r+"/teacherCourseSchedule/getCourseSchedulesWithDate",method:"get",params:e})},k=function(e){return n({url:r+"/teacherCourseSchedule/getCourseScheduleDateByMonth",method:"get",params:e})},L=function(e){return n({url:r+"/teacherCourseSchedule/classStartDateAdjust",method:"post",data:i.a.stringify(e)})},x=function(e){return n({url:r+"/teacherCourseSchedule/courseSwap",method:"post",data:i.a.stringify(e)})},G=function(e){return n({url:r+"/teacherCourseSchedule/statisticsInfo",method:"get",params:e})},I=function(e){return n({url:r+"/teacherCourseSchedule/statisticsList",method:"get",params:e})},M=function(e){return n({url:r+"/teacher/queryStudentApply",method:"get",params:e})},w=function(e){return n({url:r+"/teacher/querySubByMusicGroupId",method:"get",params:e})},F=function(e){return n({url:r+"/studentRegistration/updateSubject",method:"post",data:i.a.stringify(e)})},O=function(){return n({url:"/api-student/studentOrder/getLuckStatis",method:"get"})},A=function(){return n({url:"/api-web/api/practiceSum",method:"get"})},$=function(e){return n({url:"/api-teacher/classGroup/addStudyReport ",method:"post",data:e})},_=function(e){return n({url:"/api-teacher/studyReport/addStudyReport",method:"post",data:e})},E=function(e){return n({url:"/api-teacher/studyReport/info",method:"get",params:e})},U=function(e){return n({url:"/api-teacher/studyReport/getReviewsInfo",method:"get",params:e})},j=function(e){return n({url:"/api-teacher/classGroup/findTeacherClassGroupInfo",method:"get",params:e})},P=function(e){return n({url:"/api-teacher/studyReport/getNeedPost",method:"get",params:e})},R=function(e){return n({url:"/api-teacher/courseReview/getPracticeGroup",method:"get",params:e})},z=function(e){return n({url:"/api-teacher/courseReview/getCourseInfoHead",method:"get",params:e})},B=function(e){return n({url:"/api-teacher/courseReview/add",method:"post",data:i.a.stringify(e)})},V=function(e){return n({url:"/api-teacher/courseReview/updateReviewInfo",method:"post",data:i.a.stringify(e)})},q=function(e){return n({url:"/api-teacher/courseReview/getReviewInfo",method:"get",params:e})}},a6cc:function(e,t,a){}}]);
|