Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
303bbbdd
authored
Feb 25, 2025
by
smallNorthLee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review:代码审查
parent
59528284
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
65 deletions
+46
-65
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+38
-57
src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
+1
-1
src/views/bpm/processInstance/detail/index.vue
+7
-7
No files found.
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
View file @
303bbbdd
...
...
@@ -36,8 +36,16 @@
:rule=
"approveForm.rule"
/>
</el-card>
<el-form-item
:label=
"`${nodeTypeName}意见`"
prop=
"reason"
>
<el-input
v-model=
"approveReasonForm.reason"
:placeholder=
"`请输入${nodeTypeName}意见`"
type=
"textarea"
:rows=
"4"
/>
</el-form-item>
<el-form-item
label=
"选择审批人"
label=
"选择
下一个节点的
审批人"
prop=
"selectApproveUser"
v-if=
"dialogVisibleSelectApproveUser"
>
...
...
@@ -48,14 +56,6 @@
@
select-user-confirm=
"selectUserConfirm"
/>
</el-form-item>
<el-form-item
:label=
"`${nodeTypeName}意见`"
prop=
"reason"
>
<el-input
v-model=
"approveReasonForm.reason"
:placeholder=
"`请输入${nodeTypeName}意见`"
type=
"textarea"
:rows=
"4"
/>
</el-form-item>
<el-form-item
v-if=
"runningTask.signEnable"
label=
"签名"
...
...
@@ -695,30 +695,7 @@ const openPopover = async (type: string) => {
message
.
warning
(
'表单校验不通过,请先完善表单!!'
)
return
}
// 获取修改的流程变量, 暂时只支持流程表单
const
variables
=
getUpdatedProcessInstanceVariables
()
const
param
=
{
processInstanceId
:
props
.
processInstance
.
id
,
processVariablesStr
:
JSON
.
stringify
(
variables
)
}
// 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
const
res
=
await
ProcessInstanceApi
.
getApprovalDetail
(
param
)
//当前待审批节点id
const
activityId
=
res
.
todoTask
?.
taskDefinitionKey
if
(
res
.
activityNodes
&&
res
.
activityNodes
.
length
>
0
)
{
// 找到当前节点的索引
const
currentNodeIndex
=
res
.
activityNodes
.
findIndex
((
node
)
=>
node
.
id
===
activityId
)
const
nextNode
=
res
.
activityNodes
[
currentNodeIndex
+
1
]
if
(
nextNode
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
!
nextNode
.
tasks
&&
nextNode
.
candidateUsers
?.
length
===
0
)
{
// 自选审批人,则弹出选择审批人弹窗
activityNodes
.
value
=
[
nextNode
]
dialogVisibleSelectApproveUser
.
value
=
true
}
}
initNextTaskSelectAssigneeFormField
()
}
if
(
type
===
'return'
)
{
// 获取退回节点
...
...
@@ -744,6 +721,33 @@ const closePropover = (type: string, formRef: FormInstance | undefined) => {
dialogVisibleSelectApproveUser
.
value
=
false
}
/** // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
const
initNextTaskSelectAssigneeFormField
=
async
()
=>
{
// 获取修改的流程变量, 暂时只支持流程表单
const
variables
=
getUpdatedProcessInstanceVariables
()
const
param
=
{
processInstanceId
:
props
.
processInstance
.
id
,
processVariablesStr
:
JSON
.
stringify
(
variables
)
}
const
res
=
await
ProcessInstanceApi
.
getApprovalDetail
(
param
)
//当前待审批节点id
const
activityId
=
res
.
todoTask
?.
taskDefinitionKey
if
(
res
.
activityNodes
&&
res
.
activityNodes
.
length
>
0
)
{
// 找到当前节点的索引
const
currentNodeIndex
=
res
.
activityNodes
.
findIndex
((
node
)
=>
node
.
id
===
activityId
)
const
nextNode
=
res
.
activityNodes
[
currentNodeIndex
+
1
]
if
(
nextNode
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
!
nextNode
.
tasks
&&
nextNode
.
candidateUsers
?.
length
===
0
)
{
// 自选审批人,则弹出选择审批人弹窗
activityNodes
.
value
=
[
nextNode
]
dialogVisibleSelectApproveUser
.
value
=
true
}
}
}
/** 处理审批通过和不通过的操作 */
const
handleAudit
=
async
(
pass
:
boolean
,
formRef
:
FormInstance
|
undefined
)
=>
{
formLoading
.
value
=
true
...
...
@@ -764,33 +768,10 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
dialogVisibleSelectApproveUser
.
value
&&
Object
.
keys
(
approveReasonForm
.
selectApproveUser
).
length
===
0
)
{
message
.
warning
(
'审批人不能为空!'
)
message
.
warning
(
'
下一个节点的
审批人不能为空!'
)
return
}
// 获取修改的流程变量, 暂时只支持流程表单
const
variables
=
getUpdatedProcessInstanceVariables
()
const
param
=
{
processInstanceId
:
props
.
processInstance
.
id
,
processVariablesStr
:
JSON
.
stringify
(
variables
)
}
// 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
const
res
=
await
ProcessInstanceApi
.
getApprovalDetail
(
param
)
//当前待审批节点id
const
activityId
=
res
.
todoTask
?.
taskDefinitionKey
if
(
res
.
activityNodes
&&
res
.
activityNodes
.
length
>
0
)
{
// 找到当前节点的索引
const
currentNodeIndex
=
res
.
activityNodes
.
findIndex
((
node
)
=>
node
.
id
===
activityId
)
const
nextNode
=
res
.
activityNodes
[
currentNodeIndex
+
1
]
if
(
nextNode
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
!
nextNode
.
tasks
&&
nextNode
.
candidateUsers
?.
length
===
0
)
{
// 自选审批人,则弹出选择审批人弹窗
activityNodes
.
value
=
[
nextNode
]
dialogVisibleSelectApproveUser
.
value
=
true
}
}
// 审批通过数据
const
data
=
{
id
:
runningTask
.
value
.
id
,
...
...
src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
View file @
303bbbdd
...
...
@@ -48,7 +48,7 @@ watch(
finishedActivityIds
,
finishedSequenceFlowActivityIds
)
simpleModel
.
value
=
newModelView
.
simpleModel
==
null
?
{}
:
newModelView
.
simpleModel
simpleModel
.
value
=
newModelView
.
simpleModel
?
newModelView
.
simpleModel
:
{}
}
}
)
...
...
src/views/bpm/processInstance/detail/index.vue
View file @
303bbbdd
...
...
@@ -178,21 +178,21 @@ const writableFields: Array<string> = [] // 表单可以编辑的字段
/** 获得详情 */
const
getDetail
=
()
=>
{
const
param
=
{
processInstanceId
:
props
.
id
,
activityId
:
props
.
activityId
,
taskId
:
props
.
taskId
}
getApprovalDetail
(
param
)
getApprovalDetail
()
getProcessModelView
()
}
/** 加载流程实例 */
const
BusinessFormComponent
=
ref
<
any
>
(
null
)
// 异步组件
/** 获取审批详情 */
const
getApprovalDetail
=
async
(
param
?:
any
)
=>
{
const
getApprovalDetail
=
async
()
=>
{
processInstanceLoading
.
value
=
true
try
{
const
param
=
{
processInstanceId
:
props
.
id
,
activityId
:
props
.
activityId
,
taskId
:
props
.
taskId
}
const
data
=
await
ProcessInstanceApi
.
getApprovalDetail
(
param
)
if
(
!
data
)
{
message
.
error
(
'查询不到审批详情信息!'
)
...
...
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