ticketList.blade.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/fonts/themify/themify.min.css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container-fluid">
  7. <div class="row">
  8. <div class="col-lg-8 order-lg-1 order-2">
  9. <div class="panel panel-bordered">
  10. <div class="panel-heading p-20">
  11. <h1 class="panel-title cyan-600">
  12. <i class="icon wb-user-circle"></i>{{ trans('user.menu.tickets') }}
  13. </h1>
  14. <div class="panel-actions">
  15. <button class="btn btn-primary btn-animate btn-animate-side" data-toggle="modal" data-target="#add_ticket_modal">
  16. <span>
  17. <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('user.ticket.new') }}
  18. </span>
  19. </button>
  20. </div>
  21. </div>
  22. <div class="panel-body">
  23. <div class="table-responsive">
  24. <table class="table table-hover text-center">
  25. <thead class="thead-default">
  26. <tr>
  27. <th data-cell-style="cellStyle"> #</th>
  28. <th> {{ ucfirst(trans('validation.attributes.title')) }} </th>
  29. <th> {{ trans('common.status.attribute') }} </th>
  30. <th></th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. @foreach ($tickets as $ticket)
  35. <tr>
  36. <td>{{ $ticket->id }}</td>
  37. <td>{{ $ticket->title }}</td>
  38. <td>{!! $ticket->status_label !!}</td>
  39. <td>
  40. <a class="btn btn-animate btn-animate-vertical btn-outline-info"
  41. href="{{ route('replyTicket', ['id' => $ticket->id]) }}">
  42. <span>
  43. @if ($ticket->status === 2)
  44. <i class="icon wb-eye" aria-hidden="true" style="left: 40%"> </i>{{ trans('common.view') }}
  45. @else
  46. <i class="icon wb-check" aria-hidden="true" style="left: 40%"> </i>{{ trans('common.open') }}
  47. @endif
  48. </span>
  49. </a>
  50. </td>
  51. </tr>
  52. @endforeach
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. <div class="panel-footer">
  58. <div class="row">
  59. <div class="col-md-12">
  60. <nav class="Page navigation float-right">
  61. {{ $tickets->links() }}
  62. </nav>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="col-lg-4 order-lg-2 order-1">
  69. <div class="panel panel-bordered">
  70. <div class="panel-heading p-20">
  71. <h3 class="panel-title cyan-600">
  72. <i class="icon ti-headphone-alt"></i>{{ trans('user.ticket.service_hours') }}
  73. </h3>
  74. </div>
  75. <div class="panel-body pt-0">
  76. <ul class="list-group list-group-dividered list-group-full vertical-align-middle">
  77. <li class="list-group-item">
  78. <div class="row">
  79. <div class="col-lg-5 col-4">
  80. <button class="btn btn-pure ti-time blue-700"></button>
  81. {{ trans('user.ticket.online_hour') }}
  82. </div>
  83. <div class="col-lg-7 col-8 text-right">
  84. {{ trans('common.days.work') }} 23:00 - {{ trans('common.days.next') }} 11:00
  85. <br>
  86. {{ trans('common.days.weekend') }} 21:00 - {{ trans('common.days.next') }} 12:00
  87. </div>
  88. </div>
  89. </li>
  90. <li class="list-group-item">
  91. <div class="row">
  92. <div class="col-2">
  93. <button class="btn btn-pure ti-info-alt red-700"></button>
  94. </div>
  95. <div class="col-10">
  96. {!! trans('user.ticket.service_tips') !!}
  97. </div>
  98. </div>
  99. </li>
  100. </ul>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="modal fade" id="add_ticket_modal" data-focus-on="input:first" data-keyboard="false" tabindex="-1">
  107. <div class="modal-dialog modal-simple modal-center">
  108. <div class="modal-content">
  109. <div class="modal-header">
  110. <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
  111. <span aria-hidden="true">×</span>
  112. </button>
  113. <h4 class="modal-title"> {{ trans('user.ticket.new') }} </h4>
  114. </div>
  115. <div class="modal-body">
  116. <div class="row">
  117. <div class="col-xl-12 form-group">
  118. <input class="form-control" id="title" name="title" type="text" placeholder="{{ trans('user.ticket.title_placeholder') }}">
  119. </div>
  120. <div class="col-xl-12 form-group">
  121. <textarea class="form-control" id="content" name="content" rows="5" placeholder="{{ trans('user.ticket.content_placeholder') }}"></textarea>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="modal-footer">
  126. <button class="btn btn-danger mr-auto" data-dismiss="modal" type="button"> {{ trans('common.cancel') }} </button>
  127. <button class="btn btn-success" data-dismiss="modal" type="button" onclick="createTicket()"> {{ trans('common.confirm') }} </button>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. @endsection
  133. @section('javascript')
  134. <script>
  135. // 发起工单
  136. function createTicket() {
  137. const title = $('#title').val();
  138. const content = $('#content').val();
  139. if (title.trim() === '') {
  140. swal.fire({
  141. title: '{{ ucfirst(trans('validation.required', ['attribute' => trans('validation.attributes.title')])) }}!',
  142. icon: 'warning',
  143. });
  144. return false;
  145. }
  146. if (content.trim() === '') {
  147. swal.fire({
  148. title: '{{ ucfirst(trans('validation.required', ['attribute' => trans('validation.attributes.content')])) }}!',
  149. icon: 'warning',
  150. });
  151. return false;
  152. }
  153. swal.fire({
  154. title: '{{ trans('user.ticket.submit_tips') }}',
  155. icon: 'question',
  156. showCancelButton: true,
  157. cancelButtonText: '{{ trans('common.close') }}',
  158. confirmButtonText: '{{ trans('common.confirm') }}',
  159. }).then((result) => {
  160. if (result.value) {
  161. $.post('{{ route('openTicket') }}', {
  162. _token: '{{ csrf_token() }}',
  163. title: title,
  164. content: content,
  165. }, function(ret) {
  166. if (ret.status === 'success') {
  167. swal.fire({
  168. title: ret.message,
  169. icon: 'success',
  170. timer: 1000,
  171. showConfirmButton: false,
  172. }).then(() => window.location.reload());
  173. } else {
  174. swal.fire({
  175. title: ret.message,
  176. icon: 'error'
  177. }).then(() => window.location.reload());
  178. }
  179. });
  180. }
  181. });
  182. }
  183. </script>
  184. @endsection