1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-aba618b0"],{"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return i})),Math.easeInOutQuad=function(t,e,a,r){return t/=r/2,t<1?a/2*t*t+e:(t--,-a/2*(t*(t-2)-1)+e)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function n(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(t,e,a){var i=s(),o=t-i,u=20,c=0;e="undefined"===typeof e?500:e;var l=function t(){c+=u;var s=Math.easeInOutQuad(c,i,o,e);n(s),c<e?r(t):a&&"function"===typeof a&&a()};l()}},"0a56":function(t,e,a){},5754:function(t,e,a){"use strict";a("0a56")},"5a4c":function(t,e,a){t.exports=a.p+"static/img/weekTimer.5a867c5d.png"},c466:function(t,e,a){"use strict";a.d(e,"n",(function(){return i})),a.d(e,"f",(function(){return o})),a.d(e,"g",(function(){return u})),a.d(e,"h",(function(){return c})),a.d(e,"i",(function(){return l})),a.d(e,"j",(function(){return d})),a.d(e,"e",(function(){return m})),a.d(e,"d",(function(){return f})),a.d(e,"a",(function(){return p})),a.d(e,"b",(function(){return h})),a.d(e,"c",(function(){return v})),a.d(e,"k",(function(){return g})),a.d(e,"l",(function(){return k})),a.d(e,"m",(function(){return b}));a("a481");var r=a("5a0c"),n=a.n(r),s=a("56d7");function i(t){var e=t.getFullYear(),a=t.getMonth()+1,r=t.getDate();return a=a<10?"0"+a:a,r=r<10?"0"+r:r,e+"-"+a+"-"+r}function o(t){return t.setDate(1),t}function u(t){var e=t.getMonth(),a=++e,r=new Date(t.getFullYear(),a,1),n=864e5;return new Date(r-n)}function c(t){var e=new Date(t.replace(/-/g,"/")).getTime(),a=new Date(t);0==a.getDay()&&(e-=6048e5);var r=e-24*(a.getDay()-1)*60*60*1e3,n=new Date(r),s=n.getFullYear(),i=n.getMonth()+1<10?"0"+(n.getMonth()+1):n.getMonth()+1,o=n.getDate()<10?"0"+n.getDate():n.getDate(),u=s+"-"+i+"-"+o;return u}function l(t){var e=new Date(t.replace(/-/g,"/")).getTime(),a=new Date(t),r=7-a.getDay();7==r&&(r=0);var n=e+24*r*60*60*1e3,s=new Date(n),i=s.getFullYear(),o=s.getMonth()+1<10?"0"+(s.getMonth()+1):s.getMonth()+1,u=s.getDate()<10?"0"+s.getDate():s.getDate(),c=i+"-"+o+"-"+u;return c}function d(t){var e=new Date(t.replace(/-/g,"/")).getDay();return 0===e&&(e=7),e}function m(t,e,a){return Math.abs(n()(t+" "+e).diff(t+" "+a,"Minute"))}function f(t,e,a){var r=n()(t+" "+e).add(a,"minute");return n()(t+" 21:00").isBefore(r)?(s["$message"].error("课程结束时间不可超过21:00点,请重新设置开始时间"),""):r.format("HH:mm")}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=n()("2021-12-17 "+t).add(e,"minute");return a.format("HH:mm:ss")}function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=n()("2021-12-17 "+t).add(e,"minute").add(1,"second");return a.format("HH:mm:ss")}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=n()("2021-12-17 "+t).add(e,"minute").subtract(1,"second");return a.format("HH:mm:ss")}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=n()("2021-12-17 "+t).subtract(e,"minute");return a.format("HH:mm:ss")}function k(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=n()("2021-12-17 "+t).subtract(e,"minute").add(1,"second");return a.format("HH:mm:ss")}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=n()("2021-12-17 "+t).subtract(e,"minute").subtract(1,"second");return a.format("HH:mm:ss")}},c66f3:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"m-container"},[a("h2",[a("el-page-header",{attrs:{content:t.title},on:{back:t.onCancel}})],1),t._v(" "),a("el-date-picker",{attrs:{type:"week",format:"yyyy-MM 第 WW 周","value-format":"yyyy-MM-dd",placeholder:"选择周","picker-options":{firstDayOfWeek:1}},on:{change:t.changeWeek},model:{value:t.week,callback:function(e){t.week=e},expression:"week"}}),t._v(" "),a("div",{staticClass:"m-core",staticStyle:{"margin-top":"20px"}},[a("div",{staticClass:"taskList"},[a("div",{staticClass:"teamDot dotBtn",attrs:{draggable:"true"},on:{click:t.drop,dragstart:function(e){return t.dragstart(e)}}},[t._v("\n 下校巡查\n ")]),t._v(" "),a("p",[t._v("\n 任务数量:"),a("span",{style:t.times>t.activeTotal?"color:red":""},[t._v(t._s(t.activeTotal))]),t._v("/"),a("span",[t._v(t._s(t.times))])])]),t._v(" "),a("div",{staticClass:"timeWrap"},[a("div",{staticClass:"weekDotList"},t._l(t.weekList,(function(e,r){return a("div",{key:r,staticClass:"weekDot"},[a("p",{staticClass:"week"},[t._v(t._s(e.week))]),t._v(" "),a("p",{staticClass:"date"},[t._v(t._s(e.dateStr))])])})),0),t._v(" "),a("div",{staticClass:"timer",on:{drop:t.drop,dragover:function(e){return t.dragOver(e)}}},[a("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"imgWrap"},[a("img",{attrs:{src:t.timerImg}}),t._v(" "),t._l(t.taskList,(function(e,r){return a("div",{key:r+"new"},[a("el-popover",{attrs:{placement:"top",trigger:"hover"}},[a("p",[t._v("巡查日期:"+t._s(t._f("dayjsFormat")(e.planStart)))]),t._v(" "),a("p",[t._v("\n 巡查时间:"+t._s(t._f("dayjsFormatMinute")(e.planStart))+"~"+t._s(t._f("dayjsFormatMinute")(e.planEnd))+"\n ")]),t._v(" "),a("p",[t._v("巡查乐团:"+t._s(e.musicGroupName))]),t._v(" "),a("div",{staticClass:"teamDot dot",style:e.style,attrs:{slot:"reference"},on:{click:function(a){return t.resetSchedule(e)}},slot:"reference"},[t._v("\n 下校巡查\n ")])])],1)}))],2)])]),t._v(" "),t.taskStatus?a("el-dialog",{attrs:{title:t.isNew?"新增下校巡查":"修改下校巡查",width:"600px",visible:t.taskStatus},on:{"update:visible":function(e){t.taskStatus=e}}},[a("taskinfo",{ref:"taskinfo",attrs:{taskInfo:t.activeTask,rangeStart:t.rangeStart,rangeEnd:t.rangeEnd,MusicGroupList:t.MusicGroupList,itemId:t.itemId},on:{refreshList:t.refreshList}}),t._v(" "),a("div",{staticClass:"dialog-footer",staticStyle:{"margin-top":"20px"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.taskStatus=!1}}},[t._v("取 消")]),t._v(" "),t.isNew?a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitInfo(0)}}},[t._v("确 定")]):a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitInfo(1)}}},[t._v("确 定")])],1)],1):t._e(),t._v(" "),a("taskList",{ref:"taskList",staticStyle:{"margin-top":"15px"},on:{resetSchedule:t.resetSchedule,getTotal:t.getTotal}})],1)],1)},n=[],s=(a("a481"),a("28a5"),a("7f7f"),a("c80c")),i=(a("96cf"),a("3b8d")),o=a("5a0c"),u=a.n(o),c=a("8179"),l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-form",{ref:"form",attrs:{model:t.taskForm,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"日期",rules:[{required:!0,message:"请选择日期"}],prop:"date"}},[a("el-date-picker",{staticStyle:{width:"410px"},attrs:{"value-format":"yyyy-MM-dd",type:"date","picker-options":t.rangeDate(t.rangeStart,t.rangeEnd),placeholder:"选择日期"},model:{value:t.taskForm.date,callback:function(e){t.$set(t.taskForm,"date",e)},expression:"taskForm.date"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"开始时间",rules:[{required:!0,message:"请选择开始时间"}],prop:"startTimer"}},[a("el-time-picker",{staticStyle:{width:"410px"},attrs:{format:"HH:mm","value-format":"HH:mm",placeholder:"选择时间范围","picker-options":{selectableRange:"07:00:00-22:00:00"}},on:{change:t.changeStartTime},model:{value:t.taskForm.startTimer,callback:function(e){t.$set(t.taskForm,"startTimer",e)},expression:"taskForm.startTimer"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"结束时间",rules:[{required:!0,message:"请选择结束时间"}],prop:"endTimer"}},[a("el-time-picker",{staticStyle:{width:"410px"},attrs:{format:"HH:mm","value-format":"HH:mm",placeholder:"选择时间范围",disabled:!t.taskForm.startTimer,"picker-options":{selectableRange:t.taskForm.startTimer+":00-22:00:00"}},model:{value:t.taskForm.endTimer,callback:function(e){t.$set(t.taskForm,"endTimer",e)},expression:"taskForm.endTimer"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"乐团",rules:[{required:!0,message:"请选择乐团"}],prop:"musicGroupId"}},[a("el-select",{staticStyle:{width:"410px !important"},attrs:{clearable:"",filterable:""},model:{value:t.taskForm.musicGroupId,callback:function(e){t.$set(t.taskForm,"musicGroupId",e)},expression:"taskForm.musicGroupId"}},t._l(t.MusicGroupList,(function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.id}})})),1)],1),t._v(" "),a("el-form-item",[a("p",{staticStyle:{color:"red"}},[t._v("注意:请确认当天该乐团有课,否则将无法提交乐团巡查表")])])],1)],1)},d=[],m={props:["taskInfo","rangeStart","rangeEnd","MusicGroupList","itemId"],data:function(){return{taskForm:{date:"",endTimer:"",startTimer:"",musicGroupId:"",userId:""},timerStr:""}},mounted:function(){this.checkTimes(),this.userId=this.$route.query.teacher,this.taskInfo&&(this.taskForm.date=this.taskInfo.planStart,this.taskForm.startTimer=u()(this.taskInfo.planStart).format("HH:mm:ss"),this.taskForm.endTimer=u()(this.taskInfo.planEnd).format("HH:mm:ss"),this.taskForm.musicGroupId=this.taskInfo.musicGroupId)},methods:{rangeDate:function(t,e){var a=this;return{firstDayOfWeek:1,disabledDate:function(r){if(e&&t)return"before"==a.timerStr?new Date(e).getTime()<=r.getTime()||new Date(t).getTime()-864e5>=r.getTime():"middle"!=a.timerStr||(new Date(e).getTime()<=r.getTime()||(new Date).getTime()-864e5>=r.getTime())}}},submitInfo:function(t){var e=this;this.$refs.form.validate(function(){var a=Object(i["a"])(Object(s["a"])().mark((function a(r){var n,i;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(!r){a.next=28;break}if(n=u()(e.taskForm.date).format("YYYY-MM-DD")+" "+e.taskForm.startTimer,i=u()(e.taskForm.date).format("YYYY-MM-DD")+" "+e.taskForm.endTimer,!t){a.next=18;break}return console.log("提交修改"),a.prev=5,a.next=8,Object(c["A"])({musicGroupId:e.taskForm.musicGroupId,planStart:n,planEnd:i,itemId:e.itemId,id:e.taskInfo.id,userId:e.userId});case 8:a.sent,e.$message.success("提交成功"),e.$emit("refreshList",e.taskForm.date),a.next=16;break;case 13:a.prev=13,a.t0=a["catch"](5),console.log(a.t0);case 16:a.next=28;break;case 18:return a.prev=18,a.next=21,Object(c["a"])({musicGroupId:e.taskForm.musicGroupId,planStart:n,planEnd:i,itemId:e.itemId,userId:e.userId});case 21:a.sent,e.$message.success("提交成功"),e.$emit("refreshList",e.taskForm.date),a.next=28;break;case 26:a.prev=26,a.t1=a["catch"](18);case 28:case"end":return a.stop()}}),a,null,[[5,13],[18,26]])})));return function(t){return a.apply(this,arguments)}}())},changeStartTime:function(t){this.taskForm.endTimer=""},checkTimes:function(){var t=u()(this.rangeStart).valueOf(),e=u()(this.rangeEnd).valueOf(),a=u()(new Date).valueOf();a<t?this.timerStr="before":t<a&&a<e?this.timerStr="middle":a>e&&(this.timerStr="after")}}},f=m,p=a("2877"),h=Object(p["a"])(f,l,d,!1,null,"4365d5ca",null),v=h.exports,g=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-table",{staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#EDEEF0",color:"#444"},data:t.tableList}},[a("el-table-column",{attrs:{align:"center",prop:"studentId",label:"事项"}},[[a("div",[t._v("下校巡查")])]],2),t._v(" "),a("el-table-column",{attrs:{align:"center",prop:"studentId",label:"时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",[t._v("\n "+t._s(e.row.planStart)+"-"+t._s(t._f("dayjsFormatMinute")(e.row.planEnd))+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",prop:"cooperationName",label:"合作单位"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",prop:"musicGroupName",label:"乐团"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",prop:"studentId",label:"是否完成"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",[t._v("\n "+t._s(e.row.status>0?"已完成":"未完成")+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",prop:"studentId",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("auth",{attrs:{auths:["inspectionItemPlan/update"]}},[a("div",[a("el-button",{attrs:{type:"text",disabled:!!e.row.status},on:{click:function(a){return t.resetList(e.row)}}},[t._v("修改日程")])],1)])]}}])})],1),t._v(" "),a("pagination",{attrs:{"save-key":"teamSchedule-taskList",sync:"",total:t.rules.total,page:t.rules.page,limit:t.rules.limit,"page-sizes":t.rules.page_size},on:{"update:total":function(e){return t.$set(t.rules,"total",e)},"update:page":function(e){return t.$set(t.rules,"page",e)},"update:limit":function(e){return t.$set(t.rules,"limit",e)},pagination:t.getList}})],1)},k=[],b=a("333d"),w={components:{pagination:b["a"]},data:function(){return{tableList:[],rangeStart:"",rangeEnd:"",rules:{limit:10,page:1,total:0,page_size:[10,20,40,50]}}},mounted:function(){this.rangeStart=this.$route.query.startTime,this.rangeEnd=this.$route.query.endTime,this.userId=this.$route.query.teacher,this.itemId=this.$route.query.itemId,this.getList()},methods:{getList:function(){var t=Object(i["a"])(Object(s["a"])().mark((function t(){var e;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(c["i"])({startTime:this.rangeStart,endTime:this.rangeEnd,userId:this.userId,page:this.rules.page,rows:this.rules.limit,itemId:this.itemId});case 3:e=t.sent,this.tableList=e.data.rows,this.rules.total=e.data.total,this.$emit("getTotal",e.data.total),t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),console.log(t.t0);case 12:case"end":return t.stop()}}),t,this,[[0,9]])})));function e(){return t.apply(this,arguments)}return e}(),resetList:function(t){this.$emit("resetSchedule",t)}}},T=w,y=Object(p["a"])(T,g,k,!1,null,"a2be853e",null),_=y.exports,I=a("ec8a"),S=a("c466"),D={name:"scheduleDetail",components:{taskinfo:v,taskList:_},data:function(){return{timerImg:a("5a4c"),active:-1,week:new Date,weekList:[],startTime:"",endTime:"",taskList:[],weekDay:["周一","周二","周三","周四","周五","周六","周日"],tableTime:"",title:"",userId:"",taskStatus:!1,activeTask:null,isNew:!1,rangeStart:"",rangeEnd:"",organId:"",MusicGroupList:[],times:"",activeTotal:""}},mounted:function(){var t=Object(i["a"])(Object(s["a"])().mark((function t(){var e;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.init(),t.prev=1,t.next=4,Object(c["j"])({organId:this.organId,userId:this.userId});case 4:e=t.sent,this.MusicGroupList=e.data,t.next=10;break;case 8:t.prev=8,t.t0=t["catch"](1);case 10:case"end":return t.stop()}}),t,this,[[1,8]])})));function e(){return t.apply(this,arguments)}return e}(),methods:{init:function(){this.times=this.$route.query.times,this.itemId=this.$route.query.itemId,this.organId=this.$route.query.organId,this.rangeStart=this.$route.query.startTime,this.rangeEnd=this.$route.query.endTime,this.week=this.$route.query.startTime,this.userId=this.$route.query.teacher,this.startTime=this.$route.query.startTime;var t=u()(this.startTime).format("MM");this.title="".concat(this.$route.query.name).concat(t,"月下校巡查安排"),this.getCalendatList(),this.setWeekList()},setStartTimeAndEndTime:function(t){this.startTime=Object(S["h"])(t),-1===this.active&&(this.active=0,this.tableTime=this.startTime),this.endTime=Object(S["i"])(t)},getCalendatList:function(){var t=Object(i["a"])(Object(s["a"])().mark((function t(){var e,a;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.setStartTimeAndEndTime(this.week),t.prev=1,t.next=4,Object(c["i"])({startTime:this.startTime,endTime:this.endTime,userId:this.userId,itemId:this.itemId,page:1,rows:9999});case 4:for(a in e=t.sent,this.dataList=e.data.rows,this.taskList=[],this.dataList)this.setCourseTime(this.dataList[a]),this.taskList.push(this.dataList[a]);t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](1),t.t0;case 13:case"end":return t.stop()}}),t,this,[[1,10]])})));function e(){return t.apply(this,arguments)}return e}(),setCourseTime:function(t){var e=this.getMinutes(t.planStart.split(" ")[1]),a=this.getMinutes(t.planEnd.split(" ")[1]),r=1.8*(a-e),n=e-420>0?1.8*(e-420)+17:17,s=1===Object(S["j"])(t.planStart)?40:60*Object(S["j"])(t.planStart)-16;t.style={width:r+"px",top:s+"px",left:n+"px"}},getMinutes:function(t){return 60*parseInt(t.split(":")[0])+parseInt(t.split(":")[1])},setWeekList:function(){this.weekList=[];var t=new Date(this.startTime.replace(/-/g,"/"));t.setTime(t.getTime()-864e5);for(var e=0;e<7;e++)t.setTime(t.getTime()+864e5),this.weekList.push({week:this.weekDay[e],dateStr:t.getMonth()+1+"月"+t.getDate()+"日",date:Object(S["n"])(t)})},setWeekDotList:function(t,e){this.active=e,this.tableTime=t.date},changeWeek:function(t){this.week=t,this.active=-1,this.getCalendatList(),this.setWeekList(),this.$refs.taskList.getList()},onCancel:function(){this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/workbench",query:{tabrouter:"teamSchedule"}})},drop:function(t){this.isNew=!0,this.activeTask=null,this.taskStatus=!0},dragOver:function(t){t.preventDefault()},dragstart:function(t){},submitInfo:function(t){this.$refs.taskinfo.submitInfo(t)},refreshList:function(t){this.taskStatus=!1,this.changeWeek(t)},resetSchedule:function(t){Object(I["a"])("inspectionItemPlan/update")&&(this.isNew=!1,this.activeTask=t,this.taskStatus=!0)},getTotal:function(t){this.activeTotal=t}},directives:{drag:function(t){var e=t;e.onmousedown=function(t){var a=t.clientX-e.offsetLeft,r=(t.clientY,e.offsetTop,document.querySelector(".timer").offsetWidth),n=document.querySelector(".imgWrap").offsetWidth;return document.onmousemove=function(t){var s=t.clientX-a;t.clientY;s>0?s=0:s<2-(n-r)&&(s=2-(n-r)),e.style.left=s+"px"},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null},!1}}}},L=D,F=(a("5754"),Object(p["a"])(L,r,n,!1,null,"57c7cc57",null));e["default"]=F.exports}}]);
|