2025-05-24 15:10:03 +08:00
|
|
|
|
<script lang="ts" setup>
|
2025-10-24 00:01:38 +08:00
|
|
|
|
// TODO @jason:你感觉要拆分下,按照表单么?
|
2025-05-24 15:10:03 +08:00
|
|
|
|
import type { FormInstance } from 'ant-design-vue';
|
|
|
|
|
|
import type { Rule } from 'ant-design-vue/es/form';
|
|
|
|
|
|
|
|
|
|
|
|
import type { BpmProcessInstanceApi } from '#/api/bpm/processInstance';
|
2025-10-27 09:13:32 +08:00
|
|
|
|
import type { SystemUserApi } from '#/api/system/user';
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
2025-08-02 22:25:30 +08:00
|
|
|
|
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
2025-05-24 15:10:03 +08:00
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
2025-06-06 20:45:45 +08:00
|
|
|
|
import { useVbenModal } from '@vben/common-ui';
|
2025-09-03 16:08:40 +08:00
|
|
|
|
import {
|
|
|
|
|
|
BpmCandidateStrategyEnum,
|
|
|
|
|
|
BpmModelFormType,
|
|
|
|
|
|
BpmNodeTypeEnum,
|
|
|
|
|
|
BpmProcessInstanceStatus,
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum,
|
|
|
|
|
|
BpmTaskStatusEnum,
|
|
|
|
|
|
OPERATION_BUTTON_NAME,
|
2025-09-04 18:19:49 +08:00
|
|
|
|
} from '@vben/constants';
|
|
|
|
|
|
import { IconifyIcon } from '@vben/icons';
|
|
|
|
|
|
import { useUserStore } from '@vben/stores';
|
|
|
|
|
|
import { isEmpty } from '@vben/utils';
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
import FormCreate from '@form-create/ant-design-vue';
|
|
|
|
|
|
import {
|
|
|
|
|
|
Alert,
|
|
|
|
|
|
Button,
|
|
|
|
|
|
Card,
|
|
|
|
|
|
Form,
|
|
|
|
|
|
FormItem,
|
|
|
|
|
|
Image,
|
|
|
|
|
|
message,
|
|
|
|
|
|
Popover,
|
|
|
|
|
|
Select,
|
|
|
|
|
|
SelectOption,
|
|
|
|
|
|
Space,
|
|
|
|
|
|
Textarea,
|
|
|
|
|
|
} from 'ant-design-vue';
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
cancelProcessInstanceByStartUser,
|
|
|
|
|
|
getNextApprovalNodes,
|
|
|
|
|
|
} from '#/api/bpm/processInstance';
|
2025-10-27 09:13:32 +08:00
|
|
|
|
import {
|
|
|
|
|
|
approveTask,
|
|
|
|
|
|
copyTask,
|
|
|
|
|
|
delegateTask,
|
|
|
|
|
|
getTaskListByReturn,
|
|
|
|
|
|
rejectTask,
|
|
|
|
|
|
returnTask,
|
|
|
|
|
|
signCreateTask,
|
|
|
|
|
|
signDeleteTask,
|
|
|
|
|
|
transferTask,
|
|
|
|
|
|
} from '#/api/bpm/task';
|
2025-10-17 16:23:43 +08:00
|
|
|
|
import { setConfAndFields2 } from '#/components/form-create';
|
2025-10-21 17:42:02 +08:00
|
|
|
|
import { $t } from '#/locales';
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
import Signature from './signature.vue';
|
|
|
|
|
|
import ProcessInstanceTimeline from './time-line.vue';
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'ProcessInstanceBtnContainer' });
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
|
normalForm: any; // 流程表单 formCreate
|
|
|
|
|
|
normalFormApi: any; // 流程表单 formCreate Api
|
|
|
|
|
|
processDefinition: any; // 流程定义信息
|
|
|
|
|
|
processInstance: any; // 流程实例信息
|
2025-10-27 09:13:32 +08:00
|
|
|
|
userOptions: SystemUserApi.User[];
|
2025-05-24 15:10:03 +08:00
|
|
|
|
writableFields: string[]; // 流程表单可以编辑的字段
|
|
|
|
|
|
}>(); // 当前登录的编号
|
|
|
|
|
|
const emit = defineEmits(['success']);
|
2025-06-06 20:45:45 +08:00
|
|
|
|
|
|
|
|
|
|
const [SignatureModal, signatureModalApi] = useVbenModal({
|
|
|
|
|
|
connectedComponent: Signature,
|
|
|
|
|
|
destroyOnClose: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-21 20:56:53 +08:00
|
|
|
|
const router = useRouter();
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const userStore = useUserStore();
|
|
|
|
|
|
const userId = userStore.userInfo?.id;
|
|
|
|
|
|
const formLoading = ref(false); // 表单加载中
|
|
|
|
|
|
const popOverVisible: any = ref({
|
|
|
|
|
|
approve: false,
|
|
|
|
|
|
reject: false,
|
|
|
|
|
|
transfer: false,
|
|
|
|
|
|
delegate: false,
|
|
|
|
|
|
addSign: false,
|
|
|
|
|
|
return: false,
|
|
|
|
|
|
copy: false,
|
|
|
|
|
|
cancel: false,
|
|
|
|
|
|
deleteSign: false,
|
|
|
|
|
|
}); // 气泡卡是否展示
|
|
|
|
|
|
const returnList = ref([] as any); // 退回节点
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
/** 创建流程表达式 */
|
|
|
|
|
|
function openSignatureModal() {
|
|
|
|
|
|
signatureModalApi.setData(null).open();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-24 15:10:03 +08:00
|
|
|
|
// ========== 审批信息 ==========
|
|
|
|
|
|
const runningTask = ref<any>(); // 运行中的任务
|
|
|
|
|
|
const approveForm = ref<any>({}); // 审批通过时,额外的补充信息
|
|
|
|
|
|
const approveFormFApi = ref<any>({}); // approveForms 的 fAPi
|
|
|
|
|
|
const nodeTypeName = ref('审批'); // 节点类型名称
|
|
|
|
|
|
|
|
|
|
|
|
const reasonRequire = ref();
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const approveFormRef = ref<FormInstance>(); // 审批通过意见表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const approveSignFormRef = ref();
|
|
|
|
|
|
const nextAssigneesActivityNode = ref<BpmProcessInstanceApi.ApprovalNodeInfo[]>(
|
|
|
|
|
|
[],
|
|
|
|
|
|
); // 下一个审批节点信息
|
2025-08-02 22:25:30 +08:00
|
|
|
|
const nextAssigneesTimelineRef = ref(); // 下一个节点审批人时间线组件的引用
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const approveReasonForm: any = reactive({
|
|
|
|
|
|
reason: '',
|
|
|
|
|
|
signPicUrl: '',
|
|
|
|
|
|
nextAssignees: {},
|
|
|
|
|
|
});
|
|
|
|
|
|
const approveReasonRule: Record<string, any> = computed(() => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
reason: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: reasonRequire.value,
|
|
|
|
|
|
message: `${nodeTypeName.value}意见不能为空`,
|
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
signPicUrl: [
|
|
|
|
|
|
{ required: true, message: '签名不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
nextAssignees: [
|
|
|
|
|
|
{ required: true, message: '审批人不能为空', trigger: 'blur' },
|
|
|
|
|
|
],
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const rejectFormRef = ref<FormInstance>();
|
|
|
|
|
|
const rejectReasonForm = reactive({
|
|
|
|
|
|
reason: '',
|
2025-10-24 00:01:38 +08:00
|
|
|
|
}); // 拒绝表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const rejectReasonRule: any = computed(() => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
reason: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: reasonRequire.value,
|
|
|
|
|
|
message: '审批意见不能为空',
|
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
} as Record<string, Rule[]>;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const copyFormRef = ref<FormInstance>(); // 抄送表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const copyForm = reactive({
|
|
|
|
|
|
copyUserIds: [],
|
|
|
|
|
|
copyReason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const copyFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
copyUserIds: [
|
|
|
|
|
|
{ required: true, message: '抄送人不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const transferFormRef = ref<FormInstance>(); // 转办表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const transferForm = reactive({
|
|
|
|
|
|
assigneeUserId: undefined,
|
|
|
|
|
|
reason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const transferFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
assigneeUserId: [
|
|
|
|
|
|
{ required: true, message: '新审批人不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const delegateFormRef = ref<FormInstance>(); // 委派表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const delegateForm = reactive({
|
|
|
|
|
|
delegateUserId: undefined,
|
|
|
|
|
|
reason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const delegateFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
delegateUserId: [
|
|
|
|
|
|
{ required: true, message: '接收人不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const addSignFormRef = ref<FormInstance>(); // 加签表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const addSignForm = reactive({
|
|
|
|
|
|
addSignUserIds: undefined,
|
|
|
|
|
|
reason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const addSignFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
addSignUserIds: [
|
|
|
|
|
|
{ required: true, message: '加签处理人不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const deleteSignFormRef = ref<FormInstance>(); // 减签表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const deleteSignForm = reactive({
|
|
|
|
|
|
deleteSignTaskId: undefined,
|
|
|
|
|
|
reason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const deleteSignFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
deleteSignTaskId: [
|
|
|
|
|
|
{ required: true, message: '减签人员不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const returnFormRef = ref<FormInstance>(); // 退回表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const returnForm = reactive({
|
|
|
|
|
|
targetTaskDefinitionKey: undefined,
|
|
|
|
|
|
returnReason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const returnFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
targetTaskDefinitionKey: [
|
|
|
|
|
|
{ required: true, message: '退回节点不能为空', trigger: 'change' },
|
|
|
|
|
|
],
|
|
|
|
|
|
returnReason: [
|
|
|
|
|
|
{ required: true, message: '退回理由不能为空', trigger: 'blur' },
|
|
|
|
|
|
],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
const cancelFormRef = ref<FormInstance>(); // 取消表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const cancelForm = reactive({
|
|
|
|
|
|
cancelReason: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
const cancelFormRule: Record<string, Rule[]> = reactive({
|
|
|
|
|
|
cancelReason: [
|
|
|
|
|
|
{ required: true, message: '取消理由不能为空', trigger: 'blur' },
|
|
|
|
|
|
],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/** 监听 approveFormFApis,实现它对应的 form-create 初始化后,隐藏掉对应的表单提交按钮 */
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => approveFormFApi.value,
|
|
|
|
|
|
(val) => {
|
|
|
|
|
|
val?.btn?.show(false);
|
|
|
|
|
|
val?.resetBtn?.show(false);
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/** 弹出气泡卡 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function openPopover(type: string) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (type === 'approve') {
|
|
|
|
|
|
// 校验流程表单
|
|
|
|
|
|
const valid = await validateNormalForm();
|
|
|
|
|
|
if (!valid) {
|
|
|
|
|
|
message.warning('表单校验不通过,请先完善表单!!');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-10-24 00:01:38 +08:00
|
|
|
|
await initNextAssigneesFormField();
|
2025-05-24 15:10:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (type === 'return') {
|
|
|
|
|
|
// 获取退回节点
|
2025-10-27 09:13:32 +08:00
|
|
|
|
returnList.value = await getTaskListByReturn(runningTask.value.id);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (returnList.value.length === 0) {
|
|
|
|
|
|
message.warning('当前没有可退回的节点');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Object.keys(popOverVisible.value).forEach((item) => {
|
|
|
|
|
|
if (popOverVisible.value[item]) popOverVisible.value[item] = item === type;
|
|
|
|
|
|
});
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 关闭气泡卡 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function closePopover(type: string, formRef: any | FormInstance) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (formRef) {
|
|
|
|
|
|
formRef.resetFields();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (popOverVisible.value[type]) popOverVisible.value[type] = false;
|
|
|
|
|
|
nextAssigneesActivityNode.value = [];
|
2025-08-02 22:25:30 +08:00
|
|
|
|
// 清理 Timeline 组件中的自定义审批人数据
|
|
|
|
|
|
if (nextAssigneesTimelineRef.value) {
|
|
|
|
|
|
nextAssigneesTimelineRef.value.batchSetCustomApproveUsers({});
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function initNextAssigneesFormField() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
// 获取修改的流程变量, 暂时只支持流程表单
|
|
|
|
|
|
const variables = getUpdatedProcessInstanceVariables();
|
|
|
|
|
|
const data = await getNextApprovalNodes({
|
|
|
|
|
|
processInstanceId: props.processInstance.id,
|
|
|
|
|
|
taskId: runningTask.value.id,
|
|
|
|
|
|
processVariablesStr: JSON.stringify(variables),
|
|
|
|
|
|
});
|
|
|
|
|
|
if (data && data.length > 0) {
|
2025-08-02 22:25:30 +08:00
|
|
|
|
const customApproveUsersData: Record<string, any[]> = {}; // 用于收集需要设置到 Timeline 组件的自定义审批人数据
|
2025-05-24 15:10:03 +08:00
|
|
|
|
data.forEach((node: BpmProcessInstanceApi.ApprovalNodeInfo) => {
|
|
|
|
|
|
if (
|
|
|
|
|
|
// 情况一:当前节点没有审批人,并且是发起人自选
|
|
|
|
|
|
(isEmpty(node.tasks) &&
|
|
|
|
|
|
isEmpty(node.candidateUsers) &&
|
|
|
|
|
|
BpmCandidateStrategyEnum.START_USER_SELECT ===
|
|
|
|
|
|
node.candidateStrategy) ||
|
|
|
|
|
|
// 情况二:当前节点是审批人自选
|
|
|
|
|
|
BpmCandidateStrategyEnum.APPROVE_USER_SELECT === node.candidateStrategy
|
|
|
|
|
|
) {
|
|
|
|
|
|
nextAssigneesActivityNode.value.push(node);
|
|
|
|
|
|
}
|
2025-08-02 22:25:30 +08:00
|
|
|
|
|
|
|
|
|
|
// 如果节点有 candidateUsers,设置到 customApproveUsers 中
|
|
|
|
|
|
if (node.candidateUsers && node.candidateUsers.length > 0) {
|
|
|
|
|
|
customApproveUsersData[node.id] = node.candidateUsers;
|
|
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
});
|
2025-08-02 22:25:30 +08:00
|
|
|
|
|
|
|
|
|
|
// 将 candidateUsers 设置到 Timeline 组件中
|
|
|
|
|
|
await nextTick(); // 等待下一个 tick,确保 Timeline 组件已经渲染
|
|
|
|
|
|
if (
|
|
|
|
|
|
nextAssigneesTimelineRef.value &&
|
|
|
|
|
|
Object.keys(customApproveUsersData).length > 0
|
|
|
|
|
|
) {
|
|
|
|
|
|
nextAssigneesTimelineRef.value.batchSetCustomApproveUsers(
|
|
|
|
|
|
customApproveUsersData,
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 选择下一个节点的审批人 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function selectNextAssigneesConfirm(id: string, userList: any[]) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
approveReasonForm.nextAssignees[id] = userList?.map((item: any) => item.id);
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-10-24 00:01:38 +08:00
|
|
|
|
|
2025-05-24 15:10:03 +08:00
|
|
|
|
/** 审批通过时,校验每个自选审批人的节点是否都已配置了审批人 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function validateNextAssignees() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (Object.keys(nextAssigneesActivityNode.value).length === 0) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 如果需要自选审批人,则校验每个节点是否都已配置审批人
|
|
|
|
|
|
for (const item of nextAssigneesActivityNode.value) {
|
|
|
|
|
|
if (isEmpty(approveReasonForm.nextAssignees[item.id])) {
|
|
|
|
|
|
message.warning('下一个节点的审批人不能为空!');
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理审批通过和不通过的操作 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleAudit(pass: boolean, formRef: FormInstance | undefined) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 校验表单
|
|
|
|
|
|
if (!formRef) return;
|
|
|
|
|
|
await formRef?.validate();
|
|
|
|
|
|
// 校验流程表单必填字段
|
|
|
|
|
|
const valid = await validateNormalForm();
|
|
|
|
|
|
if (!valid) {
|
|
|
|
|
|
message.warning('表单校验不通过,请先完善表单!!');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pass) {
|
|
|
|
|
|
const nextAssigneesValid = validateNextAssignees();
|
|
|
|
|
|
if (!nextAssigneesValid) return;
|
|
|
|
|
|
const variables = getUpdatedProcessInstanceVariables();
|
|
|
|
|
|
// 审批通过数据
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
reason: approveReasonForm.reason,
|
|
|
|
|
|
variables, // 审批通过, 把修改的字段值赋于流程实例变量
|
|
|
|
|
|
nextAssignees: approveReasonForm.nextAssignees, // 下个自选节点选择的审批人信息
|
|
|
|
|
|
} as any;
|
|
|
|
|
|
// 签名
|
|
|
|
|
|
if (runningTask.value.signEnable) {
|
|
|
|
|
|
data.signPicUrl = approveReasonForm.signPicUrl;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 多表单处理,并且有额外的 approveForm 表单,需要校验 + 拼接到 data 表单里提交
|
|
|
|
|
|
// TODO 芋艿 任务有多表单这里要如何处理,会和可编辑的字段冲突
|
|
|
|
|
|
const formCreateApi = approveFormFApi.value;
|
|
|
|
|
|
if (Object.keys(formCreateApi)?.length > 0) {
|
|
|
|
|
|
await formCreateApi.validate();
|
|
|
|
|
|
data.variables = approveForm.value.value;
|
|
|
|
|
|
}
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await approveTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
popOverVisible.value.approve = false;
|
|
|
|
|
|
nextAssigneesActivityNode.value = [];
|
2025-08-02 22:25:30 +08:00
|
|
|
|
// 清理 Timeline 组件中的自定义审批人数据
|
|
|
|
|
|
if (nextAssigneesTimelineRef.value) {
|
|
|
|
|
|
nextAssigneesTimelineRef.value.batchSetCustomApproveUsers({});
|
|
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
message.success('审批通过成功');
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 审批不通过数据
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
reason: rejectReasonForm.reason,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await rejectTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
popOverVisible.value.reject = false;
|
|
|
|
|
|
message.success('审批不通过成功');
|
|
|
|
|
|
}
|
|
|
|
|
|
// 重置表单
|
|
|
|
|
|
formRef.resetFields();
|
|
|
|
|
|
// 加载最新数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理抄送 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleCopy() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1. 校验表单
|
|
|
|
|
|
if (!copyFormRef.value) return;
|
|
|
|
|
|
await copyFormRef.value.validate();
|
|
|
|
|
|
// 2. 提交抄送
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
reason: copyForm.copyReason,
|
|
|
|
|
|
copyUserIds: copyForm.copyUserIds,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await copyTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
copyFormRef.value.resetFields();
|
|
|
|
|
|
popOverVisible.value.copy = false;
|
2025-10-21 17:42:02 +08:00
|
|
|
|
message.success($t('ui.actionMessage.operationSuccess'));
|
2025-05-24 15:10:03 +08:00
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理转交 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleTransfer() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1.1 校验表单
|
2025-10-24 00:01:38 +08:00
|
|
|
|
if (!transferFormRef.value) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
await transferFormRef.value.validate();
|
|
|
|
|
|
// 1.2 提交转交
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
reason: transferForm.reason,
|
|
|
|
|
|
assigneeUserId: transferForm.assigneeUserId,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await transferTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
transferFormRef.value.resetFields();
|
|
|
|
|
|
popOverVisible.value.transfer = false;
|
2025-10-21 17:42:02 +08:00
|
|
|
|
message.success($t('ui.actionMessage.operationSuccess'));
|
2025-05-24 15:10:03 +08:00
|
|
|
|
// 2. 加载最新数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理委派 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleDelegate() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1.1 校验表单
|
|
|
|
|
|
if (!delegateFormRef.value) return;
|
|
|
|
|
|
await delegateFormRef.value.validate();
|
|
|
|
|
|
// 1.2 处理委派
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
reason: delegateForm.reason,
|
|
|
|
|
|
delegateUserId: delegateForm.delegateUserId,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await delegateTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
popOverVisible.value.delegate = false;
|
|
|
|
|
|
delegateFormRef.value.resetFields();
|
2025-10-21 17:42:02 +08:00
|
|
|
|
message.success($t('ui.actionMessage.operationSuccess'));
|
2025-05-24 15:10:03 +08:00
|
|
|
|
// 2. 加载最新数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理加签 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handlerAddSign(type: string) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1.1 校验表单
|
|
|
|
|
|
if (!addSignFormRef.value) return;
|
|
|
|
|
|
await addSignFormRef.value.validate();
|
|
|
|
|
|
// 1.2 提交加签
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
type,
|
|
|
|
|
|
reason: addSignForm.reason,
|
|
|
|
|
|
userIds: addSignForm.addSignUserIds,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await signCreateTask(data);
|
2025-10-21 17:42:02 +08:00
|
|
|
|
message.success($t('ui.actionMessage.operationSuccess'));
|
2025-05-24 15:10:03 +08:00
|
|
|
|
addSignFormRef.value.resetFields();
|
|
|
|
|
|
popOverVisible.value.addSign = false;
|
|
|
|
|
|
// 2 加载最新数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理退回 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleReturn() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1.1 校验表单
|
|
|
|
|
|
if (!returnFormRef.value) return;
|
|
|
|
|
|
await returnFormRef.value.validate();
|
|
|
|
|
|
// 1.2 提交退回
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: runningTask.value.id,
|
|
|
|
|
|
reason: returnForm.returnReason,
|
|
|
|
|
|
targetTaskDefinitionKey: returnForm.targetTaskDefinitionKey,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await returnTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
popOverVisible.value.return = false;
|
|
|
|
|
|
returnFormRef.value.resetFields();
|
2025-10-21 17:42:02 +08:00
|
|
|
|
message.success($t('ui.actionMessage.operationSuccess'));
|
2025-05-24 15:10:03 +08:00
|
|
|
|
// 2 重新加载数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理取消 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleCancel() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1.1 校验表单
|
|
|
|
|
|
if (!cancelFormRef.value) return;
|
|
|
|
|
|
await cancelFormRef.value.validate();
|
|
|
|
|
|
// 1.2 提交取消
|
|
|
|
|
|
await cancelProcessInstanceByStartUser(
|
|
|
|
|
|
props.processInstance.id,
|
|
|
|
|
|
cancelForm.cancelReason,
|
|
|
|
|
|
);
|
|
|
|
|
|
popOverVisible.value.return = false;
|
2025-10-21 17:42:02 +08:00
|
|
|
|
message.success($t('ui.actionMessage.operationSuccess'));
|
2025-05-24 15:10:03 +08:00
|
|
|
|
cancelFormRef.value.resetFields();
|
|
|
|
|
|
// 2 重新加载数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理再次提交 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handleReCreate() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
// 跳转发起流程界面
|
|
|
|
|
|
await router.push({
|
2025-10-26 09:10:52 +08:00
|
|
|
|
name: 'BpmProcessInstanceCreate',
|
2025-05-24 15:10:03 +08:00
|
|
|
|
query: { processInstanceId: props.processInstance?.id },
|
|
|
|
|
|
});
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 获取减签人员标签 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function getDeleteSignUserLabel(task: any): string {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const deptName = task?.assigneeUser?.deptName || task?.ownerUser?.deptName;
|
|
|
|
|
|
const nickname = task?.assigneeUser?.nickname || task?.ownerUser?.nickname;
|
|
|
|
|
|
return `${nickname} ( 所属部门:${deptName} )`;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-10-24 00:01:38 +08:00
|
|
|
|
|
2025-05-24 15:10:03 +08:00
|
|
|
|
/** 处理减签 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function handlerDeleteSign() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
formLoading.value = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 1.1 校验表单
|
|
|
|
|
|
if (!deleteSignFormRef.value) return;
|
|
|
|
|
|
await deleteSignFormRef.value?.validate();
|
|
|
|
|
|
// 1.2 提交减签
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
id: deleteSignForm.deleteSignTaskId,
|
|
|
|
|
|
reason: deleteSignForm.reason,
|
|
|
|
|
|
};
|
2025-10-27 09:13:32 +08:00
|
|
|
|
await signDeleteTask(data);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
message.success('减签成功');
|
|
|
|
|
|
deleteSignFormRef.value.resetFields();
|
|
|
|
|
|
popOverVisible.value.deleteSign = false;
|
|
|
|
|
|
// 2 加载最新数据
|
|
|
|
|
|
reload();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
formLoading.value = false;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-10-24 00:01:38 +08:00
|
|
|
|
|
2025-05-24 15:10:03 +08:00
|
|
|
|
/** 重新加载数据 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function reload() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
emit('success');
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 任务是否为处理中状态 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function isHandleTaskStatus() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
let canHandle = false;
|
|
|
|
|
|
if (BpmTaskStatusEnum.RUNNING === runningTask.value?.status) {
|
|
|
|
|
|
canHandle = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return canHandle;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 流程状态是否为结束状态 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function isEndProcessStatus(status: number) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
let isEndStatus = false;
|
|
|
|
|
|
if (
|
|
|
|
|
|
BpmProcessInstanceStatus.APPROVE === status ||
|
|
|
|
|
|
BpmProcessInstanceStatus.REJECT === status ||
|
|
|
|
|
|
BpmProcessInstanceStatus.CANCEL === status
|
|
|
|
|
|
) {
|
|
|
|
|
|
isEndStatus = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return isEndStatus;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 是否显示按钮 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function isShowButton(btnType: BpmTaskOperationButtonTypeEnum): boolean {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
let isShow = true;
|
|
|
|
|
|
if (
|
|
|
|
|
|
runningTask.value?.buttonsSetting &&
|
|
|
|
|
|
runningTask.value?.buttonsSetting[btnType]
|
|
|
|
|
|
) {
|
|
|
|
|
|
isShow = runningTask.value.buttonsSetting[btnType].enable;
|
|
|
|
|
|
}
|
|
|
|
|
|
return isShow;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 获取按钮的显示名称 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function getButtonDisplayName(btnType: BpmTaskOperationButtonTypeEnum) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
let displayName = OPERATION_BUTTON_NAME.get(btnType);
|
|
|
|
|
|
if (
|
|
|
|
|
|
runningTask.value?.buttonsSetting &&
|
|
|
|
|
|
runningTask.value?.buttonsSetting[btnType]
|
|
|
|
|
|
) {
|
|
|
|
|
|
displayName = runningTask.value.buttonsSetting[btnType].displayName;
|
|
|
|
|
|
}
|
|
|
|
|
|
return displayName;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
2025-10-24 00:01:38 +08:00
|
|
|
|
/** 加载待办任务 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function loadTodoTask(task: any) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
approveForm.value = {};
|
|
|
|
|
|
runningTask.value = task;
|
|
|
|
|
|
approveFormFApi.value = {};
|
|
|
|
|
|
reasonRequire.value = task?.reasonRequire ?? false;
|
|
|
|
|
|
nodeTypeName.value =
|
|
|
|
|
|
task?.nodeType === BpmNodeTypeEnum.TRANSACTOR_NODE ? '办理' : '审批';
|
2025-10-24 00:01:38 +08:00
|
|
|
|
// 处理 approve 表单
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (task && task.formId && task.formConf) {
|
|
|
|
|
|
const tempApproveForm = {};
|
|
|
|
|
|
setConfAndFields2(
|
|
|
|
|
|
tempApproveForm,
|
|
|
|
|
|
task.formConf,
|
|
|
|
|
|
task.formFields,
|
|
|
|
|
|
task.formVariables,
|
|
|
|
|
|
);
|
|
|
|
|
|
approveForm.value = tempApproveForm;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
approveForm.value = {}; // 占位,避免为空
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 校验流程表单 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
async function validateNormalForm() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (props.processDefinition?.formType === BpmModelFormType.NORMAL) {
|
|
|
|
|
|
let valid = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
await props.normalFormApi?.validate();
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
valid = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return valid;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 从可以编辑的流程表单字段,获取需要修改的流程实例的变量 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function getUpdatedProcessInstanceVariables() {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
const variables: any = {};
|
|
|
|
|
|
props.writableFields.forEach((field: string) => {
|
2025-07-04 19:52:34 +08:00
|
|
|
|
variables[field] = props.normalFormApi.getValue(field);
|
2025-05-24 15:10:03 +08:00
|
|
|
|
});
|
|
|
|
|
|
return variables;
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理签名完成 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function handleSignFinish(url: string) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
approveReasonForm.signPicUrl = url;
|
|
|
|
|
|
approveFormRef.value?.validateFields(['signPicUrl']);
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
/** 处理弹窗可见性 */
|
2025-06-06 20:45:45 +08:00
|
|
|
|
function handlePopoverVisible(visible: boolean) {
|
2025-05-24 15:10:03 +08:00
|
|
|
|
if (!visible) {
|
|
|
|
|
|
// 拦截关闭事件
|
|
|
|
|
|
popOverVisible.value.approve = true;
|
|
|
|
|
|
}
|
2025-06-06 20:45:45 +08:00
|
|
|
|
}
|
2025-05-24 15:10:03 +08:00
|
|
|
|
|
|
|
|
|
|
defineExpose({ loadTodoTask });
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
|
<!-- 【通过】按钮 -->
|
|
|
|
|
|
<!-- z-index 设置为300 避免覆盖签名弹窗 -->
|
|
|
|
|
|
<Space size="middle">
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.approve"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ minWidth: '400px', zIndex: 300 }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
@open-change="handlePopoverVisible"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.APPROVE)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button ghost type="primary" @click="openPopover('approve')">
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<IconifyIcon icon="lucide:check" />
|
2025-05-24 15:10:03 +08:00
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.APPROVE) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
|
|
|
|
|
<!-- 办理表单 -->
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="approveFormRef"
|
|
|
|
|
|
:model="approveReasonForm"
|
|
|
|
|
|
:rules="approveReasonRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<Card v-if="runningTask?.formId > 0" class="!-mt-2.5 mb-3.5">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<template #title>
|
|
|
|
|
|
<span class="el-icon-picture-outline">
|
|
|
|
|
|
填写表单【{{ runningTask?.formName }}】
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<FormCreate
|
|
|
|
|
|
v-model:value="approveForm.value"
|
|
|
|
|
|
v-model:api="approveFormFApi"
|
|
|
|
|
|
:option="approveForm.option"
|
|
|
|
|
|
:rule="approveForm.rule"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
|
|
<FormItem
|
|
|
|
|
|
label="下一个节点的审批人"
|
|
|
|
|
|
name="nextAssignees"
|
|
|
|
|
|
v-if="nextAssigneesActivityNode.length > 0"
|
|
|
|
|
|
>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="-mb-8 -mt-3.5 ml-2.5">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<ProcessInstanceTimeline
|
2025-08-02 22:25:30 +08:00
|
|
|
|
ref="nextAssigneesTimelineRef"
|
2025-05-24 15:10:03 +08:00
|
|
|
|
:activity-nodes="nextAssigneesActivityNode"
|
|
|
|
|
|
:show-status-icon="false"
|
2025-08-02 22:25:30 +08:00
|
|
|
|
:enable-approve-user-select="true"
|
2025-05-24 15:10:03 +08:00
|
|
|
|
@select-user-confirm="selectNextAssigneesConfirm"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem
|
|
|
|
|
|
v-if="runningTask.signEnable"
|
|
|
|
|
|
label="签名"
|
|
|
|
|
|
name="signPicUrl"
|
|
|
|
|
|
ref="approveSignFormRef"
|
|
|
|
|
|
>
|
2025-11-05 09:52:23 +08:00
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
|
<Button @click="openSignatureModal" type="primary">
|
|
|
|
|
|
{{ approveReasonForm.signPicUrl ? '重新签名' : '点击签名' }}
|
|
|
|
|
|
</Button>
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Image
|
2025-11-05 09:52:23 +08:00
|
|
|
|
class="!h-10 !w-40 object-contain"
|
2025-05-24 15:10:03 +08:00
|
|
|
|
v-if="approveReasonForm.signPicUrl"
|
|
|
|
|
|
:src="approveReasonForm.signPicUrl"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem :label="`${nodeTypeName}意见`" name="reason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="approveReasonForm.reason"
|
|
|
|
|
|
:placeholder="`请输入${nodeTypeName}意见`"
|
|
|
|
|
|
:rows="4"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleAudit(true, approveFormRef)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{
|
|
|
|
|
|
getButtonDisplayName(
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum.APPROVE,
|
|
|
|
|
|
)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button @click="closePopover('approve', approveFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【拒绝】按钮 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.reject"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ minWidth: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.REJECT)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button ghost danger type="primary" @click="openPopover('reject')">
|
2025-06-06 20:45:45 +08:00
|
|
|
|
<IconifyIcon icon="lucide:x" />
|
2025-05-24 15:10:03 +08:00
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.REJECT) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
|
|
|
|
|
<!-- 审批表单 -->
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="rejectFormRef"
|
|
|
|
|
|
:model="rejectReasonForm"
|
|
|
|
|
|
:rules="rejectReasonRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="审批意见" name="reason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="rejectReasonForm.reason"
|
|
|
|
|
|
placeholder="请输入审批意见"
|
|
|
|
|
|
:rows="4"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
danger
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleAudit(false, rejectFormRef)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{
|
|
|
|
|
|
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.REJECT)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
class="ml-2"
|
|
|
|
|
|
@click="closePopover('reject', rejectFormRef)"
|
|
|
|
|
|
>
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【抄送】按钮 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.copy"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ width: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.COPY)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('copy')">
|
2025-06-06 20:45:45 +08:00
|
|
|
|
<IconifyIcon icon="lucide:copy" />
|
2025-05-24 15:10:03 +08:00
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.COPY) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="copyFormRef"
|
|
|
|
|
|
:model="copyForm"
|
|
|
|
|
|
:rules="copyFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="抄送人" name="copyUserIds">
|
|
|
|
|
|
<Select
|
|
|
|
|
|
v-model:value="copyForm.copyUserIds"
|
|
|
|
|
|
:allow-clear="true"
|
|
|
|
|
|
mode="multiple"
|
|
|
|
|
|
placeholder="请选择抄送人"
|
2025-11-01 22:55:45 +08:00
|
|
|
|
class="w-full"
|
2025-05-24 15:10:03 +08:00
|
|
|
|
>
|
|
|
|
|
|
<SelectOption
|
|
|
|
|
|
v-for="item in userOptions"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.nickname"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ item.nickname }}
|
|
|
|
|
|
</SelectOption>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem label="抄送意见" name="copyReason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="copyForm.copyReason"
|
|
|
|
|
|
placeholder="请输入抄送意见"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleCopy"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{
|
|
|
|
|
|
getButtonDisplayName(BpmTaskOperationButtonTypeEnum.COPY)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button @click="closePopover('copy', copyFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【转办】按钮 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.transfer"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ width: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.TRANSFER)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('transfer')">
|
|
|
|
|
|
<IconifyIcon icon="icon-park-outline:share-two" />
|
|
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.TRANSFER) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="transferFormRef"
|
|
|
|
|
|
:model="transferForm"
|
|
|
|
|
|
:rules="transferFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="新审批人" name="assigneeUserId">
|
|
|
|
|
|
<Select
|
|
|
|
|
|
v-model:value="transferForm.assigneeUserId"
|
|
|
|
|
|
:allow-clear="true"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<SelectOption
|
|
|
|
|
|
v-for="item in userOptions"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.nickname"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ item.nickname }}
|
|
|
|
|
|
</SelectOption>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem label="审批意见" name="reason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="transferForm.reason"
|
2025-09-06 10:24:59 +08:00
|
|
|
|
allow-clear
|
2025-05-24 15:10:03 +08:00
|
|
|
|
placeholder="请输入审批意见"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleTransfer()"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{
|
|
|
|
|
|
getButtonDisplayName(
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum.TRANSFER,
|
|
|
|
|
|
)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button @click="closePopover('transfer', transferFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【委派】按钮 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.delegate"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ width: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.DELEGATE)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('delegate')">
|
|
|
|
|
|
<IconifyIcon :size="14" icon="icon-park-outline:user-positioning" />
|
|
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.DELEGATE) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="delegateFormRef"
|
|
|
|
|
|
:model="delegateForm"
|
|
|
|
|
|
:rules="delegateFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="接收人" name="delegateUserId">
|
|
|
|
|
|
<Select
|
|
|
|
|
|
v-model:value="delegateForm.delegateUserId"
|
|
|
|
|
|
:allow-clear="true"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<SelectOption
|
|
|
|
|
|
v-for="item in userOptions"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.nickname"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ item.nickname }}
|
|
|
|
|
|
</SelectOption>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem label="审批意见" name="reason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="delegateForm.reason"
|
2025-09-06 10:24:59 +08:00
|
|
|
|
allow-clear
|
2025-05-24 15:10:03 +08:00
|
|
|
|
placeholder="请输入审批意见"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleDelegate()"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{
|
|
|
|
|
|
getButtonDisplayName(
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum.DELEGATE,
|
|
|
|
|
|
)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button @click="closePopover('delegate', delegateFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【加签】按钮 当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.addSign"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ width: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.ADD_SIGN)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('addSign')">
|
|
|
|
|
|
<IconifyIcon :size="14" icon="icon-park-outline:plus" />
|
|
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.ADD_SIGN) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="addSignFormRef"
|
|
|
|
|
|
:model="addSignForm"
|
|
|
|
|
|
:rules="addSignFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="加签处理人" name="addSignUserIds">
|
|
|
|
|
|
<Select
|
|
|
|
|
|
v-model:value="addSignForm.addSignUserIds"
|
|
|
|
|
|
:allow-clear="true"
|
|
|
|
|
|
mode="multiple"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<SelectOption
|
|
|
|
|
|
v-for="item in userOptions"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.nickname"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ item.nickname }}
|
|
|
|
|
|
</SelectOption>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem label="审批意见" name="reason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="addSignForm.reason"
|
2025-09-06 10:24:59 +08:00
|
|
|
|
allow-clear
|
2025-05-24 15:10:03 +08:00
|
|
|
|
placeholder="请输入审批意见"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handlerAddSign('before')"
|
|
|
|
|
|
>
|
|
|
|
|
|
向前{{
|
|
|
|
|
|
getButtonDisplayName(
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum.ADD_SIGN,
|
|
|
|
|
|
)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handlerAddSign('after')"
|
|
|
|
|
|
>
|
|
|
|
|
|
向后{{
|
|
|
|
|
|
getButtonDisplayName(
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum.ADD_SIGN,
|
|
|
|
|
|
)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button @click="closePopover('addSign', addSignFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【减签】按钮 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.deleteSign"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ width: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="runningTask?.children.length > 0"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('deleteSign')">
|
|
|
|
|
|
<IconifyIcon :size="14" icon="icon-park-outline:minus" /> 减签
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="deleteSignFormRef"
|
|
|
|
|
|
:model="deleteSignForm"
|
|
|
|
|
|
:rules="deleteSignFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="减签人员" name="deleteSignTaskId">
|
|
|
|
|
|
<Select
|
|
|
|
|
|
v-model:value="deleteSignForm.deleteSignTaskId"
|
|
|
|
|
|
:allow-clear="true"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<SelectOption
|
|
|
|
|
|
v-for="item in runningTask.children"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="getDeleteSignUserLabel(item)"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ getDeleteSignUserLabel(item) }}
|
|
|
|
|
|
</SelectOption>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem label="审批意见" name="reason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="deleteSignForm.reason"
|
2025-09-06 10:24:59 +08:00
|
|
|
|
allow-clear
|
2025-05-24 15:10:03 +08:00
|
|
|
|
placeholder="请输入审批意见"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handlerDeleteSign()"
|
|
|
|
|
|
>
|
|
|
|
|
|
减签
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
@click="closePopover('deleteSign', deleteSignFormRef)"
|
|
|
|
|
|
>
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 【退回】按钮 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.return"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:overlay-style="{ width: '400px' }"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
runningTask &&
|
|
|
|
|
|
isHandleTaskStatus() &&
|
|
|
|
|
|
isShowButton(BpmTaskOperationButtonTypeEnum.RETURN)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('return')">
|
2025-06-15 15:53:12 +08:00
|
|
|
|
<IconifyIcon :size="14" icon="lucide:arrow-left" />
|
2025-05-24 15:10:03 +08:00
|
|
|
|
{{ getButtonDisplayName(BpmTaskOperationButtonTypeEnum.RETURN) }}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<div class="flex flex-1 flex-col px-5 pt-5" v-loading="formLoading">
|
2025-05-24 15:10:03 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="returnFormRef"
|
|
|
|
|
|
:model="returnForm"
|
|
|
|
|
|
:rules="returnFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="退回节点" name="targetTaskDefinitionKey">
|
|
|
|
|
|
<Select
|
|
|
|
|
|
v-model:value="returnForm.targetTaskDefinitionKey"
|
|
|
|
|
|
:allow-clear="true"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<SelectOption
|
|
|
|
|
|
v-for="item in returnList"
|
|
|
|
|
|
:key="item.taskDefinitionKey"
|
|
|
|
|
|
:label="item.name"
|
|
|
|
|
|
:value="item.taskDefinitionKey"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
</SelectOption>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem label="退回理由" name="returnReason">
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="returnForm.returnReason"
|
2025-09-06 10:24:59 +08:00
|
|
|
|
allow-clear
|
2025-05-24 15:10:03 +08:00
|
|
|
|
placeholder="请输入退回理由"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleReturn()"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{
|
|
|
|
|
|
getButtonDisplayName(
|
|
|
|
|
|
BpmTaskOperationButtonTypeEnum.RETURN,
|
|
|
|
|
|
)
|
|
|
|
|
|
}}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button @click="closePopover('return', returnFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
|
|
|
|
|
|
<!--【取消】按钮 这个对应发起人的取消, 只有发起人可以取消 -->
|
|
|
|
|
|
<Popover
|
|
|
|
|
|
v-model:open="popOverVisible.cancel"
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
:width="500"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
userId === processInstance?.startUser?.id &&
|
|
|
|
|
|
!isEndProcessStatus(processInstance?.status)
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Button type="dashed" @click="openPopover('cancel')">
|
|
|
|
|
|
<IconifyIcon :size="14" icon="icon-park-outline:back" />
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<template #content>
|
|
|
|
|
|
<div
|
2025-06-17 20:22:24 +08:00
|
|
|
|
class="flex w-96 flex-1 flex-col px-5 pt-5"
|
2025-05-24 15:10:03 +08:00
|
|
|
|
v-loading="formLoading"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Form
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
class="mb-auto"
|
|
|
|
|
|
ref="cancelFormRef"
|
|
|
|
|
|
:model="cancelForm"
|
|
|
|
|
|
:rules="cancelFormRule"
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<FormItem label="取消理由" name="cancelReason">
|
|
|
|
|
|
<Alert
|
2025-06-17 20:22:24 +08:00
|
|
|
|
class="mb-2 text-xs"
|
2025-05-24 15:10:03 +08:00
|
|
|
|
type="warning"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
show-icon
|
|
|
|
|
|
message="友情提醒:取消后,该审批流程将自动结束。"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<Textarea
|
|
|
|
|
|
v-model:value="cancelForm.cancelReason"
|
2025-09-06 10:24:59 +08:00
|
|
|
|
allow-clear
|
2025-05-24 15:10:03 +08:00
|
|
|
|
placeholder="请输入取消理由"
|
|
|
|
|
|
:rows="3"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem :wrapper-col="{ span: 18, offset: 0 }">
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
:disabled="formLoading"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleCancel()"
|
|
|
|
|
|
>
|
|
|
|
|
|
确认
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
|
|
<Button @click="closePopover('cancel', cancelFormRef)">
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
<!-- 【再次提交】 按钮-->
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type="dashed"
|
|
|
|
|
|
@click="handleReCreate()"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
userId === processInstance?.startUser?.id &&
|
|
|
|
|
|
isEndProcessStatus(processInstance?.status) &&
|
|
|
|
|
|
processDefinition?.formType === 10
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
2025-06-17 20:22:24 +08:00
|
|
|
|
<IconifyIcon :size="14" icon="lucide:refresh-cw" /> 再次提交
|
2025-05-24 15:10:03 +08:00
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 签名弹窗 -->
|
2025-06-06 20:45:45 +08:00
|
|
|
|
<SignatureModal @success="handleSignFinish" />
|
2025-05-24 15:10:03 +08:00
|
|
|
|
</template>
|