Commit e9eb73ea by 汪伟伟

未审核页 重构

parent 440bc69d
......@@ -23,8 +23,11 @@ class AlreadyApproveController extends AdminController
protected function grid()
{
return Grid::make(TasksApprove::with(['task', 'collects', 'user']), function (Grid $grid) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('status', '>', 0)->orderBy('task_id', 'desc');
$grid->model()->where('status', '>', 0)
->orderBy('updated_at', 'desc')
->orderBy('task_id', 'desc');
......
......@@ -28,6 +28,8 @@ class AlreadyDoneTaskController extends AdminController
return Grid::make(TasksReceive::with(['task', 'collects', 'user','approve']), function (Grid $grid){
$user = Admin::user();
$user->is_admin == 0 && $grid->model()->where('user_id', $user->id);
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('status', '>', 0)->orderBy('updated_at','desc');
// dd(trans('admin.view'));//查看
......@@ -73,9 +75,9 @@ class AlreadyDoneTaskController extends AdminController
$html = \App\Models\TasksReceive::STATUS_DESC[$val];
if ($val == 2) {
// dd($this->id,$this->approve->msg);
Tooltip::make('.ti-shi-span')->title($this->approve->msg);
return "<span style='color: red' class='ti-shi-span'>{$html}<i class='feather icon-help-circle'></i></span>";
// var_dump($this->id,$this->approve->msg);
Tooltip::make('.ti-shi-span'.$this->approve->id)->title($this->approve->msg);
return "<span style='color: red' class='ti-shi-span{$this->approve->id}'>{$html}<i class='feather icon-help-circle'></i></span>";
}else{
return $html;
}
......
......@@ -20,6 +20,8 @@ class AlreadySettlementController extends AdminController
return response()->redirectTo('/orders');
} else {
return Grid::make(TasksOrder::query(), function (Grid $grid) use ($user) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('user_id', $user->id);
// 在 display 回调中使用
......
......@@ -17,6 +17,7 @@ class CreateOrderController extends AdminController
protected function grid()
{
return Grid::make(TasksReceive::with(['task', 'collects', 'user']), function (Grid $grid) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('status', 3);//3:审核通过但未结算的任务
......
......@@ -29,6 +29,8 @@ class NoDoneTaskController extends AdminController
return Grid::make(TasksReceive::with(['task', 'collects', 'user']), function (Grid $grid) {
$user = Admin::user();
$user->is_admin == 0 && $grid->model()->where('user_id', $user->id);
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('status', 0);
// dd(trans('admin.view'));//查看
......@@ -140,6 +142,15 @@ class NoDoneTaskController extends AdminController
$receive->status =1;
TasksCollect::query()->where('receive_id',$id)->update(['is_find'=>0,'remark'=>$remark]);
$receive->save();
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
'task_id' => $receive->task_id,
'user_id' => $receive->user_id,
'receive_id' => $receive->id,
], [
'task_id' => $receive->task_id,
'user_id' => $receive->user_id,
'receive_id' => $receive->id,
]);
}
$no = \App\Models\TasksReceive::query()
......
......@@ -41,6 +41,7 @@ class TaskController extends AdminController
// $model = \App\Models\Task::query()->whereNotIn('id',$exists)
return Grid::make(new Task(), function (Grid $grid)use ($user,$exists) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
// $grid->title('dasd');
$grid->model()->whereNotIn('id',$exists);
......@@ -134,7 +135,9 @@ class TaskController extends AdminController
protected function grid()
{
return Grid::make(new Task(), function (Grid $grid) {
$grid->model()->orderBy('created_at','desc');
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->orderBy('created_at','desc');
// dd(trans('admin.view'));//查看
// 在 display 回调中使用
......
......@@ -47,6 +47,8 @@ class TaskReceiveController extends AdminController
{
return Grid::make(TasksOrder::query(), function (Grid $grid) {
$user = Admin::user();
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('user_id', $user->id);
// 在 display 回调中使用
......@@ -88,6 +90,7 @@ class TaskReceiveController extends AdminController
if ($status == 0) $grid->model()->where('status', 0);
if ($status == 1) $grid->model()->where('status', '>', 0);
// dd(trans('admin.view'));//查看
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->orderBy('created_at','desc');
// 在 display 回调中使用
......
......@@ -7,6 +7,7 @@ use App\Admin\Extensions\Tools\PassAction;
use App\Admin\Repositories\TasksApprove;
use App\Admin\Services\CityAreaService;
use App\Models\Task;
use App\Models\TasksReceive;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Layout\Column;
......@@ -26,135 +27,42 @@ class TasksApproveController extends AdminController
public function checkData(Request $request)
{
$page = $request->input('page',1);
$pageSize = $request->input('per_page',115);
$page = $request->input('page', 1);
$pageSize = $request->input('per_page', 5);
// var_dump($request->input());
$data = Task::query()
->whereHas('receives',function ($query){
->whereHas('receives', function ($query) {
$query->where('status', 1)->orderBy('created_at', 'desc');
})
->with(['receives.collects','receives.user'])->paginate($pageSize,'*','page',$page)->toArray();
->with(['receives.collects', 'receives.user', 'receives.approve'])->paginate($pageSize, '*', 'page', $page)->toArray();
foreach ($data['data'] as $key =>&$item){
if (count($item['receives']) >1){
if ($item['receives'][0]['collects']['value'] != $item['receives'][1]['collects']['value']){
foreach ($data['data'] as $key => &$item) {
if (count($item['receives']) > 1) {
if ($item['receives'][0]['collects']['value'] != $item['receives'][1]['collects']['value']) {
$item['receives'][0]['is_bs'] = $item['receives'][1]['is_bs'] = 1;
}else{
} else {
$item['receives'][0]['is_bs'] = $item['receives'][1]['is_bs'] = 0;
}
}else{
} else {
$item['receives'][0]['is_bs'] = 0;
}
foreach ($item['receives'] as $k => $v) {
if ($v['status'] != 1) {
unset($data['data'][$key]['receives'][$k]);
}
}
}
dd($data);
// dd($data);
$content = Content::make();
return $content
->title('未审核列表')
->body(view('admin.check', ['data' => $data['data'],'page'=>$page,'total'=>$data['total']]));
->body(view('admin.check', ['data' => $data]));
}
protected function getData22($status)
{
$taskIds = \App\Models\TasksApprove::query()->where('status', 0)->pluck('task_id');
$model = \App\Models\Task::query()->with(['approves'])->whereIn('id', $taskIds);
// dd($taskIds);
$header = Grid::make($model, function (Grid $grid) use ($status) {
// 在 display 回调中使用
$grid->column('序号')->display(function () {
return $this->_index + 1;
});
// $grid->column('id')->sortable();
$grid->column('name', '指标名称');
$grid->column('city_id', '地区')->display(function ($v) {
return CityAreaService::getAreaName($v);
});
$grid->column('year', '时间');
$grid->column('refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('price', '单价');
$grid->disableEditButton()->disableDeleteButton()->disableCreateButton()->disableFilterButton()->disableBatchDelete();
$grid->actions(function (Grid\Displayers\Actions $actions) {
$actions->append(new PassAction());//通过按钮
$actions->append(new NotPassAction());//不通过按钮
});
});
$body = Grid::make(TasksApprove::with(['task', 'collects', 'user']), function (Grid $grid) use ($status) {
// 在 display 回调中使用
$grid->column('序号')->display(function () {
return $this->_index + 1;
});
// $grid->column('id')->sortable();
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('collects.refer_level', '信源等级');
// $grid->column('collects.net_img', '截图链接');
$grid->disableEditButton()->disableDeleteButton()->disableCreateButton()->disableFilterButton()->disableBatchDelete();
$grid->actions(function (Grid\Displayers\Actions $actions) {
$actions->append(new PassAction());//通过按钮
$actions->append(new NotPassAction());//不通过按钮
});
});
$content = Content::make();
$row = new Row();
$row->column(12, function (Column $column) use ($header) {
$column->row(
$header
// function (Row $row) {
// $row->column(12 / 7, '序号');
// $row->column(12 / 7, '指标名称');
// $row->column(12 / 7, '地区');
// $row->column(12 / 7, '时间');
// $row->column(12 / 7, '参考信源');
// $row->column(12 / 7, '单价');
// $row->column(12 / 7, '操作');
// }
);
$column->row(function (Row $row) {
$row->column(6, 4);
$row->column(6, 5);
});
});
return $row;
}
/**
* Make a grid builder.
......@@ -168,8 +76,10 @@ class TasksApproveController extends AdminController
// dd($taskIds);
$model =TasksApprove::with(['task', 'collects', 'user']);
$model = TasksApprove::with(['task', 'collects', 'user']);
return Grid::make($model, function (Grid $grid) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->model()->where('status', 0)->orderBy('task_id', 'desc');
// 在 display 回调中使用
......@@ -183,8 +93,8 @@ class TasksApproveController extends AdminController
// return new Table(['ID', '内容', '发布时间'],[['id'=>1,'content'=>'dsdsds','<a href="/">通过</a>'],['id'=>2,'content'=>'d2sdsds','created_at'=>'gg2ggg']]
// ,['id'=>'asddddd']);
// 返回显示的详情
// 这里返回 content 字段内容,并用 Card 包裹起来
// 返回显示的详情
// 这里返回 content 字段内容,并用 Card 包裹起来
// $card = new Card(null, $this->id);
// return $r;
// })
......@@ -201,7 +111,7 @@ class TasksApproveController extends AdminController
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
} else {
return $val;
}
});
......@@ -211,14 +121,13 @@ class TasksApproveController extends AdminController
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
} else {
return $val;
}
});
$grid->column('collects.refer_level', '信源等级');
// $grid->column('content')->expand(function (Grid\Displayers\Expand $expand) {
// // 设置按钮名称
// $expand->button('详情');
......@@ -321,4 +230,63 @@ class TasksApproveController extends AdminController
// }
public function pass($receiveId)
{
$approve = \App\Models\TasksApprove::query()->where('receive_id', $receiveId)->first();
TasksReceive::query()->where('id', $receiveId)->update(['status' => 3]);//3:审核通过但未结算的任务
$approve->status = 2;//审核通过
$approve->save();
// dd($id,$user->id);
return true;
}
public function noPass($receiveId)
{
$msg = \request()->input('msg');
// dd($receiveId,$msg);
$approve = \App\Models\TasksApprove::query()->where('receive_id', $receiveId)->first();
TasksReceive::query()->where('id', $receiveId)->update(['status' => 2]);//2:审核不通过的任务
$approve->status = 1;//审核不通过
$approve->msg = $msg;
$approve->save();
return true;
}
public function allPass($taskId)
{
$task = Task::query()->find($taskId);
foreach ($task->receives->toArray() as $receive) {
if ($receive['status'] == 1) {
$approve = \App\Models\TasksApprove::query()->where('receive_id', $receive['id'])->first();
TasksReceive::query()->where('id', $receive['id'])->update(['status' => 3]);//3:审核通过但未结算的任务
$approve->status = 2;//审核通过
$approve->save();
}
}
return true;
}
public function allNoPass($taskId)
{
$msg = \request()->input('msg');
$task = Task::query()->find($taskId);
foreach ($task->receives->toArray() as $receive) {
if ($receive['status'] == 1) {
// dd($receive);
$approve = \App\Models\TasksApprove::query()->where('receive_id', $receive['id'])->first();
TasksReceive::query()->where('id', $receive['id'])->update(['status' => 2]);//2:审核不通过的任务
$approve->status = 1;//审核不通过
$approve->msg = $msg;
$approve->save();
}
}
// dd($taskId,$msg,$task->receives->toArray());
return true;
}
}
......@@ -18,6 +18,8 @@ class TasksCollectController extends AdminController
protected function grid()
{
return Grid::make(new TasksCollect(), function (Grid $grid) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->column('id')->sortable();
$grid->column('task_id');
$grid->column('user_id');
......
......@@ -35,6 +35,7 @@ class TasksOrderController extends AdminController
return Grid::make(\App\Admin\Repositories\TasksReceive::with(['task', 'collects', 'user']), function (Grid $grid) use ($id, $type) {
$user = Admin::user();
// dd(trans('admin.view'));//查看
$grid->addTableClass(['table-text-center']);//设置表格文字居中
$grid->title('结算单详情');
......@@ -137,6 +138,8 @@ class TasksOrderController extends AdminController
protected function grid()
{
return Grid::make(TasksOrder::with(['user']), function (Grid $grid) {
$grid->addTableClass(['table-text-center']);//设置表格文字居中
// 在 display 回调中使用
$grid->column('序号')->display(function () {
return $this->_index + 1;
......
......@@ -32,8 +32,12 @@ Route::group([
$router->resource('settle', 'AlreadySettlementController');
$router->resource('approves', 'TasksApproveController');
// $router->get('approves', 'TasksApproveController@checkData');
// $router->resource('approves', 'TasksApproveController');
$router->get('approves', 'TasksApproveController@checkData');
$router->get('pass/{id}', 'TasksApproveController@pass');
$router->get('noPass/{id}', 'TasksApproveController@noPass');
$router->get('allPass/{id}', 'TasksApproveController@allPass');
$router->get('allNoPass/{id}', 'TasksApproveController@allNoPass');
$router->resource('alreadyApprove', 'AlreadyApproveController');
$router->resource('orders', 'TasksOrderController');
......
{{--<body class="dcat-admin-body full-page modal-open" style="height: auto;">--}}
{{--<div class="app-content content">--}}
{{-- <div id="pjax-container" class="wrapper" style="min-height:calc(100vh - 45px);box-sizing: border-box;padding: 1.5rem 3rem 3rem 3rem">--}}
<div class="content-body" id="app">
......@@ -62,8 +67,8 @@
<div class="table-responsive table-wrapper complex-container table-middle mt-1 table-collapse ">
@foreach($data as $key=>$item)
<table style="" class="table custom-data-table data-table" id="grid-table">
@foreach($data['data'] as $key=>$item)
<table style="" class="table custom-data-table data-table table-text-center" id="grid-table">
<thead>
<tr>
{{-- <th>--}}
......@@ -112,11 +117,10 @@
{{-- <td>3</td>--}}
<td class="grid__actions__">
{{-- <a style="cursor: pointer;" class="act-YwdhdqPcBxTZwKy2" href="http://127.0.0.1:83/approves/17"><i class=""></i> <span class="text-success">查看</span>  </a>--}}
<a style="cursor: pointer;" class="act-8r3v0iFpeBCgEsaB"
href="javascript:void(0)">全部通过&nbsp;&nbsp;&nbsp;</a>
<span style="cursor: pointer" data-toggle="modal"
data-target="#modal-14NXsK3Ogh"><a
href="javascript:void(0)">全部不通过</a></span>
<a id="allPass-task-{{$item['id']}}" style="cursor: pointer;" class="act-8r3v0iFpeBCgEsaB"
href="#" onclick="allPass({{$item['id']}},{{json_encode($item['receives'])}})">全部通过&nbsp;&nbsp;&nbsp;</a>
<span id="allNotPass-task-{{$item['id']}}" onclick="noPass({{$item['id']}},1,{{json_encode($item['receives'])}})" style="cursor: pointer" data-toggle="modal" data-target="#modal-14NXsK3Ogh">
<a href="javascript:void(0)">全部不通过</a></span>
</td>
</tr>
</tbody>
......@@ -149,18 +153,20 @@
<td>
@foreach(explode(',',$rec['collects']['net_img']) as $url)
@if(filter_var($url, FILTER_VALIDATE_URL) !== false)
<a href={{$url}}>点击查看</a><br>
<a target="_blank" href={{$url}}>点击查看</a><br>
@endif
@endforeach
</td>
<td class="grid__actions__">
<a style="cursor: pointer;" class="act-8r3v0iFpeBCgEsaB"
href="javascript:void(0)">通过&nbsp;&nbsp;&nbsp;</a>
<span style="cursor: pointer" data-toggle="modal"
<a id="approvePass-{{$rec['id']}}" style="cursor: pointer;" class="act-8r3v0iFpeBCgEsaB"
href="#" onclick="passTask({{$rec['id']}})">通过&nbsp;&nbsp;&nbsp;</a>
<span id="approveNotPass-{{$rec['id']}}" style="cursor: pointer" data-toggle="modal"
data-target="#modal-14NXsK3Ogh"><a
href="javascript:void(0)">不通过</a></span>
href="#" onclick="noPass({{$rec['id']}})">不通过</a></span>
</td>
</tr>
@endforeach
......@@ -174,26 +180,55 @@
<div class="box-footer d-block clearfix ">
<span class="d-none d-sm-inline" style="line-height:33px;color:#7c858e"><b>1</b><b>15</b> ,总共 <b>{{$total}}</b></span>
<span class="d-none d-sm-inline"
style="line-height:33px;color:#7c858e">从 <b>{{$data['from']}}</b> 到 <b>{{$data['to']}}</b> ,总共 <b>{{$data['total']}}</b> 条</span>
<ul class="pagination pagination-sm no-margin pull-right shadow-100"
style="border-radius: 1.5rem">
<!-- Previous Page Link -->
<li class="page-item previous disabled"><span class="page-link"></span></li>
<!-- "Three Dots" Separator -->
@if($data['prev_page_url'])
<li class="page-item previous">
<a class="page-link"
href={{$data['prev_page_url'].'&per_page='.$data['per_page']}} rel="prev"></a>
</li>
@else
<li class="page-item previous disabled">
<span class="page-link"></span>
</li>
@endif
<!-- "Three Dots" Separator -->
<!-- Array Of Links -->
<li class="page-item active"><span class="page-link">1</span></li>
<li class="page-item"><a class="page-link" href="http://127.0.0.1:83/tasks?page=2">2</a>
</li>
<!-- Next Page Link -->
<li class="page-item next disabled"><span class="page-link"></span></li>
@for($i=1;$i<=$data['last_page'];$i++)
@if($i == $data['current_page'])
<li class="page-item active"><span class="page-link">{{$i}}</span></li>
@else
<li class="page-item">
<a class="page-link"
href=/approves?page={{$i}}&per_page={{$data['per_page']}} >{{$i}}</a></li>
@endif
@endfor
<!-- Next Page Link -->
@if($data['next_page_url'])
<li class="page-item next">
<a class="page-link"
href={{$data['next_page_url'].'&per_page='.$data['per_page']}} rel="next"></a>
</li>
@else
<li class="page-item next disabled">
<span class="page-link"></span>
</li>
@endif
</ul>
<label class="pull-right d-none d-sm-inline per-pages-selector" style="margin-right: 10px">
<span class="dropup" style="display:inline-block">
<a id="" class="dropdown-toggle btn btn-sm btn-white waves-effect" style="" data-toggle="dropdown"
href="javascript:void(0)">
<stub>20</stub>
<stub>{{$data['per_page']}}</stub>
<span class="caret"></span>
</a>
<ul class="dropdown-menu"><li class="dropdown-item"><a
......@@ -219,8 +254,200 @@
</div>
<div id="tan-chuang-msg" class="modal fade Dcat_Admin_Widgets_Modal" role="dialog" style="display: none;"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">请填写不通过原因</h4>
<button onclick="hideDiv()" type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form method="POST" class="form-horizontal" accept-charset="UTF-8" pjax-container="1"
action="" id="form-WLhROqC3">
<div class="box-body fields-group pl-0 pr-0 pt-1" style="padding: 0 0 .5rem">
<div class="form-group row form-field">
<div class="col-md-2 text-capitalize asterisk control-label">
<span>原因</span>
</div>
<div class="col-md-8 ">
<div class="help-block with-errors"></div>
<div class="input-group">
<span class="input-group-prepend"><span class="input-group-text bg-white"><i
class="feather icon-edit-2"></i></span></span>
<input id="msg-input" required="1" type="text"
class="form-control field_msg _normal_" placeholder="输入 原因">
</div>
</div>
</div>
<input type="hidden" id="receive-id" value="0" class="field__form_ _normal_">
<input type="hidden" id="task-id" value="0" class="field__current_ _normal_">
{{-- <input type="hidden" name="_payload_"--}}
{{-- value="{&quot;_current_&quot;:&quot;http:\/\/127.0.0.1:83\/alreadyApprove?&quot;,&quot;id&quot;:&quot;27&quot;,&quot;renderable&quot;:&quot;App_Admin_Forms_MsgSetting&quot;,&quot;_trans_&quot;:&quot;already-approve&quot;}"--}}
{{-- class="field__payload_ _normal_">--}}
</div>
<div class="box-footer row d-flex">
<div class="col-md-2"> &nbsp;</div>
<div class="col-md-8">
<button type="reset" class="btn btn-white pull-left"><i class="feather icon-rotate-ccw"></i>
重置
</button>
<button type="button" onclick="noPassAction()" class="btn btn-primary pull-right"><i class="feather icon-save"></i>
提交
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{{-- </div>--}}
{{--</div>--}}
{{--<div id="myDivd" class="modal-backdrop fade show"></div>--}}
{{--</body>--}}
<script>
function hideDiv() {
var element = document.getElementById("myDivd"); // "myDivd" 是要销毁的 div 元素的 ID
element.parentNode.removeChild(element);
var tan_chuang = document.getElementById("tan-chuang-msg"); // "myDivd" 是要销毁的 div 元素的 ID
tan_chuang.className = 'modal fade Dcat_Admin_Widgets_Modal';
tan_chuang.style.display = 'none';
tan_chuang.setAttribute('aria-hidden', 'true');
tan_chuang.removeAttribute('aria-modal');
document.getElementById("task-id").value = '0';
console.log(123213)
}
function allPass(taskId,allReceives) {
console.log(taskId,allReceives)
$.ajax({
url: '/allPass/' + taskId,
success: function (res) {
document.getElementById("allPass-task-" + taskId).style.display = 'none';
for (var i=0;i< allReceives.length;i++){
console.log(allReceives[i].id)
document.getElementById("approvePass-" + allReceives[i].id).style.display = 'none';
}
Dcat.success('审核成功')
}
})
}
var receiveArr = [];
function noPass(receiveId,type = 0,arr = []) {
// 获取现有元素(比如id为existingDiv)的父节点
var parentElement = document.getElementById("tan-chuang-msg").parentNode;
// 创建新的<div>元素
var newDiv = document.createElement("div");
newDiv.innerHTML = '<div id="myDivd" class="modal-backdrop fade show"></div>'; // 设置新<div>元素的内容
// 将新的<div>元素添加为现有元素的同级元素
parentElement.appendChild(newDiv);
var tan_chuang = document.getElementById("tan-chuang-msg");
tan_chuang.className = 'modal fade Dcat_Admin_Widgets_Modal show';
tan_chuang.style.display = 'block';
tan_chuang.setAttribute('aria-modal', 'true')
tan_chuang.removeAttribute('aria-hidden')
if (type == 0){//单个不通过
var receive_id = document.getElementById("receive-id");
receive_id.setAttribute('value',receiveId)
}
if (type == 1){//全部不通过
receiveArr = arr;
document.getElementById("task-id").value = receiveId;
}
}
function noPassAction() {
var taskId = document.getElementById("task-id").value;
console.log(taskId,2323232);
var receiveId = document.getElementById("receive-id").value;
msg = document.getElementById("msg-input").value;
if (msg == '') {
Dcat.error('请填写不通过原因')
}else {
if (taskId == 0) {//单个不通过
console.log(receiveId)
$.ajax({
url: '/noPass/' + receiveId + '?msg=' + msg,
success: function (res) {
console.log(res)
hideDiv();
document.getElementById("msg-input").value = '';
document.getElementById("approveNotPass-" + receiveId).style.display = 'none';
Dcat.success('审核成功')
}
})
} else {//全部不通过
// console.log(44,receiveArr)
$.ajax({
url: '/allNoPass/' + taskId + '?msg=' + msg,
success: function (res) {
hideDiv();
document.getElementById("msg-input").value = '';
document.getElementById("allNotPass-task-" + taskId).style.display = 'none';
for (var i=0;i< receiveArr.length;i++){
console.log(receiveArr[i].id)
document.getElementById("approveNotPass-" + receiveArr[i].id).style.display = 'none';
}
Dcat.success('审核成功')
}
})
}
}
}
function passTask(receiveId) {
$.ajax({
url: '/pass/' + receiveId,
success: function (res) {
document.getElementById("approvePass-"+receiveId).style.display = 'none';
Dcat.success('审核成功')
}
})
}
</script>
<style>
.table tbody tr {
border: 1px solid #ddd; /* 设置边框颜色 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment