wesley 6 лет назад
Родитель
Сommit
694b19a968

+ 0 - 1
app/Http/Controllers/Admin/Company/InfoController.php

xqd
@@ -38,7 +38,6 @@ class InfoController extends Controller
     {
         $search = $request->all();
 
-        //dd($search);
         $order = array();
         if (isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
             $order[$request['sort_field']] = $request['sort_field_by'];

+ 1 - 1
app/Repositories/Company/InfoRepository.php

xqd
@@ -17,7 +17,7 @@ class InfoRepository extends Repository {
         return \App\Models\CompanyInfoModel::class;
     }
 
-    public function searchCompany(array $search,array $orderby=['id'=>'desc'],$pagesize=10)
+    public function searchCompany(array $search,array $orderby=['id'=>'desc'],$pagesize=3)
     {
         $currentQuery = $this->model;
         /*企业名称*/

+ 75 - 52
resources/views/admin/call/records/index.blade.php

xqd xqd xqd
@@ -14,68 +14,67 @@
                 <div class="ibox-content">
                     <div class="form-group">
 
-                            @if(role('Call/Records/addCallList'))
-                                <div class="col-sm-8 pull-right">
+                        @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>
+                        @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">
-                        <tr>
-                            <th> 过滤条件</th>
-                            <form method="GET" action="" accept-charset="UTF-8" id="filter_records">
-                                <th>
-                                    <select name="ip" class="form-control filter_records">
-                                        <option value="">拨打IP</option>
-                                        <option value="172.31.20.133">172.31.20.133</option>
-                                        <option value="172.31.20.134">172.31.20.134</option>
-                                        <option value="172.31.20.135">172.31.20.135</option>
-                                        <option value="172.31.20.136">172.31.20.136</option>
-                                        <option value="172.31.20.137">172.31.20.137</option>
-                                    </select>
-                                </th>
-
-                                <th>
-                                    <select name="term_status" class="form-control filter_records">
-                                        <option value="">接听状态</option>
-                                        <option value="200">已接通</option>
-                                        <option value="408">未接通</option>
-                                    </select>
-                                </th>
-                            </form>
+                {{-- 过滤条件 --}}
+                <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                    <tr>
+                        <th> 过滤条件</th>
+                        <form method="GET" action="" accept-charset="UTF-8" id="filter_records">
                             <th>
-                                <form method="GET" action="" accept-charset="UTF-8">
-                                    <div class="input-group">
-                                        <input type="text" class="form-control" value="{{Request::get('phone')}}"
-                                               placeholder="请输入电话号码"
-                                               name="phone">
-                                        <span class="input-group-append">
-                                                <button type="submit" class="btn btn-sm btn-default"
-                                                        style="height: 100%">搜索</button>
-                                            </span>
-                                    </div>
-                                </form>
+                                <select name="ip" class="form-control filter_records">
+                                    <option value="">拨打IP</option>
+                                    <option value="172.31.20.133">172.31.20.133</option>
+                                    <option value="172.31.20.134">172.31.20.134</option>
+                                    <option value="172.31.20.135">172.31.20.135</option>
+                                    <option value="172.31.20.136">172.31.20.136</option>
+                                    <option value="172.31.20.137">172.31.20.137</option>
+                                </select>
                             </th>
-                        </tr>
-                    </table>
 
-                    <div id="records-list">
-                        @include('admin.call.records.data')
-                    </div>
+                            <th>
+                                <select name="term_status" class="form-control filter_records">
+                                    <option value="">接听状态</option>
+                                    <option value="200">已接通</option>
+                                    <option value="408">未接通</option>
+                                </select>
+                            </th>
 
+                            <th>
+                                <div class="input-group">
+                                    <input type="text" class="form-control" value="{{Request::get('phone')}}"
+                                           placeholder="请输入电话号码"
+                                           name="phone">
+                                    <span class="input-group-append">
+                                                <span class="btn btn-sm btn-default filter_records"
+                                                      style="height: 100%">搜索</span>
+                                            </span>
+                                </div>
+                            </th>
+                        </form>
+                    </tr>
+                </table>
+
+                <div id="records-list">
+                    @include('admin.call.records.data')
                 </div>
+
             </div>
         </div>
     </div>
+    </div>
 @endsection
 
 @section('js')
@@ -130,8 +129,6 @@
                 }
 
             })
