site_list.blade.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  4. <style>
  5. .btn-danger, .btn-primary, .btn-info {
  6. background: #2a94e0 !important;
  7. border-color: #2a94e0 !important;
  8. }
  9. .table-striped > tbody > tr:nth-of-type(odd) {
  10. background: #f8f8f8 !important;
  11. }
  12. .table-striped > tbody > tr .btn {
  13. background: none !important;
  14. }
  15. .table-striped > tbody > tr td {
  16. font-size: 14px !important;
  17. }
  18. .table-striped > tbody > tr:hover {
  19. background: #ffebd8 !important;
  20. }
  21. .table-striped > tbody > tr:hover .btn {
  22. background: #2a94e0 !important;
  23. color: #fff !important;
  24. }
  25. .table-striped > tbody > tr:hover .btn .glyphicon {
  26. color: #fff !important;
  27. }
  28. </style>
  29. @endsection
  30. @section('content')
  31. @php $authUser=auth()->user() @endphp
  32. <body class="gray-bg">
  33. <div class="wrapper wrapper-content animated fadeInRight">
  34. <div class="row">
  35. <div class="col-sm-12">
  36. <div class="ibox float-e-margins">
  37. <div class="ibox-content">
  38. <form id="searchForm">
  39. <div class="input-group">
  40. <select name="siteUserId" id="siteUserId" title="" class="form-control"
  41. style="width: 150px;float: right" onchange="tips.selectPage();">
  42. <option value="">请选择人员</option>
  43. @foreach($userList as $item)
  44. <option value="{{$item->id}}">{{$item->nickname}}</option>
  45. @endforeach
  46. </select>
  47. <select name="status" id="status" title="" class="form-control"
  48. style="width: 150px;float: right" onchange="tips.selectPage();">
  49. <option value="">请选择项目状态</option>
  50. @foreach(\App\Http\Models\Site::STATUS_MAP as $key=>$item)
  51. @if(!in_array($key,[5,6]))
  52. <option value="{{$key}}">{{$item}}</option>
  53. @endif
  54. @endforeach
  55. </select>
  56. <input type="text" placeholder="请输入域名或项目名称" class="input-md form-control"
  57. name="keyword"
  58. id="keyword" style="width: 300px;float: right">
  59. <span class="input-group-btn">
  60. <button type="button" class="btn btn-md btn-primary"
  61. onclick="units.search()"> 搜索</button>
  62. <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px"
  63. name="btnReset"> 重置</button>
  64. </span>
  65. </div>
  66. </form>
  67. <hr>
  68. <div class="table-responsive">
  69. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </body>
  77. @endsection
  78. @section('footer')
  79. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  80. <script>
  81. var jsSwitch = document.querySelector(".js-switch");
  82. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  83. var units = {
  84. search: function () {
  85. tips.selectPage();
  86. },
  87. getIdsBySelections: function () {
  88. var selections = $("#table").bootstrapTable('getSelections');
  89. var ids = [];
  90. $.each(selections, function (inx, val) {
  91. ids.push(val.id);
  92. });
  93. return ids;
  94. },
  95. openDetail: function (id, title) {
  96. tips.page('/admin/sites/' + id + '/overview', title);
  97. },
  98. };
  99. var config = {};
  100. config.url = '/admin/bid/site-list/' + "{{$type}}";
  101. config.pageSize = 50;
  102. config.showColumns = true;
  103. config.columns = [ //字段
  104. {checkbox: true},
  105. {
  106. title: '序号', align: 'center', formatter: function (value, item, index) {
  107. return index + 1;
  108. },
  109. width: '10px'
  110. },
  111. {title: '项目状态', field: 'statusTitle', align: 'center', sortable: true, width: '30px'},
  112. {title: '项目名称', field: 'cn_title', align: 'center', width: '240px'},
  113. {title: '域名', field: 'domain', align: 'center', width: '160px'},
  114. {title: '竞价人员', field: 'bidder_title', align: 'center', width: '160px'},
  115. {title: '设计', field: 'designer', align: 'center'},
  116. {title: '前端', field: 'web_front', align: 'center'},
  117. {title: '赠送费用', field: 'bid_give_fee', align: 'center'},
  118. {title: '总费用', field: 'total_fee', align: 'center'},
  119. {title: '账户上线日期', field: 'bid_account_online_time', align: 'center', width: '180px', sortable: true},
  120. {title: '暂停日期', field: 'bid_account_pause_time', align: 'center', width: '180px'},
  121. {title: '客户评分', field: 'bid_score', align: 'center', width: '80px', sortable: true},
  122. {title: '投放时长', field: 'sustain_days', align: 'center', width: '80px', sortable: true},
  123. {
  124. title: '操作', field: 'id', align: 'center',
  125. formatter: function (value, row) {
  126. var str = '<button onclick="units.openDetail(' + value + ',\'' + row.cn_title + '\')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button><br>';
  127. if (row.is_google_bid) {
  128. if (row.bid_status) {
  129. if (!row.bid_account_pause_time) {
  130. str += '<span class="glyphicon glyphicon-fire" style="color:red">PPC</span>'
  131. } else {
  132. str += '<span class="glyphicon glyphicon-fire" style="color:red"><del>PPC</del></span>'
  133. }
  134. } else {
  135. str += '<span class="glyphicon glyphicon-fire" style="color:#C0C0C0">PPC</span>'
  136. }
  137. }
  138. return str;
  139. }
  140. }
  141. ];
  142. tips.bootstrapTable(config);
  143. $(document).on('click', '#allotStaff', function () {
  144. var ids = units.getIdsBySelections();
  145. if (ids.length === 0) {
  146. layer.alert('请先选择您所要操作的对象', {icon: 0});
  147. return;
  148. }
  149. var siteIds = '?';
  150. $.each(ids, function (inx, val) {
  151. siteIds += 'siteIds[]=' + val + '&';
  152. });
  153. layer.open({
  154. type: 2,
  155. content: ['/admin/site/allot' + siteIds],
  156. area: ['50%', '50%'],
  157. title: '修改'
  158. });
  159. });
  160. $(document).on('click', '#batchDelete', function () {
  161. var ids = units.getIdsBySelections();
  162. if (ids.length === 0) {
  163. layer.alert('请先选择您所要操作的对象', {icon: 0});
  164. return;
  165. }
  166. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
  167. layer.close(index);
  168. tips.ajax({
  169. url: '/admin/sites',
  170. type: 'delete',
  171. data: {ids: ids},
  172. tableRefresh: '#table'
  173. });
  174. });
  175. });
  176. </script>
  177. @endsection