阜外心血管项目前端

Data.html 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link rel="stylesheet" href="../css/init.css" />
  8. <link href="../js/fullcalendar/fullcalendar.css" rel="stylesheet" />
  9. <title>系统管理-->排班管理</title>
  10. <style>
  11. .fc-event-title {
  12. color: white;
  13. }
  14. .group {
  15. margin-bottom: 5px;
  16. }
  17. .seatuser {
  18. color: black;
  19. padding: 5px 10px;
  20. border-radius: 2px;
  21. cursor: pointer;
  22. margin-bottom: 5px;
  23. background-color: #f3f3f4;
  24. }
  25. .active {
  26. background-color: #1ab394;
  27. color: #fff;
  28. }
  29. .lable {
  30. /*display: none;*/
  31. background-color: #d1dade;
  32. color: #5e5e5e;
  33. font-size: 10px;
  34. padding: 3px 8px;
  35. text-shadow: none;
  36. font-size: 75%;
  37. font-weight: 700;
  38. line-height: 1;
  39. text-align: center;
  40. white-space: nowrap;
  41. vertical-align: baseline;
  42. border-radius: .25em;
  43. margin: 3px;
  44. float: left;
  45. cursor: pointer;
  46. }
  47. .active ~ .lable {
  48. display: inline;
  49. }
  50. .fc-ltr .fc-event-hori.fc-event-end,
  51. .fc-rtl .fc-event-hori.fc-event-start {
  52. display: none;
  53. }
  54. </style>
  55. </head>
  56. <body class="gray-bg">
  57. <div class="container-fluid wrapper-content animated fadeInRight">
  58. <div class="col-sm-12">
  59. <div id="calendar"></div>
  60. </div>
  61. </div>
  62. <script src="../js/fullcalendar/fullcalendar.min.js"></script>
  63. <script>
  64. var bl = false;
  65. var flag = true;
  66. blur();
  67. $(document).ready(function() {
  68. blur();
  69. function blur() {
  70. var rl = $('#RoleCode', top.document).val();
  71. var gcode = $('#GroupCode', top.document).val();
  72. $('#calendar').html("");
  73. var dates = new Date();
  74. var time = dates.getFullYear() + "-" + (dates.getMonth() + 1) + '-' + dates.getDate();
  75. var date = new Date();
  76. var d = date.getDate();
  77. var m = date.getMonth();
  78. var y = date.getFullYear();
  79. $('#calendar').fullCalendar({
  80. header: {
  81. //left: 'month,agendaWeek,agendaDay',
  82. left: 'month',
  83. center: 'title',
  84. right: 'today, prev, next'
  85. },
  86. monthNames: ['年1月', '年2月', '年3月', '年4月', '年5月', '年6月', '年7月', '年8月', '年9月', '年10月', '年11月', '年12月'],
  87. monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  88. dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
  89. dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  90. titleFormat: {
  91. month: "yyyy MMMM "
  92. },
  93. firstDay: "1",
  94. editable: false,
  95. droppable: bl,
  96. weekMode: 'liquid',
  97. // eventDrop: function (event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
  98. // var g = event.start;
  99. // var c = g.getDate();
  100. // var a = g.getMonth() + 1;
  101. // var e = g.getFullYear();
  102. // $.post(huayi.config.callcenter_url + 'GroupClass/AddGroupClass', {
  103. // id: event.id, date: e + '-' + a + '-' + c, groupcode: event.groupcode, classcode: event.classcode,
  104. // "token": $.cookie("token")
  105. // }, function (result) {
  106. // result = JSON.parse(result);
  107. // if (result.state.toLowerCase() != "success") {
  108. // revertFunc();
  109. // }
  110. // })
  111. // },
  112. events: function(start, end, callback) {
  113. var st = $.fullCalendar.formatDate(start, "yyyy-MM-dd");
  114. var ed = $.fullCalendar.formatDate(end, "yyyy-MM-dd");
  115. console.log(ed);
  116. $.ajax({
  117. type: "get",
  118. url: huayi.config.callcenter_url + "WorkOffDays/GetList",
  119. dataType: 'json',
  120. async: true,
  121. data: {
  122. "token": $.cookie("token")
  123. },
  124. success: function(data) {
  125. /*验证请求*/
  126. //工作日
  127. var arr = [];
  128. console.log(data.data);
  129. var time;
  130. $(data.data).each(function(i, n) {
  131. time = n.start.substring(0, n.start.indexOf(' '))
  132. arr.push(time);
  133. });
  134. $(".fc-day").each(function(i, n) {
  135. var state = '<font class="redFont" style="font-weight: bold;background: #FFAB3D;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">班</font>';
  136. $(n).children().find('.fc-day-content').append(state);
  137. var a = $(this).attr("data-date")
  138. $(arr).each(function(j, k) {
  139. if(k == a) {
  140. if($(n).children().find('.redFont')) {
  141. $(n).children().find('.redFont').text('休');
  142. $(n).children().find('.redFont').css('background-color', 'red');
  143. $(n).children().find('.redFont').addClass("offday");
  144. }
  145. }
  146. })
  147. // if($.inArray($(n).attr("data-date"),arr)){
  148. // var state = '<font class="redFont" style="font-weight: bold;background: #FFAB3D;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">班</font>';
  149. // $(this).children().find('.fc-day-content').append(state);
  150. // if(cdate == $(this).attr("data-date")){
  151. // //alert(cdate);
  152. // //console.info($(this).children().find('.fc-day-content'));
  153. // if(state=='班'){
  154. // state ='<font class="redFont" style="font-weight: bold;background: #FFAB3D;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">班</font>';
  155. // }else{
  156. // state ='<font class="redFont" style="font-weight: bold;background: #37ABEC;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">休</font>';
  157. // }
  158. // $(this).children().find('.fc-day-content').append(state);
  159. // }
  160. //}
  161. })
  162. callback(data.data);
  163. }
  164. });
  165. },
  166. dayClick: function(date, allDay, jsEvent, view) {
  167. console.log($(this).attr("data-date"));
  168. $(this).children().children().find('.redFont').text();
  169. console.log($(this).children().children().find('.redFont').text())
  170. var Time = $(this).attr("data-date");
  171. console.log(Time);
  172. var type = 1;
  173. if($(this).children().children().find('.redFont').text() != "休") {
  174. layer.confirm('确定休息日吗?', {
  175. btn: ['是', '否'] //按钮
  176. }, function() {
  177. $.ajax({
  178. type: "post",
  179. url: huayi.config.callcenter_url + "WorkOffDays/setOfforOn",
  180. dataType: 'json',
  181. async: true,
  182. data: {
  183. offdate: Time,
  184. token: $.cookie("token"),
  185. type: 0
  186. },
  187. success: function(data) {
  188. /*验证请求*/
  189. if(data.state.toLowerCase() == "success") {
  190. layer.msg("修改成功");
  191. blur();
  192. }
  193. }
  194. });
  195. });
  196. }else{
  197. layer.confirm('确定设为工作日吗?', {
  198. btn: ['是', '否'] //按钮
  199. }, function() {
  200. $.ajax({
  201. type: "post",
  202. url: huayi.config.callcenter_url + "WorkOffDays/setOfforOn",
  203. dataType: 'json',
  204. async: true,
  205. data: {
  206. offdate: Time,
  207. token: $.cookie("token"),
  208. type: 1
  209. },
  210. success: function(data) {
  211. /*验证请求*/
  212. if(data.state.toLowerCase() == "success") {
  213. layer.msg("修改成功");
  214. blur();
  215. }
  216. }
  217. });
  218. });
  219. }
  220. }
  221. });
  222. }
  223. });
  224. </script>
  225. </body>
  226. </html>