阜外心血管项目前端

Data.html 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. $.ajax({
  116. type: "get",
  117. url: huayi.config.callcenter_url + "WorkOffDays/GetList",
  118. dataType: 'json',
  119. async: true,
  120. data: {
  121. "token": $.cookie("token")
  122. },
  123. success: function (data) {
  124. /*验证请求*/
  125. //工作日
  126. var arr = [];
  127. var time;
  128. $(data.data).each(function (i, n) {
  129. time = n.start.substring(0, n.start.indexOf(' '))
  130. arr.push(time);
  131. });
  132. $(".fc-day").each(function (i, n) {
  133. var state = '<font class="redFont" style="font-weight: bold;background: #FFAB3D;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">班</font>';
  134. $(n).children().find('.fc-day-content').append(state);
  135. var a = $(this).attr("data-date")
  136. $(arr).each(function (j, k) {
  137. if (k == a) {
  138. if ($(n).children().find('.redFont')) {
  139. $(n).children().find('.redFont').text('休');
  140. $(n).children().find('.redFont').css('background-color', 'red');
  141. $(n).children().find('.redFont').addClass("offday");
  142. }
  143. }
  144. })
  145. // if($.inArray($(n).attr("data-date"),arr)){
  146. // var state = '<font class="redFont" style="font-weight: bold;background: #FFAB3D;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">班</font>';
  147. // $(this).children().find('.fc-day-content').append(state);
  148. // if(cdate == $(this).attr("data-date")){
  149. // //alert(cdate);
  150. // //console.info($(this).children().find('.fc-day-content'));
  151. // if(state=='班'){
  152. // state ='<font class="redFont" style="font-weight: bold;background: #FFAB3D;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">班</font>';
  153. // }else{
  154. // state ='<font class="redFont" style="font-weight: bold;background: #37ABEC;color: #fff;padding: 5px;font-size: 16px;border-radius: 5px;">休</font>';
  155. // }
  156. // $(this).children().find('.fc-day-content').append(state);
  157. // }
  158. //}
  159. })
  160. callback(data.data);
  161. }
  162. });
  163. },
  164. dayClick: function (date, allDay, jsEvent, view) {
  165. $(this).children().children().find('.redFont').text();
  166. var Time = $(this).attr("data-date");
  167. var type = 1;
  168. if ($(this).children().children().find('.redFont').text() != "休") {
  169. layer.confirm('确定休息日吗?', {
  170. btn: ['是', '否'] //按钮
  171. }, function () {
  172. $.ajax({
  173. type: "post",
  174. url: huayi.config.callcenter_url + "WorkOffDays/setOfforOn",
  175. dataType: 'json',
  176. async: true,
  177. data: {
  178. offdate: Time,
  179. token: $.cookie("token"),
  180. type: 0
  181. },
  182. success: function (data) {
  183. /*验证请求*/
  184. if (data.state.toLowerCase() == "success") {
  185. layer.msg("修改成功");
  186. blur();
  187. }
  188. }
  189. });
  190. });
  191. } else {
  192. layer.confirm('确定设为工作日吗?', {
  193. btn: ['是', '否'] //按钮
  194. }, function () {
  195. $.ajax({
  196. type: "post",
  197. url: huayi.config.callcenter_url + "WorkOffDays/setOfforOn",
  198. dataType: 'json',
  199. async: true,
  200. data: {
  201. offdate: Time,
  202. token: $.cookie("token"),
  203. type: 1
  204. },
  205. success: function (data) {
  206. /*验证请求*/
  207. if (data.state.toLowerCase() == "success") {
  208. layer.msg("修改成功");
  209. blur();
  210. }
  211. }
  212. });
  213. });
  214. }
  215. }
  216. });
  217. }
  218. });
  219. </script>
  220. </body>
  221. </html>