Commit 633b2622 by 汪伟伟

未审核模块 操作之后就不显示

parent 3961f232
......@@ -226,6 +226,7 @@ class AlreadyDoneTaskController extends AdminController
}
}
TasksCollect::query()->where('receive_id', $this->id)->update(['images' => $images]);//更新
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['time'=>date('Y-m-d H:i:s')]);//更新完成时间
});
$form->disableDeleteButton();
......
......@@ -141,6 +141,7 @@ class NoDoneTaskController extends AdminController
$receive = \App\Models\TasksReceive::query()->find($id);
if ($receive){
$receive->status =1;
$receive->time =date('Y-m-d H:i:s');
TasksCollect::query()->where('receive_id',$id)->update(['is_find'=>0,'remark'=>$remark]);
$receive->save();
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
......@@ -244,7 +245,7 @@ class NoDoneTaskController extends AdminController
if ($this->status == 0) {
// dd($this->id);
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['status' => 1]);//状态更新成已完成
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['status' => 1,'time'=>date('Y-m-d H:i:s')]);//状态更新成已完成
TasksCollect::query()->where('receive_id', $this->id)->update(['is_find' => 1]);//可以找到
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
'task_id' => $this->task_id,
......
......@@ -45,7 +45,7 @@ class TaskController extends AdminController
$grid->addTableClass(['table-text-center']);//设置表格文字居中
// $grid->title('dasd');
$grid->model()->whereNotIn('id', $exists);
$grid->model()->whereNotIn('id', $exists)->orderBy('created_at','desc');
// dd(Admin::user()->is_admin);
// dd(trans('admin.view'));//查看
......
......@@ -42,9 +42,15 @@ class TasksApproveController extends AdminController
if (!empty($userId)) {
$query->where('user_id', $userId);
}
$query->where('status', 1)->orderBy('created_at', 'desc');
$query->where('status', 1);
})
->with(['receives.collects', 'receives.user', 'receives.approve'])->paginate($pageSize, '*', 'page', $page)->toArray();
->with(['receives'=>function($qq){
$qq->orderBy('time','desc');
}
,'receives.collects', 'receives.user', 'receives.approve'])
->orderBy('created_at','desc')
->paginate($pageSize, '*', 'page', $page)
->toArray();
foreach ($data['data'] as $key => &$item) {
if (count($item['receives']) > 1) {
......
......@@ -31,6 +31,7 @@ class TasksReceive extends Model
'order_id',
'area',
'status',
'time',
'created_at',
'updated_at',
];
......
......@@ -20,6 +20,7 @@ class CreateTasksApprovesTable extends Migration
$table->bigInteger('receive_id')->comment('用户领取的任务id');
$table->tinyInteger('status')->default('0')->comment('0:未审核,1:审核不通过,2:审核通过,3:已结算');
$table->string('msg')->nullable()->comment('未通过原因');
$table->dateTime('time')->nullable()->comment('审核时间');
$table->timestamps();
});
}
......
......@@ -20,6 +20,7 @@ class CreateTasksReceivesTable extends Migration
$table->bigInteger('order_id')->default('0')->comment('所属结算单id');
$table->string('area')->default('')->comment('地区');
$table->tinyInteger('status')->default('0')->comment('任务状态:(0:已领取但未完成的任务;1:已经完成但未审核的任务;2:审核不通过的任务;3:审核通过但未结算的任务;4:已经结算的任务)');
$table->dateTime('time')->nullable()->comment('完成时间');
$table->timestamps();
});
}
......
......@@ -68,47 +68,47 @@
value={{$user['id']}} {{$userId == $user['id']?'selected':''}} >{{$user['name']}}</option>
@endforeach
</select>
{{-- <span--}}
{{-- class="select2 select2-container select2-container--default select2-container--below select2-container--focus"--}}
{{-- dir="ltr" data-select2-id="select2-data-2-2dsr" style="">--}}
{{-- <span--}}
{{-- class="selection">--}}
{{-- <span--}}
{{-- class="select2-selection select2-selection--single"--}}
{{-- role="combobox"--}}
{{-- aria-haspopup="true"--}}
{{-- aria-expanded="false"--}}
{{-- tabindex="0"--}}
{{-- aria-disabled="false"--}}
{{-- aria-labelledby="select2-userid-67-container">--}}
{{-- <button--}}
{{-- type="button"--}}
{{-- class="select2-selection__clear"--}}
{{-- tabindex="-1"--}}
{{-- title="删除所有项目"--}}
{{-- aria-label="删除所有项目"--}}
{{-- aria-describedby="select2-userid-67-container"--}}
{{-- data-select2-id="select2-data-126-ip59">--}}
{{-- <span--}}
{{-- aria-hidden="true">×</span>--}}
{{-- </button>--}}
{{-- <span--}}
{{-- class="select2-selection__rendered"--}}
{{-- id="select2-userid-67-container"--}}
{{-- role="textbox"--}}
{{-- aria-readonly="true"--}}
{{-- title="布劳恩">布劳恩</span>--}}
{{-- <span--}}
{{-- class="select2-selection__arrow"--}}
{{-- role="presentation">--}}
{{-- <b role="presentation"></b>--}}
{{-- </span>--}}
{{-- </span>--}}
{{-- </span>--}}
{{-- <span--}}
{{-- class="dropdown-wrapper"--}}
{{-- aria-hidden="true"></span>--}}
{{-- </span>--}}
{{-- <span--}}
{{-- class="select2 select2-container select2-container--default select2-container--below select2-container--focus"--}}
{{-- dir="ltr" data-select2-id="select2-data-2-2dsr" style="">--}}
{{-- <span--}}
{{-- class="selection">--}}
{{-- <span--}}
{{-- class="select2-selection select2-selection--single"--}}
{{-- role="combobox"--}}
{{-- aria-haspopup="true"--}}
{{-- aria-expanded="false"--}}
{{-- tabindex="0"--}}
{{-- aria-disabled="false"--}}
{{-- aria-labelledby="select2-userid-67-container">--}}
{{-- <button--}}
{{-- type="button"--}}
{{-- class="select2-selection__clear"--}}
{{-- tabindex="-1"--}}
{{-- title="删除所有项目"--}}
{{-- aria-label="删除所有项目"--}}
{{-- aria-describedby="select2-userid-67-container"--}}
{{-- data-select2-id="select2-data-126-ip59">--}}
{{-- <span--}}
{{-- aria-hidden="true">×</span>--}}
{{-- </button>--}}
{{-- <span--}}
{{-- class="select2-selection__rendered"--}}
{{-- id="select2-userid-67-container"--}}
{{-- role="textbox"--}}
{{-- aria-readonly="true"--}}
{{-- title="布劳恩">布劳恩</span>--}}
{{-- <span--}}
{{-- class="select2-selection__arrow"--}}
{{-- role="presentation">--}}
{{-- <b role="presentation"></b>--}}
{{-- </span>--}}
{{-- </span>--}}
{{-- </span>--}}
{{-- <span--}}
{{-- class="dropdown-wrapper"--}}
{{-- aria-hidden="true"></span>--}}
{{-- </span>--}}
</div>
</div>
</div>
......@@ -139,12 +139,11 @@
</div>
<div class="table-responsive table-wrapper complex-container table-middle mt-1 table-collapse ">
@foreach($data['data'] as $key=>$item)
<table style="" class="table custom-data-table data-table table-text-center"
id="grid-table">
id="grid-table_{{$key}}">
<thead>
<tr>
{{-- <th>--}}
......@@ -195,18 +194,17 @@
{{-- <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 id="allPass-task-{{$item['id']}}" style="cursor: pointer;"
class="act-8r3v0iFpeBCgEsaB"
href="#"
onclick="allPass({{$item['id']}},{{json_encode($item['receives'])}})">全部通过&nbsp;&nbsp;&nbsp;</a>
onclick="allPass({{$item['id']}},{{json_encode($item['receives'])}},{{$key}})">全部通过&nbsp;&nbsp;&nbsp;</a>
<span id="allNotPass-task-{{$item['id']}}"
onclick="noPass({{$item['id']}},1,{{json_encode($item['receives'])}})"
onclick="noPass({{$item['id']}},{{$key}},1,{{json_encode($item['receives'])}})"
style="cursor: pointer" data-toggle="modal"
data-target="#modal-14NXsK3Ogh">
<a href="javascript:void(0)">全部不通过</a></span>
<a >全部不通过</a></span>
</td>
</tr>
</tbody>
<thead>
<thead id="thead-{{$key}}">
<tr>
<th>序号</th>
<th>用户</th>
......@@ -217,15 +215,16 @@
<th class="grid__actions__">操作</th>
</tr>
</thead>
<tbody>
<tbody id="tbody-{{$key}}">
@foreach($item['receives'] as $k=>$rec)
<tr>
<tr id="tr-{{$key}}-{{$k}}">
<td>{{$k==0?'A':'B'}}</td>
<td>{{$rec['user']['name']}}</td>
<td style="color: {{$rec['is_bs'] == 1 ? 'red': ''}}">{{$rec['collects']['value']}}</td>
<td>
@if(filter_var($rec['collects']['reality_refer'], FILTER_VALIDATE_URL) !== false)
<a target="_blank" href={{$rec['collects']['reality_refer']}}>点击查看</a>
<a target="_blank"
href={{$rec['collects']['reality_refer']}}>点击查看</a>
@else
{{$rec['collects']['reality_refer']}}
@endif
......@@ -244,12 +243,12 @@
<a id="approvePass-{{$rec['id']}}" style="cursor: pointer;"
class="act-8r3v0iFpeBCgEsaB"
href="#" onclick="passTask({{$rec['id']}})">通过&nbsp;&nbsp;&nbsp;</a>
onclick="passTask({{$rec['id']}},{{$key}},{{$k}})">通过&nbsp;&nbsp;&nbsp;</a>
<span id="approveNotPass-{{$rec['id']}}" style="cursor: pointer"
data-toggle="modal"
data-target="#modal-14NXsK3Ogh"><a
href="#" onclick="noPass({{$rec['id']}})">不通过</a></span>
onclick="noPass({{$rec['id']}},{{$key}},0,[],{{$k}})">不通过</a></span>
</td>
</tr>
@endforeach
......@@ -257,14 +256,17 @@
</tbody>
</table>
<div style="height: 60px;background-color: #eff1f7;border: none;"></div>
<div id="grid-div_{{$key}}"
style="height: 60px;background-color: #eff1f7;border: none;"></div>
@endforeach
</div>
<div class="box-footer d-block clearfix ">
<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>
style="line-height:33px;color:#7c858e">
{{-- <b>{{$data['from']}}</b> <b id="dao-b">{{$data['to']}}</b> --}}
总共 <b id="total-b">{{$data['total']}}</b> </span>
<ul class="pagination pagination-sm no-margin pull-right shadow-100"
style="border-radius: 1.5rem">
<!-- Previous Page Link -->
......@@ -419,7 +421,7 @@
console.log(123213)
}
function allPass(taskId, allReceives) {
function allPass(taskId, allReceives, key) {
console.log(taskId, allReceives)
$.ajax({
......@@ -431,7 +433,7 @@
console.log(allReceives[i].id)
document.getElementById("approvePass-" + allReceives[i].id).style.display = 'none';
}
displayDiv(key)
Dcat.success('审核成功')
}
......@@ -440,8 +442,9 @@
}
var receiveArr = [];
var div_key,tr_key;
function noPass(receiveId, type = 0, arr = []) {
function noPass(receiveId, key, type = 0, arr = [],k) {
// 获取现有元素(比如id为existingDiv)的父节点
var parentElement = document.getElementById("tan-chuang-msg").parentNode;
......@@ -466,7 +469,8 @@
receiveArr = arr;
document.getElementById("task-id").value = receiveId;
}
div_key = key
tr_key = k
}
......@@ -488,8 +492,10 @@
hideDiv();
document.getElementById("msg-input").value = '';
document.getElementById("approveNotPass-" + receiveId).style.display = 'none';
Dcat.success('审核成功')
removeDivTr(div_key,tr_key)
Dcat.success('审核成功')
}
})
......@@ -507,6 +513,7 @@
document.getElementById("approveNotPass-" + receiveArr[i].id).style.display = 'none';
}
displayDiv(div_key)
Dcat.success('审核成功')
}
......@@ -516,14 +523,34 @@
}
}
function passTask(receiveId) {
function displayDiv(key) {
document.getElementById('grid-table_' + key).style.display = 'none';
document.getElementById('grid-div_' + key).style.display = 'none';
var c = document.getElementById('total-b').innerHTML;
document.getElementById('total-b').innerHTML = c-1;
}
function removeDivTr(key,k){
var tbody = document.getElementById("tbody-"+key); // 获取tbody元素
var trs = tbody.getElementsByTagName("tr"); // 获取所有tr元素
var count = trs.length; // 计算tr元素的数量
if (count>1){
document.getElementById("tr-"+key+"-"+k).remove();
}else {
displayDiv(key)
}
}
function passTask(receiveId, key,k) {
$.ajax({
url: '/pass/' + receiveId,
success: function (res) {
document.getElementById("approvePass-" + receiveId).style.display = 'none';
Dcat.success('审核成功')
removeDivTr(key,k)
Dcat.success('审核成功')
}
})
......
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