feat:流程自动审批功能
把checkIsAutoAgree 方法提出来,作为方法增加实现功能
This commit is contained in:
@ -431,24 +431,34 @@
|
|||||||
if (validateSuccess.value || values === 'reject' || values === 'finish') {
|
if (validateSuccess.value || values === 'reject' || values === 'finish') {
|
||||||
let params = await getApproveParams();
|
let params = await getApproveParams();
|
||||||
let response = await postApproval(params);
|
let response = await postApproval(params);
|
||||||
// 判断返回值是否带有isAutoAgree 来判断中间是否有自动审批的业务,如有执行判断
|
// 判断返回值是否带有isAutoAgree 来判断中间是否有自动审批的业务,如有再执行判断待审人员是否包含自己,不包含就直接flowSuccess
|
||||||
if (response != null && response.length != 0 && response[0].isAutoAgree == true) {
|
if (checkIsAutoAgree(response)) return
|
||||||
// 判断待审人员是否包含自己,不包含就直接flowSuccess
|
flowSuccess();
|
||||||
if (response[0].approveUserIds.includes(userStore.getUserInfo.id)) {
|
data.submitLoading = false;
|
||||||
taskId.value = response[0].taskId;
|
|
||||||
data.submitLoading = false;
|
|
||||||
onApproveClick(true);
|
|
||||||
} else {
|
|
||||||
flowSuccess();
|
|
||||||
data.submitLoading = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
flowSuccess();
|
|
||||||
data.submitLoading = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
flowFail();
|
flowFail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断该次审核是否触发自动同意事务,并且检验返回得task 是否是自身作为被审需要弹框再次审核
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
async function checkIsAutoAgree(response) {
|
||||||
|
if (response != null
|
||||||
|
&& response.length != 0
|
||||||
|
&& response[0].isAutoAgree == true //
|
||||||
|
&& response[0].approveUserIds.includes(userStore.getUserInfo.id)) {
|
||||||
|
console.error('will reSelect user=', response[0].taskId);
|
||||||
|
// 注入新得taskId
|
||||||
|
taskId.value = response[0].taskId;
|
||||||
|
data.submitLoading = false;
|
||||||
|
onApproveClick(true);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user