update 调整流程办理

This commit is contained in:
gssong 2023-11-20 21:49:58 +08:00
parent b197abef37
commit b8a3ccb867
2 changed files with 16 additions and 4 deletions

View File

@ -30,8 +30,15 @@ import { ref } from 'vue';
import { ComponentInternalInstance } from 'vue'; import { ComponentInternalInstance } from 'vue';
import { ElForm } from 'element-plus'; import { ElForm } from 'element-plus';
import { completeTask, backProcess, getBusinessStatus } from '@/api/workflow/task'; import { completeTask, backProcess, getBusinessStatus } from '@/api/workflow/task';
import { any } from 'vue-types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const props = defineProps({
taskVariables: {
type: Object as () => Record<string, any>,
default: {}
}
});
// //
const loading = ref(true); const loading = ref(true);
// //
@ -74,6 +81,7 @@ const emits = defineEmits(['submitCallback', 'cancelCallback']);
/** 办理流程 */ /** 办理流程 */
const handleCompleteTask = async () => { const handleCompleteTask = async () => {
form.value.taskId = taskId.value; form.value.taskId = taskId.value;
form.value.taskVariables = props.taskVariables;
await proxy?.$modal.confirm('是否确认提交?'); await proxy?.$modal.confirm('是否确认提交?');
loading.value = true loading.value = true
buttonLoading.value = true buttonLoading.value = true

View File

@ -92,7 +92,7 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 提交组件 --> <!-- 提交组件 -->
<submitVerify ref="submitVerifyRef" @submitCallback="submitCallback" /> <submitVerify ref="submitVerifyRef" @submitCallback="submitCallback" :taskVariables="taskVariables"/>
<!-- 审批记录 --> <!-- 审批记录 -->
<approvalRecord ref="approvalRecordRef" /> <approvalRecord ref="approvalRecordRef" />
</div> </div>
@ -129,6 +129,8 @@ const submitFormData = ref<Record<string, any>>({
processKey: '', processKey: '',
variables: {} variables: {}
}); });
const taskVariables = ref<Record<string, any>>({});
const dialog = reactive<DialogOption>({ const dialog = reactive<DialogOption>({
visible: false, visible: false,
@ -265,13 +267,15 @@ const handleExport = () => {
// //
const handleStartWorkFlow = async (data: any) => { const handleStartWorkFlow = async (data: any) => {
submitFormData.value.processKey = 'demo01'; submitFormData.value.processKey = 'leave5';
submitFormData.value.businessKey = data.id; submitFormData.value.businessKey = data.id;
// //
submitFormData.value.variables = { taskVariables.value = {
entity: data, entity: data,
leaveDays: data.leaveDays, leaveDays: data.leaveDays,
}; userList:[1,2]
}
submitFormData.value.variables = taskVariables.value;
startWorkFlow(submitFormData.value).then((response: any) => { startWorkFlow(submitFormData.value).then((response: any) => {
if (submitVerifyRef.value) { if (submitVerifyRef.value) {
buttonLoading.value = false buttonLoading.value = false