feat:发布新版本流程时,校验是否存在进行中的单据

This commit is contained in:
lizhixian 2025-02-12 09:45:29 +08:00
parent c039696288
commit bc33acfad4
3 changed files with 7 additions and 20 deletions

View File

@ -78,11 +78,11 @@ export const cleanModel = async (id: number) => {
}
/**
*
* @param processDefinitionId id
* @param modelId id
* @returns true/false
*/
export const getProcessInstance = async (processDefinitionId: string) => {
export const getProcessInstance = async (modelId: string) => {
return await request.get({
url: '/bpm/task/manager-list?processDefinitionId=' + processDefinitionId
url: '/bpm/task/manager-list?modelId=' + modelId
})
}

View File

@ -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)

View File

@ -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) {}
}
/** 步骤切换处理 */