Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psa-web
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高滢
psa-web
Commits
4918914b
Commit
4918914b
authored
Mar 28, 2025
by
qiyaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目费用报销审批
parent
9ac80d50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
245 additions
and
33 deletions
+245
-33
examineAndApprove.js
src/api/examineAndApprove/examineAndApprove.js
+33
-16
projectCostReimbursementApprove.vue
...AndApprove/components/projectCostReimbursementApprove.vue
+212
-17
No files found.
src/api/examineAndApprove/examineAndApprove.js
View file @
4918914b
import
request
from
"../../utils/request.js"
;
import
request
from
"../../utils/request.js"
;
// 1.项目费用申请审批
//获取所有项目名称(查询下拉框)
//获取所有项目名称(查询下拉框)
export
function
getProjectName
()
{
export
function
getProjectName
()
{
...
@@ -25,7 +24,26 @@ export function getRoleId() {
...
@@ -25,7 +24,26 @@ export function getRoleId() {
})
})
}
}
//项目费用审批-通过
//获取所有项目
export
const
projectList
=
(
query
)
=>
{
return
request
({
url
:
'/dailyReimbursement/dailyReimbursement/projectList'
,
method
:
'get'
,
params
:
query
})
}
//获取所有项目经理
export
function
getProjectManagerName
(
query
)
{
return
request
({
url
:
'/projectCostRequest/projectManagerName'
,
method
:
'get'
,
params
:
query
})
}
// 1.项目费用申请审批
//项目费用申请审批-通过
export
function
projectCostPass
(
query
)
{
export
function
projectCostPass
(
query
)
{
return
request
({
return
request
({
url
:
'/expenseApproval/projectCostRequestApproval'
,
url
:
'/expenseApproval/projectCostRequestApproval'
,
...
@@ -34,7 +52,7 @@ export function projectCostPass(query) {
...
@@ -34,7 +52,7 @@ export function projectCostPass(query) {
})
})
}
}
//项目费用审批-驳回
//项目费用
申请
审批-驳回
export
function
projectCostNotPass
(
query
)
{
export
function
projectCostNotPass
(
query
)
{
return
request
({
return
request
({
url
:
'/expenseApproval/projectCostRequestApprovalReject'
,
url
:
'/expenseApproval/projectCostRequestApprovalReject'
,
...
@@ -43,23 +61,22 @@ export function projectCostNotPass(query) {
...
@@ -43,23 +61,22 @@ export function projectCostNotPass(query) {
})
})
}
}
// 2.
出差申请
审批
// 2.
项目费用报销
审批
//
获取所有项目
//
项目费用报销审批-通过
export
const
projectList
=
(
query
)
=>
{
export
function
projectCostReimbursementPass
(
query
)
{
return
request
({
return
request
({
url
:
'/dailyReimbursement/dailyReimbursement/projectList
'
,
url
:
'/expenseApproval/projectCostReimbursementApproval
'
,
method
:
'
ge
t'
,
method
:
'
pos
t'
,
params
:
query
data
:
query
})
})
}
}
//获取所有项目经理
export
function
getProjectManagerName
(
query
)
{
//项目费用报销审批-驳回
export
function
projectCostReimbursementNotPass
(
query
)
{
return
request
({
return
request
({
url
:
'/
projectCostRequest/projectManagerName
'
,
url
:
'/
expenseApproval/projectCostReimbursementApprovalReject
'
,
method
:
'
ge
t'
,
method
:
'
pos
t'
,
params
:
query
data
:
query
})
})
}
}
// 3.项目费用报销审批
src/views/costManage/examineAndApprove/components/projectCostReimbursementApprove.vue
View file @
4918914b
...
@@ -43,8 +43,8 @@
...
@@ -43,8 +43,8 @@
<span
class=
"bold-text1"
style=
""
>
项目费用报销审批
</span>
<span
class=
"bold-text1"
style=
""
>
项目费用报销审批
</span>
</div>
</div>
<div>
<div>
<el-button
class=
"el-button-defalut"
type=
"default"
@
click=
""
>
一键驳回
</el-button>
<el-button
class=
"el-button-defalut"
type=
"default"
@
click=
"
oneClickNotPass
"
>
一键驳回
</el-button>
<el-button
class=
"el-button-primary"
style=
"margin-left: 20px"
type=
"primary"
@
click=
""
>
一键通过
</el-button>
<el-button
class=
"el-button-primary"
style=
"margin-left: 20px"
type=
"primary"
@
click=
"
oneClickPass
"
>
一键通过
</el-button>
</div>
</div>
</div>
</div>
<!-- 步骤条-->
<!-- 步骤条-->
...
@@ -59,8 +59,8 @@
...
@@ -59,8 +59,8 @@
</div>
</div>
</div>
</div>
<!-- 列表 -->
<!-- 列表 -->
<el-table
:data=
"ReimbursementRequestList"
border
>
<el-table
@
cell-mouse-enter=
"handleHover"
@
cell-mouse-leave=
"handleLeave"
:data=
"ReimbursementRequestList"
border
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
align=
"center"
></el-table-column>
<el-table-column
type=
"selection"
align=
"center"
:selectable=
"rowSelectable"
></el-table-column>
<el-table-column
width=
"180px"
prop=
"createBy"
label=
"申请人"
align=
"center"
></el-table-column>
<el-table-column
width=
"180px"
prop=
"createBy"
label=
"申请人"
align=
"center"
></el-table-column>
<el-table-column
width=
"180px"
prop=
"updateTime"
label=
"申请时间"
align=
"center"
min-width=
"100px"
></el-table-column>
<el-table-column
width=
"180px"
prop=
"updateTime"
label=
"申请时间"
align=
"center"
min-width=
"100px"
></el-table-column>
<el-table-column
prop=
"projectName"
label=
"项目名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectName"
label=
"项目名称"
align=
"center"
></el-table-column>
...
@@ -97,8 +97,8 @@
...
@@ -97,8 +97,8 @@
<!-- 操作按钮-->
<!-- 操作按钮-->
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
size=
"small"
style=
"font-size: 16
px"
>
通过
</el-button>
<el-button
:disabled=
"scope.row.currentStatus !== 0"
link
@
click=
"passProjectCost(scope.row)"
type=
"primary"
size=
"small"
style=
"font-size: 15
px"
>
通过
</el-button>
<el-button
link
@
click=
"dialogFormVisible = true"
type=
"danger"
size=
"small"
style=
"font-size: 16
px"
>
驳回
</el-button>
<el-button
:disabled=
"scope.row.currentStatus !== 0"
link
@
click=
"reject(scope.row)"
type=
"danger"
size=
"small"
style=
"font-size: 15
px"
>
驳回
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -136,19 +136,40 @@
...
@@ -136,19 +136,40 @@
import
{
onMounted
,
reactive
,
ref
}
from
"vue"
;
import
{
onMounted
,
reactive
,
ref
}
from
"vue"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
import
FlowChart
from
'@/components/FlowChart/index.vue'
import
FlowChart
from
'@/components/FlowChart/index.vue'
import
{
getApproveNodeList
,
getProjectName
,
getRoleId
}
from
"../../../../api/examineAndApprove/examineAndApprove.js"
;
import
{
getApproveNodeList
,
getProjectName
,
getRoleId
,
projectCostReimbursementNotPass
,
projectCostReimbursementPass
}
from
"../../../../api/examineAndApprove/examineAndApprove.js"
;
import
{
getReimbursementList
}
from
"../../../../api/projectCostReimbursement/projectCostReimbursement.js"
;
import
{
getReimbursementList
}
from
"../../../../api/projectCostReimbursement/projectCostReimbursement.js"
;
import
{
getCostRequestList
}
from
"../../../../api/projectCostRequest/projectCostRequest.js"
;
import
{
getCostRequestList
}
from
"../../../../api/projectCostRequest/projectCostRequest.js"
;
import
{
ElMessage
}
from
"element-plus"
;
const
{
project_status
,
project_cost_type
,
project_cost_request_status
,
project_type
}
=
proxy
.
useDict
(
'project_status'
,
'project_cost_type'
,
'project_cost_request_status'
,
'project_type'
);
const
{
project_status
,
project_cost_type
,
project_cost_request_status
,
project_type
}
=
proxy
.
useDict
(
'project_status'
,
'project_cost_type'
,
'project_cost_request_status'
,
'project_type'
);
const
list
=
ref
([])
// 流程图内容,只有值
const
list
=
ref
([])
// 流程图内容,只有值
const
allList
=
ref
([])
// 流程图内容,值和角色id
const
allList
=
ref
([])
// 流程图内容,值和角色id
const
total
=
ref
(
0
);
const
total
=
ref
(
0
);
const
dialogFormVisible
=
ref
(
false
)
const
projectNameList
=
ref
([]);
const
projectNameList
=
ref
([]);
//当前登录用户角色组
//当前登录用户角色组
const
currentUserRoleInfoList
=
ref
([])
const
currentUserRoleInfoList
=
ref
([])
//多选通过的参数list,用于一键通过/驳回
const
passObjList
=
[]
//驳回对象
let
rejectObj
=
reactive
({
projectCostId
:
null
,
groundsForRejection
:
null
})
//是否一键驳回标识 false 不是
let
oneClickFlag
=
false
//弹出框
const
dialogFormVisible
=
ref
(
false
)
const
changProjectNumber
=
ref
(
''
)
const
changProjectNumber
=
ref
(
''
)
const
stepActive
=
ref
(
1
)
const
stepActive
=
ref
(
1
)
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
...
@@ -185,7 +206,6 @@ const getNodeList = ()=>{
...
@@ -185,7 +206,6 @@ const getNodeList = ()=>{
return
item
.
roleName
return
item
.
roleName
})
})
})
})
}
}
//获取当前用户角色信息
//获取当前用户角色信息
...
@@ -200,27 +220,202 @@ const getRoleInfo = ()=>{
...
@@ -200,27 +220,202 @@ const getRoleInfo = ()=>{
const
ReimbursementRequestList
=
reactive
([]);
const
ReimbursementRequestList
=
reactive
([]);
const
getList
=
()
=>
{
const
getList
=
()
=>
{
getReimbursementList
(
queryParams
).
then
(
response
=>
{
getReimbursementList
(
queryParams
).
then
(
response
=>
{
console
.
log
(
"项目费用报销-列表"
,
response
.
rows
)
total
.
value
=
response
.
total
total
.
value
=
response
.
total
Object
.
assign
(
ReimbursementRequestList
,
response
.
rows
);
Object
.
assign
(
ReimbursementRequestList
,
response
.
rows
);
// for(let i in ReimbursementRequestList){
for
(
let
i
in
ReimbursementRequestList
){
// ReimbursementRequestList[i].currentStatus = approvalStatusChange(ReimbursementRequestList[i].approveStatus,ReimbursementRequestList[i].currentAuditRoleId)
ReimbursementRequestList
[
i
].
currentStatus
=
approvalStatusChange
(
ReimbursementRequestList
[
i
].
approveStatus
,
ReimbursementRequestList
[
i
].
currentAuditNodeId
)
// }
}
console
.
log
(
"项目费用报销-列表"
,
ReimbursementRequestList
)
getTopApproveInfo
()
getTopApproveInfo
()
});
});
}
}
//表格多选
const
handleSelectionChange
=
(
val
)
=>
{
passObjList
.
length
=
0
for
(
let
item
of
val
){
let
currentAuditRoleId
=
item
.
currentAuditRoleId
//获取currentAuditRoleId的下标
let
index
=
allList
.
value
.
findIndex
(
item
=>
item
.
nodeId
===
currentAuditRoleId
)
let
obj
=
{
//项目费用id
projectCostId
:
item
.
id
,
//下一个节点nodeId
nextNodeId
:
null
,
//是否终审
isEndApproval
:
false
}
//判断是不是最后一个下标
if
((
allList
.
value
.
length
-
1
)
===
index
){
//最后一个下标的话
obj
.
nextNodeId
=
allList
.
value
[
index
].
nodeId
obj
.
isEndApproval
=
true
}
else
{
//不是最后一个下标
obj
.
nextNodeId
=
allList
.
value
[
index
+
1
].
nodeId
obj
.
isEndApproval
=
false
}
passObjList
.
push
(
obj
)
}
};
//只有待审批的表格可选
const
rowSelectable
=
(
row
)
=>
{
return
row
.
currentStatus
===
0
};
//获取当前审批状态 返回值0表示当前用户可以审核,大于0已经审核过了,小于0表示表示还没到当前用户
const
approvalStatusChange
=
(
status
,
currentNodeId
)
=>
{
//如果状态为未通过,那么这里返回-999
if
(
status
===
1
)
return
-
999
if
(
status
===
3
)
return
999
// 先根据每个节点的激活nodeid查找对应的角色id---也就是可以申请的角色
let
activeRoleId
=
allList
.
value
.
find
(
item
=>
item
.
nodeId
===
currentNodeId
).
roleId
let
lastCurrentRoleId
=
currentUserRoleInfoList
.
value
[
currentUserRoleInfoList
.
value
.
length
-
1
].
roleId
//激活id的下标减去当前登录用户最后一个角色id的在整体审批列表差
//0表示当前用户可以审核,大于0已经审核过了,小于0表示表示还没到当前用户
return
allList
.
value
.
findIndex
(
item
=>
item
.
roleId
===
activeRoleId
)
-
allList
.
value
.
findIndex
(
item
=>
item
.
roleId
===
lastCurrentRoleId
)
}
//获取列表第一个顶部信息
//获取列表第一个顶部信息
const
getTopApproveInfo
=
()
=>
{
const
getTopApproveInfo
=
()
=>
{
let
item2
=
ReimbursementRequestList
[
0
]
let
item2
=
ReimbursementRequestList
[
0
]
changProjectNumber
.
value
=
item2
.
projectNumber
changProjectNumber
.
value
=
item2
.
projectNumber
// let i = allList.value.findIndex((item)=>item.nodeId === item2.currentAuditRoleId)
let
i
=
allList
.
value
.
findIndex
((
item
)
=>
item
.
nodeId
===
item2
.
currentAuditRoleId
)
// if(i === -1) stepActive.value = 1
if
(
i
===
-
1
)
stepActive
.
value
=
1
// else stepActive.value = i+1
else
stepActive
.
value
=
i
+
1
}
//表格的鼠标进入事件
let
timer
=
null
;
const
handleHover
=
(
row
,
column
,
cell
,
event
)
=>
{
//防抖
if
(
timer
)
{
clearTimeout
(
timer
);
}
timer
=
setTimeout
(()
=>
{
changProjectNumber
.
value
=
row
.
projectNumber
let
i
=
allList
.
value
.
findIndex
((
item
)
=>
item
.
nodeId
===
row
.
currentAuditRoleId
)
if
(
i
===
-
1
)
stepActive
.
value
=
1
else
stepActive
.
value
=
i
+
1
},
300
);
}
const
handleLeave
=
()
=>
{
if
(
timer
)
{
clearTimeout
(
timer
);
}
timer
=
setTimeout
(()
=>
{
getTopApproveInfo
()
},
300
);
}
}
//一键通过
const
oneClickPass
=
()
=>
{
if
(
!
passObjList
.
length
)
return
ElMessage
({
message
:
'请先选择数据项'
,
type
:
'error'
})
projectCostReimbursementPass
(
passObjList
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
getList
()
}
})
}
//通过
const
passProjectCost
=
(
row
)
=>
{
console
.
log
(
row
)
let
currentAuditRoleId
=
row
.
currentAuditRoleId
//获取currentAuditRoleId的下标
let
index
=
allList
.
value
.
findIndex
(
item
=>
item
.
nodeId
===
currentAuditRoleId
)
let
obj
=
{
//项目费用id
projectCostId
:
row
.
id
,
//下一个节点nodeId
nextNodeId
:
null
,
//是否终审
isEndApproval
:
false
}
//判断是不是最后一个下标
if
((
allList
.
value
.
length
-
1
)
===
index
){
//最后一个下标的话
obj
.
nextNodeId
=
allList
.
value
[
index
].
nodeId
obj
.
isEndApproval
=
true
}
else
{
//不是最后一个下标
obj
.
nextNodeId
=
allList
.
value
[
index
+
1
].
nodeId
obj
.
isEndApproval
=
false
}
projectCostReimbursementPass
([
obj
]).
then
(
res
=>
{
console
.
log
(
"响应"
,
res
)
if
(
res
.
code
===
200
){
getList
()
}
})
}
//驳回
const
reject
=
(
row
)
=>
{
oneClickFlag
=
false
console
.
log
(
row
)
dialogFormVisible
.
value
=
true
rejectObj
.
projectCostId
=
row
.
id
}
//确定驳回
const
sureReject
=
()
=>
{
if
(
oneClickFlag
){
//如果是一键驳回
let
list
=
passObjList
.
map
((
item
)
=>
{
return
{
projectCostId
:
item
.
projectCostId
,
groundsForRejection
:
rejectObj
.
groundsForRejection
}
})
projectCostReimbursementNotPass
(
list
).
then
(
res
=>
{
dialogFormVisible
.
value
=
false
cancelReject
()
getList
()
})
}
else
{
//不是一键驳回
projectCostReimbursementNotPass
([
rejectObj
]).
then
(
res
=>
{
dialogFormVisible
.
value
=
false
cancelReject
()
getList
()
})
}
}
//一键驳回
const
oneClickNotPass
=
()
=>
{
if
(
!
passObjList
.
length
)
return
ElMessage
({
message
:
'请先选择数据项'
,
type
:
'error'
})
oneClickFlag
=
true
dialogFormVisible
.
value
=
true
}
//取消对话框
const
cancelReject
=
()
=>
{
dialogFormVisible
.
value
=
false
rejectObj
=
reactive
({
projectCostId
:
null
,
groundsForRejection
:
null
})
}
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
//获取所有审批列表
//获取所有审批列表
...
...
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