(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["VIPApply~applyActive"],{"26a8":function(t,e,s){"use strict";var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"vipCourse"},[a("div",[a("div",{staticClass:"vip-title"},[t._v("课程信息")]),a("van-field",{attrs:{label:"课程声部","input-align":"right",placeholder:"请选择课程声部",readonly:"","is-link":""},on:{click:function(e){return t.onSelect("subjectList")}},model:{value:t.formName.subjectListName,callback:function(e){t.$set(t.formName,"subjectListName",e)},expression:"formName.subjectListName"}}),a("van-field",{attrs:{label:"课程形式","input-align":"right",placeholder:"请选择课程形式",readonly:"","is-link":""},on:{click:function(e){return t.onSelect("vipGroupCategory")}},model:{value:t.formName.vipGroupCategoryName,callback:function(e){t.$set(t.formName,"vipGroupCategoryName",e)},expression:"formName.vipGroupCategoryName"}}),a("van-cell",{staticClass:"courseStudent",attrs:{title:"上课学员",readonly:"","input-align":"right","is-link":!(t.checkboxSelectDataList.length>0),value:t.checkboxSelectDataList.length>0?"重新选择":"请选择上课学员","value-class":t.checkboxSelectDataList.length>0?"studentColor":null},on:{click:t.onCheckStudent}}),t.checkboxSelectDataList.length>0?a("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:"0.05rem 0",background:"#fafbff"}},t._l(t.checkboxSelectDataList,function(e,s){return a("p",{key:s,staticStyle:{color:"#323233"}},[t._v("\n "+t._s(e.username)+" - "+t._s(e.parentsPhone)+"\n ")])}),0):t._e(),a("div",{staticClass:"vip-title"},[t._v("课时组成")]),a("van-field",{attrs:{label:"课时总数","input-align":"right",placeholder:"输选择课时总数",readonly:"",value:"10节"}}),a("van-field",{attrs:{label:"课程时长","input-align":"right",placeholder:"请选择课程时长",readonly:"","is-link":""},on:{click:t.onClickSingleClass},model:{value:t.form.singleClassMinutes,callback:function(e){t.$set(t.form,"singleClassMinutes",e)},expression:"form.singleClassMinutes"}}),a("van-field",{attrs:{label:"排课开始时间",readonly:!0,"input-align":"right","is-link":"",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,s){return a("van-cell",{key:s,attrs:{"title-class":"title-time"}},[a("template",{slot:"title"},[a("span",{staticClass:"online"},[t._v(t._s(e.type))]),a("span",{staticClass:"week"},[t._v(t._s(e.weekStr))]),a("span",{staticClass:"timer"},[t._v(t._s(e.startTime+"-"+e.endTime))])]),a("template",{slot:"default"},[a("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(s){return t.onScheduleRemove(e)}}},[t._v("删除")])],1)],2)}),a("div",{staticClass:"add-plan van-cell",on:{click:t.onCourseSchedule}},[a("van-icon",{attrs:{name:"add-o"}}),t._v("课时安排\n ")],1),t.scheduleList.length>0?a("van-field",{attrs:{label:"排课列表",readonly:"","input-align":"right","is-link":""},on:{click:t.onShowTimeTable}}):t._e(),a("div",{staticStyle:{margin:"16px"}},[a("van-button",{attrs:{round:"",block:"",type:"info"},on:{click:t.onSubmit}},[t._v("确认排课")])],1)],2),a("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"}}),a("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[a("van-datetime-picker",{attrs:{type:"date","min-date":t.dataForm.minDate,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),a("van-popup",{attrs:{position:"bottom"},model:{value:t.sheetForm.sheetStatus,callback:function(e){t.$set(t.sheetForm,"sheetStatus",e)},expression:"sheetForm.sheetStatus"}},[a("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),a("van-popup",{attrs:{position:"bottom"},model:{value:t.courseForm.teachingStatus,callback:function(e){t.$set(t.courseForm,"teachingStatus",e)},expression:"courseForm.teachingStatus"}},[a("van-picker",{attrs:{columns:t.courseForm.columns,"show-toolbar":""},on:{cancel:function(e){t.courseForm.teachingStatus=!1},confirm:t.onTeachinConfirm}})],1),a("van-popup",{staticClass:"studentChiose",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"}},[t.statusList.studentStatus?a("div",[a("van-sticky",[a("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[a("div",{on:{click:t.onSearch}},[t._v("搜索")])]},proxy:!0}],null,!1,3446203101),model:{value:t.params.search,callback:function(e){t.$set(t.params,"search",e)},expression:"params.search"}})],1),a("div",{staticClass:"paddingB80"},[t.dataShow?a("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"}},[a("van-checkbox-group",{model:{value:t.checkboxSelect,callback:function(e){t.checkboxSelect=e},expression:"checkboxSelect"}},[a("van-cell-group",t._l(t.dataList,function(e,n){return a("van-cell",{key:n,staticClass:"input-cell",attrs:{center:!0},on:{click:function(s){return t.onCheckboxSelect(e)}}},[a("template",{slot:"icon"},[e.avatar?a("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):a("img",{staticClass:"logo",attrs:{src:s("a7ed"),alt:""}})]),a("template",{slot:"title"},[t._v("\n "+t._s(e.username)+"\n ")]),a("template",{slot:"label"},[a("span",[t._v(t._s(t.desensitPhone(e.parentsPhone)))])]),a("template",{slot:"default"},[a("van-checkbox",{attrs:{name:e.userId.toString()}})],1)],2)}),1)],1)],1):a("m-empty",{key:"data",staticClass:"empty",attrs:{msg:"暂无学生"}})],1),a("div",{staticClass:"button-group-popup"},[a("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),a("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确定")])])],1):t._e()]),a("van-popup",{attrs:{position:"bottom"},model:{value:t.statusList.classTime,callback:function(e){t.$set(t.statusList,"classTime",e)},expression:"statusList.classTime"}},[a("van-row",[a("van-col",{attrs:{span:"12"}},[t._v("上课类型")]),a("van-col",{attrs:{span:"12"}},[t._v("上课时间")])],1),a("div",{staticClass:"tableContainer"},t._l(t.timeTable,function(e,s){return a("van-row",{key:s},[a("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s("ONLINE"==e.teachMode?"线上":"线下")+"\n ")]),a("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s(e.classDate)+" "+t._s(e.startClassTimeStr)+"\n ")])],1)}),1)],1)],1)},n=[],i=s("a34a"),r=s.n(i),o=s("5a0c"),u=s.n(o),c=s("3908"),l=s("ff51"),h=s("9afb"),d=s("4198"),m=s("e3eb"),f=s.n(m),p=s("d678");function v(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,a)}return s}function g(t){for(var e=1;e0?this.checkboxSelectDataList[0].userId:null,s={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:g({},e,{userId:this.teacherId,activityCourseType:"music_theory"})},Object(c["a"])(!0),t.next=22,Object(d["a"])(s).then(function(t){var e=t.data;Object(c["a"])(!1),200==e.code?(a.$toast("申请成功"),setTimeout(function(){a.onSubmitStatus=!0,Object(l["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(l["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):a.$router.push("/business")},500)):a.$toast(e.msg)}).catch(function(){Object(c["a"])(!1)});case 22:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onCourseSchedule:function(){this.form.singleClassMinutes?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)},setTimeTable:function(){if(this.checkCourseList(!1)){this.timeTable=[];var t=this.form,e=this.scheduleList,s=10,a=0;if(!(e.length<=0)){var n=Number(s)+Number(a),i=t.courseStart.replace(/-/gi,"/"),r=new Date(i),o=0;while(n&&n>0){for(var c=0;c0&&0==l&&0==c&&(l+=7),l<0&&(l+=7);var h=this.getThinkDate(r,l),d=(new Date).getTime(),m=new Date(h.replace(/-/gi,"/")+" "+e[c].startTime+":00").getTime();if(d0?(f.teachMode="ONLINE",this.timeTable.push(f),s--,n--):"线下"==e[c].type&&a>0&&(f.teachMode="OFFLINE",this.timeTable.push(f),a--,n--)}}1==e.length?r.setDate(r.getDate()+7):e.every(function(t){return t.weekStr===e[0].weekStr})&&o++}this.timeTable.sort(function(t,e){var s=u()(u()(t.classDate).format("YYYY-MM-DD")+" "+t.startClassTimeStr+":00").valueOf(),a=u()(u()(e.classDate).format("YYYY-MM-DD")+" "+e.startClassTimeStr+":00").valueOf();return s-a})}}},onClickSingleClass:function(){this.formName.vipGroupCategoryName?this.statusList.classTimerStatus=!0:this.$toast("请选择课程形式")},onCheckStudent:function(){this.form.subjectIdList?this.statusList.studentStatus=!0:this.$toast("请选择课程声部")},onShowTimeTable:function(){this.checkCourseList()&&(this.statusList.classTime=!0,this.setTimeTable())},getThinkDate:function(t,e){var s=t;s.setDate(t.getDate()+e);var a=s.getFullYear(),n=s.getMonth()+1,i="";i=n<10?"0"+n:n+"";var r=s.getDate(),o="";return o=r<10?"0"+r:r+"",a+"-"+i+"-"+o},onTeachinConfirm:function(t){var e=this,s=this.scheduleList,a=(t[2]>=10?t[2]:"0"+t[2])+":"+t[3].split("分")[0],n=this.MinutesTest(t[2],t[3],this.form.singleClassMinutes),i=!0;s.forEach(function(s){var r=e.timeIsrange(a,n,s.startTime),o=e.timeIsrange(a,n,s.endTime);i&&(t[1]==s.weekStr?i=!r&&!o:t[1]!=s.weekStr&&(i=!0))}),i?(s.push({type:t[0],weekStr:t[1],weekIndex:this.getWeek(t[1]),startTime:a,endTime:n,id:Date.now()}),this.courseForm.teachingStatus=!1,this.setTimeTable()):this.$toast("该时间段已排课请重选时间")},checkCourseList:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.scheduleList||[],s=!1;return e.forEach(function(t){"线上"==t.type&&(s=!0)}),!!s||(t&&this.$toast("课时安排缺少线上课类型"),!1)},MinutesTest:function(t,e,s){var a=e.split("分")[0],n=new Date(1900,1,1,t,a);n.setMinutes(n.getMinutes()+parseInt(s));var i=n.getHours(),r=n.getMinutes();return i<10&&(i="0"+i),r<10&&(r="0"+r),i+":"+r},timeIsrange:function(t,e,s){var a=t.split(":");if(2!=a.length)return!1;var n=e.split(":");if(2!=n.length)return!1;var i=s.split(":");if(2!=n.length)return!1;var r=new Date,o=new Date,u=new Date;return r.setHours(a[0]),r.setMinutes(a[1]),o.setHours(n[0]),o.setMinutes(n[1]),u.setHours(i[0]),u.setMinutes(i[1]),u.getTime()-r.getTime()>=0&&u.getTime()-o.getTime()<=0},getWeek:function(t){var e={"周一":1,"周二":2,"周三":3,"周四":4,"周五":5,"周六":6,"周日":0};return e[t]},onSearch:function(){this.params.page=1,this.dataList=[],this.dataShow=!0,this.loading=!0,this.finished=!1,this.getStudent()},getStudent:function(){var t=y(r.a.mark(function t(){var e,s=this;return r.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return e=this.params,t.next=3,Object(d["c"])(f()(g({},e,{activityCourseType:"music_theory"}))).then(function(t){var a=t.data;if(s.loading=!1,200==a.code){if(s.dataList.length>0&&1==a.data.pageNo)return;e.page=a.data.pageNo,s.dataList=s.dataList.concat(a.data.rows),e.page>=a.data.totalPage&&(s.finished=!0),s.params.page++}else s.finished=!0;s.dataList.length<=0&&(s.dataShow=!1)});case 3:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onPopupCancel:function(){this.statusList.studentStatus=!1,this.checkboxSelect=[],this.checkboxSelectList=[]},onPopupSubmit:function(){var t=this.loadData.vipGroupCategorySelect,e=this.checkboxSelect.length;e<1||e>t.studentNum?this.$toast("请选择学生1~".concat(t.studentNum,"名,当前选择").concat(e,"名")):(this.checkboxSelectDataList=JSON.parse(JSON.stringify(this.checkboxSelectList)),this.checkboxSelectIds=JSON.parse(JSON.stringify(this.checkboxSelect)),this.checkboxSelect=[],this.checkboxSelectList=[],this.statusList.studentStatus=!1)},onCheckboxSelect:function(t){var e=this;this.checkboxSelect.includes(t.userId.toString())?(this.checkboxSelect.forEach(function(s,a){s==t.userId.toString()&&e.checkboxSelect.splice(a,1)}),this.checkboxSelectList.forEach(function(s,a){s.userId==t.userId&&e.checkboxSelectList.splice(a,1)})):(this.checkboxSelect.push(t.userId.toString()),this.checkboxSelectList.push(t))},onSelect:function(t){var e=this.sheetForm;e.columns=[],e.sheetStatus=!0,e.loading=!0,e.currentType=t,e.index=0;var s=this.loadData[t];s&&s.length>0?(e.columns=s,e.index=this.formName[t+"Index"],e.loading=!1):this.onLoadingData(t),this.sheetForm.status=!0},onLoadingData:function(){var t=y(r.a.mark(function t(){var e,s=this;return r.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.sheetForm,"subjectList"!=e.currentType){t.next=6;break}return t.next=4,Object(h["k"])().then(function(t){var a=t.data;if(200==a.code&&a.data.length>0){var n=[];a.data.forEach(function(t){t.value=t.id,t.text=t.name,n.push(t)}),s.loadData.subjectList=n,e.columns=n,e.loading=!1}else s.$toast("暂无科目列表"),e.loading=!1});case 4:t.next=7;break;case 6:"vipGroupCategory"==e.currentType&&Object(h["bb"])({includeMusicTheory:1}).then(function(t){var a=t.data;if(200==a.code&&a.data.length>0){var n=[];a.data.forEach(function(t){t.musicTheory&&(t.value=t.id,t.text=t.name,n.push(t))}),(!n||n.length<=0)&&s.$toast("暂无课程形式"),s.loadData.vipGroupCategory=n,e.columns=n,e.loading=!1}else s.$toast("暂无课程形式"),e.loading=!1});case 7:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onClassTimerSelect:function(t){this.form.singleClassMinutes!=t.value&&(this.timeTable=[],this.scheduleList=[]),this.form.singleClassMinutes=t.value,this.statusList.classTimerStatus=!1},onSheetConfirm:function(t,e){var s=this,a=this.sheetForm,n=this.form,i=this.formName,r=this.loadData;if("subjectList"==a.currentType)n.subjectIdList=t.value,i.subjectListName=t.text,i.subjectListIndex=e,r.subjectListSelect=t,this.dataList=[],this.params.search=null,this.loading=!1,this.finished=!1,this.dataShow=!0,this.params.page=1,this.checkboxSelect=[],this.checkboxSelectIds=[],this.checkboxSelectList=[],this.checkboxSelectDataList=[];else if("vipGroupCategory"==a.currentType){n.vipGroupCategoryId=t.value,i.vipGroupCategoryName=t.text,i.vipGroupCategoryIndex=e,r.vipGroupCategorySelect=t,n.studentNum=t.studentNum,n.onlineClassesUnitPrice=Math.ceil(t.onlineClassesUnitPrice),n.offlineClassesUnitPrice=Math.ceil(t.offlineClassesUnitPrice),n.singleClassMinutes=null,r.classTimer=[];var o=t.singleClassMinutes.split(",");n.singleClassMinutes=o.length>0?o[0]:null,o.forEach(function(t){s.loadData.classTimer.push({name:t,value:t})}),this.scheduleList=[],this.timeTable=[]}a.sheetStatus=!1},onCurrentConfirm:function(t){var e=new Date(t),s=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),a=e.getDate()>=10?e.getDate():"0"+e.getDate();this.form.courseStart=e.getFullYear()+"-"+s+"-"+a,this.dataForm.status=!1},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"==t?"".concat(e,"日"):e},desensitPhone:function(t){var e=t.substr(0,3),s=t.substr(-4);return e+"****"+s}}},L=T,D=(s("9afc"),s("2877")),N=Object(D["a"])(L,a,n,!1,null,"70234beb",null);e["a"]=N.exports},4198:function(t,e,s){"use strict";s.d(e,"c",function(){return i}),s.d(e,"a",function(){return o}),s.d(e,"b",function(){return r});var a=s("981f").default,n="/api-teacher",i=function(t){return a({url:n+"/teacherVipGroup/queryChildrenDayStudentList",method:"get",params:t})},r=function(t){return a({url:n+"/vipGroupActivity/getChildrenDayActivitys",method:"get",params:t})},o=function(t){return a({url:n+"/teacherVipGroup/createActivityVipGroup",method:"post",data:t})}},"51c7":function(t,e,s){},"541f":function(t,e,s){},"5a0c":function(t,e,s){!function(e,s){t.exports=s()}(0,function(){"use strict";var t="millisecond",e="second",s="minute",a="hour",n="day",i="week",r="month",o="quarter",u="year",c=/^(\d{4})-?(\d{1,2})?-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,l=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(t,e,s){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(s)+t},d={s:h,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),a=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+h(a,2,"0")+":"+h(n,2,"0")},m:function(t,e){var s=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(s,r),n=e-a<0,i=t.clone().add(s+(n?-1:1),r);return Number(-(s+(e-a)/(n?a-i:i-a))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:r,y:u,w:i,d:n,D:"date",h:a,m:s,s:e,ms:t,Q:o}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},f="en",p={};p[f]=m;var v=function(t){return t instanceof y},g=function(t,e,s){var a;if(!t)return f;if("string"==typeof t)p[t]&&(a=t),e&&(p[t]=e,a=t);else{var n=t.name;p[n]=t,a=n}return!s&&a&&(f=a),a||!s&&f},S=function(t,e){if(v(t))return t.clone();var s="object"==typeof e?e:{};return s.date=t,s.args=arguments,new y(s)},b=d;b.l=g,b.i=v,b.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var y=function(){function h(t){this.$L=this.$L||g(t.locale,null,!0),this.parse(t)}var d=h.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,s=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(c);if(a){var n=a[2]-1||0;return s?new Date(Date.UTC(a[1],n,a[3]||1,a[4]||0,a[5]||0,a[6]||0,a[7]||0)):new Date(a[1],n,a[3]||1,a[4]||0,a[5]||0,a[6]||0,a[7]||0)}}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return b},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var s=S(t);return this.startOf(e)<=s&&s<=this.endOf(e)},d.isAfter=function(t,e){return S(t)0),value:t.checkboxSelectDataList.length>0?"重新选择":"请选择上课学员","value-class":t.checkboxSelectDataList.length>0?"studentColor":null},on:{click:t.onCheckStudent}}),t.checkboxSelectDataList.length>0?a("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:"0.05rem 0",background:"#fafbff"}},t._l(t.checkboxSelectDataList,function(e,s){return a("p",{key:s,staticStyle:{color:"#323233"}},[t._v("\n "+t._s(e.username)+" - "+t._s(e.parentsPhone)+"\n ")])}),0):t._e(),a("van-field",{attrs:{label:"活动方案","input-align":"right",placeholder:"请选择活动方案",readonly:"","is-link":""},on:{click:function(e){return t.onSelect("vipGroupActivity")}},model:{value:t.formName.vipGroupActivityName,callback:function(e){t.$set(t.formName,"vipGroupActivityName",e)},expression:"formName.vipGroupActivityName"}}),a("div",{staticClass:"vip-title"},[t._v("课时组成")]),a("van-field",{attrs:{label:"课时总数","input-align":"right",placeholder:"请输入课时总数",readonly:"",value:t.loadData.vipGroupActivitySelect.maxCourseNum?t.loadData.vipGroupActivitySelect.maxCourseNum+"节":"0节"}}),a("van-field",{attrs:{label:"课程时长","input-align":"right",placeholder:"请选择课程时长",readonly:"","is-link":""},on:{click:t.onClickSingleClass},model:{value:t.form.singleClassMinutes,callback:function(e){t.$set(t.form,"singleClassMinutes",e)},expression:"form.singleClassMinutes"}}),t.statusList.hasOnline?a("van-field",{attrs:{label:"线上课","input-align":"right",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?a("van-field",{attrs:{label:"线下课","input-align":"right",placeholder:"请输入次数",type:"number"},on:{keyup:function(e){return t.onClassKeyUp("offLine")}},model:{value:t.form.offlineClassesNums,callback:function(e){t.$set(t.form,"offlineClassesNums",e)},expression:"form.offlineClassesNums"}}):t._e(),t.form.offlineClassesNums>0?a("van-field",{attrs:{label:"线下课地址",readonly:!0,"input-align":"right","is-link":"",placeholder:"请选择"},on:{click:function(e){return t.onSelect("teacherSchool")}},model:{value:t.formName.teacherSchoolName,callback:function(e){t.$set(t.formName,"teacherSchoolName",e)},expression:"formName.teacherSchoolName"}}):t._e(),a("van-field",{attrs:{label:"排课开始时间",readonly:!0,"input-align":"right","is-link":"",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,s){return a("van-cell",{key:s,attrs:{"title-class":"title-time"}},[a("template",{slot:"title"},[a("span",{staticClass:"online"},[t._v(t._s(e.type))]),a("span",{staticClass:"week"},[t._v(t._s(e.weekStr))]),a("span",{staticClass:"timer"},[t._v(t._s(e.startTime+"-"+e.endTime))])]),a("template",{slot:"default"},[a("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(s){return t.onScheduleRemove(e)}}},[t._v("删除")])],1)],2)}),a("div",{staticClass:"add-plan van-cell",on:{click:t.onCourseShedule}},[a("van-icon",{attrs:{name:"add-o"}}),t._v("课时安排\n ")],1),t.scheduleList.length>0?a("van-field",{attrs:{label:"排课列表",disabled:"","input-align":"right","is-link":""},on:{click:t.onShowTimeTable}}):t._e(),a("div",{staticStyle:{margin:"16px"}},[a("van-button",{attrs:{round:"",block:"",type:"info"},on:{click:t.onSubmit}},[t._v("确认排课")])],1)],2),a("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"}}),a("van-popup",{attrs:{position:"bottom"},model:{value:t.enlistForm.status,callback:function(e){t.$set(t.enlistForm,"status",e)},expression:"enlistForm.status"}},[a("van-datetime-picker",{attrs:{type:"date","min-date":t.enlistForm.minDate,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),a("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"}}),a("van-popup",{attrs:{position:"bottom"},model:{value:t.sheetForm.sheetStatus,callback:function(e){t.$set(t.sheetForm,"sheetStatus",e)},expression:"sheetForm.sheetStatus"}},[a("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),a("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[a("van-datetime-picker",{attrs:{type:"date","min-date":t.dataForm.minDate,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),a("van-popup",{attrs:{position:"bottom"},model:{value:t.courseForm.teachingStatus,callback:function(e){t.$set(t.courseForm,"teachingStatus",e)},expression:"courseForm.teachingStatus"}},[a("van-picker",{attrs:{columns:t.courseForm.columns,"show-toolbar":""},on:{cancel:function(e){t.courseForm.teachingStatus=!1},confirm:t.onTeachinConfirm}})],1),a("van-popup",{staticClass:"studentChiose",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"}},[t.statusList.studentStatus?a("div",[a("van-sticky",[a("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[a("div",{on:{click:t.onSearch}},[t._v("搜索")])]},proxy:!0}],null,!1,3446203101),model:{value:t.params.search,callback:function(e){t.$set(t.params,"search",e)},expression:"params.search"}})],1),a("div",{staticClass:"paddingB80"},[t.dataShow?a("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"}},[a("van-checkbox-group",{model:{value:t.checkboxSelect,callback:function(e){t.checkboxSelect=e},expression:"checkboxSelect"}},[a("van-cell-group",t._l(t.dataList,function(e,n){return a("van-cell",{key:n,staticClass:"input-cell",attrs:{center:!0},on:{click:function(s){return t.onCheckboxSelect(e)}}},[a("template",{slot:"icon"},[e.avatar?a("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):a("img",{staticClass:"logo",attrs:{src:s("a7ed"),alt:""}})]),a("template",{slot:"title"},[t._v("\n "+t._s(e.username)+"\n ")]),a("template",{slot:"label"},[a("span",[t._v(t._s(t.desensitPhone(e.parentsPhone)))])]),a("template",{slot:"default"},[a("van-checkbox",{attrs:{name:e.userId.toString()}})],1)],2)}),1)],1)],1):a("m-empty",{key:"data",staticClass:"empty",attrs:{msg:"暂无学生"}})],1),a("div",{staticClass:"button-group-popup"},[a("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),a("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确定")])])],1):t._e()]),a("van-popup",{attrs:{position:"bottom"},model:{value:t.statusList.classTime,callback:function(e){t.$set(t.statusList,"classTime",e)},expression:"statusList.classTime"}},[a("van-row",[a("van-col",{attrs:{span:"12"}},[t._v("上课类型")]),a("van-col",{attrs:{span:"12"}},[t._v("上课时间")])],1),a("div",{staticClass:"tableContainer"},t._l(t.timeTable,function(e,s){return a("van-row",{key:s},[a("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s("ONLINE"==e.teachMode?"线上":"线下")+"\n ")]),a("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s(e.classDate)+" "+t._s(e.startClassTimeStr)+"\n ")])],1)}),1)],1)],1)},n=[],i=s("a34a"),r=s.n(i),o=s("5a0c"),u=s.n(o),c=s("e3eb"),l=s.n(c),h=s("ff51"),d=s("9afb"),m=s("4198"),f=s("3908"),p=s("d678");function v(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,a)}return s}function g(t){for(var e=1;e0?(e.columns=s,e.index=this.formName[t+"Index"],e.loading=!1):this.onLoadingData(t),this.sheetForm.status=!0}else this.$toast("请选择上课学生");else this.$toast("请选择课程形式")},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"==t?"".concat(e,"日"):e},onLoadingData:function(){var t=y(r.a.mark(function t(){var e,s,a=this;return r.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.sheetForm,"subjectList"!=e.currentType){t.next=6;break}return t.next=4,Object(d["k"])().then(function(t){var s=t.data;if(200==s.code&&s.data.length>0){var n=[];s.data.forEach(function(t){t.value=t.id,t.text=t.name,n.push(t)}),a.loadData.subjectList=n,e.columns=n,e.loading=!1}else a.$toast("暂无科目列表"),e.loading=!1});case 4:t.next=7;break;case 6:"vipGroupCategory"==e.currentType?Object(d["bb"])().then(function(t){var s=t.data;if(200==s.code&&s.data.length>0){var n=[];s.data.forEach(function(t){"1v1"!=t.name&&"1v2"!=t.name||(t.value=t.id,t.text=t.name,n.push(t))}),a.loadData.vipGroupCategory=n,e.columns=n,e.loading=!1}else a.$toast("暂无课程形式"),e.loading=!1}):"vipGroupActivity"==e.currentType?(s=[],this.checkboxSelectDataList&&this.checkboxSelectDataList.length>0&&this.checkboxSelectDataList.forEach(function(t){s.push(t.userId)}),Object(m["b"])({categoryId:this.form.vipGroupCategoryId,studentIds:s.join(",")}).then(function(t){var s=t.data;if(200==s.code&&s.data.length>0){var n=[],i=new RegExp("双十一");s.data.forEach(function(t){i.test(t.name)||(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,n.push(t))}),a.loadData.vipGroupActivity=n,e.columns=n,e.loading=!1}else a.$toast("暂无活动方案"),e.loading=!1})):"teacherSchool"==e.currentType&&Object(d["n"])({userId:this.teacherId}).then(function(t){var s=t.data;if(200==s.code&&s.data.length>0){var n=[];s.data.forEach(function(t){t.value=t.id,t.text=t.name,n.push(t)}),a.loadData.teacherSchool=n,e.columns=n,e.loading=!1}else a.$toast("暂无教学点"),e.loading=!1});case 7:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onSheetConfirm:function(t,e){var s=this,a=this.sheetForm,n=this.form,i=this.formName,r=this.loadData;if("subjectList"==a.currentType)n.subjectIdList=t.value,i.subjectListName=t.text,i.subjectListIndex=e,r.subjectListSelect=t,this.dataList=[],this.params.search=null,this.loading=!1,this.finished=!1,this.dataShow=!0,this.params.page=1,this.checkboxSelect=[],this.checkboxSelectIds=[],this.checkboxSelectList=[],this.checkboxSelectDataList=[];else if("vipGroupCategory"==a.currentType){n.vipGroupCategoryId=t.value,i.vipGroupCategoryName=t.text,1==t.studentNum?this.activityCourseType="vip1":2==t.studentNum&&(this.activityCourseType="vip2"),i.vipGroupCategoryIndex=e,r.vipGroupCategorySelect=t,n.studentNum=t.studentNum,n.onlineClassesUnitPrice=Math.ceil(t.onlineClassesUnitPrice),n.offlineClassesUnitPrice=Math.ceil(t.offlineClassesUnitPrice),n.singleClassMinutes=null,r.classTimer=[];var o=t.singleClassMinutes.split(",");n.singleClassMinutes=o.length>0?o[0]:null,o.forEach(function(t){s.loadData.classTimer.push({name:t,value:t})}),this.dataList=[],this.params.search=null,this.loading=!1,this.finished=!1,this.dataShow=!0,this.params.page=1,this.checkboxSelect=[],this.checkboxSelectIds=[],this.checkboxSelectList=[],this.checkboxSelectDataList=[],n.vipGroupActivityId=null,i.vipGroupActivityName=null,i.vipGroupActivityIndex=0,r.vipGroupActivity=[],r.vipGroupActivitySelect=[],this.scheduleList=[],this.timeTable=[]}else"vipGroupActivity"==a.currentType?(n.vipGroupActivityId!=t.value&&(n.offlineClassesNums=null,n.onlineClassesNums=null),n.vipGroupActivityId=t.value,i.vipGroupActivityName=t.text,i.vipGroupActivityIndex=e,t.maxCourseNum<=0&&(t.maxCourseNum=0),r.vipGroupActivitySelect=t,n.onlineClassesUnitPrice=Math.ceil(r.vipGroupCategorySelect.onlineClassesUnitPrice),n.offlineClassesUnitPrice=Math.ceil(r.vipGroupCategorySelect.offlineClassesUnitPrice),this.onCalcClassTimes(t),this.setTimeTable()):"teacherSchool"==a.currentType&&(n.teacherSchoolId=t.value,i.teacherSchoolName=t.text,i.teacherSchoolIndex=e);a.sheetStatus=!1},onClassKeyUp:function(t){"offLine"==t&&this.form.offlineClassesNums<=0&&(this.form.teacherSchoolId=null,this.formName.teacherSchoolName=null,this.formName.teacherSchoolIndex=0);var e=this.loadData.vipGroupActivitySelect;this.onCalcClassTimes(e),this.setTimeTable()},onCalcClassTimes:function(t){var e=this.form,s=this.other,a=this.statusList,n=Number(e.onlineClassesNums)+Number(e.offlineClassesNums);if(t.salarySettlementJson){var i=JSON.parse(t.salarySettlementJson);i&&i.onlineSalarySettlement?a.hasOnline=!0:a.hasOnline=!1,i&&i.offlineSalarySettlement?a.hasOffline=!0:a.hasOffline=!1}"GIVE_CLASS"==t.type?(this.statusList.teachOnOrOff=!0,n>=Number(t.attribute1)?(e.totalClassTime=n+"+"+t.attribute2,s.giveNum=t.attribute2):(e.totalClassTime=n,s.giveNum=0)):(e.totalClassTime=n,s.giveNum=0,this.statusList.teachOnOrOff=!1)},onModeSelect:function(t){this.form.giveTeachMode=t.value,this.formName.giveTeachModeName=t.name,this.statusList.giveTeachModeStatus=!1},onClickSingleClass:function(){this.formName.vipGroupCategoryName?this.statusList.classTimerStatus=!0:this.$toast("请选择课程形式")},onClassTimerSelect:function(t){this.form.singleClassMinutes!=t.value&&(this.timeTable=[],this.scheduleList=[]),this.form.singleClassMinutes=t.value,this.statusList.classTimerStatus=!1},onCurrentConfirm:function(t){var e=new Date(t),s=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),a=e.getDate()>=10?e.getDate():"0"+e.getDate();this.form.courseStart=e.getFullYear()+"-"+s+"-"+a,this.dataForm.status=!1},onEnlistConfirm:function(t){var e=new Date(t),s=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),a=e.getDate()>=10?e.getDate():"0"+e.getDate(),n=this.enlistForm,i=this.form;if("start"==n.updateStatus){if(i.registrationStartTime=e.getFullYear()+"-"+s+"-"+a,i.coursesExpireDate){var r=new Date(i.registrationStartTime.replace(/-/gi,"/")).getTime(),o=new Date(i.coursesExpireDate.replace(/-/gi,"/")).getTime();r>o&&(i.coursesExpireDate=null)}}else"end"==n.updateStatus&&(i.coursesExpireDate=e.getFullYear()+"-"+s+"-"+a);n.status=!1},onEnListShow:function(t,e){var s=this.enlistForm;"end"==t?this.form.registrationStartTime?s.minDate=new Date(this.form.registrationStartTime.replace(/-/gi,"/")):s.minDate=new Date:"start"==t&&(s.minDate=new Date),s.currentDate=e?new Date(e.replace(/-/gi,"/")):new Date,s.updateStatus=t,s.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,s=this.scheduleList,a=(t[2]>=10?t[2]:"0"+t[2])+":"+t[3].split("分")[0],n=this.MinutesTest(t[2],t[3],this.form.singleClassMinutes),i=!0;s.forEach(function(s){var r=e.timeIsrange(a,n,s.startTime),o=e.timeIsrange(a,n,s.endTime);i&&(t[1]==s.weekStr?i=!r&&!o:t[1]!=s.weekStr&&(i=!0))}),i?(s.push({type:t[0],weekStr:t[1],weekIndex:this.getWeek(t[1]),startTime:a,endTime:n,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 t=this.form,e=this.scheduleList,s=parseInt(t.onlineClassesNums?t.onlineClassesNums:0),a=parseInt(t.offlineClassesNums?t.offlineClassesNums:0),n=parseInt(this.other.giveNum),i=t.giveTeachMode;if("ONLINE"==i?s+=n:"OFFLINE"==i&&(a+=n),!(e.length<=0)){var r=Number(s)+Number(a),o=t.courseStart.replace(/-/gi,"/"),c=new Date(o),l=0;while(r&&r>0){for(var h=0;h0&&0==d&&0==h&&(d+=7),d<0&&(d+=7);var m=this.getThinkDate(c,d),f=(new Date).getTime(),p=new Date(m.replace(/-/gi,"/")+" "+e[h].startTime+":00").getTime();if(f0?(v.teachMode="ONLINE",this.timeTable.push(v),s--,r--):"线下"==e[h].type&&a>0&&(v.teachMode="OFFLINE",this.timeTable.push(v),a--,r--)}}1==e.length?c.setDate(c.getDate()+7):e.every(function(t){return t.weekStr===e[0].weekStr})&&l++}this.timeTable.sort(function(t,e){var s=u()(u()(t.classDate).format("YYYY-MM-DD")+" "+t.startClassTimeStr+":00").valueOf(),a=u()(u()(e.classDate).format("YYYY-MM-DD")+" "+e.startClassTimeStr+":00").valueOf();return s-a})}}},onGiveMode:function(){this.statusList.giveTeachModeStatus=!0},getCalcClass:function(){var t=this.loadData,e=this.form,s=t.vipGroupActivitySelect,a=t.teacherCategory,n=e.onlineClassesNums?e.onlineClassesNums:0,i=e.offlineClassesNums?e.offlineClassesNums:0,r=parseInt(this.other.giveNum),o=e.giveTeachMode;if(s.salarySettlementJson){var u=JSON.parse(s.salarySettlementJson),c=0;if(Number(n)+Number(i)>0){var l=n*e.onlineClassesUnitPrice+i*e.offlineClassesUnitPrice;r>0&&!o&&(l=0),c=l*e.studentNum/(Number(n)+Number(i)+Number(r)),"DISCOUNT"==s.type&&(c=c*(s.attribute1?Number(s.attribute1):100)/100)}if(u&&u.onlineSalarySettlement){var h=u.onlineSalarySettlement;"TEACHER_DEFAULT"==h.salarySettlementType?e.onlineTeacherSalary=Math.round(a.offlineClassesSalary):"RATIO_DISCOUNT"==h.salarySettlementType?e.onlineTeacherSalary=Math.round(c?c*(h.settlementValue?h.settlementValue:100)/100:0):"FIXED_SALARY"==h.salarySettlementType&&(e.onlineTeacherSalary=Math.round(h.settlementValue)),e.onlineTeacherSalary=Number(e.onlineTeacherSalary)}else e.onlineTeacherSalary=Math.round(a.offlineClassesSalary);if(u&&u.offlineSalarySettlement){var d=u.offlineSalarySettlement;"TEACHER_DEFAULT"==d.salarySettlementType?e.offlineTeacherSalary=Math.round(a.offlineClassesSalary):"RATIO_DISCOUNT"==d.salarySettlementType?e.offlineTeacherSalary=Math.round(c?c*(d.settlementValue?d.settlementValue:100)/100:0):"FIXED_SALARY"==d.salarySettlementType&&(e.offlineTeacherSalary=Math.round(d.settlementValue)),e.offlineTeacherSalary=Number(e.offlineTeacherSalary)}else e.offlineTeacherSalary=Math.round(a.offlineClassesSalary)}"GIVE_CLASS"==s.type||"BASE_ACTIVITY"==s.type?e.totalCount=Math.round(n*e.onlineClassesUnitPrice+i*e.offlineClassesUnitPrice):"DISCOUNT"==s.type&&(e.totalCount=Math.round((n*e.onlineClassesUnitPrice+i*e.offlineClassesUnitPrice)*Number(s.attribute1)/100)),e.totalCount=Number(e.totalCount)},getThinkDate:function(t,e){var s=t;s.setDate(t.getDate()+e);var a=s.getFullYear(),n=s.getMonth()+1,i="";i=n<10?"0"+n:n+"";var r=s.getDate(),o="";return o=r<10?"0"+r:r+"",a+"-"+i+"-"+o},MinutesTest:function(t,e,s){var a=e.split("分")[0],n=new Date(1900,1,1,t,a);n.setMinutes(n.getMinutes()+parseInt(s));var i=n.getHours(),r=n.getMinutes();return i<10&&(i="0"+i),r<10&&(r="0"+r),i+":"+r},timeIsrange:function(t,e,s){var a=t.split(":");if(2!=a.length)return!1;var n=e.split(":");if(2!=n.length)return!1;var i=s.split(":");if(2!=n.length)return!1;var r=new Date,o=new Date,u=new Date;return r.setHours(a[0]),r.setMinutes(a[1]),o.setHours(n[0]),o.setMinutes(n[1]),u.setHours(i[0]),u.setMinutes(i[1]),u.getTime()-r.getTime()>=0&&u.getTime()-o.getTime()<=0},getWeek:function(t){var e={"周一":1,"周二":2,"周三":3,"周四":4,"周五":5,"周六":6,"周日":0};return e[t]},onSubmit:function(){var t=y(r.a.mark(function t(){var e,s,a,n,i,o,u,c=this;return r.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.form,s=this.statusList,e.subjectIdList){t.next=5;break}return this.$toast("请选择课程声部"),t.abrupt("return",!1);case 5:if(e.vipGroupCategoryId){t.next=8;break}return this.$toast("请选择课程形式"),t.abrupt("return",!1);case 8:if(!(this.checkboxSelectIds.length<=0)){t.next=11;break}return this.$toast("请选择上课学生"),t.abrupt("return");case 11:if(e.vipGroupActivityId){t.next=14;break}return this.$toast("请选择活动方案"),t.abrupt("return",!1);case 14:if(e.singleClassMinutes){t.next=17;break}return this.$toast("请选择每课时长"),t.abrupt("return",!1);case 17:if(a=!e.onlineClassesNums&&e.onlineClassesNums<=0,n=!e.offlineClassesNums&&e.offlineClassesNums<=0,!s.hasOnline){t.next=23;break}if(!a){t.next=23;break}return this.$toast("请输入线上课次数"),t.abrupt("return",!1);case 23:if(!s.hasOffline){t.next=30;break}if(!n){t.next=27;break}return this.$toast("请输入线下课次数"),t.abrupt("return",!1);case 27:if(!(e.offlineClassesNums>0)||e.teacherSchoolId){t.next=30;break}return this.$toast("请选择线下课地址"),t.abrupt("return",!1);case 30:if(i=this.loadData.vipGroupActivitySelect,"GIVE_CLASS"!=i.type||e.giveTeachMode){t.next=34;break}return this.$toast("请选择赠课类型"),t.abrupt("return",!1);case 34:if(!(this.scheduleList.length<=0)){t.next=37;break}return this.$toast("课时安排不能为空"),t.abrupt("return",!1);case 37:if(!(i.maxCourseNum>0)){t.next=42;break}if(o=parseInt(e.onlineClassesNums)+parseInt(e.offlineClassesNums),o==i.maxCourseNum){t.next=42;break}return this.$toast("课时总数为".concat(i.maxCourseNum,"节")),t.abrupt("return");case 42:if(!(i.maxCourseNum<=0)){t.next=45;break}return this.$toast("当前选择活动有误,请选择其它活动"),t.abrupt("return");case 45:if(this.checkCourseList()){t.next=47;break}return t.abrupt("return");case 47:if(this.setTimeTable(),"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(","),e.firstStudentId=this.checkboxSelectDataList.length>0?this.checkboxSelectDataList[0].userId:null,u={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:g({},e,{userId:this.teacherId,activityCourseType:this.activityCourseType})},this.onSubmitStatus){t.next=56;break}return t.abrupt("return");case 56:return this.onSubmitStatus=!1,Object(f["a"])(!0),t.next=60,Object(m["a"])(u).then(function(t){var e=t.data;Object(f["a"])(!1),200==e.code?(c.$toast("申请成功"),setTimeout(function(){c.onSubmitStatus=!0,Object(h["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(h["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):c.$router.push("/business")},500)):(c.onSubmitStatus=!0,c.$toast(e.msg))}).catch(function(){c.onSubmitStatus=!0,Object(f["a"])(!1)});case 60:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),checkCourseList:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.form,s=this.scheduleList||[],a=!1,n=!1;s.forEach(function(t){"线上"==t.type&&(a=!0),"线下"==t.type&&(n=!0)});var i=this.statusList,r=!e.onlineClassesNums&&e.onlineClassesNums<=0,o=!e.offlineClassesNums&&e.offlineClassesNums<=0;if(i.hasOnline){if(r)return t&&this.$toast("请输入线上课次数"),!1;if(!r&&!a&&e.onlineClassesNums>0)return t&&this.$toast("课时安排缺少线上课类型"),!1}if(i.hasOffline){if(o)return t&&this.$toast("请输入线下课次数"),!1;if(!o&&!n&&e.offlineClassesNums>0)return t&&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 t=this,e=this.params;Object(m["c"])(l()(g({},e,{activityCourseType:this.activityCourseType,subjectId:this.form.subjectIdList}))).then(function(s){var a=s.data;if(t.loading=!1,200==a.code){if(t.dataList.length>0&&1==a.data.pageNo)return;e.page=a.data.pageNo,t.dataList=t.dataList.concat(a.data.rows),e.page>=a.data.totalPage&&(t.finished=!0),t.params.page++}else t.finished=!0;t.dataList.length<=0&&(t.dataShow=!1)})},onPopupCancel:function(){this.statusList.studentStatus=!1,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.loadData.vipGroupActivity=[],this.formName.vipGroupActivityName=null,this.formName.vipGroupCategoryIndex=0,this.form.vipGroupActivityId=null,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(s,a){s==t.userId.toString()&&e.checkboxSelect.splice(a,1)}),this.checkboxSelectList.forEach(function(s,a){s.userId==t.userId&&e.checkboxSelectList.splice(a,1)})):(this.checkboxSelect.push(t.userId.toString()),this.checkboxSelectList.push(t))},desensitPhone:function(t){var e=t.substr(0,3),s=t.substr(-4);return e+"****"+s}}},L=T,D=(s("9323"),s("2877")),N=Object(D["a"])(L,a,n,!1,null,"2a59c36c",null);e["a"]=N.exports}}]);