hall_save.blade.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. @extends('admin/layout')
  2. @section('header')
  3. <style>
  4. .auditReason {
  5. font-size: 16px;
  6. color: red;
  7. font-weight: bold;
  8. }
  9. .xmrl-gb-boxs {
  10. z-index: 1000;
  11. }
  12. .xmrl-gb-boxs.ons {
  13. position: fixed;
  14. width: 100%;
  15. left: 0;
  16. top: 0;
  17. padding-top: 15px;
  18. background: #fff;
  19. }
  20. .xmrl-gb-boxs.ons:before {
  21. content: '';
  22. display: block;
  23. position: absolute;
  24. width: 20px;
  25. height: 100%;
  26. left: 0;
  27. top: 0;
  28. background: #f3f3f4;
  29. z-index: 2000;
  30. }
  31. .xmrl-gb-boxs.ons:after {
  32. content: '';
  33. display: block;
  34. position: absolute;
  35. width: 20px;
  36. height: 100%;
  37. right: 0;
  38. top: 0;
  39. background: #f3f3f4;
  40. z-index: 2000;
  41. }
  42. </style>
  43. @endsection
  44. @section('content')
  45. <body class="gray-bg">
  46. <div class="row" style="padding: 20px 20px 0;background: #f3f3f4; margin: 0;">
  47. <div class="col-sm-12" style="height: 64px; background: #fff;padding-top: 15px;">
  48. <div class="row">
  49. <div class="col-sm-12" style="text-align: center;height: 40px;">
  50. <div class="xmrl-gb-boxs">
  51. <button class="btn btn-info" onclick="units.show()">项目信息</button>
  52. {{--待审核或审核失败--}}
  53. @if(in_array($data->status,[2,4]))
  54. <button class="btn btn-primary" type="button"
  55. onclick="units.submitAudit()">
  56. 提交审核
  57. </button>
  58. <button class="btn btn-warning" type="button"
  59. onclick="units.linkTaskRelease()">
  60. 释放任务
  61. </button>
  62. @endif
  63. @if($data->status==1) {{-- 待分配 --}}
  64. <button class="btn btn-warning" type="button"
  65. onclick="units.linkTaskClaim()">
  66. 认领任务
  67. </button>
  68. @else
  69. <button class="btn btn-success" type="button" onclick="units.exportExcel()">
  70. 导出
  71. </button>
  72. @endif
  73. @if($data->status==2) {{-- 任务中 --}}
  74. <button class="btn btn-info" type="button" onclick="units.importExcel()">
  75. 导入
  76. </button>
  77. @endif
  78. <button class="btn btn-white closeLayer" type="button">关闭页面</button>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="wrapper wrapper-content animated fadeInRight" style="padding-top: 0;">
  85. <div class="row">
  86. <div class="col-sm-12">
  87. <div class="ibox float-e-margins">
  88. <div class="ibox-content" style="padding-top: 0;">
  89. @if($data->status==4)
  90. <br>
  91. <div style="text-align: center;font-size: 16px;font-weight: bold">审核失败原因:<b
  92. style="color: red">{{$data->audit_reason}}</b></div>
  93. @endif
  94. {{--<div class="row hide">--}}
  95. {{--<div class="col-sm-12" style="text-align: center;height: 40px;">--}}
  96. {{--<div class="xmrl-gb-boxs">--}}
  97. {{--<button class="btn btn-info" onclick="units.show()">项目信息</button>--}}
  98. {{--待审核或审核失败--}}
  99. {{--@if(in_array($data->status,[2,4]))--}}
  100. {{--<button class="btn btn-primary" type="button"--}}
  101. {{--onclick="units.submitAudit()">--}}
  102. {{--提交审核--}}
  103. {{--</button>--}}
  104. {{--<button class="btn btn-warning" type="button"--}}
  105. {{--onclick="units.linkTaskRelease()">--}}
  106. {{--释放任务--}}
  107. {{--</button>--}}
  108. {{--@endif--}}
  109. {{--@if($data->status==1) --}}{{-- 任务中 --}}
  110. {{--<button class="btn btn-warning" type="button"--}}
  111. {{--onclick="units.linkTaskClaim()">--}}
  112. {{--认领任务--}}
  113. {{--</button>--}}
  114. {{--@endif--}}
  115. {{--<button class="btn btn-white closeLayer" type="button">关闭页面</button>--}}
  116. {{--</div>--}}
  117. {{--</div>--}}
  118. {{--</div>--}}
  119. @foreach($data->links as $inx=>$link)
  120. {{--@if($key!=0)--}}
  121. <div class="hr-line-dashed"></div>
  122. {{--@endif--}}
  123. <form class="form-horizontal" id="form{{$inx}}">
  124. <div class="form-group">
  125. <label class="col-sm-2 control-label" for="username">平台链接:</label>
  126. <label class="col-sm-10 control-label" style="text-align: left;font-weight: normal">
  127. <strong
  128. style="margin-right: 15px">({{$linkTypes[$link->type]??''}}
  129. )</strong><span>{{$link->url??''}}</span>
  130. </label>
  131. </div>
  132. <div class="form-group">
  133. <label class="col-sm-2 control-label" for="username">链接备注:</label>
  134. <label class="col-sm-10 control-label" style="text-align: left;font-weight: normal">
  135. {{$link->remark??''}}
  136. </label>
  137. </div>
  138. <div class="form-group">
  139. <label class="col-sm-2 control-label" for="username">用户名:</label>
  140. <div class="col-sm-8">
  141. <input type="text" class="form-control" name="username" title=""
  142. value="{{$link->pivot->username??''}}">
  143. </div>
  144. </div>
  145. <div class="form-group">
  146. <label class="col-sm-2 control-label" for="title">注册邮箱:</label>
  147. <div class="col-sm-8">
  148. <input type="text" class="form-control" name="email" title=""
  149. value="{{$link->pivot->email??''}}">
  150. </div>
  151. </div>
  152. <div class="form-group">
  153. <label class="col-sm-2 control-label" for="password">密码:</label>
  154. <div class="col-sm-8">
  155. <input type="text" class="form-control" name="password" title=""
  156. value="{{$link->pivot->password??''}}">
  157. </div>
  158. </div>
  159. <div class="form-group">
  160. <label class="col-sm-2 control-label" for="url">profile演示地址:</label>
  161. <div class="col-sm-8">
  162. <input type="text" class="form-control" name="url" title=""
  163. value="{{$link->pivot->url??''}}">
  164. </div>
  165. </div>
  166. <div class="showUrl">
  167. @php $showUrls = $idMapUrls[$link->pivot->id]??[[]]; @endphp
  168. @foreach($showUrls as $key=>$item)
  169. <div class="form-group">
  170. @if($key==0)
  171. <label class="col-sm-2 control-label">页面演示地址:</label>
  172. @endif
  173. <div class="col-sm-6 @if($key!=0) col-sm-offset-2 @endif">
  174. <input type="text" class="form-control" name="show_url" title=""
  175. value="{{$item['url']??''}}">
  176. <input type="hidden" name="show_url_id"
  177. value="{{$item['id']??0}}">
  178. @if($data->status==4)
  179. <span class="auditReason">{{$item['audit_reason']??''}}</span>
  180. @endif
  181. </div>
  182. <div class="col-sm-2">
  183. @if($key==0)
  184. <button class="btn btn-primary" type="button"
  185. onclick="units.addShowUrl(this)">添加
  186. </button>
  187. @else
  188. <button class="btn btn-warning" type="button"
  189. onclick="units.delShowUrl(this)">删除
  190. </button>
  191. @endif
  192. </div>
  193. </div>
  194. @endforeach
  195. </div>
  196. <div class="form-group">
  197. <label class="col-sm-2 control-label" for="remark">备注:</label>
  198. <div class="col-sm-8">
  199. <textarea class="form-control"
  200. name="remark" id="remark">{{$link->pivot->remark??''}}</textarea>
  201. </div>
  202. </div>
  203. <div class="form-group">
  204. <div class="col-sm-4 col-sm-offset-2">
  205. {{--待审核或审核失败--}}
  206. @if(in_array($data->status,[2,4]))
  207. <button class="btn btn-primary" type="button"
  208. onclick="units.save('{{$inx}}','{{$link->pivot->id??''}}')">
  209. 保存
  210. </button>
  211. @endif
  212. </div>
  213. </div>
  214. </form>
  215. @endforeach
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </body>
  222. @endsection
  223. @section('footer')
  224. <script>
  225. var units = {
  226. importExcel: function () {
  227. var str = '<div class="ibox-content" id="importLayer">' +
  228. '<form class="form-horizontal">' +
  229. '<div class="form-group">' +
  230. '<label class="col-sm-3 control-label">请选择excel文件:</label>' +
  231. '<div class="col-sm-6">' +
  232. '<input type="file" id="excel_file" class="form-control">' +
  233. '<input type="hidden" id="excel_path">' +
  234. '</div>' +
  235. '<div class="col-sm-2"><button class="btn btn-info" type="button" onclick="units.fileUpload()">上传</button></div>' +
  236. '</div>' +
  237. ' <div class="form-group">' +
  238. '<div class="col-sm-6 col-sm-offset-3">' +
  239. '<a href="{{asset('tpl/link_hall_tpl.xlsx')}}">请下载导入模板</a>' +
  240. '</div>' +
  241. '</div>' +
  242. '</form>' +
  243. '</div>';
  244. openIndex = layer.open({
  245. type: 1,
  246. content: str,
  247. area: ['60%', '30%'],
  248. // btn: ['导入', '取消'],
  249. title: '导入关键词',
  250. {{--yes: function (index, layero) {--}}
  251. {{--var data = {excel_path: $("#excel_path").val(), siteId: "{{$siteId}}"};--}}
  252. {{--var config = {--}}
  253. {{--url: '/admin/rank/keyword/import',--}}
  254. {{--type: 'post',--}}
  255. {{--data: data,--}}
  256. {{--success: function (result) {--}}
  257. {{--layer.msg(result.message, {icon: 6, time: 1500}, function () {--}}
  258. {{--layer.close(openIndex);--}}
  259. {{--});--}}
  260. {{--}--}}
  261. {{--};--}}
  262. {{--tips.ajax(config);--}}
  263. {{--}--}}
  264. });
  265. },
  266. exportExcel: function () {
  267. window.open('/admin/link/hall/worker-export?taskId={{$data->id}}');
  268. },
  269. fileUpload: function () {
  270. var config = {
  271. url: '/admin/tool/excel-upload'
  272. };
  273. config.success = function (result) {
  274. // $("#excel_path").val(result.data.file_url);
  275. // layer.msg(result.message, {icon: 6, time: 1500});
  276. var data = {excel_path: result.data.file_url, taskId: "{{$data->id}}"};
  277. var config = {
  278. url: '/admin/link/hall/worker-import',
  279. type: 'post',
  280. data: data,
  281. success: function (result) {
  282. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  283. layer.close(openIndex);
  284. window.location.reload();
  285. });
  286. }
  287. };
  288. tips.ajax(config);
  289. };
  290. tips.fileUpload($("#excel_file"), config);
  291. },
  292. addShowUrl: function (_this) { //添加页面演示地址
  293. var html = '<div class="form-group">' +
  294. '<div class="col-sm-6 col-sm-offset-2">' +
  295. '<input type="text" class="form-control" name="show_url" value="">' +
  296. '<input type="hidden" name="show_url_id" value="0">' +
  297. '</div>' +
  298. '<div class="col-sm-2">' +
  299. '<button class="btn btn-warning" type="button" onclick="units.delShowUrl(this)">删除\n' +
  300. '</button>' +
  301. '</div>' +
  302. '</div>';
  303. $(_this).parent().parent().parent().append(html);
  304. },
  305. delShowUrl: function (_this) { //删除页面演示地址
  306. $(_this).parent().parent().remove();
  307. },
  308. save: function (key, id) { //兼职人员保存
  309. var formSelector = "#form" + key;
  310. var data = tips.getFormValues(formSelector);
  311. var urls = [];
  312. $(formSelector).find("div.showUrl").find(".form-group").each(function () {
  313. if ($(this).find("[name=show_url]").val().length !== 0) {
  314. urls.push({
  315. url: $(this).find("[name=show_url]").val(),
  316. id: $(this).find("[name=show_url_id]").val()
  317. });
  318. }
  319. });
  320. var ajax = function () {
  321. var url = '/admin/link/hall/work-save/' + id;
  322. var ajaxConfig = {
  323. url: url,
  324. type: 'put',
  325. data: {link_tasks_detail: data, link_tasks_url: {show_urls: urls}}
  326. };
  327. tips.ajax(ajaxConfig);
  328. };
  329. ajax();
  330. },
  331. show: function () { //项目信息展示
  332. var url = '/admin/link/hall-show/{{$data->id??null}}';
  333. layer.open({
  334. type: 2,
  335. content: [url],
  336. area: ['90%', '100%'],
  337. title: '项目信息',
  338. closeBtn: 1
  339. });
  340. },
  341. submitAudit: function () { //用户提交审核
  342. layer.confirm('您确定要提交审核吗?', {icon: 3, title: '提交审核'}, function () {
  343. var url = '/admin/link/task/{{$data->id}}/submit-audit';
  344. var ajaxConfig = {
  345. url: url,
  346. type: 'put',
  347. success: function (result) {
  348. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  349. tips.closeParentLayer();
  350. window.parent.tips.tableRefresh('#table');
  351. });
  352. }
  353. };
  354. tips.ajax(ajaxConfig);
  355. });
  356. },
  357. linkTaskClaim: function () {
  358. layer.confirm('您确定要接受该任务吗?', {icon: 3, title: '认领任务'}, function () {
  359. var url = '/admin/link/task/{{$data->id}}/claim';
  360. var ajaxConfig = {
  361. url: url,
  362. type: 'put',
  363. success: function (result) {
  364. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  365. // tips.closeParentLayer();
  366. // window.parent.tips.tableRefresh('#table');
  367. window.location.reload();
  368. });
  369. }
  370. };
  371. tips.ajax(ajaxConfig);
  372. });
  373. },
  374. linkTaskRelease: function () {
  375. layer.confirm('您确定要释放该任务吗?', {icon: 3, title: '任务释放'}, function () {
  376. var url = '/admin/link/task/{{$data->id}}/release';
  377. var ajaxConfig = {
  378. url: url,
  379. type: 'put',
  380. success: function (result) {
  381. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  382. tips.closeParentLayer();
  383. window.parent.tips.tableRefresh('#table');
  384. // window.location.reload();
  385. });
  386. }
  387. };
  388. tips.ajax(ajaxConfig);
  389. });
  390. }
  391. };
  392. $(window).scrollTop(0);
  393. $(window).scroll(function () {
  394. var scrollHeight = 10;
  395. if ($(window).scrollTop() > scrollHeight) {
  396. $(".xmrl-gb-boxs").addClass("ons");
  397. } else {
  398. $(".xmrl-gb-boxs").removeClass("ons");
  399. }
  400. });
  401. </script>
  402. @endsection