PeriodAdjust.86bd8eea.js 8.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["PeriodAdjust"],{"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",{attrs:{dayList:t.getMonthDay},on:{onSelectDay:t.onSelectDay,onChangeMonth:t.onChangeMonth}}),t.dataShow?a("van-radio-group",{key:"data",staticClass:"cellList",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",{staticClass:"titleCell",on:{click:function(a){return t.onCheckRadio(e)}}},[a("template",{slot:"default"},[a("div",{staticClass:"signImgBox"},[a("img",{staticClass:"signImg",attrs:{src:t.getSignInIcon(e.isSignIn),alt:""}})])]),a("template",{slot:"title"},[a("div",{staticClass:"classTitleWrap",staticStyle:{"word-break":"break-all"}},[a("img",{staticClass:"teacherModelImg",attrs:{src:t.getTeacherImg(e.teachMode),alt:""}}),a("img",{staticClass:"courseImg",attrs:{src:t.squrtList.squrt2,alt:""}}),t._v("\n "+t._s(e.name)+"\n ")])])],2),a("van-cell",[a("template",{slot:"title"},[e.schoolName?a("p",{staticClass:"studentTitle",staticStyle:{"word-break":"break-all"}},[t._v("\n 上课地点 :  "+t._s(e.schoolName)+"\n ")]):t._e(),a("p",{staticClass:"studentTitle",staticStyle:{"word-break":"break-all"}},[t._v("\n 上课学生 :  "+t._s(e.studentNames)+"\n ")])])],2),a("van-cell",{staticClass:"input-cell",attrs:{"title-class":"title-content","value-class":"value-content",center:!0},on:{click:function(a){return t.onCheckRadio(e)}}},[a("template",{slot:"title"},[a("div",{staticClass:"chioseWrap"},[a("img",{staticClass:"clockIcon",attrs:{src:t.squrtList.squrt8,alt:""}}),a("p",{staticClass:"timer"},[t._v("\n "+t._s(t._f("formatDate")(e.startClassTime))+"-"+t._s(t._f("formatDate")(e.endClassTime))+"\n ")])])]),a("template",{slot:"default"},[a("van-radio",{ref:"radioes",refInFor:!0,attrs:{disabled:t.radioDisabled,name:e.id}})],1)],2)],1)}),1):a("m-empty",{key:"data"})],1),t.dataShow?a("van-sticky",[a("div",{staticClass:"button-group"},[a("van-button",{staticClass:"changeBtn",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)},r=[],s=a("a34a"),o=a.n(s),i=a("47ad"),c=a("d678"),u=a("5a0c"),l=a.n(u),d=a("ff51"),h=a("9afb"),m=a("3908");function f(t){return f="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},f(t)}function p(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)}return a}function g(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?p(a,!0).forEach(function(e){b(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):p(a).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function b(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function D(t,e,a,n,r,s,o){try{var i=t[s](o),c=i.value}catch(u){return void a(u)}i.done?e(c):Promise.resolve(c).then(n,r)}function v(t){return function(){var e=this,a=arguments;return new Promise(function(n,r){var s=t.apply(e,a);function o(t){D(s,n,r,o,i,"next",t)}function i(t){D(s,n,r,o,i,"throw",t)}o(void 0)})}}var y={name:"periodadjust",components:{MCalendar:i["a"],MEmpty:c["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,getMonthDay:[],squrtList:{squrt2:a("8b84"),squrt3:a("c040"),squrt4:a("5fcb"),squrt5:a("261c"),squrt6:a("5dc1"),squrt7:a("1367"),squrt8:a("430b")}}},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),this.getCourseMonth(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))},onChangeMonth:function(t){this.getCourseMonth(l()(t).format("YYYY-MM-DD"))},onCheckRadio:function(t){console.log("点击",this.radioDisabled),this.radioDisabled||(this.radioSelect=t.id,this.radioSelectList=t)},getCourseMonth:function(){var t=v(o.a.mark(function t(e){var a=this;return o.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(h["p"])({month:e,type:"VIP"}).then(function(t){var e=t.data;200==e.code&&(a.getMonthDay=[],e.data.forEach(function(t){a.getMonthDay.push(l()(t).format("DD"))}),a.isCalendar=!0)});case 2:case"end":return t.stop()}},t)}));function e(e){return t.apply(this,arguments)}return e}(),getCourseDate:function(){var t=v(o.a.mark(function t(e){var a=this;return o.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return Object(m["a"])(!0),t.prev=1,this.dataList=[],t.next=5,Object(h["q"])({date:e,type:"VIP"}).then(function(t){var e=t.data;200==e.code&&e.data&&(a.dataList=e.data.rows.map(function(t){var e=[];return t.students&&(e=t.students.map(function(t){return t.userName})),g({},t,{studentNames:e.join(",")})}),a.dataShow=e.data.rows.length>0),Object(m["a"])(!1)});case 5:t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](1),Object(m["a"])(!1);case 10:case"end":return t.stop()}},t,this,[[1,7]])}));function e(e){return t.apply(this,arguments)}return e}(),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),r="2019/12/18 "+this.getDateInfo(a.endClassTime),s=new Date(n),o=new Date(r),i=parseInt(Math.abs(o.getTime()-s.getTime())/1e3/60),c=new Date(t),u=new Date(t);u.setMinutes(c.getMinutes()+i),c.toDateString()===u.toDateString()?Object(h["e"])({actualTeacherId:a.actualTeacherId,id:this.radioSelect,classDate:this.getFormartDate(c),startClassTimeStr:this.getDateInfo(c),endClassTimeStr:this.getDateInfo(u)}).then(function(t){var a=t.data;200==a.code?(e.$toast("调整成功"),setTimeout(function(){Object(d["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(d["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):e.$router.push("/business")},500)):e.$toast(a.msg)}):this.$toast("课时调整不允许跨天调整")},getDateInfo:function(t){var e=t;"object"!==f(t)&&(e=t.replace(/-/gi,"/"));var a=new Date(e),n=a.getHours()>=10?a.getHours():"0"+a.getHours(),r=a.getMinutes()>=10?a.getMinutes():"0"+a.getMinutes();return n+":"+r+":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},getSignInIcon:function(t){return 1==t?this.squrtList.squrt3:0==t?this.squrtList.squrt5:this.squrtList.squrt4},getTeacherImg:function(t){return"ONLINE"==t?this.squrtList.squrt6:this.squrtList.squrt7}}},w=y,S=(a("a088"),a("2877")),C=Object(S["a"])(w,n,r,!1,null,"129e9278",null);e["default"]=C.exports},a088:function(t,e,a){"use strict";var n=a("b11f"),r=a.n(n);r.a},b11f:function(t,e,a){}}]);