(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["program"],{2851:function(t,e,n){},"5a0c":function(t,e,n){!function(e,n){t.exports=n()}(0,function(){"use strict";var t="millisecond",e="second",n="minute",r="hour",s="day",a="week",i="month",u="quarter",o="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,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},f={s:h,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),s=n%60;return(e<=0?"+":"-")+h(r,2,"0")+":"+h(s,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,i),s=e-r<0,a=t.clone().add(n+(s?-1:1),i);return Number(-(n+(e-r)/(s?r-a:a-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:i,y:o,w:a,d:s,D:"date",h:r,m:n,s:e,ms:t,Q:u}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},d={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("_")},p="en",m={};m[p]=d;var v=function(t){return t instanceof S},g=function(t,e,n){var r;if(!t)return p;if("string"==typeof t)m[t]&&(r=t),e&&(m[t]=e,r=t);else{var s=t.name;m[s]=t,r=s}return!n&&r&&(p=r),r||!n&&p},y=function(t,e){if(v(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},b=f;b.l=g,b.i=v,b.w=function(t,e){return y(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var S=function(){function h(t){this.$L=this.$L||g(t.locale,null,!0),this.parse(t)}var f=h.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=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 r=e.match(c);if(r){var s=r[2]-1||0;return n?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}}return new Date(e)}(t),this.init()},f.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()},f.$utils=function(){return b},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(t,e){var n=y(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return y(t)0?[n("h2",{staticClass:"van-block__title"},[t._v("上课学员")]),n("van-cell-group",t._l(t.studentList,function(e,r){return n("van-cell",{key:r,attrs:{"title-style":"flex: 1 auto; color: #1A1A1A;",size:"large"},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n "+t._s(e.username)+" - "+t._s(e.phone)+"\n ")]},proxy:!0},{key:"default",fn:function(){return[n("span",{on:{click:function(n){return t.onDelete("student",e)}}},[n("van-icon",{attrs:{name:"delete-o",size:".14rem"}}),n("span",{staticStyle:{"font-size":".12rem"}},[t._v("删除")])],1)]},proxy:!0}],null,!0)})}),1)]:t._e(),n("div",{staticClass:"addButton",on:{click:function(e){t.studentStatus=!0}}},[n("van-icon",{attrs:{name:"plus"}}),t._v(" 添加学员\n ")],1),n("h2",{staticClass:"van-block__title"},[t._v("课时组成")]),n("van-cell-group",[t.statusList.hasOnline&&-1==t.teachMode?n("van-field",{attrs:{label:"线上课次数","input-align":"right",size:"large",placeholder:"请输入次数",type:"number"},on:{keyup:t.onClassKeyUp},model:{value:t.form.onlineClassesNums,callback:function(e){t.$set(t.form,"onlineClassesNums",e)},expression:"form.onlineClassesNums"}}):t._e(),t.statusList.hasOffline&&-1==t.teachMode?n("van-field",{attrs:{label:"线下课次数","input-align":"right",size:"large",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.tempOfflineNum>0?n("van-field",{attrs:{label:"线下课地址",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){return t.onGetSheetList("teacherSchool")}},model:{value:t.formName.teacherSchoolName,callback:function(e){t.$set(t.formName,"teacherSchoolName",e)},expression:"formName.teacherSchoolName"}}):t._e(),t.isMusicTheory?n("van-field",{attrs:{value:"1-"+(t.form.studentNum||0)+"人",label:"班级人数",readonly:!0,"input-align":"right",size:"large"}}):n("van-field",{attrs:{value:(t.form.studentNum||0)+"人",label:"班级人数",readonly:!0,"input-align":"right",size:"large"}}),n("van-field",{attrs:{value:(t.form.singleClassMinutes||0)+"分钟",label:"单课时时长",readonly:!0,"input-align":"right",size:"large"}})],1),n("h2",{staticClass:"van-block__title"},[t._v("课时安排")]),n("van-cell-group",[t.vipGroup.coursesStartTime?n("van-cell",{attrs:{title:"最早排课时间",readonly:!0,"input-align":"right",size:"large","value-class":"showText",value:t.vipGroup.coursesStartTime}}):t._e(),t.vipGroup.coursesEndTime?n("van-cell",{attrs:{title:"最晚排课时间",readonly:!0,"input-align":"right",size:"large","value-class":"showText",value:t.vipGroup.coursesEndTime}}):t._e(),n("van-field",{attrs:{label:"课时总数",readonly:!(!t.courseTypeIsVip&&!t.isLimitNum&&t.typeStatus),"input-align":"right",size:"large",placeholder:"请输入排课课时数"},scopedSlots:t._u([t.form.totalClassTime?{key:"extra",fn:function(){return[n("span",{staticStyle:{color:"#808080","font-size":"16px"}},[t._v("课时")])]},proxy:!0}:null],null,!0),model:{value:t.form.totalClassTime,callback:function(e){t.$set(t.form,"totalClassTime",e)},expression:"form.totalClassTime"}}),n("van-field",{attrs:{label:"排课开始时间",readonly:!0,"input-align":"right","is-link":"",size:"large",placeholder:"请选择"},on:{click:function(e){t.dataForm.status=!0}},model:{value:t.form.courseStart,callback:function(e){t.$set(t.form,"courseStart",e)},expression:"form.courseStart"}})],1),n("van-cell-group",{staticStyle:{"margin-top":".1rem"},attrs:{border:!1}},t._l(t.scheduleList,function(e,r){return n("van-cell",{key:r,attrs:{"title-class":"title-time"}},[n("template",{slot:"title"},[n("span",{staticClass:"online"},[t._v(t._s(e.type))]),n("span",{staticClass:"week"},[t._v(t._s(e.weekStr))]),n("span",{staticClass:"timer"},[t._v(t._s(e.startTime+"~"+e.endTime))])]),n("template",{slot:"default"},[n("span",{on:{click:function(n){return t.onDelete("class",e)}}},[n("van-icon",{attrs:{name:"delete-o",size:".14rem"}}),n("span",{staticStyle:{"font-size":".12rem"}},[t._v("删除")])],1)])],2)}),1),n("div",{staticClass:"addButton",on:{click:function(e){t.teachingStatus=!0}}},[n("van-icon",{attrs:{name:"plus"}}),t._v(" 添加课时安排\n ")],1),n("van-cell-group",[t.scheduleList.length>0?n("van-field",{attrs:{label:"排课列表",disabled:"","input-align":"right","is-link":"",size:"large"},on:{click:t.onShowTimeTable}}):t._e()],1),n("div",{staticClass:"button-group"},[n("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1),n("van-popup",{staticClass:"studentChose",style:{height:"80%"},attrs:{"lock-scroll":!0,position:"bottom"},model:{value:t.studentStatus,callback:function(e){t.studentStatus=e},expression:"studentStatus"}},[n("student-list",{attrs:{studentList:t.studentList,activityId:t.activityId,studentNum:t.form.studentNum,courseTypeIsVip:t.courseTypeIsVip,typeStatus:t.typeStatus,isMusicTheory:t.isMusicTheory},on:{close:function(e){t.studentStatus=!1},submit:t.onSelectStudent}})],1),n("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[n("van-datetime-picker",{attrs:{type:"date","min-date":t.dataForm.minDate,"max-date":t.dataForm.maxDate,formatter:t.formatter},on:{cancel:function(e){t.dataForm.status=!1},confirm:t.onCurrentConfirm},model:{value:t.dataForm.currentDate,callback:function(e){t.$set(t.dataForm,"currentDate",e)},expression:"dataForm.currentDate"}})],1),n("van-popup",{attrs:{position:"bottom"},model:{value:t.teachingStatus,callback:function(e){t.teachingStatus=e},expression:"teachingStatus"}},[n("course-modal",{attrs:{scheduleList:t.scheduleList,singleClassMinutes:t.form.singleClassMinutes},on:{close:function(e){t.teachingStatus=!1}}})],1),n("van-popup",{attrs:{position:"bottom"},model:{value:t.sheetForm.sheetStatus,callback:function(e){t.$set(t.sheetForm,"sheetStatus",e)},expression:"sheetForm.sheetStatus"}},[n("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),n("van-popup",{attrs:{position:"bottom"},model:{value:t.statusList.classTime,callback:function(e){t.$set(t.statusList,"classTime",e)},expression:"statusList.classTime"}},[n("van-row",[n("van-col",{attrs:{span:"12"}},[t._v("上课类型")]),n("van-col",{attrs:{span:"12"}},[t._v("上课时间")])],1),n("div",{staticClass:"tableContainer"},t._l(t.timeTable,function(e,r){return n("van-row",{key:r},[n("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s("ONLINE"==e.teachMode?"线上":"线下")+"\n ")]),n("van-col",{attrs:{span:"12"}},[t._v("\n "+t._s(e.classDate)+" "+t._s(e.startClassTimeStr)+"\n ")])],1)}),1)],1)],2)},s=[],a=n("a34a"),i=n.n(a),u=n("5a0c"),o=n.n(u),c=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"paddingB80"},[t.dataShow?r("div",{key:"data",staticClass:"studentContainer"},[r("van-checkbox-group",{model:{value:t.checkboxSelect,callback:function(e){t.checkboxSelect=e},expression:"checkboxSelect"}},[r("van-cell-group",{attrs:{border:!1}},t._l(t.dataList,function(e,s){return r("van-cell",{key:s,staticClass:"input-cell",attrs:{"value-class":"value-times",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:"default"},[r("span",{staticStyle:{"font-size":".16rem",color:"#1A1A1A"}},[t._v("可排课次数:"),r("span",{staticStyle:{color:"#01C1B5"}},[t._v(t._s(e.showStudentNum))])])]),r("template",{slot:"extra"},[r("van-checkbox",{attrs:{name:e.userId},scopedSlots:t._u([{key:"icon",fn:function(n){return[e.radioDisabled?t._e():r("img",{staticClass:"img-icon",attrs:{src:n.checked?t.activeButtonIcon:t.inactiveButtonIcon}})]}}],null,!0)})],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("确定")])])])},l=[],h=n("d678"),f=n("ef13");function d(t,e,n,r,s,a,i){try{var u=t[a](i),o=u.value}catch(c){return void n(c)}u.done?e(o):Promise.resolve(o).then(r,s)}function p(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var a=t.apply(e,n);function i(t){d(a,r,s,i,u,"next",t)}function u(t){d(a,r,s,i,u,"throw",t)}i(void 0)})}}for(var m={components:{MEmpty:h["a"]},props:["studentList","activityId","courseTypeIsVip","typeStatus","studentNum","isMusicTheory"],data:function(){return{params:{search:null,activityId:this.activityId},dataShow:!0,dataList:[],checkboxSelect:[]}},watch:{studentList:function(t){var e=this;if(t){var n=t||[];this.checkboxSelect=[],n.forEach(function(t){e.checkboxSelect.push(t.userId)})}}},mounted:function(){this.getStudent()},methods:{getStudent:function(){var t=p(i.a.mark(function t(){var e,n,r,s,a=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return e=this.params,t.prev=1,t.next=4,Object(f["c"])(e);case 4:n=t.sent,r=n.data||[],s=[],r.forEach(function(t){var e=0;e=a.typeStatus?a.courseTypeIsVip?t.vipNum:t.practiceNum:a.courseTypeIsVip?t.giveVipNum:t.givePracticeNum,t.showStudentNum=e,e>0&&s.push(t)}),this.dataList=s,s.length>0?this.dataShow=!0:this.dataShow=!1,t.next=14;break;case 12:t.prev=12,t.t0=t["catch"](1);case 14:case"end":return t.stop()}},t,this,[[1,12]])}));function e(){return t.apply(this,arguments)}return e}(),onCheckboxSelect:function(t){var e=this;this.checkboxSelect.includes(t.userId)?this.checkboxSelect.forEach(function(n,r){n===t.userId&&e.checkboxSelect.splice(r,1)}):this.checkboxSelect.push(t.userId)},onPopupCancel:function(){this.$listeners.close()},onPopupSubmit:function(){var t=this;if(this.isMusicTheory){if(!(this.checkboxSelect.length>=1&&this.checkboxSelect.length<=this.studentNum))return void this.$toast("请选择1-".concat(this.studentNum,"名学生,当前选择").concat(this.checkboxSelect.length,"名"))}else if(this.checkboxSelect.length!=this.studentNum)return void this.$toast("请选择学生".concat(this.studentNum,"名,当前选择").concat(this.checkboxSelect.length,"名"));var e=this.dataList||[],n=[];e.forEach(function(e){t.checkboxSelect.includes(e.userId)&&n.push(e)}),this.$emit("submit",n)}}},v=m,g=(n("61c1"),n("2877")),y=Object(g["a"])(v,c,l,!1,null,"532fbcc4",null),b=y.exports,S=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("van-picker",{attrs:{columns:t.columns,"show-toolbar":""},on:{cancel:function(e){return t.$listeners.close()},confirm:t.onTeachingConfirm}})},k=[],T=[],C=0;C<60;C++){var x=C<10?"0"+C:C;T.push(x+"分")}var I={props:["scheduleList","singleClassMinutes"],data:function(){return{columns:[{values:["线上","线下"],className:"type"},{values:["周一","周二","周三","周四","周五","周六","周日"],className:"week"},{values:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],className:"hours",defaultIndex:7},{values:T,className:"minutes"}]}},methods:{onTeachingConfirm:function(t){var e=this,n=this.scheduleList,r=(t[2]>=10?t[2]:"0"+t[2])+":"+t[3].split("分")[0],s=this.MinutesTest(t[2],t[3],this.singleClassMinutes),a=!0;n.forEach(function(n){var i=e.timeIsRange(r,s,n.startTime),u=e.timeIsRange(r,s,n.endTime);a&&(t[1]==n.weekStr?a=!i&&!u:t[1]!=n.weekStr&&(a=!0))}),a?(n.push({type:t[0],weekStr:t[1],weekIndex:this.getWeek(t[1]),startTime:r,endTime:s,id:Date.now()}),this.$listeners.close()):this.$toast("该时间段已排课请重选时间")},MinutesTest:function(t,e,n){var r=e.split("分")[0],s=new Date(1900,1,1,t,r);s.setMinutes(s.getMinutes()+parseInt(n));var a=s.getHours(),i=s.getMinutes();return a<10&&(a="0"+a),i<10&&(i="0"+i),a+":"+i},timeIsRange:function(t,e,n){var r=t.split(":");if(2!=r.length)return!1;var s=e.split(":");if(2!=s.length)return!1;var a=n.split(":");if(2!=s.length)return!1;var i=new Date,u=new Date,o=new Date;return i.setHours(r[0]),i.setMinutes(r[1]),u.setHours(s[0]),u.setMinutes(s[1]),o.setHours(a[0]),o.setMinutes(a[1]),o.getTime()-i.getTime()>=0&&o.getTime()-u.getTime()<=0},getWeek:function(t){var e={"周一":1,"周二":2,"周三":3,"周四":4,"周五":5,"周六":6,"周日":0};return e[t]}}},D=I,N=Object(g["a"])(D,S,k,!1,null,null,null),M=N.exports,w=n("267e"),L=n("9afb");function O(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 A(t){for(var e=1;e0}},mounted:function(){this.__init()},methods:{__init:function(){var t=P(i.a.mark(function t(){var e,n,r;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(f["d"])({activityId:this.activityId});case 3:e=t.sent,this.vipDetail=e.data,n=e.data.vipGroupActivity,n.coursesStartTime=n.coursesStartTime?o()(n.coursesStartTime).format("YYYY-MM-DD"):null,n.coursesEndTime=n.coursesEndTime?o()(n.coursesEndTime).format("YYYY-MM-DD"):null,this.vipGroup=n,r=this.form,r.vipGroupCategoryId=this.typeStatus?n.vipGroupCategoryIdList:n.giveCategoryId,r.singleClassMinutes=this.typeStatus?n.singleCourseTime:n.giveSingleCourseTime,this.isMusicTheory="乐理课"===n.giveCategoryName,this.courseTypeIsVip?(r.studentNum=this.typeStatus?n.vipGroupCategoryNum:n.giveCategoryNum,this.statusList.hasOnline=this.typeStatus?this.formatStatus("online",n.teachMode):this.formatStatus("online",n.giveTeachMode),this.statusList.hasOffline=this.typeStatus?this.formatStatus("offline",n.teachMode):this.formatStatus("offline",n.giveTeachMode)):(r.totalClassTime=null,r.studentNum=1,this.statusList.hasOnLine=!1,this.statusList.hasOffLine=!1),!this.isLimitNum&&this.typeStatus||(r.totalClassTime=this.typeStatus?n.minCourseNum:n.giveCourseNum),0==this.teachMode?(r.onlineClassesNums=r.totalClassTime||0,r.offlineClassesNums=0):1==this.teachMode&&(r.onlineClassesNums=0,r.offlineClassesNums=r.totalClassTime||0,this.tempOfflineNum=r.totalClassTime||0),t.next=20;break;case 18:t.prev=18,t.t0=t["catch"](0);case 20:case"end":return t.stop()}},t,this,[[0,18]])}));function e(){return t.apply(this,arguments)}return e}(),onGetSheetList: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.length>0?(e.columns=n,e.index=this.formName[t+"Index"],e.loading=!1):this.onLoadingData(t)},onLoadingData:function(){var t=this,e=this.sheetForm;"subjectList"==e.currentType?Object(L["k"])().then(function(n){var r=n.data;if(200==r.code&&r.data.length>0){var s=[];r.data.forEach(function(t){t.value=t.id,t.text=t.name,s.push(t)}),t.loadData.subjectList=s,e.columns=s,e.loading=!1}else t.$toast("暂无科目列表"),e.loading=!1}):"teacherSchool"==e.currentType?Object(L["n"])().then(function(n){var r=n.data;if(200==r.code&&r.data.length>0){var s=[];r.data.forEach(function(t){t.value=t.id,t.text=t.name,s.push(t)}),t.loadData.teacherSchool=s,e.columns=s,e.loading=!1}else t.$toast("暂无教学点"),e.loading=!1}):"teacherList"==e.currentType&&Object(L["j"])().then(function(n){var r=n.data;if(200==r.code&&r.data.length>0){var s=[];r.data.forEach(function(t){t.value=t.userId,t.text=t.userName,s.push(t)}),t.loadData.teacherList=s,e.columns=s,e.loading=!1}else t.$toast("暂无乐团主管"),e.loading=!1})},onSheetConfirm:function(t,e){var n=this.sheetForm,r=this.form,s=this.formName;"subjectList"==n.currentType?(r.subjectIdList=t.value,s.subjectListName=t.text,s.subjectListIndex=e):"teacherSchool"==n.currentType?(r.teacherSchoolId=t.value,s.teacherSchoolName=t.text,s.teacherSchoolIndex=e):"teacherList"==n.currentType&&(r.educationalTeacherId=t.value,s.educationalTeacherName=t.text,s.educationalTeacherIndex=e),n.sheetStatus=!1},onSubmit:function(){var t=P(i.a.mark(function t(){var e,n,r,s,a;return i.a.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.educationalTeacherId){t.next=8;break}return this.$toast("请选择乐团主管"),t.abrupt("return");case 8:if(!(this.checkboxSelectIds.length<=0)){t.next=11;break}return this.$toast("请选择上课学员"),t.abrupt("return");case 11:if(!this.isMusicTheory){t.next=17;break}if(this.checkboxSelectIds.length>=1&&this.checkboxSelectIds.length<=this.form.studentNum){t.next=15;break}return this.$toast("请选择1-".concat(this.form.studentNum,"名学生,当前选择").concat(this.checkboxSelectIds.length,"名")),t.abrupt("return");case 15:t.next=20;break;case 17:if(this.checkboxSelectIds.length==this.form.studentNum){t.next=20;break}return this.$toast("请选择学生".concat(this.form.studentNum,"名,当前选择").concat(this.checkboxSelectIds.length,"名")),t.abrupt("return");case 20:if(r=!e.onlineClassesNums&&e.onlineClassesNums<=0,s=!e.offlineClassesNums&&e.offlineClassesNums<=0,!n.hasOnline||!r){t.next=25;break}return this.$toast("请输入线上课次数"),t.abrupt("return",!1);case 25:if(!n.hasOffline||n.hasOnline){t.next=32;break}if(!s){t.next=29;break}return this.$toast("请输入线下课次数"),t.abrupt("return",!1);case 29:if(!(e.offlineClassesNums>0)||e.teacherSchoolId){t.next=32;break}return this.$toast("请选择线下课地址"),t.abrupt("return",!1);case 32:if(!n.hasOffline||!n.hasOnline||parseFloat(e.onlineClassesNums||0)+parseFloat(e.offlineClassesNums||0)==this.form.totalClassTime){t.next=35;break}return this.$toast("线上课次数+线下课次数不等于总课次数"),t.abrupt("return");case 35:if(!(this.scheduleList.length<=0)){t.next=38;break}return this.$toast("课时安排不能为空"),t.abrupt("return",!1);case 38:if(this.checkCourseList()){t.next=40;break}return t.abrupt("return");case 40:if(this.setTimeTable(),e.studentIdList=this.checkboxSelectIds.join(","),e.firstStudentId=this.studentList.length>0?this.studentList[0].userId:null,e.onlineClassesNum=Number(e.onlineClassesNums),e.offlineClassesNum=Number(e.offlineClassesNums),a={courseSchedules:this.timeTable},!this.courseTypeIsVip){t.next=53;break}return a.vipGroupApplyBaseInfo=e,a.giveFlag=!this.typeStatus,t.next=51,this.onPayVip(a);case 51:t.next=60;break;case 53:return a.practiceGroupApplyBaseInfoDto=e,a.practiceGroupApplyBaseInfoDto.studentId=e.studentIdList,a.practiceGroupApplyBaseInfoDto.allCourseNum=e.totalClassTime,a.practiceGroupApplyBaseInfoDto.subjectId=e.subjectIdList,a.giveFlag=!this.typeStatus,t.next=60,this.onPayPractice(a);case 60:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onPayVip:function(){var t=P(i.a.mark(function t(e){var n=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(f["b"])(e);case 3:this.$toast("排课成功"),setTimeout(function(){n.$router.back()},1e3),t.next=9;break;case 7:t.prev=7,t.t0=t["catch"](0);case 9:case"end":return t.stop()}},t,this,[[0,7]])}));function e(e){return t.apply(this,arguments)}return e}(),onPayPractice:function(){var t=P(i.a.mark(function t(e){var n=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(f["a"])(e);case 3:this.$toast("排课成功"),setTimeout(function(){n.$router.back()},1e3),t.next=9;break;case 7:t.prev=7,t.t0=t["catch"](0);case 9:case"end":return t.stop()}},t,this,[[0,7]])}));function e(e){return t.apply(this,arguments)}return e}(),onSelectStudent:function(t){var e=this,n=t||[];this.studentList=n,this.checkboxSelectIds=[],n.forEach(function(t){e.checkboxSelectIds.push(t.userId)}),this.studentStatus=!1},onDelete:function(t,e){var n=this;"student"==t?this.$dialog.confirm({title:"提示",message:"是否删除该学员?",confirmButtonText:"确定",confirmButtonColor:"#269a93",cancelButtonText:"取消"}).then(function(){var t=n.studentList.indexOf(e);-1!==t&&(n.studentList.splice(t,1),n.checkboxSelectIds.splice(t,1))}):"class"==t&&this.$dialog.confirm({title:"提示",message:"是否删除该课时安排?",confirmButtonText:"确定",confirmButtonColor:"#269a93",cancelButtonText:"取消"}).then(function(){var t=n.scheduleList.indexOf(e);-1!==t&&n.scheduleList.splice(t,1)})},onCurrentConfirm:function(t){this.form.courseStart=o()(t).format("YYYY-MM-DD"),this.dataForm.status=!1},onClassKeyUp:function(t){if(-1==this.teachMode){var e=this.form,n=e.onlineClassesNums,r=e.offlineClassesNums;if(parseInt(n||0)+parseInt(r||0)>=e.totalClassTime)if("offLine"==t){var s=e.totalClassTime-parseInt(n||0);r=s<0?0:s}else{var a=e.totalClassTime-parseInt(r||0);n=a<0?0:a}this.form.onlineClassesNums=n,this.form.offlineClassesNums=r,this.tempOfflineNum=r||0}},onShowTimeTable:function(){if(this.checkCourseList()){var t=this.checkTimeTable();t?this.$toast(t):(this.statusList.classTime=!0,this.setTimeTable())}},checkTimeTable:function(){var t=this.form,e=this.scheduleList,n=parseInt(t.onlineClassesNums?t.onlineClassesNums:0),r=parseInt(t.offlineClassesNums?t.offlineClassesNums:0);this.courseTypeIsVip||(n=parseInt(t.totalClassTime||0));for(var s=!1,a=!1,i=0;i0&&!s?"请添加线上课时安排":r>0&&!a?"请添加线下课时安排":void console.log(A({},t),n,r,s,a)},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);if(this.courseTypeIsVip||(n=parseInt(t.totalClassTime||0)),!(e.length<=0)){var s=Number(n)+Number(r),a=t.courseStart.replace(/-/gi,"/"),i=new Date(a),u=0;while(s&&s>0){for(var c=0;c0&&0==l&&0==c&&(l+=7),l<0&&(l+=7);var h=this.getThinkDate(i,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--,s--):"线下"==e[c].type&&r>0&&(p.teachMode="OFFLINE",this.timeTable.push(p),r--,s--)}}1==e.length?i.setDate(i.getDate()+7):e.every(function(t){return t.weekStr===e[0].weekStr})&&u++}this.timeTable.sort(function(t,e){var n=o()(o()(t.classDate).format("YYYY-MM-DD")+" "+t.startClassTimeStr+":00").valueOf(),r=o()(o()(e.classDate).format("YYYY-MM-DD")+" "+e.startClassTimeStr+":00").valueOf();return n-r})}}},getThinkDate:function(t,e){var n=t;return n.setDate(t.getDate()+e),o()(n).format("YYYY-MM-DD")},checkCourseList:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.form,n=this.scheduleList||[],r=!1,s=!1;n.forEach(function(t){"线上"==t.type&&(r=!0),"线下"==t.type&&(s=!0)});var a=this.statusList,i=!e.onlineClassesNums&&e.onlineClassesNums<=0,u=!e.offlineClassesNums&&e.offlineClassesNums<=0;if(a.hasOnline){if(i)return t&&this.$toast("请输入线上课次数"),!1;if(!i&&!r&&e.onlineClassesNums>0)return t&&this.$toast("课时安排缺少线上课类型"),!1}if(a.hasOffline&&!a.hasOnline){if(u)return t&&this.$toast("请输入线下课次数"),!1;if(!u&&!s&&e.offlineClassesNums>0)return t&&this.$toast("课时安排缺少线下课类型"),!1}return!a.hasOffline||!a.hasOnline||parseFloat(e.onlineClassesNums||0)+parseFloat(e.offlineClassesNums||0)==this.form.totalClassTime||(this.$toast("线上课次数+线下课次数不等于总课次数"),!1)},formatStatus:function(t,e){return this.teachMode=e,"online"==t&&0==e||("offline"==t&&1==e||-1==e)},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"===t?"".concat(e,"日"):e}}},F=j,Y=(n("89a0"),Object(g["a"])(F,r,s,!1,null,"5b737b85",null));e["default"]=Y.exports},ff51:function(t,e,n){"use strict";n.d(e,"g",function(){return r}),n.d(e,"e",function(){return s}),n.d(e,"f",function(){return a}),n.d(e,"b",function(){return i}),n.d(e,"c",function(){return u}),n.d(e,"h",function(){return o}),n.d(e,"a",function(){return c}),n.d(e,"i",function(){return l}),n.d(e,"d",function(){return h});var r=function(){var t=""+(new Date).getTime()+Math.floor(1e6*Math.random());return t};function s(t){var e=new Date(t.replace(/-/g,"/")).getTime(),n=new Date(t);0==n.getDay()&&(e-=6048e5);var r=e-24*(n.getDay()-1)*60*60*1e3,s=new Date(r),a=s.getFullYear(),i=s.getMonth()+1<10?"0"+(s.getMonth()+1):s.getMonth()+1,u=s.getDate()<10?"0"+s.getDate():s.getDate(),o=a+"-"+i+"-"+u;return o}function a(t){var e=new Date(t.replace(/-/g,"/")).getTime(),n=new Date(t),r=7-n.getDay();7==r&&(r=0);var s=e+24*r*60*60*1e3,a=new Date(s),i=a.getFullYear(),u=a.getMonth()+1<10?"0"+(a.getMonth()+1):a.getMonth()+1,o=a.getDate()<10?"0"+a.getDate():a.getDate(),c=i+"-"+u+"-"+o;return c}var i=function(){var t=navigator.userAgent;return{trident:t.indexOf("Trident")>-1,presto:t.indexOf("Presto")>-1,webKit:t.indexOf("AppleWebKit")>-1,gecko:t.indexOf("Gecko")>-1&&-1==t.indexOf("KHTML"),mobile:!!t.match(/AppleWebKit.*Mobile.*/),ios:!!t.match(/Mac OS X/),android:t.indexOf("DAYAAPPA")>-1||t.indexOf("Adr")>-1,iPhone:t.indexOf("DAYAAPPI")>-1,isApp:t.indexOf("DAYAAPPI")>-1||t.indexOf("DAYAAPPA")>-1||t.indexOf("Adr")>-1,iPad:t.indexOf("iPad")>-1,webApp:-1==t.indexOf("Safari"),weixin:t.indexOf("MicroMessenger")>-1,qq:" qq"==t.match(/\sQQ/i)}},u=function(t){if(t<=0)return"0分钟";var e=t%60,n=0;t>=60&&(n=(t-e)/60);var r="";return n&&(r=n+"小时"),e&&(r+=e+"分钟"),r},o=function(t){return Number(t)>=10?t:"0"+t},c=function(t,e){var n=!0;return function(){var r=this,s=arguments;n&&(n=!1,setTimeout(function(){t.call(r,s),n=!0},e))}},l=function(){var t=window.location.href,e="";return e=/test/.test(t)?"http://mstutest.dayaedu.com":/dev/.test(t)?"http://mstudev.dayaedu.com":/online/.test(t)?"https://mstuonline.dayaedu.com":"http://mstudev.dayaedu.com",e},h=function(t){var e=parseFloat(t);if(isNaN(e))return"0.00";e=Math.round(100*e)/100;var n=e.toString(),r=n.indexOf(".");r<0&&(r=n.length,n+=".");while(n.length<=r+2)n+="0";return n}}}]);