123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- {extend name="common/common2" /}
- {block name="css"}
- <link rel="stylesheet" href="/static/fullcalendar-3.10.2/fullcalendar.css">
- {/block}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>排班表</h5>
- <div class="ibox-tools">
- <a class="toback" href="{:url('index')}">
- 返回上一页
- </a>
- </div>
- </div>
- <div class="ibox-content">
- <div id="calendar"></div>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script src='/static/fullcalendar-3.10.2/lib/moment.min.js'></script>
- <script src='/static/fullcalendar-3.10.2/fullcalendar.js'></script>
- <script src='/static/fullcalendar-3.10.2/locale-all.js'></script>
- <script src="/static/fullcalendar-3.10.2/locale/zh-cn.js"></script>
- <script src="/static/form.js"></script>
- <script src="/static/study/js/base.js"></script>
- <script>
- var url = "{:url('AttendanceGroup/pbjson',['id'=>$id])}";
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y = date.getFullYear();
- $(function (){
- var calendar = $('#calendar').fullCalendar({
- firstDay: 1,
- locale:'zh-cn',
- currentTimezone: 'Asia/Shanghai',
- eventLimit: false, //多个记录,显示更多查看
- buttonText: {
- prev: '<',
- next: '>',
- prevYear: '去年',
- nextYear: '明年',
- today: '今天',
- month: '月',
- week: '周',
- day: '日'
- },
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- events: url,
- loading: function(bool) {
- if (bool) {
- var layerIndex = layer.load(1);
- } else {
- layer.closeAll('loading');
- }
- },
- eventRender: function(event, element) {
- element.html(event.title);
- },
- editable: false,
- selectable: true,
- selectHelper: true,
- select: function(start, end, allDay) {
- var start = formatDateTime(new Date(start));
- var end = formatDateTime(new Date(end));
- console.log(allDay)
- var addurl = "{:url('addGroupClass',['id'=>$id])}?start=" + start + "&end=" + end;
- jFlyer.show_dialog_form("添加修改", addurl);
- calendar.fullCalendar('unselect');
- }
- ,
- eventClick: function(calEvent, jsEvent, view) {
- var start = formatDateTime(new Date(calEvent.start));
- var end = formatDateTime(new Date(calEvent.end));
- // var addurl = "addGroupClass?id=<?=$id?>&start=" + start + "&end=" + end;
- console.log(calEvent)
- var addurl = "{:url('addGroupClass',['id'=>$id])}?start=" + start + "&end=" + end+'&group_id='+calEvent.taskid
- jFlyer.show_dialog_form("添加修改", addurl);
- calendar.fullCalendar('unselect');
- }
- });
- })
- var formatDateTime = function(date) {
- date = new Date(date.getTime() + date.getTimezoneOffset() * 60000);
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- m = m < 10 ? ('0' + m) : m;
- var d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- var h = date.getHours();
- h = h < 10 ? ('0' + h) : h;
- var minute = date.getMinutes();
- minute = minute < 10 ? ('0' + minute) : minute;
- var second = date.getSeconds();
- second = second < 10 ? ('0' + second) : second;
- return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
- };
- </script>
- {/block}
|