1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["VIPApply"],{"19a3":function(t,e,a){"use strict";var s=a("55b2"),i=a.n(s);i.a},2117:function(t,e,a){},3354:function(t,e,a){},"38f5":function(t,e,a){"use strict";a.r(e);for(var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"vipapply"},[t.statusList.headerStatus?s("m-header"):t._e(),s("div",{staticClass:"vip-title"},[t._v("课程信息")]),s("van-cell-group",[s("van-field",{attrs:{label:"科目名称",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onGetSheetList("subjectList")}},model:{value:t.formName.subjectListName,callback:function(e){t.$set(t.formName,"subjectListName",e)},expression:"formName.subjectListName"}}),s("van-field",{attrs:{label:"课程形式",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onGetSheetList("vipGroupCategory")}},model:{value:t.formName.vipGroupCategoryName,callback:function(e){t.$set(t.formName,"vipGroupCategoryName",e)},expression:"formName.vipGroupCategoryName"}}),s("van-cell",{attrs:{title:"上课学生",readonly:!0,"input-align":"right","is-link":!(t.checkboxSelectDataList.length>0),size:"large",value:t.checkboxSelectDataList.length>0?"重新选择":"请选择","value-class":t.checkboxSelectDataList.length>0?"studentColor":null},on:{click:t.onCheckStudent}}),t.checkboxSelectDataList.length>0?s("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:".05rem 0",background:"#fafbff"}},t._l(t.checkboxSelectDataList,function(e,a){return s("p",{key:a,staticStyle:{color:"#323233"}},[t._v("\n\t\t\t\t\t"+t._s(e.userName)+" - "+t._s(e.phone)+"\n\t\t\t\t")])}),0):t._e(),s("van-field",{attrs:{label:"活动方案",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onGetSheetList("vipGroupActivity")}},model:{value:t.formName.vipGroupActivityName,callback:function(e){t.$set(t.formName,"vipGroupActivityName",e)},expression:"formName.vipGroupActivityName"}}),t.statusList.hasOffline?s("van-field",{attrs:{label:"线下课地址",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onGetSheetList("teacherSchool")}},model:{value:t.formName.teacherSchoolName,callback:function(e){t.$set(t.formName,"teacherSchoolName",e)},expression:"formName.teacherSchoolName"}}):t._e()],1),s("div",{staticClass:"vip-title"},[t._v("课时组成")]),s("van-cell-group",[s("van-field",{attrs:{label:"每班人数",disabled:"","input-align":"right",size:"large",placeholder:"每班预计招收人数"},model:{value:t.form.studentNum,callback:function(e){t.$set(t.form,"studentNum",e)},expression:"form.studentNum"}}),s("van-field",{attrs:{label:"每课时长",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请输入每课时长"},on:{click:t.onClickSingleClass},model:{value:t.form.singleClassMinutes,callback:function(e){t.$set(t.form,"singleClassMinutes",e)},expression:"form.singleClassMinutes"}}),t.statusList.hasOnline?s("van-field",{attrs:{label:"线上课","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:t.onClassKeyUp},model:{value:t.form.onlineClassesNums,callback:function(e){t.$set(t.form,"onlineClassesNums",e)},expression:"form.onlineClassesNums"}}):t._e(),t.statusList.hasOffline?s("van-field",{attrs:{label:"线下课","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:t.onClassKeyUp},model:{value:t.form.offlineClassesNums,callback:function(e){t.$set(t.form,"offlineClassesNums",e)},expression:"form.offlineClassesNums"}}):t._e()],1),s("div",{staticClass:"vip-title"},[t._v("时间安排")]),s("van-cell-group",[s("van-field",{attrs:{label:"报名开始时间",disabled:"","input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onEnListShow("start",t.form.registrationStartTime)}},model:{value:t.form.registrationStartTime,callback:function(e){t.$set(t.form,"registrationStartTime",e)},expression:"form.registrationStartTime"}}),s("van-field",{attrs:{label:"报名截止时间",disabled:"","input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onEnListShow("end",t.form.coursesExpireDate)}},model:{value:t.form.coursesExpireDate,callback:function(e){t.$set(t.form,"coursesExpireDate",e)},expression:"form.coursesExpireDate"}})],1),s("div",{staticClass:"vip-title"},[t._v("课时安排")]),s("van-cell-group",[s("van-field",{attrs:{label:"课时总数",disabled:"","input-align":"right",size:"large",placeholder:"请输入次数"},model:{value:t.form.totalClassTime,callback:function(e){t.$set(t.form,"totalClassTime",e)},expression:"form.totalClassTime"}}),t.statusList.teachOnOrOff?s("van-field",{attrs:{label:"赠课类型",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:t.onGiveMode},model:{value:t.formName.giveTeachModeName,callback:function(e){t.$set(t.formName,"giveTeachModeName",e)},expression:"formName.giveTeachModeName"}}):t._e(),s("van-field",{attrs:{label:"排课开始时间",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){t.dataForm.status=!0}},model:{value:t.form.courseStart,callback:function(e){t.$set(t.form,"courseStart",e)},expression:"form.courseStart"}}),t._l(t.scheduleList,function(e,a){return s("van-cell",{key:a,attrs:{"title-class":"title-time"}},[s("template",{slot:"title"},[s("span",{staticClass:"online"},[t._v(t._s(e.type))]),s("span",{staticClass:"week"},[t._v(t._s(e.weekStr))]),s("span",{staticClass:"timer"},[t._v(t._s(e.startTime+"-"+e.endTime))])]),s("template",{slot:"default"},[s("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(a){return t.onScheduleRemove(e)}}},[t._v("删除")])],1)],2)}),s("div",{staticClass:"add-plan van-cell",on:{click:t.onCourseShedule}},[s("van-icon",{attrs:{name:"add-o"}}),t._v("课时安排\n\t\t\t")],1),t.scheduleList.length>0?s("van-field",{attrs:{label:"排课列表",disabled:"","input-align":"right","is-link":"",size:"large"},on:{click:t.onShowTimeTable}}):t._e()],2),s("div",{staticClass:"vip-title"},[t._v("课酬设置")]),s("van-cell-group",[t.statusList.hasOnline?s("van-field",{attrs:{label:"线上课单价",type:"number","input-align":"right",size:"large",disabled:0==t.loadData.vipGroupActivitySelect.paymentReadonlyFlag,placeholder:"金额(每课时)"},on:{keyup:t.getCalcClass},model:{value:t.form.onlineClassesUnitPrice,callback:function(e){t.$set(t.form,"onlineClassesUnitPrice",e)},expression:"form.onlineClassesUnitPrice"}}):t._e(),t.statusList.hasOffline?s("van-field",{attrs:{label:"线下课单价",type:"number","input-align":"right",size:"large",disabled:0==t.loadData.vipGroupActivitySelect.paymentReadonlyFlag,placeholder:"金额(每课时)"},on:{keyup:t.getCalcClass},model:{value:t.form.offlineClassesUnitPrice,callback:function(e){t.$set(t.form,"offlineClassesUnitPrice",e)},expression:"form.offlineClassesUnitPrice"}}):t._e(),t.statusList.hasOnline?s("van-field",{attrs:{label:"线上课课酬","input-align":"right",size:"large",disabled:0==t.loadData.vipGroupActivitySelect.salaryReadonlyFlag,placeholder:"金额(每课时)",type:"number"},model:{value:t.form.onlineTeacherSalary,callback:function(e){t.$set(t.form,"onlineTeacherSalary",e)},expression:"form.onlineTeacherSalary"}}):t._e(),t.statusList.hasOffline?s("van-field",{attrs:{label:"线下课课酬","input-align":"right",size:"large",disabled:0==t.loadData.vipGroupActivitySelect.salaryReadonlyFlag,placeholder:"金额(每课时)",type:"number"},model:{value:t.form.offlineTeacherSalary,callback:function(e){t.$set(t.form,"offlineTeacherSalary",e)},expression:"form.offlineTeacherSalary"}}):t._e(),s("van-field",{attrs:{disabled:"",label:"课程总价","input-align":"right",size:"large",placeholder:"金额(每课时)"},model:{value:t.form.totalCount,callback:function(e){t.$set(t.form,"totalCount",e)},expression:"form.totalCount"}})],1),s("div",{staticClass:"button-group"},[s("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1),s("van-action-sheet",{attrs:{actions:t.loadData.classTimer,"cancel-text":"取消"},on:{cancel:function(e){t.statusList.classTimerStatus=!1},select:t.onClassTimerSelect},model:{value:t.statusList.classTimerStatus,callback:function(e){t.$set(t.statusList,"classTimerStatus",e)},expression:"statusList.classTimerStatus"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:t.enlistForm.status,callback:function(e){t.$set(t.enlistForm,"status",e)},expression:"enlistForm.status"}},[s("van-datetime-picker",{attrs:{type:"date","min-date":t.enlistForm.minDate,"max-date":t.enlistForm.maxDate,formatter:t.formatter},on:{cancel:function(e){t.enlistForm.status=!1},confirm:t.onEnlistConfirm},model:{value:t.enlistForm.currentDate,callback:function(e){t.$set(t.enlistForm,"currentDate",e)},expression:"enlistForm.currentDate"}})],1),s("van-action-sheet",{attrs:{actions:t.loadData.giveTeachMode,"cancel-text":"取消"},on:{cancel:function(e){t.statusList.giveTeachModeStatus=!1},select:t.onModeSelect},model:{value:t.statusList.giveTeachModeStatus,callback:function(e){t.$set(t.statusList,"giveTeachModeStatus",e)},expression:"statusList.giveTeachModeStatus"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:t.sheetForm.sheetStatus,callback:function(e){t.$set(t.sheetForm,"sheetStatus",e)},expression:"sheetForm.sheetStatus"}},[s("van-picker",{attrs:{loading:t.sheetForm.loading,"default-index":t.sheetForm.index,columns:t.sheetForm.columns,"show-toolbar":""},on:{cancel:function(e){t.sheetForm.sheetStatus=!1},confirm:t.onSheetConfirm}})],1),s("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[s("van-datetime-picker",{attrs:{type:"date","min-date":t.dataForm.minDate,"max-date":t.dataForm.maxDate,formatter:t.formatter},on:{cancel:function(e){t.dataForm.status=!1},confirm:t.onCurrentConfirm},model:{value:t.dataForm.currentDate,callback:function(e){t.$set(t.dataForm,"currentDate",e)},expression:"dataForm.currentDate"}})],1),s("van-popup",{attrs:{position:"bottom"},model:{value:t.courseForm.teachingStatus,callback:function(e){t.$set(t.courseForm,"teachingStatus",e)},expression:"courseForm.teachingStatus"}},[s("van-picker",{attrs:{columns:t.courseForm.columns,"show-toolbar":""},on:{cancel:function(e){t.courseForm.teachingStatus=!1},confirm:t.onTeachinConfirm}})],1),s("van-popup",{style:{height:"180%"},attrs:{"lock-scroll":!0,position:"bottom"},model:{value:t.statusList.studentStatus,callback:function(e){t.$set(t.statusList,"studentStatus",e)},expression:"statusList.studentStatus"}},[s("van-sticky",[s("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[s("div",{on:{click:t.onSearch}},[t._v("搜索")])]},proxy:!0}]),model:{value:t.params.search,callback:function(e){t.$set(t.params,"search",e)},expression:"params.search"}})],1),s("div",{staticClass:"paddingB80"},[t.dataShow?s("van-list",{key:"data",staticClass:"studentContainer",attrs:{finished:t.finished,"finished-text":""},on:{load:t.getStudent},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},[s("van-checkbox-group",{model:{value:t.checkboxSelect,callback:function(e){t.checkboxSelect=e},expression:"checkboxSelect"}},[s("van-cell-group",t._l(t.dataList,function(e,i){return s("van-cell",{key:i,staticClass:"input-cell",attrs:{center:!0},on:{click:function(a){return t.onCheckboxSelect(e)}}},[s("template",{slot:"icon"},[e.avatar?s("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):s("img",{staticClass:"logo",attrs:{src:a("a7ed"),alt:""}})]),s("template",{slot:"title"},[t._v("\n\t\t\t\t\t\t\t\t\t"+t._s(e.userName)+"\n\t\t\t\t\t\t\t\t")]),s("template",{slot:"label"},[s("span",[t._v(t._s(t.desensitPhone(e.phone)))])]),s("template",{slot:"default"},[s("van-checkbox",{attrs:{name:e.userId.toString()}})],1)],2)}),1)],1)],1):s("m-empty",{key:"data",staticClass:"empty"})],1),s("div",{staticClass:"button-group-popup"},[s("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),s("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确定")])])],1),s("van-popup",{attrs:{position:"bottom"},model:{value:t.statusList.classTime,callback:function(e){t.$set(t.statusList,"classTime",e)},expression:"statusList.classTime"}},[s("van-row",[s("van-col",{attrs:{span:"12"}},[t._v("上课类型")]),s("van-col",{attrs:{span:"12"}},[t._v("上课时间")])],1),s("div",{staticClass:"tableContainer"},t._l(t.timeTable,function(e,a){return s("van-row",{key:a},[s("van-col",{attrs:{span:"12"}},[t._v("\n\t\t\t\t\t\t"+t._s("ONLINE"==e.teachMode?"线上":"线下")+"\n\t\t\t\t\t")]),s("van-col",{attrs:{span:"12"}},[t._v("\n\t\t\t\t\t\t"+t._s(e.classDate)+" "+t._s(e.startClassTimeStr)+"\n\t\t\t\t\t")])],1)}),1)],1)],1)},i=[],n=a("6e6e"),r=a("ff51"),o=a("d678"),l=a("9afb"),u=[],c=0;c<60;c++){var h=c<10?"0"+c:c;u.push(h+"分")}var m={name:"vipapply",components:{MHeader:n["a"],MEmpty:o["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,studentStatus:!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:u,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,checkboxSelect:[],checkboxSelectIds:[],checkboxSelectList:[],checkboxSelectDataList:[],loading:!1,finished:!1,params:{search:null,page:1,rows:20},dataShow:!0,dataList:[]}},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),document.title="VIP课程班申请",Object(r["b"])().android&&(this.headerStatus=!0)},methods:{onCheckStudent:function(){this.form.vipGroupCategoryId?this.statusList.studentStatus=!0:this.$toast("请选择课程形式")},onGetSheetList:function(t){var e=this.sheetForm;if(e.columns=[],this.form.vipGroupCategoryId||"vipGroupActivity"!=t){e.sheetStatus=!0,e.loading=!0,e.currentType=t,e.index=0;var a=this.loadData[t];a.length>0?(e.columns=a,e.index=this.formName[t+"Index"],e.loading=!1):this.onLoadingData(t)}else this.$toast("请选择课程形式")},onLoadingData:function(){var t=this,e=this.sheetForm;"subjectList"==e.currentType?Object(l["j"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(t){t.value=t.id,t.text=t.name,i.push(t)}),t.loadData.subjectList=i,e.columns=i,e.loading=!1}else t.$toast("暂无科目列表"),e.loading=!1}):"vipGroupCategory"==e.currentType?Object(l["N"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(t){t.value=t.id,t.text=t.name,i.push(t)}),t.loadData.vipGroupCategory=i,e.columns=i,e.loading=!1}else t.$toast("暂无课程形式"),e.loading=!1}):"vipGroupActivity"==e.currentType?Object(l["i"])({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(t){t.value=t.id,t.text=t.name,t.startTime=t.startTime?t.startTime.split(" ")[0]:null,t.endTime=t.endTime?t.endTime.split(" ")[0]:null,i.push(t)}),t.loadData.vipGroupActivity=i,e.columns=i,e.loading=!1}else t.$toast("暂无活动文案"),e.loading=!1}):"teacherSchool"==e.currentType&&Object(l["m"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(t){t.value=t.id,t.text=t.name,i.push(t)}),t.loadData.teacherSchool=i,e.columns=i,e.loading=!1}else t.$toast("暂无教学点"),e.loading=!1})},findTeacherCategory:function(t){var e=this;Object(l["h"])({categoryId:t}).then(function(t){var a=t.data;200==a.code&&(e.loadData.teacherCategory=a.data)})},onSheetConfirm:function(t,e){var a=this,s=this.sheetForm,i=this.form,n=this.formName,r=this.loadData;if("subjectList"==s.currentType)i.subjectIdList=t.value,n.subjectListName=t.text,n.subjectListIndex=e,r.subjectListSelect=t;else if("vipGroupCategory"==s.currentType){r.vipGroupCategorySelect.id!=t.id&&this.findTeacherCategory(t.id),i.vipGroupCategoryId=t.value,n.vipGroupCategoryName=t.text,n.vipGroupCategoryIndex=e,r.vipGroupCategorySelect=t,i.studentNum=t.studentNum,i.onlineClassesUnitPrice=Math.ceil(t.onlineClassesUnitPrice),i.offlineClassesUnitPrice=Math.ceil(t.offlineClassesUnitPrice),i.singleClassMinutes=null,r.classTimer=[];var o=t.singleClassMinutes.split(",");o.forEach(function(t){a.loadData.classTimer.push({name:t,value:t})}),this.checkboxSelect=[],this.checkboxSelectIds=[],this.checkboxSelectList=[],this.checkboxSelectDataList=[],i.vipGroupActivityId=null,n.vipGroupActivityName=null,n.vipGroupActivityIndex=0,r.vipGroupActivity=[],r.vipGroupActivitySelect=[]}else"vipGroupActivity"==s.currentType?(i.vipGroupActivityId!=t.value&&(i.offlineClassesNums=null,i.onlineClassesNums=null),i.vipGroupActivityId=t.value,n.vipGroupActivityName=t.text,n.vipGroupActivityIndex=e,r.vipGroupActivitySelect=t,i.onlineClassesUnitPrice=Math.ceil(r.vipGroupCategorySelect.onlineClassesUnitPrice),i.offlineClassesUnitPrice=Math.ceil(r.vipGroupCategorySelect.offlineClassesUnitPrice),this.onCalcClassTimes(t),this.getCalcClass(),this.setTimeTable()):"teacherSchool"==s.currentType&&(i.teacherSchoolId=t.value,n.teacherSchoolName=t.text,n.teacherSchoolIndex=e);s.sheetStatus=!1},onClassKeyUp:function(){var t=this.loadData.vipGroupActivitySelect;this.onCalcClassTimes(t),this.getCalcClass(),this.setTimeTable()},onCalcClassTimes:function(t){var e=this.form,a=this.other,s=this.statusList,i=Number(e.onlineClassesNums)+Number(e.offlineClassesNums);if(t.salarySettlementJson){var n=JSON.parse(t.salarySettlementJson);n&&n.onlineSalarySettlement?s.hasOnline=!0:s.hasOnline=!1,n&&n.offlineSalarySettlement?s.hasOffline=!0:s.hasOffline=!1}"GIVE_CLASS"==t.type?(this.statusList.teachOnOrOff=!0,i>=Number(t.attribute1)?(e.totalClassTime=i+"+"+t.attribute2,a.giveNum=t.attribute2):(e.totalClassTime=i,a.giveNum=0)):(e.totalClassTime=i,a.giveNum=0,this.statusList.teachOnOrOff=!1)},onModeSelect:function(t){this.form.giveTeachMode=t.value,this.formName.giveTeachModeName=t.name,this.statusList.giveTeachModeStatus=!1,this.getCalcClass()},onClickSingleClass:function(){this.formName.vipGroupCategoryName?this.statusList.classTimerStatus=!0:this.$toast("请选择课程形式")},onClassTimerSelect:function(t){this.form.singleClassMinutes=t.value,this.statusList.classTimerStatus=!1,this.getCalcClass()},onCurrentConfirm:function(t){var e=new Date(t),a=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),s=e.getDate()>=10?e.getDate():"0"+e.getDate();this.form.courseStart=e.getFullYear()+"-"+a+"-"+s,this.dataForm.status=!1},onEnlistConfirm:function(t){var e=new Date(t),a=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),s=e.getDate()>=10?e.getDate():"0"+e.getDate(),i=this.enlistForm,n=this.form;if("start"==i.updateStatus){if(n.registrationStartTime=e.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=e.getFullYear()+"-"+a+"-"+s);i.status=!1},onEnListShow:function(t,e){var a=this.enlistForm;"end"==t?this.form.registrationStartTime?a.minDate=new Date(this.form.registrationStartTime.replace(/-/gi,"/")):a.minDate=new Date:"start"==t&&(a.minDate=new Date),a.currentDate=e?new Date(e.replace(/-/gi,"/")):new Date,a.updateStatus=t,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(t){var e=this.scheduleList.indexOf(t);-1!==e&&this.scheduleList.splice(e,1)},onTeachinConfirm:function(t){var e=this,a=this.scheduleList,s=(t[2]>=10?t[2]:"0"+t[2])+":"+t[3].split("分")[0],i=this.MinutesTest(t[2],t[3],this.form.singleClassMinutes),n=!0;a.forEach(function(a){var r=e.timeIsrange(s,i,a.startTime),o=e.timeIsrange(s,i,a.endTime);n&&(t[1]==a.weekStr?n=!r&&!o:t[1]!=a.weekStr&&(n=!0))}),n?(a.push({type:t[0],weekStr:t[1],weekIndex:this.getWeek(t[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 t=this.form,e=this.scheduleList,a=parseInt(t.onlineClassesNums?t.onlineClassesNums:0),s=parseInt(t.offlineClassesNums?t.offlineClassesNums:0),i=parseInt(this.other.giveNum),n=t.giveTeachMode;if("ONLINE"==n?a+=i:"OFFLINE"==n&&(s+=i),!(e.length<=0)){var r=Number(a)+Number(s),o=t.courseStart.replace(/-/gi,"/"),l=new Date(o),u=0;while(r&&r>0){for(var c=0;c<e.length;c++){if(0==a&&0==s)break;var h=e[c].weekIndex-l.getDay();u>0&&0==h&&0==c&&(h+=7),h<0&&(h+=7);var m=this.getThinkDate(l,h),d=(new Date).getTime(),f=new Date(m.replace(/-/gi,"/")+" "+e[c].startTime+":00").getTime();if(d<f){var p={classDate:m,startClassTimeStr:e[c].startTime,endClassTimeStr:e[c].endTime};"线上"==e[c].type&&a>0?(p.teachMode="ONLINE",this.timeTable.push(p),a--):"线下"==e[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==e.length?l.setDate(l.getDate()+7):e.every(function(t){return t.weekStr===e[0].weekStr})&&u++}}},onGiveMode:function(){this.statusList.giveTeachModeStatus=!0,this.getCalcClass()},getCalcClass:function(){var t=this.loadData,e=this.form,a=t.vipGroupActivitySelect,s=(t.vipGroupCategorySelect,t.teacherCategory),i=e.onlineClassesNums?e.onlineClassesNums:0,n=e.offlineClassesNums?e.offlineClassesNums:0,r=parseInt(this.other.giveNum),o=e.giveTeachMode;if(a.salarySettlementJson){var l=JSON.parse(a.salarySettlementJson),u=0;if(Number(i)+Number(n)>0){var c=i*e.onlineClassesUnitPrice+n*e.offlineClassesUnitPrice;r>0&&!o&&(c=0),u=c*e.studentNum/(Number(i)+Number(n)+Number(r)),"DISCOUNT"==a.type&&(u=u*(a.attribute1?Number(a.attribute1):100)/100)}if(l&&l.onlineSalarySettlement){var h=l.onlineSalarySettlement;"TEACHER_DEFAULT"==h.salarySettlementType?e.onlineTeacherSalary=Math.round(s.offlineClassesSalary):"RATIO_DISCOUNT"==h.salarySettlementType?e.onlineTeacherSalary=Math.round(u?u*(h.settlementValue?h.settlementValue:100)/100:0):"FIXED_SALARY"==h.salarySettlementType&&(e.onlineTeacherSalary=Math.round(h.settlementValue)),e.onlineTeacherSalary=Number(e.onlineTeacherSalary)}if(l&&l.offlineSalarySettlement){var m=l.offlineSalarySettlement;"TEACHER_DEFAULT"==m.salarySettlementType?e.offlineTeacherSalary=Math.round(s.offlineClassesSalary):"RATIO_DISCOUNT"==m.salarySettlementType?e.offlineTeacherSalary=Math.round(u?u*(m.settlementValue?m.settlementValue:100)/100:0):"FIXED_SALARY"==m.salarySettlementType&&(e.offlineTeacherSalary=Math.round(m.settlementValue)),e.offlineTeacherSalary=Number(e.offlineTeacherSalary)}}"GIVE_CLASS"==a.type||"BASE_ACTIVITY"==a.type?e.totalCount=Math.round(i*e.onlineClassesUnitPrice+n*e.offlineClassesUnitPrice):"DISCOUNT"==a.type&&(e.totalCount=Math.round((i*e.onlineClassesUnitPrice+n*e.offlineClassesUnitPrice)*Number(a.attribute1)/100)),e.totalCount=Number(e.totalCount)},getThinkDate:function(t,e){var a=t;a.setDate(t.getDate()+e);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(t,e,a){var s=e.split("分")[0],i=new Date(1900,1,1,t,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(t,e,a){var s=t.split(":");if(2!=s.length)return!1;var i=e.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(t){var e={"周一":1,"周二":2,"周三":3,"周四":4,"周五":5,"周六":6,"周日":0};return e[t]},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"===t?"".concat(e,"日"):e},onSubmit:function(){var t=this,e=this.form,a=this.statusList;if(this.setTimeTable(),!e.subjectIdList)return this.$toast("请选择科目"),!1;if(!e.vipGroupCategoryId)return this.$toast("请选择课程形式"),!1;if(this.checkboxSelectIds.length<=0)this.$toast("请选择上课学生");else{if(!e.vipGroupActivityId)return this.$toast("请选择活动方案"),!1;if(a.hasOffline&&!e.teacherSchoolId)return this.$toast("请选择线下课地址"),!1;if(!e.singleClassMinutes)return this.$toast("请选择每课时长"),!1;var s=!e.onlineClassesNums&&e.onlineClassesNums<=0,i=!e.offlineClassesNums&&e.offlineClassesNums<=0;if(a.hasOnline&&s)return this.$toast("请输入线上课次数"),!1;if(a.hasOffline&&i)return this.$toast("请输入线下课次数"),!1;if(!e.registrationStartTime)return this.$toast("请选择报名开始时间"),!1;if(!e.coursesExpireDate)return this.$toast("请选择报名结束时间"),!1;var n=this.loadData.vipGroupActivitySelect;if("GIVE_CLASS"==n.type&&!e.giveTeachMode)return this.$toast("请选择赠课类型"),!1;if(this.scheduleList.length<=0)return this.$toast("课时安排不能为空"),!1;if(a.hasOnline){if(!e.onlineClassesUnitPrice)return this.$toast("请输入线上课单价"),!1;if(!e.onlineTeacherSalary)return this.$toast("请输入线上课课酬"),!1}if(a.hasOffline){if(!e.offlineClassesUnitPrice)return this.$toast("请输入线下课单价"),!1;if(!e.offlineTeacherSalary)return this.$toast("请输入线下课课酬"),!1}"ONLINE"==e.giveTeachMode?(e.onlineClassesNum=Number(e.onlineClassesNums)+Number(this.other.giveNum),e.offlineClassesNum=Number(e.offlineClassesNums)):(e.onlineClassesNum=Number(e.onlineClassesNums),e.offlineClassesNum=Number(e.offlineClassesNums)+Number(this.other.giveNum)),e.totalClassTimes=Number(e.onlineClassesNums)+Number(e.offlineClassesNums)+Number(this.other.giveNum),e.paymentExpireDate=e.coursesExpireDate,e.studentIdList=this.checkboxSelectIds.join(",");var o={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:e};this.onSubmitStatus&&(this.onSubmitStatus=!1,Object(l["M"])(o).then(function(e){var a=e.data;200==a.code?(t.$toast("申请成功"),setTimeout(function(){t.onSubmitStatus=!0,Object(r["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(r["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):t.$router.push("/business")},500)):(t.onSubmitStatus=!0,t.$toast(a.msg))}))}},onSearch:function(){this.params.page=1,this.dataList=[],this.dataShow=!0,this.loading=!0,this.finished=!1,this.getStudent()},getStudent:function(){var t=this,e=this.params;Object(l["z"])(e).then(function(a){var s=a.data;t.loading=!1,200==s.code?(e.page=s.data.pageNo,t.dataList=t.dataList.concat(s.data.rows),e.page>=s.data.totalPage&&(t.finished=!0),t.params.page++):t.finished=!0,t.dataList.length<=0&&(t.dataShow=!1)})},onPopupCancel:function(){this.statusList.studentStatus=!1,this.params.search=null,this.checkboxSelect=[],this.checkboxSelectList=[]},onPopupSubmit:function(){var t=this.loadData.vipGroupCategorySelect;this.checkboxSelect.length==t.studentNum?(this.checkboxSelectDataList=JSON.parse(JSON.stringify(this.checkboxSelectList)),this.checkboxSelectIds=JSON.parse(JSON.stringify(this.checkboxSelect)),this.checkboxSelect=[],this.checkboxSelectList=[],this.statusList.studentStatus=!1):this.$toast("请选择学生".concat(t.studentNum,"名,当前选择").concat(this.checkboxSelect.length,"名"))},onCheckboxSelect:function(t){var e=this;this.checkboxSelect.includes(t.userId.toString())?(this.checkboxSelect.forEach(function(a,s){a==t.userId.toString()&&e.checkboxSelect.splice(s,1)}),this.checkboxSelectList.forEach(function(a,s){a.userId==t.userId&&e.checkboxSelectList.splice(s,1)})):(this.checkboxSelect.push(t.userId.toString()),this.checkboxSelectList.push(t))},desensitPhone:function(t){var e=t.substr(0,3),a=t.substr(-4);return e+"****"+a}}},d=m,f=(a("87b5"),a("2877")),p=Object(f["a"])(d,s,i,!1,null,"600b3e5a",null);e["default"]=p.exports},5115:function(t,e,a){"use strict";var s=a("3354"),i=a.n(s);i.a},"55b2":function(t,e,a){},"6e6e":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"mheader"},[a("header",{staticClass:"m-nav-header",class:[t.isFixed?"fixed":""]},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:t.goBack}},[a("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),a("div",{staticClass:"m-nav-bar__title"},[t._t("default",[t._v(t._s(t.name?t.name:this.$route.meta.descrition))])],2),a("div",{staticClass:"m-nav-bar__right"},[t._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 t=this.backUrl;"function"==typeof t.callBack?t.callBack():t.path?this.$router.push({path:t.path,query:t.params}):history.go(-1)}}},r=n,o=(a("5115"),a("2877")),l=Object(o["a"])(r,s,i,!1,null,"61d0e2e4",null);e["a"]=l.exports},"87b5":function(t,e,a){"use strict";var s=a("2117"),i=a.n(s);i.a},"9afb":function(t,e,a){"use strict";a.d(e,"w",function(){return o}),a.d(e,"C",function(){return l}),a.d(e,"x",function(){return u}),a.d(e,"J",function(){return h}),a.d(e,"j",function(){return c}),a.d(e,"N",function(){return m}),a.d(e,"i",function(){return d}),a.d(e,"l",function(){return f}),a.d(e,"D",function(){return v}),a.d(e,"E",function(){return g}),a.d(e,"F",function(){return S}),a.d(e,"h",function(){return y}),a.d(e,"M",function(){return b}),a.d(e,"B",function(){return C}),a.d(e,"v",function(){return T}),a.d(e,"c",function(){return k}),a.d(e,"p",function(){return N}),a.d(e,"o",function(){return x}),a.d(e,"e",function(){return L}),a.d(e,"g",function(){return D}),a.d(e,"G",function(){return I}),a.d(e,"H",function(){return G}),a.d(e,"y",function(){return w}),a.d(e,"A",function(){return M}),a.d(e,"L",function(){return _}),a.d(e,"m",function(){return p}),a.d(e,"q",function(){return O}),a.d(e,"u",function(){return F}),a.d(e,"a",function(){return $}),a.d(e,"I",function(){return E}),a.d(e,"k",function(){return P}),a.d(e,"t",function(){return j}),a.d(e,"r",function(){return U}),a.d(e,"b",function(){return A}),a.d(e,"n",function(){return R}),a.d(e,"f",function(){return z}),a.d(e,"K",function(){return B}),a.d(e,"s",function(){return V}),a.d(e,"d",function(){return J}),a.d(e,"z",function(){return q});var s=a("4328"),i=a.n(s),n=a("981f").default,r="/api-teacher",o=function(t){return n({url:r+"/snaker/task/queryMyCreatedList",method:"get",params:t})},l=function(t){return n({url:r+"/snaker/task/queryWaitList",method:"get",params:t})},u=function(t){return n({url:r+"/snaker/task/queryProcessedList",method:"get",params:t})},c=function(t){return n({url:r+"/subject/findTeacherSubjets",method:"get",params:t})},h=function(t){return n({url:r+"/subject/findSubSubjects",method:"get",params:t})},m=function(t){return n({url:r+"/vipGroupCategory/queryAll",method:"get",params:t})},d=function(t){return n({url:r+"/vipGroupActivity/findByVipGroupCategory",method:"get",params:t})},f=function(t){return n({url:r+"/school/findVipSchoolByTeacher",method:"get",params:t})},p=function(t){return n({url:r+"/school/findVipSchoolByTeacher2",method:"get",params:t})},v=function(t){return n({url:r+"/school/add",method:"post",data:i.a.stringify(t)})},g=function(t){return n({url:r+"/school/del",method:"post",data:i.a.stringify(t)})},S=function(t){return n({url:r+"/school/update",method:"post",data:i.a.stringify(t)})},y=function(t){return n({url:r+"/teacherDefaultVipGroupSalary/findByTeacherAndCategory",method:"get",params:t})},b=function(t){return n({url:r+"/teacherVipGroup/vipGroupApply",method:"post",data:t})},C=function(t){return n({url:r+"/teacherLeaveRecord/queryVipCourseScheduleList",method:"get",params:t})},T=function(t){return n({url:r+"/leaveCategory/queryPage",method:"post",data:t})},k=function(t){return n({url:r+"/teacherLeaveRecord/askForLeave",method:"post",data:i.a.stringify(t)})},N=function(t){return n({url:r+"/teacherCourseSchedule/getCourseSchedulesWithDate",method:"get",params:t})},x=function(t){return n({url:r+"/teacherCourseSchedule/getCourseScheduleDateByMonth",method:"get",params:t})},L=function(t){return n({url:r+"/teacherCourseSchedule/classStartDateAdjust",method:"post",data:i.a.stringify(t)})},D=function(t){return n({url:r+"/teacherCourseSchedule/courseSwap",method:"post",data:i.a.stringify(t)})},I=function(t){return n({url:r+"/teacherCourseSchedule/statisticsInfo",method:"get",params:t})},G=function(t){return n({url:r+"/teacherCourseSchedule/statisticsList",method:"get",params:t})},w=function(t){return n({url:r+"/teacher/queryStudentApply",method:"get",params:t})},M=function(t){return n({url:r+"/teacher/querySubByMusicGroupId",method:"get",params:t})},_=function(t){return n({url:r+"/studentRegistration/updateSubject",method:"post",data:i.a.stringify(t)})},O=function(){return n({url:"/api-student/studentOrder/getLuckStatis",method:"get"})},F=function(){return n({url:"/api-web/api/practiceSum",method:"get"})},$=function(t){return n({url:"/api-teacher/classGroup/addStudyReport ",method:"post",data:t})},A=function(t){return n({url:"/api-teacher/studyReport/addStudyReport",method:"post",data:t})},E=function(t){return n({url:"/api-teacher/studyReport/info",method:"get",params:t})},j=function(t){return n({url:"/api-teacher/studyReport/getReviewsInfo",method:"get",params:t})},P=function(t){return n({url:"/api-teacher/classGroup/findTeacherClassGroupInfo",method:"get",params:t})},U=function(t){return n({url:"/api-teacher/studyReport/getNeedPost",method:"get",params:t})},R=function(t){return n({url:"/api-teacher/courseReview/getCourseInfoHead",method:"get",params:t})},z=function(t){return n({url:"/api-teacher/courseReview/add",method:"post",data:i.a.stringify(t)})},B=function(t){return n({url:"/api-teacher/courseReview/updateReviewInfo",method:"post",data:i.a.stringify(t)})},V=function(t){return n({url:"/api-teacher/courseReview/getReviewInfo",method:"get",params:t})},J=function(t){return n({url:"/api-teacher/teacherCourseHomeworkReply/checkeIsAssignHomework",method:"get",params:t})},q=function(t){return n({url:"/api-teacher/teacherVipGroup/queryStudentsWithTeacher",method:"get",params:t})}},a7ed:function(t,e,a){t.exports=a.p+"img/icon_student.2f375f47.png"},d678:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"mempty"},[a("div",{class:[t.icon?t.icon:"icon_nodata","icon"]}),a("div",{staticClass:"msg"},[t._v(t._s(t.msg?t.msg:"暂无内容"))])])},i=[],n={name:"mempty",props:{icon:String,msg:String}},r=n,o=(a("19a3"),a("2877")),l=Object(o["a"])(r,s,i,!1,null,"67669af7",null);e["a"]=l.exports}}]);
|