mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 08:22:41 +08:00
review:代码审查
This commit is contained in:
parent
3725e9d352
commit
8244050ea0
@ -44,7 +44,11 @@
|
|||||||
:rows="4"
|
:rows="4"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下一个节点的审批人" prop="nextAssignees" v-if="nextAssigneesActivityNode.length > 0">
|
<el-form-item
|
||||||
|
label="下一个节点的审批人"
|
||||||
|
prop="nextAssignees"
|
||||||
|
v-if="nextAssigneesActivityNode.length > 0"
|
||||||
|
>
|
||||||
<div class="ml-10px -mt-15px -mb-35px">
|
<div class="ml-10px -mt-15px -mb-35px">
|
||||||
<ProcessInstanceTimeline
|
<ProcessInstanceTimeline
|
||||||
:activity-nodes="nextAssigneesActivityNode"
|
:activity-nodes="nextAssigneesActivityNode"
|
||||||
@ -725,11 +729,12 @@ const initNextAssigneesFormField = async () => {
|
|||||||
})
|
})
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
data.forEach((node: any) => {
|
data.forEach((node: any) => {
|
||||||
|
// 如果是发起人自选,并且没有审批人 或者 是审批人自选
|
||||||
if (
|
if (
|
||||||
isEmpty(node.tasks) &&
|
(isEmpty(node.tasks) &&
|
||||||
isEmpty(node.candidateUsers) &&
|
isEmpty(node.candidateUsers) &&
|
||||||
(CandidateStrategy.START_USER_SELECT === node.candidateStrategy ||
|
CandidateStrategy.START_USER_SELECT === node.candidateStrategy) ||
|
||||||
CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy)
|
CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy
|
||||||
) {
|
) {
|
||||||
nextAssigneesActivityNode.value.push(node)
|
nextAssigneesActivityNode.value.push(node)
|
||||||
}
|
}
|
||||||
@ -741,6 +746,20 @@ const initNextAssigneesFormField = async () => {
|
|||||||
const selectNextAssigneesConfirm = (id: string, userList: any[]) => {
|
const selectNextAssigneesConfirm = (id: string, userList: any[]) => {
|
||||||
approveReasonForm.nextAssignees[id] = userList?.map((item: any) => item.id)
|
approveReasonForm.nextAssignees[id] = userList?.map((item: any) => item.id)
|
||||||
}
|
}
|
||||||
|
/** 审批通过时,校验每个自选审批人的节点是否都已配置了审批人 */
|
||||||
|
const validateNextAssignees = () => {
|
||||||
|
// 如果需要自选审批人,则校验自选审批人
|
||||||
|
if (Object.keys(nextAssigneesActivityNode.value).length > 0) {
|
||||||
|
// 校验每个节点是否都已配置审批人
|
||||||
|
for (const item of nextAssigneesActivityNode.value) {
|
||||||
|
if (isEmpty(approveReasonForm.nextAssignees[item.id])) {
|
||||||
|
message.warning('下一个节点的审批人不能为空!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
/** 处理审批通过和不通过的操作 */
|
/** 处理审批通过和不通过的操作 */
|
||||||
const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) => {
|
const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) => {
|
||||||
@ -757,12 +776,8 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pass) {
|
if (pass) {
|
||||||
// 如果需要自选审批人,则校验自选审批人
|
const nextAssigneesValid = validateNextAssignees()
|
||||||
if (Object.keys(nextAssigneesActivityNode.value).length > 0
|
if (!nextAssigneesValid) return
|
||||||
&& Object.keys(approveReasonForm.nextAssignees).length === 0) {
|
|
||||||
message.warning('下一个节点的审批人不能为空!')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const variables = getUpdatedProcessInstanceVariables()
|
const variables = getUpdatedProcessInstanceVariables()
|
||||||
// 审批通过数据
|
// 审批通过数据
|
||||||
const data = {
|
const data = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user