| xqd
@@ -28,25 +28,27 @@
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
- {{--@if(role('User/Threads/create'))--}}
|
|
|
- {{--<div class="col-sm-8 pull-right">--}}
|
|
|
- {{--<a href="{{ U('User/Threads/create')}}" class="btn btn-primary pull-right">添加</a>--}}
|
|
|
- {{--</div>--}}
|
|
|
- {{--@endif--}}
|
|
|
+ @if(role('User/Threads/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
|
|
|
</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"> 联系方式</th>
|
|
|
<th class="sorting" data-sort="ower_id"> 线索拥有者</th>
|
|
|
<th class="sorting">企业名称</th>
|
|
|
<th class="sorting">企业网址</th>
|
|
|
<th class="sorting">注册资本</th>
|
|
|
- <th class="sorting" data-sort="status"> 线索状态</th>
|
|
|
+ <th class="sorting"> 最新跟进</th>
|
|
|
<th class="sorting" data-sort="created_at"> 领取时间</th>
|
|
|
<th width="22%">相关操作</th>
|
|
|
</tr>
|
| xqd
@@ -56,6 +58,10 @@
|
|
|
@foreach($list as $key => $item)
|
|
|
<tr>
|
|
|
|
|
|
+ <td>
|
|
|
+ <label><input class="contacts" name='contact_id[]' type="checkbox"
|
|
|
+ value="{{ $item->id }}"></label>
|
|
|
+ </td>
|
|
|
<td>{{ $item->id }}</td>
|
|
|
<td>{{ $item->contact?$item->contact->phone:'暂无联系人信息' }}</td>
|
|
|
<td>{{ $item->ower->real_name }}</td>
|
| xqd
@@ -65,7 +71,7 @@
|
|
|
<td><a href="http://{{ $item->company->website }}"
|
|
|
target="_blank">{{ $item->company->website }}</a></td>
|
|
|
<td>{{ $item->company->regCapital }}</td>
|
|
|
- <td>{{ $item->status }}</td>
|
|
|
+ <td>{{ $item->latestProgress() }}</td>
|
|
|
<td>{{ $item->created_at }}</td>
|
|
|
<td>
|
|
|
@if(role('User/Threads/update'))
|
| xqd
@@ -108,4 +114,56 @@
|
|
|
</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_ids = []
|
|
|
+ csrf_token = "{{ csrf_token() }}"
|
|
|
+ $('.contacts:checked').each(function () {
|
|
|
+ contact_ids.push($(this).val())
|
|
|
+ })
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'{{ U('User/Threads/addCallList') }}',
|
|
|
+ data:{contact_ids:contact_ids,_token:csrf_token},
|
|
|
+ success:function (data) {
|
|
|
+ if(data == 200){
|
|
|
+ window.location.href =window.location.href
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(contact_ids)
|
|
|
+ })
|
|
|
+ </script>
|
|
|
@endsection
|