mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor: 优化代码
This commit is contained in:
@ -119,9 +119,8 @@ function closeDrawer() {
|
|||||||
visible.value = false;
|
visible.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSaveDraft() {
|
async function handleOperate() {
|
||||||
await validate();
|
await validate();
|
||||||
|
|
||||||
// request
|
// request
|
||||||
if (props.operateType === 'add') {
|
if (props.operateType === 'add') {
|
||||||
const { leaveType, startDate, endDate, leaveDays, remark } = model;
|
const { leaveType, startDate, endDate, leaveDays, remark } = model;
|
||||||
@ -138,10 +137,16 @@ async function handleSaveDraft() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleSaveDraft() {
|
||||||
|
await handleOperate();
|
||||||
|
window.$message?.success($t('common.updateSuccess'));
|
||||||
|
closeDrawer();
|
||||||
|
}
|
||||||
|
|
||||||
const taskVariables = ref<{ [key: string]: any }>({});
|
const taskVariables = ref<{ [key: string]: any }>({});
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
await handleSaveDraft();
|
await handleOperate();
|
||||||
// 提交流程
|
// 提交流程
|
||||||
startWorkflowModel.businessId = respLeave.value?.id;
|
startWorkflowModel.businessId = respLeave.value?.id;
|
||||||
startWorkflowModel.flowCode = model.flowCode;
|
startWorkflowModel.flowCode = model.flowCode;
|
||||||
@ -200,7 +205,7 @@ watch(visible, () => {
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<NSpace :size="16">
|
<NSpace :size="16">
|
||||||
<NButton @click="closeDrawer">{{ $t('common.cancel') }}</NButton>
|
<NButton @click="closeDrawer">{{ $t('common.cancel') }}</NButton>
|
||||||
<NButton @click="handleSaveDraft">暂存</NButton>
|
<NButton type="warning" @click="handleSaveDraft">暂存</NButton>
|
||||||
<NButton type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</NButton>
|
<NButton type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</NButton>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
</template>
|
</template>
|
||||||
|
Reference in New Issue
Block a user