123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- @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('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"> 最新跟进</th>
- <th class="sorting" data-sort="created_at"> 领取时间</th>
- <th width="22%">相关操作</th>
- </tr>
- </thead>
- <tbody>
- @if(isset($list))
- @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>
- <td>
- <a href="{{ U('Company/Info/view',['id'=> $item->company->id]) }}"> {{ $item->company->companyName }} </a>
- </td>
- <td><a href="http://{{ $item->company->website }}"
- target="_blank">{{ $item->company->website }}</a></td>
- <td>{{ $item->company->regCapital }}</td>
- <td>{{ $item->latestProgress() }}</td>
- <td>{{ $item->created_at }}</td>
- <td>
- @if(role('User/Threads/update'))
- <button onclick="layer.open({type: 2,area: ['25%', '60%'],content: '{{ U('User/Threads/update',['id'=>$item->id])}}'});"
- class="btn btn-sm btn-primary ">跟进
- </button>
- @endif
- @if(role('User/Threads/destroy'))
- <a class="btn btn-sm btn-danger"
- href="{{ U('User/Threads/destroy',['id'=>$item->id])}}"
- onclick="return confirm('你确定放弃该线索?');">放弃</a>
- @endif
- @if(role('User/Threads/view'))
- @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_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) {
- layer.msg('导入成功', {
- icon: 1,
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
- }, function () {
- window.location.href = window.location.href
- });
- }
- }
- })
- console.log(contact_ids)
- })
- </script>
- @endsection
|