(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["VIPApply~applyActive"],{"26a8":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"vipCourse"},[r("div",[r("div",{staticClass:"vip-title"},[t._v("课程信息")]),r("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"}}),r("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"}}),r("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?r("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:"0.05rem 0",background:"#fafbff"}},t._l(t.checkboxSelectDataList,(function(e,n){return r("p",{key:n,staticStyle:{color:"#323233"}},[t._v("\n "+t._s(e.username)+" - "+t._s(e.parentsPhone)+"\n ")])})),0):t._e(),r("div",{staticClass:"vip-title"},[t._v("课时组成")]),r("van-field",{attrs:{label:"课时总数","input-align":"right",placeholder:"输选择课时总数",readonly:"",value:"10节"}}),r("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"}}),r("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,n){return r("van-cell",{key:n,attrs:{"title-class":"title-time"}},[r("template",{slot:"title"},[r("span",{staticClass:"online"},[t._v(t._s(e.type))]),r("span",{staticClass:"week"},[t._v(t._s(e.weekStr))]),r("span",{staticClass:"timer"},[t._v(t._s(e.startTime+"-"+e.endTime))])]),r("template",{slot:"default"},[r("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(n){return t.onScheduleRemove(e)}}},[t._v("删除")])],1)],2)})),r("div",{staticClass:"add-plan van-cell",on:{click:t.onCourseSchedule}},[r("van-icon",{attrs:{name:"add-o"}}),t._v("课时安排\n ")],1),t.scheduleList.length>0?r("van-field",{attrs:{label:"排课列表",readonly:"","input-align":"right","is-link":""},on:{click:t.onShowTimeTable}}):t._e(),r("div",{staticStyle:{margin:"16px"}},[r("van-button",{attrs:{round:"",block:"",type:"info"},on:{click:t.onSubmit}},[t._v("确认排课")])],1)],2),r("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"}}),r("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[r("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),r("van-popup",{attrs:{position:"bottom"},model:{value:t.sheetForm.sheetStatus,callback:function(e){t.$set(t.sheetForm,"sheetStatus",e)},expression:"sheetForm.sheetStatus"}},[r("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),r("van-popup",{attrs:{position:"bottom"},model:{value:t.courseForm.teachingStatus,callback:function(e){t.$set(t.courseForm,"teachingStatus",e)},expression:"courseForm.teachingStatus"}},[r("van-picker",{attrs:{columns:t.courseForm.columns,"show-toolbar":""},on:{cancel:function(e){t.courseForm.teachingStatus=!1},confirm:t.onTeachinConfirm}})],1),r("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?r("div",[r("van-sticky",[r("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[r("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),r("div",{staticClass:"paddingB80"},[t.dataShow?r("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"}},[r("van-checkbox-group",{model:{value:t.checkboxSelect,callback:function(e){t.checkboxSelect=e},expression:"checkboxSelect"}},[r("van-cell-group",t._l(t.dataList,(function(e,a){return r("van-cell",{key:a,staticClass:"input-cell",attrs:{center:!0},on:{click:function(n){return t.onCheckboxSelect(e)}}},[r("template",{slot:"icon"},[e.avatar?r("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):r("img",{staticClass:"logo",attrs:{src:n("a7ed"),alt:""}})]),r("template",{slot:"title"},[t._v("\n "+t._s(e.username)+"\n ")]),r("template",{slot:"label"},[r("span",[t._v(t._s(t.desensitPhone(e.parentsPhone)))])]),r("template",{slot:"default"},[r("van-checkbox",{attrs:{name:e.userId.toString()}})],1)],2)})),1)],1)],1):r("m-empty",{key:"data",staticClass:"empty",attrs:{msg:"暂无学生"}})],1),r("div",{staticClass:"button-group-popup"},[r("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),r("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确定")])])],1):t._e()]),r("van-popup",{attrs:{position:"bottom"},model:{value:t.statusList.classTime,callback:function(e){t.$set(t.statusList,"classTime",e)},expression:"statusList.classTime"}},[r("van-row",[r("van-col",{attrs:{span:"12"}},[t._v("上课类型")]),r("van-col",{attrs:{span:"12"}},[t._v("上课时间")])],1),r("div",{staticClass:"tableContainer"},t._l(t.timeTable,(function(e,n){return r("van-row",{key:n},[r("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s("ONLINE"==e.teachMode?"线上":"线下")+"\n ")]),r("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s(e.classDate)+" "+t._s(e.startClassTimeStr)+"\n ")])],1)})),1)],1)],1)},a=[],s=n("5a0c"),i=n.n(s),o=n("3908"),u=n("ff51"),c=n("9afb"),l=n("4198"),h=n("e3eb"),f=n.n(h),d=n("d678");function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function o(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(D){o=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var a=e&&e.prototype instanceof h?e:h,s=Object.create(a.prototype),i=new T(r||[]);return s._invoke=function(t,e,n){var r="suspendedStart";return function(a,s){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw s;return N()}for(n.method=a,n.arg=s;;){var i=n.delegate;if(i){var o=C(i,n);if(o){if(o===l)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),s}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(D){return{type:"throw",arg:D}}}t.wrap=u;var l={};function h(){}function f(){}function d(){}var v={};o(v,a,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(w([])));y&&y!==e&&n.call(y,a)&&(v=y);var b=d.prototype=h.prototype=Object.create(v);function S(t){["next","throw","return"].forEach((function(e){o(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(a,s,i,o){var u=c(t[a],t,s);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==p(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,i,o)}),(function(t){r("throw",t,i,o)})):e.resolve(h).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,o)}))}o(u.arg)}var a;this._invoke=function(t,n){function s(){return new e((function(e,a){r(t,n,e,a)}))}return a=a?a.then(s,s):s()}}function C(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function w(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r=0;--a){var s=this.tryEntries[a],i=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var o=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(o&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e0?this.checkboxSelectDataList[0].userId:null,n={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:g(g({},e),{},{userId:this.teacherId,activityCourseType:"music_theory"})},Object(o["a"])(!0),t.next=22,Object(l["a"])(n).then((function(t){var e=t.data;Object(o["a"])(!1),200==e.code?(r.$toast("申请成功"),setTimeout((function(){r.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"})):r.$router.push("/business")}),500)):r.$toast(e.msg)})).catch((function(){Object(o["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,n=10,r=0;if(!(e.length<=0)){var a=Number(n)+Number(r),s=t.courseStart.replace(/-/gi,"/"),o=new Date(s),u=0;while(a&&a>0){for(var c=0;c0&&0==l&&0==c&&(l+=7),l<0&&(l+=7);var h=this.getThinkDate(o,l),f=(new Date).getTime(),d=new Date(h.replace(/-/gi,"/")+" "+e[c].startTime+":00").getTime();if(f0?(p.teachMode="ONLINE",this.timeTable.push(p),n--,a--):"线下"==e[c].type&&r>0&&(p.teachMode="OFFLINE",this.timeTable.push(p),r--,a--)}}1==e.length?o.setDate(o.getDate()+7):e.every((function(t){return t.weekStr===e[0].weekStr}))&&u++}this.timeTable.sort((function(t,e){var n=i()(i()(t.classDate).format("YYYY-MM-DD")+" "+t.startClassTimeStr+":00").valueOf(),r=i()(i()(e.classDate).format("YYYY-MM-DD")+" "+e.startClassTimeStr+":00").valueOf();return n-r}))}}},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 n=t;n.setDate(t.getDate()+e);var r=n.getFullYear(),a=n.getMonth()+1,s="";s=a<10?"0"+a:a+"";var i=n.getDate(),o="";return o=i<10?"0"+i:i+"",r+"-"+s+"-"+o},onTeachinConfirm:function(t){var e=this,n=this.scheduleList,r=(t[2]>=10?t[2]:"0"+t[2])+":"+t[3].split("分")[0],a=this.MinutesTest(t[2],t[3],this.form.singleClassMinutes),s=!0;n.forEach((function(n){var i=e.timeIsrange(r,a,n.startTime),o=e.timeIsrange(r,a,n.endTime);s&&(t[1]==n.weekStr?s=!i&&!o:t[1]!=n.weekStr&&(s=!0))}));var i=a?Number(a.split(":")[0]):0,o=a?Number(a.split(":")[1]):0;i>=21&&o>0?this.$toast("课程安排结束时间不可超过21:00"):s?(n.push({type:t[0],weekStr:t[1],weekIndex:this.getWeek(t[1]),startTime:r,endTime:a,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||[],n=!1;return e.forEach((function(t){"线上"==t.type&&(n=!0)})),!!n||(t&&this.$toast("课时安排缺少线上课类型"),!1)},MinutesTest:function(t,e,n){var r=e.split("分")[0],a=new Date(1900,1,1,t,r);a.setMinutes(a.getMinutes()+parseInt(n));var s=a.getHours(),i=a.getMinutes();return s<10&&(s="0"+s),i<10&&(i="0"+i),s+":"+i},timeIsrange:function(t,e,n){var r=t.split(":");if(2!=r.length)return!1;var a=e.split(":");if(2!=a.length)return!1;var s=n.split(":");if(2!=a.length)return!1;var i=new Date,o=new Date,u=new Date;return i.setHours(r[0]),i.setMinutes(r[1]),o.setHours(a[0]),o.setMinutes(a[1]),u.setHours(s[0]),u.setMinutes(s[1]),u.getTime()-i.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=S(m().mark((function t(){var e,n=this;return m().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=this.params,t.next=3,Object(l["c"])(f()(g(g({},e),{},{activityCourseType:"music_theory"}))).then((function(t){var r=t.data;if(n.loading=!1,200==r.code){if(n.dataList.length>0&&1==r.data.pageNo)return;e.page=r.data.pageNo,n.dataList=n.dataList.concat(r.data.rows),e.page>=r.data.totalPage&&(n.finished=!0),n.params.page++}else n.finished=!0;n.dataList.length<=0&&(n.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(n,r){n==t.userId.toString()&&e.checkboxSelect.splice(r,1)})),this.checkboxSelectList.forEach((function(n,r){n.userId==t.userId&&e.checkboxSelectList.splice(r,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 n=this.loadData[t];n&&n.length>0?(e.columns=n,e.index=this.formName[t+"Index"],e.loading=!1):this.onLoadingData(t),this.sheetForm.status=!0},onLoadingData:function(){var t=S(m().mark((function t(){var e,n=this;return m().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(c["k"])().then((function(t){var r=t.data;if(200==r.code&&r.data.length>0){var a=[];r.data.forEach((function(t){t.value=t.id,t.text=t.name,a.push(t)})),n.loadData.subjectList=a,e.columns=a,e.loading=!1}else n.$toast("暂无科目列表"),e.loading=!1}));case 4:t.next=7;break;case 6:"vipGroupCategory"==e.currentType&&Object(c["bb"])({includeMusicTheory:1}).then((function(t){var r=t.data;if(200==r.code&&r.data.length>0){var a=[];r.data.forEach((function(t){t.musicTheory&&(t.value=t.id,t.text=t.name,a.push(t))})),(!a||a.length<=0)&&n.$toast("暂无课程形式"),n.loadData.vipGroupCategory=a,e.columns=a,e.loading=!1}else n.$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 n=this,r=this.sheetForm,a=this.form,s=this.formName,i=this.loadData;if("subjectList"==r.currentType)a.subjectIdList=t.value,s.subjectListName=t.text,s.subjectListIndex=e,i.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"==r.currentType){a.vipGroupCategoryId=t.value,s.vipGroupCategoryName=t.text,s.vipGroupCategoryIndex=e,i.vipGroupCategorySelect=t,a.studentNum=t.studentNum,a.onlineClassesUnitPrice=Math.ceil(t.onlineClassesUnitPrice),a.offlineClassesUnitPrice=Math.ceil(t.offlineClassesUnitPrice),a.singleClassMinutes=null,i.classTimer=[];var o=t.singleClassMinutes.split(",");a.singleClassMinutes=o.length>0?o[0]:null,o.forEach((function(t){n.loadData.classTimer.push({name:t,value:t})})),this.scheduleList=[],this.timeTable=[]}r.sheetStatus=!1},onCurrentConfirm:function(t){var e=new Date(t),n=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),r=e.getDate()>=10?e.getDate():"0"+e.getDate();this.form.courseStart=e.getFullYear()+"-"+n+"-"+r,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),n=t.substr(-4);return e+"****"+n}}},T=L,w=(n("4896"),n("2877")),N=Object(w["a"])(T,r,a,!1,null,"06fee1d0",null);e["a"]=N.exports},4198:function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return i}));var r=n("981f").default,a="/api-teacher",s=function(t){return r({url:a+"/teacherVipGroup/queryChildrenDayStudentList",method:"get",params:t})},i=function(t){return r({url:a+"/vipGroupActivity/getChildrenDayActivitys",method:"get",params:t})},o=function(t){return r({url:a+"/teacherVipGroup/createActivityVipGroup",method:"post",data:t})}},4896:function(t,e,n){"use strict";n("4c3f")},"4c3f":function(t,e,n){},"5a0c":function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",a="second",s="minute",i="hour",o="day",u="week",c="month",l="quarter",h="year",f="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,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,v={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("_")},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},y={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),a=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(a,2,"0")},m:function t(e,n){if(e.date()1)return t(i[0])}else{var o=e.name;S[o]=e,a=o}return!r&&a&&(b=a),a||!r&&b},x=function(t,e){if(k(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new T(n)},L=y;L.l=C,L.i=k,L.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var T=function(){function v(t){this.$L=C(t.locale,null,!0),this.parse(t)}var g=v.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(L.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var a=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},g.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()},g.$utils=function(){return L},g.isValid=function(){return!(this.$d.toString()===d)},g.isSame=function(t,e){var n=x(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return x(t)0),value:t.checkboxSelectDataList.length>0?"重新选择":"请选择上课学员","value-class":t.checkboxSelectDataList.length>0?"studentColor":null},on:{click:t.onCheckStudent}}),t.checkboxSelectDataList.length>0?r("div",{staticStyle:{"text-align":"center","line-height":"1.8",padding:"0.05rem 0",background:"#fafbff"}},t._l(t.checkboxSelectDataList,(function(e,n){return r("p",{key:n,staticStyle:{color:"#323233"}},[t._v("\n "+t._s(e.username)+" - "+t._s(e.parentsPhone)+"\n ")])})),0):t._e(),r("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"}}),r("div",{staticClass:"vip-title"},[t._v("课时组成")]),r("van-field",{attrs:{label:"课时总数","input-align":"right",placeholder:"请输入课时总数",readonly:"",value:t.loadData.vipGroupActivitySelect.maxCourseNum?t.loadData.vipGroupActivitySelect.maxCourseNum+"节":"0节"}}),r("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?r("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?r("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?r("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(),r("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,n){return r("van-cell",{key:n,attrs:{"title-class":"title-time"}},[r("template",{slot:"title"},[r("span",{staticClass:"online"},[t._v(t._s(e.type))]),r("span",{staticClass:"week"},[t._v(t._s(e.weekStr))]),r("span",{staticClass:"timer"},[t._v(t._s(e.startTime+"-"+e.endTime))])]),r("template",{slot:"default"},[r("van-button",{attrs:{type:"warning",round:"",size:"small",plain:""},on:{click:function(n){return t.onScheduleRemove(e)}}},[t._v("删除")])],1)],2)})),r("div",{staticClass:"add-plan van-cell",on:{click:t.onCourseShedule}},[r("van-icon",{attrs:{name:"add-o"}}),t._v("课时安排\n ")],1),t.scheduleList.length>0?r("van-field",{attrs:{label:"排课列表",disabled:"","input-align":"right","is-link":""},on:{click:t.onShowTimeTable}}):t._e(),r("div",{staticStyle:{margin:"16px"}},[r("van-button",{attrs:{round:"",block:"",type:"info"},on:{click:t.onSubmit}},[t._v("确认排课")])],1)],2),r("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"}}),r("van-popup",{attrs:{position:"bottom"},model:{value:t.enlistForm.status,callback:function(e){t.$set(t.enlistForm,"status",e)},expression:"enlistForm.status"}},[r("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),r("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"}}),r("van-popup",{attrs:{position:"bottom"},model:{value:t.sheetForm.sheetStatus,callback:function(e){t.$set(t.sheetForm,"sheetStatus",e)},expression:"sheetForm.sheetStatus"}},[r("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),r("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[r("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),r("van-popup",{attrs:{position:"bottom"},model:{value:t.courseForm.teachingStatus,callback:function(e){t.$set(t.courseForm,"teachingStatus",e)},expression:"courseForm.teachingStatus"}},[r("van-picker",{attrs:{columns:t.courseForm.columns,"show-toolbar":""},on:{cancel:function(e){t.courseForm.teachingStatus=!1},confirm:t.onTeachinConfirm}})],1),r("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?r("div",[r("van-sticky",[r("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[r("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),r("div",{staticClass:"paddingB80"},[t.dataShow?r("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"}},[r("van-checkbox-group",{model:{value:t.checkboxSelect,callback:function(e){t.checkboxSelect=e},expression:"checkboxSelect"}},[r("van-cell-group",t._l(t.dataList,(function(e,a){return r("van-cell",{key:a,staticClass:"input-cell",attrs:{center:!0},on:{click:function(n){return t.onCheckboxSelect(e)}}},[r("template",{slot:"icon"},[e.avatar?r("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):r("img",{staticClass:"logo",attrs:{src:n("a7ed"),alt:""}})]),r("template",{slot:"title"},[t._v("\n "+t._s(e.username)+"\n ")]),r("template",{slot:"label"},[r("span",[t._v(t._s(t.desensitPhone(e.parentsPhone)))])]),r("template",{slot:"default"},[r("van-checkbox",{attrs:{name:e.userId.toString()}})],1)],2)})),1)],1)],1):r("m-empty",{key:"data",staticClass:"empty",attrs:{msg:"暂无学生"}})],1),r("div",{staticClass:"button-group-popup"},[r("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),r("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确定")])])],1):t._e()]),r("van-popup",{attrs:{position:"bottom"},model:{value:t.statusList.classTime,callback:function(e){t.$set(t.statusList,"classTime",e)},expression:"statusList.classTime"}},[r("van-row",[r("van-col",{attrs:{span:"12"}},[t._v("上课类型")]),r("van-col",{attrs:{span:"12"}},[t._v("上课时间")])],1),r("div",{staticClass:"tableContainer"},t._l(t.timeTable,(function(e,n){return r("van-row",{key:n},[r("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s("ONLINE"==e.teachMode?"线上":"线下")+"\n ")]),r("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s(e.classDate)+" "+t._s(e.startClassTimeStr)+"\n ")])],1)})),1)],1)],1)},a=[],s=n("5a0c"),i=n.n(s),o=n("e3eb"),u=n.n(o),c=n("ff51"),l=n("9afb"),h=n("4198"),f=n("3908"),d=n("d678");function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e=0;--a){var s=this.tryEntries[a],i=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var o=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(o&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function b(t,e,n,r,a,s,i){try{var o=t[s](i),u=o.value}catch(c){return void n(c)}o.done?e(u):Promise.resolve(u).then(r,a)}function S(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function i(t){b(s,r,a,i,o,"next",t)}function o(t){b(s,r,a,i,o,"throw",t)}i(void 0)}))}}for(var k=[],C=0;C<60;C++){var x=C<10?"0"+C:C;k.push(x+"分")}var L={components:{MEmpty:d["a"]},name:"apply",data:function(){return{dayjs:i.a,activityCourseType:null,subjectId:null,dataForm:{status:!1,minDate:new Date,currentDate:new Date},enlistForm:{updateStatus:"",status:!1,minDate:new Date,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],className:"hours",defaultIndex:7},{values:k,className:"minutes"}]},form:{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},other:{onlineSalary:null,offlineSalary:null,giveNum:0},scheduleList:[],timeTable:[],onSubmitStatus:!0,checkboxSelect:[],checkboxSelectIds:[],checkboxSelectList:[],checkboxSelectDataList:[],loading:!1,finished:!1,params:{search:null,page:1,rows:20},dataShow:!0,dataList:[]}},mounted:function(){var t=S(y().mark((function t(){return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),watch:{"form.singleClassMinutes":function(){this.scheduleList=[]}},methods:{onCheckStudent:function(){this.form.subjectIdList?this.form.vipGroupCategoryId?this.statusList.studentStatus=!0:this.$toast("请选择课程形式"):this.$toast("请选择课程声部")},onSelect:function(t){var e=this.sheetForm;if(e.columns=[],this.form.vipGroupCategoryId||"vipGroupActivity"!=t)if(this.checkboxSelectDataList&&!(this.checkboxSelectDataList&&this.checkboxSelectDataList.length<=0)||"vipGroupActivity"!=t){e.sheetStatus=!0,e.loading=!0,e.currentType=t,e.index=0;var n=this.loadData[t];n&&n.length>0?(e.columns=n,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=S(y().mark((function t(){var e,n,r=this;return y().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(l["k"])().then((function(t){var n=t.data;if(200==n.code&&n.data.length>0){var a=[];n.data.forEach((function(t){t.value=t.id,t.text=t.name,a.push(t)})),r.loadData.subjectList=a,e.columns=a,e.loading=!1}else r.$toast("暂无科目列表"),e.loading=!1}));case 4:t.next=7;break;case 6:"vipGroupCategory"==e.currentType?Object(l["bb"])().then((function(t){var n=t.data;if(200==n.code&&n.data.length>0){var a=[];n.data.forEach((function(t){"1v1"!=t.name&&"1v2"!=t.name||(t.value=t.id,t.text=t.name,a.push(t))})),r.loadData.vipGroupCategory=a,e.columns=a,e.loading=!1}else r.$toast("暂无课程形式"),e.loading=!1})):"vipGroupActivity"==e.currentType?(n=[],this.checkboxSelectDataList&&this.checkboxSelectDataList.length>0&&this.checkboxSelectDataList.forEach((function(t){n.push(t.userId)})),Object(h["b"])({categoryId:this.form.vipGroupCategoryId,studentIds:n.join(",")}).then((function(t){var n=t.data;if(200==n.code&&n.data.length>0){var a=[],s=new RegExp("双十一");n.data.forEach((function(t){s.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,a.push(t))})),r.loadData.vipGroupActivity=a,e.columns=a,e.loading=!1}else r.$toast("暂无活动方案"),e.loading=!1}))):"teacherSchool"==e.currentType&&Object(l["n"])({userId:this.teacherId}).then((function(t){var n=t.data;if(200==n.code&&n.data.length>0){var a=[];n.data.forEach((function(t){t.value=t.id,t.text=t.name,a.push(t)})),r.loadData.teacherSchool=a,e.columns=a,e.loading=!1}else r.$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 n=this,r=this.sheetForm,a=this.form,s=this.formName,i=this.loadData;if("subjectList"==r.currentType)a.subjectIdList=t.value,s.subjectListName=t.text,s.subjectListIndex=e,i.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"==r.currentType){a.vipGroupCategoryId=t.value,s.vipGroupCategoryName=t.text,1==t.studentNum?this.activityCourseType="vip1":2==t.studentNum&&(this.activityCourseType="vip2"),s.vipGroupCategoryIndex=e,i.vipGroupCategorySelect=t,a.studentNum=t.studentNum,a.onlineClassesUnitPrice=Math.ceil(t.onlineClassesUnitPrice),a.offlineClassesUnitPrice=Math.ceil(t.offlineClassesUnitPrice),a.singleClassMinutes=null,i.classTimer=[];var o=t.singleClassMinutes.split(",");a.singleClassMinutes=o.length>0?o[0]:null,o.forEach((function(t){n.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=[],a.vipGroupActivityId=null,s.vipGroupActivityName=null,s.vipGroupActivityIndex=0,i.vipGroupActivity=[],i.vipGroupActivitySelect=[],this.scheduleList=[],this.timeTable=[]}else"vipGroupActivity"==r.currentType?(a.vipGroupActivityId!=t.value&&(a.offlineClassesNums=null,a.onlineClassesNums=null),a.vipGroupActivityId=t.value,s.vipGroupActivityName=t.text,s.vipGroupActivityIndex=e,t.maxCourseNum<=0&&(t.maxCourseNum=0),i.vipGroupActivitySelect=t,a.onlineClassesUnitPrice=Math.ceil(i.vipGroupCategorySelect.onlineClassesUnitPrice),a.offlineClassesUnitPrice=Math.ceil(i.vipGroupCategorySelect.offlineClassesUnitPrice),this.onCalcClassTimes(t),this.setTimeTable()):"teacherSchool"==r.currentType&&(a.teacherSchoolId=t.value,s.teacherSchoolName=t.text,s.teacherSchoolIndex=e);r.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,n=this.other,r=this.statusList,a=Number(e.onlineClassesNums)+Number(e.offlineClassesNums);if(t.salarySettlementJson){var s=JSON.parse(t.salarySettlementJson);s&&s.onlineSalarySettlement?r.hasOnline=!0:r.hasOnline=!1,s&&s.offlineSalarySettlement?r.hasOffline=!0:r.hasOffline=!1}"GIVE_CLASS"==t.type?(this.statusList.teachOnOrOff=!0,a>=Number(t.attribute1)?(e.totalClassTime=a+"+"+t.attribute2,n.giveNum=t.attribute2):(e.totalClassTime=a,n.giveNum=0)):(e.totalClassTime=a,n.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),n=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),r=e.getDate()>=10?e.getDate():"0"+e.getDate();this.form.courseStart=e.getFullYear()+"-"+n+"-"+r,this.dataForm.status=!1},onEnlistConfirm:function(t){var e=new Date(t),n=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),r=e.getDate()>=10?e.getDate():"0"+e.getDate(),a=this.enlistForm,s=this.form;if("start"==a.updateStatus){if(s.registrationStartTime=e.getFullYear()+"-"+n+"-"+r,s.coursesExpireDate){var i=new Date(s.registrationStartTime.replace(/-/gi,"/")).getTime(),o=new Date(s.coursesExpireDate.replace(/-/gi,"/")).getTime();i>o&&(s.coursesExpireDate=null)}}else"end"==a.updateStatus&&(s.coursesExpireDate=e.getFullYear()+"-"+n+"-"+r);a.status=!1},onEnListShow:function(t,e){var n=this.enlistForm;"end"==t?this.form.registrationStartTime?n.minDate=new Date(this.form.registrationStartTime.replace(/-/gi,"/")):n.minDate=new Date:"start"==t&&(n.minDate=new Date),n.currentDate=e?new Date(e.replace(/-/gi,"/")):new Date,n.updateStatus=t,n.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,n=this.scheduleList,r=(t[2]>=10?t[2]:"0"+t[2])+":"+t[3].split("分")[0],a=this.MinutesTest(t[2],t[3],this.form.singleClassMinutes),s=!0;n.forEach((function(n){var i=e.timeIsrange(r,a,n.startTime),o=e.timeIsrange(r,a,n.endTime);s&&(t[1]==n.weekStr?s=!i&&!o:t[1]!=n.weekStr&&(s=!0))}));var i=a?Number(a.split(":")[0]):0,o=a?Number(a.split(":")[1]):0;i>=21&&o>0?this.$toast("课程安排结束时间不可超过21:00"):s?(n.push({type:t[0],weekStr:t[1],weekIndex:this.getWeek(t[1]),startTime:r,endTime:a,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,n=parseInt(t.onlineClassesNums?t.onlineClassesNums:0),r=parseInt(t.offlineClassesNums?t.offlineClassesNums:0),a=parseInt(this.other.giveNum),s=t.giveTeachMode;if("ONLINE"==s?n+=a:"OFFLINE"==s&&(r+=a),!(e.length<=0)){var o=Number(n)+Number(r),u=t.courseStart.replace(/-/gi,"/"),c=new Date(u),l=0;while(o&&o>0){for(var h=0;h0&&0==f&&0==h&&(f+=7),f<0&&(f+=7);var d=this.getThinkDate(c,f),p=(new Date).getTime(),m=new Date(d.replace(/-/gi,"/")+" "+e[h].startTime+":00").getTime();if(p0?(v.teachMode="ONLINE",this.timeTable.push(v),n--,o--):"线下"==e[h].type&&r>0&&(v.teachMode="OFFLINE",this.timeTable.push(v),r--,o--)}}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 n=i()(i()(t.classDate).format("YYYY-MM-DD")+" "+t.startClassTimeStr+":00").valueOf(),r=i()(i()(e.classDate).format("YYYY-MM-DD")+" "+e.startClassTimeStr+":00").valueOf();return n-r}))}}},onGiveMode:function(){this.statusList.giveTeachModeStatus=!0},getCalcClass:function(){var t=this.loadData,e=this.form,n=t.vipGroupActivitySelect,r=t.teacherCategory,a=e.onlineClassesNums?e.onlineClassesNums:0,s=e.offlineClassesNums?e.offlineClassesNums:0,i=parseInt(this.other.giveNum),o=e.giveTeachMode;if(n.salarySettlementJson){var u=JSON.parse(n.salarySettlementJson),c=0;if(Number(a)+Number(s)>0){var l=a*e.onlineClassesUnitPrice+s*e.offlineClassesUnitPrice;i>0&&!o&&(l=0),c=l*e.studentNum/(Number(a)+Number(s)+Number(i)),"DISCOUNT"==n.type&&(c=c*(n.attribute1?Number(n.attribute1):100)/100)}if(u&&u.onlineSalarySettlement){var h=u.onlineSalarySettlement;"TEACHER_DEFAULT"==h.salarySettlementType?e.onlineTeacherSalary=Math.round(r.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(r.offlineClassesSalary);if(u&&u.offlineSalarySettlement){var f=u.offlineSalarySettlement;"TEACHER_DEFAULT"==f.salarySettlementType?e.offlineTeacherSalary=Math.round(r.offlineClassesSalary):"RATIO_DISCOUNT"==f.salarySettlementType?e.offlineTeacherSalary=Math.round(c?c*(f.settlementValue?f.settlementValue:100)/100:0):"FIXED_SALARY"==f.salarySettlementType&&(e.offlineTeacherSalary=Math.round(f.settlementValue)),e.offlineTeacherSalary=Number(e.offlineTeacherSalary)}else e.offlineTeacherSalary=Math.round(r.offlineClassesSalary)}"GIVE_CLASS"==n.type||"BASE_ACTIVITY"==n.type?e.totalCount=Math.round(a*e.onlineClassesUnitPrice+s*e.offlineClassesUnitPrice):"DISCOUNT"==n.type&&(e.totalCount=Math.round((a*e.onlineClassesUnitPrice+s*e.offlineClassesUnitPrice)*Number(n.attribute1)/100)),e.totalCount=Number(e.totalCount)},getThinkDate:function(t,e){var n=t;n.setDate(t.getDate()+e);var r=n.getFullYear(),a=n.getMonth()+1,s="";s=a<10?"0"+a:a+"";var i=n.getDate(),o="";return o=i<10?"0"+i:i+"",r+"-"+s+"-"+o},MinutesTest:function(t,e,n){var r=e.split("分")[0],a=new Date(1900,1,1,t,r);a.setMinutes(a.getMinutes()+parseInt(n));var s=a.getHours(),i=a.getMinutes();return s<10&&(s="0"+s),i<10&&(i="0"+i),s+":"+i},timeIsrange:function(t,e,n){var r=t.split(":");if(2!=r.length)return!1;var a=e.split(":");if(2!=a.length)return!1;var s=n.split(":");if(2!=a.length)return!1;var i=new Date,o=new Date,u=new Date;return i.setHours(r[0]),i.setMinutes(r[1]),o.setHours(a[0]),o.setMinutes(a[1]),u.setHours(s[0]),u.setMinutes(s[1]),u.getTime()-i.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=S(y().mark((function t(){var e,n,r,a,s,i,o,u=this;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.form,n=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(r=!e.onlineClassesNums&&e.onlineClassesNums<=0,a=!e.offlineClassesNums&&e.offlineClassesNums<=0,!n.hasOnline){t.next=23;break}if(!r){t.next=23;break}return this.$toast("请输入线上课次数"),t.abrupt("return",!1);case 23:if(!n.hasOffline){t.next=30;break}if(!a){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(s=this.loadData.vipGroupActivitySelect,"GIVE_CLASS"!=s.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(!(s.maxCourseNum>0)){t.next=42;break}if(i=parseInt(e.onlineClassesNums)+parseInt(e.offlineClassesNums),i==s.maxCourseNum){t.next=42;break}return this.$toast("课时总数为".concat(s.maxCourseNum,"节")),t.abrupt("return");case 42:if(!(s.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,o={courseSchedules:this.timeTable,vipGroupApplyBaseInfo:v(v({},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(h["a"])(o).then((function(t){var e=t.data;Object(f["a"])(!1),200==e.code?(u.$toast("申请成功"),setTimeout((function(){u.onSubmitStatus=!0,Object(c["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(c["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):u.$router.push("/business")}),500)):(u.onSubmitStatus=!0,u.$toast(e.msg))})).catch((function(){u.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,n=this.scheduleList||[],r=!1,a=!1;n.forEach((function(t){"线上"==t.type&&(r=!0),"线下"==t.type&&(a=!0)}));var s=this.statusList,i=!e.onlineClassesNums&&e.onlineClassesNums<=0,o=!e.offlineClassesNums&&e.offlineClassesNums<=0;if(s.hasOnline){if(i)return t&&this.$toast("请输入线上课次数"),!1;if(!i&&!r&&e.onlineClassesNums>0)return t&&this.$toast("课时安排缺少线上课类型"),!1}if(s.hasOffline){if(o)return t&&this.$toast("请输入线下课次数"),!1;if(!o&&!a&&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(h["c"])(u()(v(v({},e),{},{activityCourseType:this.activityCourseType,subjectId:this.form.subjectIdList}))).then((function(n){var r=n.data;if(t.loading=!1,200==r.code){if(t.dataList.length>0&&1==r.data.pageNo)return;e.page=r.data.pageNo,t.dataList=t.dataList.concat(r.data.rows),e.page>=r.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(n,r){n==t.userId.toString()&&e.checkboxSelect.splice(r,1)})),this.checkboxSelectList.forEach((function(n,r){n.userId==t.userId&&e.checkboxSelectList.splice(r,1)}))):(this.checkboxSelect.push(t.userId.toString()),this.checkboxSelectList.push(t))},desensitPhone:function(t){var e=t.substr(0,3),n=t.substr(-4);return e+"****"+n}}},T=L,w=(n("bc74"),n("2877")),N=Object(w["a"])(T,r,a,!1,null,"5f63d6fa",null);e["a"]=N.exports}}]);