detail.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('Yunshop\Appointment::pack.work_time'))
  4. <style type="text/css">
  5. .my-calendar .fc-day{
  6. cursor: pointer;
  7. }
  8. </style>
  9. <div class="w1200 m0a">
  10. <div class="right-titpos">
  11. <ul class="add-snav">
  12. <li class="active"><a href="#">{!! trans('Yunshop\Appointment::pack.work_time') !!}</a></li>
  13. </ul>
  14. </div>
  15. @if($set['worker_time_type']=='1')
  16. {{--店长排班--}}
  17. <div class="form-group">
  18. <a class="btn btn-success" href="{{yzWebUrl(\Yunshop\Appointment\admin\WorkTimeController::ADD_WORK_TIMES_URL, ['worker_id' => $worker_id])}}" title='添加工作时间' ><i class='fa fa-plus'></i> 添加工作时间</a>
  19. </div>
  20. @else
  21. <div class="form-group">
  22. <div class="panel panel-default">
  23. <div class="panel-heading">
  24. 默认工作时间
  25. <a class="btn btn-success" href="{{yzWebUrl(\Yunshop\Appointment\admin\WorkTimeController::ADD_DEFAULT_WORK_TIMES_URL, ['worker_id' => $worker_id])}}" style="color:#fff;" > 添加默认工作时间</a>
  26. </div>
  27. <div class="panel-body table-responsive">
  28. <table cellspacing="0" cellpadding="0" class="table table-hover">
  29. <thead class="navbar-inner">
  30. <tr>
  31. <th class="col-md-3 col-lg-3">id</th>
  32. <th class="col-md-5 col-lg-3">开始时间</th>
  33. <th class="col-md-5 col-lg-3">结束时间</th>
  34. <th class="col-md-3 col-lg-3">操作</th>
  35. </tr>
  36. </thead>
  37. @foreach ($default_times as $v)
  38. <tr class="js-time-tr-show{{$v['id']}}">
  39. <td>{{$v['id']}}</td>
  40. <td class="js-show-work_hour_start">{{$v['work_hour_start']}}</td>
  41. <td class="js-show-work_hour_end">{{$v['work_hour_end']}}</td>
  42. <td>
  43. <a class="btn btn-success" onclick="delTime({{$v['id']}})" title='删除' >删除</a>
  44. </td>
  45. </tr>
  46. @endforeach
  47. </table>
  48. </div>
  49. </div>
  50. </div>
  51. @endif
  52. <div class="my-calendar" style="overflow: auto">
  53. </div>
  54. </div>
  55. <script>
  56. function delTime(id){
  57. $.ajax({
  58. url: "{!! yzWebUrl('plugin.appointment.admin.workTime.delDefaultWorkTimes') !!}",
  59. type: "post",
  60. data: {
  61. time_id:id
  62. },
  63. cache: false,
  64. success: function (data) {
  65. alert(data.msg);
  66. if(!data.result){
  67. }else{
  68. window.location.reload();
  69. }
  70. }
  71. })
  72. }
  73. $(function(){
  74. var calendar = $('.my-calendar').fullCalendar({
  75. /*customButtons: {
  76. myCustomButton: {
  77. text: '自定义按钮',
  78. click: function() {
  79. alert('点击了自定义按钮!');
  80. }
  81. }
  82. },*/
  83. header: {
  84. left: '',
  85. center: 'prev title next',
  86. right: ''
  87. },
  88. locale:'zh-cn',
  89. firstDay:1,
  90. views:{
  91. month:{
  92. titleFormat:"YYYY年M月"
  93. },
  94. week:{
  95. titleFormat:"YYYY年M月D日",
  96. columnFormat:"M.D dddd"
  97. },
  98. day:{
  99. titleFormat:"YYYY年M月D日 dddd",
  100. columnFormat:"M/D dddd"
  101. }
  102. },
  103. monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  104. monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  105. dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  106. dayNamesShort: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  107. //editable: true,
  108. //eventLimit: true,
  109. //allDaySlot : false,
  110. //events:[{title: "10:00~12:00", start: "2020-09-03"}],
  111. eventClick: function( calEvent, jsEvent, view ){
  112. var dateFmt = moment(calEvent.start).format("YYYY-MM-DD");
  113. window.location.href = "{!! yzWebUrl('plugin.appointment.admin.workTime.eidtDateWorkTimesView',['worker_id'=>$worker_id]) !!}"+"&work_date="+dateFmt;
  114. },
  115. dayClick: function(date, allDay, jsEvent, view) {
  116. console.log('dayClick');
  117. var dateFmt = moment(date).format("YYYY-MM-DD");
  118. window.location.href = "{!! yzWebUrl('plugin.appointment.admin.workTime.eidtDateWorkTimesView',['worker_id'=>$worker_id]) !!}"+"&work_date="+dateFmt;
  119. },
  120. timeFormat: 'H:mm'
  121. });
  122. getWorkTimes();
  123. function getWorkTimes(){
  124. $.ajax({
  125. url: "{!! yzWebUrl('plugin.appointment.admin.workTime.getAllWorkTimes') !!}",
  126. type: "post",
  127. data: {worker_id: "{!! $worker_id !!}"},
  128. cache: false,
  129. success: function (data) {
  130. calendar.fullCalendar('renderEvents',data,true);
  131. }
  132. })
  133. }
  134. });
  135. </script>
  136. @endsection