diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index bacbe62..6e01705 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -30,8 +30,15 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; import { completeTask, backProcess, getBusinessStatus } from '@/api/workflow/task'; +import { any } from 'vue-types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const props = defineProps({ + taskVariables: { + type: Object as () => Record, + default: {} + } +}); //遮罩层 const loading = ref(true); //按钮 @@ -74,6 +81,7 @@ const emits = defineEmits(['submitCallback', 'cancelCallback']); /** 办理流程 */ const handleCompleteTask = async () => { form.value.taskId = taskId.value; + form.value.taskVariables = props.taskVariables; await proxy?.$modal.confirm('是否确认提交?'); loading.value = true buttonLoading.value = true diff --git a/src/views/demo/leave/index.vue b/src/views/demo/leave/index.vue index 903d58b..a46e199 100644 --- a/src/views/demo/leave/index.vue +++ b/src/views/demo/leave/index.vue @@ -92,7 +92,7 @@ - + @@ -129,6 +129,8 @@ const submitFormData = ref>({ processKey: '', variables: {} }); +const taskVariables = ref>({}); + const dialog = reactive({ visible: false, @@ -265,13 +267,15 @@ const handleExport = () => { //提交申请 const handleStartWorkFlow = async (data: any) => { - submitFormData.value.processKey = 'demo01'; + submitFormData.value.processKey = 'leave5'; submitFormData.value.businessKey = data.id; //流程变量 - submitFormData.value.variables = { + taskVariables.value = { entity: data, leaveDays: data.leaveDays, - }; + userList:[1,2] + } + submitFormData.value.variables = taskVariables.value; startWorkFlow(submitFormData.value).then((response: any) => { if (submitVerifyRef.value) { buttonLoading.value = false