123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- @extends('admin.layouts.app')
- @section('content')
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>通话纪录</h5>
- <div class="ibox-tools">
- <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
- </a>
- </div>
- </div>
- <div class="ibox-content">
- <div class="form-group">
- <div class="row">
- <div class="col-sm-4">
- <form method="GET" action="" accept-charset="UTF-8">
- <div class="input-group">
- <input type="text" class="form-control" value="{{Request::get('keyword')}}"
- placeholder="请输入电话号码"
- name="keyword">
- <span class="input-group-append">
- <button type="submit" class="btn btn-primary"
- style="height: 100%">搜索</button>
- </span>
- </div>
- </form>
- </div>
- @if(role('Call/Records/addCallList'))
- <div class="col-sm-8 pull-right">
- <span id="addCallList" class="btn btn-primary pull-right fa fa-phone"
- style="display: none">添加到电话列表</span>
- </div>
- @endif
- {{--@if(role('Call/Records/create'))--}}
- {{--<div class="col-sm-8 pull-right">--}}
- {{--<a href="{{ U('Call/Records/create')}}" class="btn btn-primary pull-right">添加</a>--}}
- {{--</div>--}}
- {{--@endif--}}
- </div>
- </div>
- <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
- <thead>
- <tr>
- <th><label><input type="checkbox" id="checkAll"> 全选</label>
- </th>
- <th class="sorting" data-sort="id"> ID</th>
- <th class="sorting" data-sort="phone"> 电话号码</th>
- <th class="sorting" data-sort="start_time"> 拨打时间</th>
- <th class="sorting" data-sort="end_time"> 结束时间</th>
- <th class="sorting" data-sort="record_path"> 录音地址</th>
- <th class="sorting" data-sort="intention"> 意向</th>
- <th class="sorting" data-sort="term_status"> 接通状态</th>
- <th class="sorting" data-sort="hangup_dispostion"> 挂断原因</th>
- <th class="sorting" data-sort="ip"> 拨打IP</th>
- <th width="22%">相关操作</th>
- </tr>
- </thead>
- <tbody>
- @if(isset($list))
- @foreach($list as $key => $item)
- <tr>
- <td>
- <label><input class="contacts" name='contact_phone[]' type="checkbox"
- value="{{ $item->phone }}"></label>
- </td>
- <td>{{ $item->id }}</td>
- <td>{{ $item->phone }}</td>
- <td>{{ $item->start_time }}</td>
- <td>{{ $item->end_time }}</td>
- <td>
- <audio src="http://{{ $item->record_path }}" controls="controls">
- </audio>
- </td>
- <td>{{ $item->intention }}</td>
- <td>{{ $item->term_status }}</td>
- <td>{{ $item->hangup_dispostion }}</td>
- <td>{{ $item->ip }}</td>
- <td>
- {{--@if(role('Call/Records/update'))--}}
- {{--<button class="btn btn-sm btn-success"--}}
- {{--onclick="window.location.href='{{ U('Call/Records/update',['id'=>$item->id])}}' ">--}}
- {{--修改--}}
- {{--</button>--}}
- {{--@endif--}}
- {{--@if(role('Call/Records/destroy'))--}}
- {{--<a class="btn btn-sm btn-danger"--}}
- {{--href="{{ U('Call/Records/destroy',['id'=>$item->id])}}"--}}
- {{--onclick="return confirm('你确定执行删除操作?');">删除</a>--}}
- {{--@endif--}}
- @if(role('Call/Records/view'))
- <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Call/Records/view',['id'=>$item->id])}}'});"
- class="btn btn-sm btn-primary ">对话纪录
- </button>
- @endif
- </td>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- <div class="row">
- <div class="col-sm-6">
- <div class="dataTables_info" id="DataTables_Table_0_info"
- role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
- 条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
- </div>
- </div>
- <div class="col-sm-6">
- <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
- {!! $list->setPath('')->appends(Request::all())->render() !!}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- @endsection
- @section('js')
- <script type="text/javascript">
- /*电话全选功能*/
- var items = $('.contacts')
- $('#checkAll').click(function () {
- isChecked = $(this).prop('checked')
- items.prop('checked', isChecked)
- if (isChecked == true) {
- $('#addCallList').show()
- } else {
- $('#addCallList').hide()
- }
- })
- items.click(function () {
- checkedLength = $('.contacts:checked').length
- if (checkedLength) {
- $('#addCallList').show()
- } else {
- $('#addCallList').hide()
- }
- if (items.length == checkedLength) {
- $('#addCallList').show()
- } else {
- $('#checkAll').prop('checked', false)
- }
- })
- /*添加选择的电话到拨打列表*/
- $('#addCallList').click(function () {
- contact_phones = []
- csrf_token = "{{ csrf_token() }}"
- $('.contacts:checked').each(function () {
- contact_phones.push($(this).val())
- })
- $.ajax({
- type: 'post',
- url: '{{ U('Call/Records/addCallList') }}',
- data: {contact_phones: contact_phones, _token: csrf_token},
- success: function (data) {
- if (data == 200) {
- layer.msg('导入成功', {
- icon: 1,
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
- }, function () {
- window.location.href = window.location.href
- });
- }
- }
- })
- console.log(contact_phones)
- })
- </script>
- @endsection
|