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
8d8ada17
authored
Mar 01, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】BPM:下一个审批人
parent
a911af3f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
53 deletions
+66
-53
src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
+21
-8
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+43
-45
src/views/bpm/processInstance/detail/index.vue
+2
-0
No files found.
src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
View file @
8d8ada17
...
@@ -147,8 +147,9 @@
...
@@ -147,8 +147,9 @@
size=
"large"
size=
"large"
:label=
"FieldPermissionType.READ"
:label=
"FieldPermissionType.READ"
@
change=
"updateElementExtensions"
@
change=
"updateElementExtensions"
><span></span
>
></el-radio>
<span></span>
</el-radio>
</div>
</div>
<div
class=
"item-radio-wrap"
>
<div
class=
"item-radio-wrap"
>
<el-radio
<el-radio
...
@@ -156,8 +157,9 @@
...
@@ -156,8 +157,9 @@
size=
"large"
size=
"large"
:label=
"FieldPermissionType.WRITE"
:label=
"FieldPermissionType.WRITE"
@
change=
"updateElementExtensions"
@
change=
"updateElementExtensions"
><span></span
>
></el-radio>
<span></span>
</el-radio>
</div>
</div>
<div
class=
"item-radio-wrap"
>
<div
class=
"item-radio-wrap"
>
<el-radio
<el-radio
...
@@ -165,8 +167,9 @@
...
@@ -165,8 +167,9 @@
size=
"large"
size=
"large"
:label=
"FieldPermissionType.NONE"
:label=
"FieldPermissionType.NONE"
@
change=
"updateElementExtensions"
@
change=
"updateElementExtensions"
><span></span
>
></el-radio>
<span></span>
</el-radio>
</div>
</div>
</el-radio-group>
</el-radio-group>
</div>
</div>
...
@@ -174,12 +177,22 @@
...
@@ -174,12 +177,22 @@
<el-divider
content-position=
"left"
>
是否需要签名
</el-divider>
<el-divider
content-position=
"left"
>
是否需要签名
</el-divider>
<el-form-item
prop=
"signEnable"
>
<el-form-item
prop=
"signEnable"
>
<el-switch
v-model=
"signEnable.value"
active-text=
"是"
inactive-text=
"否"
@
change=
"updateElementExtensions"
/>
<el-switch
v-model=
"signEnable.value"
active-text=
"是"
inactive-text=
"否"
@
change=
"updateElementExtensions"
/>
</el-form-item>
</el-form-item>
<el-divider
content-position=
"left"
>
审批意见
</el-divider>
<el-divider
content-position=
"left"
>
审批意见
</el-divider>
<el-form-item
prop=
"reasonRequire"
>
<el-form-item
prop=
"reasonRequire"
>
<el-switch
v-model=
"reasonRequire.value"
active-text=
"必填"
inactive-text=
"非必填"
@
change=
"updateElementExtensions"
/>
<el-switch
v-model=
"reasonRequire.value"
active-text=
"必填"
inactive-text=
"非必填"
@
change=
"updateElementExtensions"
/>
</el-form-item>
</el-form-item>
</div>
</div>
</
template
>
</
template
>
...
...
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
View file @
8d8ada17
...
@@ -44,17 +44,14 @@
...
@@ -44,17 +44,14 @@
:rows=
"4"
:rows=
"4"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
label=
"下一个节点的审批人"
prop=
"nextAssignees"
v-if=
"nextAssigneesVisible"
>
label=
"选择下一个节点的审批人"
<div
class=
"ml-10px -mt-15px -mb-35px"
>
prop=
"nextAssignees"
v-if=
"dialogVisibleSelectApproveUser"
>
<ProcessInstanceTimeline
<ProcessInstanceTimeline
ref=
"timelineRef"
:activity-nodes=
"nextAssigneesActivityNode"
:activity-nodes=
"activityNodes"
:show-status-icon=
"false"
:show-status-icon=
"false"
@
select-user-confirm=
"selectUser
Confirm"
@
select-user-confirm=
"selectNextAssignees
Confirm"
/>
/>
</div>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
v-if=
"runningTask.signEnable"
v-if=
"runningTask.signEnable"
...
@@ -78,7 +75,7 @@
...
@@ -78,7 +75,7 @@
>
>
{{ getButtonDisplayName(OperationButtonType.APPROVE) }}
{{ getButtonDisplayName(OperationButtonType.APPROVE) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('approve', approveFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('approve', approveFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -123,7 +120,7 @@
...
@@ -123,7 +120,7 @@
>
>
{{ getButtonDisplayName(OperationButtonType.REJECT) }}
{{ getButtonDisplayName(OperationButtonType.REJECT) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('reject', rejectFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('reject', rejectFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -181,7 +178,7 @@
...
@@ -181,7 +178,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleCopy"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleCopy"
>
{{ getButtonDisplayName(OperationButtonType.COPY) }}
{{ getButtonDisplayName(OperationButtonType.COPY) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('copy', copyFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('copy', copyFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -233,7 +230,7 @@
...
@@ -233,7 +230,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleTransfer()"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleTransfer()"
>
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('transfer', transferFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('transfer', transferFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -285,7 +282,7 @@
...
@@ -285,7 +282,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleDelegate()"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleDelegate()"
>
{{ getButtonDisplayName(OperationButtonType.DELEGATE) }}
{{ getButtonDisplayName(OperationButtonType.DELEGATE) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('delegate', delegateFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('delegate', delegateFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -340,7 +337,7 @@
...
@@ -340,7 +337,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handlerAddSign('after')"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handlerAddSign('after')"
>
向后{{ getButtonDisplayName(OperationButtonType.ADD_SIGN) }}
向后{{ getButtonDisplayName(OperationButtonType.ADD_SIGN) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('addSign', addSignFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('addSign', addSignFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -391,7 +388,7 @@
...
@@ -391,7 +388,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handlerDeleteSign()"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handlerDeleteSign()"
>
减签
减签
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('deleteSign', deleteSignFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('deleteSign', deleteSignFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -443,7 +440,7 @@
...
@@ -443,7 +440,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleReturn()"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleReturn()"
>
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('return', returnFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('return', returnFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -487,7 +484,7 @@
...
@@ -487,7 +484,7 @@
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleCancel()"
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleCancel()"
>
确认
确认
</el-button>
</el-button>
<el-button
@
click=
"closeP
r
opover('cancel', cancelFormRef)"
>
取消
</el-button>
<el-button
@
click=
"closePopover('cancel', cancelFormRef)"
>
取消
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -562,14 +559,14 @@ const runningTask = ref<any>() // 运行中的任务
...
@@ -562,14 +559,14 @@ const runningTask = ref<any>() // 运行中的任务
const
approveForm
=
ref
<
any
>
({})
// 审批通过时,额外的补充信息
const
approveForm
=
ref
<
any
>
({})
// 审批通过时,额外的补充信息
const
approveFormFApi
=
ref
<
any
>
({})
// approveForms 的 fAPi
const
approveFormFApi
=
ref
<
any
>
({})
// approveForms 的 fAPi
const
nodeTypeName
=
ref
(
'审批'
)
// 节点类型名称
const
nodeTypeName
=
ref
(
'审批'
)
// 节点类型名称
const
activityNodes
=
ref
<
ProcessInstanceApi
.
ApprovalNodeInfo
[]
>
([])
// 审批节点信息
const
dialogVisibleSelectApproveUser
=
ref
(
false
)
// 是否显示节点审批人选择框
// 审批通过意见表单
// 审批通过意见表单
const
reasonRequire
=
ref
()
const
reasonRequire
=
ref
()
const
approveFormRef
=
ref
<
FormInstance
>
()
const
approveFormRef
=
ref
<
FormInstance
>
()
const
signRef
=
ref
()
const
signRef
=
ref
()
const
approveSignFormRef
=
ref
()
const
approveSignFormRef
=
ref
()
const
nextAssigneesVisible
=
ref
(
false
)
// 是否显示下一个节点的审批人
const
nextAssigneesActivityNode
=
ref
<
ProcessInstanceApi
.
ApprovalNodeInfo
[]
>
([])
// 下一个审批节点信息
const
approveReasonForm
=
reactive
({
const
approveReasonForm
=
reactive
({
reason
:
''
,
reason
:
''
,
signPicUrl
:
''
,
signPicUrl
:
''
,
...
@@ -584,6 +581,7 @@ const approveReasonRule = computed(() => {
...
@@ -584,6 +581,7 @@ const approveReasonRule = computed(() => {
nextAssignees
:
[{
required
:
true
,
message
:
'审批人不能为空'
,
trigger
:
'blur'
}]
nextAssignees
:
[{
required
:
true
,
message
:
'审批人不能为空'
,
trigger
:
'blur'
}]
}
}
})
})
// 拒绝表单
// 拒绝表单
const
rejectFormRef
=
ref
<
FormInstance
>
()
const
rejectFormRef
=
ref
<
FormInstance
>
()
const
rejectReasonForm
=
reactive
({
const
rejectReasonForm
=
reactive
({
...
@@ -681,11 +679,6 @@ watch(
...
@@ -681,11 +679,6 @@ watch(
}
}
)
)
/** 选择下一个节点的审批人 */
const
selectUserConfirm
=
(
id
:
string
,
userList
:
any
[])
=>
{
approveReasonForm
.
nextAssignees
[
id
]
=
userList
?.
map
((
item
:
any
)
=>
item
.
id
)
}
/** 弹出气泡卡 */
/** 弹出气泡卡 */
const
openPopover
=
async
(
type
:
string
)
=>
{
const
openPopover
=
async
(
type
:
string
)
=>
{
if
(
type
===
'approve'
)
{
if
(
type
===
'approve'
)
{
...
@@ -695,7 +688,7 @@ const openPopover = async (type: string) => {
...
@@ -695,7 +688,7 @@ const openPopover = async (type: string) => {
message
.
warning
(
'表单校验不通过,请先完善表单!!'
)
message
.
warning
(
'表单校验不通过,请先完善表单!!'
)
return
return
}
}
initNext
TaskSelectAssignee
FormField
()
initNext
Assignees
FormField
()
}
}
if
(
type
===
'return'
)
{
if
(
type
===
'return'
)
{
// 获取退回节点
// 获取退回节点
...
@@ -713,41 +706,49 @@ const openPopover = async (type: string) => {
...
@@ -713,41 +706,49 @@ const openPopover = async (type: string) => {
}
}
/** 关闭气泡卡 */
/** 关闭气泡卡 */
const
closeP
r
opover
=
(
type
:
string
,
formRef
:
FormInstance
|
undefined
)
=>
{
const
closePopover
=
(
type
:
string
,
formRef
:
FormInstance
|
undefined
)
=>
{
if
(
formRef
)
{
if
(
formRef
)
{
formRef
.
resetFields
()
formRef
.
resetFields
()
}
}
popOverVisible
.
value
[
type
]
=
false
popOverVisible
.
value
[
type
]
=
false
dialogVisibleSelectApproveUser
.
value
=
false
nextAssigneesVisible
.
value
=
false
}
}
/**
//
流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
/** 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
const
initNext
TaskSelectAssignee
FormField
=
async
()
=>
{
const
initNext
Assignees
FormField
=
async
()
=>
{
// 获取修改的流程变量, 暂时只支持流程表单
// 获取修改的流程变量, 暂时只支持流程表单
const
variables
=
getUpdatedProcessInstanceVariables
()
const
variables
=
getUpdatedProcessInstanceVariables
()
const
param
=
{
const
data
=
await
ProcessInstanceApi
.
getApprovalDetail
(
{
processInstanceId
:
props
.
processInstance
.
id
,
processInstanceId
:
props
.
processInstance
.
id
,
processVariablesStr
:
JSON
.
stringify
(
variables
)
processVariablesStr
:
JSON
.
stringify
(
variables
)
}
})
const
res
=
await
ProcessInstanceApi
.
getApprovalDetail
(
param
)
//当前待审批节点id
const
activityId
=
data
.
todoTask
?.
taskDefinitionKey
const
activityId
=
res
.
todoTask
?.
taskDefinitionKey
if
(
data
.
activityNodes
&&
data
.
activityNodes
.
length
>
0
)
{
if
(
res
.
activityNodes
&&
res
.
activityNodes
.
length
>
0
)
{
// 找到当前节点的索引
// 找到当前节点的索引
const
currentNodeIndex
=
res
.
activityNodes
.
findIndex
((
node
)
=>
node
.
id
===
activityId
)
const
currentNodeIndex
=
data
.
activityNodes
.
findIndex
((
node
:
any
)
=>
node
.
id
===
activityId
)
const
nextNode
=
res
.
activityNodes
[
currentNodeIndex
+
1
]
const
nextNode
=
data
.
activityNodes
[
currentNodeIndex
+
1
]
// 情况一:发起人选择审批人:此时一般是因为条件发生变化,需要当前审批人补充选择
if
(
if
(
nextNode
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
nextNode
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
!
nextNode
.
tasks
&&
!
nextNode
.
tasks
&&
nextNode
.
candidateUsers
?.
length
===
0
nextNode
.
candidateUsers
?.
length
===
0
)
{
)
{
// 自选审批人,则弹出选择审批人弹窗
// 自选审批人,则弹出选择审批人弹窗
activityNodes
.
value
=
[
nextNode
]
// TODO @小北:需要考虑下,这里的 nextNode 可能是多个节点,需要怎么处理;类似你在后端的处理哈
dialogVisibleSelectApproveUser
.
value
=
true
// TODO @小北:有点纠结,是不是写个预测下一个节点的接口,更合适?
nextAssigneesActivityNode
.
value
=
[
nextNode
]
nextAssigneesVisible
.
value
=
true
}
}
// TODO @小北:情况二:审批人选择的情况
}
}
}
}
/** 选择下一个节点的审批人 */
const
selectNextAssigneesConfirm
=
(
id
:
string
,
userList
:
any
[])
=>
{
approveReasonForm
.
nextAssignees
[
id
]
=
userList
?.
map
((
item
:
any
)
=>
item
.
id
)
}
/** 处理审批通过和不通过的操作 */
/** 处理审批通过和不通过的操作 */
const
handleAudit
=
async
(
pass
:
boolean
,
formRef
:
FormInstance
|
undefined
)
=>
{
const
handleAudit
=
async
(
pass
:
boolean
,
formRef
:
FormInstance
|
undefined
)
=>
{
formLoading
.
value
=
true
formLoading
.
value
=
true
...
@@ -764,10 +765,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
...
@@ -764,10 +765,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
if
(
pass
)
{
if
(
pass
)
{
// 如果需要自选审批人,则校验自选审批人
// 如果需要自选审批人,则校验自选审批人
if
(
if
(
nextAssigneesVisible
.
value
&&
Object
.
keys
(
approveReasonForm
.
nextAssignees
).
length
===
0
)
{
dialogVisibleSelectApproveUser
.
value
&&
Object
.
keys
(
approveReasonForm
.
nextAssignees
).
length
===
0
)
{
message
.
warning
(
'下一个节点的审批人不能为空!'
)
message
.
warning
(
'下一个节点的审批人不能为空!'
)
return
return
}
}
...
@@ -778,7 +776,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
...
@@ -778,7 +776,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
reason
:
approveReasonForm
.
reason
,
reason
:
approveReasonForm
.
reason
,
variables
,
// 审批通过, 把修改的字段值赋于流程实例变量
variables
,
// 审批通过, 把修改的字段值赋于流程实例变量
nextAssignees
:
approveReasonForm
.
nextAssignees
// 下个自选节点选择的审批人信息
nextAssignees
:
approveReasonForm
.
nextAssignees
// 下个自选节点选择的审批人信息
}
}
as
any
// 签名
// 签名
if
(
runningTask
.
value
.
signEnable
)
{
if
(
runningTask
.
value
.
signEnable
)
{
data
.
signPicUrl
=
approveReasonForm
.
signPicUrl
data
.
signPicUrl
=
approveReasonForm
.
signPicUrl
...
@@ -793,7 +791,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
...
@@ -793,7 +791,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
}
}
await
TaskApi
.
approveTask
(
data
)
await
TaskApi
.
approveTask
(
data
)
popOverVisible
.
value
.
approve
=
false
popOverVisible
.
value
.
approve
=
false
dialogVisibleSelectApproveUser
.
value
=
false
nextAssigneesVisible
.
value
=
false
message
.
success
(
'审批通过成功'
)
message
.
success
(
'审批通过成功'
)
}
else
{
}
else
{
// 审批不通过数据
// 审批不通过数据
...
...
src/views/bpm/processInstance/detail/index.vue
View file @
8d8ada17
...
@@ -178,7 +178,9 @@ const writableFields: Array<string> = [] // 表单可以编辑的字段
...
@@ -178,7 +178,9 @@ const writableFields: Array<string> = [] // 表单可以编辑的字段
/** 获得详情 */
/** 获得详情 */
const
getDetail
=
()
=>
{
const
getDetail
=
()
=>
{
// 获得审批详情
getApprovalDetail
()
getApprovalDetail
()
// 获得流程模型视图
getProcessModelView
()
getProcessModelView
()
}
}
...
...
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