index.blade.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. @extends('admin.layouts.app')
  2. @section('header')
  3. <style>
  4. .company-info {
  5. border: 1px solid #eee;
  6. padding: 10px 0;
  7. margin-bottom: 10px;
  8. border-radius: 5px
  9. }
  10. .company-info p {
  11. margin-bottom: 0;
  12. font-size: 14px
  13. }
  14. .company-info p label {
  15. color: #aaa;
  16. font-weight: 400
  17. }
  18. .company-info p span {
  19. margin-right: 20px;
  20. color: #111
  21. }
  22. #filter_table {
  23. margin: 0 auto 20px auto;
  24. border-radius: 5px;
  25. border: 1px solid #eee;
  26. }
  27. </style>
  28. @endsection
  29. @section('content')
  30. <div class="row">
  31. <div class="col-sm-12">
  32. <div class="ibox float-e-margins">
  33. <div class="ibox-title">
  34. <h5>挖掘线索</h5>
  35. <div class="ibox-tools">
  36. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  37. </a>
  38. </div>
  39. </div>
  40. <div class="ibox-content">
  41. <div class="form-group">
  42. <div class="row">
  43. <div class="col-sm-4">
  44. </div>
  45. @if(role('Company/Info/collection'))
  46. <div class="col-sm-8 pull-right">
  47. <span class="btn btn-warning pull-right" onclick="save_collection()">保存为我的公海
  48. </span>
  49. </div>
  50. @endif
  51. </div>
  52. </div>
  53. <div class="col-sm-7" id="filter_table">
  54. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  55. <tr>
  56. <th> 过滤条件</th>
  57. <form method="GET" action="" accept-charset="UTF-8" id="filter_company">
  58. {{ csrf_field() }}
  59. <th>
  60. <select name="district" class="form-control" onchange="filter_company()">
  61. <option value="">所在地区</option>
  62. @foreach($fields['district'] as $district)
  63. <option value="{{$district['value']}}"
  64. @if($district['value'] == Request::get('district')) selected @endif>{{$district['name']}}</option>
  65. @endforeach
  66. </select>
  67. </th>
  68. <th>
  69. <select name="industry" class="form-control" onchange="filter_company()">
  70. <option value="">所属行业</option>
  71. @foreach($fields['industry'] as $industry)
  72. <option value="{{$industry['value']}}"
  73. @if($industry['value'] == Request::get('industry')) selected @endif>{{$industry['name']}}</option>
  74. @endforeach
  75. </select>
  76. </th>
  77. <th>
  78. <select name="regCapital" class="form-control" onchange="filter_company()">
  79. <option value="">注册资本</option>
  80. @foreach($fields['regCapital'] as $regCapital)
  81. <option value="{{$regCapital['value']}}"
  82. @if($regCapital['value']== Request::get('regCapital')) selected @endif>{{$regCapital['name']}}</option>
  83. @endforeach
  84. </select>
  85. </th>
  86. <th>
  87. <select name="startDate" class="form-control" onchange="filter_company()">
  88. <option value="">成立年限</option>
  89. @foreach($fields['startDate'] as $startDate)
  90. <option value="{{$startDate['value']}}"
  91. @if($startDate['value']== Request::get('startDate')) selected @endif>{{$startDate['name']}}</option>
  92. @endforeach
  93. </select>
  94. </th>
  95. <th>
  96. <select name="entType" class="form-control" onchange="filter_company()">
  97. <option value="">企业类型</option>
  98. @foreach($fields['entType'] as $entType)
  99. <option value="{{$entType['value']}}"
  100. @if($entType['value']== Request::get('entType')) selected @endif>{{$entType['name']}}</option>
  101. @endforeach
  102. </select>
  103. </th>
  104. <th>
  105. <select name="openStatus" class="form-control" onchange="filter_company()">
  106. <option value="">企业状态</option>
  107. @foreach($fields['openStatus'] as $openStatus)
  108. <option value="{{$openStatus['value']}}"
  109. @if($openStatus['value']== Request::get('openStatus')) selected @endif>{{$openStatus['name']}}</option>
  110. @endforeach
  111. </select>
  112. </th>
  113. <th>
  114. <div class="input-group">
  115. <input type="text" class="form-control"
  116. value="{{Request::get('companyName')}}"
  117. placeholder="请输入企业名称"
  118. name="companyName">
  119. <span class="input-group-append">
  120. <span class="btn btn-sm btn-default"
  121. style="height: 100%" onclick="filter_company()">搜索</span>
  122. </span>
  123. </div>
  124. </th>
  125. </form>
  126. </tr>
  127. </table>
  128. </div>
  129. <div id="company-list">
  130. @include('admin.company.info.data')
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. @endsection
  137. @section('js')
  138. <script type="text/javascript">
  139. /*对字段进行过滤*/
  140. function filter_company() {
  141. data = $('#filter_company').serialize()
  142. $.ajax({
  143. type: 'get',
  144. data: data,
  145. }).done(function (data) {
  146. $('#company-list').html(data.html)
  147. })
  148. }
  149. /*保存公海*/
  150. function save_collection() {
  151. data = $('#filter_company').serialize()
  152. $.ajax({
  153. url: '{{ U('Company/Info/add_collection') }}',
  154. type: 'post',
  155. data: data,
  156. success: function (data) {
  157. if (data == 200) {
  158. layer.msg('保存公海成功!', {icon: 1})
  159. }
  160. }
  161. })
  162. }
  163. /*Ajax分页*/
  164. $('body').on('click', '.pagination a', function (e) {
  165. e.preventDefault();
  166. if ($(this).attr('href') != '#') {
  167. data = $('#filter_company').serialize()
  168. $.ajax({
  169. url: $(this).attr('href'),
  170. type: 'get',
  171. data: data,
  172. }).done(function (data) {
  173. $('#company-list').html(data.html)
  174. })
  175. }
  176. });
  177. </script>
  178. @endsection