Commit d08f7713 by 汪伟伟

退回 跳转

parent 77d68051
......@@ -70,6 +70,9 @@ class AlreadyApproveController extends AdminController
$grid->disableEditButton()->disableDeleteButton()->disableCreateButton()->disableBatchDelete();
$grid->filter(function (Grid\Filter $filter) {
// $filter->expand();
// $filter->panel();
$filter->equal('user.id','用户')->select('/getUsers');
$filter->like('task.name','指标名称');
......
......@@ -67,7 +67,7 @@ class CreateOrderController extends AdminController
$grid->filter(function (Grid\Filter $filter) {
$filter->expand();//展开过滤器
// 更改为 panel 布局
// 更改为 panel 布局
$filter->panel();
// 注意切换为panel布局方式时需要重新调整表单字段的宽度
......
......@@ -6,6 +6,7 @@ use App\Admin\Extensions\Tools\NotPassAction;
use App\Admin\Extensions\Tools\PassAction;
use App\Admin\Repositories\TasksApprove;
use App\Admin\Services\CityAreaService;
use App\Models\AdminUser;
use App\Models\Task;
use App\Models\TasksReceive;
use Dcat\Admin\Form;
......@@ -29,9 +30,18 @@ class TasksApproveController extends AdminController
{
$page = $request->input('page', 1);
$pageSize = $request->input('per_page', 10);
$userId = $request->input('user_id');
$taskName = $request->input('task_name');
// var_dump($request->input());
$data = Task::query()
->whereHas('receives', function ($query) {
$taskQuery = Task::query();
if (!empty($taskName)) {
$taskQuery->where('name', 'like', "%{$taskName}%");
}
$data = $taskQuery
->whereHas('receives', function ($query) use ($userId) {
if (!empty($userId)) {
$query->where('user_id', $userId);
}
$query->where('status', 1)->orderBy('created_at', 'desc');
})
->with(['receives.collects', 'receives.user', 'receives.approve'])->paginate($pageSize, '*', 'page', $page)->toArray();
......@@ -55,12 +65,13 @@ class TasksApproveController extends AdminController
}
}
$users = AdminUser::query()->where('is_admin', 0)->get(['id', 'name'])->toArray();
// dd($data);
$content = Content::make();
return $content
->title('未审核列表')
->body(view('admin.check', ['data' => $data]));
->body(view('admin.check', ['data' => $data, 'users' => $users, 'userId' => $userId, 'taskName' => $taskName]));
}
......@@ -144,9 +155,13 @@ class TasksApproveController extends AdminController
// $grid->tools('<a class="btn btn-primary disable-outline">测试按钮</a>');
$grid->disableEditButton()->disableDeleteButton()->disableCreateButton()->disableFilterButton()->disableBatchDelete();
$grid->disableEditButton()->disableDeleteButton()->disableCreateButton()->disableBatchDelete();
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('id');
$filter->expand();
$filter->panel();
$filter->equal('user.id', '用户')->select('/getUsers')->width(3);
$filter->like('task.name', '指标名称')->width(3);
});
$grid->actions(function (Grid\Displayers\Actions $actions) {
......
......@@ -45,11 +45,14 @@ class BackAction extends RowAction
*/
public function handle(Request $request)
{
// 获取主键
$id = $this->getKey();
// $user = Admin::user();
$receive = TasksReceive::query()->find($id);
$type = $receive->status;
$task = Task::query()->find($receive->task_id);
$receive->collects()->delete();
$receive->approve()->delete();
......@@ -58,9 +61,15 @@ class BackAction extends RowAction
$task->save();
// dd($id,$user->id);
if (in_array($type,[1,2])){
$url = 'already';
}
if ($type == 0){
$url = 'noDone';
}
return $this->response()->success('退回成功')
->redirect('noDone');
->redirect($url);
}
public function html()
......
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