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"
/>