ticketList.blade.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" type="text/css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container-fluid">
  7. <div class="panel">
  8. <div class="panel-heading">
  9. <h3 class="panel-title">工单列表</h3>
  10. <div class="panel-actions">
  11. <a href="/ticket/add" class="btn btn-primary btn-animate btn-animate-side">
  12. <span><i class="icon wb-plus" aria-hidden="true"></i> {{trans('home.ticket_table_new_button')}}
  13. </span>
  14. </a>
  15. </div>
  16. </div>
  17. <div class="panel-body">
  18. <div class="form-row">
  19. <div class="form-group col-lg-3 col-sm-6">
  20. <input type="text" class="form-control" name="email" id="email"
  21. value="{{Request::get('email')}}" placeholder="用户名" autocomplete="off"/>
  22. </div>
  23. <div class="form-group col-lg-2 col-sm-6 btn-group">
  24. <button class="btn btn-primary" onclick="Search()">搜 索</button>
  25. <a href="/ticket" class="btn btn-danger">重 置</a>
  26. </div>
  27. </div>
  28. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  29. <thead class="thead-default">
  30. <tr>
  31. <th> #</th>
  32. <th> 用户名</th>
  33. <th> 标题</th>
  34. <th> 状态</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. @foreach($ticketList as $ticket)
  39. <tr>
  40. <td> {{$ticket->id}} </td>
  41. <td>
  42. @if(!$ticket->user)
  43. 【账号已删除】
  44. @else
  45. <a href="/admin/userList?id={{$ticket->user->id}}"
  46. target="_blank">{{$ticket->user->email}}</a>
  47. @endif
  48. </td>
  49. <td>
  50. <a href="/ticket/reply?id={{$ticket->id}}" target="_blank">{{$ticket->title}}</a>
  51. </td>
  52. <td>
  53. {!!$ticket->status_label!!}
  54. </td>
  55. </tr>
  56. @endforeach
  57. </tbody>
  58. </table>
  59. </div>
  60. <div class="panel-footer">
  61. <div class="row">
  62. <div class="col-sm-4">
  63. 共 <code>{{$ticketList->total()}}</code> 个工单
  64. </div>
  65. <div class="col-sm-8">
  66. <nav class="Page navigation float-right">
  67. {{$ticketList->links()}}
  68. </nav>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. @endsection
  75. @section('script')
  76. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  77. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"
  78. type="text/javascript"></script>
  79. <script type="text/javascript">
  80. //回车检测
  81. $(document).on("keypress", "input", function (e) {
  82. if (e.which === 13) {
  83. Search();
  84. return false;
  85. }
  86. });
  87. // 搜索
  88. function Search() {
  89. window.location.href = '/ticket?email=' + $("#email").val();
  90. }
  91. </script>
  92. @endsection