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 回调中使用
......
......@@ -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');
......
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