ticketList.blade.php 3.0 KB

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