update 调整请假申请流程提交

This commit is contained in:
gssong 2023-10-07 17:45:30 +08:00
parent a3a0fae63b
commit 136ad0b42e
2 changed files with 12 additions and 8 deletions

View File

@ -56,7 +56,7 @@
v-hasPermi="['demo:leave:remove']"></el-button>
</el-tooltip>
<el-tooltip content="撤销" placement="top" v-if="scope.row.processInstanceVo.businessStatus === 'waiting'">
<el-button link type="primary" icon="Promotion"
<el-button link type="primary" icon="Notification"
@click="handleCancelProcessApply(scope.row.processInstanceVo.id)"></el-button>
</el-tooltip>
<el-tooltip content="审批记录" placement="top" v-if="scope.row.processInstanceVo.businessStatus === 'waiting'">
@ -209,14 +209,13 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = (row?: LeaveVO) => {
loading.value = true;
buttonLoading.value = false;
dialog.visible = true;
dialog.title = '修改请假申请';
nextTick(async () => {
reset();
const _id = row?.id || ids.value[0];
const res = await getLeave(_id);
loading.value = false;
Object.assign(form.value, res.data);
});
};
@ -228,17 +227,18 @@ const submitForm = (status: string) => {
buttonLoading.value = true;
let res = {};
if (form.value.id) {
res = await updateLeave(form.value).finally(() => (buttonLoading.value = false));
res = await updateLeave(form.value)
} else {
res = await addLeave(form.value).finally(() => (buttonLoading.value = false));
res = await addLeave(form.value)
}
form.value = res.data
if (status === 'draft') {
buttonLoading.value = false
proxy?.$modal.msgSuccess('暂存成功');
dialog.visible = false;
} else {
handleStartWorkFlow(res.data);
}
await getList();
}
});
};
@ -265,14 +265,16 @@ const handleExport = () => {
//
const handleStartWorkFlow = async (data: any) => {
submitFormData.value.processKey = 'test2';
submitFormData.value.processKey = 'demo01';
submitFormData.value.businessKey = data.id;
//
submitFormData.value.variables = {
entity: data,
leaveDays: data.leaveDays,
userList: [1]
};
startWorkFlow(submitFormData.value).then((response: any) => {
if (submitVerifyRef.value) {
buttonLoading.value = false
submitVerifyRef.value.openDialog(response.data.taskId);
}
});

View File

@ -69,6 +69,8 @@
<el-button type="text" size="small" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</el-col>
<el-col :span="1.5" v-if="scope.row.businessStatus === 'waiting'">
<el-button type="text" size="small" icon="Notification"
@click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
</el-col>
<el-col :span="1.5"
v-if="scope.row.businessStatus === 'draft' || scope.row.businessStatus === 'cancel' || scope.row.businessStatus === 'back'">