[as fr] 금액 없을 경우 메시지 표시
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
} from "@/entities/pwrk-cnsltn-doc-crt-rslt";
|
||||
import { usePwrkCnsltnDocPjtcoAjmtMngPage } from "@/entities/pwrk-cnsltn-doc-pjtco-ajmt-mng";
|
||||
import { useElaprBranchesByDocNo, useElaprDocPrgrsByDocNo } from "@/entities/elapr";
|
||||
import { useAiAutoPrcsLatest, AI_AUTO_SE } from "@/entities/ai-auto-prcs-mng";
|
||||
import {
|
||||
findCompletedPwrkDraft,
|
||||
pwrkCnsltnMngKeys,
|
||||
@@ -397,14 +398,43 @@ function PwrkCnsltnDocMngDialog({
|
||||
const documentFileName = `실무협의서${branchLabel}${verSuffix}_${pwrkCnsltnData?.pwrkCnsltnDocNo ?? crtDmndUuid}.hwpx`;
|
||||
const isLoading = isPwrkCnsltnLoading || isDocumentLoading;
|
||||
const isError = isPwrkCnsltnError || isDocumentError;
|
||||
// AI 자동화 이력 조회 (COST_VRFC 완료 여부 확인)
|
||||
const { data: aiAutoLatestList } = useAiAutoPrcsLatest(fnrsCnsltnDocNo, {
|
||||
enabled: open && Boolean(fnrsCnsltnDocNo),
|
||||
atmtnSeComCd: AI_AUTO_SE.COST_VRFC,
|
||||
});
|
||||
|
||||
const costVrfcRecord = useMemo(() => {
|
||||
return aiAutoLatestList?.find((row) => row.atmtnSeComCd === AI_AUTO_SE.COST_VRFC);
|
||||
}, [aiAutoLatestList]);
|
||||
|
||||
// COST_VRFC 완료 여부 (SUCCESS, COMPLETED, PASS 등)
|
||||
const hasCostVrfcSuccess = useMemo(() => {
|
||||
if (!costVrfcRecord) return false;
|
||||
return (
|
||||
costVrfcRecord.atmtnPrcsSttsComCd === "SUCCESS" ||
|
||||
costVrfcRecord.atmtnPrcsSttsComCd === "COMPLETED" ||
|
||||
costVrfcRecord.rplyRsltComCd === "PASS" ||
|
||||
Boolean(costVrfcRecord.rplyDt)
|
||||
);
|
||||
}, [costVrfcRecord]);
|
||||
|
||||
// AI 금액검증(AV) 이후 진행되는 상태 (EV: 조치결과검토의뢰, RK: 2차검토, TE: 2차검토완료, SL: 2차보완 등)
|
||||
const isPostCostVerifyStatus = useMemo(() => {
|
||||
return Boolean(prgrsSttsComCd && ["EV", "RK", "TE", "SL", "AP"].includes(prgrsSttsComCd));
|
||||
}, [prgrsSttsComCd]);
|
||||
|
||||
const effectivePwrkDocNo =
|
||||
pwrkCnsltnData?.pwrkCnsltnDocNo ?? costVrfcRecord?.pwrkCnsltnDocNo;
|
||||
|
||||
const pjtcoAjmtSearchParams = useMemo(
|
||||
() => ({
|
||||
pwrkCnsltnDocNo: pwrkCnsltnData?.pwrkCnsltnDocNo,
|
||||
pwrkCnsltnDocNo: effectivePwrkDocNo,
|
||||
page: 0,
|
||||
size: 1000,
|
||||
sort: "rvwOpnnSn,asc",
|
||||
}),
|
||||
[pwrkCnsltnData?.pwrkCnsltnDocNo],
|
||||
[effectivePwrkDocNo],
|
||||
);
|
||||
const {
|
||||
data: pjtcoAjmtPage,
|
||||
@@ -412,6 +442,17 @@ function PwrkCnsltnDocMngDialog({
|
||||
isError: isPjtcoAjmtError,
|
||||
} = usePwrkCnsltnDocPjtcoAjmtMngPage(pjtcoAjmtSearchParams, open);
|
||||
|
||||
// 금액검증 슬라이드 노출 조건:
|
||||
// 1) 실제 금액조정 내역이 1건 이상 있거나
|
||||
// 2) AI 금액검증이 완료된 상태(EV 또는 RK 등)이거나
|
||||
// 3) tb_as_atmtn_prcs_mng에 COST_VRFC 완료 이력이 있는 경우
|
||||
const shouldShowCostVerifySlide = useMemo(() => {
|
||||
if (Boolean(pjtcoAjmtPage?.content?.length)) return true;
|
||||
if (isPostCostVerifyStatus) return true;
|
||||
if (hasCostVrfcSuccess) return true;
|
||||
return false;
|
||||
}, [pjtcoAjmtPage?.content?.length, isPostCostVerifyStatus, hasCostVrfcSuccess]);
|
||||
|
||||
const { uploadFileAsync, isUploading, uploads } = useTus({
|
||||
onSuccess: (atflCd, atflId, _file, fileKey) => {
|
||||
if (!atflCd || !atflId) return;
|
||||
@@ -1029,7 +1070,7 @@ function PwrkCnsltnDocMngDialog({
|
||||
rightSlot={versionHistorySelect}
|
||||
/>
|
||||
</div>
|
||||
{pjtcoAjmtPage?.content?.length ? (
|
||||
{shouldShowCostVerifySlide ? (
|
||||
isPjtcoAjmtTableOpen ? (
|
||||
<section
|
||||
className={cn(
|
||||
@@ -1053,6 +1094,7 @@ function PwrkCnsltnDocMngDialog({
|
||||
rows={pjtcoAjmtPage?.content ?? []}
|
||||
isLoading={isPjtcoAjmtLoading}
|
||||
isError={isPjtcoAjmtError}
|
||||
emptyMessage="금액조정 검토의견이 0건(변동 없음)입니다."
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -16,12 +16,14 @@ interface PwrkCnsltnDocPjtcoAjmtTableProps {
|
||||
rows: PwrkCnsltnDocPjtcoAjmtMngResponseDto[];
|
||||
isLoading: boolean;
|
||||
isError: boolean;
|
||||
emptyMessage?: string;
|
||||
}
|
||||
|
||||
function PwrkCnsltnDocPjtcoAjmtTable({
|
||||
rows,
|
||||
isLoading,
|
||||
isError,
|
||||
emptyMessage = "금액조정 검토의견이 0건(변동 없음)입니다.",
|
||||
}: PwrkCnsltnDocPjtcoAjmtTableProps) {
|
||||
if (isLoading) {
|
||||
return (
|
||||
@@ -64,7 +66,7 @@ function PwrkCnsltnDocPjtcoAjmtTable({
|
||||
{rows.length === 0 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={3} className="py-10 text-center text-muted-foreground">
|
||||
조회된 사업비조정 항목이 없습니다.
|
||||
{emptyMessage}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user