12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["PeriodAdjust"],{"0ee0":function(t,e,a){"use strict";var n=a("ad08"),o=a.n(n);o.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",{staticClass:"container"},[a("m-header"),t.isCalendar?a("m-calendar",{attrs:{dataList:t.getMonthDay},on:{onSelectDay:t.onSelectDay}}):t._e(),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.id)}}},[a("template",{slot:"default"},[a("span",[t._v("到课:"+t._s(e.studentNum)+"/"+t._s(e.totalStudentNum))]),a("span",[t._v("请假:"+t._s(e.leaveStudentNum))])]),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.id)}}},[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(e.teacherName))])],2)],1)}),1):a("m-empty",{key:"data"}),t.dataShow?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=[],s=(a("ac6a"),a("6e6e")),r=a("47ad"),i=a("d678"),c=a("ff51"),d=a("9afb"),u={name:"periodadjust",components:{MHeader:s["a"],MCalendar:r["a"],MEmpty:i["a"]},data:function(){return{dataForm:{status:!1,minDate:new Date(2018,0,1),maxDate:new Date(2025,10,1),currentDate:new Date},radioSelect:null,dataList:[],dataShow:!0,getMonthDay:[],isCalendar:!1,radioDisabled:!0}},mounted:function(){var t=this.getFormartDate(new Date);this.getCourseDate(t),this.getCourseMonth(t)},methods:{onSelectDay:function(t){new Date(this.getFormartDate(new Date)>=new Date(this.getFormartDate(t)))?this.radioDisabled=!0:(this.radioDisabled=!1,this.getCourseDate(this.getFormartDate(t)))},onCheckRadio:function(t){this.radioDisabled||(this.radioSelect=t)},getCourseMonth:function(t){var e=this;Object(d["g"])({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["h"])({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(){this.radioSelect?this.$router.push({path:"/PeriodChange"}):this.$toast("请选择需要交换的课程")},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/10/10 "+this.getDateInfo(a.startClassTime),o="2019/10/10 "+this.getDateInfo(a.endClassTime),s=new Date(n),r=new Date(o),i=parseInt(Math.abs(r.getTime()-s.getTime())/1e3/60),u=new Date(t),l=new Date(t);l.setMinutes(u.getMinutes()+i),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("调整成功"),Object(c["a"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):e.$router.push("/business")):e.$toast(a.msg)})},getDateInfo:function(t){var e=new Date(t),a=e.getHours()>=10?e.getHours():"0"+e.getHours(),n=e.getMinutes()>=10?e.getMinutes():"0"+e.getMinutes();return a+":"+n+":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("0ee0"),a("2877")),h=Object(m["a"])(l,n,o,!1,null,"696cd78c",null);e["default"]=h.exports},ad08:function(t,e,a){}}]);
- //# sourceMappingURL=PeriodAdjust.8ebb2ef4.js.map
|