123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- @extends('admin/layout')
- @section('header')
- <style>
- .auditReason {
- font-size: 16px;
- color: red;
- font-weight: bold;
- }
- .xmrl-gb-boxs {
- z-index: 1000;
- }
- .xmrl-gb-boxs.ons {
- position: fixed;
- width: 100%;
- left: 0;
- top: 0;
- padding-top: 15px;
- background: #fff;
- }
- .xmrl-gb-boxs.ons:before {
- content: '';
- display: block;
- position: absolute;
- width: 20px;
- height: 100%;
- left: 0;
- top: 0;
- background: #f3f3f4;
- z-index: 2000;
- }
- .xmrl-gb-boxs.ons:after {
- content: '';
- display: block;
- position: absolute;
- width: 20px;
- height: 100%;
- right: 0;
- top: 0;
- background: #f3f3f4;
- z-index: 2000;
- }
- </style>
- @endsection
- @section('content')
- <body class="gray-bg">
- <div class="row" style="padding: 20px 20px 0;background: #f3f3f4; margin: 0;">
- <div class="col-sm-12" style="height: 64px; background: #fff;padding-top: 15px;">
- <div class="row">
- <div class="col-sm-12" style="text-align: center;height: 40px;">
- <div class="xmrl-gb-boxs">
- <button class="btn btn-info" onclick="units.show()">项目信息</button>
- {{--待审核或审核失败--}}
- @if(in_array($data->status,[2,4]))
- <button class="btn btn-primary" type="button"
- onclick="units.submitAudit()">
- 提交审核
- </button>
- <button class="btn btn-warning" type="button"
- onclick="units.linkTaskRelease()">
- 释放任务
- </button>
- @endif
- @if($data->status==1) {{-- 待分配 --}}
- <button class="btn btn-warning" type="button"
- onclick="units.linkTaskClaim()">
- 认领任务
- </button>
- @else
- <button class="btn btn-success" type="button" onclick="units.exportExcel()">
- 导出
- </button>
- @endif
- @if($data->status==2) {{-- 任务中 --}}
- <button class="btn btn-info" type="button" onclick="units.importExcel()">
- 导入
- </button>
- @endif
- <button class="btn btn-white closeLayer" type="button">关闭页面</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="wrapper wrapper-content animated fadeInRight" style="padding-top: 0;">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content" style="padding-top: 0;">
- @if($data->status==4)
- <br>
- <div style="text-align: center;font-size: 16px;font-weight: bold">审核失败原因:<b
- style="color: red">{{$data->audit_reason}}</b></div>
- @endif
- {{--<div class="row hide">--}}
- {{--<div class="col-sm-12" style="text-align: center;height: 40px;">--}}
- {{--<div class="xmrl-gb-boxs">--}}
- {{--<button class="btn btn-info" onclick="units.show()">项目信息</button>--}}
- {{--待审核或审核失败--}}
- {{--@if(in_array($data->status,[2,4]))--}}
- {{--<button class="btn btn-primary" type="button"--}}
- {{--onclick="units.submitAudit()">--}}
- {{--提交审核--}}
- {{--</button>--}}
- {{--<button class="btn btn-warning" type="button"--}}
- {{--onclick="units.linkTaskRelease()">--}}
- {{--释放任务--}}
- {{--</button>--}}
- {{--@endif--}}
- {{--@if($data->status==1) --}}{{-- 任务中 --}}
- {{--<button class="btn btn-warning" type="button"--}}
- {{--onclick="units.linkTaskClaim()">--}}
- {{--认领任务--}}
- {{--</button>--}}
- {{--@endif--}}
- {{--<button class="btn btn-white closeLayer" type="button">关闭页面</button>--}}
- {{--</div>--}}
- {{--</div>--}}
- {{--</div>--}}
- @foreach($data->links as $inx=>$link)
- {{--@if($key!=0)--}}
- <div class="hr-line-dashed"></div>
- {{--@endif--}}
- <form class="form-horizontal" id="form{{$inx}}">
- <div class="form-group">
- <label class="col-sm-2 control-label" for="username">平台链接:</label>
- <label class="col-sm-10 control-label" style="text-align: left;font-weight: normal">
- <strong
- style="margin-right: 15px">({{$linkTypes[$link->type]??''}}
- )</strong><span>{{$link->url??''}}</span>
- </label>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="username">链接备注:</label>
- <label class="col-sm-10 control-label" style="text-align: left;font-weight: normal">
- {{$link->remark??''}}
- </label>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="username">用户名:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" name="username" title=""
- value="{{$link->pivot->username??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="title">注册邮箱:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" name="email" title=""
- value="{{$link->pivot->email??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="password">密码:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" name="password" title=""
- value="{{$link->pivot->password??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="url">profile演示地址:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" name="url" title=""
- value="{{$link->pivot->url??''}}">
- </div>
- </div>
- <div class="showUrl">
- @php $showUrls = $idMapUrls[$link->pivot->id]??[[]]; @endphp
- @foreach($showUrls as $key=>$item)
- <div class="form-group">
- @if($key==0)
- <label class="col-sm-2 control-label">页面演示地址:</label>
- @endif
- <div class="col-sm-6 @if($key!=0) col-sm-offset-2 @endif">
- <input type="text" class="form-control" name="show_url" title=""
- value="{{$item['url']??''}}">
- <input type="hidden" name="show_url_id"
- value="{{$item['id']??0}}">
- @if($data->status==4)
- <span class="auditReason">{{$item['audit_reason']??''}}</span>
- @endif
- </div>
- <div class="col-sm-2">
- @if($key==0)
- <button class="btn btn-primary" type="button"
- onclick="units.addShowUrl(this)">添加
- </button>
- @else
- <button class="btn btn-warning" type="button"
- onclick="units.delShowUrl(this)">删除
- </button>
- @endif
- </div>
- </div>
- @endforeach
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="remark">备注:</label>
- <div class="col-sm-8">
- <textarea class="form-control"
- name="remark" id="remark">{{$link->pivot->remark??''}}</textarea>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- {{--待审核或审核失败--}}
- @if(in_array($data->status,[2,4]))
- <button class="btn btn-primary" type="button"
- onclick="units.save('{{$inx}}','{{$link->pivot->id??''}}')">
- 保存
- </button>
- @endif
- </div>
- </div>
- </form>
- @endforeach
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script>
- var units = {
- importExcel: function () {
- var str = '<div class="ibox-content" id="importLayer">' +
- '<form class="form-horizontal">' +
- '<div class="form-group">' +
- '<label class="col-sm-3 control-label">请选择excel文件:</label>' +
- '<div class="col-sm-6">' +
- '<input type="file" id="excel_file" class="form-control">' +
- '<input type="hidden" id="excel_path">' +
- '</div>' +
- '<div class="col-sm-2"><button class="btn btn-info" type="button" onclick="units.fileUpload()">上传</button></div>' +
- '</div>' +
- ' <div class="form-group">' +
- '<div class="col-sm-6 col-sm-offset-3">' +
- '<a href="{{asset('tpl/link_hall_tpl.xlsx')}}">请下载导入模板</a>' +
- '</div>' +
- '</div>' +
- '</form>' +
- '</div>';
- openIndex = layer.open({
- type: 1,
- content: str,
- area: ['60%', '30%'],
- // btn: ['导入', '取消'],
- title: '导入关键词',
- {{--yes: function (index, layero) {--}}
- {{--var data = {excel_path: $("#excel_path").val(), siteId: "{{$siteId}}"};--}}
- {{--var config = {--}}
- {{--url: '/admin/rank/keyword/import',--}}
- {{--type: 'post',--}}
- {{--data: data,--}}
- {{--success: function (result) {--}}
- {{--layer.msg(result.message, {icon: 6, time: 1500}, function () {--}}
- {{--layer.close(openIndex);--}}
- {{--});--}}
- {{--}--}}
- {{--};--}}
- {{--tips.ajax(config);--}}
- {{--}--}}
- });
- },
- exportExcel: function () {
- window.open('/admin/link/hall/worker-export?taskId={{$data->id}}');
- },
- fileUpload: function () {
- var config = {
- url: '/admin/tool/excel-upload'
- };
- config.success = function (result) {
- // $("#excel_path").val(result.data.file_url);
- // layer.msg(result.message, {icon: 6, time: 1500});
- var data = {excel_path: result.data.file_url, taskId: "{{$data->id}}"};
- var config = {
- url: '/admin/link/hall/worker-import',
- type: 'post',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1500}, function () {
- layer.close(openIndex);
- window.location.reload();
- });
- }
- };
- tips.ajax(config);
- };
- tips.fileUpload($("#excel_file"), config);
- },
- addShowUrl: function (_this) { //添加页面演示地址
- var html = '<div class="form-group">' +
- '<div class="col-sm-6 col-sm-offset-2">' +
- '<input type="text" class="form-control" name="show_url" value="">' +
- '<input type="hidden" name="show_url_id" value="0">' +
- '</div>' +
- '<div class="col-sm-2">' +
- '<button class="btn btn-warning" type="button" onclick="units.delShowUrl(this)">删除\n' +
- '</button>' +
- '</div>' +
- '</div>';
- $(_this).parent().parent().parent().append(html);
- },
- delShowUrl: function (_this) { //删除页面演示地址
- $(_this).parent().parent().remove();
- },
- save: function (key, id) { //兼职人员保存
- var formSelector = "#form" + key;
- var data = tips.getFormValues(formSelector);
- var urls = [];
- $(formSelector).find("div.showUrl").find(".form-group").each(function () {
- if ($(this).find("[name=show_url]").val().length !== 0) {
- urls.push({
- url: $(this).find("[name=show_url]").val(),
- id: $(this).find("[name=show_url_id]").val()
- });
- }
- });
- var ajax = function () {
- var url = '/admin/link/hall/work-save/' + id;
- var ajaxConfig = {
- url: url,
- type: 'put',
- data: {link_tasks_detail: data, link_tasks_url: {show_urls: urls}}
- };
- tips.ajax(ajaxConfig);
- };
- ajax();
- },
- show: function () { //项目信息展示
- var url = '/admin/link/hall-show/{{$data->id??null}}';
- layer.open({
- type: 2,
- content: [url],
- area: ['90%', '100%'],
- title: '项目信息',
- closeBtn: 1
- });
- },
- submitAudit: function () { //用户提交审核
- layer.confirm('您确定要提交审核吗?', {icon: 3, title: '提交审核'}, function () {
- var url = '/admin/link/task/{{$data->id}}/submit-audit';
- var ajaxConfig = {
- url: url,
- type: 'put',
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- });
- }
- };
- tips.ajax(ajaxConfig);
- });
- },
- linkTaskClaim: function () {
- layer.confirm('您确定要接受该任务吗?', {icon: 3, title: '认领任务'}, function () {
- var url = '/admin/link/task/{{$data->id}}/claim';
- var ajaxConfig = {
- url: url,
- type: 'put',
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- // tips.closeParentLayer();
- // window.parent.tips.tableRefresh('#table');
- window.location.reload();
- });
- }
- };
- tips.ajax(ajaxConfig);
- });
- },
- linkTaskRelease: function () {
- layer.confirm('您确定要释放该任务吗?', {icon: 3, title: '任务释放'}, function () {
- var url = '/admin/link/task/{{$data->id}}/release';
- var ajaxConfig = {
- url: url,
- type: 'put',
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- // window.location.reload();
- });
- }
- };
- tips.ajax(ajaxConfig);
- });
- }
- };
- $(window).scrollTop(0);
- $(window).scroll(function () {
- var scrollHeight = 10;
- if ($(window).scrollTop() > scrollHeight) {
- $(".xmrl-gb-boxs").addClass("ons");
- } else {
- $(".xmrl-gb-boxs").removeClass("ons");
- }
- });
- </script>
- @endsection
|