[as] feat: 재원협의 보완요청 로직 작업
This commit is contained in:
@@ -36,4 +36,5 @@ export {
|
||||
type SplmntDmndDialogConfirmPayload,
|
||||
} from "./ui/splmnt-dmnd-dialog";
|
||||
export { type SplmntDmndFormItem, SplmntDmndFormSection } from "./ui/splmnt-dmnd-form-section";
|
||||
export { SupplementDemandSection } from "./ui/supplement-demand-section";
|
||||
export { TaskSePickerDialog } from "./ui/task-se-picker-dialog";
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
"use client";
|
||||
|
||||
import { Paperclip } from "lucide-react";
|
||||
|
||||
import { dayjs } from "@/shared/lib";
|
||||
import type { SplmntDmndResponseExtension, SplmntDmndSaveBase } from "@/shared/model";
|
||||
import { useDownloadAttachmentByAtflCd } from "@/entities/attach";
|
||||
import {
|
||||
Badge,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@common/components";
|
||||
|
||||
import { SectionCollapsible } from "./section-collapsible";
|
||||
|
||||
type SplmntDmndItem = SplmntDmndSaveBase & SplmntDmndResponseExtension;
|
||||
|
||||
interface SupplementDemandSectionProps {
|
||||
splmntDmndList: SplmntDmndItem[];
|
||||
}
|
||||
|
||||
function SupplementDemandSection({ splmntDmndList }: SupplementDemandSectionProps) {
|
||||
const { mutate: downloadAttachment } = useDownloadAttachmentByAtflCd();
|
||||
|
||||
return (
|
||||
<SectionCollapsible title="보완요청 및 완료 현황">
|
||||
<div className="overflow-x-auto">
|
||||
<Table variant="secondary">
|
||||
<colgroup>
|
||||
<col width="14%" />
|
||||
<col width="8%" />
|
||||
<col width="30%" />
|
||||
<col width="8%" />
|
||||
<col width="30%" />
|
||||
<col width="10%" />
|
||||
</colgroup>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>보완항목</TableHead>
|
||||
<TableHead>보완요청일시</TableHead>
|
||||
<TableHead>보완요청내용</TableHead>
|
||||
<TableHead>보완완료일시</TableHead>
|
||||
<TableHead>보완완료내용</TableHead>
|
||||
<TableHead>완료여부</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{splmntDmndList.map((item) => {
|
||||
const sn = item.splmntDmndSn;
|
||||
const cmptnYn = item.cmptnYn ?? "N";
|
||||
const dmndAtchFileNm = item.splmntDmndAtchFileInfo?.orgnlFileNm;
|
||||
const cmptnAtchFileNm = item.splmntAtchFileInfo?.orgnlFileNm;
|
||||
|
||||
return (
|
||||
<TableRow key={sn ?? `${item.splmntArtclComCd}-${item.splmntDmndDt}`}>
|
||||
<TableCell align="center" className="align-top">
|
||||
{item.splmntArtclCdNm || "-"}
|
||||
</TableCell>
|
||||
<TableCell align="center" className="whitespace-nowrap align-top">
|
||||
{item.splmntDmndDt ? dayjs(item.splmntDmndDt).format("YYYY-MM-DD HH:mm") : "-"}
|
||||
</TableCell>
|
||||
<TableCell className="align-top">
|
||||
<div className="space-y-2">
|
||||
<div className="whitespace-pre-wrap">{item.splmntDmndCn || "-"}</div>
|
||||
{item.splmntDmndAtchFileGroupId ? (
|
||||
<a
|
||||
className="inline-flex cursor-pointer items-start gap-1 text-blue-600 hover:underline"
|
||||
onClick={() => downloadAttachment(item.splmntDmndAtchFileGroupId!)}
|
||||
>
|
||||
<Paperclip className="my-1 size-5 shrink-0" />
|
||||
{dmndAtchFileNm || "다운로드"}
|
||||
</a>
|
||||
) : null}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell align="center" className="whitespace-nowrap align-top">
|
||||
{item.splmntCmptnDt
|
||||
? dayjs(item.splmntCmptnDt).format("YYYY-MM-DD HH:mm")
|
||||
: "-"}
|
||||
</TableCell>
|
||||
<TableCell className="align-top">
|
||||
<div className="space-y-2">
|
||||
<div className="whitespace-pre-wrap">{item.splmntCn || "-"}</div>
|
||||
{item.splmntAtchFileGroupId ? (
|
||||
<a
|
||||
className="inline-flex cursor-pointer items-start gap-1 text-blue-600 hover:underline"
|
||||
onClick={() => downloadAttachment(item.splmntAtchFileGroupId!)}
|
||||
>
|
||||
<Paperclip className="my-1 size-5 shrink-0" />
|
||||
{cmptnAtchFileNm || "다운로드"}
|
||||
</a>
|
||||
) : null}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell align="center" className="align-top">
|
||||
<Badge size="lg" color={cmptnYn === "Y" ? "green" : "gray"}>
|
||||
{cmptnYn === "Y" ? "완료" : "미완료"}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
</SectionCollapsible>
|
||||
);
|
||||
}
|
||||
|
||||
export { SupplementDemandSection };
|
||||
Reference in New Issue
Block a user