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
bc33acfa
authored
Feb 12, 2025
by
lizhixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:发布新版本流程时,校验是否存在进行中的单据
parent
c0396962
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
20 deletions
+7
-20
src/api/bpm/model/index.ts
+3
-3
src/views/bpm/model/CategoryDraggableModel.vue
+1
-4
src/views/bpm/model/form/index.vue
+3
-13
No files found.
src/api/bpm/model/index.ts
View file @
bc33acfa
...
...
@@ -78,11 +78,11 @@ export const cleanModel = async (id: number) => {
}
/**
* 查询当前流程实例下是否存在正在进行中的单据
* @param
processDefinitionId 流程
定义id
* @param
modelId 模型
定义id
* @returns true/false
*/
export
const
getProcessInstance
=
async
(
processDefinition
Id
:
string
)
=>
{
export
const
getProcessInstance
=
async
(
model
Id
:
string
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/task/manager-list?
processDefinitionId='
+
processDefinition
Id
url
:
'/bpm/task/manager-list?
modelId='
+
model
Id
})
}
src/views/bpm/model/CategoryDraggableModel.vue
View file @
bc33acfa
...
...
@@ -445,13 +445,10 @@ const handleChangeState = async (row: any) => {
/** 发布流程 */
const
handleDeploy
=
async
(
row
:
any
)
=>
{
try
{
// 发布的二次确认
await
message
.
confirm
(
'是否发布该流程!!'
)
//校验当前版本的流程下是否存在正在进行中的单据
const
res
=
await
ModelApi
.
getProcessInstance
(
row
.
id
)
if
(
res
)
{
message
.
error
(
'当前版本下存在正在进行中的单据,请先结束单据后再发布'
)
return
await
message
.
confirm
(
'流程下存在进行中的单据,是否确认发布该流程?'
)
}
// 发起部署
await
ModelApi
.
deployModel
(
row
.
id
)
...
...
src/views/bpm/model/form/index.vue
View file @
bc33acfa
...
...
@@ -179,8 +179,6 @@ const userList = ref<UserApi.UserVO[]>([])
/** 初始化数据 */
const
initData
=
async
()
=>
{
console
.
log
(
route
.
params
);
const
modelId
=
route
.
params
.
id
as
string
if
(
modelId
)
{
// 修改场景
...
...
@@ -297,7 +295,7 @@ const handleSave = async () => {
// 跳转到编辑页面
await
router
.
push
({
name
:
'BpmModelUpdate'
,
params
:
{
id
:
formData
.
value
.
id
}
params
:
{
id
:
formData
.
value
.
id
}
})
}
catch
{
// 先删除当前页签
...
...
@@ -314,21 +312,16 @@ const handleSave = async () => {
/** 发布操作 */
const
handleDeploy
=
async
()
=>
{
console
.
log
(
route
.
params
);
try
{
// 修改场景下直接发布,新增场景下需要先确认
if
(
!
formData
.
value
.
id
)
{
await
message
.
confirm
(
'是否确认发布该流程?'
)
}
//校验当前版本的流程下是否存在正在进行中的单据
const
res
=
await
ModelApi
.
getProcessInstance
(
formData
.
value
.
id
)
if
(
res
)
{
message
.
error
(
'当前版本下存在正在进行中的单据,请先结束单据后再发布'
)
return
await
message
.
confirm
(
'流程下存在进行中的单据,是否确认发布该流程?'
)
}
// 校验所有步骤
await
validateAllSteps
()
...
...
@@ -350,10 +343,7 @@ const handleDeploy = async () => {
message
.
success
(
'发布成功'
)
// 返回列表页
await
router
.
push
({
name
:
'BpmModel'
})
}
catch
(
error
:
any
)
{
console
.
error
(
'发布失败:'
,
error
)
message
.
warning
(
error
.
message
||
'发布失败'
)
}
}
catch
(
error
:
any
)
{}
}
/** 步骤切换处理 */
...
...
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