【文案修改】工作流:“回退”统一改成“退回”,和飞书保持一致

pull/582/head
YunaiV 2024-10-19 19:01:38 +08:00
parent 410c3bc9a7
commit dcdce4120d
8 changed files with 91 additions and 75 deletions

View File

@ -75,12 +75,12 @@ export const getTaskListByProcessInstanceId = async (processInstanceId: string)
}) })
} }
// 获取所有可退的节点 // 获取所有可退的节点
export const getTaskListByReturn = async (id: string) => { export const getTaskListByReturn = async (id: string) => {
return await request.get({ url: '/bpm/task/list-by-return', params: { id } }) return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
} }
// 退 // 退
export const returnTask = async (data: any) => { export const returnTask = async (data: any) => {
return await request.put({ url: '/bpm/task/return', data }) return await request.put({ url: '/bpm/task/return', data })
} }

View File

@ -177,7 +177,7 @@ export enum ApproveMethodType {
export type RejectHandler = { export type RejectHandler = {
// 审批拒绝类型 // 审批拒绝类型
type: RejectHandlerType type: RejectHandlerType
// 退节点 Id // 退节点 Id
returnNodeId?: string returnNodeId?: string
} }
@ -359,7 +359,7 @@ export enum OperationButtonType {
*/ */
ADD_SIGN = 5, ADD_SIGN = 5,
/** /**
* 退 * 退
*/ */
RETURN = 6, RETURN = 6,
/** /**
@ -516,7 +516,7 @@ export const DEFAULT_BUTTON_SETTING: ButtonSetting[] = [
{ id: OperationButtonType.TRANSFER, displayName: '转办', enable: true }, { id: OperationButtonType.TRANSFER, displayName: '转办', enable: true },
{ id: OperationButtonType.DELEGATE, displayName: '委派', enable: true }, { id: OperationButtonType.DELEGATE, displayName: '委派', enable: true },
{ id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: true }, { id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: true },
{ id: OperationButtonType.RETURN, displayName: '退', enable: true } { id: OperationButtonType.RETURN, displayName: '退', enable: true }
] ]
// 发起人的按钮权限。暂时定死,不可以编辑 // 发起人的按钮权限。暂时定死,不可以编辑
@ -526,7 +526,7 @@ export const START_USER_BUTTON_SETTING: ButtonSetting[] = [
{ id: OperationButtonType.TRANSFER, displayName: '转办', enable: false }, { id: OperationButtonType.TRANSFER, displayName: '转办', enable: false },
{ id: OperationButtonType.DELEGATE, displayName: '委派', enable: false }, { id: OperationButtonType.DELEGATE, displayName: '委派', enable: false },
{ id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: false }, { id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: false },
{ id: OperationButtonType.RETURN, displayName: '退', enable: false } { id: OperationButtonType.RETURN, displayName: '退', enable: false }
] ]
export const MULTI_LEVEL_DEPT: DictDataVO = [ export const MULTI_LEVEL_DEPT: DictDataVO = [

View File

@ -134,12 +134,7 @@
prop="userIds" prop="userIds"
span="24" span="24"
> >
<el-select <el-select v-model="configForm.userIds" clearable multiple style="width: 100%">
v-model="configForm.userIds"
clearable
multiple
style="width: 100%"
>
<el-option <el-option
v-for="item in userOptions" v-for="item in userOptions"
:key="item.id" :key="item.id"
@ -183,10 +178,7 @@
:key="index" :key="index"
class="flex items-center" class="flex items-center"
> >
<el-radio <el-radio :value="item.value" :label="item.value">
:value="item.value"
:label="item.value"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
<el-form-item prop="approveRatio"> <el-form-item prop="approveRatio">
@ -552,7 +544,7 @@ const approveMethodChanged = () => {
} }
formRef.value.clearValidate('approveRatio') formRef.value.clearValidate('approveRatio')
} }
// 退 // 退
const returnTaskList = ref<SimpleFlowNode[]>([]) const returnTaskList = ref<SimpleFlowNode[]>([])
// //
const { const {

View File

@ -282,9 +282,12 @@ const importXML = async (xml: string) => {
/** 高亮流程 */ /** 高亮流程 */
const setProcessStatus = (view: any) => { const setProcessStatus = (view: any) => {
// //
if (!view || !view.processInstance) {
return
}
processInstance.value = view.processInstance processInstance.value = view.processInstance
tasks.value = view.tasks tasks.value = view.tasks
if (isLoading.value || !processInstance.value || !bpmnViewer.value) { if (isLoading.value || !bpmnViewer.value) {
return return
} }
const { const {

View File

@ -8,7 +8,7 @@
placement="top-end" placement="top-end"
:width="420" :width="420"
trigger="click" trigger="click"
v-if=" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)" v-if="runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
> >
<template #reference> <template #reference>
<el-button plain type="success" @click="openPopover('approve')"> <el-button plain type="success" @click="openPopover('approve')">
@ -60,7 +60,7 @@
placement="top-end" placement="top-end"
:width="420" :width="420"
trigger="click" trigger="click"
v-if=" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)" v-if="runningTask && 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')">
@ -171,7 +171,7 @@
placement="top-start" placement="top-start"
:width="420" :width="420"
trigger="click" trigger="click"
v-if=" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)" v-if="runningTask && 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">
@ -397,7 +397,9 @@
placement="top-start" placement="top-start"
:width="420" :width="420"
trigger="click" trigger="click"
v-if="userId === processInstance?.startUser?.id && !isEndProcessStatus(processInstance?.status)" v-if="
userId === processInstance?.startUser?.id && !isEndProcessStatus(processInstance?.status)
"
> >
<template #reference> <template #reference>
<div @click="openPopover('cancel')" class="hover-bg-gray-100 rounded-xl p-6px"> <div @click="openPopover('cancel')" class="hover-bg-gray-100 rounded-xl p-6px">
@ -414,7 +416,7 @@
label-width="100px" label-width="100px"
> >
<el-form-item label="撤消理由" prop="cancelReason"> <el-form-item label="撤消理由" prop="cancelReason">
<span class=" text-#878c93 text-12px">&nbsp; 撤消后该审批流程将自动结束</span> <span class="text-#878c93 text-12px">&nbsp; 撤消后该审批流程将自动结束</span>
<el-input <el-input
v-model="genericForm.cancelReason" v-model="genericForm.cancelReason"
clearable clearable
@ -424,7 +426,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button :disabled="formLoading" type="primary" @click="handleCancel()"></el-button> <el-button :disabled="formLoading" type="primary" @click="handleCancel()"
>撤消</el-button
>
<el-button @click="popOverVisible.cancel = false"> 取消 </el-button> <el-button @click="popOverVisible.cancel = false"> 取消 </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -434,15 +438,16 @@
<div <div
@click="handleReCreate()" @click="handleReCreate()"
class="hover-bg-gray-100 rounded-xl p-6px" class="hover-bg-gray-100 rounded-xl p-6px"
v-if="userId === processInstance?.startUser?.id && isEndProcessStatus(processInstance?.status) v-if="
&& processDefinition?.formType === 10" userId === processInstance?.startUser?.id &&
isEndProcessStatus(processInstance?.status) &&
processDefinition?.formType === 10
"
> >
<Icon :size="14" icon="ep:refresh" />&nbsp; 再次提交 <Icon :size="14" icon="ep:refresh" />&nbsp; 再次提交
</div> </div>
<!-- 弹窗子任务 --> <!-- 弹窗子任务 -->
<TaskSignList ref="taskSignListRef" @success="reload" /> <TaskSignList ref="taskSignListRef" @success="reload" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -457,20 +462,22 @@ import {
OPERATION_BUTTON_NAME OPERATION_BUTTON_NAME
} from '@/components/SimpleProcessDesignerV2/src/consts' } from '@/components/SimpleProcessDesignerV2/src/consts'
import { BpmProcessInstanceStatus } from '@/utils/constants' import { BpmProcessInstanceStatus } from '@/utils/constants'
defineOptions({ name: 'ProcessInstanceBtnConatiner' })
defineOptions({ name: 'ProcessInstanceBtnContainer' })
const router = useRouter() // const router = useRouter() //
const message = useMessage() // const message = useMessage() //
const { proxy } = getCurrentInstance() as any const { proxy } = getCurrentInstance() as any
const userId = useUserStoreWithOut().getUser.id // const userId = useUserStoreWithOut().getUser.id //
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const props = defineProps({ const props = defineProps({
processInstance: propTypes.object, // processInstance: propTypes.object, //
processDefinition : propTypes.object, // processDefinition: propTypes.object, //
userOptions: propTypes.any userOptions: propTypes.any
}) })
const formLoading = ref(false) // const formLoading = ref(false) //
/** 气泡卡是否展示 */
const popOverVisible = ref({ const popOverVisible = ref({
approve: false, approve: false,
reject: false, reject: false,
@ -480,16 +487,15 @@ const popOverVisible = ref({
return: false, return: false,
copy: false, copy: false,
cancel: false cancel: false
}) }) //
/** 退回节点 */ const returnList = ref([] as any) // 退
const returnList = ref([] as any)
// ========== ========== // ========== ==========
const runningTask = ref<any>() // const runningTask = ref<any>() //
const genericForm = ref<any>({}) // const genericForm = ref<any>({}) //
const approveForm = ref<any>({}) // const approveForm = ref<any>({}) //
const approveFormFApi = ref<any>({}) // approveForms fAPi const approveFormFApi = ref<any>({}) // approveForms fAPi
const formRef = ref() const formRef = ref()
/** 表单校验规则 */
const genericRule = reactive({ 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' }],
@ -498,8 +504,8 @@ const genericRule = reactive({
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' }],
targetTaskDefinitionKey: [{ required: true, message: '退回节点不能为空', trigger: 'change' }] targetTaskDefinitionKey: [{ required: true, message: '退回节点不能为空', trigger: 'change' }]
}) }) //
/** 监听 approveFormFApis实现它对应的 form-create 初始化后,隐藏掉对应的表单提交按钮 */ /** 监听 approveFormFApis实现它对应的 form-create 初始化后,隐藏掉对应的表单提交按钮 */
watch( watch(
@ -520,20 +526,16 @@ const openReturnPopover = async () => {
message.warning('当前没有可退回的节点') message.warning('当前没有可退回的节点')
return return
} }
openPopover('return') await openPopover('return')
} }
/** 弹出气泡卡 */ /** 弹出气泡卡 */
const openPopover = (type: string) => { const openPopover = async (type: string) => {
Object.keys(popOverVisible.value).forEach((item) => { Object.keys(popOverVisible.value).forEach((item) => {
if (item === type) { popOverVisible.value[item] = item === type
popOverVisible.value[item] = true
} else {
popOverVisible.value[item] = false
}
})
nextTick().then(() => {
formRef.value.resetFields()
}) })
await nextTick()
formRef.value.resetFields()
} }
/** 处理审批通过和不通过的操作 */ /** 处理审批通过和不通过的操作 */
@ -575,7 +577,7 @@ const handleAudit = async (pass: boolean) => {
} }
} }
/* 处理抄送 */ /** 处理抄送 */
const handleCopy = async () => { const handleCopy = async () => {
formLoading.value = true formLoading.value = true
try { try {
@ -718,7 +720,10 @@ const handleCancel = async () => {
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
// 1.2 // 1.2
await ProcessInstanceApi.cancelProcessInstanceByStartUser(props.processInstance.id, genericForm.value.cancelReason) await ProcessInstanceApi.cancelProcessInstanceByStartUser(
props.processInstance.id,
genericForm.value.cancelReason
)
popOverVisible.value.return = false popOverVisible.value.return = false
message.success('操作成功') message.success('操作成功')
// 2 // 2
@ -764,8 +769,9 @@ const isHandleTaskStatus = () => {
const isEndProcessStatus = (status: number) => { const isEndProcessStatus = (status: number) => {
let isEndStatus = false let isEndStatus = false
if ( if (
BpmProcessInstanceStatus.APPROVE === status || BpmProcessInstanceStatus.REJECT === status || BpmProcessInstanceStatus.APPROVE === status ||
BpmProcessInstanceStatus.CANCEL === status BpmProcessInstanceStatus.REJECT === status ||
BpmProcessInstanceStatus.CANCEL === status
) { ) {
isEndStatus = true isEndStatus = true
} }
@ -806,7 +812,6 @@ const loadTodoTask = (task: any) => {
} }
defineExpose({ loadTodoTask }) defineExpose({ loadTodoTask })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -11,28 +11,45 @@
> >
<div class="flex flex-col items-start"> <div class="flex flex-col items-start">
<div class="font-bold"> {{ activity.name }}</div> <div class="font-bold"> {{ activity.name }}</div>
<div class="flex items-center flex-wrap mt-1 "> <div class="flex items-center flex-wrap mt-1">
<!-- 情况一遍历每个审批节点下的进行中task 任务 --> <!-- 情况一遍历每个审批节点下的进行中task 任务 -->
<div v-for="(task, idx) in activity.tasks" :key="idx" class="flex items-center"> <div v-for="(task, idx) in activity.tasks" :key="idx" class="flex items-center">
<div class="flex flex-col pr-2"> <div class="flex flex-col pr-2">
<div class="position-relative" v-if="task.assigneeUser || task.ownerUser"> <div class="position-relative" v-if="task.assigneeUser || task.ownerUser">
<!-- 信息头像 --> <!-- 信息头像 -->
<el-tooltip :content="task.reason" placement="bottom" v-if="task.assigneeUser && task.assigneeUser.avatar" effect="light"> <el-tooltip
<el-avatar :content="task.reason"
:size="36" placement="bottom"
:src="task.assigneeUser.avatar" v-if="task.assigneeUser && task.assigneeUser.avatar"
/> effect="light"
>
<el-avatar :size="36" :src="task.assigneeUser.avatar" />
</el-tooltip> </el-tooltip>
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.assigneeUser && task.assigneeUser.nickname" effect="light"> <el-tooltip
<el-avatar > :content="task.reason"
placement="bottom"
v-else-if="task.assigneeUser && task.assigneeUser.nickname"
effect="light"
>
<el-avatar>
{{ task.assigneeUser.nickname.substring(0, 1) }} {{ task.assigneeUser.nickname.substring(0, 1) }}
</el-avatar> </el-avatar>
</el-tooltip> </el-tooltip>
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.ownerUser && task.ownerUser.avatar" effect="light"> <el-tooltip
<el-avatar :src="task.ownerUser.avatar"/> :content="task.reason"
placement="bottom"
v-else-if="task.ownerUser && task.ownerUser.avatar"
effect="light"
>
<el-avatar :src="task.ownerUser.avatar" />
</el-tooltip> </el-tooltip>
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.ownerUser && task.ownerUser.nickname" effect="light"> <el-tooltip
<el-avatar > :content="task.reason"
placement="bottom"
v-else-if="task.ownerUser && task.ownerUser.nickname"
effect="light"
>
<el-avatar>
{{ task.ownerUser.nickname.substring(0, 1) }} {{ task.ownerUser.nickname.substring(0, 1) }}
</el-avatar> </el-avatar>
</el-tooltip> </el-tooltip>
@ -146,7 +163,6 @@ defineProps<{
// //
const statusIconMap2 = { const statusIconMap2 = {
// //
'-1': { color: '#e5e7ec', icon: 'ep-clock' }, '-1': { color: '#e5e7ec', icon: 'ep-clock' },
@ -160,7 +176,7 @@ const statusIconMap2 = {
'3': { color: '#f46b6c', icon: 'fa-solid:times-circle' }, '3': { color: '#f46b6c', icon: 'fa-solid:times-circle' },
// //
'4': { color: '#cccccc', icon: 'ep:delete-filled' }, '4': { color: '#cccccc', icon: 'ep:delete-filled' },
// 退 // 退
'5': { color: '#f46b6c', icon: 'ep:remove-filled' }, '5': { color: '#f46b6c', icon: 'ep:remove-filled' },
// //
'6': { color: '#448ef7', icon: 'ep:loading' }, '6': { color: '#448ef7', icon: 'ep:loading' },
@ -180,7 +196,7 @@ const statusIconMap = {
'3': { color: '#f46b6c', icon: Close }, '3': { color: '#f46b6c', icon: Close },
// //
'4': { color: '#cccccc', icon: Delete }, '4': { color: '#cccccc', icon: Delete },
// 退 // 退
'5': { color: '#f46b6c', icon: Minus }, '5': { color: '#f46b6c', icon: Minus },
// //
'6': { color: '#448ef7', icon: Loading }, '6': { color: '#448ef7', icon: Loading },

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog v-model="dialogVisible" title="退任务" width="500"> <Dialog v-model="dialogVisible" title="退任务" width="500">
<el-form <el-form
ref="formRef" ref="formRef"
v-loading="formLoading" v-loading="formLoading"
@ -17,8 +17,8 @@
/> />
</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="formData.reason" clearable placeholder="请输入退理由" /> <el-input v-model="formData.reason" clearable placeholder="请输入退理由" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -39,8 +39,8 @@ const formData = ref({
reason: '' reason: ''
}) })
const formRules = ref({ const formRules = ref({
targetTaskDefinitionKey: [{ required: true, message: '必须选择退节点', trigger: 'change' }], targetTaskDefinitionKey: [{ required: true, message: '必须选择退节点', trigger: 'change' }],
reason: [{ required: true, message: '退理由不能为空', trigger: 'blur' }] reason: [{ required: true, message: '退理由不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
@ -49,7 +49,7 @@ const returnList = ref([] as any)
const open = async (id: string) => { const open = async (id: string) => {
returnList.value = await TaskApi.getTaskListByReturn(id) returnList.value = await TaskApi.getTaskListByReturn(id)
if (returnList.value.length === 0) { if (returnList.value.length === 0) {
message.warning('当前没有可退的节点') message.warning('当前没有可退的节点')
return false return false
} }
dialogVisible.value = true dialogVisible.value = true
@ -69,7 +69,7 @@ const submitForm = async () => {
formLoading.value = true formLoading.value = true
try { try {
await TaskApi.returnTask(formData.value) await TaskApi.returnTask(formData.value)
message.success('退成功') message.success('退成功')
dialogVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')

View File

@ -161,7 +161,7 @@
<!-- 弹窗转派审批人 --> <!-- 弹窗转派审批人 -->
<TaskTransferForm ref="taskTransferFormRef" @success="getDetail" /> <TaskTransferForm ref="taskTransferFormRef" @success="getDetail" />
<!-- 弹窗退节点 --> <!-- 弹窗退节点 -->
<TaskReturnForm ref="taskReturnFormRef" @success="getDetail" /> <TaskReturnForm ref="taskReturnFormRef" @success="getDetail" />
<!-- 弹窗委派将任务委派给别人处理处理完成后会重新回到原审批人手中--> <!-- 弹窗委派将任务委派给别人处理处理完成后会重新回到原审批人手中-->
<TaskDelegateForm ref="taskDelegateForm" @success="getDetail" /> <TaskDelegateForm ref="taskDelegateForm" @success="getDetail" />