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
03b8bd5e
authored
Mar 17, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BPM:调整抄送逻辑的实现,改成审批通过、不通过时,可选择抄送
parent
de295281
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
376 deletions
+93
-376
src/api/bpm/processInstance/index.ts
+10
-25
src/utils/formatTime.ts
+5
-5
src/views/bpm/processInstance/detail/TaskCCDialogForm.vue
+0
-242
src/views/bpm/processInstance/detail/index.vue
+22
-7
src/views/bpm/task/copy/index.vue
+17
-20
src/views/bpm/task/done/TaskDetail.vue
+0
-51
src/views/bpm/task/done/index.vue
+39
-26
No files found.
src/api/bpm/processInstance/index.ts
View file @
03b8bd5e
...
...
@@ -20,14 +20,14 @@ export type ProcessInstanceVO = {
endTime
:
string
}
export
type
ProcessInstanceC
C
VO
=
{
type
:
number
,
taskName
:
string
,
taskKey
:
string
,
processInstanceName
:
string
,
processInstanceKey
:
string
,
startUserId
:
string
,
options
:
string
[],
export
type
ProcessInstanceC
opy
VO
=
{
type
:
number
taskName
:
string
taskKey
:
string
processInstanceName
:
string
processInstanceKey
:
string
startUserId
:
string
options
:
string
[]
reason
:
string
}
...
...
@@ -51,20 +51,6 @@ export const getProcessInstance = async (id: number) => {
return
await
request
.
get
({
url
:
'/bpm/process-instance/get?id='
+
id
})
}
/**
* 抄送
* @param data 抄送数据
* @returns 是否抄送成功
*/
export
const
createProcessInstanceCC
=
async
(
data
)
=>
{
return
await
request
.
post
({
url
:
'/bpm/process-instance/cc/create'
,
data
:
data
})
export
const
getProcessInstanceCopyPage
=
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/process-instance/copy/page'
,
params
})
}
/**
* 抄送列表
* @param params
* @returns
*/
export
const
getProcessInstanceCCPage
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/process-instance/cc/my-page'
,
params
})
}
\ No newline at end of file
src/utils/formatTime.ts
View file @
03b8bd5e
...
...
@@ -175,18 +175,18 @@ export function formatPast2(ms: number): string {
const
minute
=
Math
.
floor
(
ms
/
(
60
*
1000
)
-
day
*
24
*
60
-
hour
*
60
)
const
second
=
Math
.
floor
(
ms
/
1000
-
day
*
24
*
60
*
60
-
hour
*
60
*
60
-
minute
*
60
)
if
(
day
>
0
)
{
return
day
+
'
天'
+
hour
+
'小时'
+
minute
+
'
分钟'
return
day
+
'
天'
+
hour
+
' 小时 '
+
minute
+
'
分钟'
}
if
(
hour
>
0
)
{
return
hour
+
'
小时'
+
minute
+
'
分钟'
return
hour
+
'
小时 '
+
minute
+
'
分钟'
}
if
(
minute
>
0
)
{
return
minute
+
'分钟'
return
minute
+
'
分钟'
}
if
(
second
>
0
)
{
return
second
+
'秒'
return
second
+
'
秒'
}
else
{
return
0
+
'秒'
return
0
+
'
秒'
}
}
...
...
src/views/bpm/processInstance/detail/TaskCCDialogForm.vue
deleted
100644 → 0
View file @
de295281
<!-- TODO @kyle:需要在讨论下;可能直接选人更合适 -->
<
template
>
<Dialog
v-model=
"dialogVisible"
title=
"修改任务规则"
width=
"600"
>
<el-form
ref=
"formRef"
:model=
"formData"
:rules=
"formRules"
label-width=
"80px"
>
<el-form-item
label=
"任务名称"
prop=
"taskName"
>
<el-input
v-model=
"formData.taskName"
disabled
placeholder=
"请输入任务名称"
/>
</el-form-item>
<el-form-item
label=
"任务标识"
prop=
"taskKey"
>
<el-input
v-model=
"formData.taskKey"
disabled
placeholder=
"请输入任务标识"
/>
</el-form-item>
<el-form-item
label=
"流程名称"
prop=
"processInstanceName"
>
<el-input
v-model=
"formData.processInstanceName"
disabled
placeholder=
"请输入流程名称"
/>
</el-form-item>
<el-form-item
label=
"流程标识"
prop=
"processInstanceKey"
>
<el-input
v-model=
"formData.processInstanceKey"
disabled
placeholder=
"请输入流程标识"
/>
</el-form-item>
<el-form-item
label=
"规则类型"
prop=
"type"
>
<el-select
v-model=
"formData.type"
clearable
style=
"width: 100%"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.BPM_TASK_CANDIDATE_STRATEGY)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"formData.type === 10"
label=
"指定角色"
prop=
"roleIds"
>
<el-select
v-model=
"formData.roleIds"
clearable
multiple
style=
"width: 100%"
>
<el-option
v-for=
"item in roleOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"formData.type === 20 || formData.type === 21"
label=
"指定部门"
prop=
"deptIds"
span=
"24"
>
<el-tree-select
ref=
"treeRef"
v-model=
"formData.deptIds"
:data=
"deptTreeOptions"
:props=
"defaultProps"
empty-text=
"加载中,请稍后"
multiple
node-key=
"id"
show-checkbox
/>
</el-form-item>
<el-form-item
v-if=
"formData.type === 22"
label=
"指定岗位"
prop=
"postIds"
span=
"24"
>
<el-select
v-model=
"formData.postIds"
clearable
multiple
style=
"width: 100%"
>
<el-option
v-for=
"item in postOptions"
:key=
"parseInt(item.id)"
:label=
"item.name"
:value=
"parseInt(item.id)"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"formData.type === 30 || formData.type === 31 || formData.type === 32"
label=
"指定用户"
prop=
"userIds"
span=
"24"
>
<el-select
v-model=
"formData.userIds"
clearable
multiple
style=
"width: 100%"
>
<el-option
v-for=
"item in userOptions"
:key=
"parseInt(item.id)"
:label=
"item.nickname"
:value=
"parseInt(item.id)"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"formData.type === 40"
label=
"指定用户组"
prop=
"userGroupIds"
>
<el-select
v-model=
"formData.userGroupIds"
clearable
multiple
style=
"width: 100%"
>
<el-option
v-for=
"item in userGroupOptions"
:key=
"parseInt(item.id)"
:label=
"item.name"
:value=
"parseInt(item.id)"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"formData.type === 50"
label=
"指定脚本"
prop=
"scripts"
>
<el-select
v-model=
"formData.scripts"
clearable
multiple
style=
"width: 100%"
>
<el-option
v-for=
"dict in taskAssignScriptDictDatas"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"抄送原因"
prop=
"reason"
>
<el-input
v-model=
"formData.reason"
placeholder=
"请输入抄送原因"
type=
"textarea"
/>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<template
#
footer
>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
</
template
>
</Dialog>
</template>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
defaultProps
,
handleTree
}
from
'@/utils/tree'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
import
*
as
RoleApi
from
'@/api/system/role'
import
*
as
DeptApi
from
'@/api/system/dept'
import
*
as
PostApi
from
'@/api/system/post'
import
*
as
UserApi
from
'@/api/system/user'
import
*
as
UserGroupApi
from
'@/api/bpm/userGroup'
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formData
=
ref
({
type
:
Number
(
undefined
),
taskName
:
''
,
taskKey
:
''
,
processInstanceName
:
''
,
processInstanceKey
:
''
,
startUserId
:
''
,
options
:
[],
roleIds
:
[],
deptIds
:
[],
postIds
:
[],
userIds
:
[],
userGroupIds
:
[],
scripts
:
[],
reason
:
''
})
const
formRules
=
reactive
({
type
:
[{
required
:
true
,
message
:
'规则类型不能为空'
,
trigger
:
'change'
}],
roleIds
:
[{
required
:
true
,
message
:
'指定角色不能为空'
,
trigger
:
'change'
}],
deptIds
:
[{
required
:
true
,
message
:
'指定部门不能为空'
,
trigger
:
'change'
}],
postIds
:
[{
required
:
true
,
message
:
'指定岗位不能为空'
,
trigger
:
'change'
}],
userIds
:
[{
required
:
true
,
message
:
'指定用户不能为空'
,
trigger
:
'change'
}],
userGroupIds
:
[{
required
:
true
,
message
:
'指定用户组不能为空'
,
trigger
:
'change'
}],
scripts
:
[{
required
:
true
,
message
:
'指定脚本不能为空'
,
trigger
:
'change'
}],
reason
:
[{
required
:
true
,
message
:
'抄送原因不能为空'
,
trigger
:
'change'
}]
})
const
formRef
=
ref
()
// 表单 Ref
const
roleOptions
=
ref
<
RoleApi
.
RoleVO
[]
>
([])
// 角色列表
const
deptOptions
=
ref
<
DeptApi
.
DeptVO
[]
>
([])
// 部门列表
const
deptTreeOptions
=
ref
()
// 部门树
const
postOptions
=
ref
<
PostApi
.
PostVO
[]
>
([])
// 岗位列表
const
userOptions
=
ref
<
UserApi
.
UserVO
[]
>
([])
// 用户列表
const
userGroupOptions
=
ref
<
UserGroupApi
.
UserGroupVO
[]
>
([])
// 用户组列表
const
taskAssignScriptDictDatas
=
getIntDictOptions
(
DICT_TYPE
.
BPM_TASK_ASSIGN_SCRIPT
)
/** 打开弹窗 */
const
open
=
async
(
row
)
=>
{
// 1. 先重置表单
resetForm
()
// 2. 再设置表单
if
(
row
!=
null
)
{
formData
.
value
.
type
=
undefined
as
unknown
as
number
formData
.
value
.
taskName
=
row
.
name
formData
.
value
.
taskKey
=
row
.
id
formData
.
value
.
processInstanceName
=
row
.
processInstance
.
name
formData
.
value
.
processInstanceKey
=
row
.
processInstance
.
id
formData
.
value
.
startUserId
=
row
.
processInstance
.
startUserId
}
// 打开弹窗
dialogVisible
.
value
=
true
// 获得角色列表
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
// 获得部门列表
deptOptions
.
value
=
await
DeptApi
.
getSimpleDeptList
()
deptTreeOptions
.
value
=
handleTree
(
deptOptions
.
value
,
'id'
)
// 获得岗位列表
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
// 获得用户列表
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
// 获得用户组列表
userGroupOptions
.
value
=
await
UserGroupApi
.
getSimpleUserGroupList
()
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
/** 提交表单 */
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
submitForm
=
async
()
=>
{
// 校验表单
if
(
!
formRef
)
return
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
return
// 构建表单
const
form
=
{
...
formData
.
value
}
// 将 roleIds 等选项赋值到 options 中
if
(
form
.
type
===
10
)
{
form
.
options
=
form
.
roleIds
}
else
if
(
form
.
type
===
20
||
form
.
type
===
21
)
{
form
.
options
=
form
.
deptIds
}
else
if
(
form
.
type
===
22
)
{
form
.
options
=
form
.
postIds
}
else
if
(
form
.
type
===
30
||
form
.
type
===
31
||
form
.
type
===
32
)
{
form
.
options
=
form
.
userIds
}
else
if
(
form
.
type
===
40
)
{
form
.
options
=
form
.
userGroupIds
}
else
if
(
form
.
type
===
50
)
{
form
.
options
=
form
.
scripts
}
form
.
roleIds
=
undefined
form
.
deptIds
=
undefined
form
.
postIds
=
undefined
form
.
userIds
=
undefined
form
.
userGroupIds
=
undefined
form
.
scripts
=
undefined
// 提交请求
formLoading
.
value
=
true
try
{
const
data
=
form
as
unknown
as
ProcessInstanceApi
.
ProcessInstanceCCVO
await
ProcessInstanceApi
.
createProcessInstanceCC
(
data
)
console
.
log
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
dialogVisible
.
value
=
false
// 发送操作成功的事件
emit
(
'success'
)
}
finally
{
formLoading
.
value
=
false
}
}
/** 重置表单 */
const
resetForm
=
()
=>
{
formRef
.
value
?.
resetFields
()
}
</
script
>
src/views/bpm/processInstance/detail/index.vue
View file @
03b8bd5e
...
...
@@ -31,6 +31,16 @@
type=
"textarea"
/>
</el-form-item>
<el-form-item
label=
"抄送人"
prop=
"copyUserIds"
>
<el-select
v-model=
"auditForms[index].copyUserIds"
multiple
placeholder=
"请选择抄送人"
>
<el-option
v-for=
"item in userOptions"
:key=
"item.id"
:label=
"item.nickname"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</el-form>
<div
style=
"margin-bottom: 20px; margin-left: 10%; font-size: 14px"
>
<el-button
type=
"success"
@
click=
"handleAudit(item, true)"
>
...
...
@@ -118,6 +128,7 @@ import TaskDelegateForm from './TaskDelegateForm.vue'
import
TaskAddSignDialogForm
from
'./TaskAddSignDialogForm.vue'
import
{
registerComponent
}
from
'@/utils/routerHelper'
import
{
isEmpty
}
from
'@/utils/is'
import
*
as
UserApi
from
'@/api/system/user'
defineOptions
({
name
:
'BpmProcessInstanceDetail'
})
...
...
@@ -161,7 +172,8 @@ const handleAudit = async (task, pass) => {
// 2.1 提交审批
const
data
=
{
id
:
task
.
id
,
reason
:
auditForms
.
value
[
index
].
reason
reason
:
auditForms
.
value
[
index
].
reason
,
copyUserIds
:
auditForms
.
value
[
index
].
copyUserIds
}
if
(
pass
)
{
await
TaskApi
.
approveTask
(
data
)
...
...
@@ -180,21 +192,20 @@ const openTaskUpdateAssigneeForm = (id: string) => {
taskUpdateAssigneeFormRef
.
value
.
open
(
id
)
}
const
taskDelegateForm
=
ref
()
/** 处理审批退回的操作 */
const
taskDelegateForm
=
ref
()
const
handleDelegate
=
async
(
task
)
=>
{
taskDelegateForm
.
value
.
open
(
task
.
id
)
}
//回退弹框组件
const
taskReturnDialogRef
=
ref
()
/** 处理审批退回的操作 */
const
taskReturnDialogRef
=
ref
()
const
handleBack
=
async
(
task
)
=>
{
taskReturnDialogRef
.
value
.
open
(
task
.
id
)
}
const
taskAddSignDialogForm
=
ref
()
/** 处理审批加签的操作 */
const
taskAddSignDialogForm
=
ref
()
const
handleSign
=
async
(
task
)
=>
{
taskAddSignDialogForm
.
value
.
open
(
task
.
id
)
}
...
...
@@ -304,13 +315,17 @@ const loadRunningTask = (tasks) => {
// 2.3 添加到处理任务
runningTasks
.
value
.
push
({
...
task
})
auditForms
.
value
.
push
({
reason
:
''
reason
:
''
,
copyUserIds
:
[]
})
})
}
/** 初始化 */
onMounted
(()
=>
{
const
userOptions
=
ref
<
UserApi
.
UserVO
[]
>
([])
// 用户列表
onMounted
(
async
()
=>
{
getDetail
()
// 获得用户列表
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
})
</
script
>
src/views/bpm/task/c
c
/index.vue
→
src/views/bpm/task/c
opy
/index.vue
View file @
03b8bd5e
...
...
@@ -11,14 +11,6 @@
placeholder=
"请输入流程名称"
/>
</el-form-item>
<el-form-item
label=
"所属流程"
prop=
"processDefinitionId"
>
<el-input
v-model=
"queryParams.processInstanceId"
placeholder=
"请输入流程定义的编号"
clearable
class=
"!w-240px"
/>
</el-form-item>
<el-form-item
label=
"抄送时间"
prop=
"createTime"
>
<el-date-picker
v-model=
"queryParams.createTime"
...
...
@@ -46,12 +38,17 @@
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
align=
"center"
label=
"所属流程"
prop=
"processInstanceId"
width=
"300px"
/>
<el-table-column
align=
"center"
label=
"流程名称"
prop=
"processInstanceName"
/>
<el-table-column
align=
"center"
label=
"任务名称"
prop=
"taskName"
/>
<el-table-column
align=
"center"
label=
"流程发起人"
prop=
"startUserNickname"
/>
<el-table-column
align=
"center"
label=
"抄送发起人"
prop=
"creatorNickname"
/>
<el-table-column
align=
"center"
label=
"抄送原因"
prop=
"reason"
/>
<el-table-column
align=
"center"
label=
"流程名"
prop=
"processInstanceName"
min-width=
"180"
/>
<el-table-column
align=
"center"
label=
"流程发起人"
prop=
"startUserName"
min-width=
"100"
/>
<el-table-column
:formatter=
"dateFormatter"
align=
"center"
label=
"流程发起时间"
prop=
"processInstanceStartTime"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"抄送任务"
prop=
"taskName"
min-width=
"180"
/>
<el-table-column
align=
"center"
label=
"抄送人"
prop=
"creatorName"
min-width=
"100"
/>
<el-table-column
align=
"center"
label=
"抄送时间"
...
...
@@ -59,9 +56,9 @@
width=
"180"
:formatter=
"dateFormatter"
/>
<el-table-column
align=
"center"
label=
"操作"
>
<el-table-column
align=
"center"
label=
"操作"
fixed=
"right"
width=
"80"
>
<template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"handleAudit(scope.row)"
>
跳转待办
</el-button>
<el-button
link
type=
"primary"
@
click=
"handleAudit(scope.row)"
>
详情
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -78,14 +75,14 @@
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
defineOptions
({
name
:
'Bpm
CCProcessInstance
'
})
defineOptions
({
name
:
'Bpm
ProcessInstanceCopy
'
})
const
{
push
}
=
useRouter
()
// 路由
const
loading
=
ref
(
false
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
queryParams
=
re
f
({
const
queryParams
=
re
active
({
pageNo
:
1
,
pageSize
:
10
,
processInstanceId
:
''
,
...
...
@@ -98,7 +95,7 @@ const queryFormRef = ref() // 搜索的表单
const
getList
=
async
()
=>
{
loading
.
value
=
true
try
{
const
data
=
await
ProcessInstanceApi
.
getProcessInstanceC
C
Page
(
queryParams
)
const
data
=
await
ProcessInstanceApi
.
getProcessInstanceC
opy
Page
(
queryParams
)
list
.
value
=
data
.
list
total
.
value
=
data
.
total
}
finally
{
...
...
@@ -118,7 +115,7 @@ const handleAudit = (row: any) => {
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
queryParams
.
value
.
pageNo
=
1
queryParams
.
pageNo
=
1
getList
()
}
...
...
src/views/bpm/task/done/TaskDetail.vue
deleted
100644 → 0
View file @
de295281
<
template
>
<Dialog
v-model=
"dialogVisible"
:max-height=
"500"
:scroll=
"true"
title=
"详情"
>
<el-descriptions
:column=
"1"
border
>
<el-descriptions-item
label=
"任务编号"
min-width=
"120"
>
{{
detailData
.
id
}}
</el-descriptions-item>
<el-descriptions-item
label=
"任务名称"
>
{{
detailData
.
name
}}
</el-descriptions-item>
<el-descriptions-item
label=
"所属流程"
>
{{
detailData
.
processInstance
.
name
}}
</el-descriptions-item>
<el-descriptions-item
label=
"流程发起人"
>
{{
detailData
.
processInstance
.
startUserNickname
}}
</el-descriptions-item>
<el-descriptions-item
label=
"状态"
>
<dict-tag
:type=
"DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT"
:value=
"detailData.status"
/>
</el-descriptions-item>
<el-descriptions-item
label=
"原因"
>
{{
detailData
.
reason
}}
</el-descriptions-item>
<el-descriptions-item
label=
"创建时间"
>
{{
formatDate
(
detailData
.
createTime
)
}}
</el-descriptions-item>
</el-descriptions>
</Dialog>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
formatDate
}
from
'@/utils/formatTime'
import
*
as
TaskApi
from
'@/api/bpm/task'
defineOptions
({
name
:
'BpmTaskDetail'
})
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
detailLoading
=
ref
(
false
)
// 表单的加载中
const
detailData
=
ref
()
// 详情数据
/** 打开弹窗 */
const
open
=
async
(
data
:
TaskApi
.
TaskVO
)
=>
{
dialogVisible
.
value
=
true
// 设置数据
detailLoading
.
value
=
true
try
{
detailData
.
value
=
data
}
finally
{
detailLoading
.
value
=
false
}
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
</
script
>
src/views/bpm/task/done/index.vue
View file @
03b8bd5e
...
...
@@ -46,27 +46,50 @@
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
align=
"center"
label=
"任务编号"
prop=
"id"
width=
"300px"
/>
<el-table-column
align=
"center"
label=
"任务名称"
prop=
"name"
/>
<el-table-column
align=
"center"
label=
"所属流程"
prop=
"processInstance.name"
/>
<el-table-column
align=
"center"
label=
"流程发起人"
prop=
"processInstance.startUserNickname"
/>
<el-table-column
align=
"center"
label=
"审批状态"
prop=
"status"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"原因"
prop=
"reason"
/>
<el-table-column
align=
"center"
label=
"流程"
prop=
"processInstance.name"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"发起人"
prop=
"processInstance.startUser.nickname"
width=
"100"
/>
<el-table-column
:formatter=
"dateFormatter"
align=
"center"
label=
"
创建
时间"
label=
"
发起
时间"
prop=
"createTime"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"操作"
>
<el-table-column
align=
"center"
label=
"当前任务"
prop=
"name"
width=
"180"
/>
<el-table-column
:formatter=
"dateFormatter"
align=
"center"
label=
"任务开始时间"
prop=
"createTime"
width=
"180"
/>
<el-table-column
:formatter=
"dateFormatter"
align=
"center"
label=
"任务结束时间"
prop=
"endTime"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"耗时"
prop=
"durationInMillis"
width=
"120"
>
<template
#
default=
"scope"
>
{{
formatPast2
(
scope
.
row
.
durationInMillis
)
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"审批状态"
prop=
"status"
width=
"100"
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"openDetail(scope.row)"
>
详情
</el-button>
<el-button
link
type=
"primary"
@
click=
"handleAudit(scope.row)"
>
流程
</el-button>
<dict-tag
:type=
"DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"流程编号"
prop=
"id"
:show-overflow-tooltip=
"true"
/>
<el-table-column
align=
"center"
label=
"任务编号"
prop=
"id"
:show-overflow-tooltip=
"true"
/>
<el-table-column
align=
"center"
label=
"操作"
fixed=
"right"
width=
"80"
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"handleAudit(scope.row)"
>
历史
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -78,15 +101,11 @@
@
pagination=
"getList"
/>
</ContentWrap>
<!-- 表单弹窗:详情 -->
<TaskDetail
ref=
"detailRef"
@
success=
"getList"
/>
</template>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
,
formatPast2
}
from
'@/utils/formatTime'
import
*
as
TaskApi
from
'@/api/bpm/task'
import
TaskDetail
from
'./TaskDetail.vue'
defineOptions
({
name
:
'BpmTodoTask'
})
...
...
@@ -127,14 +146,8 @@ const resetQuery = () => {
handleQuery
()
}
/** 详情操作 */
const
detailRef
=
ref
()
const
openDetail
=
(
row
:
TaskApi
.
TaskVO
)
=>
{
detailRef
.
value
.
open
(
row
)
}
/** 处理审批按钮 */
const
handleAudit
=
(
row
)
=>
{
const
handleAudit
=
(
row
:
any
)
=>
{
push
({
name
:
'BpmProcessInstanceDetail'
,
query
:
{
...
...
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