feat-wip(projects): 办理功能弹窗适配

This commit is contained in:
AN 2025-07-10 22:22:14 +08:00
parent 39b0c636f2
commit 3a506df9b9
3 changed files with 12 additions and 4 deletions

View File

@ -84,7 +84,7 @@ defineExpose({
<NButton v-if="showSubmit || showApproval" @click="handleClose">{{ $t('common.cancel') }}</NButton>
<NButton v-if="showSubmit" type="warning" @click="handleSaveDraft">暂存</NButton>
<NButton v-if="showSubmit" type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</NButton>
<NButton v-if="showApproval" type="warning" @click="handleApproval">办理</NButton>
<NButton v-if="showApproval" type="primary" @click="handleApproval">办理</NButton>
</NSpace>
</div>
</slot>

View File

@ -21,13 +21,15 @@ interface Props {
operateType: CommonType.WorkflowTableOperateType;
/** 业务ID */
businessId?: CommonType.IdType;
taskId?: CommonType.IdType;
/** the edit row data */
rowData?: Api.Workflow.Leave | null;
}
const props = withDefaults(defineProps<Props>(), {
rowData: null,
businessId: undefined
businessId: undefined,
taskId: undefined
});
interface Emits {
@ -59,6 +61,8 @@ const readonly = computed(() => {
return props.operateType === 'detail' || props.operateType === 'approval';
});
const taskId = ref<CommonType.IdType>(props.taskId!);
const respLeave = ref<Api.Workflow.Leave>();
const startWorkflowResult = ref<Api.Workflow.StartWorkflowResult>();
@ -209,6 +213,7 @@ async function handleSubmit() {
const { error, data } = await fetchStartWorkflow(startWorkflowModel);
if (error) return;
startWorkflowResult.value = data;
taskId.value = data.taskId!;
setTaskApplyVisible();
}
@ -298,7 +303,7 @@ watch(visible, initializeData, { immediate: true });
</FlowDrawer>
<FlowTaskApprovalModal
v-model:visible="taskApplyVisible"
:task-id="startWorkflowResult?.taskId!"
:task-id="taskId"
:task-variables="taskVariables"
@finished="handleTaskFinished"
/>

View File

@ -159,9 +159,11 @@ function handleResetSearch() {
}
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
const businessId = ref<CommonType.IdType>();
const taskId = ref<CommonType.IdType>();
async function handleApproval(row: Api.Workflow.Task) {
businessId.value = row.businessId;
taskId.value = row.id;
const formPath = row.formPath;
if (formPath) {
dynamicComponent.value = await loadDynamicComponent(modules, formPath);
@ -205,7 +207,7 @@ async function handleApproval(row: Api.Workflow.Task) {
</template>
<div class="h-full flex-col-stretch gap-12px overflow-hidden lt-sm:overflow-auto">
<TaskWaitingSearch v-model:model="searchParams" @reset="handleResetSearch" @search="getDataByPage" />
<NCard title="我发起的" :bordered="false" size="small" class="card-wrapper sm:flex-1-hidden">
<NCard title="我待办" :bordered="false" size="small" class="card-wrapper sm:flex-1-hidden">
<template #header-extra>
<TableHeaderOperation
v-model:columns="columnChecks"
@ -235,6 +237,7 @@ async function handleApproval(row: Api.Workflow.Task) {
:visible="viewVisible"
operate-type="approval"
:business-id="businessId"
:task-id="taskId"
@submitted="getData"
/>
</NCard>