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
5968fc5f
authored
Aug 22, 2024
by
GoldenZqqq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 审批通过/拒绝以popover的形式来填写审批意见等信息并进行二次确认
parent
38e2063f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
135 additions
and
41 deletions
+135
-41
src/views/bpm/processInstance/detail/index_new.vue
+135
-41
No files found.
src/views/bpm/processInstance/detail/index_new.vue
View file @
5968fc5f
...
...
@@ -24,10 +24,7 @@
<el-row
:gutter=
"10"
>
<el-col
:span=
"18"
class=
"!flex !flex-col"
>
<!-- 表单信息 -->
<div
v-loading=
"processInstanceLoading"
class=
"form-box border-1 border-solid border-[#ccc] p-20px flex flex-col mb-30px"
>
<div
v-loading=
"processInstanceLoading"
class=
"form-box flex flex-col mb-30px flex-1"
>
<!-- 情况一:流程表单 -->
<el-col
v-if=
"processInstance?.processDefinition?.formType === 10"
...
...
@@ -47,12 +44,18 @@
</div>
</div>
<!-- 审批信息 -->
<el-divider
content-position=
"center"
v-if=
"runningTask"
>
<div
class=
"text-16px font-1000"
>
审批意见
</div>
</el-divider>
<div
class=
"flex flex-col flex-1"
v-loading=
"processInstanceLoading"
>
<div
class=
"h-60px"
>
<el-divider
class=
"!my-8px"
/>
<div
class=
"text-14px flex items-center color-#32373c font-bold btn-container"
>
<el-popover
:visible=
"passVisible"
placement=
"top-end"
:width=
"500"
trigger=
"click"
>
<template
#
reference
>
<el-button
plain
type=
"success"
@
click=
"openPopover('1')"
>
<Icon
icon=
"ep:select"
/>
通过
</el-button>
</
template
>
<div
class=
"flex flex-col flex-1 pt-20px px-20px"
v-loading=
"formLoading"
>
<el-form
label-position=
"top"
class=
"mb-auto"
ref=
"formRef"
:model=
"auditForm"
...
...
@@ -89,7 +92,11 @@
/>
</el-form-item>
<el-form-item
label=
"抄送人"
prop=
"copyUserIds"
>
<el-select
v-model=
"auditForm.copyUserIds"
multiple
placeholder=
"请选择抄送人"
>
<el-select
v-model=
"auditForm.copyUserIds"
multiple
placeholder=
"请选择抄送人"
>
<el-option
v-for=
"itemx in userOptions"
:key=
"itemx.id"
...
...
@@ -98,47 +105,106 @@
/>
</el-select>
</el-form-item>
</el-form>
<div
class=
"h-60px"
>
<el-divider
class=
"!my-8px"
/>
<div
class=
"text-14px flex items-center color-#32373c font-bold"
>
<el-button
plain
type=
"success"
@
click=
"handleAudit(true)"
>
<Icon
icon=
"ep:select"
/>
通过
<el-form-item>
<el-button
:disabled=
"formLoading"
type=
"primary"
@
click=
"handleAudit(true)"
>
通过
</el-button>
<el-button
class=
"mr-20px"
plain
type=
"danger"
@
click=
"handleAudit(false)"
>
<el-button
@
click=
"passVisible = false"
>
取消
</el-button>
</el-form-item>
</el-form>
</div>
</el-popover>
<el-popover
:visible=
"rejectVisible"
placement=
"top-end"
:width=
"500"
trigger=
"click"
>
<
template
#
reference
>
<el-button
class=
"mr-20px"
plain
type=
"danger"
@
click=
"openPopover('2')"
>
<Icon
icon=
"ep:close"
/>
拒绝
</el-button>
<div
class=
"mx-15px cursor-pointer !hover:color-#6db5ff flex items-center"
@
click=
"handleSend"
</
template
>
<div
class=
"flex flex-col flex-1 pt-20px px-20px"
v-loading=
"formLoading"
>
<el-form
label-position=
"top"
class=
"mb-auto"
ref=
"formRef"
:model=
"auditForm"
:rules=
"auditRule"
label-width=
"100px"
>
<Icon
:size=
"14"
icon=
"svg-icon:send"
/>
抄送
</div>
<div
class=
"mx-15px cursor-pointer !hover:color-#6db5ff flex items-center"
@
click=
"openTaskUpdateAssigneeForm"
<el-form-item
v-if=
"processInstance && processInstance.startUser"
label=
"流程发起人"
>
<Icon
:size=
"14"
icon=
"fa:share-square-o"
/>
转交
</div>
<div
class=
"mx-15px cursor-pointer !hover:color-#6db5ff flex items-center"
@
click=
"handleDelegate"
{{ processInstance?.startUser.nickname }}
<el-tag
size=
"small"
type=
"info"
class=
"ml-8px"
>
{{ processInstance?.startUser.deptName }}
</el-tag>
</el-form-item>
<el-card
v-if=
"runningTask.formId > 0"
class=
"mb-15px !-mt-10px"
>
<
template
#
header
>
<span
class=
"el-icon-picture-outline"
>
填写表单【
{{
runningTask
?.
formName
}}
】
</span>
</
template
>
<form-create
v-model=
"approveForm.value"
v-model:api=
"approveFormFApi"
:option=
"approveForm.option"
:rule=
"approveForm.rule"
/>
</el-card>
<el-form-item
label=
"审批建议"
prop=
"reason"
>
<el-input
v-model=
"auditForm.reason"
placeholder=
"请输入审批建议"
type=
"textarea"
/>
</el-form-item>
<el-form-item
label=
"抄送人"
prop=
"copyUserIds"
>
<el-select
v-model=
"auditForm.copyUserIds"
multiple
placeholder=
"请选择抄送人"
>
<Icon
:size=
"14"
icon=
"ep:position"
/>
委派
</div>
<div
class=
"mx-15px cursor-pointer !hover:color-#6db5ff flex items-center"
@
click=
"handleSign"
<el-option
v-for=
"itemx in userOptions"
:key=
"itemx.id"
:label=
"itemx.nickname"
:value=
"itemx.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
:disabled=
"formLoading"
type=
"danger"
@
click=
"handleAudit(false)"
>
<Icon
:size=
"14"
icon=
"ep:plus"
/>
加签
拒绝
</el-button>
<el-button
@
click=
"rejectVisible = false"
>
取消
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
"mx-15px cursor-pointer !hover:color-#6db5ff flex items-center"
@
click=
"handleBack"
>
<Icon
:size=
"14"
icon=
"fa:mail-reply"
/>
退回
</el-popover>
<div
@
click=
"handleSend"
>
<Icon
:size=
"14"
icon=
"svg-icon:send"
/>
抄送
</div>
<div
@
click=
"openTaskUpdateAssigneeForm"
>
<Icon
:size=
"14"
icon=
"fa:share-square-o"
/>
转交
</div>
<div
@
click=
"handleDelegate"
>
<Icon
:size=
"14"
icon=
"ep:position"
/>
委派
</div>
<div
@
click=
"handleSign"
>
<Icon
:size=
"14"
icon=
"ep:plus"
/>
加签
</div>
<div
@
click=
"handleBack"
>
<Icon
:size=
"14"
icon=
"fa:mail-reply"
/>
退回
</div>
</div>
</div>
</el-col>
...
...
@@ -245,12 +311,16 @@ const { proxy } = getCurrentInstance() as any
const
userId
=
useUserStore
().
getUser
.
id
// 当前登录的编号
const
id
=
query
.
id
as
unknown
as
string
// 流程实例的编号
const
processInstanceLoading
=
ref
(
false
)
// 流程实例的加载中
const
formLoading
=
ref
(
false
)
// 表单加载中
const
passVisible
=
ref
(
false
)
// 是否显示
const
rejectVisible
=
ref
(
false
)
// 是否显示
const
processInstance
=
ref
<
any
>
({})
// 流程实例
const
bpmnXml
=
ref
(
''
)
// BPMN XML
const
tasksLoad
=
ref
(
true
)
// 任务的加载中
const
tasks
=
ref
<
any
[]
>
([])
// 任务列表
// ========== 审批信息 ==========
const
runningTask
=
ref
<
any
>
({})
// 运行中的任务
const
formRef
=
ref
()
const
auditForm
=
ref
<
any
>
({})
// 审批任务的表单
const
auditRule
=
reactive
({
reason
:
[{
required
:
true
,
message
:
'审批建议不能为空'
,
trigger
:
'blur'
}]
...
...
@@ -280,6 +350,8 @@ watch(
/** 处理审批通过和不通过的操作 */
const
handleAudit
=
async
(
pass
)
=>
{
formLoading
.
value
=
true
try
{
const
auditFormRef
=
proxy
.
$refs
[
'formRef'
]
// 1.2 校验表单
const
elForm
=
unref
(
auditFormRef
)
...
...
@@ -309,6 +381,9 @@ const handleAudit = async (pass) => {
}
// 2.2 加载最新数据
getDetail
()
}
finally
{
formLoading
.
value
=
false
}
}
/** 转派审批人 */
...
...
@@ -457,6 +532,13 @@ const loadRunningTask = (tasks) => {
/* 抄送 TODO */
const
handleSend
=
()
=>
{}
const
openPopover
=
(
flag
)
=>
{
passVisible
.
value
=
false
rejectVisible
.
value
=
false
formRef
.
value
.
resetFields
()
flag
===
'1'
?
(
passVisible
.
value
=
true
)
:
(
rejectVisible
.
value
=
true
)
}
/** 初始化 */
const
userOptions
=
ref
<
UserApi
.
UserVO
[]
>
([])
// 用户列表
onMounted
(
async
()
=>
{
...
...
@@ -507,4 +589,16 @@ const activities = [
border
:
none
;
}
}
.btn-container
{
>
div
{
margin
:
0
15px
;
cursor
:
pointer
;
display
:
flex
;
align-items
:
center
;
&:hover
{
color
:
#6db5ff
;
}
}
}
</
style
>
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