chore: 修改办理人
This commit is contained in:
parent
f56ba6ba33
commit
d28cf0d98f
@ -37,7 +37,12 @@ import {
|
|||||||
} from '#/api/workflow/task';
|
} from '#/api/workflow/task';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
|
|
||||||
import { approvalModal, approvalRejectionModal, ApprovalTimeline } from '.';
|
import {
|
||||||
|
approvalModal,
|
||||||
|
approvalRejectionModal,
|
||||||
|
ApprovalTimeline,
|
||||||
|
flowInterfereModal,
|
||||||
|
} from '.';
|
||||||
import userSelectModal from './user-select-modal.vue';
|
import userSelectModal from './user-select-modal.vue';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -310,6 +315,14 @@ function handleReductionSignature(userList: User[]) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [FlowInterfereModal, flowInterfereModalApi] = useVbenModal({
|
||||||
|
connectedComponent: flowInterfereModal,
|
||||||
|
});
|
||||||
|
function handleFlowInterfere() {
|
||||||
|
flowInterfereModalApi.setData({ taskId: props.task?.id });
|
||||||
|
flowInterfereModalApi.open();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -452,8 +465,9 @@ function handleReductionSignature(userList: User[]) {
|
|||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
<Space v-if="type === 'admin'">
|
<Space v-if="type === 'admin'">
|
||||||
<a-button>流程干预</a-button>
|
<a-button @click="handleFlowInterfere"> 流程干预 </a-button>
|
||||||
<a-button>修改办理人</a-button>
|
<a-button>修改办理人(没做)</a-button>
|
||||||
|
<FlowInterfereModal @complete="$emit('reload')" />
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,106 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { User } from '#/api/system/user/model';
|
||||||
|
import type { TaskInfo } from '#/api/workflow/task/model';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { Descriptions, DescriptionsItem, Modal } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import {
|
||||||
|
getTaskByTaskId,
|
||||||
|
taskOperation,
|
||||||
|
terminationTask,
|
||||||
|
} from '#/api/workflow/task';
|
||||||
|
|
||||||
|
import { userSelectModal } from '.';
|
||||||
|
|
||||||
|
const emit = defineEmits<{ complete: [] }>();
|
||||||
|
|
||||||
|
const taskInfo = ref<TaskInfo>();
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
title: '流程干预',
|
||||||
|
class: 'w-[800px]',
|
||||||
|
fullscreenButton: false,
|
||||||
|
async onOpenChange(isOpen) {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const { taskId } = modalApi.getData() as { taskId: string };
|
||||||
|
taskInfo.value = await getTaskByTaskId(taskId);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转办
|
||||||
|
*/
|
||||||
|
const [TransferModal, transferModalApi] = useVbenModal({
|
||||||
|
connectedComponent: userSelectModal,
|
||||||
|
});
|
||||||
|
function handleTransfer(userList: User[]) {
|
||||||
|
if (userList.length === 0 || !taskInfo.value) return;
|
||||||
|
const current = userList[0];
|
||||||
|
Modal.confirm({
|
||||||
|
title: '转办',
|
||||||
|
content: `确定转办给${current?.nickName}吗?`,
|
||||||
|
centered: true,
|
||||||
|
onOk: async () => {
|
||||||
|
await taskOperation(
|
||||||
|
{ taskId: taskInfo.value!.id, userId: current!.userId },
|
||||||
|
'transferTask',
|
||||||
|
);
|
||||||
|
emit('complete');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批终止
|
||||||
|
*/
|
||||||
|
function handleTermination() {
|
||||||
|
if (!taskInfo.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '审批终止',
|
||||||
|
content: '确定终止当前审批流程吗?',
|
||||||
|
centered: true,
|
||||||
|
okButtonProps: { danger: true },
|
||||||
|
onOk: async () => {
|
||||||
|
await terminationTask({ taskId: taskInfo.value!.id });
|
||||||
|
emit('complete');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal>
|
||||||
|
<Descriptions v-if="taskInfo" :column="2" bordered size="small">
|
||||||
|
<DescriptionsItem label="任务名称">
|
||||||
|
{{ taskInfo.nodeName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="节点编码">
|
||||||
|
{{ taskInfo.nodeCode }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="开始时间">
|
||||||
|
{{ taskInfo.createTime }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="流程实例ID">
|
||||||
|
{{ taskInfo.instanceId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="版本号">
|
||||||
|
{{ taskInfo.version }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="业务ID">
|
||||||
|
{{ taskInfo.businessId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
</Descriptions>
|
||||||
|
<TransferModal mode="single" @finish="handleTransfer" />
|
||||||
|
<template #footer>
|
||||||
|
<a-button @click="() => transferModalApi.open()">转办</a-button>
|
||||||
|
<a-button danger type="primary" @click="handleTermination">终止</a-button>
|
||||||
|
</template>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
@ -19,6 +19,11 @@ export { default as CopyComponent } from './copy-component.vue';
|
|||||||
* 详情信息 modal
|
* 详情信息 modal
|
||||||
*/
|
*/
|
||||||
export { default as flowInfoModal } from './flow-info-modal.vue';
|
export { default as flowInfoModal } from './flow-info-modal.vue';
|
||||||
|
/**
|
||||||
|
* 流程干预 modal
|
||||||
|
*/
|
||||||
|
export { default as flowInterfereModal } from './flow-interfere-modal.vue';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选人 支持单选/多选
|
* 选人 支持单选/多选
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user