-
-            console.log(contact_phones)
         })
 
         /*通话纪录筛选*/
@@ -144,5 +141,31 @@
                 $('#records-list').html(data.html)
             })
         })
+
+        $('.filter_records').click(function () {
+            data = $('#filter_records').serialize()
+            $.ajax({
+                type: 'get',
+                data: data,
+            }).done(function (data) {
+                $('#records-list').html(data.html)
+            })
+        })
+
+        /*Ajax分页*/
+        $('body').on('click', '.pagination a', function (e) {
+            e.preventDefault();
+            if ($(this).attr('href') != '#') {
+                data = $('#filter_records').serialize()
+                $.ajax({
+                    url: $(this).attr('href'),
+                    type: 'get',
+                    data: data,
+                }).done(function (data) {
+                    $('#records-list').html(data.html)
+                })
+            }
+
+        });
     </script>
 @endsection

+ 31 - 21
resources/views/admin/company/info/index.blade.php

xqd xqd
@@ -81,20 +81,18 @@
                                     </select>
                                 </th>
 
-                            </form>
-                            <th>
-                                <form method="GET" action="" accept-charset="UTF-8">
+                                <th>
                                     <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-sm btn-default"
-                                                        style="height: 100%">搜索</button>
+                                                <span class="btn btn-sm btn-default filter_company"
+                                                      style="height: 100%">搜索</span>
                                             </span>
                                     </div>
-                                </form>
-                            </th>
+                                </th>
+                            </form>
                         </tr>
                     </table>
 
@@ -119,20 +117,32 @@
                 $('#company-list').html(data.html)
             })
         })
+        $('.filter_company').click(function () {
+            data = $('#filter_company').serialize()
+            $.ajax({
+                type: 'get',
+                data: data,
+            }).done(function (data) {
+                $('#company-list').html(data.html)
+            })
+        })
+
+        $('body').on('click', '.pagination a', function (e) {
+            e.preventDefault();
+            console.log($(this).attr('href'))
+            if ($(this).attr('href') != '#') {
+                data = $('#filter_company').serialize()
+                $.ajax({
+                    url: $(this).attr('href'),
+                    type: 'get',
+                    data: data,
+                }).done(function (data) {
+                    console.log(data)
+                    $('#company-list').html(data.html)
+                })
+            }
+
+        });
 
-        // $('.pagination a').click(function (event) {
-        //     event.preventDefault();
-        //
-        //     if ( $(this).attr('href') != '#' ) {
-        //         data = $('#filter_company').serialize()
-        //         $.ajax({
-        //             url: window.location.href + $(this).attr('href'),
-        //             type: 'get',
-        //             data: data,
-        //         }).done(function (data) {
-        //             $('#company-list').html(data.html)
-        //         })
-        //     }
-        // });
     </script>
 @endsection

+ 28 - 4
resources/views/admin/user/threads/index.blade.php

xqd xqd
@@ -71,8 +71,8 @@
                                            placeholder="请输入企业名称"
                                            name="keyword">
                                     <span class="input-group-append">
-                                                <button type="submit" class="btn btn-sm btn-default"
-                                                        style="height: 100%">搜索</button>
+                                                <span  class="btn btn-sm btn-default filter_threads"
+                                                        style="height: 100%">搜索</span>
                                             </span>
                                 </div>
 
@@ -149,14 +149,38 @@
         /*线索筛选*/
         $('.filter_threads').change(function () {
             data = $('#filter_threads').serialize()
-            console.log(data)
             $.ajax({
                 type: 'get',
                 data: data,
             }).done(function (data) {
-                console.log(data)
                 $('#threads-list').html(data.html)
             })
         })
+
+        $('.filter_threads').click(function () {
+            data = $('#filter_threads').serialize()
+            $.ajax({
+                type: 'get',
+                data: data,
+            }).done(function (data) {
+                $('#threads-list').html(data.html)
+            })
+        })
+
+        /*Ajax 分页*/
+        $('body').on('click', '.pagination a', function(e) {
+            e.preventDefault();
+            if ($(this).attr('href') != '#' ) {
+                data = $('#filter_threads').serialize()
+                $.ajax({
+                    url: $(this).attr('href'),
+                    type: 'get',
+                    data: data,
+                }).done(function (data) {
+                    $('#threads-list').html(data.html)
+                })
+            }
+
+        });
     </script>
 @endsection