1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["Leave"],{3354:function(t,e,a){},5115:function(t,e,a){"use strict";var n=a("3354"),s=a.n(n);s.a},"6e6e":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"mheader"},[a("header",{staticClass:"m-nav-header",class:[t.isFixed?"fixed":""]},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:t.goBack}},[a("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),a("div",{staticClass:"m-nav-bar__title"},[t._t("default",[t._v(t._s(t.name?t.name:this.$route.meta.descrition))])],2),a("div",{staticClass:"m-nav-bar__right"},[t._t("right")],2)])])},s=[],i={name:"mheader",props:{name:String,isBack:{type:Boolean,default:!0},isFixed:{type:Boolean,default:!0},backUrl:{type:Object,default:function(){return{callBack:null,path:"",params:{}}}}},methods:{goBack:function(){var t=this.backUrl;"function"==typeof t.callBack?t.callBack():t.path?this.$router.push({path:t.path,query:t.params}):history.go(-1)}}},r=i,o=(a("5115"),a("2877")),c=Object(o["a"])(r,n,s,!1,null,"61d0e2e4",null);e["a"]=c.exports},7229:function(t,e,a){"use strict";var n=a("79ec"),s=a.n(n);s.a},"79ec":function(t,e,a){},"9eb3":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"leave"},[t.headerStatus?n("m-header"):t._e(),n("van-cell-group",{staticClass:"search"},[n("van-field",{attrs:{label:"开始时间",placeholder:"选择开始时间","input-align":"right",readonly:"","is-link":""},on:{click:function(e){t.startShow=!0}},model:{value:t.searchList.startText,callback:function(e){t.$set(t.searchList,"startText",e)},expression:"searchList.startText"}}),n("van-field",{attrs:{label:"结束时间","input-align":"right",placeholder:"选择结束时间",readonly:"","is-link":""},on:{click:function(e){t.endShow=!0}},model:{value:t.searchList.endText,callback:function(e){t.$set(t.searchList,"endText",e)},expression:"searchList.endText"}}),n("van-field",{attrs:{type:"textarea",placeholder:"请详细说明原因",rows:"4",autosize:""},model:{value:t.searchList.remark,callback:function(e){t.$set(t.searchList,"remark",e)},expression:"searchList.remark"}})],1),t.vipList.length>0?n("van-panel",{attrs:{title:"课时安排"}},t._l(t.vipList,function(e,s){return n("div",{key:s,staticClass:"leaveCell"},[n("div",{staticClass:"leaveCell-l"},[t._v(t._s(e.name))]),n("div",{staticClass:"leaveCell-r"},[n("div",{staticClass:"left-wrap"},[n("p",{staticClass:"classTime"},[t._v("上课时间")]),n("p",[t._v(t._s(t._f("getFormatTime")(e.classDate,e.startClassTime)))]),n("div",{staticClass:"line"}),n("img",{staticClass:"icon",attrs:{src:a("bf37"),alt:""}})]),e.changeTime?n("div",{staticClass:"left-wrap"},[n("p",{staticClass:"classTime"},[t._v("已调整为")]),n("p",[t._v(t._s(e.changeTime)+" "),n("van-icon",{attrs:{name:"edit"},on:{click:function(a){return t.onUpdate(e)}}})],1)]):n("div",{staticClass:"left-wrap"},[n("van-button",{attrs:{round:"",type:"info",size:"small"},on:{click:function(a){return t.onAdd(e)}}},[t._v("调整")])],1)])])}),0):t._e(),n("div",{staticClass:"button-group"},[n("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1),n("van-popup",{attrs:{position:"bottom"},model:{value:t.startShow,callback:function(e){t.startShow=e},expression:"startShow"}},[n("van-datetime-picker",{attrs:{type:"datetime","item-height":40,title:"开始时间","min-date":t.startDate.minDate,"max-date":t.startDate.maxDate,formatter:t.formatter},on:{cancel:function(e){t.startShow=!1},confirm:t.onStartConfirm},model:{value:t.startDate.currentDate,callback:function(e){t.$set(t.startDate,"currentDate",e)},expression:"startDate.currentDate"}})],1),n("van-popup",{attrs:{position:"bottom"},model:{value:t.endShow,callback:function(e){t.endShow=e},expression:"endShow"}},[n("van-datetime-picker",{attrs:{type:"datetime","item-height":40,title:"结束时间","min-date":t.endDate.minDate,"max-date":t.endDate.maxDate,formatter:t.formatter},on:{cancel:function(e){t.endShow=!1},confirm:t.onEndConfirm},model:{value:t.endDate.currentDate,callback:function(e){t.$set(t.endDate,"currentDate",e)},expression:"endDate.currentDate"}})],1),n("van-action-sheet",{attrs:{actions:t.leaveCategoryList,"cancel-text":"取消"},on:{cancel:function(e){t.dealShow=!1},select:t.onDealSelect},model:{value:t.dealShow,callback:function(e){t.dealShow=e},expression:"dealShow"}}),n("van-popup",{attrs:{position:"bottom"},model:{value:t.changeShow,callback:function(e){t.changeShow=e},expression:"changeShow"}},[n("van-datetime-picker",{attrs:{type:"datetime","item-height":40,title:"结束时间","min-date":t.changeDate.minDate,"max-date":t.changeDate.maxDate,formatter:t.formatter},on:{cancel:function(e){t.changeShow=!1},confirm:t.onChangeConfirm},model:{value:t.changeDate.currentDate,callback:function(e){t.$set(t.changeDate,"currentDate",e)},expression:"changeDate.currentDate"}})],1)],1)},s=[],i=(a("c5f6"),a("a481"),a("7618")),r=(a("7f7f"),a("ac6a"),a("6e6e")),o=a("9afb"),c=a("ff51"),l={name:"leave",components:{MHeader:r["a"]},data:function(){return{headerStatus:!1,startShow:!1,startDate:{minDate:new Date,maxDate:new Date(2025,12,31),currentDate:new Date},endShow:!1,endDate:{minDate:new Date,maxDate:new Date(2025,12,31),currentDate:new Date},dealShow:!1,searchList:{startText:null,endText:null,dealText:null,remark:null},vipList:[],changeShow:!1,changeDate:{minDate:new Date,maxDate:new Date(2025,12,31),currentDate:new Date},leaveCategoryList:[],changeItem:null}},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",t.Authorization),localStorage.setItem("userInfo",t.Authorization)),document.title="批量调整",this.__init()},methods:{__init:function(){var t=this;Object(o["l"])({rows:9999,page:1}).then(function(e){var a=e.data;200==a.code&&a.data.rows.forEach(function(e){t.leaveCategoryList.push({name:e.name,id:e.id})})})},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(),s=a.getMinutes()>=10?a.getMinutes():"0"+a.getMinutes();return n+":"+s+":00"},onSubmit:function(){var t=this,e=this.searchList;if(e.startText&&e.endText)if(e.remark){var a;this.leaveCategoryList.forEach(function(t){t.name==e.dealText&&(a=t.id)});var n=[],s=!1;this.vipList.forEach(function(e){e.changeAllTime||(t.$toast("操作无效:您还有VIP未调整"),s=!0);var a=Object.assign({},e),i="2019/12/18 "+t.getDateInfo(e.startClassTime),r="2019/12/18 "+t.getDateInfo(e.endClassTime),o=new Date(i),c=new Date(r),l=parseInt(Math.abs(o.getTime()-c.getTime())/1e3/60);a.classDate=t.getFormatDate(e.changeAllTime)+":00",a.startClassTime=t.getFormatDate(e.changeAllTime)+":00";var u=new Date(e.changeAllTime);u.setMinutes(u.getMinutes()+l),a.endClassTime=t.getFormatDate(u)+":00",n.push({befor:e,after:a})}),s||Object(o["a"])({coursesScheduleJson:JSON.stringify(n),startTime:e.startText,endTime:e.endText,leaveCategoryId:a,leaveCategoryName:e.dealText,remark:e.remark}).then(function(e){var a=e.data;200==a.code?(t.$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"})):t.$router.push("/business")},500)):t.$toast(a.msg)})}else this.$toast("请填写原因");else this.$toast("时间不能为空")},onAdd:function(t){this.changeShow=!0,this.changeItem=t},onUpdate:function(t){this.changeDate.currentDate=t.changeAllTime,this.changeShow=!0,this.changeItem=t},onChangeConfirm:function(t){var e=new Date(t),a=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),n=e.getDate()>=10?e.getDate():"0"+e.getDate(),s=e.getHours()>=10?e.getHours():"0"+e.getHours(),i=e.getMinutes()>=10?e.getMinutes():"0"+e.getMinutes();this.changeItem.changeTime=a+"-"+n+" "+s+":"+i,this.changeItem.changeAllTime=t,this.changeShow=!1},onStartConfirm:function(t){var e=this.searchList;e.startText=this.getFormatDate(t),this.startShow=!1,t>=this.endDate.currentDate?(e.endText=null,this.endDate.currentDate=new Date):e.startText&&e.endText&&this.queryVipCourseScheduleList()},onEndConfirm:function(t){var e=this.searchList;e.endText=this.getFormatDate(t),this.endShow=!1,t<=this.startDate.currentDate?(e.startText=null,this.startDate.currentDate=new Date):e.startText&&e.endText&&this.queryVipCourseScheduleList()},queryVipCourseScheduleList:function(){var t=this;Object(o["q"])({endTime:this.searchList.endText,startTime:this.searchList.startText}).then(function(e){var a=e.data;t.vipList=[],200==a.code&&a.data.length>0&&(t.vipList=a.data)})},onDealSelect:function(t){this.searchList.dealText=t.name,this.dealShow=!1},getFormatDate:function(t){var e=new Date(t),a=e.getMonth()+1>=10?e.getMonth()+1:"0"+(e.getMonth()+1),n=e.getDate()>=10?e.getDate():"0"+e.getDate(),s=e.getFullYear()+"-"+a+"-"+n,i=e.getHours()>=10?e.getHours():"0"+e.getHours(),r=e.getMinutes()>=10?e.getMinutes():"0"+e.getMinutes();return s+" "+i+":"+r},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}},filters:{getFormatTime:function(t,e){t=new Date(t.replace(/-/g,"/")),e=new Date(e.replace(/-/g,"/"));var a=Number(t.getMonth()+1)>=10?Number(t.getMonth()+1):"0"+Number(t.getMonth()+1),n=Number(t.getDate())>=10?t.getDate():"0"+t.getDate(),s=Number(e.getHours())>=10?e.getHours():"0"+e.getHours(),i=Number(e.getMinutes())>=10?e.getMinutes():"0"+e.getMinutes();return a+"-"+n+" "+s+":"+i}}},u=l,h=(a("7229"),a("2877")),d=Object(h["a"])(u,n,s,!1,null,"186a85e7",null);e["default"]=d.exports},bf37:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAB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