index.blade.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. @extends('admin.layouts.app')
  2. @section('content')
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-title">
  7. <h5>通话纪录</h5>
  8. <div class="ibox-tools">
  9. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  10. </a>
  11. </div>
  12. </div>
  13. <div class="ibox-content">
  14. <div class="form-group">
  15. @if(role('Call/Records/addCallList'))
  16. <div class="col-sm-8 pull-right">
  17. <span id="addCallList" class="btn btn-primary pull-right fa fa-phone"
  18. style="display: none">添加到电话列表</span>
  19. </div>
  20. @endif
  21. {{--@if(role('Call/Records/create'))--}}
  22. {{--<div class="col-sm-8 pull-right">--}}
  23. {{--<a href="{{ U('Call/Records/create')}}" class="btn btn-primary pull-right">添加</a>--}}
  24. {{--</div>--}}
  25. {{--@endif--}}
  26. </div>
  27. </div>
  28. {{-- 过滤条件 --}}
  29. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  30. <tr>
  31. <th> 过滤条件</th>
  32. <form method="GET" action="" accept-charset="UTF-8" id="filter_records">
  33. <th>
  34. <select name="ip" class="form-control filter_records">
  35. <option value="">拨打IP</option>
  36. <option value="172.31.20.133">172.31.20.133</option>
  37. <option value="172.31.20.134">172.31.20.134</option>
  38. <option value="172.31.20.135">172.31.20.135</option>
  39. <option value="172.31.20.136">172.31.20.136</option>
  40. <option value="172.31.20.137">172.31.20.137</option>
  41. </select>
  42. </th>
  43. <th>
  44. <select name="term_status" class="form-control filter_records">
  45. <option value="">接听状态</option>
  46. <option value="200">已接通</option>
  47. <option value="408">未接通</option>
  48. </select>
  49. </th>
  50. </form>
  51. <th>
  52. <form method="GET" action="" accept-charset="UTF-8">
  53. <div class="input-group">
  54. <input type="text" class="form-control" value="{{Request::get('phone')}}"
  55. placeholder="请输入电话号码"
  56. name="phone">
  57. <span class="input-group-append">
  58. <button type="submit" class="btn btn-sm btn-default"
  59. style="height: 100%">搜索</button>
  60. </span>
  61. </div>
  62. </form>
  63. </th>
  64. </tr>
  65. </table>
  66. <div id="records-list">
  67. @include('admin.call.records.data')
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. @endsection
  74. @section('js')
  75. <script type="text/javascript">
  76. /*电话全选功能*/
  77. var items = $('.contacts')
  78. $('#checkAll').click(function () {
  79. isChecked = $(this).prop('checked')
  80. items.prop('checked', isChecked)
  81. if (isChecked == true) {
  82. $('#addCallList').show()
  83. } else {
  84. $('#addCallList').hide()
  85. }
  86. })
  87. items.click(function () {
  88. checkedLength = $('.contacts:checked').length
  89. if (checkedLength) {
  90. $('#addCallList').show()
  91. } else {
  92. $('#addCallList').hide()
  93. }
  94. if (items.length == checkedLength) {
  95. $('#addCallList').show()
  96. } else {
  97. $('#checkAll').prop('checked', false)
  98. }
  99. })
  100. /*添加选择的电话到拨打列表*/
  101. $('#addCallList').click(function () {
  102. contact_phones = []
  103. csrf_token = "{{ csrf_token() }}"
  104. $('.contacts:checked').each(function () {
  105. contact_phones.push($(this).val())
  106. })
  107. $.ajax({
  108. type: 'post',
  109. url: '{{ U('Call/Records/addCallList') }}',
  110. data: {contact_phones: contact_phones, _token: csrf_token},
  111. success: function (data) {
  112. if (data == 200) {
  113. layer.msg('导入成功', {
  114. icon: 1,
  115. time: 2000 //2秒关闭(如果不配置,默认是3秒)
  116. }, function () {
  117. window.location.href = window.location.href
  118. });
  119. }
  120. }
  121. })
  122. console.log(contact_phones)
  123. })
  124. /*通话纪录筛选*/
  125. $('.filter_records').change(function () {
  126. data = $('#filter_records').serialize()
  127. $.ajax({
  128. type: 'get',
  129. data: data,
  130. }).done(function (data) {
  131. $('#records-list').html(data.html)
  132. })
  133. })
  134. </script>
  135. @endsection