[st frontend] sncnSeComCd 인가 구분 공통 처리

This commit is contained in:
2026-06-01 12:37:06 +09:00
parent 98f24d8a96
commit 6432b9f44a
3 changed files with 22 additions and 20 deletions
@@ -29,6 +29,7 @@ export interface InstlSncnMng {
chrgrNm?: string;
instNm?: string;
envoSeComCd: string;
sncnSeComCd: string;
envoSeCdNm: string;
taskSeComCd: string;
taskSeCdNm: string;
@@ -9,8 +9,8 @@ import axios from "axios";
import { type HttpResponse, Upload } from "tus-js-client";
import { AUTH_USER_ID, CLAIM_NAME, ENDPOINT, PROXY_HOST } from "@/shared/config";
import { deleteAttachment } from "@/shared/lib/attach";
import { getCookie, setCookie, useAlertStore, useUserStore } from "@/shared/lib";
import { deleteAttachment } from "@/shared/lib/attach";
import { formatFileSize } from "@/shared/lib/file-utils";
import type { AcntgSeMngTreeDto } from "@/entities/acntg";
import { acntgService } from "@/entities/acntg";
@@ -30,7 +30,7 @@ import {
type InstlSncnBzScaleSaveDto,
type InstlSncnMng,
} from "@/entities/instl-sncn";
import { EtcAttachments,NumCell, PrivacyConsent, ReadCell } from "@/widgets/cnfm";
import { Button, Input } from "@common/components";
import "./cnfm-page.css";
@@ -68,12 +68,8 @@ const emptyAmt = (): BzAmtRow => ({ bscPl: "", budgetReflct: "", thtiDsgn: "" })
const num = (v: string) => parseFloat(v.replace(/,/g, "") || "0");
const fmt = (v: number) => (isNaN(v) ? "" : v.toLocaleString());
const DEFAULT_RVW_STP_COM_CD = "LOCAL"; // LOCAL.지자체,ENV.환경청,KECO.환경공단 (검토단계공통코드:RVWSTP 참조)
/* ------------------------------------------------------------------ */
/* 공통 셀 컴포넌트 분리: widgets/cnfm/ui/cells.tsx에서 import */
/* ------------------------------------------------------------------ */
import { NumCell, ReadCell, PrivacyConsent, EtcAttachments } from '@/widgets/cnfm';
const DEFAULT_RVW_STP_COM_CD = "LOCAL"; //검토단계공통코드: RVWSTP ( 상세 코드 : LOCAL.지자체,ENV.환경청,KECO.환경공단)
const DEFAULT_SNCN_SE_COM_CD = "CNFM";
/* ------------------------------------------------------------------ */
/* 메인 컴포넌트 */
@@ -88,7 +84,7 @@ import { NumCell, ReadCell, PrivacyConsent, EtcAttachments } from '@/widgets/cnf
*
* - 주요 detFields (det 또는 detDto 내부):
* - bizNm, bizBgngYr, bizEndYr, bizCn
* - envoSeComCd or envoSeCd (설치구분)
* - sncnSeComCd or envoSeComCd or envoSeCd (설치구분)
* - dsgnrNm, dsgnrOgdpNm (소속), dsgnrTelno, dsgnrEmlAddr
* - privacyAgree ("Y" | "N")
* - aplcntNm, aplcntMblTelno, aplcntOgdpNm, aplcntEmlAddr
@@ -109,11 +105,11 @@ function CnfmRegistPage({ initialData }: { initialData?: any } = {}) {
const userInfo = useUserStore((state) => state.userInfo);
const alert = useAlertStore((state) => state.setMessage);
const qc = useQueryClient();
const currentDet = useMemo(() => initialData?.detDto ?? initialData, [initialData]);
const docId = useMemo(() => {
const det = initialData?.detDto ?? initialData;
return det?.instlSncnDocNo ?? det?.instlSncnDocNo ?? "";
}, [initialData]);
return currentDet?.instlSncnDocNo ?? "";
}, [currentDet]);
const [docSeComCd] = useState("INSTL");
const [taskSeComCdNm, setTaskSeComCdNm] = useState("재이용수");
@@ -138,7 +134,7 @@ function CnfmRegistPage({ initialData }: { initialData?: any } = {}) {
const [bzBgngYr, setBzBgngYr] = useState("");
const [bzEndYr, setBzEndYr] = useState("");
const [bzCn, setBzCn] = useState("");
const [instlCnfmApr, setInstlCnfmApr] = useState("CNFM");
const [sncnSeComCd, setSncnSeComCd] = useState("CNFM");
/* ── 설계자 정보 ── */
const [dsgnrNm, setDsgnrNm] = useState("");
@@ -269,7 +265,7 @@ function CnfmRegistPage({ initialData }: { initialData?: any } = {}) {
if (initialMappedRef.current) return;
try {
const det = (initialData.detDto ?? initialData) as any;
const det = (currentDet ?? {}) as any;
const bizSclList = initialData.bizSclList ?? [];
const bizCstList = initialData.bizCstList ?? [];
@@ -283,7 +279,7 @@ function CnfmRegistPage({ initialData }: { initialData?: any } = {}) {
setBzBgngYr(det.bizBgngYr ?? "");
setBzEndYr(det.bizEndYr ?? "");
setBzCn(det.bizCn ?? "");
setInstlCnfmApr(det.envoSeComCd ?? det.envoSeCd ?? "CNFM");
setSncnSeComCd(det.sncnSeComCd ?? det.envoSeComCd ?? det.envoSeCd ?? DEFAULT_SNCN_SE_COM_CD);
// 설계자
setDsgnrNm(det.dsgnrNm ?? "");
@@ -862,7 +858,8 @@ function CnfmRegistPage({ initialData }: { initialData?: any } = {}) {
sggNm: "",
chrgrNm: "",
instNm: "",
envoSeComCd: instlCnfmApr,
envoSeComCd: currentDet?.envoSeComCd ?? "",
sncnSeComCd: sncnSeComCd || DEFAULT_SNCN_SE_COM_CD,
envoSeCdNm: "",
taskSeComCd,
taskSeCdNm: taskSeComCdNm,
@@ -1037,10 +1034,10 @@ function CnfmRegistPage({ initialData }: { initialData?: any } = {}) {
<label key={val} className="flex cursor-pointer items-center gap-1">
<input
type="radio"
name="instlCnfmApr"
name="sncnSeComCd"
value={val}
checked={instlCnfmApr === val}
onChange={() => setInstlCnfmApr(val)}
checked={sncnSeComCd === val}
onChange={() => setSncnSeComCd(val)}
/>
{label}
</label>
@@ -75,7 +75,11 @@ function CnfmViewPage({ id }: { id: string }) {
<th>업무구분</th>
<td>{det.taskSeCdNm || det.taskSeComCd || "-"}</td>
<th>행정동ID</th>
<td>{det.dongId || "-"}</td>
<td>{det.admdstCd || "-"}</td>
</tr>
<tr>
<th>사업구분(인가구분)</th>
<td colSpan={3}>{det.sncnSeComCd || "-"}</td>
</tr>
<tr>
<th>진행상태</th>