@@ -2,6 +2,7 @@ import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { rswtChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
|
||||
import { Checkbox, Input, TableCell, TableRow } from "@common/components/ui";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export const rainChkTableData = (chkData: rainChkZodType[]) => {
|
||||
// 1. chkgdnFk + utztnUsgCd 기준 누계 정보 만들기
|
||||
@@ -54,27 +55,32 @@ export const rainChkTableData = (chkData: rainChkZodType[]) => {
|
||||
export const rswtChkTableData = (chkData: rswtChkZodType[]) => {
|
||||
// 1. chkgdnFk + utztnUsgCd 기준 누계 정보 만들기
|
||||
const makeRswtData: any[] = [];
|
||||
chkData?.forEach((root) => {
|
||||
root.rswtrDetails.forEach((detail) => {
|
||||
let flatRswtChk = {};
|
||||
const findGuide = root.guideDetails.find(
|
||||
(guide) => guide.utztnUsgCd === detail.utztnUsgCd
|
||||
);
|
||||
const findPoluttion = root.rswtrPollutions.find(
|
||||
(polution) => polution.utztnUsgCd === detail.utztnUsgCd
|
||||
);
|
||||
const operMngCd = root?.reuseBuilding.operMngCd;
|
||||
flatRswtChk = {
|
||||
...root,
|
||||
...detail,
|
||||
...findGuide,
|
||||
...findPoluttion,
|
||||
...flatRswtChk,
|
||||
operMngCd: operMngCd,
|
||||
};
|
||||
makeRswtData.push(flatRswtChk);
|
||||
|
||||
|
||||
if(chkData&&chkData.length>0){
|
||||
|
||||
chkData?.forEach((root) => {
|
||||
root.rswtrDetails.forEach((detail) => {
|
||||
let flatRswtChk = {};
|
||||
const findGuide = root.guideDetails.find(
|
||||
(guide) => guide.utztnUsgCd === detail.utztnUsgCd
|
||||
);
|
||||
const findPoluttion = root.rswtrPollutions.find(
|
||||
(polution) => polution.utztnUsgCd === detail.utztnUsgCd
|
||||
);
|
||||
const operMngCd = root?.reuseBuilding.operMngCd;
|
||||
flatRswtChk = {
|
||||
...root,
|
||||
...detail,
|
||||
...findGuide,
|
||||
...findPoluttion,
|
||||
...flatRswtChk,
|
||||
operMngCd: operMngCd,
|
||||
};
|
||||
makeRswtData.push(flatRswtChk);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
return makeRswtData;
|
||||
};
|
||||
|
||||
@@ -93,6 +99,7 @@ export const chRowspanTable = (
|
||||
let order = 0
|
||||
// rowspan된 셀 렌더링 여부 추적용
|
||||
const renderedMap = new Map<string, Set<number>>();
|
||||
|
||||
return (
|
||||
<>
|
||||
{makeTableData.map((row, rowIndex) => (
|
||||
@@ -228,7 +235,6 @@ export const InputTableBody = (
|
||||
}
|
||||
return span;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{chgRes.map((data, dataIndex) => {
|
||||
|
||||
@@ -138,7 +138,7 @@ export default function ConCostForm({
|
||||
if (type === "mat") {
|
||||
const data: DedMatUpdateType = {
|
||||
dmdInfoSn: form.getValues("dmdInfoSn"),
|
||||
usgPrcsProcs: form.getValues("demandCst.usgPrcsProcs"),
|
||||
usgPrcsProcs: form.getValues("demandCst.usgPrcsProcs")|| "",
|
||||
cstrnCst: form.getValues("demandCst.cstrnCst"),
|
||||
fcltSbsdCstrnCst: form.getValues("demandCst.fcltSbsdCstrnCst"),
|
||||
prcsFcltCpctCstrnCst: form.getValues("demandCst.prcsFcltCpctCstrnCst"),
|
||||
@@ -294,7 +294,9 @@ export default function ConCostForm({
|
||||
<div className="col-span-12 w-full">
|
||||
<h1 className={formH1Class}>공사비 입력사항</h1>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
|
||||
|
||||
<div className="col-span-2 mt-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<PopoverUi
|
||||
childrenTriger={
|
||||
@@ -333,7 +335,7 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<div className="col-span-2 mt-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<PopoverUi
|
||||
childrenTriger={
|
||||
@@ -372,12 +374,12 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
<div className="col-span-2 mt-4">
|
||||
<PopoverUi
|
||||
childrenTriger={
|
||||
<>
|
||||
<Label className="underline">
|
||||
총사업비 (백만원) <i className="diveicon di-search" />
|
||||
처리시설 총사업비(백만원) <i className="diveicon di-search" />
|
||||
</Label>
|
||||
</>
|
||||
}
|
||||
@@ -414,7 +416,7 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 mt-4">
|
||||
{/* <div className="col-span-3 mt-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label>공급처 선정</Label>
|
||||
<Button size={"sm"} onClick={(e) => {}} className="bg-none">
|
||||
@@ -437,8 +439,8 @@ export default function ConCostForm({
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4">
|
||||
</div> */}
|
||||
<div className="col-span-3 mt-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="demandCst.cstrnCst"
|
||||
@@ -457,7 +459,7 @@ export default function ConCostForm({
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4 mt-4 mb-3">
|
||||
<div className="col-span-3 mt-4 mb-3">
|
||||
<Label className="text-xl">
|
||||
처리시설 + 공급관로 총사업비(백만원)
|
||||
</Label>
|
||||
|
||||
@@ -21,7 +21,7 @@ import { useForm } from "react-hook-form";
|
||||
import toast from "react-hot-toast";
|
||||
import type { z } from "zod";
|
||||
|
||||
export default function PbnPrfExcelModal({ data ,setIsExcelOPen }: { data: FcPrfType ,setIsExcelOPen:(open:boolean )=>void }) {
|
||||
export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelData}: { data: FcPrfType ,setIsExcelOPen:(open:boolean )=>void,setModalExcelData:(excelData :PrfType)=>void }) {
|
||||
const { prfmnRegData } = useWrStore((state) => state);
|
||||
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
@@ -42,7 +42,9 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen }: { data: FcPrf
|
||||
const onSubmit = (values: z.infer<typeof pbnPrfRegExcelZod>) => {
|
||||
|
||||
if (excelData) {
|
||||
prfmnRegData(excelData as unknown as PrfType);
|
||||
// prfmnRegData(1,'41', excelData as unknown as PrfType);
|
||||
|
||||
setModalExcelData(excelData as unknown as PrfType)
|
||||
setIsExcelOPen(false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user