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