diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index 6d3d598..68e49f8 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -102,4 +102,28 @@ export const returnTask = (taskId: string) => { }); }; +/** + * 任务驳回 + * @param taskId + * @returns {*} + */ +export const backProcess = (data: object) => { + return request({ + url: '/workflow/task/backProcess', + method: 'post', + data: data + }); +}; + +/** + * 获取流程状态 + * @param taskId + * @returns + */ +export const getBusinessStatus = (taskId: string) => { + return request({ + url: '/workflow/task/getBusinessStatus/' + taskId, + method: 'get' + }); +}; diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 184deb2..9bf9c17 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -16,6 +16,7 @@ 取消 提交 + 退回 @@ -25,7 +26,7 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask } from '@/api/workflow/task'; +import { completeTask, backProcess, getBusinessStatus } from '@/api/workflow/task'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const props = defineProps({ taskId: { @@ -35,8 +36,10 @@ const props = defineProps({ } }); -// 遮罩层 +//遮罩层 const loading = ref(true); +//流程状态 +const businessStatus = ref(''); const dialog = reactive({ visible: false, @@ -51,7 +54,13 @@ const form = ref>({ }); //打开弹窗 const openDialog = (visible?: any) => { + form.value.message = undefined; dialog.visible = visible; + nextTick(() => { + getBusinessStatus(props.taskId).then((response) => { + businessStatus.value = response.data; + }); + }); }; onMounted(() => {}); @@ -66,6 +75,17 @@ const handleCompleteTask = async () => { emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); }; + +/** 驳回流程 */ +const handleBackProcess = async () => { + form.value.taskId = props.taskId; + await proxy?.$modal.confirm('是否确认驳回到申请人?'); + await backProcess(form.value).finally(() => (loading.value = false)); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); +}; + /** * 对外暴露子组建方法 */