【功能修改】 新审批页面增加减签
This commit is contained in:
1 parent
6b06f320b9
commit
842fe09e8b
6 files changed
+203
-163
No files matched your search
@@ -9,10 +9,10 @@ export enum TaskStatusEnum {
|
||||
*/
|
||||
NOT_START = -1,
|
||||
|
||||
/**
|
||||
/**
|
||||
* 待审批
|
||||
*/
|
||||
WAIT = 0,
|
||||
WAIT = 0,
|
||||
/**
|
||||
* 审批中
|
||||
*/
|
||||
@@ -26,7 +26,7 @@ export enum TaskStatusEnum {
|
||||
* 审批不通过
|
||||
*/
|
||||
REJECT = 3,
|
||||
|
||||
|
||||
/**
|
||||
* 已取消
|
||||
*/
|
||||
@@ -42,8 +42,7 @@ export enum TaskStatusEnum {
|
||||
/**
|
||||
* 审批通过中
|
||||
*/
|
||||
APPROVING = 7,
|
||||
|
||||
APPROVING = 7
|
||||
}
|
||||
|
||||
export type TaskVO = {
|
||||
@@ -111,6 +110,11 @@ export const copyTask = async (data: any) => {
|
||||
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) => {
|
||||
return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id })
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg t="1728812935276" class="icon" viewBox="0 0 1167 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4361" width="200" height="200"><path d="M1159.10034 346.809949l-177.334385-280.171946a52.524561 52.524561 0 0 0-72.305741-16.279543L24.344573 611.35763a52.626948 52.626948 0 0 0-16.30002 72.305741L185.399416 963.876272a52.504083 52.504083 0 0 0 72.244308 16.21811l885.156596-560.958215a52.422174 52.422174 0 0 0 16.30002-72.326218z m-35.323535 42.203945L238.640686 950.054019a16.627658 16.627658 0 0 1-23.016611-5.180785L38.310168 664.660333a16.730045 16.730045 0 0 1 5.180785-23.078043L928.668027 80.562642a16.607181 16.607181 0 0 1 22.975655 5.22174l177.416295 280.212902a16.996252 16.996252 0 0 1-5.283172 23.01661z m-763.008836-177.784888l14.682304 35.303058 19.043993-33.132452 38.047031-3.071612-25.617242-28.422647 8.723377-37.146025-34.770645 15.644743-32.681949-19.801658 4.136438 38.067509-28.975538 24.736713 37.412231 7.822371zM586.121884 106.077497l-18.265851-33.62391-15.5014 35.016374-37.596528 7.167094 28.381692 25.514855-4.894101 37.924167 33.111975-19.187335 34.545393 16.422884-7.98619-37.473663 26.211086-27.787848-38.006076-3.972618z m343.610968 563.29264l-30.245137-23.303294-0.143342 38.190372-31.596646 21.460328 36.38836 12.040718 10.730164 36.654567 22.566108-30.85946 38.190372 1.085303-22.422765-31.043756 12.921246-35.83547-36.38836 11.610692z m-123.49927 152.270033l-14.416098-35.425922-19.351154 33.030065-38.026553 2.764451 25.39199 28.545512-9.030538 37.105069 34.975419-15.296626 32.538607 20.25216-3.849753-38.087986 28.975537-24.716235-37.207457-8.170488z m-226.234444 103.574748l18.102032 33.767252 15.808562-34.913987 37.596528-6.757545-28.217873-25.781062 5.180785-37.883211-33.255317 18.839218-34.361097-16.648135 7.658552 37.391753-26.57968 27.685461 38.067508 4.300256z m-338.901163-565.954703l30.081318 23.671888 0.430026-38.231328 31.739988-21.35794-36.183587-12.286447-10.443479-36.818386-22.852792 30.654685-38.190373-1.392464 22.115605 31.187098-13.166976 35.937858 36.449793-11.364964z m-134.372775 165.047938C102.711627 362.454691 181.242501 202.444197 327.61504 109.722477 473.987578 17.000757 651.915808 14.379648 796.465857 87.033505L831.400321 64.9179A508.106015 508.106015 0 0 0 694.119753 12.536681a510.133279 510.133279 0 0 0-195.927874-5.651766 506.611164 506.611164 0 0 0-189.620832 72.612902 509.355138 509.355138 0 0 0-146.659222 140.638863 509.989937 509.989937 0 0 0-78.858513 179.627855 508.679383 508.679383 0 0 0-11.344486 146.618268l35.016374-22.095127z m950.520494-24.757191c4.156915 161.832984-74.394437 321.823002-220.72602 414.524244-146.331584 92.844584-324.321246 95.404261-468.83034 22.729927l-34.975419 22.177037a510.338053 510.338053 0 0 0 137.301045 52.319787 508.658906 508.658906 0 0 0 195.907398 5.672243 506.201616 506.201616 0 0 0 189.620832-72.592424A510.235666 510.235666 0 0 0 1080.876627 624.156012c10.91446-48.531466 14.702782-97.718208 11.324009-146.700177l-34.975419 22.115605zM433.176097 276.613382a276.322193 276.322193 0 0 1 131.321641-42.511107l54.019412-34.217755a312.075754 312.075754 0 0 0-204.528388 46.688499 312.055276 312.055276 0 0 0-129.478674 165.047938l53.998935-34.197278a276.50649 276.50649 0 0 1 94.667074-100.810297z m297.741565 470.57092c40.954823-25.903926 72.756244-60.879345 94.687552-100.666956l53.957979-34.279187a311.686683 311.686683 0 0 1-129.417241 165.047938c-61.718919 39.009469-133.164608 55.14567-204.50791 46.708976l53.978457-34.197278c45.25508-2.784928 90.305385-16.586703 131.301163-42.593016z m-303.00426-123.990728L277.895884 716.918687l40.565753 64.913395c5.467469 8.764332 12.573131 10.402525 21.337463 4.914579l120.816728-75.500217a19.494496 19.494496 0 0 0 8.211442-11.201144c1.290077-5.528901-5.487946-21.235076-19.53545-46.954705l29.671769-7.719984c16.279542 33.091497 23.549023 53.917025 22.013218 62.312763-2.477767 8.989584-8.682423 16.914342-18.102032 23.487592l-135.171395 84.448845c-20.927915 13.064589-37.965121 8.518603-51.644032-13.37175l-78.694693-125.936081 25.289604-15.788085 20.067863 32.088104 124.215979-77.629867-34.627303-55.432353-159.723811 99.806904-15.194239-24.306688 185.484395-115.90215 65.036259 104.025252z m160.133359-51.050187l8.805287 14.108936 31.596646-19.760702-8.805287-14.088459-31.617123 19.740225z m20.047386-38.21085l-8.661945-13.863208-31.617124 19.740225 8.661946 13.863207 31.617123-19.740224z m0.286684 70.790412l25.228171 40.360978-21.890353 13.678911-78.223713-125.219372 72.694812-45.418899-5.610811-1.9044c-0.327639-4.873624-0.901006-9.583429-1.228645-14.436575l-9.010061 13.719866c-2.477767-1.82249-4.730282-3.788321-6.675636-5.283172-11.979286 12.225015-31.064233 28.197396-57.111501 48.203827l-15.214717-17.876781c4.300256-3.378773 6.470862-9.112448 6.614204-16.996251-0.286684-5.897495-0.839574-14.334188-2.109173-25.023397l-22.852792 14.272756-14.293233-22.852792 33.07102-20.682186a213.84561 213.84561 0 0 0-19.023516-13.105543l22.361334-19.392109c6.286565 5.201263 13.044111 11.119235 20.25216 17.7Line truncated
|
||||
|
After Width: | Height: | Size: 8.7 KiB |
@@ -292,8 +292,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
},
|
||||
{
|
||||
path: 'process-instance/detail',
|
||||
// component: () => import('@/views/bpm/processInstance/detail/index_new.vue'),
|
||||
component: () => import('@/views/bpm/processInstance/detail/index.vue'),
|
||||
component: () => import('@/views/bpm/processInstance/detail/index_new.vue'),
|
||||
//component: () => import('@/views/bpm/processInstance/detail/index.vue'),
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
meta: {
|
||||
noCache: true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div
|
||||
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
|
||||
@@ -9,7 +9,7 @@
|
||||
placement="top-end"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.APPROVE)"
|
||||
v-if=" isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button plain type="success" @click="openPopover('approve')">
|
||||
@@ -38,7 +38,12 @@
|
||||
/>
|
||||
</el-card>
|
||||
<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-button :disabled="formLoading" type="success" @click="handleAudit(true)">
|
||||
@@ -56,7 +61,7 @@
|
||||
placement="top-end"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.REJECT)"
|
||||
v-if=" isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button class="mr-20px" plain type="danger" @click="openPopover('reject')">
|
||||
@@ -85,7 +90,12 @@
|
||||
/>
|
||||
</el-card>
|
||||
<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-button :disabled="formLoading" type="danger" @click="handleAudit(false)">
|
||||
@@ -103,10 +113,10 @@
|
||||
placement="top-start"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.COPY)"
|
||||
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.COPY)"
|
||||
>
|
||||
<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" />
|
||||
{{ getButtonDisplayName(OperationButtonType.COPY) }}
|
||||
</div>
|
||||
@@ -120,9 +130,14 @@
|
||||
:rules="genericRule"
|
||||
label-width="100px"
|
||||
>
|
||||
|
||||
<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
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -132,7 +147,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
@@ -151,10 +172,10 @@
|
||||
placement="top-start"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.TRANSFER)"
|
||||
v-if=" isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)"
|
||||
>
|
||||
<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" />
|
||||
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
|
||||
</div>
|
||||
@@ -168,7 +189,6 @@
|
||||
:rules="genericRule"
|
||||
label-width="100px"
|
||||
>
|
||||
|
||||
<el-form-item label="新审批人" prop="assigneeUserId">
|
||||
<el-select v-model="genericForm.assigneeUserId" clearable style="width: 100%">
|
||||
<el-option
|
||||
@@ -180,12 +200,17 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-button :disabled="formLoading" type="primary" @click="handleTransfer()">
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleTransfer()">
|
||||
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
|
||||
</el-button>
|
||||
<el-button @click="popOverVisible.transfer = false"> 取消 </el-button>
|
||||
@@ -193,22 +218,22 @@
|
||||
</el-form>
|
||||
</div>
|
||||
</el-popover>
|
||||
|
||||
|
||||
<!-- 【委派】按钮 -->
|
||||
<el-popover
|
||||
:visible="popOverVisible.delegate"
|
||||
placement="top-start"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.DELEGATE)"
|
||||
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.DELEGATE)"
|
||||
>
|
||||
<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" />
|
||||
{{ getButtonDisplayName(OperationButtonType.DELEGATE) }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<div class="flex flex-col flex-1 pt-20px px-20px" v-loading="formLoading">
|
||||
<el-form
|
||||
label-position="top"
|
||||
@@ -228,9 +253,15 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<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>
|
||||
@@ -241,7 +272,6 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
</el-popover>
|
||||
|
||||
<!-- 【加签】按钮 当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
||||
@@ -250,10 +280,10 @@
|
||||
placement="top-start"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.ADD_SIGN)"
|
||||
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.ADD_SIGN)"
|
||||
>
|
||||
<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" />
|
||||
{{ getButtonDisplayName(OperationButtonType.ADD_SIGN) }}
|
||||
</div>
|
||||
@@ -278,9 +308,15 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<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-button :disabled="formLoading" type="primary" @click="handlerAddSign('before')">
|
||||
@@ -295,17 +331,25 @@
|
||||
</div>
|
||||
</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
|
||||
:visible="popOverVisible.return"
|
||||
placement="top-start"
|
||||
:width="420"
|
||||
trigger="click"
|
||||
v-if="isShowButton(OperationButtonType.RETURN)"
|
||||
v-if="isHandleTaskStatus() && isShowButton(OperationButtonType.RETURN)"
|
||||
>
|
||||
<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" />
|
||||
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
|
||||
</div>
|
||||
@@ -320,20 +364,26 @@
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="退回节点" prop="targetTaskDefinitionKey">
|
||||
<el-select v-model="genericForm.targetTaskDefinitionKey" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in returnList"
|
||||
:key="item.taskDefinitionKey"
|
||||
:label="item.name"
|
||||
:value="item.taskDefinitionKey"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-model="genericForm.targetTaskDefinitionKey" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in returnList"
|
||||
:key="item.taskDefinitionKey"
|
||||
:label="item.name"
|
||||
:value="item.taskDefinitionKey"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-button :disabled="formLoading" type="primary" @click="handleReturn()">
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleReturn()">
|
||||
{{ getButtonDisplayName(OperationButtonType.RETURN) }}
|
||||
</el-button>
|
||||
<el-button @click="popOverVisible.return = false"> 取消 </el-button>
|
||||
@@ -341,29 +391,29 @@
|
||||
</el-form>
|
||||
</div>
|
||||
</el-popover>
|
||||
|
||||
|
||||
<!-- 弹窗:子任务 -->
|
||||
<TaskSignList ref="taskSignListRef" @success="reload" />
|
||||
<!--TODO @jason:撤回 -->
|
||||
<!--TODO @jason:再次发起 -->
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import TaskSignList from './dialog/TaskSignList.vue'
|
||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import * as TaskApi from '@/api/bpm/task'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { isEmpty } from '@/utils/is'
|
||||
import {
|
||||
OperationButtonType,
|
||||
OPERATION_BUTTON_NAME
|
||||
} from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
defineOptions({ name: 'ProcessInstanceBtnConatiner' })
|
||||
|
||||
const userId = useUserStore().getUser.id // 当前登录的编号
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { proxy } = getCurrentInstance() as any
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
defineProps({
|
||||
processInstance: propTypes.any, // 流程实例信息
|
||||
const props = defineProps({
|
||||
processInstanceId: propTypes.string, // 流程实例信息
|
||||
userOptions: propTypes.any
|
||||
})
|
||||
const formLoading = ref(false) // 表单加载中
|
||||
@@ -374,7 +424,7 @@ const popOverVisible = ref({
|
||||
transfer: false,
|
||||
delegate: false,
|
||||
addSign: false,
|
||||
return : false,
|
||||
return: false,
|
||||
copy: false
|
||||
})
|
||||
/** 退回节点 */
|
||||
@@ -390,7 +440,7 @@ const genericRule = reactive({
|
||||
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
||||
returnReason: [{ required: true, message: '退回理由不能为空', trigger: 'blur' }],
|
||||
copyUserIds: [{ required: true, message: '抄送人不能为空', trigger: 'change' }],
|
||||
assigneeUserId:[{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
||||
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
||||
delegateUserId: [{ required: true, message: '接收人不能为空', trigger: 'change' }],
|
||||
addSignUserIds: [{ required: true, message: '加签处理人不能为空', trigger: 'change' }]
|
||||
})
|
||||
@@ -407,43 +457,25 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
// TODO @jaosn:具体的审批任务,要不改成后端返回。让前端弱化下
|
||||
/**
|
||||
* 设置 runningTasks 中的任务
|
||||
*/
|
||||
const loadRunningTask = (tasks: any[]) => {
|
||||
runningTask.value = {}
|
||||
genericForm.value = {}
|
||||
approveForm.value = {}
|
||||
approveFormFApi.value = {}
|
||||
tasks.forEach((task: any) => {
|
||||
if (!isEmpty(task.children)) {
|
||||
loadRunningTask(task.children)
|
||||
}
|
||||
// 2.1 只有待处理才需要
|
||||
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
|
||||
/** 弹出退回气泡卡 */
|
||||
const openReturnPopover = async () => {
|
||||
returnList.value = await TaskApi.getTaskListByReturn(runningTask.value.id)
|
||||
if (returnList.value.length === 0) {
|
||||
message.warning('当前没有可退回的节点')
|
||||
return
|
||||
}
|
||||
openPopover('return')
|
||||
}
|
||||
/** 弹出气泡卡 */
|
||||
const openPopover = (type: string) => {
|
||||
Object.keys(popOverVisible.value).forEach((item) => {
|
||||
if (item === type) {
|
||||
popOverVisible.value[item] = true
|
||||
} else {
|
||||
approveForm.value = {} // 占位,避免为空
|
||||
popOverVisible.value[item] = false
|
||||
}
|
||||
})
|
||||
formRef.value.resetFields()
|
||||
}
|
||||
|
||||
/** 处理审批通过和不通过的操作 */
|
||||
@@ -479,7 +511,7 @@ const handleAudit = async (pass: boolean) => {
|
||||
message.success('审批不通过成功')
|
||||
}
|
||||
// 2.2 加载最新数据
|
||||
getDetail()
|
||||
reload()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -511,7 +543,6 @@ const handleCopy = async () => {
|
||||
|
||||
/** 处理转交 */
|
||||
const handleTransfer = async () => {
|
||||
|
||||
formLoading.value = true
|
||||
try {
|
||||
const transferFormRef = proxy.$refs['formRef']
|
||||
@@ -526,12 +557,12 @@ const handleTransfer = async () => {
|
||||
reason: genericForm.value.reason,
|
||||
assigneeUserId: genericForm.value.assigneeUserId
|
||||
}
|
||||
|
||||
|
||||
await TaskApi.transferTask(data)
|
||||
popOverVisible.value.transfer = false
|
||||
message.success('操作成功')
|
||||
// 2. 加载最新数据
|
||||
getDetail()
|
||||
reload()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -539,30 +570,30 @@ const handleTransfer = async () => {
|
||||
|
||||
/** 处理委派 */
|
||||
const handleDelegate = async () => {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const deletegateFormRef = proxy.$refs['formRef']
|
||||
// 1.1 校验表单
|
||||
const elForm = unref(deletegateFormRef)
|
||||
if (!elForm) return
|
||||
const valid = await elForm.validate()
|
||||
if (!valid) return
|
||||
// 1.2 处理委派
|
||||
const data = {
|
||||
id: runningTask.value.id,
|
||||
reason: genericForm.value.reason,
|
||||
delegateUserId: genericForm.value.delegateUserId
|
||||
}
|
||||
|
||||
await TaskApi.delegateTask(data)
|
||||
popOverVisible.value.delegate = false
|
||||
message.success('操作成功')
|
||||
// 2. 加载最新数据
|
||||
getDetail()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
formLoading.value = true
|
||||
try {
|
||||
const deletegateFormRef = proxy.$refs['formRef']
|
||||
// 1.1 校验表单
|
||||
const elForm = unref(deletegateFormRef)
|
||||
if (!elForm) return
|
||||
const valid = await elForm.validate()
|
||||
if (!valid) return
|
||||
// 1.2 处理委派
|
||||
const data = {
|
||||
id: runningTask.value.id,
|
||||
reason: genericForm.value.reason,
|
||||
delegateUserId: genericForm.value.delegateUserId
|
||||
}
|
||||
|
||||
await TaskApi.delegateTask(data)
|
||||
popOverVisible.value.delegate = false
|
||||
message.success('操作成功')
|
||||
// 2. 加载最新数据
|
||||
reload()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 处理加签 */
|
||||
const handlerAddSign = async (type: string) => {
|
||||
@@ -585,7 +616,7 @@ const handlerAddSign = async (type: string) => {
|
||||
message.success('操作成功')
|
||||
popOverVisible.value.addSign = false
|
||||
// 2 加载最新数据
|
||||
getDetail()
|
||||
reload()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -607,43 +638,41 @@ const handleReturn = async () => {
|
||||
reason: genericForm.value.returnReason,
|
||||
targetTaskDefinitionKey: genericForm.value.targetTaskDefinitionKey
|
||||
}
|
||||
|
||||
|
||||
await TaskApi.returnTask(data)
|
||||
popOverVisible.value.return = false
|
||||
message.success('操作成功')
|
||||
// 2 加载最新数据
|
||||
getDetail()
|
||||
// 2 重新加载数据
|
||||
reload()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 弹出退回气泡卡 */
|
||||
const openReturnPopover = async () => {
|
||||
returnList.value = await TaskApi.getTaskListByReturn(runningTask.value.id)
|
||||
if (returnList.value.length === 0) {
|
||||
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 taskSignListRef = ref()
|
||||
const openChildrenTask = () => {
|
||||
taskSignListRef.value.open(runningTask.value)
|
||||
}
|
||||
|
||||
/** 获得详情 */
|
||||
const getDetail = () => {
|
||||
/** 重新加载数据 */
|
||||
const reload = () => {
|
||||
getMyTodoTask()
|
||||
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 => {
|
||||
let isShow = true
|
||||
@@ -662,7 +691,26 @@ const getButtonDisplayName = (btnType: OperationButtonType) => {
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-drawer v-model="drawerVisible" title="子任务" size="880px">
|
||||
<!-- 当前任务 -->
|
||||
<template #header>
|
||||
<h4>【{{ parentTask.name }} 】审批人:{{ parentTask?.assigneeUser?.nickname }}</h4>
|
||||
<h4>【{{ parentTask.name }} 】审批人:{{ parentTask?.ownerUser?.nickname }}</h4>
|
||||
<el-button
|
||||
style="margin-left: 5px"
|
||||
v-if="isSignDeleteButtonVisible(parentTask)"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<div class="text-#878c93"> {{ formatDate(processInstance.startTime) }} 提交 </div>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" @tab-change="onTabChange">
|
||||
<el-tabs v-model="activeTab">
|
||||
<!-- 表单信息 -->
|
||||
<el-tab-pane label="审批详情" name="form">
|
||||
<div class="form-scroll-area">
|
||||
@@ -104,8 +104,7 @@
|
||||
<div class="b-t-solid border-t-1px border-[var(--el-border-color)]">
|
||||
<!-- 操作栏按钮 -->
|
||||
<ProcessInstanceOperationButton
|
||||
ref="operationButtonRef"
|
||||
:processInstance="processInstance"
|
||||
:process-instance-id="id"
|
||||
:userOptions="userOptions"
|
||||
@success="refresh"
|
||||
/>
|
||||
@@ -119,7 +118,6 @@ import { formatDate } from '@/utils/formatTime'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
||||
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 TaskApi from '@/api/bpm/task'
|
||||
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 audit2 from '@/assets/svgs/bpm/audit2.svg'
|
||||
import audit3 from '@/assets/svgs/bpm/audit3.svg'
|
||||
import audit4 from '@/assets/svgs/bpm/audit4.svg'
|
||||
|
||||
defineOptions({ name: 'BpmProcessInstanceDetail' })
|
||||
const props = defineProps<{
|
||||
@@ -142,16 +141,14 @@ const props = defineProps<{
|
||||
const message = useMessage() // 消息弹窗
|
||||
const processInstanceLoading = ref(false) // 流程实例的加载中
|
||||
const processInstance = ref<any>({}) // 流程实例
|
||||
let processDefinitionId = undefined // 流程定义 Id
|
||||
const operationButtonRef = ref()
|
||||
const timelineRef = ref()
|
||||
const bpmnXml = ref('') // BPMN XML
|
||||
const tasksLoad = ref(true) // 任务的加载中
|
||||
const tasks = ref<any[]>([]) // 任务列表
|
||||
const auditIcons = {
|
||||
1: audit1,
|
||||
2: audit2,
|
||||
3: audit3
|
||||
3: audit3,
|
||||
4: audit4
|
||||
}
|
||||
|
||||
// ========== 申请信息 ==========
|
||||
@@ -220,9 +217,6 @@ const getProcessInstance = async () => {
|
||||
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
||||
BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
|
||||
}
|
||||
processDefinitionId = processDefinition.id
|
||||
// 加载流程图
|
||||
// bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinition.id))?.bpmnXml
|
||||
} finally {
|
||||
processInstanceLoading.value = false
|
||||
}
|
||||
@@ -272,7 +266,7 @@ const getTaskList = async () => {
|
||||
})
|
||||
|
||||
// 获得需要自己审批的任务
|
||||
operationButtonRef.value?.loadRunningTask(tasks.value)
|
||||
//operationButtonRef.value?.loadRunningTask(tasks.value)
|
||||
} finally {
|
||||
tasksLoad.value = false
|
||||
}
|
||||
@@ -291,13 +285,6 @@ const refresh = () => {
|
||||
/** 当前的Tab */
|
||||
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[]>([]) // 用户列表
|
||||
onMounted(async () => {
|
||||
|
||||
Reference in new issue
Block a user