mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-09 08:52:41 +08:00
feat:发布前校验当前流程模型下是否存在正在审批中的单据信息
This commit is contained in:
parent
1b0fe23292
commit
c039696288
@ -159,7 +159,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openModelForm('update', scope.row.id, scope.row.processDefinition.id)"
|
@click="openModelForm('update', scope.row.id, scope.row.processDefinition?.id)"
|
||||||
v-if="hasPermiUpdate"
|
v-if="hasPermiUpdate"
|
||||||
:disabled="!isManagerUser(scope.row)"
|
:disabled="!isManagerUser(scope.row)"
|
||||||
>
|
>
|
||||||
@ -448,7 +448,7 @@ const handleDeploy = async (row: any) => {
|
|||||||
// 发布的二次确认
|
// 发布的二次确认
|
||||||
await message.confirm('是否发布该流程!!')
|
await message.confirm('是否发布该流程!!')
|
||||||
//校验当前版本的流程下是否存在正在进行中的单据
|
//校验当前版本的流程下是否存在正在进行中的单据
|
||||||
const res = await ModelApi.getProcessInstance(row.processDefinition.id)
|
const res = await ModelApi.getProcessInstance(row.id)
|
||||||
if (res) {
|
if (res) {
|
||||||
message.error('当前版本下存在正在进行中的单据,请先结束单据后再发布')
|
message.error('当前版本下存在正在进行中的单据,请先结束单据后再发布')
|
||||||
return
|
return
|
||||||
@ -593,14 +593,14 @@ const handleDeleteCategory = async () => {
|
|||||||
|
|
||||||
/** 添加流程模型弹窗 */
|
/** 添加流程模型弹窗 */
|
||||||
const tagsView = useTagsView()
|
const tagsView = useTagsView()
|
||||||
const openModelForm = async (type: string, id?: number, processDefinitionId?: string) => {
|
const openModelForm = async (type: string, id?: number, processDefinitionId?: any) => {
|
||||||
alert(processDefinitionId)
|
|
||||||
if (type === 'create') {
|
if (type === 'create') {
|
||||||
await push({ name: 'BpmModelCreate' })
|
await push({ name: 'BpmModelCreate' })
|
||||||
} else {
|
} else {
|
||||||
|
const params = processDefinitionId ? { id, type, processDefinitionId } : { id, type }
|
||||||
await push({
|
await push({
|
||||||
name: 'BpmModelUpdate',
|
name: 'BpmModelUpdate',
|
||||||
params: { id, type }
|
params: params
|
||||||
})
|
})
|
||||||
// 设置标题
|
// 设置标题
|
||||||
if (type === 'copy') {
|
if (type === 'copy') {
|
||||||
|
@ -179,6 +179,8 @@ const userList = ref<UserApi.UserVO[]>([])
|
|||||||
|
|
||||||
/** 初始化数据 */
|
/** 初始化数据 */
|
||||||
const initData = async () => {
|
const initData = async () => {
|
||||||
|
console.log(route.params);
|
||||||
|
|
||||||
const modelId = route.params.id as string
|
const modelId = route.params.id as string
|
||||||
if (modelId) {
|
if (modelId) {
|
||||||
// 修改场景
|
// 修改场景
|
||||||
@ -295,7 +297,7 @@ const handleSave = async () => {
|
|||||||
// 跳转到编辑页面
|
// 跳转到编辑页面
|
||||||
await router.push({
|
await router.push({
|
||||||
name: 'BpmModelUpdate',
|
name: 'BpmModelUpdate',
|
||||||
params: { id: formData.value.id, processDefinitionId: formData.value.processDefinitionId }
|
params: { id: formData.value.id}
|
||||||
})
|
})
|
||||||
} catch {
|
} catch {
|
||||||
// 先删除当前页签
|
// 先删除当前页签
|
||||||
@ -312,6 +314,8 @@ const handleSave = async () => {
|
|||||||
|
|
||||||
/** 发布操作 */
|
/** 发布操作 */
|
||||||
const handleDeploy = async () => {
|
const handleDeploy = async () => {
|
||||||
|
console.log(route.params);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 修改场景下直接发布,新增场景下需要先确认
|
// 修改场景下直接发布,新增场景下需要先确认
|
||||||
if (!formData.value.id) {
|
if (!formData.value.id) {
|
||||||
@ -319,7 +323,7 @@ const handleDeploy = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//校验当前版本的流程下是否存在正在进行中的单据
|
//校验当前版本的流程下是否存在正在进行中的单据
|
||||||
const res = await ModelApi.getProcessInstance(row.processDefinition.id)
|
const res = await ModelApi.getProcessInstance(formData.value.id)
|
||||||
if (res) {
|
if (res) {
|
||||||
message.error('当前版本下存在正在进行中的单据,请先结束单据后再发布')
|
message.error('当前版本下存在正在进行中的单据,请先结束单据后再发布')
|
||||||
return
|
return
|
||||||
@ -352,11 +356,6 @@ const handleDeploy = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateProcessInstance = async (processDefinitionId) => {
|
|
||||||
const valid = await ModelApi.getProcessInstance(processDefinitionId)
|
|
||||||
console.log(valid)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 步骤切换处理 */
|
/** 步骤切换处理 */
|
||||||
const handleStepClick = async (index: number) => {
|
const handleStepClick = async (index: number) => {
|
||||||
try {
|
try {
|
||||||
|
@ -58,7 +58,16 @@
|
|||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-image :src="definition.icon" class="w-32px h-32px" />
|
<el-image
|
||||||
|
v-if="definition.icon"
|
||||||
|
:src="definition.icon"
|
||||||
|
class="w-32px h-32px"
|
||||||
|
/>
|
||||||
|
<div v-else class="flow-icon">
|
||||||
|
<span style="font-size: 12px; color: #fff">{{
|
||||||
|
sliceName(definition.name)
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
<el-text class="!ml-10px" size="large">{{ definition.name }}</el-text>
|
<el-text class="!ml-10px" size="large">{{ definition.name }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -275,6 +284,14 @@ const availableCategories = computed(() => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 处理显示的名称
|
||||||
|
const sliceName = (name: string) => {
|
||||||
|
if (name.length > 2) {
|
||||||
|
return name.slice(0, 2)
|
||||||
|
}
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
@ -282,13 +299,25 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.flow-icon {
|
||||||
|
display: flex;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.process-definition-container::before {
|
.process-definition-container::before {
|
||||||
content: '';
|
|
||||||
border-left: 1px solid #e6e6e6;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20.8%;
|
left: 20.8%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border-left: 1px solid #e6e6e6;
|
||||||
|
content: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep() {
|
:deep() {
|
||||||
.definition-item-card {
|
.definition-item-card {
|
||||||
.el-card__body {
|
.el-card__body {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user