extend.blade.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. @extends('admin/site/side_layout')
  2. @section('header_extend')
  3. <style>
  4. .tabs-container .tab-content .lists {
  5. height: 0;
  6. overflow: hidden;
  7. }
  8. .tabs-container .tab-content .lists.active {
  9. height: auto;
  10. }
  11. </style>
  12. @endsection
  13. @section('right')
  14. @php $hasEdit=0; @endphp
  15. @hasAuth('sites-report-edit')
  16. @php $hasEdit=1; @endphp
  17. @endHasAuth
  18. @hasAuth('sites-report-edit')
  19. <div style="padding-bottom: 20px">
  20. <button type="button" class="btn btn-info" onclick="units.report()">月报</button>
  21. <button type="button" class="btn btn-primary" onclick="units.afresh()">重新生成</button>
  22. <button type="button" class="btn btn-success" onclick="units.clearLastMonthData()" >清除上月数据</button>
  23. </div>
  24. @endHasAuth
  25. <div class="tabs-container">
  26. <ul class="nav nav-tabs">
  27. <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 外链文章</a>
  28. </li>
  29. <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">月度总结</a>
  30. </li>
  31. <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">合同</a>
  32. </li>
  33. </ul>
  34. <div class="tab-content">
  35. <div id="tab-1" class="lists active">
  36. <form id="customer">
  37. <div class="form-group">
  38. <label class="control-label">外链数量</label>
  39. <div class="input-group">
  40. @foreach($sixMonth as $val)
  41. <span class="input-group-addon">{{date('Y年n月', strtotime($val . '01')) }}</span>
  42. <input type="text" class="form-control" title=""
  43. name="linkCount"
  44. value="{{$keyCustomList[$val]->link_count ?? ''}}">
  45. @endforeach
  46. </div>
  47. </div>
  48. <hr class="line">
  49. <div class="form-group">
  50. <label class="control-label">文章数量</label>
  51. <div class="input-group">
  52. @foreach($sixMonth as $val)
  53. <span class="input-group-addon">{{date('Y年n月', strtotime($val . '01')) }}</span>
  54. <input type="text" class="form-control"
  55. name="articleCount" title=""
  56. value="{{$keyCustomList[$val]->article_count ?? '' }}">
  57. @endforeach
  58. </div>
  59. </div>
  60. <div class="hr-line-dashed"></div>
  61. <div class="form-group">
  62. <div class="col-sm-4 col-sm-offset-2">
  63. @if($hasEdit)
  64. <button class="btn btn-primary" type="button"
  65. onclick="units.customerSave();">
  66. 保存
  67. </button>
  68. @endif
  69. {{--<button class="btn btn-white closeLayer" type="button">取消</button>--}}
  70. </div>
  71. </div>
  72. </form>
  73. </div>
  74. <div id="tab-2" class="lists">
  75. <table width="100%" class="table table-datalist" data-plugin="chk-group" id="table">
  76. <thead>
  77. <tr>
  78. <td style="text-indent: 20px">优化事项</td>
  79. <td style="text-indent: 15px">引擎力项目经理</td>
  80. <td style="text-indent: 15px">客户</td>
  81. <td style="width: 80px;text-align: center" onclick="units.add(this)"><span
  82. class="glyphicon glyphicon-plus"></span></td>
  83. </tr>
  84. </thead>
  85. <tbody>
  86. @foreach ($summaryList as $item)
  87. <tr>
  88. <td><textarea cols="30" rows="2" name="val1" title="">{{$item->val1}}</textarea></td>
  89. <td><textarea cols="30" rows="2" name="val2" title="">{{$item->val2}}</textarea></td>
  90. <td><textarea cols="30" rows="2" name="val3" title="">{{$item->val3}}</textarea></td>
  91. <td style="width:80px;text-align:center;padding-top:20px" onclick="units.remove(this)">
  92. <span class="glyphicon glyphicon-minus"></span>
  93. <input type="hidden" name="summaryId" value="{{$item->id}}">
  94. </td>
  95. </tr>
  96. @endforeach
  97. </tbody>
  98. </table>
  99. <br>
  100. <textarea style="width: 100%;" rows="6" id="remark" name="remark"
  101. title="">{{$reportExtend->remark??''}}</textarea>
  102. @php $selectItems=json_decode($reportExtend->select_item??null,true)??[] @endphp
  103. @php
  104. $manageList=$selectItems['manage']??[];
  105. $customerList=$selectItems['customer']??[];
  106. @endphp
  107. <div style="margin-top: 10px">
  108. <h3>项目经理勾选内容:</h3>
  109. <div>
  110. @php $str="网站数据呈平稳上升趋势,将持续推进优化工作。" @endphp
  111. <input type="checkbox" value="{{$str}}" name="selectManage"
  112. @if (in_array($str,$manageList)) checked @endif>
  113. {{$str}}
  114. </div>
  115. <div>
  116. @php $str="网站数据中个别指标有所波动,属于正常现象,我们将持续推进优化工作,使数据平稳上升。" @endphp
  117. <input type="checkbox" value="{{$str}}" name="selectManage"
  118. @if (in_array($str,$manageList)) checked @endif>
  119. {{$str}}
  120. </div>
  121. <div>
  122. @php $str="网站数据波动比较大,正在查找原因,下一步将调整优化方案加强优化。" @endphp
  123. <input type="checkbox" value="{{$str}}" name="selectManage"
  124. @if (in_array($str,$manageList)) checked @endif>
  125. {{$str}}
  126. </div>
  127. <br>
  128. <h3>客户配合:</h3>
  129. <div>
  130. @php $customerStr="尽量提供企业、行业、产品相关资讯继信息进行站内更新,形式可以多样:video,pdf,images等。" @endphp
  131. <input type="checkbox" value="{{$customerStr}}"
  132. name="selectCustomer" @if (in_array($customerStr,$customerList)) checked @endif>
  133. {{$customerStr}}
  134. </div>
  135. <div>
  136. @php $customerStr="可以登陆quora平台,参与评论互动,每月3-5条为宜。" @endphp
  137. <input type="checkbox" value="{{$customerStr}}" name="selectCustomer"
  138. @if (in_array($customerStr,$customerList)) checked @endif>
  139. {{$customerStr}}
  140. </div>
  141. <div>
  142. @php $customerStr="发送营销邮件,刺激客户点击访问网站" @endphp
  143. <input type="checkbox" value="{{$customerStr}}" name="selectCustomer"
  144. @if (in_array($customerStr,$customerList)) checked @endif>
  145. {{$customerStr}}
  146. </div>
  147. <div>
  148. @php $customerStr="多与已有网站、合作伙伴、上下游客户进行友情链接" @endphp
  149. <input type="checkbox" value="{{$customerStr}}" name="selectCustomer"
  150. @if (in_array($customerStr,$customerList)) checked @endif>
  151. {{$customerStr}}
  152. </div>
  153. <div>
  154. @php $customerStr="邮件给客户公司的社交主页,让客户关注,让公司员工注册对应社交并关注公司主页,日常互动。" @endphp
  155. <input type="checkbox" value="{{$customerStr}}"
  156. name="selectCustomer" @if (in_array($customerStr,$customerList)) checked @endif>
  157. {{$customerStr}}
  158. </div>
  159. </div>
  160. <div id="fileDiv">
  161. @if($hasEdit)
  162. <button type="button" class="btn btn-primary" name="file_upload"
  163. style="float: left;margin-top: 5px;margin-right:10px;" onclick="units.triggerFile()">
  164. 文件上传
  165. </button>
  166. @endif
  167. <input type="file" value="" style="display: none" name="uploadFile" id="uploadFile"
  168. onchange="units.fileUpload(this)">
  169. @if (!empty($reportExtend->file_list))
  170. @php $viewFileList = json_decode($reportExtend->file_list, true); @endphp
  171. @foreach ($viewFileList as $item)
  172. <div class="input-group input-group-sm"
  173. style="width: 180px;padding-top:5px;float:left;">
  174. <span class="input-group-addon"><span
  175. class="glyphicon glyphicon-remove" onclick="units.removeFile(this)"></span></span>
  176. <input type="text" class="form-control" name="fileTitle" title=""
  177. value="{{$item['fileTitle']}}">
  178. <input type="hidden" class="form-control" name="fileVal" value="{{$item['fileVal']}}">
  179. </div>
  180. @endforeach
  181. @endif
  182. </div>
  183. <div>
  184. @if($hasEdit)
  185. <button class="btn btn-primary" type="button"
  186. onclick="units.summarySave()">
  187. 保存
  188. </button>
  189. @endif
  190. </div>
  191. @foreach($reportExtendList as $item)
  192. <hr>
  193. <div>
  194. <span style="font-weight: bold">月份:{{$item->ym}}</span>
  195. <br>
  196. @php $nowSummary= $reportSummaryList[$item->ym]??[]; @endphp
  197. @if($nowSummary)
  198. <table width="80%">
  199. <thead>
  200. <tr>
  201. <td>优化事项</td>
  202. <td>引擎力项目经理</td>
  203. <td>客户</td>
  204. </tr>
  205. @foreach($nowSummary as $val)
  206. <tr>
  207. <td>{{$val['val1']}}</td>
  208. <td>{{$val['val2']}}</td>
  209. <td>{{$val['val3']}}</td>
  210. </tr>
  211. @endforeach
  212. </thead>
  213. </table>
  214. <br>
  215. @endif
  216. <p>
  217. {!! $item->remark !!}
  218. </p>
  219. </div>
  220. @endforeach
  221. </div>
  222. <div id="tab-3" class="tab-pane fade">
  223. <br>
  224. <form id="contract" class="form-horizontal">
  225. <div class="form-group">
  226. <label class="control-label col-sm-2" for="keyNum">关键词合同数:</label>
  227. <div class="col-sm-8">
  228. <input type="number" class="form-control" id="keyNum"
  229. value="{{$contractList->key_num??''}}">
  230. </div>
  231. </div>
  232. <div class="form-group">
  233. <label class="control-label col-sm-2" for="articleNum">软文合同数:</label>
  234. <div class="col-sm-8">
  235. <input type="number" class="form-control" id="articleNum"
  236. value="{{$contractList->article_num??''}}">
  237. </div>
  238. </div>
  239. <div class="form-group">
  240. <label class="control-label col-sm-2" for="linkNum">营销合同数:</label>
  241. <div class="col-sm-8">
  242. <input type="number" class="form-control" id="linkNum"
  243. value="{{$contractList->link_num??''}}">
  244. </div>
  245. </div>
  246. <div class="form-group">
  247. <div class="col-sm-4 col-sm-offset-2">
  248. @if($hasEdit)
  249. <button class="btn btn-primary" type="button"
  250. onclick="units.contractSave();">
  251. 保存
  252. </button>
  253. @endif
  254. {{--<button class="btn btn-white closeLayer" type="button">取消</button>--}}
  255. </div>
  256. </div>
  257. </form>
  258. </div>
  259. </div>
  260. </div>
  261. @endsection
  262. @section('footer_extend')
  263. <script>
  264. var units = {
  265. customerSave: function () {
  266. var linkCount = [], articleCount = [], sixMonth, data = {};
  267. $("[name=linkCount]").each(function () {
  268. linkCount.push($(this).val());
  269. });
  270. $("[name=articleCount]").each(function () {
  271. articleCount.push($(this).val());
  272. });
  273. sixMonth = JSON.parse('{!! json_encode($sixMonth) !!}');
  274. $.each(sixMonth, function (inx, val) {
  275. data[val] = {linkCount: linkCount[inx], articleCount: articleCount[inx]}
  276. });
  277. var ajaxConfig = {
  278. url: '/admin/site/' + "{{$data->old_id}}" + '/report/customer',
  279. type: 'put',
  280. data: {ymMapData: data}
  281. };
  282. tips.ajax(ajaxConfig);
  283. },
  284. contractSave: function () {
  285. var ajaxConfig = {
  286. url: '/admin/site/' + "{{$data->old_id}}" + '/report/contract',
  287. type: 'put',
  288. data: {
  289. key_num: $("#keyNum").val(),
  290. article_num: $("#articleNum").val(),
  291. link_num: $("#linkNum").val()
  292. }
  293. };
  294. tips.ajax(ajaxConfig);
  295. },
  296. summarySave: function () {
  297. var dataList = [];
  298. var val1, val2, val3;
  299. $("#table").find("tbody").find("tr").each(function () {
  300. val1 = $(this).find("[name=val1]").val();
  301. val2 = $(this).find("[name=val2]").val();
  302. val3 = $(this).find("[name=val3]").val();
  303. if (val1 || val2 || val3) {
  304. dataList.push({
  305. summaryId: $(this).find("[name=summaryId]").val(),
  306. val1: val1,
  307. val2: val2,
  308. val3: val3
  309. });
  310. }
  311. });
  312. var fileList = [];
  313. $("#fileDiv").find("div").each(function () {
  314. fileList.push({
  315. fileTitle: $(this).find("[name=fileTitle]").val(),
  316. fileVal: $(this).find("[name=fileVal]").val()
  317. });
  318. });
  319. var selectManageList = [];
  320. $("[name=selectManage]:checked").each(function () {
  321. selectManageList.push($(this).val());
  322. });
  323. var selectCustomerList = [];
  324. $("[name=selectCustomer]:checked").each(function () {
  325. selectCustomerList.push($(this).val());
  326. });
  327. var ajaxConfig = {
  328. url: '/admin/site/' + "{{$data->old_id}}" + '/report/summary',
  329. type: 'put',
  330. data: {
  331. dataList: dataList,
  332. remark: $("#remark").val(),
  333. fileList: fileList,
  334. selectManageList: selectManageList,
  335. selectCustomerList: selectCustomerList
  336. }
  337. };
  338. tips.ajax(ajaxConfig);
  339. },
  340. add: function (_this) {
  341. $(_this).parent().parent().next().append(units.makeHtml());
  342. },
  343. remove: function (_this) {
  344. $(_this).parent().remove();
  345. },
  346. makeHtml: function () {
  347. return '<tr>' +
  348. '<td><textarea cols="30" rows="2" name="val1"></textarea></td>' +
  349. '<td><textarea cols="30" rows="2" name="val2"></textarea></td>' +
  350. '<td> ' +
  351. '<textarea cols="30" rows="2" name="val3" style="float:left"></textarea>' +
  352. '</td>' +
  353. '<td class="cut" style="width:80px;text-align:center;padding-top:20px" onclick="units.remove(this)">' +
  354. '<span class="glyphicon glyphicon-minus"></span>' +
  355. '<input type="hidden" name="summaryId" value="0">' +
  356. '</td>' +
  357. '</tr>';
  358. },
  359. triggerFile: function () { //文件上传
  360. $("#uploadFile").trigger('click');
  361. },
  362. fileUpload: function (_this) {
  363. var config = {
  364. url: '/admin/tool/upload'
  365. };
  366. config.success = function (result) {
  367. layer.msg(result.message, {icon: 6, time: 1500});
  368. $("#fileDiv").append(units.makeFileHtml(result.data.original_name, result.data.file_url));
  369. };
  370. tips.fileUpload(_this, config);
  371. },
  372. makeFileHtml: function (fileTitle, fileVal) {
  373. if (!fileTitle) {
  374. fileTitle = '';
  375. }
  376. if (!fileVal) {
  377. fileVal = '';
  378. }
  379. return '<div class="input-group input-group-sm" style="width: 180px;padding-top:5px;float:left;">' +
  380. '<span class="input-group-addon"><span class="glyphicon glyphicon-remove" onclick="units.removeFile(this)"></span></span>' +
  381. '<input type="text" class="form-control" name="fileTitle" value="' + fileTitle + '">' +
  382. '<input type="hidden" class="form-control" name="fileVal" value="' + fileVal + '">' +
  383. '</div>';
  384. },
  385. removeFile: function (_this) {
  386. $(_this).parent().parent().remove();
  387. },
  388. report: function () {
  389. window.open('https://rank.yinqingli.cn/webmaster/report?projectId=' + "{{base64_encode($data->old_id)}}");
  390. },
  391. afresh: function () {
  392. window.open('https://rank.yinqingli.cn/webmaster/report?noCache=1&projectId=' + "{{base64_encode($data->old_id)}}");
  393. },
  394. clearLastMonthData: function () {
  395. var ajaxConfig = {
  396. url: '/admin/site/clearLastMonthData/{{$siteId}}',
  397. type: 'get',
  398. success: function () {
  399. layer.msg('操作成功', {
  400. icon: 1,
  401. time: 1500 //2秒关闭(如果不配置,默认是3秒)
  402. }, function () {
  403. window.location.reload()
  404. });
  405. }
  406. };
  407. tips.ajax(ajaxConfig);
  408. },
  409. };
  410. </script>
  411. @endsection