VIPApply.a54a4c09.js 73 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["VIPApply"],{"106b":function(e,t,a){},"2d23":function(e,t,a){},"38f5":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return 1==e.tenantId?a("div",[a("van-tabs",{staticClass:"vanTabs",attrs:{"swipe-threshold":"3",sticky:"",color:"#01C1B5"},on:{change:e.onChange},model:{value:e.active,callback:function(t){e.active=t},expression:"active"}},[a("van-tab",{attrs:{title:"VIP申请",name:1}},[1===e.active?a("vip-00-apply"):e._e()],1),a("van-tab",{attrs:{title:"双十一排课",name:2}},[2===e.active?a("vip-11-apply"):e._e()],1),a("van-tab",{attrs:{title:"考级VIP排课",name:3}},[3===e.active?a("vip-course"):e._e()],1),a("van-tab",{attrs:{title:"考级乐理排课",name:4}},[4===e.active?a("theory-course"):e._e()],1)],1)],1):a("div",[a("vip-00-apply")],1)},i=[],n=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"vipapply"},[e.statusList.headerStatus?s("m-header"):e._e(),s("div",{staticClass:"vip-title"},[e._v("课程信息")]),s("van-cell-group",[s("van-field",{attrs:{label:"排课类型",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){e.statusList.courseTypeStatus=!0}},model:{value:e.courseTypeName,callback:function(t){e.courseTypeName=t},expression:"courseTypeName"}}),s("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"}}),s("van-field",{directives:[{name:"show",rawName:"v-show",value:e.courseTypeVip,expression:"courseTypeVip"}],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"}}),s("van-field",{attrs:{label:"乐团主管",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onGetSheetList("teacherList")}},model:{value:e.formName.educationalTeacherName,callback:function(t){e.$set(e.formName,"educationalTeacherName",t)},expression:"formName.educationalTeacherName"}}),s("van-cell",{staticClass:"courseStudent",attrs:{title:"上课学生",readonly:!0,"input-align":"right","is-link":!(e.checkboxSelectDataList.length>0),size:"large",value:e.checkboxSelectDataList.length>0?"重新选择":"请选择","value-class":[e.checkboxSelectDataList.length>0?"studentColor":null,"classStudent"]},on:{click:e.onCheckStudent}}),e.checkboxSelectDataList.length>0?s("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:"0.05rem 0",background:"#fafbff"}},e._l(e.checkboxSelectDataList,function(t,a){return s("p",{key:a,staticStyle:{color:"#323233"}},[e._v("\n "+e._s(t.userName)+" - "+e._s(t.phone)+"\n ")])}),0):e._e(),s("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"}})],1),s("div",{staticClass:"vip-title"},[e._v("课时组成")]),s("van-cell-group",[s("van-field",{attrs:{label:"每班人数",readonly:!0,"input-align":"right",size:"large",placeholder:"每班预计招收人数"},model:{value:e.form.studentNum,callback:function(t){e.$set(e.form,"studentNum",t)},expression:"form.studentNum"}}),s("van-field",{attrs:{label:"每课时长",readonly:!0,"input-align":"right","is-link":!e.form.vipGroupActivityId,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.loadData.vipGroupActivitySelect.maxCourseNum>0&&e.loadData.vipGroupActivitySelect.minCourseNum>0?s("div",{staticClass:"courseTips"},[e._v("\n 该活动最小课时数:"),s("span",[e._v(e._s(e.loadData.vipGroupActivitySelect.minCourseNum))]),e._v("节 最大课时数:"),s("span",[e._v(e._s(e.loadData.vipGroupActivitySelect.maxCourseNum))]),e._v("节\n ")]):e._e(),e.statusList.hasOnline&&e.studentMaxStatus?s("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?s("van-field",{attrs:{label:"线下课","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:function(t){return e.onClassKeyUp("offLine")}},model:{value:e.form.offlineClassesNums,callback:function(t){e.$set(e.form,"offlineClassesNums",t)},expression:"form.offlineClassesNums"}}):e._e(),e.form.offlineClassesNums>0?s("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(),s("van-field",{attrs:{label:"课时总数",readonly:!e.courseTypePractice,type:"number","input-align":"right",size:"large",placeholder:"请输入次数"},on:{keyup:e.getCalcClass},model:{value:e.form.totalClassTime,callback:function(t){e.$set(e.form,"totalClassTime",t)},expression:"form.totalClassTime"}})],1),s("div",{staticClass:"vip-title"},[e._v("时间安排")]),s("van-cell-group",[e.loadData.vipGroupActivitySelect.coursesStartTime?s("van-cell",{attrs:{title:"最早排课时间",readonly:!0,"input-align":"right",size:"large"},scopedSlots:e._u([{key:"default",fn:function(){return[e._v("\n "+e._s(e.dayjs(e.loadData.vipGroupActivitySelect.coursesStartTime).format("YYYY-MM-DD"))+"\n ")]},proxy:!0}],null,!1,875942923)}):e._e(),e.loadData.vipGroupActivitySelect.coursesEndTime?s("van-cell",{attrs:{title:"最晚排课时间",readonly:!0,"input-align":"right",size:"large"},scopedSlots:e._u([{key:"default",fn:function(){return[e._v("\n "+e._s(e.dayjs(e.loadData.vipGroupActivitySelect.coursesEndTime).format("YYYY-MM-DD"))+"\n ")]},proxy:!0}],null,!1,1329614116)}):e._e(),s("van-field",{attrs:{label:"报名开始时间",readonly:!0,"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"}}),s("van-field",{attrs:{label:"报名截止时间",readonly:!0,"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),s("div",{staticClass:"vip-title"},[e._v("课时安排")]),s("van-cell-group",[s("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,a){return s("van-cell",{key:a,attrs:{"title-class":"title-time"}},[s("template",{slot:"title"},[s("span",{staticClass:"online"},[e._v(e._s(t.type))]),s("span",{staticClass:"week"},[e._v(e._s(t.weekStr))]),s("span",{staticClass:"timer"},[e._v(e._s(t.startTime+"-"+t.endTime))])]),s("template",{slot:"default"},[s("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(a){return e.onScheduleRemove(t)}}},[e._v("删除")])],1)],2)}),s("div",{staticClass:"add-plan van-cell",on:{click:e.onCourseShedule}},[s("van-icon",{attrs:{name:"add-o"}}),e._v("课时安排\n ")],1),e.scheduleList.length>0?s("van-field",{attrs:{label:"排课列表",readonly:!0,"input-align":"right","is-link":"",size:"large"},on:{click:e.onShowTimeTable}}):e._e()],2),s("div",{staticClass:"vip-title"},[e._v("课酬设置")]),s("van-cell-group",[e.statusList.hasOnline&&e.studentMaxStatus?s("van-field",{attrs:{label:"线上课单价",type:"number","input-align":"right",size:"large",readonly:!0,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?s("van-field",{attrs:{label:"线下课单价",type:"number","input-align":"right",size:"large",readonly:!0,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.hasOffline||e.statusList.hasOnline?s("van-field",{attrs:{value:e.statusList.hasOffline?e.form.offlineTeacherSalary:e.form.onlineTeacherSalary,label:"VIP课酬","input-align":"right",size:"large",readonly:!0,placeholder:"金额(每课时)",type:"number"}}):e._e(),e.courseTypePractice?s("van-field",{attrs:{label:"网管课单价","input-align":"right",size:"large",readonly:!0,placeholder:"金额(每课时)",type:"number"},model:{value:e.singleClassMinutesPrice,callback:function(t){e.singleClassMinutesPrice=t},expression:"singleClassMinutesPrice"}}):e._e(),e.courseTypePractice?s("van-field",{attrs:{label:"网管课课酬","input-align":"right",size:"large",readonly:!0,placeholder:"金额(每课时)",type:"number"},model:{value:e.form.onlineTeacherSalary,callback:function(t){e.$set(e.form,"onlineTeacherSalary",t)},expression:"form.onlineTeacherSalary"}}):e._e(),s("van-field",{attrs:{readonly:!0,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),s("div",{staticClass:"button-group"},[s("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:e.onSubmit}},[e._v("确认")])],1),s("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"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:e.enlistForm.status,callback:function(t){e.$set(e.enlistForm,"status",t)},expression:"enlistForm.status"}},[s("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),s("van-action-sheet",{attrs:{actions:[{name:"VIP课",value:"VIP"},{name:"网管课",value:"PRACTICE"}],"cancel-text":"取消"},on:{cancel:function(t){e.statusList.courseTypeStatus=!1},select:e.onCourseTypeSelect},model:{value:e.statusList.courseTypeStatus,callback:function(t){e.$set(e.statusList,"courseTypeStatus",t)},expression:"statusList.courseTypeStatus"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:e.sheetForm.sheetStatus,callback:function(t){e.$set(e.sheetForm,"sheetStatus",t)},expression:"sheetForm.sheetStatus"}},[s("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),s("van-popup",{attrs:{position:"bottom"},model:{value:e.dataForm.status,callback:function(t){e.$set(e.dataForm,"status",t)},expression:"dataForm.status"}},[s("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),s("van-popup",{attrs:{position:"bottom"},model:{value:e.courseForm.teachingStatus,callback:function(t){e.$set(e.courseForm,"teachingStatus",t)},expression:"courseForm.teachingStatus"}},[s("van-picker",{attrs:{columns:e.courseForm.columns,"show-toolbar":""},on:{cancel:function(t){e.courseForm.teachingStatus=!1},confirm:e.onTeachinConfirm}})],1),s("van-popup",{staticClass:"studentChiose",style:{height:"180%"},attrs:{"lock-scroll":!0,position:"bottom"},model:{value:e.statusList.studentStatus,callback:function(t){e.$set(e.statusList,"studentStatus",t)},expression:"statusList.studentStatus"}},[s("van-sticky",[s("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:e.onSearch},scopedSlots:e._u([{key:"action",fn:function(){return[s("div",{on:{click:e.onSearch}},[e._v("搜索")])]},proxy:!0}]),model:{value:e.params.search,callback:function(t){e.$set(e.params,"search",t)},expression:"params.search"}})],1),s("div",{staticClass:"paddingB80"},[e.dataShow?s("van-list",{key:"data",staticClass:"studentContainer",attrs:{finished:e.finished,"finished-text":""},on:{load:e.getStudent},model:{value:e.loading,callback:function(t){e.loading=t},expression:"loading"}},[s("van-checkbox-group",{model:{value:e.checkboxSelect,callback:function(t){e.checkboxSelect=t},expression:"checkboxSelect"}},[s("van-cell-group",e._l(e.dataList,function(t,i){return s("van-cell",{key:i,staticClass:"input-cell",attrs:{center:!0},on:{click:function(a){return e.onCheckboxSelect(t)}}},[s("template",{slot:"icon"},[t.avatar?s("img",{staticClass:"logo",attrs:{src:t.avatar,alt:""}}):s("img",{staticClass:"logo",attrs:{src:a("a7ed"),alt:""}})]),s("template",{slot:"title"},[e._v("\n "+e._s(t.userName)+"\n ")]),s("template",{slot:"label"},[s("span",[e._v(e._s(e.desensitPhone(t.phone)))])]),s("template",{slot:"default"},[s("van-checkbox",{attrs:{name:t.userId.toString()}})],1)],2)}),1)],1)],1):s("m-empty",{key:"data",staticClass:"empty",attrs:{msg:"暂无学生"}})],1),s("div",{staticClass:"button-group-popup"},[s("span",{staticClass:"btn",on:{click:e.onPopupCancel}},[e._v("取消")]),s("span",{staticClass:"btn primary",on:{click:e.onPopupSubmit}},[e._v("确定")])])],1),s("van-popup",{attrs:{position:"bottom"},model:{value:e.statusList.classTime,callback:function(t){e.$set(e.statusList,"classTime",t)},expression:"statusList.classTime"}},[s("van-row",[s("van-col",{attrs:{span:"12"}},[e._v("上课类型")]),s("van-col",{attrs:{span:"12"}},[e._v("上课时间")])],1),s("div",{staticClass:"tableContainer"},e._l(e.timeTable,function(t,a){return s("van-row",{key:a},[s("van-col",{attrs:{span:"12"}},[e._v("\n "+e._s("ONLINE"==t.teachMode?"线上":"线下")+"\n ")]),s("van-col",{attrs:{span:"12"}},[e._v("\n "+e._s(t.classDate)+" "+e._s(t.startClassTimeStr)+"\n ")])],1)}),1)],1)],1)},r=[],o=a("a34a"),l=a.n(o),c=a("6e6e"),u=a("ff51"),h=a("d678"),m=a("9afb"),p=a("3908"),f=a("5a0c"),d=a.n(f);function v(e,t,a,s,i,n,r){try{var o=e[n](r),l=o.value}catch(c){return void a(c)}o.done?t(l):Promise.resolve(l).then(s,i)}function g(e){return function(){var t=this,a=arguments;return new Promise(function(s,i){var n=e.apply(t,a);function r(e){v(n,s,i,r,o,"next",e)}function o(e){v(n,s,i,r,o,"throw",e)}r(void 0)})}}for(var S=[],b=0;b<60;b++){var y=b<10?"0"+b:b;S.push(y+"分")}var C={name:"vipapply",components:{MHeader:c["a"],MEmpty:h["a"]},watch:{"statusList.hasOffline":function(){}},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:{hasOnline:!0,hasOffline:!0,classTime:!1,headerStatus:!1,classTimerStatus:!1,studentStatus:!1,courseTypeStatus:!1},loadData:{subjectList:[],subjectListSelect:[],vipGroupCategory:[],vipGroupCategorySelect:[],vipGroupActivity:[],vipGroupActivitySelect:[],teacherSchool:[],teacherSchoolSelect:[],teacherList:[],teacherListSelect:[],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:S,className:"minutes"}]},courseType:"VIP",courseTypeName:"VIP课",form:{name:null,subjectIdList:null,vipGroupCategoryId:null,vipGroupActivityId:null,teacherSchoolId:null,educationalTeacherId:null,studentNum:null,singleClassMinutes:null,onlineClassesNums:null,offlineClassesNums:null,registrationStartTime:null,coursesExpireDate:null,totalClassTime:null,courseStart: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,educationalTeacherName:null,educationalTeacherIndex:0},other:{onlineSalary:null,offlineSalary:null},scheduleList:[],timeTable:[],onSubmitStatus:!0,checkboxSelect:[],checkboxSelectIds:[],checkboxSelectList:[],checkboxSelectDataList:[],loading:!1,finished:!1,params:{search:null,page:1,rows:20},dataShow:!0,dataList:[],salaryStatus:!0,singleClassMinutesPrice:0,singleClassMinutesSalary:0,studentMaxLimit:0,studentMaxStatus:!0}},mounted:function(){var e=g(l.a.mark(function e(){var t,a,s,i;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=this.$route.query,t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),document.title="VIP课程申请",Object(u["b"])().android&&(this.headerStatus=!0),e.prev=4,Object(p["a"])(!0),e.next=8,Object(m["W"])();case 8:a=e.sent,s=a.data,i=s.data.config?JSON.parse(s.data.config):{},this.studentMaxLimit=i.cloud_room_rule.cloud_room_up_limit-1,Object(p["a"])(!1),e.next=18;break;case 15:e.prev=15,e.t0=e["catch"](4),Object(p["a"])(!1);case 18:case"end":return e.stop()}},e,this,[[4,15]])}));function t(){return e.apply(this,arguments)}return t}(),methods:{dayjs:d.a,onCheckStudent:function(){this.form.vipGroupCategoryId||!this.courseTypeVip?this.statusList.studentStatus=!0:this.$toast("请选择课程形式")},onGetSheetList:function(e){var t=this.sheetForm;if(t.columns=[],this.form.vipGroupCategoryId||"vipGroupActivity"!=e||!this.courseTypeVip)if(this.checkboxSelectDataList&&!(this.checkboxSelectDataList&&this.checkboxSelectDataList.length<=0)||"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("请选择上课学生");else this.$toast("请选择课程形式")},onLoadingData:function(){var e=this,t=this.sheetForm;if("subjectList"==t.currentType)Object(m["k"])().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});else if("vipGroupCategory"==t.currentType)Object(m["bb"])().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});else if("vipGroupActivity"==t.currentType){var a=[];this.checkboxSelectDataList&&this.checkboxSelectDataList.length>0&&this.checkboxSelectDataList.forEach(function(e){a.push(e.userId)});var s={studentIds:a.join(","),activityChannel:2};this.courseTypeVip?s.categoryId=this.form.vipGroupCategoryId:this.courseTypePractice&&(s.courseType="PRACTICE"),Object(m["i"])(s).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})}else"teacherSchool"==t.currentType?Object(m["n"])().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}):"teacherList"==t.currentType&&Object(m["j"])().then(function(a){var s=a.data,i=s.data.EDUCATION||[];if(200==s.code&&i.length>0){var n=[];i.forEach(function(e){e.value=e.userId,e.text=e.userName,n.push(e)}),e.loadData.teacherList=n,t.columns=n,t.loading=!1}else e.$toast("暂无乐团主管"),t.loading=!1})},findTeacherCategory:function(e){var t=this;Object(m["h"])({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(console.log(s.currentType),"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=e.onlineClassesUnitPrice,i.offlineClassesUnitPrice=e.offlineClassesUnitPrice,i.singleClassMinutes=null,r.classTimer=[];var o=e.singleClassMinutes.split(",");o.forEach(function(e){a.loadData.classTimer.push({name:e,value:e})}),e.studentNum>this.studentMaxLimit?this.studentMaxStatus=!1:this.studentMaxStatus=!0,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!=e.value&&(i.offlineClassesNums=null,i.onlineClassesNums=null),i.vipGroupActivityId=e.value,n.vipGroupActivityName=e.text,n.vipGroupActivityIndex=t,r.vipGroupActivitySelect=e,i.onlineClassesUnitPrice=parseFloat(r.vipGroupCategorySelect.onlineClassesUnitPrice||0),i.offlineClassesUnitPrice=parseFloat(r.vipGroupCategorySelect.offlineClassesUnitPrice||0),i.singleClassMinutes=e.singleCourseTime,this.courseTypeVip&&this.onCalcClassTimes(e),this.getCalcClass(),this.setTimeTable()):"teacherSchool"==s.currentType?(i.teacherSchoolId=e.value,n.teacherSchoolName=e.text,n.teacherSchoolIndex=t):"teacherList"==s.currentType&&(i.educationalTeacherId=e.value,n.educationalTeacherName=e.text,n.educationalTeacherIndex=t);s.sheetStatus=!1},onClassKeyUp:function(e){"offLine"==e&&this.form.offlineClassesNums<=0&&(this.form.teacherSchoolId=null,this.formName.teacherSchoolName=null,this.formName.teacherSchoolIndex=0);var t=this.loadData.vipGroupActivitySelect;this.onCalcClassTimes(t),this.getCalcClass(),this.setTimeTable()},onCalcClassTimes:function(e){var t=this.form,a=this.statusList,s=Number(t.onlineClassesNums)+Number(t.offlineClassesNums);switch(t.totalClassTime=s,e.teachMode){case-1:a.hasOffline=!0,a.hasOnline=!0;break;case 0:a.hasOnline=!0,a.hasOffline=!1;break;case 1:a.hasOnline=!1,a.hasOffline=!0;break;default:break}},onCourseTypeSelect:function(){var e=g(l.a.mark(function e(t){var a,s,i,n=this;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.statusList.courseTypeStatus=!1,t.value!=this.courseType){e.next=3;break}return e.abrupt("return");case 3:if(this.courseType=t.value,this.courseTypeName=t.name,a=this.form,s=this.formName,i=this.loadData,a.vipGroupCategoryId=null,s.vipGroupCategoryName=null,s.vipGroupCategoryIndex=0,this.checkboxSelect=[],this.checkboxSelectIds=[],this.checkboxSelectList=[],this.checkboxSelectDataList=[],a.vipGroupActivityId=null,s.vipGroupActivityName=null,s.vipGroupActivityIndex=0,i.vipGroupActivity=[],i.vipGroupActivitySelect=[],a.singleClassMinutes=null,a.totalClassTime=null,a.offlineClassesNums=null,a.onlineClassesNums=null,this.scheduleList=[],"VIP"!=t.value){e.next=33;break}this.courseForm.columns[0].values=["线上","线下"],a.studentNum=null,a.onlineClassesUnitPrice=0,a.onlineTeacherSalary=0,this.statusList.hasOnline=!0,this.statusList.hasOffline=!0,this.getCalcClass(),e.next=49;break;case 33:if("PRACTICE"!=t.value){e.next=49;break}if(this.courseForm.columns[0].values=["线上"],this.form.teacherSchoolId=null,this.formName.teacherSchoolName=null,this.formName.teacherSchoolIndex=0,a.studentNum=1,i.classTimer=[{name:25,value:25}],this.statusList.hasOnline=!1,this.statusList.hasOffline=!1,this.getCalcClass(),this.singleClassMinutesPrice){e.next=46;break}return e.next=46,Object(m["G"])().then(function(e){var t=e.data;200==t.code&&(n.singleClassMinutesPrice=t.data.singleClassMinutesPrice||0)});case 46:if(this.singleClassMinutesSalary){e.next=49;break}return e.next=49,Object(m["u"])().then(function(e){var t=e.data;200==t.code&&(n.singleClassMinutesSalary=t.data.onlineTeacherSalary||0)});case 49:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),onClickSingleClass:function(){this.formName.vipGroupCategoryName||!this.courseTypeVip?this.form.vipGroupActivityId||(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.form.courseStart?this.courseForm.teachingStatus=!0:this.$toast("请选择排课开始时间"):this.$toast("请选每课时长")},onScheduleRemove:function(e){var t=this;this.$dialog.confirm({title:"提示",message:"是否删除该课时安排?",confirmButtonText:"确定",confirmButtonColor:"#269a93",cancelButtonText:"取消"}).then(function(){var a=t.scheduleList.indexOf(e);-1!==a&&t.scheduleList.splice(a,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.checkCourseList()&&(this.statusList.classTime=!0,this.setTimeTable())},setTimeTable:function(){if(this.checkCourseList(!1)){this.timeTable=[];var e=this.form,t=this.scheduleList,a=parseInt(e.onlineClassesNums||0),s=parseInt(e.offlineClassesNums||0);if(this.courseTypePractice&&(a=parseInt(e.totalClassTime||0)),!(t.length<=0)){var i=Number(a)+Number(s),n=e.courseStart.replace(/-/gi,"/"),r=new Date(n),o=0;while(i&&i>0){for(var l=0;l<t.length;l++){if(0==a&&0==s)break;var c=t[l].weekIndex-r.getDay();o>0&&0==c&&0==l&&(c+=7),c<0&&(c+=7);var u=this.getThinkDate(r,c),h=(new Date).getTime(),m=new Date(u.replace(/-/gi,"/")+" "+t[l].startTime+":00").getTime();if(h<m){var p={classDate:u,startClassTimeStr:t[l].startTime,endClassTimeStr:t[l].endTime};"线上"==t[l].type&&a>0?(p.teachMode="ONLINE",this.timeTable.push(p),a--,i--):"线下"==t[l].type&&s>0&&(p.teachMode="OFFLINE",this.timeTable.push(p),s--,i--)}}1==t.length?r.setDate(r.getDate()+7):t.every(function(e){return e.weekStr===t[0].weekStr})&&o++}this.timeTable.sort(function(e,t){var a=d()(d()(e.classDate).format("YYYY-MM-DD")+" "+e.startClassTimeStr+":00").valueOf(),s=d()(d()(t.classDate).format("YYYY-MM-DD")+" "+t.startClassTimeStr+":00").valueOf();return a-s})}}},getCalcClass:function(){var e=this.loadData,t=this.form,a=e.vipGroupActivitySelect,s=e.teacherCategory,i=t.onlineClassesNums?t.onlineClassesNums:0,n=t.offlineClassesNums?t.offlineClassesNums:0;this.courseTypePractice&&(i=parseInt(t.totalClassTime||0));var r=("number"!==typeof a.discount?100:a.discount)/100;if(this.courseTypePractice&&(t.onlineTeacherSalary=this.singleClassMinutesSalary,t.onlineClassesUnitPrice=this.singleClassMinutesPrice),console.log("重新计算课酬",this.courseTypeVip),a.salarySettlementJson){var o=JSON.parse(a.salarySettlementJson);if(this.courseTypeVip)if(o&&o.offlineSalarySettlement){var l=o.offlineSalarySettlement;"TEACHER_DEFAULT"==l.salarySettlementType?(t.onlineTeacherSalary=Number(s.offlineClassesSalary),t.offlineTeacherSalary=Number(s.offlineClassesSalary)):"FIXED_SALARY"==l.salarySettlementType&&(t.onlineTeacherSalary=Number(l.settlementValue),t.offlineTeacherSalary=Number(l.settlementValue))}else t.onlineTeacherSalary=Number(s.offlineClassesSalary),t.offlineTeacherSalary=Number(s.offlineClassesSalary);else if(this.courseTypePractice)if(o&&o.practiceSalarySettlement){var c=o.practiceSalarySettlement;"TEACHER_DEFAULT"==c.salarySettlementType?t.onlineTeacherSalary=Number(this.singleClassMinutesSalary):"FIXED_SALARY"==c.salarySettlementType&&(t.onlineTeacherSalary=Number(c.settlementValue))}else t.onlineTeacherSalary=Number(this.singleClassMinutesSalary)}else this.courseTypeVip&&(t.onlineTeacherSalary=Number(s.offlineClassesSalary),t.offlineTeacherSalary=Number(s.offlineClassesSalary));var u=0;u=this.courseTypeVip?Math.ceil(parseFloat((i*t.onlineClassesUnitPrice+n*t.offlineClassesUnitPrice)*r*1e4)/1e4):Math.ceil(parseFloat(i*t.onlineClassesUnitPrice*r*1e4)/1e4),t.totalCount=Number(u)},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=g(l.a.mark(function e(t){var a,s,i,n,r,o,c,u=this;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(a=this.form,s=this.statusList,a.subjectIdList){e.next=5;break}return this.$toast("请选择科目"),e.abrupt("return",!1);case 5:if(a.vipGroupCategoryId||!this.courseTypeVip){e.next=8;break}return this.$toast("请选择课程形式"),e.abrupt("return",!1);case 8:if(a.educationalTeacherId){e.next=11;break}return this.$toast("请选择乐团主管"),e.abrupt("return");case 11:if(!(this.checkboxSelectIds.length<=0)){e.next=14;break}return this.$toast("请选择上课学生"),e.abrupt("return");case 14:if(a.singleClassMinutes){e.next=17;break}return this.$toast("请选择每课时长"),e.abrupt("return",!1);case 17:if(i=!a.onlineClassesNums&&a.onlineClassesNums<=0,n=!a.offlineClassesNums&&a.offlineClassesNums<=0,!s.hasOnline||!this.studentMaxStatus){e.next=23;break}if(!i){e.next=23;break}return this.$toast("请输入线上课次数"),e.abrupt("return",!1);case 23:if(!s.hasOffline||s.hasOnline){e.next=30;break}if(!n){e.next=27;break}return this.$toast("请输入线下课次数"),e.abrupt("return",!1);case 27:if(!(a.offlineClassesNums>0)||a.teacherSchoolId){e.next=30;break}return this.$toast("请选择线下课地址"),e.abrupt("return",!1);case 30:if(!(s.hasOffline&&s.hasOnline&&this.studentMaxStatus&&parseFloat(a.onlineClassesNums||0)+parseFloat(a.offlineClassesNums||0)!=this.form.totalClassTime)){e.next=33;break}return this.$toast("线上课次数+线下课次数不等于总课次数"),e.abrupt("return");case 33:if(!(a.totalClassTime<=0)){e.next=36;break}return this.$toast("请输入线上/线下课次数"),e.abrupt("return",!1);case 36:if(a.registrationStartTime){e.next=39;break}return this.$toast("请选择报名开始时间"),e.abrupt("return",!1);case 39:if(a.coursesExpireDate){e.next=42;break}return this.$toast("请选择报名结束时间"),e.abrupt("return",!1);case 42:if(!(this.scheduleList.length<=0)){e.next=45;break}return this.$toast("课时安排不能为空"),e.abrupt("return",!1);case 45:if(r=this.loadData.vipGroupActivitySelect,!(r.minCourseNum>0&&r.maxCourseNum>0)){e.next=51;break}if(o=Number(a.totalClassTime)||parseInt(a.onlineClassesNums||0)+parseInt(a.offlineClassesNums||0),!(r.minCourseNum>o||o>r.maxCourseNum)){e.next=51;break}return this.$toast("课时总数为".concat(r.minCourseNum,"~").concat(r.maxCourseNum,"节")),e.abrupt("return");case 51:if(this.checkCourseList()){e.next=53;break}return e.abrupt("return");case 53:if(this.setTimeTable(),!(s.hasOnline&&this.studentMaxStatus&&s.hasOffline)){e.next=58;break}if(!(a.onlineClassesNums>0&&a.onlineTeacherSalary<=0&&a.offlineClassesNums>0&&a.offlineTeacherSalary<=0&&this.salaryStatus)){e.next=58;break}return this.$dialog.confirm({message:"当前课程课酬预计为0,是否继续?"}).then(function(){u.salaryStatus=!1,u.onSubmit()}),e.abrupt("return");case 58:if(!s.hasOnline||!this.studentMaxStatus){e.next=68;break}if(a.onlineClassesUnitPrice){e.next=62;break}return this.$toast("请输入线上课单价"),e.abrupt("return",!1);case 62:if(a.onlineTeacherSalary){e.next=65;break}return this.$toast("请输入线上课课酬"),e.abrupt("return",!1);case 65:if(!(a.onlineClassesNums>0&&a.onlineTeacherSalary<=0&&this.salaryStatus)){e.next=68;break}return this.$dialog.confirm({message:"当前课程线上课酬预计为0,是否继续?"}).then(function(){u.salaryStatus=!1,u.onSubmit()}),e.abrupt("return");case 68:if(!s.hasOffline){e.next=78;break}if(a.offlineClassesUnitPrice){e.next=72;break}return this.$toast("请输入线下课单价"),e.abrupt("return",!1);case 72:if(a.offlineTeacherSalary){e.next=75;break}return this.$toast("请输入线下课课酬"),e.abrupt("return",!1);case 75:if(!(a.offlineClassesNums>0&&a.offlineTeacherSalary<=0&&this.salaryStatus)){e.next=78;break}return this.$dialog.confirm({message:"当前课程线下课酬预计为0,是否继续?"}).then(function(){u.salaryStatus=!1,u.onSubmit()}),e.abrupt("return");case 78:if(a.onlineClassesNum=Number(a.onlineClassesNums),a.offlineClassesNum=Number(a.offlineClassesNums),this.courseTypePractice&&(a.onlineClassesNum=Number(a.totalClassTime)),a.totalClassTimes=Number(a.onlineClassesNums)+Number(a.offlineClassesNums),a.paymentExpireDate=a.coursesExpireDate,a.studentIdList=this.checkboxSelectIds.join(","),a.firstStudentId=this.checkboxSelectDataList.length>0?this.checkboxSelectDataList[0].userId:null,c={courseSchedules:this.timeTable},1==t&&(c.allowOverstepActivityStudentNum=1),this.onSubmitStatus){e.next=89;break}return e.abrupt("return");case 89:if(this.onSubmitStatus=!1,!this.courseTypeVip){e.next=96;break}return c.vipGroupApplyBaseInfo=a,e.next=94,this.getVipApply(c);case 94:e.next=102;break;case 96:return c.practiceGroupApplyBaseInfoDto=a,c.practiceGroupApplyBaseInfoDto.studentId=a.studentIdList,c.practiceGroupApplyBaseInfoDto.allCourseNum=a.totalClassTime,c.practiceGroupApplyBaseInfoDto.subjectId=a.subjectIdList,e.next=102,this.getPracticeApply(c);case 102:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),getVipApply:function(){var e=g(l.a.mark(function e(t){var a=this;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return Object(p["a"])(!0),e.next=3,Object(m["Z"])(t).then(function(e){var t=e.data;if(Object(p["a"])(!1),200==t.code)a.$toast("申请成功"),setTimeout(function(){a.onSubmitStatus=!0,Object(u["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(u["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):a.$router.push("/business")},500);else{if(206==t.code)return a.onSubmitStatus=!0,a.salaryStatus=!0,void a.$dialog.confirm({message:t.msg,showConfirmButton:!0,showCancelButton:!0,confirmButtonText:"继续创建",cancelButtonText:"取消"}).then(function(){a.salaryStatus=!1,a.onSubmit(1)});a.onSubmitStatus=!0,a.salaryStatus=!0,a.$toast(t.msg)}}).catch(function(){a.onSubmitStatus=!0,a.salaryStatus=!0,Object(p["a"])(!1)});case 3:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}(),getPracticeApply:function(){var e=g(l.a.mark(function e(t){var a=this;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return Object(p["a"])(!0),e.next=3,Object(m["D"])(t).then(function(e){var t=e.data;if(Object(p["a"])(!1),200==t.code)a.$toast("申请成功"),setTimeout(function(){a.onSubmitStatus=!0,Object(u["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(u["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):a.$router.push("/business")},500);else{if(206==t.code)return a.onSubmitStatus=!0,a.salaryStatus=!0,void a.$dialog.confirm({message:t.msg,showConfirmButton:!0,showCancelButton:!0,confirmButtonText:"继续创建",cancelButtonText:"取消"}).then(function(){a.salaryStatus=!1,a.onSubmit(1)});a.onSubmitStatus=!0,a.salaryStatus=!0,a.$toast(t.msg)}}).catch(function(){a.onSubmitStatus=!0,a.salaryStatus=!0,Object(p["a"])(!1)});case 3:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}(),checkCourseList:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.form,a=this.scheduleList||[],s=!1,i=!1;a.forEach(function(e){"线上"==e.type&&(s=!0),"线下"==e.type&&(i=!0)});var n=this.statusList,r=!t.onlineClassesNums&&t.onlineClassesNums<=0,o=!t.offlineClassesNums&&t.offlineClassesNums<=0;if(n.hasOnline&&this.studentMaxStatus){if(r)return e&&this.$toast("请输入线上课次数"),!1;if(!r&&!s&&t.onlineClassesNums>0)return e&&this.$toast("课时安排缺少线上课类型"),!1}if(n.hasOffline){if(o)return e&&this.$toast("请输入线下课次数"),!1;if(!o&&!i&&t.offlineClassesNums>0)return e&&this.$toast("课时安排缺少线下课类型"),!1}return!0},onSearch:function(){this.params.page=1,this.dataList=[],this.dataShow=!0,this.loading=!0,this.finished=!1,this.getStudent()},getStudent:function(){var e=this,t=this.params;Object(m["K"])(t).then(function(a){var s=a.data;e.loading=!1,200==s.code?(t.page=s.data.pageNo,e.dataList=e.dataList.concat(s.data.rows),t.page>=s.data.totalPage&&(e.finished=!0),e.params.page++):e.finished=!0,e.dataList.length<=0&&(e.dataShow=!1)})},onPopupCancel:function(){this.statusList.studentStatus=!1,this.checkboxSelect=[],this.checkboxSelectList=[]},onPopupSubmit:function(){var e=this.loadData.vipGroupCategorySelect,t=this.courseTypeVip?e.studentNum:1;console.log(t),this.checkboxSelect.length==t?(this.checkboxSelectDataList=JSON.parse(JSON.stringify(this.checkboxSelectList)),this.checkboxSelectIds=JSON.parse(JSON.stringify(this.checkboxSelect)),this.checkboxSelect=[],this.checkboxSelectList=[],this.loadData.vipGroupActivitySelect={},this.loadData.vipGroupActivity=[],this.formName.vipGroupActivityName=null,this.formName.vipGroupCategoryIndex=0,this.form.vipGroupActivityId=null,this.statusList.studentStatus=!1,"网管课"!=this.courseTypeName&&(this.statusList.hasOffline=!0),this.getCalcClass()):this.$toast("请选择学生".concat(t,"名,当前选择").concat(this.checkboxSelect.length,"名"))},onCheckboxSelect:function(e){var t=this;this.checkboxSelect.includes(e.userId.toString())?(this.checkboxSelect.forEach(function(a,s){a==e.userId.toString()&&t.checkboxSelect.splice(s,1)}),this.checkboxSelectList.forEach(function(a,s){a.userId==e.userId&&t.checkboxSelectList.splice(s,1)})):(this.checkboxSelect.push(e.userId.toString()),this.checkboxSelectList.push(e))},desensitPhone:function(e){var t=e.substr(0,3),a=e.substr(-4);return t+"****"+a}},computed:{courseTypeVip:function(){return"VIP"==this.courseType},courseTypePractice:function(){return"PRACTICE"==this.courseType}}},T=C,k=(a("f9bd9"),a("2877")),x=Object(k["a"])(T,n,r,!1,null,"d5e7b768",null),N=x.exports,L=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"vipapply"},[e.statusList.headerStatus?s("m-header"):e._e(),s("div",{staticClass:"vip-title"},[e._v("课程信息")]),s("van-cell-group",[s("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"}}),s("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"}}),s("van-field",{attrs:{label:"乐团主管",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(t){return e.onGetSheetList("teacherList")}},model:{value:e.formName.educationalTeacherName,callback:function(t){e.$set(e.formName,"educationalTeacherName",t)},expression:"formName.educationalTeacherName"}}),s("van-cell",{staticClass:"courseStudent",attrs:{title:"上课学生",readonly:!0,"input-align":"right","is-link":!(e.checkboxSelectDataList.length>0),size:"large",value:e.checkboxSelectDataList.length>0?"重新选择":"请选择","value-class":e.checkboxSelectDataList.length>0?"studentColor":null},on:{click:e.onCheckStudent}}),e.checkboxSelectDataList.length>0?s("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:"0.05rem 0",background:"#fafbff"}},e._l(e.checkboxSelectDataList,function(t,a){return s("p",{key:a,staticStyle:{color:"#323233"}},[e._v("\n "+e._s(t.userName)+" - "+e._s(t.phone)+"\n ")])}),0):e._e(),s("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"}})],1),s("div",{staticClass:"vip-title"},[e._v("课时组成")]),s("van-cell-group",[s("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"}}),s("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?s("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?s("van-field",{attrs:{label:"线下课","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:function(t){return e.onClassKeyUp("offLine")}},model:{value:e.form.offlineClassesNums,callback:function(t){e.$set(e.form,"offlineClassesNums",t)},expression:"form.offlineClassesNums"}}):e._e(),e.form.offlineClassesNums>0?s("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),s("div",{staticClass:"vip-title"},[e._v("课时安排")]),s("van-cell-group",[s("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?s("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(),s("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,a){return s("van-cell",{key:a,attrs:{"title-class":"title-time"}},[s("template",{slot:"title"},[s("span",{staticClass:"online"},[e._v(e._s(t.type))]),s("span",{staticClass:"week"},[e._v(e._s(t.weekStr))]),s("span",{staticClass:"timer"},[e._v(e._s(t.startTime+"-"+t.endTime))])]),s("template",{slot:"default"},[s("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(a){return e.onScheduleRemove(t)}}},[e._v("删除")])],1)],2)}),s("div",{staticClass:"add-plan van-cell",on:{click:e.onCourseShedule}},[s("van-icon",{attrs:{name:"add-o"}}),e._v("课时安排\n ")],1),e.scheduleList.length>0?s("van-field",{attrs:{label:"排课列表",disabled:"","input-align":"right","is-link":"",size:"large"},on:{click:e.onShowTimeTable}}):e._e()],2),s("div",{staticClass:"button-group"},[s("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:e.onSubmit}},[e._v("确认")])],1),s("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"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:e.enlistForm.status,callback:function(t){e.$set(e.enlistForm,"status",t)},expression:"enlistForm.status"}},[s("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),s("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"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:e.sheetForm.sheetStatus,callback:function(t){e.$set(e.sheetForm,"sheetStatus",t)},expression:"sheetForm.sheetStatus"}},[s("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),s("van-popup",{attrs:{position:"bottom"},model:{value:e.dataForm.status,callback:function(t){e.$set(e.dataForm,"status",t)},expression:"dataForm.status"}},[s("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),s("van-popup",{attrs:{position:"bottom"},model:{value:e.courseForm.teachingStatus,callback:function(t){e.$set(e.courseForm,"teachingStatus",t)},expression:"courseForm.teachingStatus"}},[s("van-picker",{attrs:{columns:e.courseForm.columns,"show-toolbar":""},on:{cancel:function(t){e.courseForm.teachingStatus=!1},confirm:e.onTeachinConfirm}})],1),s("van-popup",{staticClass:"studentChiose",style:{height:"180%"},attrs:{"lock-scroll":!0,position:"bottom"},model:{value:e.statusList.studentStatus,callback:function(t){e.$set(e.statusList,"studentStatus",t)},expression:"statusList.studentStatus"}},[s("van-sticky",[s("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:e.onSearch},scopedSlots:e._u([{key:"action",fn:function(){return[s("div",{on:{click:e.onSearch}},[e._v("搜索")])]},proxy:!0}]),model:{value:e.params.search,callback:function(t){e.$set(e.params,"search",t)},expression:"params.search"}})],1),s("div",{staticClass:"paddingB80"},[e.dataShow?s("van-list",{key:"data",staticClass:"studentContainer",attrs:{finished:e.finished,"finished-text":""},on:{load:e.getStudent},model:{value:e.loading,callback:function(t){e.loading=t},expression:"loading"}},[s("van-checkbox-group",{model:{value:e.checkboxSelect,callback:function(t){e.checkboxSelect=t},expression:"checkboxSelect"}},[s("van-cell-group",e._l(e.dataList,function(t,i){return s("van-cell",{key:i,staticClass:"input-cell",attrs:{center:!0},on:{click:function(a){return e.onCheckboxSelect(t)}}},[s("template",{slot:"icon"},[t.avatar?s("img",{staticClass:"logo",attrs:{src:t.avatar,alt:""}}):s("img",{staticClass:"logo",attrs:{src:a("a7ed"),alt:""}})]),s("template",{slot:"title"},[s("span",{staticStyle:{width:"0.8rem",display:"inline-block"}},[e._v(e._s(t.userName))]),s("van-tag",{attrs:{type:"warning"}},[e._v("1V1: "+e._s(t.courseOneToOneTime)+"次")])],1),s("template",{slot:"label"},[s("span",{staticStyle:{width:"0.8rem",display:"inline-block"}},[e._v(e._s(e.desensitPhone(t.phone)))]),s("van-tag",{attrs:{type:"warning"}},[e._v("1V2: "+e._s(t.courseOneToTwoTime)+"次")])],1),s("template",{slot:"default"},[s("van-checkbox",{attrs:{disabled:!t.courseOneToOneTime&&!t.courseOneToTwoTime,name:t.userId.toString()}})],1)],2)}),1)],1)],1):s("m-empty",{key:"data",staticClass:"empty",attrs:{msg:"暂无学生"}})],1),s("div",{staticClass:"button-group-popup"},[s("span",{staticClass:"btn",on:{click:e.onPopupCancel}},[e._v("取消")]),s("span",{staticClass:"btn primary",on:{click:e.onPopupSubmit}},[e._v("确定")])])],1),s("van-popup",{attrs:{position:"bottom"},model:{value:e.statusList.classTime,callback:function(t){e.$set(e.statusList,"classTime",t)},expression:"statusList.classTime"}},[s("van-row",[s("van-col",{attrs:{span:"12"}},[e._v("上课类型")]),s("van-col",{attrs:{span:"12"}},[e._v("上课时间")])],1),s("div",{staticClass:"tableContainer"},e._l(e.timeTable,function(t,a){return s("van-row",{key:a},[s("van-col",{attrs:{span:"12"}},[e._v("\n "+e._s("ONLINE"==t.teachMode?"线上":"线下")+"\n ")]),s("van-col",{attrs:{span:"12"}},[e._v("\n "+e._s(t.classDate)+" "+e._s(t.startClassTimeStr)+"\n ")])],1)}),1)],1)],1)},D=[];function I(e,t,a,s,i,n,r){try{var o=e[n](r),l=o.value}catch(c){return void a(c)}o.done?t(l):Promise.resolve(l).then(s,i)}function w(e){return function(){var t=this,a=arguments;return new Promise(function(s,i){var n=e.apply(t,a);function r(e){I(n,s,i,r,o,"next",e)}function o(e){I(n,s,i,r,o,"throw",e)}r(void 0)})}}for(var G=[],O=0;O<60;O++){var M=O<10?"0"+O:O;G.push(M+"分")}var A={name:"vipapply",components:{MHeader:c["a"],MEmpty:h["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:[],teacherList:[],teacherListSelect:[],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:G,className:"minutes"}]},form:{name:null,subjectIdList:null,vipGroupCategoryId:null,vipGroupActivityId:null,teacherSchoolId:null,educationalTeacherId: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,educationalTeacherName:null,educationalTeacherIndex:0},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 e=this.$route.query;e.Authorization&&(localStorage.setItem("Authorization",decodeURI(e.Authorization)),localStorage.setItem("userInfo",decodeURI(e.Authorization))),document.title="双十一排课",Object(u["b"])().android&&(this.headerStatus=!0)},methods:{onCheckStudent:function(){this.form.vipGroupCategoryId?this.statusList.studentStatus=!0:this.$toast("请选择课程形式")},onGetSheetList:function(e){var t=this.sheetForm;if(t.columns=[],this.form.vipGroupCategoryId||"vipGroupActivity"!=e)if(this.checkboxSelectDataList&&!(this.checkboxSelectDataList&&this.checkboxSelectDataList.length<=0)||"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("请选择上课学生");else this.$toast("请选择课程形式")},onLoadingData:function(){var e=this,t=this.sheetForm;if("subjectList"==t.currentType)Object(m["k"])().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});else if("vipGroupCategory"==t.currentType)Object(m["bb"])().then(function(a){var s=a.data;if(200==s.code&&s.data.length>0){var i=[];s.data.forEach(function(e){e.studentNum<=2&&(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});else if("vipGroupActivity"==t.currentType){var a=[];this.checkboxSelectDataList&&this.checkboxSelectDataList.length>0&&this.checkboxSelectDataList.forEach(function(e){a.push(e.userId)}),Object(m["i"])({categoryId:this.form.vipGroupCategoryId,onlySpecialActivity:!0,studentIds:a.join(",")}).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})}else"teacherSchool"==t.currentType?Object(m["n"])().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}):"teacherList"==t.currentType&&Object(m["j"])().then(function(a){var s=a.data,i=s.data.EDUCATION||[];if(200==s.code&&i.length>0){var n=[];i.forEach(function(e){e.value=e.userId,e.text=e.userName,n.push(e)}),e.loadData.teacherList=n,t.columns=n,t.loading=!1}else e.$toast("暂无乐团主管"),t.loading=!1})},findTeacherCategory:function(e){var t=this;Object(m["h"])({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})}),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!=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):"teacherList"==s.currentType&&(i.educationalTeacherId=e.value,n.educationalTeacherName=e.text,n.educationalTeacherIndex=t);s.sheetStatus=!1},onClassKeyUp:function(e){"offLine"==e&&this.form.offlineClassesNums<=0&&(this.form.teacherSchoolId=null,this.formName.teacherSchoolName=null,this.formName.teacherSchoolIndex=0);var t=this.loadData.vipGroupActivitySelect;this.onCalcClassTimes(t),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),c=0;while(r&&r>0){for(var u=0;u<t.length;u++){if(0==a&&0==s)break;var h=t[u].weekIndex-l.getDay();c>0&&0==h&&0==u&&(h+=7),h<0&&(h+=7);var m=this.getThinkDate(l,h),p=(new Date).getTime(),f=new Date(m.replace(/-/gi,"/")+" "+t[u].startTime+":00").getTime();if(p<f){var d={classDate:m,startClassTimeStr:t[u].startTime,endClassTimeStr:t[u].endTime};"线上"==t[u].type&&a>0?(d.teachMode="ONLINE",this.timeTable.push(d),a--):"线下"==t[u].type&&s>0?(d.teachMode="OFFLINE",this.timeTable.push(d),s--):a>0?(d.teachMode="ONLINE",this.timeTable.push(d),a--):s>0&&(d.teachMode="OFFLINE",this.timeTable.push(d),s--),r--}}1==t.length?l.setDate(l.getDate()+7):t.every(function(e){return e.weekStr===t[0].weekStr})&&c++}}},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),c=0;if(Number(i)+Number(n)>0){var u=i*t.onlineClassesUnitPrice+n*t.offlineClassesUnitPrice;r>0&&!o&&(u=0),c=u*t.studentNum/(Number(i)+Number(n)+Number(r)),"DISCOUNT"==a.type&&(c=c*(a.attribute1?Number(a.attribute1):100)/100)}if(l&&l.onlineSalarySettlement){var h=l.onlineSalarySettlement;"TEACHER_DEFAULT"==h.salarySettlementType?t.onlineTeacherSalary=Math.round(s.offlineClassesSalary):"RATIO_DISCOUNT"==h.salarySettlementType?t.onlineTeacherSalary=Math.round(c?c*(h.settlementValue?h.settlementValue:100)/100:0):"FIXED_SALARY"==h.salarySettlementType&&(t.onlineTeacherSalary=Math.round(h.settlementValue)),t.onlineTeacherSalary=Number(t.onlineTeacherSalary)}if(l&&l.offlineSalarySettlement){var m=l.offlineSalarySettlement;"TEACHER_DEFAULT"==m.salarySettlementType?t.offlineTeacherSalary=Math.round(s.offlineClassesSalary):"RATIO_DISCOUNT"==m.salarySettlementType?t.offlineTeacherSalary=Math.round(c?c*(m.settlementValue?m.settlementValue:100)/100:0):"FIXED_SALARY"==m.salarySettlementType&&(t.offlineTeacherSalary=Math.round(m.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=w(l.a.mark(function e(){var t,a,s,i,n,r,o=this;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=this.form,a=this.statusList,this.setTimeTable(),t.subjectIdList){e.next=6;break}return this.$toast("请选择科目"),e.abrupt("return",!1);case 6:if(t.vipGroupCategoryId){e.next=9;break}return this.$toast("请选择课程形式"),e.abrupt("return",!1);case 9:if(t.educationalTeacherId){e.next=12;break}return this.$toast("请选择乐团主管"),e.abrupt("return");case 12:if(!(this.checkboxSelectIds.length<=0)){e.next=15;break}return this.$toast("请选择上课学生"),e.abrupt("return");case 15:if(t.vipGroupActivityId){e.next=18;break}return this.$toast("请选择活动方案"),e.abrupt("return",!1);case 18:if(t.singleClassMinutes){e.next=21;break}return this.$toast("请选择每课时长"),e.abrupt("return",!1);case 21:if(s=!t.onlineClassesNums&&t.onlineClassesNums<=0,i=!t.offlineClassesNums&&t.offlineClassesNums<=0,!a.hasOnline){e.next=27;break}if(!s){e.next=27;break}return this.$toast("请输入线上课次数"),e.abrupt("return",!1);case 27:if(!a.hasOffline){e.next=34;break}if(!i){e.next=31;break}return this.$toast("请输入线下课次数"),e.abrupt("return",!1);case 31:if(!(t.offlineClassesNums>0)||t.teacherSchoolId){e.next=34;break}return this.$toast("请选择线下课地址"),e.abrupt("return",!1);case 34:if(n=this.loadData.vipGroupActivitySelect,"GIVE_CLASS"!=n.type||t.giveTeachMode){e.next=38;break}return this.$toast("请选择赠课类型"),e.abrupt("return",!1);case 38:if(!(this.scheduleList.length<=0)){e.next=41;break}return this.$toast("课时安排不能为空"),e.abrupt("return",!1);case 41:if(!a.hasOnline){e.next=48;break}if(t.onlineClassesUnitPrice){e.next=45;break}return this.$toast("请输入线上课单价"),e.abrupt("return",!1);case 45:if(t.onlineTeacherSalary){e.next=48;break}return this.$toast("请输入线上课课酬"),e.abrupt("return",!1);case 48:if(!a.hasOffline){e.next=55;break}if(t.offlineClassesUnitPrice){e.next=52;break}return this.$toast("请输入线下课单价"),e.abrupt("return",!1);case 52:if(t.offlineTeacherSalary){e.next=55;break}return this.$toast("请输入线下课课酬"),e.abrupt("return",!1);case 55:if("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,t.studentIdList=this.checkboxSelectIds.join(","),t.firstStudentId=this.checkboxSelectDataList.length>0?this.checkboxSelectDataList[0].userId:null,r={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:t},this.onSubmitStatus){e.next=63;break}return e.abrupt("return");case 63:return this.onSubmitStatus=!1,Object(p["a"])(!0),e.next=67,Object(m["ab"])(r).then(function(e){var t=e.data;Object(p["a"])(!1),200==t.code?(o.$toast("排课成功"),setTimeout(function(){o.onSubmitStatus=!0,Object(u["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(u["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):o.$router.push("/business")},500)):(o.onSubmitStatus=!0,o.$toast(t.msg))}).catch(function(){Object(p["a"])(!1)});case 67:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),onSearch:function(){this.params.page=1,this.dataList=[],this.dataShow=!0,this.loading=!0,this.finished=!1,this.getStudent()},getStudent:function(){var e=w(l.a.mark(function e(){var t,a=this;return l.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=this.params,e.next=3,Object(m["E"])(t).then(function(e){var s=e.data;a.loading=!1,200==s.code?(t.page=s.data.pageNo,a.dataList=a.dataList.concat(s.data.rows),t.page>=s.data.totalPage&&(a.finished=!0),a.params.page++):a.finished=!0,a.dataList.length<=0&&(a.dataShow=!1)});case 3:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),onPopupCancel:function(){this.statusList.studentStatus=!1,this.checkboxSelect=[],this.checkboxSelectList=[]},onPopupSubmit:function(){var e=this.loadData.vipGroupCategorySelect;this.checkboxSelect.length==e.studentNum?(this.checkboxSelectDataList=JSON.parse(JSON.stringify(this.checkboxSelectList)),this.checkboxSelectIds=JSON.parse(JSON.stringify(this.checkboxSelect)),this.checkboxSelect=[],this.checkboxSelectList=[],this.loadData.vipGroupActivity=[],this.formName.vipGroupActivityName=null,this.formName.vipGroupCategoryIndex=0,this.form.vipGroupActivityId=null,this.statusList.studentStatus=!1):this.$toast("请选择学生".concat(e.studentNum,"名,当前选择").concat(this.checkboxSelect.length,"名"))},onCheckboxSelect:function(e){var t=this;(e.courseOneToOneTime||e.courseOneToTwoTime)&&(this.checkboxSelect.includes(e.userId.toString())?(this.checkboxSelect.forEach(function(a,s){a==e.userId.toString()&&t.checkboxSelect.splice(s,1)}),this.checkboxSelectList.forEach(function(a,s){a.userId==e.userId&&t.checkboxSelectList.splice(s,1)})):(this.checkboxSelect.push(e.userId.toString()),this.checkboxSelectList.push(e)))},desensitPhone:function(e){var t=e.substr(0,3),a=e.substr(-4);return t+"****"+a}}},_=A,$=(a("64a8"),Object(k["a"])(_,L,D,!1,null,"462a0d85",null)),F=$.exports,P=a("fa8b"),E=a("26a8"),j={components:{vip00Apply:N,vip11Apply:F,VipCourse:P["a"],TheoryCourse:E["a"]},data:function(){return{active:1,tenantId:null}},created:function(){this.tenantId=sessionStorage.getItem("tenantId")||null},mounted:function(){var e=this.$route.query;e.Authorization&&(localStorage.setItem("Authorization",decodeURI(e.Authorization)),localStorage.setItem("userInfo",decodeURI(e.Authorization))),document.title="课程申请"},methods:{onChange:function(e){1==e?document.title="VIP课程申请":2==e?document.title="双十一排课":3==e?document.title="考级VIP排课":4==e&&(document.title="考级乐理排课")}}},U=j,z=(a("c1af"),Object(k["a"])(U,s,i,!1,null,"150b742a",null));t["default"]=z.exports},"4dc9":function(e,t,a){},"64a8":function(e,t,a){"use strict";var s=a("4dc9"),i=a.n(s);i.a},c1af:function(e,t,a){"use strict";var s=a("106b"),i=a.n(s);i.a},f9bd9:function(e,t,a){"use strict";var s=a("2d23"),i=a.n(s);i.a}}]);