1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["PeriodAdjust"],{"0929":function(t,e,a){},"87d4":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"periodadjust"},[a("div",{class:[t.dataShow?"container":""]},[a("m-calendar",{on:{onSelectDay:t.onSelectDay}}),t.dataShow?a("van-radio-group",{key:"data",model:{value:t.radioSelect,callback:function(e){t.radioSelect=e},expression:"radioSelect"}},t._l(t.dataList,function(e,n){return a("van-cell-group",{key:n},[a("van-cell",{attrs:{icon:"underway-o",center:!0},on:{click:function(a){return t.onCheckRadio(e)}}},[a("template",{slot:"default"},[t._v(t._s(e.signInStatus?"已签到":"未签到"))]),a("template",{slot:"title"},[t._v(t._s(t._f("formatDate")(e.startClassTime))+"-"+t._s(t._f("formatDate")(e.endClassTime)))])],2),a("van-cell",{staticClass:"input-cell",attrs:{"title-class":"title-content",center:!0},on:{click:function(a){return t.onCheckRadio(e)}}},[a("template",{slot:"default"},[a("van-radio",{ref:"radioes",refInFor:!0,attrs:{disabled:t.radioDisabled,name:e.id}})],1),a("template",{slot:"title"},[t._v(t._s(e.name))]),a("template",{slot:"label"},[t._v(t._s(t._f("teachModeStatus")(e.teachMode))+" 主讲老师:"+t._s(e.teacherName))])],2)],1)}),1):a("m-empty",{key:"data"})],1),t.dataShow?a("van-sticky",[a("div",{staticClass:"button-group"},[a("van-button",{attrs:{type:"default",size:"large"},on:{click:t.onDateChange}},[t._v("课时调整")]),a("van-button",{attrs:{type:"primary",size:"large"},on:{click:t.onSubmit}},[t._v("去换课")])],1)]):t._e(),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:"datetime","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)],1)},o=[],i=(a("a481"),a("7618")),s=(a("7f7f"),a("28a5"),a("ac6a"),a("47ad")),r=a("d678"),c=a("ff51"),d=a("9afb"),u={name:"periodadjust",components:{MCalendar:s["a"],MEmpty:r["a"]},data:function(){return{dataForm:{status:!1,minDate:new Date(2018,0,1),maxDate:new Date(2025,10,1),currentDate:new Date},radioSelect:null,radioSelectList:[],dataList:[],dataShow:!0,radioDisabled:!0}},created:function(){},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),document.title="课程调整";var e=this.getFormartDate(new Date);this.getCourseDate(e)},methods:{onSelectDay:function(t){new Date(this.getFormartDateIOS(new Date))>=new Date(this.getFormartDateIOS(t))?this.radioDisabled=!0:this.radioDisabled=!1,this.getCourseDate(this.getFormartDate(t))},onCheckRadio:function(t){this.radioDisabled||(this.radioSelect=t.id,this.radioSelectList=t)},getCourseMonth:function(t){var e=this;Object(d["i"])({month:t,type:"VIP"}).then(function(t){var a=t.data;200==a.code&&(a.data.forEach(function(t){var a=new Date(t);e.getMonthDay.push(a.getDate())}),e.isCalendar=!0)})},getCourseDate:function(t){var e=this;Object(d["j"])({date:t,type:"VIP"}).then(function(t){var a=t.data;200==a.code&&a.data&&(e.dataList=a.data.rows,e.dataShow=a.data.rows.length>0)})},onSubmit:function(){if(this.radioSelect){var t=this.radioSelectList,e=t.classDate.split(" ")[0],a=t.startClassTime.split(" ")[1];this.$router.push({path:"/PeriodChange",query:{checkId:this.radioSelect,classDate:e,startTime:a,name:t.name}})}else this.$toast("请选择需要交换的课程")},getFormartDateIOS:function(t){var e=new Date(t),a=e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate();return a},getFormartDate:function(t){var e=new Date(t),a=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate();return a},onDateChange:function(){this.radioSelect?this.dataForm.status=!0:this.$toast("请选择需要调整的课程")},onCurrentConfirm:function(t){var e=this,a=[];this.dataList.forEach(function(t){t.id==e.radioSelect&&(a=t)});var n="2019/12/18 "+this.getDateInfo(a.startClassTime),o="2019/12/18 "+this.getDateInfo(a.endClassTime),i=new Date(n),s=new Date(o),r=parseInt(Math.abs(s.getTime()-i.getTime())/1e3/60),u=new Date(t),l=new Date(t);l.setMinutes(u.getMinutes()+r),Object(d["b"])({actualTeacherId:a.actualTeacherId,id:this.radioSelect,classDate:this.getFormartDate(u),startClassTimeStr:this.getDateInfo(u),endClassTimeStr:this.getDateInfo(l)}).then(function(t){var a=t.data;200==a.code?(e.$toast("调整成功"),setTimeout(function(){Object(c["a"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(c["a"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):e.$router.push("/business")},500)):e.$toast(a.msg)})},getDateInfo:function(t){var e=t;"object"!==Object(i["a"])(t)&&(e=t.replace(/-/gi,"/"));var a=new Date(e),n=a.getHours()>=10?a.getHours():"0"+a.getHours(),o=a.getMinutes()>=10?a.getMinutes():"0"+a.getMinutes();return n+":"+o+":00"},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"===t?"".concat(e,"日"):"hour"===t?"".concat(e,"时"):"minute"===t?"".concat(e,"分"):e}}},l=u,m=(a("a711"),a("2877")),h=Object(m["a"])(l,n,o,!1,null,"c6bd3590",null);e["default"]=h.exports},a711:function(t,e,a){"use strict";var n=a("0929"),o=a.n(n);o.a}}]);
|