From 5d1027cc3a6c13e30c4e80f57b49bf176665c28d Mon Sep 17 00:00:00 2001
From: gssong <1742057357@qq.com>
Date: Sun, 9 Jul 2023 12:45:49 +0800
Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E9=A9=B3=E5=9B=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/workflow/task/index.ts | 24 ++++++++++++++++++++++++
src/components/Process/submitVerify.vue | 24 ++++++++++++++++++++++--
2 files changed, 46 insertions(+), 2 deletions(-)
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('操作成功');
+};
+
/**
* 对外暴露子组建方法
*/