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
81d2a383
authored
Nov 10, 2024
by
jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能优化】发起人自选判断优化
parent
2aa2b460
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
src/api/bpm/processInstance/index.ts
+2
-1
src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
+9
-11
src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
+3
-6
No files found.
src/api/bpm/processInstance/index.ts
View file @
81d2a383
import
request
from
'@/config/axios'
import
{
ProcessDefinitionVO
}
from
'@/api/bpm/model'
import
{
NodeType
}
from
'@/components/SimpleProcessDesignerV2/src/consts'
import
{
NodeType
,
CandidateStrategy
}
from
'@/components/SimpleProcessDesignerV2/src/consts'
export
type
Task
=
{
id
:
string
name
:
string
...
...
@@ -43,6 +43,7 @@ export type ApprovalNodeInfo = {
id
:
number
name
:
string
nodeType
:
NodeType
candidateStrategy
?:
CandidateStrategy
status
:
number
startTime
?:
Date
endTime
?:
Date
...
...
src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
View file @
81d2a383
...
...
@@ -29,7 +29,6 @@
ref=
"timelineRef"
:activity-nodes=
"activityNodes"
:show-status-icon=
"false"
:startUserSelectTasks=
"startUserSelectTasks"
:startUserSelectAssignees=
"startUserSelectAssignees"
@
select-user-confirm=
"selectUserConfirm"
/>
...
...
@@ -78,6 +77,7 @@
<
script
lang=
"ts"
setup
>
import
{
decodeFields
,
setConfAndFields2
}
from
'@/utils/formCreate'
import
{
BpmModelType
}
from
'@/utils/constants'
import
{
CandidateStrategy
}
from
'@/components/SimpleProcessDesignerV2/src/consts'
import
ProcessInstanceBpmnViewer
from
'../detail/ProcessInstanceBpmnViewer.vue'
import
ProcessInstanceSimpleViewer
from
'../detail/ProcessInstanceSimpleViewer.vue'
import
ProcessInstanceTimeline
from
'../detail/ProcessInstanceTimeline.vue'
...
...
@@ -103,7 +103,7 @@ const detailForm: any = ref({
})
// 流程表单详情
const
fApi
=
ref
<
ApiAttrs
>
()
// 指定审批人
const
startUserSelectTasks
:
any
=
ref
([])
// 发起人需要选择审批人
的用户
任务列表
const
startUserSelectTasks
:
any
=
ref
([])
// 发起人需要选择审批人
或抄送人的
任务列表
const
startUserSelectAssignees
=
ref
({})
// 发起人选择审批人的数据
const
bpmnXML
:
any
=
ref
(
null
)
// BPMN 数据
const
simpleJson
=
ref
<
string
|
undefined
>
()
// Simple 设计器数据 json 格式
...
...
@@ -140,14 +140,6 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
if
(
processDefinitionDetail
)
{
bpmnXML
.
value
=
processDefinitionDetail
.
bpmnXml
simpleJson
.
value
=
processDefinitionDetail
.
simpleModel
startUserSelectTasks
.
value
=
processDefinitionDetail
.
startUserSelectTasks
// 设置指定审批人
if
(
startUserSelectTasks
.
value
?.
length
>
0
)
{
for
(
const
userTask
of
startUserSelectTasks
.
value
)
{
// 初始化数据
startUserSelectAssignees
.
value
[
userTask
.
id
]
=
[]
}
}
}
// 情况二:业务表单
}
else
if
(
row
.
formCustomCreatePath
)
{
...
...
@@ -169,6 +161,12 @@ const getApprovalDetail = async (row: any) => {
message
.
error
(
'查询不到审批详情信息!'
)
return
}
// 获取发起人自选的任务
startUserSelectTasks
.
value
=
data
.
activityNodes
?.
filter
(
node
=>
CandidateStrategy
.
START_USER_SELECT
===
node
.
candidateStrategy
)
for
(
const
node
of
startUserSelectTasks
.
value
)
{
// 初始化数据
startUserSelectAssignees
.
value
[
node
.
id
]
=
[]
}
// 获取审批节点,显示 Timeline 的数据
activityNodes
.
value
=
data
.
activityNodes
}
finally
{
...
...
@@ -187,7 +185,7 @@ const submitForm = async () => {
Array
.
isArray
(
startUserSelectAssignees
.
value
[
userTask
.
id
])
&&
startUserSelectAssignees
.
value
[
userTask
.
id
].
length
===
0
)
return
message
.
warning
(
`请选择
${
userTask
.
name
}
的
审批
人`
)
return
message
.
warning
(
`请选择
${
userTask
.
name
}
的
候选
人`
)
}
}
...
...
src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue
View file @
81d2a383
...
...
@@ -39,9 +39,7 @@
<!-- 需要自定义选择审批人 -->
<div
class=
"flex flex-wrap gap2 items-center"
v-if=
"
startUserSelectTasks?.length > 0 && Array.isArray(startUserSelectAssignees[activity.id])
"
v-if=
"isEmpty(activity.tasks) && isEmpty(activity.candidateUsers) && CandidateStrategy.START_USER_SELECT === activity.candidateStrategy"
>
<!-- && activity.nodeType === NodeType.USER_TASK_NODE -->
<el-button
...
...
@@ -156,7 +154,8 @@
import
{
formatDate
}
from
'@/utils/formatTime'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
import
{
TaskStatusEnum
}
from
'@/api/bpm/task'
import
{
NodeType
}
from
'@/components/SimpleProcessDesignerV2/src/consts'
import
{
NodeType
,
CandidateStrategy
}
from
'@/components/SimpleProcessDesignerV2/src/consts'
import
{
isEmpty
}
from
'@/utils/is'
import
{
Check
,
Close
,
Loading
,
Clock
,
Minus
,
Delete
}
from
'@element-plus/icons-vue'
import
starterSvg
from
'@/assets/svgs/bpm/starter.svg'
import
auditorSvg
from
'@/assets/svgs/bpm/auditor.svg'
...
...
@@ -170,12 +169,10 @@ withDefaults(
defineProps
<
{
activityNodes
:
ProcessInstanceApi
.
ApprovalNodeInfo
[]
// 审批节点信息
showStatusIcon
?:
boolean
// 是否显示头像右下角状态图标
startUserSelectTasks
?:
any
[]
// 发起人需要选择审批人的用户任务列表
startUserSelectAssignees
?:
any
// 发起人选择审批人的数据
}
>
(),
{
showStatusIcon
:
true
,
// 默认值为 true
startUserSelectTasks
:
()
=>
[],
// 默认值为空数组
startUserSelectAssignees
:
()
=>
{}
}
)
...
...
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