[as] 2차 결재 버튼 표시 부분 검증
This commit is contained in:
@@ -6,8 +6,11 @@ export function hasCurrentUserPendingApprovalRequest(
|
||||
): boolean {
|
||||
if (!currentUserUuid) return false;
|
||||
|
||||
const normalizedUserUuid = currentUserUuid.toLowerCase();
|
||||
return list.some(
|
||||
(row) => row.aprvrUuid === currentUserUuid && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
||||
(row) =>
|
||||
row.aprvrUuid?.toLowerCase() === normalizedUserUuid &&
|
||||
row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +20,10 @@ export function findCurrentUserPendingApprovalRequest(
|
||||
): ElaprDocPrgrsResponseDto | undefined {
|
||||
if (!currentUserUuid) return undefined;
|
||||
|
||||
const normalizedUserUuid = currentUserUuid.toLowerCase();
|
||||
return list?.find(
|
||||
(row) => row.aprvrUuid === currentUserUuid && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
||||
(row) =>
|
||||
row.aprvrUuid?.toLowerCase() === normalizedUserUuid &&
|
||||
row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -201,13 +201,14 @@ function FloatingActionButtons({
|
||||
userInfo?.userUnqId,
|
||||
);
|
||||
const currentUserPrgrsRow = elaprPrgrsForPending.find(
|
||||
(row) => row.aprvrUuid === userInfo?.userUnqId,
|
||||
(row) => row.aprvrUuid?.toLowerCase() === userInfo?.userUnqId?.toLowerCase(),
|
||||
);
|
||||
const userPendingPrgrs = elaprPrgrsForPending.find(
|
||||
(row) =>
|
||||
row.aprvrUuid === userInfo?.userUnqId &&
|
||||
row.aprvrUuid?.toLowerCase() === userInfo?.userUnqId?.toLowerCase() &&
|
||||
row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
||||
);
|
||||
const userBranchId = userPendingPrgrs?.branchId ?? currentUserPrgrsRow?.branchId;
|
||||
const userBranchSeCd = (userPendingPrgrs?.branchSeCd ?? currentUserPrgrsRow?.branchSeCd) as
|
||||
| "SP"
|
||||
| "SF"
|
||||
@@ -255,7 +256,10 @@ function FloatingActionButtons({
|
||||
if (!isForkJoin || !userBranchSeCd) return undefined;
|
||||
|
||||
// 1. elaprBranchList API 응답에서 사용자 브랜치 상태 확인
|
||||
const matchedBranch = elaprBranchList.find((b) => b.branchSeCd === userBranchSeCd);
|
||||
// 현재 결재선(2차 차수 등)의 고유 branchId로 우선 매칭하고, 없으면 findLast로 최신 차수 브랜치 매칭
|
||||
const matchedBranch = userBranchId
|
||||
? elaprBranchList.find((b) => b.branchId === userBranchId)
|
||||
: elaprBranchList.findLast((b) => b.branchSeCd === userBranchSeCd);
|
||||
if (matchedBranch?.branchSttsCd) {
|
||||
return matchedBranch.branchSttsCd;
|
||||
}
|
||||
@@ -281,7 +285,15 @@ function FloatingActionButtons({
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}, [elaprBranchList, elaprPrgrsForPending, isForkJoin, prgrsSttsComCd, supplementDmndBranch, userBranchSeCd]);
|
||||
}, [
|
||||
elaprBranchList,
|
||||
elaprPrgrsForPending,
|
||||
isForkJoin,
|
||||
prgrsSttsComCd,
|
||||
supplementDmndBranch,
|
||||
userBranchId,
|
||||
userBranchSeCd,
|
||||
]);
|
||||
|
||||
const isBranchInProgress =
|
||||
isForkJoin && userBranchSttsCd === "IN_PROGRESS" && dtlInstCd === "ROLE_USER01";
|
||||
|
||||
Reference in New Issue
Block a user