Merge commit '03675aaa6062402fbb3772e97cd966c0f7abd890' into iipbs/wr/dev
This commit is contained in:
@@ -364,6 +364,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
setIndexMng(index);
|
||||
}}
|
||||
indexMng={indexMng}
|
||||
readonly={false}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function RainStat() {
|
||||
searchRainStatList(searchYear);
|
||||
}, [code.cityCd, code.sggCd, searchRainStatList])
|
||||
|
||||
const excelDetailDownLoad=() =>{
|
||||
const excelDetailDownLoad = () => {
|
||||
const sidoList = new Set<string>();
|
||||
const sidoDataMap = new Map<string, (string | number)[]>(); // 시도별 데이터를 저장할 Map
|
||||
const sidoDetailMap = new Map<string, (string | number)[][]>(); // 시도별 상세 데이터를 저장할 Map
|
||||
@@ -49,7 +49,7 @@ export default function RainStat() {
|
||||
|
||||
sidoText = sido?.text || '';
|
||||
sigunText = sigun?.text || '';
|
||||
|
||||
|
||||
// 시도, 시군구 코드를 텍스트로 변환하여 데이터에 할당
|
||||
if (item.length > 0) {
|
||||
item[0] = sidoText as unknown as RainStatProps;
|
||||
@@ -58,7 +58,7 @@ export default function RainStat() {
|
||||
item[1] = sigunText as unknown as RainStatProps;
|
||||
}
|
||||
if (item.length > 2) {
|
||||
item[2] = sidoText+' '+sigunText as unknown as RainStatProps;
|
||||
item[2] = sidoText + ' ' + sigunText as unknown as RainStatProps;
|
||||
}
|
||||
|
||||
// 시도별 상세 데이터 수집
|
||||
@@ -89,32 +89,32 @@ export default function RainStat() {
|
||||
const sidoData = sidoDataMap.get(sidoText)!;
|
||||
// 각 컬럼의 값을 합계에 더하기 (1번 인덱스부터 시작)
|
||||
for (let i = 1; i < item.length && i < sidoData.length; i++) {
|
||||
if(i == 2){
|
||||
if (i == 2) {
|
||||
sidoData[i] = '합계';
|
||||
} else if(i == 3){
|
||||
} else if (i == 3) {
|
||||
// 해당 시도의 데이터 개수를 계산
|
||||
const sidoDataCount = rainDetailList.filter((data: unknown[]) =>
|
||||
const sidoDataCount = rainDetailList.filter((data: unknown[]) =>
|
||||
Array.isArray(data) && data.length > 0 && String(data[0]) === sidoText
|
||||
).length;
|
||||
sidoData[i] = sidoDataCount;
|
||||
} else if( i == 4){
|
||||
} else if (i == 4) {
|
||||
sidoData[i] = '';
|
||||
} else if(i == 6){
|
||||
} else if (i == 6) {
|
||||
// 법정 대상 건축물 개수 (인덱스 6이 'Y'인 경우)
|
||||
const bumCnt = rainDetailList.filter((data: unknown[]) =>
|
||||
const bumCnt = rainDetailList.filter((data: unknown[]) =>
|
||||
Array.isArray(data) && data.length > 6 && String(data[0]) === sidoText
|
||||
).filter((data: unknown[]) => String(data[6]) === '대상').length;
|
||||
sidoData[i] = bumCnt;
|
||||
} else if(i==8){
|
||||
} else if (i == 8) {
|
||||
const value = Number(item[8]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==11){
|
||||
} else if (i == 11) {
|
||||
const value = Number(item[11]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==12){
|
||||
} else if (i == 12) {
|
||||
const value = Number(item[12]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==14){
|
||||
} else if (i == 14) {
|
||||
const value = Number(item[14]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
}
|
||||
@@ -127,12 +127,12 @@ export default function RainStat() {
|
||||
|
||||
// 시도별로 합계와 상세 데이터를 순서대로 배치
|
||||
const summaryExcelData: (string | number)[][] = [];
|
||||
|
||||
|
||||
// 시도별로 순회하면서 합계와 상세 데이터를 추가
|
||||
Array.from(sidoList).forEach((sidoText) => {
|
||||
const sidoSummary = sidoDataMap.get(sidoText);
|
||||
const sidoDetails = sidoDetailMap.get(sidoText) || [];
|
||||
|
||||
|
||||
if (sidoSummary) {
|
||||
// 시도 합계 데이터 추가
|
||||
summaryExcelData.push(sidoSummary);
|
||||
@@ -147,14 +147,14 @@ export default function RainStat() {
|
||||
const sidoTotalSummary = [['전체', '', '합계', 0, '', '', 0, '', '', 0, 0, 0, 0, 0, 0, '', 0]];
|
||||
sidoSummaryList.forEach((item: (string | number)[]) => {
|
||||
item.forEach((value: string | number, index: number) => {
|
||||
if(typeof value === 'number') {
|
||||
if (typeof value === 'number') {
|
||||
if (sidoTotalSummary[0] && index < sidoTotalSummary[0].length) {
|
||||
sidoTotalSummary[0][index] = Number(sidoTotalSummary[0][index]) + Number(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// sidoSummaryList와 rainDetailList를 합쳐서 엑셀 데이터 생성
|
||||
const excelData = [...sidoTotalSummary, ...sidoSummaryList, ...summaryExcelData];
|
||||
|
||||
@@ -175,28 +175,30 @@ export default function RainStat() {
|
||||
headerRange: "A1:M1"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const transExcel = Array.isArray(excelList) ? excelList : [excelList];
|
||||
const excelData = tableData(transExcel, { code });
|
||||
const tbData = Array.isArray(excelData)
|
||||
? excelData.map((item: RainStatProps) => {
|
||||
return {
|
||||
"시도": item.cityText,
|
||||
"개소": item.tmp,
|
||||
"설치비(백만원)": item.instlCst,
|
||||
"저류조용량(m³/년)": item.dtfcltCpct,
|
||||
"연간사용량(m³/년)": item.wtrUsqty,
|
||||
"조경용수": item.lndwtr,
|
||||
"청소화장실용수": item.cleanToilUswtr,
|
||||
"세척살수용수": item.resn,
|
||||
"농업용수": item.farmUswtr,
|
||||
"공업용수": item.indstUswtr,
|
||||
"친수용수": item.hydUswtr,
|
||||
"기타": item.ithlEtcUswtr,
|
||||
"연간운영비(백만원/년)": item.anlOperCst,
|
||||
};
|
||||
})
|
||||
? excelData
|
||||
.filter((item: RainStatProps) => item.cityText !== '없음')
|
||||
.map((item: RainStatProps) => {
|
||||
return {
|
||||
"시도": item.cityText,
|
||||
"개소": item.tmp,
|
||||
"설치비(백만원)": item.instlCst,
|
||||
"저류조용량(m³/년)": item.dtfcltCpct,
|
||||
"연간사용량(m³/년)": item.wtrUsqty,
|
||||
"조경용수": item.lndwtr,
|
||||
"청소화장실용수": item.cleanToilUswtr,
|
||||
"세척살수용수": item.resn,
|
||||
"농업용수": item.farmUswtr,
|
||||
"공업용수": item.indstUswtr,
|
||||
"친수용수": item.hydUswtr,
|
||||
"기타": item.ithlEtcUswtr,
|
||||
"연간운영비(백만원/년)": item.anlOperCst,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
setExData(tbData);
|
||||
}, [code, excelList])
|
||||
@@ -237,7 +239,7 @@ export default function RainStat() {
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row space-x-2 items-center">
|
||||
<Button className="" size={"sm"} onClick={()=>{searchRainStatList(searchYear);}}>
|
||||
<Button className="" size={"sm"} onClick={() => { searchRainStatList(searchYear); }}>
|
||||
조회
|
||||
</Button>
|
||||
<Button className="" size={"sm"} onClick={() => excelClick()}>
|
||||
@@ -264,7 +266,7 @@ export default function RainStat() {
|
||||
total={0}
|
||||
headName={""}
|
||||
cellClick={undefined}
|
||||
onPageChange={() => {}}
|
||||
onPageChange={() => { }}
|
||||
></UiTable>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
|
||||
@@ -55,29 +55,31 @@ export default function RswtStat() {
|
||||
const transExcel = Array.isArray(excelList) ? excelList : [excelList];
|
||||
const exData = tableData(transExcel, { code });
|
||||
const tbData = Array.isArray(exData) ?
|
||||
exData.map((item: RswtStatProps) => {
|
||||
return {
|
||||
"시도": item.cityText,
|
||||
"개소": item.ctpvCnt,
|
||||
// "건축연면적(m³)": item.archArea,
|
||||
"처리용량(m³)": item.filtrTrtmfctCpct,
|
||||
"물사용량(m³/년)": item.wtrUsqty,
|
||||
"중수도+대체수이용량(m³/년)": item.rswtAltSum,
|
||||
"중수도이용량(m³/년)": item.rswtrUsqty,
|
||||
"대체수이용량(m³/년)": item.altUswtrUtztnQnt,
|
||||
"조경용수": item.lndwtr,
|
||||
"청소화장실용수": item.cleanToilUswtr,
|
||||
"농업용수": item.farmUswtr,
|
||||
"공업용수": item.indstUswtr,
|
||||
"친수용수": item.hydUswtr,
|
||||
"기타": item.ithlEtcUswtr,
|
||||
"연간운영비(백만원/년)": item.anlOperCst,
|
||||
};
|
||||
}) : [];
|
||||
exData
|
||||
.filter((item: RswtStatProps) => item.cityText !== '없음')
|
||||
.map((item: RswtStatProps) => {
|
||||
return {
|
||||
"시도": item.cityText,
|
||||
"개소": item.ctpvCnt,
|
||||
// "건축연면적(m³)": item.archArea,
|
||||
"처리용량(m³)": item.filtrTrtmfctCpct,
|
||||
"물사용량(m³/년)": item.wtrUsqty,
|
||||
"중수도+대체수이용량(m³/년)": item.rswtAltSum,
|
||||
"중수도이용량(m³/년)": item.rswtrUsqty,
|
||||
"대체수이용량(m³/년)": item.altUswtrUtztnQnt,
|
||||
"조경용수": item.lndwtr,
|
||||
"청소화장실용수": item.cleanToilUswtr,
|
||||
"농업용수": item.farmUswtr,
|
||||
"공업용수": item.indstUswtr,
|
||||
"친수용수": item.hydUswtr,
|
||||
"기타": item.ithlEtcUswtr,
|
||||
"연간운영비(백만원/년)": item.anlOperCst,
|
||||
};
|
||||
}) : [];
|
||||
setExceData(tbData);
|
||||
}, [code, excelList])
|
||||
|
||||
const excelDetailDownLoad=() =>{
|
||||
const excelDetailDownLoad = () => {
|
||||
const sidoList = new Set<string>();
|
||||
const sidoDataMap = new Map<string, (string | number)[]>(); // 시도별 데이터를 저장할 Map
|
||||
const sidoDetailMap = new Map<string, (string | number)[][]>(); // 시도별 상세 데이터를 저장할 Map
|
||||
@@ -94,7 +96,7 @@ export default function RswtStat() {
|
||||
|
||||
sidoText = sido?.text || '';
|
||||
sigunText = sigun?.text || '';
|
||||
|
||||
|
||||
// 시도, 시군구 코드를 텍스트로 변환하여 데이터에 할당
|
||||
if (item.length > 0) {
|
||||
item[0] = sidoText as unknown as RswtStatProps;
|
||||
@@ -103,7 +105,7 @@ export default function RswtStat() {
|
||||
item[1] = sigunText as unknown as RswtStatProps;
|
||||
}
|
||||
if (item.length > 2) {
|
||||
item[2] = sidoText+' '+sigunText as unknown as RswtStatProps;
|
||||
item[2] = sidoText + ' ' + sigunText as unknown as RswtStatProps;
|
||||
}
|
||||
|
||||
// 시도별 상세 데이터 수집
|
||||
@@ -113,7 +115,7 @@ export default function RswtStat() {
|
||||
}
|
||||
sidoDetailMap.get(sidoText)!.push(item as unknown as (string | number)[]);
|
||||
}
|
||||
|
||||
|
||||
// 시도별 합계 데이터 수집
|
||||
if (sidoText && !sidoList.has(sidoText)) {
|
||||
sidoList.add(sidoText);
|
||||
@@ -134,41 +136,41 @@ export default function RswtStat() {
|
||||
const sidoData = sidoDataMap.get(sidoText)!;
|
||||
// 각 컬럼의 값을 합계에 더하기 (1번 인덱스부터 시작)
|
||||
for (let i = 1; i < item.length && i < sidoData.length; i++) {
|
||||
if(i == 2){
|
||||
if (i == 2) {
|
||||
sidoData[i] = '합계';
|
||||
} else if(i == 3){
|
||||
} else if (i == 3) {
|
||||
// 해당 시도의 데이터 개수를 계산
|
||||
const sidoDataCount = rswtDetailList.filter((data: unknown[]) =>
|
||||
const sidoDataCount = rswtDetailList.filter((data: unknown[]) =>
|
||||
Array.isArray(data) && data.length > 0 && String(data[0]) === sidoText
|
||||
).length;
|
||||
sidoData[i] = sidoDataCount;
|
||||
} else if( i == 4){
|
||||
} else if (i == 4) {
|
||||
sidoData[i] = '';
|
||||
} else if(i == 6){
|
||||
} else if (i == 6) {
|
||||
// 법정 대상 건축물 개수 (인덱스 6이 'Y'인 경우)
|
||||
const bumCnt = rswtDetailList.filter((data: unknown[]) =>
|
||||
const bumCnt = rswtDetailList.filter((data: unknown[]) =>
|
||||
Array.isArray(data) && data.length > 6 && String(data[0]) === sidoText
|
||||
).filter((data: unknown[]) => String(data[6]) === '대상').length;
|
||||
sidoData[i] = bumCnt;
|
||||
} else if(i==9){
|
||||
} else if (i == 9) {
|
||||
const value = Number(item[9]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==10){
|
||||
} else if (i == 10) {
|
||||
const value = Number(item[10]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==11){
|
||||
} else if (i == 11) {
|
||||
const value = Number(item[11]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==12){
|
||||
} else if (i == 12) {
|
||||
const value = Number(item[12]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
}else if(i==13){
|
||||
} else if (i == 13) {
|
||||
const value = Number(item[13]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==14){
|
||||
} else if (i == 14) {
|
||||
const value = Number(item[14]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else if(i==16){
|
||||
} else if (i == 16) {
|
||||
const value = Number(item[16]) || 0;
|
||||
sidoData[i] = (Number(sidoData[i]) + value) as string | number;
|
||||
} else {
|
||||
@@ -177,15 +179,15 @@ export default function RswtStat() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 시도별로 합계와 상세 데이터를 순서대로 배치
|
||||
const summaryExcelData: (string | number)[][] = [];
|
||||
|
||||
|
||||
// 시도별로 순회하면서 합계와 상세 데이터를 추가
|
||||
Array.from(sidoList).forEach((sidoText) => {
|
||||
const sidoSummary = sidoDataMap.get(sidoText);
|
||||
const sidoDetails = sidoDetailMap.get(sidoText) || [];
|
||||
|
||||
|
||||
if (sidoSummary) {
|
||||
// 시도 합계 데이터 추가
|
||||
summaryExcelData.push(sidoSummary);
|
||||
@@ -200,7 +202,7 @@ export default function RswtStat() {
|
||||
const sidoTotalSummary = [['전체', '', '합계', 0, '', '', 0, '', '', 0, 0, 0, 0, 0, 0, '', 0]];
|
||||
sidoSummaryList.forEach((item: (string | number)[]) => {
|
||||
item.forEach((value: string | number, index: number) => {
|
||||
if(typeof value === 'number') {
|
||||
if (typeof value === 'number') {
|
||||
if (sidoTotalSummary[0] && index < sidoTotalSummary[0].length) {
|
||||
sidoTotalSummary[0][index] = Number(sidoTotalSummary[0][index]) + Number(value);
|
||||
}
|
||||
@@ -209,7 +211,7 @@ export default function RswtStat() {
|
||||
});
|
||||
|
||||
// sidoSummaryList와 rainDetailList를 합쳐서 엑셀 데이터 생성
|
||||
const excelData = [...sidoTotalSummary,...sidoSummaryList, ...summaryExcelData];
|
||||
const excelData = [...sidoTotalSummary, ...sidoSummaryList, ...summaryExcelData];
|
||||
|
||||
excelDownload(
|
||||
excelData as unknown as [][],
|
||||
|
||||
@@ -195,7 +195,7 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [
|
||||
title: "부과금액(천원)",
|
||||
upName: "feeHist",
|
||||
upSequnce: 3,
|
||||
type: "number",
|
||||
type: "text",
|
||||
edit: true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -3,7 +3,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 { formatCommaNumber } from "./commom";
|
||||
import { formatCommaNumber, handleCommaNumberChange } from "./commom";
|
||||
|
||||
export const rainChkTableData = (chkData: rainChkZodType[]) => {
|
||||
// 1. chkgdnSn + utztnUsgCd 기준 누계 정보 만들기
|
||||
@@ -142,7 +142,12 @@ export const chRowspanTable = (
|
||||
) : key === "order" ? (
|
||||
++order
|
||||
) : (
|
||||
value
|
||||
// value
|
||||
(["anlOperCst", "dtfcltCpct", "prcsCpct"].includes(head.id)) ? (
|
||||
formatCommaNumber(value)
|
||||
) : (
|
||||
<>{value}</>
|
||||
)
|
||||
)}
|
||||
</TableCell>
|
||||
);
|
||||
@@ -156,26 +161,44 @@ export const chRowspanTable = (
|
||||
onClick={() => handleCellClick(rowIndex, head.id)}
|
||||
>
|
||||
{head.edit === true ? (
|
||||
<Input
|
||||
className={`${head.type === "number" ? "text-right" : "text-center"} !text-xl`}
|
||||
type={head.type}
|
||||
onChange={(e) => {
|
||||
handleChange(rowIndex, head.id, e.target.value);
|
||||
}}
|
||||
value={value || ""}
|
||||
disabled={!selectedIds.includes(row.chkgdnSn)}
|
||||
maxLength={numSize}
|
||||
//input type number일때 slice 처리
|
||||
onInput={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (head.type === 'number' && e.target.value.length > numSize) {
|
||||
e.target.value = e.target.value.slice(0, numSize);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
(["levyAmt", "anlOperCst", "dtfcltCpct", "prcsCpct"].includes(head.id)) ? (
|
||||
<Input
|
||||
className={`${head.type === "number" ? "text-right" : "text-center"} !text-xl`}
|
||||
type={head.type}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, val =>
|
||||
handleChange(rowIndex, head.id, val))
|
||||
}}
|
||||
value={formatCommaNumber(value) || ""}
|
||||
disabled={!selectedIds.includes(row.chkgdnSn)}
|
||||
maxLength={numSize}
|
||||
onInput={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (head.type === 'number' && e.target.value.length > numSize) {
|
||||
e.target.value = e.target.value.slice(0, numSize);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<Input
|
||||
className={`${head.type === "number" ? "text-right" : "text-center"} !text-xl`}
|
||||
type={head.type}
|
||||
onChange={(e) => {
|
||||
handleChange(rowIndex, head.id, e.target.value);
|
||||
}}
|
||||
value={value || ""}
|
||||
disabled={!selectedIds.includes(row.chkgdnSn)}
|
||||
maxLength={numSize}
|
||||
onInput={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (head.type === 'number' && e.target.value.length > numSize) {
|
||||
e.target.value = e.target.value.slice(0, numSize);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
(head.id === "totalSplyUswtrUtztnQnt" || head.id === "totalRuseFcltUtztnQnt" || head.id === "splyUswtrUtztnQnt" || head.id === "ruseFcltUtztnQnt") ? (
|
||||
<span className="underline text-blue-600 cursor-pointer">
|
||||
{value}
|
||||
(["totalSplyUswtrUtztnQnt", "totalRuseFcltUtztnQnt", "splyUswtrUtztnQnt", "ruseFcltUtztnQnt", "levyAmt"].includes(head.id)) ? (
|
||||
<span className={["totalSplyUswtrUtztnQnt", "totalRuseFcltUtztnQnt", "splyUswtrUtztnQnt", "ruseFcltUtztnQnt"].includes(head.id) ? "underline text-blue-600 cursor-pointer" : ""}>
|
||||
{formatCommaNumber(value)}
|
||||
</span>
|
||||
) : (
|
||||
<>{value}</>
|
||||
@@ -183,7 +206,6 @@ export const chRowspanTable = (
|
||||
)}
|
||||
</TableCell>
|
||||
);
|
||||
|
||||
})}
|
||||
</TableRow>
|
||||
))) : (
|
||||
|
||||
@@ -494,7 +494,7 @@ export function PbnstBuseForm({
|
||||
sonClass="col-span-4"
|
||||
indexMng={indexMng}
|
||||
indexBiz={indexBiz}
|
||||
formType={""}
|
||||
readonly={false}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
+15
-15
@@ -13,7 +13,7 @@ export function BuseWaterQulity({
|
||||
sonClass,
|
||||
indexMng,
|
||||
indexBiz,
|
||||
formType,
|
||||
readonly,
|
||||
}: {
|
||||
form: UseFormReturn<{ items: PbnstRegArrrayType }>;
|
||||
h1Title: string;
|
||||
@@ -22,7 +22,7 @@ export function BuseWaterQulity({
|
||||
sonClass: string;
|
||||
indexMng: number;
|
||||
indexBiz: number;
|
||||
formType?: string;
|
||||
readonly?: boolean;
|
||||
}) {
|
||||
const [frontPHdata, setFrontPHdata] = useState("0");
|
||||
const [backPHdata, setBackPHdata] = useState("0");
|
||||
@@ -131,7 +131,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -168,7 +168,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
{/* TODO: 총대장균군수 확인 필요*/}
|
||||
@@ -203,7 +203,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -237,7 +237,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -267,7 +267,7 @@ export function BuseWaterQulity({
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly === "sttn" ? true : false}
|
||||
maxLength={txtSize}
|
||||
/> */}
|
||||
<SelectBox
|
||||
@@ -278,7 +278,7 @@ export function BuseWaterQulity({
|
||||
{ val: "불쾌하지않을것", text: "불쾌하지않을것" },
|
||||
{ val: "없음", text: "없음" },
|
||||
]}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
onSelectValue={(val) => {
|
||||
field.onChange(val);
|
||||
}}
|
||||
@@ -310,7 +310,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -344,7 +344,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -379,7 +379,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={6}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -413,7 +413,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={7}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -448,7 +448,7 @@ export function BuseWaterQulity({
|
||||
? `${field.value}`
|
||||
: ""
|
||||
}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={7}
|
||||
/>
|
||||
<span className="text-xl absolute inset-y-0 right-3 flex items-center text-gray-500 pointer-events-none">
|
||||
@@ -472,7 +472,7 @@ export function BuseWaterQulity({
|
||||
isSetFrontPh(e.target.value)
|
||||
}
|
||||
value={frontPHdata ?? ""}
|
||||
readOnly={formType === "sttn"}
|
||||
readOnly={readonly}
|
||||
maxLength={3}
|
||||
/>
|
||||
<span className="text-xl">~</span>
|
||||
@@ -484,7 +484,7 @@ export function BuseWaterQulity({
|
||||
isSetBackPh(e.target.value);
|
||||
}}
|
||||
value={backPHdata ?? ""}
|
||||
readOnly={formType === "sttn"}
|
||||
readOnly={readonly}
|
||||
maxLength={3}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -41,11 +41,13 @@ export function PbnstMngForm({
|
||||
formType,
|
||||
indexMng,
|
||||
setIndexMng,
|
||||
readonly
|
||||
}: {
|
||||
form: UseFormReturn<{ items: PbnstRegArrrayType }>;
|
||||
formType: string;
|
||||
indexMng: number;
|
||||
setIndexMng: (index: number) => void;
|
||||
readonly:boolean
|
||||
}) {
|
||||
const { code, pbnst, fileDelete, fileDownLoad } = useWrStore(
|
||||
(state) => state
|
||||
@@ -293,7 +295,7 @@ export function PbnstMngForm({
|
||||
field.onChange(String(e.target.value));
|
||||
}}
|
||||
value={field.value ?? ""}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
maxLength={txtSize}
|
||||
/>
|
||||
</FormUi>
|
||||
@@ -374,7 +376,7 @@ export function PbnstMngForm({
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -398,7 +400,7 @@ export function PbnstMngForm({
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -421,7 +423,7 @@ export function PbnstMngForm({
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={formType === "sttn" ? true : false}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -99,6 +99,7 @@ export function PbnstRegModal({
|
||||
formType={"reg"}
|
||||
indexMng={indexMng}
|
||||
setIndexMng={setIndexMng}
|
||||
readonly={false}
|
||||
/>
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
|
||||
@@ -35,7 +35,7 @@ import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titleVisible?: boolean }) {
|
||||
const { pbnstSttn, prfmnc , pbnstPrfmncSttn} = useWrStore((state) => state);
|
||||
const { pbnstSttn, prfmnc, pbnstPrfmncSttn } = useWrStore((state) => state);
|
||||
const [fcltTab, setFcltTab] = useState<string>("fclt");
|
||||
const [ruseTab, setRuseTab] = useState<string>("totalPrf");
|
||||
const [ruseHeadList, setRuseHeadList] = useState<TableUpperProps[]>([]);
|
||||
@@ -67,10 +67,10 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
cusrAlotm: item.cusrAlotm ?? "-",
|
||||
etc: item.etc ?? "-",
|
||||
totalMoney:
|
||||
Number(item.addr) +
|
||||
Number(item.gvsbs) +
|
||||
Number(item.lcep) +
|
||||
Number(item.cusrAlotm),
|
||||
Number(item.cusrAlotm) +
|
||||
(isNaN(Number(item.etc)) ? 0 : Number(item.etc)),
|
||||
instlAprvSncnDt: item.instlAprvSncnDt?.toISOString ?? "-",
|
||||
bizCmcnDay: item.bizCmcnDay?.toISOString ?? "-",
|
||||
rprcsFcltCpct: item.rprcsFcltCpct ?? "-",
|
||||
@@ -167,8 +167,8 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
const getTablePrfData = (prfList: PrfType[]) => {
|
||||
const inUsageData = structuredClone(initValInUsage);
|
||||
const outUsageData = structuredClone(initValOutUsage);
|
||||
const inSubtotal = structuredClone(subTotalObj);
|
||||
const outSubtotal = structuredClone(subTotalObj);
|
||||
const inSubtotal = { ...structuredClone(subTotalObj), 구분: "장내용수" };
|
||||
const outSubtotal = { ...structuredClone(subTotalObj), 구분: "장외용수" };
|
||||
|
||||
if (prfList) {
|
||||
prfList?.forEach((prfItem) => {
|
||||
@@ -216,7 +216,9 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
(usageTotalObj as any)[key] = val;
|
||||
}
|
||||
const tableData = [...inUsageData, ...outUsageData, usageTotalObj];
|
||||
|
||||
console.log("inusageData", inUsageData)
|
||||
console.log("outUsageData", outUsageData)
|
||||
console.log("tableData", tableData)
|
||||
setPrfData({
|
||||
inPrf: inUsageData,
|
||||
outPrf: outUsageData,
|
||||
@@ -264,6 +266,7 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
formType={"sttn"}
|
||||
indexMng={indexMng}
|
||||
setIndexMng={setIndexMng}
|
||||
readonly={true}
|
||||
/>
|
||||
<div className="px-6">
|
||||
<div className="">
|
||||
@@ -300,8 +303,8 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
}}
|
||||
>
|
||||
{fcltTab === "fclt" ? (
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.ruseFcltNodeList} />
|
||||
) : undefined}
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.ruseFcltNodeList} />
|
||||
) : undefined}
|
||||
</UiTable>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
@@ -323,22 +326,22 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
|
||||
<TabsContent className="max-h-full" value={ruseTab}>
|
||||
{prfData && (
|
||||
<ListDiv className="col-span-8 pr-6 ">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div>
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(pbnstPrfmncSttn.monthSttnHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody key={prfmnc.pageKey + 'pageKey'}>
|
||||
{InputTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{"하수처리수재이용 실적(m³) 등록결과"}
|
||||
</h3>
|
||||
</div>
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(pbnstPrfmncSttn.monthSttnHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody key={prfmnc.pageKey + 'pageKey'}>
|
||||
{InputTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
)}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
@@ -421,11 +421,11 @@ export default function CoDetailModal({
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="number"
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value);
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
value={formatCommaNumber(field.value) ?? 0}
|
||||
min={0}
|
||||
readOnly={true}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user