| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- @extends('layouts.base')
- @section('content')
- @section('title', trans('Yunshop\Appointment::pack.work_time'))
- <style type="text/css">
- .my-calendar .fc-day{
- cursor: pointer;
- }
- </style>
- <div class="w1200 m0a">
- <div class="right-titpos">
- <ul class="add-snav">
- <li class="active"><a href="#">{!! trans('Yunshop\Appointment::pack.work_time') !!}</a></li>
- </ul>
- </div>
- @if($set['worker_time_type']=='1')
- {{--店长排班--}}
- <div class="form-group">
- <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>
- </div>
- @else
- <div class="form-group">
- <div class="panel panel-default">
- <div class="panel-heading">
- 默认工作时间
- <a class="btn btn-success" href="{{yzWebUrl(\Yunshop\Appointment\admin\WorkTimeController::ADD_DEFAULT_WORK_TIMES_URL, ['worker_id' => $worker_id])}}" style="color:#fff;" > 添加默认工作时间</a>
- </div>
- <div class="panel-body table-responsive">
- <table cellspacing="0" cellpadding="0" class="table table-hover">
- <thead class="navbar-inner">
- <tr>
- <th class="col-md-3 col-lg-3">id</th>
- <th class="col-md-5 col-lg-3">开始时间</th>
- <th class="col-md-5 col-lg-3">结束时间</th>
- <th class="col-md-3 col-lg-3">操作</th>
- </tr>
- </thead>
- @foreach ($default_times as $v)
- <tr class="js-time-tr-show{{$v['id']}}">
- <td>{{$v['id']}}</td>
- <td class="js-show-work_hour_start">{{$v['work_hour_start']}}</td>
- <td class="js-show-work_hour_end">{{$v['work_hour_end']}}</td>
- <td>
- <a class="btn btn-success" onclick="delTime({{$v['id']}})" title='删除' >删除</a>
- </td>
- </tr>
- @endforeach
- </table>
- </div>
- </div>
- </div>
- @endif
- <div class="my-calendar" style="overflow: auto">
- </div>
- </div>
- <script>
- function delTime(id){
- $.ajax({
- url: "{!! yzWebUrl('plugin.appointment.admin.workTime.delDefaultWorkTimes') !!}",
- type: "post",
- data: {
- time_id:id
- },
- cache: false,
- success: function (data) {
- alert(data.msg);
- if(!data.result){
- }else{
- window.location.reload();
- }
- }
- })
- }
- $(function(){
- var calendar = $('.my-calendar').fullCalendar({
- /*customButtons: {
- myCustomButton: {
- text: '自定义按钮',
- click: function() {
- alert('点击了自定义按钮!');
- }
- }
- },*/
- header: {
- left: '',
- center: 'prev title next',
- right: ''
- },
- locale:'zh-cn',
- firstDay:1,
- views:{
- month:{
- titleFormat:"YYYY年M月"
- },
- week:{
- titleFormat:"YYYY年M月D日",
- columnFormat:"M.D dddd"
- },
- day:{
- titleFormat:"YYYY年M月D日 dddd",
- columnFormat:"M/D dddd"
- }
- },
- monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
- monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
- dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
- dayNamesShort: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
- //editable: true,
- //eventLimit: true,
- //allDaySlot : false,
- //events:[{title: "10:00~12:00", start: "2020-09-03"}],
- eventClick: function( calEvent, jsEvent, view ){
- var dateFmt = moment(calEvent.start).format("YYYY-MM-DD");
- window.location.href = "{!! yzWebUrl('plugin.appointment.admin.workTime.eidtDateWorkTimesView',['worker_id'=>$worker_id]) !!}"+"&work_date="+dateFmt;
- },
- dayClick: function(date, allDay, jsEvent, view) {
- console.log('dayClick');
- var dateFmt = moment(date).format("YYYY-MM-DD");
- window.location.href = "{!! yzWebUrl('plugin.appointment.admin.workTime.eidtDateWorkTimesView',['worker_id'=>$worker_id]) !!}"+"&work_date="+dateFmt;
- },
- timeFormat: 'H:mm'
- });
- getWorkTimes();
- function getWorkTimes(){
- $.ajax({
- url: "{!! yzWebUrl('plugin.appointment.admin.workTime.getAllWorkTimes') !!}",
- type: "post",
- data: {worker_id: "{!! $worker_id !!}"},
- cache: false,
- success: function (data) {
- calendar.fullCalendar('renderEvents',data,true);
- }
- })
- }
- });
- </script>
- @endsection
|