[as fr] 웹기안기 호출 팝업에 빌드및 lint 에러 해결
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { useContext, useEffect, useMemo, useState } from "react";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { PanelRightClose, PanelRightOpen } from "lucide-react";
|
||||
import { useStore } from "zustand";
|
||||
|
||||
import { getDefaultFileKey, useAlertStore, useTus } from "@/shared/lib";
|
||||
import { StoreContext } from "@/shared/providers";
|
||||
import { getDefaultFileKey, useAlertStore, useTus, useUserStore } from "@/shared/lib";
|
||||
import { AttachmentFileField } from "@/shared/ui";
|
||||
import {
|
||||
attachService,
|
||||
@@ -155,8 +152,7 @@ function PwrkCnsltnDocMngDialog({
|
||||
}: PwrkCnsltnDocMngDialogProps) {
|
||||
const queryClient = useQueryClient();
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const storeContext = useContext(StoreContext);
|
||||
const userInfo = storeContext ? useStore(storeContext.userStore, (state) => state.userInfo) : null;
|
||||
const userInfo = useUserStore((state) => state.userInfo);
|
||||
const [atchFileGroupId, setAtchFileGroupId] = useState("");
|
||||
const [uploadedFiles, setUploadedFiles] = useState<UploadedAtchFile[]>([]);
|
||||
const [isPjtcoAjmtTableOpen, setIsPjtcoAjmtTableOpen] = useState(false);
|
||||
@@ -165,7 +161,7 @@ function PwrkCnsltnDocMngDialog({
|
||||
// 전자결재 브랜치 목록 직접 조회 (Single Source of Truth)
|
||||
const { data: elaprBranchList = [] } = useElaprBranchesByDocNo(
|
||||
fnrsCnsltnDocNo,
|
||||
open && Boolean(isForkJoin),
|
||||
{ enabled: open && Boolean(isForkJoin) },
|
||||
);
|
||||
|
||||
// 전자결재 결재선 목록 직접 조회 (병합자 / 최종승인자 식별용)
|
||||
@@ -216,11 +212,19 @@ function PwrkCnsltnDocMngDialog({
|
||||
if (effectiveBranchSeCd === "TOTAL_AGG") {
|
||||
if (effectiveAtrzSeList.includes("ATRZ04")) return false;
|
||||
if (effectiveAtrzSeList.some((cd) => APPROVER_ATRZ_SE_COM_CDS.has(cd))) return true;
|
||||
if (currentUserPrgrs?.atrzSeq && Number(currentUserPrgrs.atrzSeq) > 1) return true;
|
||||
const userSeq = currentUserPrgrs?.atrzSeqNo ?? (currentUserPrgrs as Record<string, unknown> | undefined)?.atrzSeq;
|
||||
if (userSeq && Number(userSeq) > 1) return true;
|
||||
if (effectiveAtrzSeList.length > 0 && !effectiveAtrzSeList.includes("ATRZ04")) return true;
|
||||
}
|
||||
return false;
|
||||
}, [isForkJoin, isTeOrRk, effectiveBranchSeCd, effectiveAtrzSeList, currentUserPrgrs?.atrzSeq]);
|
||||
}, [
|
||||
isForkJoin,
|
||||
isTeOrRk,
|
||||
effectiveBranchSeCd,
|
||||
effectiveAtrzSeList,
|
||||
currentUserPrgrs?.atrzSeqNo,
|
||||
(currentUserPrgrs as Record<string, unknown> | undefined)?.atrzSeq,
|
||||
]);
|
||||
|
||||
// 3. 병합 완료(결재 후) 여부
|
||||
// 병합자가 이미 결재(승인)를 진행한 경우 (ATRZ_PRGRS_003 등) MAIN 탭 저장 불가
|
||||
@@ -233,7 +237,8 @@ function PwrkCnsltnDocMngDialog({
|
||||
const mergerRow = userRows.find(
|
||||
(row) =>
|
||||
row.atrzSeComCd === "ATRZ04" ||
|
||||
(row.branchSeCd === "TOTAL_AGG" && Number(row.atrzSeq) === 1),
|
||||
(row.branchSeCd === "TOTAL_AGG" &&
|
||||
Number(row.atrzSeqNo ?? (row as Record<string, unknown>).atrzSeq) === 1),
|
||||
);
|
||||
if (mergerRow) {
|
||||
return (
|
||||
@@ -247,7 +252,8 @@ function PwrkCnsltnDocMngDialog({
|
||||
const aggMergerRow = elaprPrgrsForCycl.find(
|
||||
(row) =>
|
||||
row.branchSeCd === "TOTAL_AGG" &&
|
||||
(row.atrzSeComCd === "ATRZ04" || Number(row.atrzSeq) === 1),
|
||||
(row.atrzSeComCd === "ATRZ04" ||
|
||||
Number(row.atrzSeqNo ?? (row as Record<string, unknown>).atrzSeq) === 1),
|
||||
);
|
||||
if (aggMergerRow) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user