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
913c9955
authored
Mar 21, 2025
by
lizhixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:增加案例流程,业务表单发起时选择审批人
parent
a5c533bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
src/views/bpm/oa/leave/create.vue
+15
-14
No files found.
src/views/bpm/oa/leave/create.vue
View file @
913c9955
...
@@ -138,12 +138,12 @@ const submitForm = async () => {
...
@@ -138,12 +138,12 @@ const submitForm = async () => {
// 新增 ====== begin ========
// 新增 ====== begin ========
/** 获取审批详情 */
/** 获取审批详情 */
const
getApprovalDetail
=
async
(
row
:
any
)
=>
{
const
getApprovalDetail
=
async
()
=>
{
try
{
try
{
const
data
=
await
ProcessInstanceApi
.
getApprovalDetail
({
const
data
=
await
ProcessInstanceApi
.
getApprovalDetail
({
processDefinitionId
:
row
.
id
,
processDefinitionId
:
processDefinitionId
.
value
,
activityId
:
NodeId
.
START_USER_NODE_ID
,
activityId
:
NodeId
.
START_USER_NODE_ID
,
processVariablesStr
:
row
.
processVariablesStr
// 解决 GET 无法传递对象的问题,后端 String 再转 JSON
processVariablesStr
:
JSON
.
stringify
({
day
:
daysDifference
()
})
// 解决 GET 无法传递对象的问题,后端 String 再转 JSON
})
})
if
(
!
data
)
{
if
(
!
data
)
{
...
@@ -178,6 +178,13 @@ const getApprovalDetail = async (row: any) => {
...
@@ -178,6 +178,13 @@ const getApprovalDetail = async (row: any) => {
const
selectUserConfirm
=
(
id
:
string
,
userList
:
any
[])
=>
{
const
selectUserConfirm
=
(
id
:
string
,
userList
:
any
[])
=>
{
startUserSelectAssignees
.
value
[
id
]
=
userList
?.
map
((
item
:
any
)
=>
item
.
id
)
startUserSelectAssignees
.
value
[
id
]
=
userList
?.
map
((
item
:
any
)
=>
item
.
id
)
}
}
// 计算天数差
const
daysDifference
=
()
=>
{
const
oneDay
=
24
*
60
*
60
*
1000
// 一天的毫秒数
const
diffTime
=
Math
.
abs
(
Number
(
formData
.
value
.
endTime
)
-
Number
(
formData
.
value
.
startTime
))
return
Math
.
floor
(
diffTime
/
oneDay
)
}
// 新增 ====== end ========
// 新增 ====== end ========
/** 初始化 */
/** 初始化 */
...
@@ -194,15 +201,12 @@ onMounted(async () => {
...
@@ -194,15 +201,12 @@ onMounted(async () => {
processDefinitionId
.
value
=
processDefinitionDetail
.
id
processDefinitionId
.
value
=
processDefinitionDetail
.
id
startUserSelectTasks
.
value
=
processDefinitionDetail
.
startUserSelectTasks
startUserSelectTasks
.
value
=
processDefinitionDetail
.
startUserSelectTasks
// 新增 ====== begin ========
// 新增 ====== begin ========
// 查询流程预测节点
// 加载最新的审批详情,主要用于节点预测
getApprovalDetail
({
getApprovalDetail
()
id
:
processDefinitionId
.
value
,
processVariablesStr
:
JSON
.
stringify
(
formData
.
value
)
})
// 新增 ====== end ========
// 新增 ====== end ========
})
})
// 新增 ====== begin ========
// 新增 ====== begin ========
/** 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次 */
/** 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次
, formData.value可改成实际业务中的特定字段
*/
watch
(
watch
(
formData
.
value
,
formData
.
value
,
(
newValue
,
oldValue
)
=>
{
(
newValue
,
oldValue
)
=>
{
...
@@ -213,11 +217,8 @@ watch(
...
@@ -213,11 +217,8 @@ watch(
// 记录之前的节点审批人
// 记录之前的节点审批人
tempStartUserSelectAssignees
.
value
=
startUserSelectAssignees
.
value
tempStartUserSelectAssignees
.
value
=
startUserSelectAssignees
.
value
startUserSelectAssignees
.
value
=
{}
startUserSelectAssignees
.
value
=
{}
// 加载最新的审批详情
// 加载最新的审批详情,主要用于节点预测
getApprovalDetail
({
getApprovalDetail
()
id
:
processDefinitionId
.
value
,
processVariablesStr
:
JSON
.
stringify
(
newValue
)
// 解决 GET 无法传递对象的问题,后端 String 再转 JSON
})
}
}
},
},
{
{
...
...
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