ticketList.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
  4. <link href="/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
  5. @endsection
  6. @section('title', trans('home.panel'))
  7. @section('content')
  8. <!-- BEGIN CONTENT BODY -->
  9. <div class="page-content" style="padding-top:0;">
  10. <!-- BEGIN PAGE BASE CONTENT -->
  11. <div class="row">
  12. <div class="col-md-12">
  13. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  14. <div class="portlet light bordered">
  15. <div class="portlet-title">
  16. <div class="caption font-dark">
  17. <span class="caption-subject bold"> {{trans('home.ticket_title')}} </span>
  18. </div>
  19. <div class="actions">
  20. <div class="btn-group">
  21. <button class="btn sbold blue" data-toggle="modal" data-target="#charge_modal"> {{trans('home.ticket_table_new_button')}} </button>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="portlet-body">
  26. <div class="table-scrollable table-scrollable-borderless">
  27. <table class="table table-hover table-light table-checkable order-column">
  28. <thead>
  29. <tr>
  30. <th> # </th>
  31. <th> {{trans('home.ticket_table_title')}} </th>
  32. <th> {{trans('home.ticket_table_status')}} </th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. @if($ticketList->isEmpty())
  37. <tr>
  38. <td colspan="4" style="text-align: center;"> {{trans('home.ticket_table_none')}} </td>
  39. </tr>
  40. @else
  41. @foreach($ticketList as $key => $ticket)
  42. <tr class="odd gradeX">
  43. <td> {{$key + 1}} </td>
  44. <td> <a href="{{url('user/replyTicket?id=') . $ticket->id}}" target="_blank">{{$ticket->title}}</a> </td>
  45. <td>
  46. @if ($ticket->status == 0)
  47. <span class="label label-info"> {{trans('home.ticket_table_status_wait')}} </span>
  48. @elseif ($ticket->status == 1)
  49. <span class="label label-danger"> {{trans('home.ticket_table_status_reply')}} </span>
  50. @else
  51. <span class="label label-default"> {{trans('home.ticket_table_status_close')}} </span>
  52. @endif
  53. </td>
  54. </tr>
  55. @endforeach
  56. @endif
  57. </tbody>
  58. </table>
  59. </div>
  60. <div class="row">
  61. <div class="col-md-12 col-sm-12">
  62. <div class="dataTables_paginate paging_bootstrap_full_number pull-right">
  63. {{ $ticketList->links() }}
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <!-- END EXAMPLE TABLE PORTLET-->
  70. </div>
  71. </div>
  72. <div id="charge_modal" class="modal fade" tabindex="-1" data-focus-on="input:first" data-keyboard="false">
  73. <div class="modal-dialog">
  74. <div class="modal-content">
  75. <div class="modal-header">
  76. <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  77. <h4 class="modal-title"> {{trans('home.ticket_table_new_button')}} </h4>
  78. </div>
  79. <div class="modal-body">
  80. <input type="text" name="title" id="title" placeholder="{{trans('home.ticket_table_title')}}" class="form-control margin-bottom-20">
  81. <textarea name="content" id="content" placeholder="{{trans('home.ticket_table_new_desc')}}" class="form-control margin-bottom-20" rows="4"></textarea>
  82. </div>
  83. <div class="modal-footer">
  84. <button type="button" data-dismiss="modal" class="btn dark btn-outline"> {{trans('home.ticket_table_new_cancel')}} </button>
  85. <button type="button" data-dismiss="modal" class="btn green btn-outline" onclick="addTicket()"> {{trans('home.ticket_table_new_yes')}} </button>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <!-- END PAGE BASE CONTENT -->
  91. </div>
  92. <!-- END CONTENT BODY -->
  93. @endsection
  94. @section('script')
  95. <script src="/js/layer/layer.js" type="text/javascript"></script>
  96. <script type="text/javascript">
  97. // 回复工单
  98. function reply(id) {
  99. window.location.href = + id;
  100. }
  101. // 发起工单
  102. function addTicket() {
  103. var title = $("#title").val();
  104. var content = $("#content").val();
  105. if (title == '' || title == undefined) {
  106. bootbox.alert('工单标题不能为空');
  107. return false;
  108. }
  109. if (content == '' || content == undefined) {
  110. bootbox.alert('工单内容不能为空');
  111. return false;
  112. }
  113. layer.confirm('确定提交工单?', {icon: 3, title:'警告'}, function(index) {
  114. $.post("{{url('user/addTicket')}}", {_token:'{{csrf_token()}}', title:title, content:content}, function(ret) {
  115. layer.msg(ret.message, {time:1000}, function() {
  116. if (ret.status == 'success') {
  117. window.location.reload();
  118. }
  119. });
  120. });
  121. layer.close(index);
  122. });
  123. }
  124. </script>
  125. @endsection