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
a40866e2
authored
Mar 18, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BPM:完善 task 转派的实现
parent
60ddc45b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
46 deletions
+40
-46
src/api/bpm/task/index.ts
+7
-20
src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue
+1
-3
src/views/bpm/processInstance/detail/dialog/TaskDelegateForm.vue
+6
-3
src/views/bpm/processInstance/detail/dialog/TaskReturnForm.vue
+1
-1
src/views/bpm/processInstance/detail/dialog/TaskTransferForm.vue
+12
-6
src/views/bpm/processInstance/detail/index.vue
+13
-13
No files found.
src/api/bpm/task/index.ts
View file @
a40866e2
...
@@ -12,10 +12,6 @@ export const getDoneTaskPage = async (params) => {
...
@@ -12,10 +12,6 @@ export const getDoneTaskPage = async (params) => {
return
await
request
.
get
({
url
:
'/bpm/task/done-page'
,
params
})
return
await
request
.
get
({
url
:
'/bpm/task/done-page'
,
params
})
}
}
export
const
completeTask
=
async
(
data
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/complete'
,
data
})
}
export
const
approveTask
=
async
(
data
)
=>
{
export
const
approveTask
=
async
(
data
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/approve'
,
data
})
return
await
request
.
put
({
url
:
'/bpm/task/approve'
,
data
})
}
}
...
@@ -23,13 +19,6 @@ export const approveTask = async (data) => {
...
@@ -23,13 +19,6 @@ export const approveTask = async (data) => {
export
const
rejectTask
=
async
(
data
)
=>
{
export
const
rejectTask
=
async
(
data
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/reject'
,
data
})
return
await
request
.
put
({
url
:
'/bpm/task/reject'
,
data
})
}
}
export
const
backTask
=
async
(
data
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/back'
,
data
})
}
export
const
updateTaskAssignee
=
async
(
data
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/update-assignee'
,
data
})
}
export
const
getTaskListByProcessInstanceId
=
async
(
processInstanceId
)
=>
{
export
const
getTaskListByProcessInstanceId
=
async
(
processInstanceId
)
=>
{
return
await
request
.
get
({
return
await
request
.
get
({
...
@@ -37,11 +26,6 @@ export const getTaskListByProcessInstanceId = async (processInstanceId) => {
...
@@ -37,11 +26,6 @@ export const getTaskListByProcessInstanceId = async (processInstanceId) => {
})
})
}
}
// 导出任务
export
const
exportTask
=
async
(
params
)
=>
{
return
await
request
.
download
({
url
:
'/bpm/task/export'
,
params
})
}
// 获取所有可回退的节点
// 获取所有可回退的节点
export
const
getTaskListByReturn
=
async
(
id
:
string
)
=>
{
export
const
getTaskListByReturn
=
async
(
id
:
string
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/task/list-by-return'
,
params
:
{
id
}
})
return
await
request
.
get
({
url
:
'/bpm/task/list-by-return'
,
params
:
{
id
}
})
...
@@ -52,13 +36,16 @@ export const returnTask = async (data: any) => {
...
@@ -52,13 +36,16 @@ export const returnTask = async (data: any) => {
return
await
request
.
put
({
url
:
'/bpm/task/return'
,
data
})
return
await
request
.
put
({
url
:
'/bpm/task/return'
,
data
})
}
}
/**
// 委派
* 委派
export
const
delegateTask
=
async
(
data
:
any
)
=>
{
*/
export
const
delegateTask
=
async
(
data
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/delegate'
,
data
})
return
await
request
.
put
({
url
:
'/bpm/task/delegate'
,
data
})
}
}
// 转派
export
const
transferTask
=
async
(
data
:
any
)
=>
{
return
await
request
.
put
({
url
:
'/bpm/task/transfer'
,
data
})
}
/**
/**
* 加签
* 加签
*/
*/
...
...
src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue
View file @
a40866e2
...
@@ -44,9 +44,7 @@
...
@@ -44,9 +44,7 @@
<label
v-if=
"item.durationInMillis"
style=
"font-weight: normal; color: #8a909c"
>
<label
v-if=
"item.durationInMillis"
style=
"font-weight: normal; color: #8a909c"
>
{{ formatPast2(item?.durationInMillis) }}
{{ formatPast2(item?.durationInMillis) }}
</label>
</label>
<p
v-if=
"item.reason"
>
<p
v-if=
"item.reason"
>
审批建议:{{ item.reason }}
</p>
<el-tag
:type=
"getTimelineItemType(item)"
>
{{ item.reason }}
</el-tag>
</p>
</el-card>
</el-card>
</el-timeline-item>
</el-timeline-item>
</el-timeline>
</el-timeline>
...
...
src/views/bpm/processInstance/detail/TaskDelegateForm.vue
→
src/views/bpm/processInstance/detail/
dialog/
TaskDelegateForm.vue
View file @
a40866e2
...
@@ -37,10 +37,12 @@ const dialogVisible = ref(false) // 弹窗的是否展示
...
@@ -37,10 +37,12 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中
const
formLoading
=
ref
(
false
)
// 表单的加载中
const
formData
=
ref
({
const
formData
=
ref
({
id
:
''
,
id
:
''
,
delegateUserId
:
undefined
delegateUserId
:
undefined
,
reason
:
''
})
})
const
formRules
=
ref
({
const
formRules
=
ref
({
delegateUserId
:
[{
required
:
true
,
message
:
'接收人不能为空'
,
trigger
:
'change'
}]
delegateUserId
:
[{
required
:
true
,
message
:
'接收人不能为空'
,
trigger
:
'change'
}],
reason
:
[{
required
:
true
,
message
:
'委派理由不能为空'
,
trigger
:
'blur'
}]
})
})
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
...
@@ -79,7 +81,8 @@ const submitForm = async () => {
...
@@ -79,7 +81,8 @@ const submitForm = async () => {
const
resetForm
=
()
=>
{
const
resetForm
=
()
=>
{
formData
.
value
=
{
formData
.
value
=
{
id
:
''
,
id
:
''
,
delegateUserId
:
undefined
delegateUserId
:
undefined
,
reason
:
''
}
}
formRef
.
value
?.
resetFields
()
formRef
.
value
?.
resetFields
()
}
}
...
...
src/views/bpm/processInstance/detail/
TaskReturnDialog
Form.vue
→
src/views/bpm/processInstance/detail/
dialog/TaskReturn
Form.vue
View file @
a40866e2
<
template
>
<
template
>
<Dialog
v-model=
"dialogVisible"
title=
"回退"
width=
"500"
>
<Dialog
v-model=
"dialogVisible"
title=
"回退
任务
"
width=
"500"
>
<el-form
<el-form
ref=
"formRef"
ref=
"formRef"
v-loading=
"formLoading"
v-loading=
"formLoading"
...
...
src/views/bpm/processInstance/detail/
TaskUpdateAssignee
Form.vue
→
src/views/bpm/processInstance/detail/
dialog/TaskTransfer
Form.vue
View file @
a40866e2
<
template
>
<
template
>
<Dialog
v-model=
"dialogVisible"
title=
"转派
审批人
"
width=
"500"
>
<Dialog
v-model=
"dialogVisible"
title=
"转派
任务
"
width=
"500"
>
<el-form
<el-form
ref=
"formRef"
ref=
"formRef"
v-loading=
"formLoading"
v-loading=
"formLoading"
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"转派理由"
prop=
"reason"
>
<el-input
v-model=
"formData.reason"
clearable
placeholder=
"请输入转派理由"
/>
</el-form-item>
</el-form>
</el-form>
<template
#
footer
>
<template
#
footer
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
...
@@ -28,16 +31,18 @@
...
@@ -28,16 +31,18 @@
import
*
as
TaskApi
from
'@/api/bpm/task'
import
*
as
TaskApi
from
'@/api/bpm/task'
import
*
as
UserApi
from
'@/api/system/user'
import
*
as
UserApi
from
'@/api/system/user'
defineOptions
({
name
:
'
BpmTaskUpdateAssignee
Form'
})
defineOptions
({
name
:
'
TaskTransfer
Form'
})
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中
const
formLoading
=
ref
(
false
)
// 表单的加载中
const
formData
=
ref
({
const
formData
=
ref
({
id
:
''
,
id
:
''
,
assigneeUserId
:
undefined
assigneeUserId
:
undefined
,
reason
:
''
})
})
const
formRules
=
ref
({
const
formRules
=
ref
({
assigneeUserId
:
[{
required
:
true
,
message
:
'新审批人不能为空'
,
trigger
:
'change'
}]
assigneeUserId
:
[{
required
:
true
,
message
:
'新审批人不能为空'
,
trigger
:
'change'
}],
reason
:
[{
required
:
true
,
message
:
'转派理由不能为空'
,
trigger
:
'blur'
}]
})
})
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
...
@@ -63,7 +68,7 @@ const submitForm = async () => {
...
@@ -63,7 +68,7 @@ const submitForm = async () => {
// 提交请求
// 提交请求
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
await
TaskApi
.
updateTaskAssignee
(
formData
.
value
)
await
TaskApi
.
transferTask
(
formData
.
value
)
dialogVisible
.
value
=
false
dialogVisible
.
value
=
false
// 发送操作成功的事件
// 发送操作成功的事件
emit
(
'success'
)
emit
(
'success'
)
...
@@ -76,7 +81,8 @@ const submitForm = async () => {
...
@@ -76,7 +81,8 @@ const submitForm = async () => {
const
resetForm
=
()
=>
{
const
resetForm
=
()
=>
{
formData
.
value
=
{
formData
.
value
=
{
id
:
''
,
id
:
''
,
assigneeUserId
:
undefined
assigneeUserId
:
undefined
,
reason
:
''
}
}
formRef
.
value
?.
resetFields
()
formRef
.
value
?.
resetFields
()
}
}
...
...
src/views/bpm/processInstance/detail/index.vue
View file @
a40866e2
...
@@ -104,12 +104,12 @@
...
@@ -104,12 +104,12 @@
/>
/>
<!-- 弹窗:转派审批人 -->
<!-- 弹窗:转派审批人 -->
<Task
UpdateAssigneeForm
ref=
"taskUpdateAssignee
FormRef"
@
success=
"getDetail"
/>
<Task
TransferForm
ref=
"taskTransfer
FormRef"
@
success=
"getDetail"
/>
<!-- 弹窗
,
回退节点 -->
<!-- 弹窗
:
回退节点 -->
<TaskReturn
Dialog
ref=
"taskReturnDialog
Ref"
@
success=
"getDetail"
/>
<TaskReturn
Form
ref=
"taskReturnForm
Ref"
@
success=
"getDetail"
/>
<!-- 委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中-->
<!--
弹窗:
委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中-->
<TaskDelegateForm
ref=
"taskDelegateForm"
@
success=
"getDetail"
/>
<TaskDelegateForm
ref=
"taskDelegateForm"
@
success=
"getDetail"
/>
<!-- 加签,当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
<!--
弹窗:
加签,当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
<TaskAddSignDialogForm
ref=
"taskAddSignDialogForm"
@
success=
"getDetail"
/>
<TaskAddSignDialogForm
ref=
"taskAddSignDialogForm"
@
success=
"getDetail"
/>
</ContentWrap>
</ContentWrap>
</template>
</template>
...
@@ -120,11 +120,11 @@ import type { ApiAttrs } from '@form-create/element-ui/types/config'
...
@@ -120,11 +120,11 @@ import type { ApiAttrs } from '@form-create/element-ui/types/config'
import
*
as
DefinitionApi
from
'@/api/bpm/definition'
import
*
as
DefinitionApi
from
'@/api/bpm/definition'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
import
*
as
TaskApi
from
'@/api/bpm/task'
import
*
as
TaskApi
from
'@/api/bpm/task'
import
TaskUpdateAssigneeForm
from
'./TaskUpdateAssigneeForm.vue'
import
ProcessInstanceBpmnViewer
from
'./ProcessInstanceBpmnViewer.vue'
import
ProcessInstanceBpmnViewer
from
'./ProcessInstanceBpmnViewer.vue'
import
ProcessInstanceTaskList
from
'./ProcessInstanceTaskList.vue'
import
ProcessInstanceTaskList
from
'./ProcessInstanceTaskList.vue'
import
TaskReturnDialog
from
'./TaskReturnDialogForm.vue'
import
TaskReturnForm
from
'./dialog/TaskReturnForm.vue'
import
TaskDelegateForm
from
'./TaskDelegateForm.vue'
import
TaskDelegateForm
from
'./dialog/TaskDelegateForm.vue'
import
TaskTransferForm
from
'./dialog/TaskTransferForm.vue'
import
TaskAddSignDialogForm
from
'./TaskAddSignDialogForm.vue'
import
TaskAddSignDialogForm
from
'./TaskAddSignDialogForm.vue'
import
{
registerComponent
}
from
'@/utils/routerHelper'
import
{
registerComponent
}
from
'@/utils/routerHelper'
import
{
isEmpty
}
from
'@/utils/is'
import
{
isEmpty
}
from
'@/utils/is'
...
@@ -187,9 +187,9 @@ const handleAudit = async (task, pass) => {
...
@@ -187,9 +187,9 @@ const handleAudit = async (task, pass) => {
}
}
/** 转派审批人 */
/** 转派审批人 */
const
task
UpdateAssignee
FormRef
=
ref
()
const
task
Transfer
FormRef
=
ref
()
const
openTaskUpdateAssigneeForm
=
(
id
:
string
)
=>
{
const
openTaskUpdateAssigneeForm
=
(
id
:
string
)
=>
{
task
UpdateAssignee
FormRef
.
value
.
open
(
id
)
task
Transfer
FormRef
.
value
.
open
(
id
)
}
}
/** 处理审批退回的操作 */
/** 处理审批退回的操作 */
...
@@ -199,9 +199,9 @@ const handleDelegate = async (task) => {
...
@@ -199,9 +199,9 @@ const handleDelegate = async (task) => {
}
}
/** 处理审批退回的操作 */
/** 处理审批退回的操作 */
const
taskReturn
Dialog
Ref
=
ref
()
const
taskReturn
Form
Ref
=
ref
()
const
handleBack
=
async
(
task
)
=>
{
const
handleBack
=
async
(
task
:
any
)
=>
{
taskReturn
Dialog
Ref
.
value
.
open
(
task
.
id
)
taskReturn
Form
Ref
.
value
.
open
(
task
.
id
)
}
}
/** 处理审批加签的操作 */
/** 处理审批加签的操作 */
...
...
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