【功能修改】 新审批页面增加减签
parent
6b06f320b9
commit
842fe09e8b
|
@ -9,10 +9,10 @@ export enum TaskStatusEnum {
|
||||||
*/
|
*/
|
||||||
NOT_START = -1,
|
NOT_START = -1,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待审批
|
* 待审批
|
||||||
*/
|
*/
|
||||||
WAIT = 0,
|
WAIT = 0,
|
||||||
/**
|
/**
|
||||||
* 审批中
|
* 审批中
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +26,7 @@ export enum TaskStatusEnum {
|
||||||
* 审批不通过
|
* 审批不通过
|
||||||
*/
|
*/
|
||||||
REJECT = 3,
|
REJECT = 3,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已取消
|
* 已取消
|
||||||
*/
|
*/
|
||||||
|
@ -42,8 +42,7 @@ export enum TaskStatusEnum {
|
||||||
/**
|
/**
|
||||||
* 审批通过中
|
* 审批通过中
|
||||||
*/
|
*/
|
||||||
APPROVING = 7,
|
APPROVING = 7
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TaskVO = {
|
export type TaskVO = {
|
||||||
|
@ -111,6 +110,11 @@ export const copyTask = async (data: any) => {
|
||||||
return await request.put({ url: '/bpm/task/copy', data })
|
return await request.put({ url: '/bpm/task/copy', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取我的待办任务
|
||||||
|
export const myTodoTask = async (processInstanceId: string) => {
|
||||||
|
return await request.get({ url: '/bpm/task/my-todo?processInstanceId=' + processInstanceId })
|
||||||
|
}
|
||||||
|
|
||||||
// 获取减签任务列表
|
// 获取减签任务列表
|
||||||
export const getChildrenTaskList = async (id: string) => {
|
export const getChildrenTaskList = async (id: string) => {
|
||||||
return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id })
|
return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id })
|
||||||
|
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.7 KiB |
|
@ -292,8 +292,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'process-instance/detail',
|
path: 'process-instance/detail',
|
||||||
// component: () => import('@/views/bpm/processInstance/detail/index_new.vue'),
|
component: () => import('@/views/bpm/processInstance/detail/index_new.vue'),
|
||||||
component: () => import('@/views/bpm/processInstance/detail/index.vue'),
|
//component: () => import('@/views/bpm/processInstance/detail/index.vue'),
|
||||||
name: 'BpmProcessInstanceDetail',
|
name: 'BpmProcessInstanceDetail',
|
||||||
meta: {
|
meta: {
|
||||||
noCache: true,
|
noCache: true,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="h-50px bottom-10 text-14px flex items-center color-#32373c dark:color-#fff font-bold btn-container"
|
class="h-50px bottom-10 text-14px flex items-center color-#32373c dark:color-#fff font-bold btn-container"
|
||||||
v-if="runningTask.id"
|
v-if="runningTask && runningTask.id"
|
||||||
>
|
>
|
||||||
<!-- 【通过】按钮 -->
|
<!-- 【通过】按钮 -->
|
||||||
<el-popover
|
<el-popover
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
placement="top-end"
|
placement="top-end"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.APPROVE)"
|
v-if=" isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button plain type="success" @click="openPopover('approve')">
|
<el-button plain type="success" @click="openPopover('approve')">
|
||||||
|
@ -38,7 +38,12 @@
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-form-item label="审批意见" prop="reason">
|
<el-form-item label="审批意见" prop="reason">
|
||||||
<el-input v-model="genericForm.reason" placeholder="请输入审批意见" type="textarea" :rows="4" />
|
<el-input
|
||||||
|
v-model="genericForm.reason"
|
||||||
|
placeholder="请输入审批意见"
|
||||||
|
type="textarea"
|
||||||
|
:rows="4"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="success" @click="handleAudit(true)">
|
<el-button :disabled="formLoading" type="success" @click="handleAudit(true)">
|
||||||
|
@ -56,7 +61,7 @@
|
||||||
placement="top-end"
|
placement="top-end"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.REJECT)"
|
v-if=" isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button class="mr-20px" plain type="danger" @click="openPopover('reject')">
|
<el-button class="mr-20px" plain type="danger" @click="openPopover('reject')">
|
||||||
|
@ -85,7 +90,12 @@
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-form-item label="审批意见" prop="reason">
|
<el-form-item label="审批意见" prop="reason">
|
||||||
<el-input v-model="genericForm.reason" placeholder="请输入审批意见" type="textarea" :rows="4" />
|
<el-input
|
||||||
|
v-model="genericForm.reason"
|
||||||
|
placeholder="请输入审批意见"
|
||||||
|
type="textarea"
|
||||||
|
:rows="4"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="danger" @click="handleAudit(false)">
|
<el-button :disabled="formLoading" type="danger" @click="handleAudit(false)">
|
||||||
|
@ -103,10 +113,10 @@
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.COPY)"
|
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.COPY)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div @click="openPopover('copy')" class="hover-bg-gray-100 rounded-xl p-6px" >
|
<div @click="openPopover('copy')" class="hover-bg-gray-100 rounded-xl p-6px">
|
||||||
<Icon :size="14" icon="svg-icon:send" />
|
<Icon :size="14" icon="svg-icon:send" />
|
||||||
{{ getButtonDisplayName(OperationButtonType.COPY) }}
|
{{ getButtonDisplayName(OperationButtonType.COPY) }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -120,9 +130,14 @@
|
||||||
:rules="genericRule"
|
:rules="genericRule"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-form-item label="抄送人" prop="copyUserIds">
|
<el-form-item label="抄送人" prop="copyUserIds">
|
||||||
<el-select v-model="genericForm.copyUserIds" clearable style="width: 100%" multiple placeholder="请选择抄送人">
|
<el-select
|
||||||
|
v-model="genericForm.copyUserIds"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
multiple
|
||||||
|
placeholder="请选择抄送人"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in userOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
@ -132,7 +147,13 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="抄送意见" prop="copyReason">
|
<el-form-item label="抄送意见" prop="copyReason">
|
||||||
<el-input v-model="genericForm.copyReason" clearable placeholder="请输入抄送意见" type="textarea" :rows="3" />
|
<el-input
|
||||||
|
v-model="genericForm.copyReason"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入抄送意见"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
@ -151,10 +172,10 @@
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.TRANSFER)"
|
v-if=" isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div @click="openPopover('transfer')" class="hover-bg-gray-100 rounded-xl p-6px" >
|
<div @click="openPopover('transfer')" class="hover-bg-gray-100 rounded-xl p-6px">
|
||||||
<Icon :size="14" icon="fa:share-square-o" />
|
<Icon :size="14" icon="fa:share-square-o" />
|
||||||
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
|
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -168,7 +189,6 @@
|
||||||
:rules="genericRule"
|
:rules="genericRule"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-form-item label="新审批人" prop="assigneeUserId">
|
<el-form-item label="新审批人" prop="assigneeUserId">
|
||||||
<el-select v-model="genericForm.assigneeUserId" clearable style="width: 100%">
|
<el-select v-model="genericForm.assigneeUserId" clearable style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -180,12 +200,17 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="审批意见" prop="reason">
|
<el-form-item label="审批意见" prop="reason">
|
||||||
<el-input v-model="genericForm.reason" clearable placeholder="请输入审批意见" type="textarea" :rows="3" />
|
<el-input
|
||||||
|
v-model="genericForm.reason"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入审批意见"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handleTransfer()">
|
<el-button :disabled="formLoading" type="primary" @click="handleTransfer()">
|
||||||
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
|
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="popOverVisible.transfer = false"> 取消 </el-button>
|
<el-button @click="popOverVisible.transfer = false"> 取消 </el-button>
|
||||||
|
@ -193,22 +218,22 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
<!-- 【委派】按钮 -->
|
<!-- 【委派】按钮 -->
|
||||||
<el-popover
|
<el-popover
|
||||||
:visible="popOverVisible.delegate"
|
:visible="popOverVisible.delegate"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.DELEGATE)"
|
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.DELEGATE)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div @click="openPopover('delegate')" class="hover-bg-gray-100 rounded-xl p-6px" >
|
<div @click="openPopover('delegate')" class="hover-bg-gray-100 rounded-xl p-6px">
|
||||||
<Icon :size="14" icon="ep:position" />
|
<Icon :size="14" icon="ep:position" />
|
||||||
{{ getButtonDisplayName(OperationButtonType.DELEGATE) }}
|
{{ getButtonDisplayName(OperationButtonType.DELEGATE) }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="flex flex-col flex-1 pt-20px px-20px" v-loading="formLoading">
|
<div class="flex flex-col flex-1 pt-20px px-20px" v-loading="formLoading">
|
||||||
<el-form
|
<el-form
|
||||||
label-position="top"
|
label-position="top"
|
||||||
|
@ -228,9 +253,15 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="审批意见" prop="reason">
|
<el-form-item label="审批意见" prop="reason">
|
||||||
<el-input v-model="genericForm.reason" clearable placeholder="请输入审批意见" type="textarea" :rows="3" />
|
<el-input
|
||||||
|
v-model="genericForm.reason"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入审批意见"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
@ -241,7 +272,6 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
<!-- 【加签】按钮 当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
<!-- 【加签】按钮 当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
||||||
|
@ -250,10 +280,10 @@
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.ADD_SIGN)"
|
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.ADD_SIGN)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div @click="openPopover('addSign')" class="hover-bg-gray-100 rounded-xl p-6px" >
|
<div @click="openPopover('addSign')" class="hover-bg-gray-100 rounded-xl p-6px">
|
||||||
<Icon :size="14" icon="ep:plus" />
|
<Icon :size="14" icon="ep:plus" />
|
||||||
{{ getButtonDisplayName(OperationButtonType.ADD_SIGN) }}
|
{{ getButtonDisplayName(OperationButtonType.ADD_SIGN) }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -278,9 +308,15 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="审批意见" prop="reason">
|
<el-form-item label="审批意见" prop="reason">
|
||||||
<el-input v-model="genericForm.reason" clearable placeholder="请输入审批意见" type="textarea" :rows="3" />
|
<el-input
|
||||||
|
v-model="genericForm.reason"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入审批意见"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handlerAddSign('before')">
|
<el-button :disabled="formLoading" type="primary" @click="handlerAddSign('before')">
|
||||||
|
@ -295,17 +331,25 @@
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
<!-- TODO @jason:减签 -->
|
<!-- 【减签】按钮 -->
|
||||||
|
<div
|
||||||
|
@click="openChildrenTask()"
|
||||||
|
class="hover-bg-gray-100 rounded-xl p-6px"
|
||||||
|
v-if="runningTask.children"
|
||||||
|
>
|
||||||
|
<Icon :size="14" icon="ep:semi-select" /> 减签
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 【退回】按钮 -->
|
<!-- 【退回】按钮 -->
|
||||||
<el-popover
|
<el-popover
|
||||||
:visible="popOverVisible.return"
|
:visible="popOverVisible.return"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:width="420"
|
:width="420"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="isShowButton(OperationButtonType.RETURN)"
|
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.RETURN)"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div @click="openReturnPopover" class="hover-bg-gray-100 rounded-xl p-6px" >
|
<div @click="openReturnPopover" class="hover-bg-gray-100 rounded-xl p-6px">
|
||||||
<Icon :size="14" icon="fa:mail-reply" />
|
<Icon :size="14" icon="fa:mail-reply" />
|
||||||
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
|
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -320,20 +364,26 @@
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
<el-form-item label="退回节点" prop="targetTaskDefinitionKey">
|
<el-form-item label="退回节点" prop="targetTaskDefinitionKey">
|
||||||
<el-select v-model="genericForm.targetTaskDefinitionKey" clearable style="width: 100%">
|
<el-select v-model="genericForm.targetTaskDefinitionKey" clearable style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in returnList"
|
v-for="item in returnList"
|
||||||
:key="item.taskDefinitionKey"
|
:key="item.taskDefinitionKey"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.taskDefinitionKey"
|
:value="item.taskDefinitionKey"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="退回理由" prop="returnReason">
|
<el-form-item label="退回理由" prop="returnReason">
|
||||||
<el-input v-model="genericForm.returnReason" clearable placeholder="请输入退回理由" type="textarea" :rows="3" />
|
<el-input
|
||||||
|
v-model="genericForm.returnReason"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入退回理由"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handleReturn()">
|
<el-button :disabled="formLoading" type="primary" @click="handleReturn()">
|
||||||
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
|
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="popOverVisible.return = false"> 取消 </el-button>
|
<el-button @click="popOverVisible.return = false"> 取消 </el-button>
|
||||||
|
@ -341,29 +391,29 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
|
<!-- 弹窗:子任务 -->
|
||||||
|
<TaskSignList ref="taskSignListRef" @success="reload" />
|
||||||
<!--TODO @jason:撤回 -->
|
<!--TODO @jason:撤回 -->
|
||||||
<!--TODO @jason:再次发起 -->
|
<!--TODO @jason:再次发起 -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import TaskSignList from './dialog/TaskSignList.vue'
|
||||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
import { setConfAndFields2 } from '@/utils/formCreate'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
|
||||||
import * as TaskApi from '@/api/bpm/task'
|
import * as TaskApi from '@/api/bpm/task'
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
import { isEmpty } from '@/utils/is'
|
|
||||||
import {
|
import {
|
||||||
OperationButtonType,
|
OperationButtonType,
|
||||||
OPERATION_BUTTON_NAME
|
OPERATION_BUTTON_NAME
|
||||||
} from '@/components/SimpleProcessDesignerV2/src/consts'
|
} from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||||
defineOptions({ name: 'ProcessInstanceBtnConatiner' })
|
defineOptions({ name: 'ProcessInstanceBtnConatiner' })
|
||||||
|
|
||||||
const userId = useUserStore().getUser.id // 当前登录的编号
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { proxy } = getCurrentInstance() as any
|
const { proxy } = getCurrentInstance() as any
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
defineProps({
|
const props = defineProps({
|
||||||
processInstance: propTypes.any, // 流程实例信息
|
processInstanceId: propTypes.string, // 流程实例信息
|
||||||
userOptions: propTypes.any
|
userOptions: propTypes.any
|
||||||
})
|
})
|
||||||
const formLoading = ref(false) // 表单加载中
|
const formLoading = ref(false) // 表单加载中
|
||||||
|
@ -374,7 +424,7 @@ const popOverVisible = ref({
|
||||||
transfer: false,
|
transfer: false,
|
||||||
delegate: false,
|
delegate: false,
|
||||||
addSign: false,
|
addSign: false,
|
||||||
return : false,
|
return: false,
|
||||||
copy: false
|
copy: false
|
||||||
})
|
})
|
||||||
/** 退回节点 */
|
/** 退回节点 */
|
||||||
|
@ -390,7 +440,7 @@ const genericRule = reactive({
|
||||||
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
||||||
returnReason: [{ required: true, message: '退回理由不能为空', trigger: 'blur' }],
|
returnReason: [{ required: true, message: '退回理由不能为空', trigger: 'blur' }],
|
||||||
copyUserIds: [{ required: true, message: '抄送人不能为空', trigger: 'change' }],
|
copyUserIds: [{ required: true, message: '抄送人不能为空', trigger: 'change' }],
|
||||||
assigneeUserId:[{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
||||||
delegateUserId: [{ required: true, message: '接收人不能为空', trigger: 'change' }],
|
delegateUserId: [{ required: true, message: '接收人不能为空', trigger: 'change' }],
|
||||||
addSignUserIds: [{ required: true, message: '加签处理人不能为空', trigger: 'change' }]
|
addSignUserIds: [{ required: true, message: '加签处理人不能为空', trigger: 'change' }]
|
||||||
})
|
})
|
||||||
|
@ -407,43 +457,25 @@ watch(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO @jaosn:具体的审批任务,要不改成后端返回。让前端弱化下
|
/** 弹出退回气泡卡 */
|
||||||
/**
|
const openReturnPopover = async () => {
|
||||||
* 设置 runningTasks 中的任务
|
returnList.value = await TaskApi.getTaskListByReturn(runningTask.value.id)
|
||||||
*/
|
if (returnList.value.length === 0) {
|
||||||
const loadRunningTask = (tasks: any[]) => {
|
message.warning('当前没有可退回的节点')
|
||||||
runningTask.value = {}
|
return
|
||||||
genericForm.value = {}
|
}
|
||||||
approveForm.value = {}
|
openPopover('return')
|
||||||
approveFormFApi.value = {}
|
}
|
||||||
tasks.forEach((task: any) => {
|
/** 弹出气泡卡 */
|
||||||
if (!isEmpty(task.children)) {
|
const openPopover = (type: string) => {
|
||||||
loadRunningTask(task.children)
|
Object.keys(popOverVisible.value).forEach((item) => {
|
||||||
}
|
if (item === type) {
|
||||||
// 2.1 只有待处理才需要
|
popOverVisible.value[item] = true
|
||||||
if (task.status !== 1 && task.status !== 6) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 2.2 自己不是处理人
|
|
||||||
if (!task.assigneeUser || task.assigneeUser.id !== userId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 2.3 添加到处理任务
|
|
||||||
runningTask.value = { ...task }
|
|
||||||
genericForm.value = {
|
|
||||||
reason: '',
|
|
||||||
copyUserIds: []
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2.4 处理 approve 表单
|
|
||||||
if (task.formId && task.formConf) {
|
|
||||||
const tempApproveForm = {}
|
|
||||||
setConfAndFields2(tempApproveForm, task.formConf, task.formFields, task.formVariables)
|
|
||||||
approveForm.value = tempApproveForm
|
|
||||||
} else {
|
} else {
|
||||||
approveForm.value = {} // 占位,避免为空
|
popOverVisible.value[item] = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
formRef.value.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理审批通过和不通过的操作 */
|
/** 处理审批通过和不通过的操作 */
|
||||||
|
@ -479,7 +511,7 @@ const handleAudit = async (pass: boolean) => {
|
||||||
message.success('审批不通过成功')
|
message.success('审批不通过成功')
|
||||||
}
|
}
|
||||||
// 2.2 加载最新数据
|
// 2.2 加载最新数据
|
||||||
getDetail()
|
reload()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
@ -511,7 +543,6 @@ const handleCopy = async () => {
|
||||||
|
|
||||||
/** 处理转交 */
|
/** 处理转交 */
|
||||||
const handleTransfer = async () => {
|
const handleTransfer = async () => {
|
||||||
|
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const transferFormRef = proxy.$refs['formRef']
|
const transferFormRef = proxy.$refs['formRef']
|
||||||
|
@ -526,12 +557,12 @@ const handleTransfer = async () => {
|
||||||
reason: genericForm.value.reason,
|
reason: genericForm.value.reason,
|
||||||
assigneeUserId: genericForm.value.assigneeUserId
|
assigneeUserId: genericForm.value.assigneeUserId
|
||||||
}
|
}
|
||||||
|
|
||||||
await TaskApi.transferTask(data)
|
await TaskApi.transferTask(data)
|
||||||
popOverVisible.value.transfer = false
|
popOverVisible.value.transfer = false
|
||||||
message.success('操作成功')
|
message.success('操作成功')
|
||||||
// 2. 加载最新数据
|
// 2. 加载最新数据
|
||||||
getDetail()
|
reload()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
@ -539,30 +570,30 @@ const handleTransfer = async () => {
|
||||||
|
|
||||||
/** 处理委派 */
|
/** 处理委派 */
|
||||||
const handleDelegate = async () => {
|
const handleDelegate = async () => {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const deletegateFormRef = proxy.$refs['formRef']
|
const deletegateFormRef = proxy.$refs['formRef']
|
||||||
// 1.1 校验表单
|
// 1.1 校验表单
|
||||||
const elForm = unref(deletegateFormRef)
|
const elForm = unref(deletegateFormRef)
|
||||||
if (!elForm) return
|
if (!elForm) return
|
||||||
const valid = await elForm.validate()
|
const valid = await elForm.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// 1.2 处理委派
|
// 1.2 处理委派
|
||||||
const data = {
|
const data = {
|
||||||
id: runningTask.value.id,
|
id: runningTask.value.id,
|
||||||
reason: genericForm.value.reason,
|
reason: genericForm.value.reason,
|
||||||
delegateUserId: genericForm.value.delegateUserId
|
delegateUserId: genericForm.value.delegateUserId
|
||||||
}
|
}
|
||||||
|
|
||||||
await TaskApi.delegateTask(data)
|
await TaskApi.delegateTask(data)
|
||||||
popOverVisible.value.delegate = false
|
popOverVisible.value.delegate = false
|
||||||
message.success('操作成功')
|
message.success('操作成功')
|
||||||
// 2. 加载最新数据
|
// 2. 加载最新数据
|
||||||
getDetail()
|
reload()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理加签 */
|
/** 处理加签 */
|
||||||
const handlerAddSign = async (type: string) => {
|
const handlerAddSign = async (type: string) => {
|
||||||
|
@ -585,7 +616,7 @@ const handlerAddSign = async (type: string) => {
|
||||||
message.success('操作成功')
|
message.success('操作成功')
|
||||||
popOverVisible.value.addSign = false
|
popOverVisible.value.addSign = false
|
||||||
// 2 加载最新数据
|
// 2 加载最新数据
|
||||||
getDetail()
|
reload()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
@ -607,43 +638,41 @@ const handleReturn = async () => {
|
||||||
reason: genericForm.value.returnReason,
|
reason: genericForm.value.returnReason,
|
||||||
targetTaskDefinitionKey: genericForm.value.targetTaskDefinitionKey
|
targetTaskDefinitionKey: genericForm.value.targetTaskDefinitionKey
|
||||||
}
|
}
|
||||||
|
|
||||||
await TaskApi.returnTask(data)
|
await TaskApi.returnTask(data)
|
||||||
popOverVisible.value.return = false
|
popOverVisible.value.return = false
|
||||||
message.success('操作成功')
|
message.success('操作成功')
|
||||||
// 2 加载最新数据
|
// 2 重新加载数据
|
||||||
getDetail()
|
reload()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 弹出退回气泡卡 */
|
/** 子任务 */
|
||||||
const openReturnPopover = async () => {
|
const taskSignListRef = ref()
|
||||||
returnList.value = await TaskApi.getTaskListByReturn(runningTask.value.id)
|
const openChildrenTask = () => {
|
||||||
if (returnList.value.length === 0) {
|
taskSignListRef.value.open(runningTask.value)
|
||||||
message.warning('当前没有可退回的节点')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
openPopover('return')
|
|
||||||
}
|
|
||||||
/** 弹出气泡卡 */
|
|
||||||
const openPopover = (type: string ) => {
|
|
||||||
Object.keys(popOverVisible.value).forEach( item => {
|
|
||||||
if( item === type) {
|
|
||||||
popOverVisible.value[item] = true
|
|
||||||
} else {
|
|
||||||
popOverVisible.value[item] = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
formRef.value.resetFields()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得详情 */
|
/** 重新加载数据 */
|
||||||
const getDetail = () => {
|
const reload = () => {
|
||||||
|
getMyTodoTask()
|
||||||
emit('success')
|
emit('success')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 任务是否为处理中状态 */
|
||||||
|
const isHandleTaskStatus = () => {
|
||||||
|
let canHandle = false
|
||||||
|
if (
|
||||||
|
TaskApi.TaskStatusEnum.RUNNING === runningTask.value.status ||
|
||||||
|
TaskApi.TaskStatusEnum.DELEGATE === runningTask.value.status
|
||||||
|
) {
|
||||||
|
canHandle = true
|
||||||
|
}
|
||||||
|
return canHandle
|
||||||
|
}
|
||||||
|
|
||||||
/** 是否显示按钮 */
|
/** 是否显示按钮 */
|
||||||
const isShowButton = (btnType: OperationButtonType): boolean => {
|
const isShowButton = (btnType: OperationButtonType): boolean => {
|
||||||
let isShow = true
|
let isShow = true
|
||||||
|
@ -662,7 +691,26 @@ const getButtonDisplayName = (btnType: OperationButtonType) => {
|
||||||
return displayName
|
return displayName
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ loadRunningTask })
|
/** 获取我的待办任务 */
|
||||||
|
const getMyTodoTask = async () => {
|
||||||
|
genericForm.value = {}
|
||||||
|
approveForm.value = {}
|
||||||
|
approveFormFApi.value = {}
|
||||||
|
const data = await TaskApi.myTodoTask(props.processInstanceId)
|
||||||
|
runningTask.value = data
|
||||||
|
// 处理 approve 表单.
|
||||||
|
if (data && data.formId && data.formConf) {
|
||||||
|
const tempApproveForm = {}
|
||||||
|
setConfAndFields2(tempApproveForm, data.formConf, data.formFields, data.formVariables)
|
||||||
|
approveForm.value = tempApproveForm
|
||||||
|
} else {
|
||||||
|
approveForm.value = {} // 占位,避免为空
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getMyTodoTask()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<el-drawer v-model="drawerVisible" title="子任务" size="880px">
|
<el-drawer v-model="drawerVisible" title="子任务" size="880px">
|
||||||
<!-- 当前任务 -->
|
<!-- 当前任务 -->
|
||||||
<template #header>
|
<template #header>
|
||||||
<h4>【{{ parentTask.name }} 】审批人:{{ parentTask?.assigneeUser?.nickname }}</h4>
|
<h4>【{{ parentTask.name }} 】审批人:{{ parentTask?.ownerUser?.nickname }}</h4>
|
||||||
<el-button
|
<el-button
|
||||||
style="margin-left: 5px"
|
style="margin-left: 5px"
|
||||||
v-if="isSignDeleteButtonVisible(parentTask)"
|
v-if="isSignDeleteButtonVisible(parentTask)"
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<div class="text-#878c93"> {{ formatDate(processInstance.startTime) }} 提交 </div>
|
<div class="text-#878c93"> {{ formatDate(processInstance.startTime) }} 提交 </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-tabs v-model="activeTab" @tab-change="onTabChange">
|
<el-tabs v-model="activeTab">
|
||||||
<!-- 表单信息 -->
|
<!-- 表单信息 -->
|
||||||
<el-tab-pane label="审批详情" name="form">
|
<el-tab-pane label="审批详情" name="form">
|
||||||
<div class="form-scroll-area">
|
<div class="form-scroll-area">
|
||||||
|
@ -104,8 +104,7 @@
|
||||||
<div class="b-t-solid border-t-1px border-[var(--el-border-color)]">
|
<div class="b-t-solid border-t-1px border-[var(--el-border-color)]">
|
||||||
<!-- 操作栏按钮 -->
|
<!-- 操作栏按钮 -->
|
||||||
<ProcessInstanceOperationButton
|
<ProcessInstanceOperationButton
|
||||||
ref="operationButtonRef"
|
:process-instance-id="id"
|
||||||
:processInstance="processInstance"
|
|
||||||
:userOptions="userOptions"
|
:userOptions="userOptions"
|
||||||
@success="refresh"
|
@success="refresh"
|
||||||
/>
|
/>
|
||||||
|
@ -119,7 +118,6 @@ import { formatDate } from '@/utils/formatTime'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
import { setConfAndFields2 } from '@/utils/formCreate'
|
||||||
import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
||||||
import * as DefinitionApi from '@/api/bpm/definition'
|
|
||||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||||
import * as TaskApi from '@/api/bpm/task'
|
import * as TaskApi from '@/api/bpm/task'
|
||||||
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
|
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
|
||||||
|
@ -132,6 +130,7 @@ import { FieldPermissionType } from '@/components/SimpleProcessDesignerV2/src/co
|
||||||
import audit1 from '@/assets/svgs/bpm/audit1.svg'
|
import audit1 from '@/assets/svgs/bpm/audit1.svg'
|
||||||
import audit2 from '@/assets/svgs/bpm/audit2.svg'
|
import audit2 from '@/assets/svgs/bpm/audit2.svg'
|
||||||
import audit3 from '@/assets/svgs/bpm/audit3.svg'
|
import audit3 from '@/assets/svgs/bpm/audit3.svg'
|
||||||
|
import audit4 from '@/assets/svgs/bpm/audit4.svg'
|
||||||
|
|
||||||
defineOptions({ name: 'BpmProcessInstanceDetail' })
|
defineOptions({ name: 'BpmProcessInstanceDetail' })
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -142,16 +141,14 @@ const props = defineProps<{
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const processInstanceLoading = ref(false) // 流程实例的加载中
|
const processInstanceLoading = ref(false) // 流程实例的加载中
|
||||||
const processInstance = ref<any>({}) // 流程实例
|
const processInstance = ref<any>({}) // 流程实例
|
||||||
let processDefinitionId = undefined // 流程定义 Id
|
|
||||||
const operationButtonRef = ref()
|
|
||||||
const timelineRef = ref()
|
const timelineRef = ref()
|
||||||
const bpmnXml = ref('') // BPMN XML
|
|
||||||
const tasksLoad = ref(true) // 任务的加载中
|
const tasksLoad = ref(true) // 任务的加载中
|
||||||
const tasks = ref<any[]>([]) // 任务列表
|
const tasks = ref<any[]>([]) // 任务列表
|
||||||
const auditIcons = {
|
const auditIcons = {
|
||||||
1: audit1,
|
1: audit1,
|
||||||
2: audit2,
|
2: audit2,
|
||||||
3: audit3
|
3: audit3,
|
||||||
|
4: audit4
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 申请信息 ==========
|
// ========== 申请信息 ==========
|
||||||
|
@ -220,9 +217,6 @@ const getProcessInstance = async () => {
|
||||||
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
||||||
BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
|
BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
|
||||||
}
|
}
|
||||||
processDefinitionId = processDefinition.id
|
|
||||||
// 加载流程图
|
|
||||||
// bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinition.id))?.bpmnXml
|
|
||||||
} finally {
|
} finally {
|
||||||
processInstanceLoading.value = false
|
processInstanceLoading.value = false
|
||||||
}
|
}
|
||||||
|
@ -272,7 +266,7 @@ const getTaskList = async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获得需要自己审批的任务
|
// 获得需要自己审批的任务
|
||||||
operationButtonRef.value?.loadRunningTask(tasks.value)
|
//operationButtonRef.value?.loadRunningTask(tasks.value)
|
||||||
} finally {
|
} finally {
|
||||||
tasksLoad.value = false
|
tasksLoad.value = false
|
||||||
}
|
}
|
||||||
|
@ -291,13 +285,6 @@ const refresh = () => {
|
||||||
/** 当前的Tab */
|
/** 当前的Tab */
|
||||||
const activeTab = ref('form')
|
const activeTab = ref('form')
|
||||||
|
|
||||||
/** Tab 切换 加载流程图,直接加载显示不出来,不知道啥原因,所以切换以后在加载 */
|
|
||||||
const onTabChange = async (tabName: string) => {
|
|
||||||
if (tabName === 'diagram' && processDefinitionId && !bpmnXml.value) {
|
|
||||||
//加载流程图
|
|
||||||
bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinitionId))?.bpmnXml
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
Loading…
Reference in New Issue