fix: 修复第二次提交流程时,表单校验错误依然会触发审批流的bug

This commit is contained in:
gaoyunqi
2024-08-23 14:08:52 +08:00
parent 9001db04ff
commit 20c6ada48a

View File

@ -80,6 +80,7 @@
import ProcessInformation from '/@/views/workflow/task/components/flow/ProcessInformation.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
const { t } = useI18n();
const { notification } = useMessage();
@ -106,7 +107,7 @@
const hasBtnApprove = ref(true);
const hasBtnReject = ref(false);
const hasBtnFinish = ref(false);
const drawNode = ref('')
const drawNode = ref('');
let approvalData = reactive({
isCountersign: false,
@ -140,33 +141,33 @@
});
} else if (key === 'transfer') {
onTransferClick();
} else if(key === 'drawBack') {
} else if (key === 'drawBack') {
Modal.confirm({
title: t('提示'),
icon: createVNode(ExclamationCircleOutlined),
content: t('请确认是否撤回该流程?'),
okText: t('确定'),
okType: 'danger',
cancelText: t('取消'),
onOk() {
withdraw(processId.value, drawNode.value).then(res => {
if (res) {
notification.open({
type: 'success',
message: t('撤回'),
description: t('撤回成功'),
title: t('提示'),
icon: createVNode(ExclamationCircleOutlined),
content: t('请确认是否撤回该流程?'),
okText: t('确定'),
okType: 'danger',
cancelText: t('取消'),
onOk() {
withdraw(processId.value, drawNode.value).then((res) => {
if (res) {
notification.open({
type: 'success',
message: t('撤回'),
description: t('撤回成功')
});
} else {
notification.open({
type: 'error',
message: t('撤回'),
description: t('撤回失败')
});
}
});
} else {
notification.open({
type: 'error',
message: t('撤回'),
description: t('撤回失败'),
});
}
})
},
onCancel() {},
});
},
onCancel() {}
});
}
}
@ -184,6 +185,9 @@
async function onApproveClick() {
await submit();
if (!validateSuccess.value) {
return;
}
const params = await getApproveParams();
const nextNodes = await postGetNextTaskMaybeArrival(params);
approvalData.approvedType = ApproveType.AGREE;
@ -333,18 +337,18 @@
approvalData.circulateConfigs = [];
}
renderKey.value = Math.random() + '';
getBackNode()
getBackNode();
} catch (error) {}
});
function getBackNode() {
getDrawNode(processId.value).then(res => {
getDrawNode(processId.value).then((res) => {
if (res.length) {
drawNode.value = res[0].activityId
drawNode.value = res[0].activityId;
} else {
drawNode.value = ''
drawNode.value = '';
}
})
});
}
async function submit() {