切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郭静帆
4 years ago
提交
f4548d212d48db10f197d8b1fd93ef5410a2a71a
1 个父辈
b5d4c83e
1 个管道 的构建
通过
耗费 14 秒
本月额外收入
变更
3
构建
2
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
71 行增加
和
4 行删除
application/admin/controller/UserSalary.php
application/admin/view/user_salary/index.html
public/assets/js/backend/user_salary.js
application/admin/controller/UserSalary.php
查看文件 @
f4548d2
...
...
@@ -3,6 +3,7 @@
namespace
app\admin\controller
;
use
app\common\controller\Backend
;
use
think\Db
;
/**
* 每月工资管理
...
...
@@ -71,4 +72,47 @@ class UserSalary extends Backend
return
$this
->
view
->
fetch
();
}
/**
* 审核
*/
public
function
examine
(
$ids
=
null
)
{
if
(
$ids
)
{
$row
=
$this
->
model
->
get
(
$ids
);
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
$adminIds
=
$this
->
getDataLimitAdminIds
();
if
(
is_array
(
$adminIds
))
{
if
(
!
in_array
(
$row
[
$this
->
dataLimitField
],
$adminIds
))
{
$this
->
error
(
__
(
'You have no permission'
));
}
}
$params
=
$this
->
request
->
param
();
if
(
$params
[
'status'
]
==
'2'
&&
$row
[
'status'
]
==
'1'
){
$this
->
error
(
'该申请已通过审核,无法驳回'
);
}
$row
->
status
=
$params
[
'status'
];
$row
->
updatetime
=
time
();
Db
::
startTrans
();
try
{
$result
=
$row
->
save
();
Db
::
commit
();
}
catch
(
ValidateException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
PDOException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
\think\Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
if
(
!
$result
)
{
$this
->
error
(
'审核失败'
);
}
$this
->
success
(
'审核成功'
);
}
}
}
...
...
application/admin/view/user_salary/index.html
查看文件 @
f4548d2
...
...
@@ -18,7 +18,7 @@
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"javascript:;"
class=
"btn btn-primary btn-refresh"
title=
"{:__('Refresh')}"
><i
class=
"fa fa-refresh"
></i>
</a>
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user_salary/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a
href=
"javascript:;"
class=
"btn btn-success btn-edit btn-disabled disabled {:$auth->check('user_salary/edit')?'':'hide'}"
title=
"{:__('Edit')}"
><i
class=
"fa fa-pencil"
></i>
{:__('Edit')}
</a
>
<!-- <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user_salary/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>--
>
<!-- <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user_salary/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!-- <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('user_salary/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
...
...
@@ -33,8 +33,6 @@
</div>
<table
id=
"table"
class=
"table table-striped table-bordered table-hover table-nowrap"
data-operate-edit=
"{:$auth->check('user_salary/edit')}"
data-operate-del=
"{:$auth->check('user_salary/del')}"
width=
"100%"
>
</table>
</div>
...
...
public/assets/js/backend/user_salary.js
查看文件 @
f4548d2
...
...
@@ -37,7 +37,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{
field
:
'status'
,
title
:
__
(
'Status'
),
searchList
:
{
"0"
:
__
(
'Status 0'
),
"1"
:
__
(
'Status 1'
)},
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'createtime'
,
title
:
__
(
'Createtime'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'updatetime'
,
title
:
__
(
'Updatetime'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
buttons
:
[
{
name
:
'examine'
,
text
:
'通过'
,
title
:
'通过'
,
classname
:
'btn btn-xs btn-success btn-ajax'
,
icon
:
''
,
url
:
'user_salary/examine?id={id}&status=1'
,
confirm
:
'是否确认通过?'
,
visible
:
function
(
row
)
{
if
(
row
.
status
==
'0'
){
return
true
;
}
},
success
:
function
(
data
)
{
table
.
bootstrapTable
(
'refresh'
);
}
},
],
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
});
...
...
请
注册
或
登录
后发表评论