Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
汪伟伟
data-collect
Commits
bb38f148
Commit
bb38f148
authored
Jan 15, 2024
by
汪伟伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tab
parent
bb6b7a04
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
32 deletions
+37
-32
app/Admin/Controllers/TaskController.php
+3
-3
app/Admin/Controllers/TaskReceiveController.php
+4
-4
app/Admin/Controllers/TasksApproveController.php
+2
-2
app/Admin/Controllers/TasksOrderController.php
+28
-23
No files found.
app/Admin/Controllers/TaskController.php
View file @
bb38f148
...
...
@@ -26,9 +26,9 @@ class TaskController extends AdminController
public
function
receiveIndex
(
Content
$content
)
{
return
$content
->
translation
(
$this
->
translation
())
->
title
(
$this
->
title
())
->
description
(
$this
->
description
()[
'index'
]
??
trans
(
'admin.list'
))
//
->translation($this->translation())
//
->title($this->title())
//
->description($this->description()['index'] ?? trans('admin.list'))
->
body
(
$this
->
getData
());
}
...
...
app/Admin/Controllers/TaskReceiveController.php
View file @
bb38f148
...
...
@@ -28,12 +28,12 @@ class TaskReceiveController extends AdminController
// $tab->add('选项卡1', view('...'));
$user
=
Admin
::
user
();
if
(
$user
->
is_admin
){
$tab
->
add
(
'全部任务'
,
$this
->
getData
(
-
1
));
$tab
->
add
(
'全部任务'
,
$this
->
getData
(
-
1
)
,
true
,
'a'
);
};
$tab
->
add
(
'待完成任务'
,
$this
->
getData
(
0
));
$tab
->
add
(
'已完成任务'
,
$this
->
getData
(
1
));
$tab
->
add
(
'待完成任务'
,
$this
->
getData
(
0
)
,
true
,
'b'
);
$tab
->
add
(
'已完成任务'
,
$this
->
getData
(
1
)
,
true
,
'c'
);
if
(
$user
->
is_admin
==
0
)
{
//用户
$tab
->
add
(
'已经结算任务'
,
$this
->
getOrderData
());
$tab
->
add
(
'已经结算任务'
,
$this
->
getOrderData
()
,
true
,
'd'
);
}
return
$tab
;
}
...
...
app/Admin/Controllers/TasksApproveController.php
View file @
bb38f148
...
...
@@ -31,8 +31,8 @@ class TasksApproveController extends AdminController
$tab
=
Tab
::
make
();
// $tab->add('选项卡1', view('...'));
$tab
->
add
(
'未审核'
,
$this
->
getData
(
0
));
$tab
->
add
(
'已审核'
,
$this
->
getData
(
1
));
$tab
->
add
(
'未审核'
,
$this
->
getData
(
0
)
,
true
,
'a'
);
$tab
->
add
(
'已审核'
,
$this
->
getData
(
1
)
,
true
,
'b'
);
return
$tab
;
}
...
...
app/Admin/Controllers/TasksOrderController.php
View file @
bb38f148
...
...
@@ -5,6 +5,7 @@ namespace App\Admin\Controllers;
use
App\Admin\Extensions\Tools\CreateSettlementOrder
;
use
App\Admin\Extensions\Tools\NotPassAction
;
use
App\Admin\Repositories\TasksReceive
;
use
App\Models\AdminUser
;
use
App\Models\TasksOrder
;
use
Dcat\Admin\Actions\Action
;
use
Dcat\Admin\Admin
;
...
...
@@ -27,9 +28,9 @@ class TasksOrderController extends AdminController
public
function
orderReceive
(
$id
,
Content
$content
)
{
return
$content
->
translation
(
$this
->
translation
())
->
title
(
$this
->
title
())
->
description
(
$this
->
description
()[
'index'
]
??
trans
(
'admin.list'
))
//
->translation($this->translation())
//
->title($this->title())
//
->description($this->description()['index'] ?? trans('admin.list'))
->
body
(
$this
->
getOderDetail
(
$id
));
}
...
...
@@ -39,7 +40,7 @@ class TasksOrderController extends AdminController
$user
=
Admin
::
user
();
// dd(trans('admin.view'));//查看
$grid
->
title
(
'
计
算单详情'
);
$grid
->
title
(
'
结
算单详情'
);
$grid
->
header
(
function
(
$collection
)
use
(
$grid
,
$id
)
{
$data
=
$collection
->
toArray
();
...
...
@@ -56,6 +57,7 @@ class TasksOrderController extends AdminController
});
$grid
->
model
()
->
where
(
'order_id'
,
$id
);
// 在 display 回调中使用
$grid
->
column
(
'序号'
)
->
display
(
function
()
{
return
$this
->
_index
+
1
;
...
...
@@ -77,9 +79,12 @@ class TasksOrderController extends AdminController
if
(
$user
->
is_admin
==
0
){
$grid
->
tools
(
new
CreateSettlementOrder
(
'<button class="btn btn-primary ">确认结账</button>'
));
$grid
->
tools
(
new
CreateSettlementOrder
(
'<button class="btn btn-primary ">确认收款</button>'
));
}
$grid
->
disableRowSelector
();
//禁用行选择器
$grid
->
disableRefreshButton
();
// 禁用刷新功能
$grid
->
disablePagination
();
// 禁用分页功能
$grid
->
disableActions
()
->
disableBatchActions
()
->
disableCreateButton
();
...
...
@@ -87,7 +92,6 @@ class TasksOrderController extends AdminController
});
}
/**
* @return Tab
*/
...
...
@@ -98,8 +102,8 @@ class TasksOrderController extends AdminController
// $tab->add('选项卡1', view('...'));
// $user = Admin::user();
$tab
->
add
(
'结算列表'
,
$this
->
getData
());
$tab
->
add
(
'生成结算单'
,
$this
->
getReceiveData
());
$tab
->
add
(
'结算列表'
,
$this
->
getData
()
,
true
,
'a'
);
$tab
->
add
(
'生成结算单'
,
$this
->
getReceiveData
()
,
true
,
'b'
);
return
$tab
;
}
...
...
@@ -140,11 +144,22 @@ class TasksOrderController extends AdminController
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
// $filter->equal('id');
$filter
->
like
(
'task.name'
,
'指标名称'
);
$filter
->
expand
();
//展开过滤器
// 更改为 panel 布局
$filter
->
panel
();
// 注意切换为panel布局方式时需要重新调整表单字段的宽度
$filter
->
equal
(
'user.id'
,
'用户'
)
->
width
(
2
)
->
select
(
function
(){
$userIds
=
\App\Models\TasksReceive
::
query
()
->
where
(
'status'
,
3
)
->
pluck
(
'user_id'
)
->
toArray
();
$userArr
=
AdminUser
::
query
()
->
whereIn
(
'id'
,
$userIds
)
->
get
()
->
toArray
();
return
array_column
(
$userArr
,
'name'
,
'id'
);
});
$filter
->
equal
(
'status'
,
'状态'
)
->
width
(
2
)
->
select
([
'3'
=>
'未结算'
])
->
default
(
3
);
});
$grid
->
disableFilterButton
();
$grid
->
disableDeleteButton
()
->
disableCreateButton
()
->
disableEditButton
()
->
disableViewButton
()
->
disableActions
()
->
disableBatchDelete
();
...
...
@@ -200,22 +215,12 @@ class TasksOrderController extends AdminController
protected
function
detail
(
$id
)
{
return
Content
::
make
()
->
translation
(
$this
->
translation
())
->
title
(
$this
->
title
())
->
description
(
$this
->
description
()[
'index'
]
??
trans
(
'admin.list'
))
//
->translation($this->translation())
//
->title($this->title())
//
->description($this->description()['index'] ?? trans('admin.list'))
->
body
(
$this
->
getOderDetail
(
$id
));
// return Show::make($id, new TasksOrder(), function (Show $show) {
// $show->field('id');
// $show->field('user_id');
// $show->field('time');
// $show->field('num');
// $show->field('amount');
// $show->field('pay_img');
// $show->field('status');
// $show->field('created_at');
// $show->field('updated_at');
// });
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment