chore: 审批完成后刷新当前页
This commit is contained in:
parent
2e3d385747
commit
7d9ddd4698
@ -125,8 +125,8 @@ async function handleSubmit() {
|
||||
variables: {},
|
||||
} as CompleteTaskReqData;
|
||||
await completeTask(requestData);
|
||||
emit('complete');
|
||||
modalApi.close();
|
||||
emit('complete');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
|
@ -43,6 +43,11 @@ defineOptions({
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
const props = defineProps<{ task?: TaskInfo; type: ApprovalType }>();
|
||||
|
||||
/**
|
||||
* 下面按钮点击后会触发的事件
|
||||
*/
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const currentTask = ref<TaskInfo>();
|
||||
/**
|
||||
* 是否显示 加签/减签操作
|
||||
@ -142,6 +147,7 @@ function handleTermination() {
|
||||
okButtonProps: { danger: true },
|
||||
onOk: async () => {
|
||||
await terminationTask({ taskId: props.task!.id });
|
||||
emit('reload');
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -179,6 +185,7 @@ function handleDelegation(userList: User[]) {
|
||||
{ taskId: props.task!.id, userId: current!.userId },
|
||||
'delegateTask',
|
||||
);
|
||||
emit('reload');
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -201,6 +208,7 @@ function handleTransfer(userList: User[]) {
|
||||
{ taskId: props.task!.id, userId: current!.userId },
|
||||
'transferTask',
|
||||
);
|
||||
emit('reload');
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -217,6 +225,7 @@ function handleAddSignature(userList: User[]) {
|
||||
centered: true,
|
||||
onOk: async () => {
|
||||
await taskOperation({ taskId: props.task!.id, userIds }, 'addSignature');
|
||||
emit('reload');
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -236,6 +245,7 @@ function handleReductionSignature(userList: User[]) {
|
||||
{ taskId: props.task!.id, userIds },
|
||||
'reductionSignature',
|
||||
);
|
||||
emit('reload');
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -357,8 +367,8 @@ function handleReductionSignature(userList: User[]) {
|
||||
</template>
|
||||
<a-button> 其他 </a-button>
|
||||
</Dropdown>
|
||||
<ApprovalModal />
|
||||
<RejectionModal />
|
||||
<ApprovalModal @complete="$emit('reload')" />
|
||||
<RejectionModal @complete="$emit('reload')" />
|
||||
<DelegationModal mode="single" @finish="handleDelegation" />
|
||||
<TransferModal mode="single" @finish="handleTransfer" />
|
||||
<AddSignatureModal mode="multiple" @finish="handleAddSignature" />
|
||||
|
@ -113,8 +113,8 @@ async function handleSubmit() {
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
console.log(data);
|
||||
await backProcess(data);
|
||||
emit('complete');
|
||||
modalApi.close();
|
||||
emit('complete');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
|
@ -5,6 +5,7 @@ import type { TaskInfo } from '#/api/workflow/task/model';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { useTabs } from '@vben/hooks';
|
||||
|
||||
import { Empty, InputSearch } from 'ant-design-vue';
|
||||
import { debounce } from 'lodash-es';
|
||||
@ -77,6 +78,8 @@ async function handleCardClick(item: TaskInfo) {
|
||||
const resp = await flowInfo(businessId);
|
||||
currentInstance.value = resp;
|
||||
}
|
||||
|
||||
const { refreshTab } = useTabs();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -115,7 +118,7 @@ async function handleCardClick(item: TaskInfo) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ApprovalPanel :task="currentTask" type="myself" />
|
||||
<ApprovalPanel :task="currentTask" type="myself" @reload="refreshTab" />
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -5,6 +5,7 @@ import type { TaskInfo } from '#/api/workflow/task/model';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { useTabs } from '@vben/hooks';
|
||||
|
||||
import { Empty, InputSearch } from 'ant-design-vue';
|
||||
import { debounce } from 'lodash-es';
|
||||
@ -78,6 +79,8 @@ async function handleCardClick(item: TaskInfo) {
|
||||
const resp = await flowInfo(businessId);
|
||||
currentInstance.value = resp;
|
||||
}
|
||||
|
||||
const { refreshTab } = useTabs();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -116,7 +119,7 @@ async function handleCardClick(item: TaskInfo) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ApprovalPanel :task="currentTask" type="approve" />
|
||||
<ApprovalPanel :task="currentTask" type="approve" @reload="refreshTab" />
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user