index.blade.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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: #009688 !important;
  7. border-color: #009688 !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: #009688 !important;
  23. color: #fff !important;
  24. }
  25. .table-striped > tbody > tr:hover .btn .glyphicon {
  26. color: #fff !important;
  27. }
  28. .btn.btn-md:hover {
  29. opacity: 0.8;
  30. }
  31. .input-group-btn2 {
  32. white-space: normal
  33. }
  34. </style>
  35. @endsection
  36. @section('content')
  37. @php $authUser=auth()->user() @endphp
  38. <body class="gray-bg">
  39. <div class="wrapper wrapper-content animated fadeInRight">
  40. <div class="row">
  41. <div class="col-sm-12">
  42. <div class="ibox float-e-margins">
  43. <div class="ibox-content">
  44. <form class="row" id="searchForm" onsubmit="units.search();return false;">
  45. @if($is_propaganda!=1)
  46. <div class="col-md-3">
  47. <div class="input-group">
  48. <span class="input-group-btn input-group-btn2">
  49. @hasAuth('sites-manage-add-and-del')
  50. <button type="button" class="btn btn-md btn-primary"
  51. style="margin-left: 10px;border-radius:2px;" onclick="units.edit(0)"> <span
  52. class="glyphicon glyphicon-plus" ></span> 添加</button>
  53. <button type="button" class="btn btn-md btn-danger" id="batchDelete"
  54. style="margin-left: 10px;border-radius:2px;"><span
  55. class="glyphicon glyphicon-remove"></span> 删除</button>
  56. @endHasAuth
  57. <button type="button" class="btn btn-md btn-primary"
  58. style="margin-left: 10px;border-radius:2px;"
  59. onclick="units.refresh()"><span
  60. class="glyphicon glyphicon-refresh"></span> 清除缓存
  61. </button>
  62. <button type="button" class="btn btn-md btn-primary"
  63. style="margin-left: 10px;border-radius:2px;" onclick="units.webmaster()"><span
  64. class="glyphicon glyphicon-film"></span> webmaster数据</button>
  65. <button type="button" class="btn btn-md btn-primary"
  66. style="margin-left: 10px;border-radius:2px;"
  67. onclick="window.open('http://rank.yinqingli.cn/admincp/webmaster/oauth2');"><span
  68. class="glyphicon glyphicon-film"></span> webmaste2数据</button>
  69. <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px;border-radius:2px;"
  70. onclick="units.generateReport()"><span
  71. class="glyphicon glyphicon-film"></span> 批量月报</button>
  72. </span>
  73. </div>
  74. </div>
  75. @endif
  76. <div class="col-md-9 pull-right">
  77. <div class="input-group">
  78. <select name="status" id="status" title="" class="form-control"
  79. style="width: 150px;float: right" onchange="tips.selectPage();">
  80. <option value="">请选择项目状态</option>
  81. @foreach(\App\Http\Models\Site::STATUS_MAP as $key=>$item)
  82. @if(!in_array($key,[5,6]))
  83. <option value="{{$key}}">{{$item}}</option>
  84. @endif
  85. @endforeach
  86. </select>
  87. <input type="text" placeholder="请输入域名或项目名称" class="input-md form-control"
  88. name="keyword"
  89. id="keyword" style="width: 200px;float: right">
  90. <div style="float: right;margin-right: 6px">
  91. <input type="checkbox" id="bid_status" name="bid_status" class="js-switch"
  92. onchange="tips.selectPage();">是否竞价
  93. </div>
  94. <div style="float: right;margin-right: 6px">
  95. <input type="checkbox" id="feedback_status" name="feedback_status"
  96. class="js-switch2"
  97. onchange="tips.selectPage();">中文待反馈
  98. </div>
  99. <div style="float: right;margin-right: 6px">
  100. <input type="checkbox" id="customer_review" name="customer_review"
  101. class="js-switch3"
  102. onchange="tips.selectPage();">是否客户审核
  103. </div>
  104. <span class="input-group-btn">
  105. <button type="search" class="btn btn-md btn-primary"
  106. onclick="units.search()" style="border-radius:2px;"> 搜索</button>
  107. <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px;border-radius:2px;"
  108. name="btnReset"> 重置</button>
  109. @if(!in_array($role_id,[15,34]))
  110. <button type="button" class="btn btn-md btn-primary"
  111. style="margin-left: 10px;border-radius:2px;"
  112. onclick="units.exportSitesList()"> 导出
  113. </button>
  114. @endif
  115. </span>
  116. </div>
  117. </div>
  118. <div class="col-md-8 pull-right">
  119. <select name="propagandaUserId" id="propagandaUserId" title="" class="form-control"
  120. style="width: 150px;float: right" onchange="tips.selectPage();">
  121. <option value="">请选择软文查找人员</option>
  122. @foreach($userList as $item)
  123. @if($item->role_id==34)
  124. <option value="{{$item->id}}">{{$item->nickname}}</option>
  125. @endif
  126. @endforeach
  127. </select>
  128. <select name="serverUserId" id="serverUserId" title="" class="form-control"
  129. style="width: 150px;float: right" onchange="tips.selectPage();">
  130. <option value="">请选择客服</option>
  131. @foreach($userList as $item)
  132. @if($item->role_id==7)
  133. <option value="{{$item->id}}">{{$item->nickname}}</option>
  134. @endif
  135. @endforeach
  136. </select>
  137. <select name="designUserId" id="designUserId" title="" class="form-control"
  138. style="width: 150px;float: right" onchange="tips.selectPage();">
  139. <option value="">请选择设计</option>
  140. @foreach($userList as $item)
  141. @if($item->role_id==27)
  142. <option value="{{$item->id}}">{{$item->nickname}}</option>
  143. @endif
  144. @endforeach
  145. </select>
  146. <select name="webUserId" id="webUserId" title="" class="form-control"
  147. style="width: 150px;float: right" onchange="tips.selectPage();">
  148. <option value="">请选择前端</option>
  149. @foreach($userList as $item)
  150. @if($item->role_id==14)
  151. <option value="{{$item->id}}">{{$item->nickname}}</option>
  152. @endif
  153. @endforeach
  154. </select>
  155. <select name="helpUserId" id="helpUserId" title="" class="form-control"
  156. style="width: 150px;float: right" onchange="tips.selectPage();">
  157. <option value="">请选择项目经理</option>
  158. @foreach($userList as $item)
  159. @if($item->role_id==25)
  160. <option value="{{$item->id}}">{{$item->nickname}}</option>
  161. @endif
  162. @endforeach
  163. </select>
  164. <select name="optimizeUserId" id="optimizeUserId" title="" class="form-control"
  165. style="width: 150px;float: right" onchange="tips.selectPage();">
  166. <option value="">请选择优化组长</option>
  167. @foreach($userList as $item)
  168. @if($item->role_id==26)
  169. <option value="{{$item->id}}">{{$item->nickname}}</option>
  170. @endif
  171. @endforeach
  172. </select>
  173. <select name="aeUserId" id="aeUserId" title="" class="form-control"
  174. style="width: 150px;float: right" onchange="tips.selectPage();">
  175. <option value="">请选择建站采编</option>
  176. @foreach($userList as $item)
  177. @if($item->role_id==2)
  178. <option value="{{$item->id}}">{{$item->nickname}}</option>
  179. @endif
  180. @endforeach
  181. </select>
  182. <select name="planUserId" id="planUserId" title="" class="form-control"
  183. style="width: 150px;float: right" onchange="tips.selectPage();">
  184. <option value="">请选择策划</option>
  185. @foreach($userList as $item)
  186. @if($item->role_id==29)
  187. <option value="{{$item->id}}">{{$item->nickname}}</option>
  188. @endif
  189. @endforeach
  190. </select>
  191. <select name="salesUserId" id="salesUserId" title="" class="form-control"
  192. style="width: 150px;float: right" onchange="tips.selectPage();">
  193. <option value="">请选择销售</option>
  194. @foreach($userList as $item)
  195. @if($item->role_id==1)
  196. <option value="{{$item->id}}">{{$item->nickname}}</option>
  197. @endif
  198. @endforeach
  199. </select>
  200. <select name="optimizationEditingUserId" id="optimizationEditingUserId" title=""
  201. class="form-control"
  202. style="width: 150px;float: right" onchange="tips.selectPage();">
  203. <option value="">请选择优化师/优化采编</option>
  204. @foreach($userList as $item)
  205. @if($item->role_id==32)
  206. <option value="{{$item->id}}">{{$item->nickname}}</option>
  207. @endif
  208. @endforeach
  209. </select>
  210. <select name="businessId" id="businessId" title="" class="form-control"
  211. style="width: 150px;float: right" onchange="tips.selectPage();">
  212. <option value="">请选择行业</option>
  213. @foreach($businessList as $key=>$item)
  214. <option value="{{$key}}">{{$item}}</option>
  215. @endforeach
  216. </select>
  217. <select name="projectType" id="projectType" title="" class="form-control"
  218. style="width: 150px;float: right" onchange="tips.selectPage();">
  219. <option value="">请选择项目类型</option>
  220. <option value="1">企业网站</option>
  221. <option value="2">电商网站</option>
  222. <option value="3">特殊项目</option>
  223. </select>
  224. <input type="text" placeholder="核心产品(中文)" class="input-md form-control"
  225. name="coreProduct"
  226. id="coreProduct" style="width: 200px;float: right">
  227. <input type="text" placeholder="核心产品(英文)" class="input-md form-control"
  228. name="layoutKeyword"
  229. id="layoutKeyword" style="width: 200px;float: right">
  230. </div>
  231. </form>
  232. <hr>
  233. <div class="table-responsive">
  234. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. </body>
  242. @endsection
  243. @section('footer')
  244. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  245. <script>
  246. var jsSwitch = document.querySelector(".js-switch");
  247. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  248. var jsSwitch2 = document.querySelector(".js-switch2");
  249. new Switchery(jsSwitch2, {color: "#1AB394", size: 'small'});
  250. var jsSwitch3 = document.querySelector(".js-switch3");
  251. new Switchery(jsSwitch3, {color: "#1AB394", size: 'small'});
  252. var units = {
  253. refresh: function () {
  254. var ajaxConfig = {
  255. url: '/admin/tool/rmCacheKey',
  256. success: function (result) {
  257. layer.msg(result.message, {icon: 6, time: 1000});
  258. }
  259. };
  260. tips.ajax(ajaxConfig);
  261. },
  262. generateReport: function () {
  263. var ajaxConfig = {
  264. url: '/admin/tool/generate-report',
  265. success: function (result) {
  266. layer.msg(result.message, {icon: 6, time: 1000});
  267. }
  268. };
  269. tips.ajax(ajaxConfig);
  270. },
  271. search: function () {
  272. tips.selectPage();
  273. },
  274. exportSitesList: function () {
  275. var formValues = tips.getFormValues("#searchForm");
  276. var str = $.param(formValues);
  277. window.open('/admin/site/indexExport?' + str)
  278. },
  279. getIdsBySelections: function () {
  280. var selections = $("#table").bootstrapTable('getSelections');
  281. var ids = [];
  282. $.each(selections, function (inx, val) {
  283. ids.push(val.id);
  284. });
  285. return ids;
  286. },
  287. edit: function (id) {
  288. var title = '添加';
  289. if (id > 0) {
  290. title = '编辑';
  291. }
  292. layer.open({
  293. type: 2,
  294. content: ['/admin/sites/' + id],
  295. area: ['100%', '100%'],
  296. title: title
  297. });
  298. },
  299. openDetail: function (id, title) {
  300. tips.page('/admin/sites/' + id + '/overview', title);
  301. },
  302. webmaster: function () {
  303. window.open('https://rank.yinqingli.cn/admincp/webmaster/oauth');
  304. },
  305. pcSpeedMeasurement: function (siteId) {
  306. layer.confirm('确定重新跑分吗?', {icon: 3, title: '重新跑分'}, function (index, layero) {
  307. layer.close(index);
  308. tips.ajax({
  309. url: '/admin/sites/getSpeedMeasurementCacheResult/' + siteId,
  310. type: 'get',
  311. tableRefresh: '#table',
  312. });
  313. });
  314. },
  315. isComponent: function (siteId, type) {
  316. layer.confirm('是否更改状态?', {icon: 3, title: '项目是否有插件'}, function (index, layero) {
  317. layer.close(index);
  318. tips.ajax({
  319. url: '/admin/sites/isComponent/' + siteId + '?type=' + type,
  320. type: 'get',
  321. tableRefresh: '#table',
  322. });
  323. });
  324. }
  325. };
  326. var config = {};
  327. config.url = '/admin/sites?is_propaganda={{$is_propaganda}}';
  328. config.pageSize = 50;
  329. config.showColumns = true;
  330. config.height = 300;
  331. config.columns = [ //字段
  332. {checkbox: true},
  333. {
  334. title: '序号', align: 'center', formatter: function (value, item, index) {
  335. return index + 1;
  336. },
  337. width: '10px'
  338. },
  339. {title: '项目状态', field: 'statusTitle', align: 'center', sortable: true},
  340. {
  341. title: '项目名称', field: 'cn_title', align: 'center', width: '240px',
  342. formatter: function (value, item) {
  343. var res = '';
  344. if (item.the500Strongest) {
  345. res += '<img src="/img/500qiang4.png" style="padding-right: 5px">';
  346. }
  347. if (item.listedCompany) {
  348. res += '<img src="/img/shangshi4.png" style="padding-right: 5px">';
  349. }
  350. if (item.stateEnterprises) {
  351. res += '<img src="/img/guoqi4.png" style="padding-right: 5px">';
  352. }
  353. if (item.leadingEnterprise) {
  354. res += '<img src="/img/longtou4.png" style="padding-right: 5px">';
  355. }
  356. res += value;
  357. return res
  358. }
  359. },
  360. {
  361. title: '域名', field: 'domain', align: 'center', width: '160px'
  362. },
  363. @if(in_array($role_id,[14]))
  364. {
  365. title: '第三方插件', field: '', align: 'center',
  366. formatter: function (value, row) {
  367. var str = '';
  368. if (row.is_component === 0) {
  369. str += '<button onclick="units.isComponent(' + row.id + ',1)" class="btn btn-md btn-primary" style="background: #d0648a !important;border: none">无</button>&nbsp;';
  370. } else {
  371. str += '<button onclick="units.isComponent(' + row.id + ',0)" class="btn btn-md btn-primary" style="background: #4ea397 !important;border: none">有</button>&nbsp;';
  372. }
  373. return str;
  374. }
  375. },
  376. @endif
  377. @if(in_array($role_id,[15,34]))
  378. {
  379. title: '软文指标', field: 'article_goal', align: 'center'
  380. },
  381. {title: '每月查找量', field: 'articles_updates_per_month', align: 'center'},
  382. {title: '完成月份至', field: 'monthOfCompletionNum', align: 'center', sortable: true},
  383. {title: '剩余查找量', field: 'over', align: 'center'},
  384. {title: '软文查找人员', field: 'propaganda', align: 'center'},
  385. {
  386. title: '有无规划',
  387. field: 'articleNote',
  388. align: 'center',
  389. sortable: true,
  390. formatter: function (value, row, index) {
  391. if (value === 0) {
  392. return '无';
  393. } else {
  394. return '<span style="color:red">有</span>';
  395. }
  396. }
  397. },
  398. @else
  399. {
  400. title: 'PC端分数',
  401. field: 'pcSpeedMeasurement',
  402. align: 'center',
  403. sortable: true,
  404. formatter: function (value, row, index) {
  405. var a = '';
  406. if (!value) {
  407. a = '<span style="color:gray;cursor: pointer" onclick="units.pcSpeedMeasurement(' + row.id + ')">--</span>';
  408. } else {
  409. if (value < 85) {
  410. a = '<span style="color:red;cursor: pointer" onclick="units.pcSpeedMeasurement(' + row.id + ')">' + value + '</span>';
  411. } else {
  412. a = '<span style="color:gray;cursor: pointer" onclick="units.pcSpeedMeasurement(' + row.id + ')">' + value + '</span>';
  413. }
  414. }
  415. return a;
  416. }
  417. },
  418. {
  419. title: '移动端分数',
  420. field: 'mobileSpeedMeasurement',
  421. align: 'center',
  422. sortable: true,
  423. formatter: function (value, row, index) {
  424. var a = '';
  425. if (!value) {
  426. a = '<span style="color:gray;cursor: pointer" onclick="units.pcSpeedMeasurement(' + row.id + ')">--</span>';
  427. } else {
  428. if (value < 70) {
  429. a = '<span style="color:red;cursor: pointer" onclick="units.pcSpeedMeasurement(' + row.id + ')">' + value + '</span>';
  430. } else {
  431. a = '<span style="color:gray;cursor: pointer" onclick="units.pcSpeedMeasurement(' + row.id + ')">' + value + '</span>';
  432. }
  433. }
  434. return a;
  435. }
  436. },
  437. {
  438. title: '月流量'+'({{$lastMonth}})',
  439. field: 'traffic',
  440. align: 'center',
  441. sortable: true,
  442. formatter: function (value, item, index) {
  443. var res = value;
  444. if (item.clicksDropResults) {
  445. res += '<i class="fa fa-arrow-down" style="font-size:8px;margin-left:6px"></i>' + item.clicksDropResults;
  446. }
  447. if (item.clicksDropResults1) {
  448. res += '<i class="fa fa-arrow-up" style="font-size:8px;margin-left:6px;color:#F00"></i>' + item.clicksDropResults1;
  449. }
  450. return res
  451. }
  452. },
  453. {
  454. title: '月排名'+'({{$month}})',
  455. field: 'top10',
  456. align: 'center',
  457. sortable: true,
  458. formatter: function (value, item, index) {
  459. var res = value;
  460. if (item.keywordDropResults) {
  461. res += '<i class="fa fa-arrow-down" style="font-size:8px;margin-left:6px"></i>' + item.keywordDropResults;
  462. }
  463. if (item.keywordDropResults1) {
  464. res += '<i class="fa fa-arrow-up" style="font-size:8px;margin-left:6px;color:#F00"></i>' + item.keywordDropResults1;
  465. }
  466. return res
  467. }
  468. },
  469. {
  470. title: '询盘'+'({{$lastMonth}})',
  471. field: 'inquire',
  472. align: 'center',
  473. sortable: true,
  474. formatter: function (value, item, index) {
  475. var res = value;
  476. if (item.listReportMapResult) {
  477. res += '<i class="fa fa-arrow-down" style="font-size:8px;margin-left:6px"></i>' + item.listReportMapResult;
  478. }
  479. if (item.listReportMapResult1) {
  480. res += '<i class="fa fa-arrow-up" style="font-size:8px;margin-left:6px;color:#F00"></i>' + item.listReportMapResult1;
  481. }
  482. return res
  483. }
  484. },
  485. {title: '月软文', field: 'articles_count', align: 'center'},
  486. {title: '月外链', field: 'link_details_count', align: 'center'},
  487. {title: '下单时间', field: 'order_at', align: 'center', sortable: true},
  488. @endif
  489. {
  490. title: '客服人员', field: 'server_title', align: 'center'
  491. },
  492. {title: '上线时间', field: 'online_at', align: 'center', sortable: true},
  493. {title: '达标时间', field: 'reach_at', align: 'center', sortable: true, width: '100px'},
  494. {
  495. title: '操作', field: 'id', align: 'center',
  496. formatter: function (value, row) {
  497. var str = '<button onclick="units.openDetail(' + value + ',\'' + row.cn_title + '\')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button><br>';
  498. if (row.is_google_bid) {
  499. if (row.bid_status) {
  500. str += '<span class="glyphicon glyphicon-fire" style="color:red">PPC</span>'
  501. } else {
  502. str += '<span class="glyphicon glyphicon-fire" style="color:#C0C0C0">PPC</span>'
  503. }
  504. }
  505. return str;
  506. }
  507. }
  508. ];
  509. tips.bootstrapTable(config);
  510. $(document).on('click', '#allotStaff', function () {
  511. var ids = units.getIdsBySelections();
  512. if (ids.length === 0) {
  513. layer.alert('请先选择您所要操作的对象', {icon: 0});
  514. return;
  515. }
  516. var siteIds = '?';
  517. $.each(ids, function (inx, val) {
  518. siteIds += 'siteIds[]=' + val + '&';
  519. });
  520. layer.open({
  521. type: 2,
  522. content: ['/admin/site/allot' + siteIds],
  523. area: ['50%', '50%'],
  524. title: '修改'
  525. });
  526. });
  527. $(document).on('click', '#batchDelete', function () {
  528. var ids = units.getIdsBySelections();
  529. if (ids.length === 0) {
  530. layer.alert('请先选择您所要操作的对象', {icon: 0});
  531. return;
  532. }
  533. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
  534. layer.close(index);
  535. tips.ajax({
  536. url: '/admin/sites',
  537. type: 'delete',
  538. data: {ids: ids},
  539. tableRefresh: '#table'
  540. });
  541. });
  542. });
  543. </script>
  544. @endsection