index.blade.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. <div class="row">
  16. <div class="col-sm-4">
  17. <form method="GET" action="" accept-charset="UTF-8">
  18. <div class="input-group">
  19. <input type="text" class="form-control" value="{{Request::get('keyword')}}"
  20. placeholder="请输入电话号码"
  21. name="keyword">
  22. <span class="input-group-append">
  23. <button type="submit" class="btn btn-primary"
  24. style="height: 100%">搜索</button>
  25. </span>
  26. </div>
  27. </form>
  28. </div>
  29. @if(role('Call/Records/addCallList'))
  30. <div class="col-sm-8 pull-right">
  31. <span id="addCallList" class="btn btn-primary pull-right fa fa-phone"
  32. style="display: none">添加到电话列表</span>
  33. </div>
  34. @endif
  35. {{--@if(role('Call/Records/create'))--}}
  36. {{--<div class="col-sm-8 pull-right">--}}
  37. {{--<a href="{{ U('Call/Records/create')}}" class="btn btn-primary pull-right">添加</a>--}}
  38. {{--</div>--}}
  39. {{--@endif--}}
  40. </div>
  41. </div>
  42. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  43. <thead>
  44. <tr>
  45. <th><label><input type="checkbox" id="checkAll"> 全选</label>
  46. </th>
  47. <th class="sorting" data-sort="id"> ID</th>
  48. <th class="sorting" data-sort="phone"> 电话号码</th>
  49. <th class="sorting" data-sort="start_time"> 拨打时间</th>
  50. <th class="sorting" data-sort="end_time"> 结束时间</th>
  51. <th class="sorting" data-sort="record_path"> 录音地址</th>
  52. <th class="sorting" data-sort="intention"> 意向</th>
  53. <th class="sorting" data-sort="term_status"> 接通状态</th>
  54. <th class="sorting" data-sort="hangup_dispostion"> 挂断原因</th>
  55. <th class="sorting" data-sort="ip"> 拨打IP</th>
  56. <th width="22%">相关操作</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. @if(isset($list))
  61. @foreach($list as $key => $item)
  62. <tr>
  63. <td>
  64. <label><input class="contacts" name='contact_phone[]' type="checkbox"
  65. value="{{ $item->phone }}"></label>
  66. </td>
  67. <td>{{ $item->id }}</td>
  68. <td>{{ $item->phone }}</td>
  69. <td>{{ $item->start_time }}</td>
  70. <td>{{ $item->end_time }}</td>
  71. <td>
  72. <audio src="http://{{ $item->record_path }}" controls="controls">
  73. </audio>
  74. </td>
  75. <td>{{ $item->intention }}</td>
  76. <td>{{ $item->term_status }}</td>
  77. <td>{{ $item->hangup_dispostion }}</td>
  78. <td>{{ $item->ip }}</td>
  79. <td>
  80. {{--@if(role('Call/Records/update'))--}}
  81. {{--<button class="btn btn-sm btn-success"--}}
  82. {{--onclick="window.location.href='{{ U('Call/Records/update',['id'=>$item->id])}}' ">--}}
  83. {{--修改--}}
  84. {{--</button>--}}
  85. {{--@endif--}}
  86. {{--@if(role('Call/Records/destroy'))--}}
  87. {{--<a class="btn btn-sm btn-danger"--}}
  88. {{--href="{{ U('Call/Records/destroy',['id'=>$item->id])}}"--}}
  89. {{--onclick="return confirm('你确定执行删除操作?');">删除</a>--}}
  90. {{--@endif--}}
  91. @if(role('Call/Records/view'))
  92. <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Call/Records/view',['id'=>$item->id])}}'});"
  93. class="btn btn-sm btn-primary ">对话纪录
  94. </button>
  95. @endif
  96. </td>
  97. </tr>
  98. @endforeach
  99. @endif
  100. </tbody>
  101. </table>
  102. <div class="row">
  103. <div class="col-sm-6">
  104. <div class="dataTables_info" id="DataTables_Table_0_info"
  105. role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
  106. 条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
  107. </div>
  108. </div>
  109. <div class="col-sm-6">
  110. <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
  111. {!! $list->setPath('')->appends(Request::all())->render() !!}
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. @endsection
  120. @section('js')
  121. <script type="text/javascript">
  122. /*电话全选功能*/
  123. var items = $('.contacts')
  124. $('#checkAll').click(function () {
  125. isChecked = $(this).prop('checked')
  126. items.prop('checked', isChecked)
  127. if (isChecked == true) {
  128. $('#addCallList').show()
  129. } else {
  130. $('#addCallList').hide()
  131. }
  132. })
  133. items.click(function () {
  134. checkedLength = $('.contacts:checked').length
  135. if (checkedLength) {
  136. $('#addCallList').show()
  137. } else {
  138. $('#addCallList').hide()
  139. }
  140. if (items.length == checkedLength) {
  141. $('#addCallList').show()
  142. } else {
  143. $('#checkAll').prop('checked', false)
  144. }
  145. })
  146. /*添加选择的电话到拨打列表*/
  147. $('#addCallList').click(function () {
  148. contact_phones = []
  149. csrf_token = "{{ csrf_token() }}"
  150. $('.contacts:checked').each(function () {
  151. contact_phones.push($(this).val())
  152. })
  153. $.ajax({
  154. type: 'post',
  155. url: '{{ U('Call/Records/addCallList') }}',
  156. data: {contact_phones: contact_phones, _token: csrf_token},
  157. success: function (data) {
  158. if (data == 200) {
  159. layer.msg('导入成功', {
  160. icon: 1,
  161. time: 2000 //2秒关闭(如果不配置,默认是3秒)
  162. }, function(){
  163. window.location.href = window.location.href
  164. });
  165. }
  166. }
  167. })
  168. console.log(contact_phones)
  169. })
  170. </script>
  171. @endsection