wr: 후보지 조회지도 선택된 시설목록 수정

This commit is contained in:
2026-03-27 14:31:40 +09:00
parent ce0e6e9d99
commit 214bd9db4d
4 changed files with 87 additions and 53 deletions
@@ -1,3 +1,6 @@
/**
* 선택된 시설
*/
import React from "react";
type FcltItem = {
@@ -20,52 +23,6 @@ export default function SelectedFcltList({
onRemove(updatedList);
};
const TableContent = (
<>
<thead className="bg-gray-100 text-gray-700 text-[13px]">
<tr>
<th className="px-3 py-2 text-left border-b">시설명</th>
<th className="px-3 py-2 text-right border-b">
하수처리량
<br />
(㎥/일)
</th>
<th className="px-3 py-2 text-right border-b">
재이용량
<br />
(㎥/일)
</th>
<th className="px-3 py-2 border-b">삭제</th>
</tr>
</thead>
<tbody>
{data.map((item) => (
<tr key={item.pbnstRuseFcltId} className="border-b last:border-none">
<td className="px-3 py-2 text-[12px]">{item.ruseUtztnFcltNm}</td>
<td className="px-3 py-2 text-right text-[12px]">
{Number(item.splyExtraCpct || 0).toLocaleString()}
</td>
<td className="px-3 py-2 text-right text-[12px]">
{Number(item.ruseCpct || 0).toLocaleString()}
</td>
<td className="px-3 py-2 text-center">
<button
onClick={() => handleDelete(item.pbnstRuseFcltId)}
className="text-red-500 hover:text-red-700 text-sm font-bold"
aria-label="삭제"
title="삭제"
>
✕
</button>
</td>
</tr>
))}
</tbody>
</>
);
if (data.length === 0) return null;
return (
<div className="fixed right-40 top-[8rem] w-[40rem] max-h-[130rem] overflow-auto bg-white shadow-lg rounded p-4 border border-gray-300 z-50">
<h3 className="bg-cyan-700 text-white text-xl font-bold mb-2 p-2">
@@ -73,7 +30,53 @@ export default function SelectedFcltList({
</h3>
<div className="overflow-x-auto">
<table className="w-full text-sm text-gray-800 border border-gray-200">
{TableContent}
<thead className="bg-gray-100 text-gray-700 text-[13px]">
<tr>
<th className="px-3 py-2 text-left border-b">시설명</th>
<th className="px-3 py-2 text-right border-b">
하수처리량
<br />
(㎥/일)
</th>
<th className="px-3 py-2 text-right border-b">
재이용량
<br />
(㎥/일)
</th>
<th className="px-3 py-2 border-b">삭제</th>
</tr>
</thead>
<tbody>
{data.length > 0 ? (
data.map((item) => (
<tr key={item.pbnstRuseFcltId} className="border-b last:border-none">
<td className="px-3 py-2 text-[12px]">{item.ruseUtztnFcltNm}</td>
<td className="px-3 py-2 text-right text-[12px]">
{Number(item.splyExtraCpct || 0).toLocaleString()}
</td>
<td className="px-3 py-2 text-right text-[12px]">
{Number(item.ruseCpct || 0).toLocaleString()}
</td>
<td className="px-3 py-2 text-center">
<button
onClick={() => handleDelete(item.pbnstRuseFcltId)}
className="text-red-500 hover:text-red-700 text-sm font-bold"
aria-label="삭제"
title="삭제"
>
✕
</button>
</td>
</tr>
))
) : (
<tr>
<td colSpan={4} className="px-3 py-6 text-center text-[12px] text-gray-500">
선택된 시설이 없습니다.
</td>
</tr>
)}
</tbody>
</table>
</div>
</div>
+2 -1
View File
@@ -150,6 +150,7 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
return "수요처 정보 변경 중 오류가 발생했습니다.";
}
},
// 요율정보 조회 : ONSEMIRO_NEW.EM_STD_COST_INC_EXP_RT 설치관리표준사업비 부대경비요율
getRateFee: async (year: string) => {
try {
const url = `/prcsFclt/CstRt/${year}`;
@@ -179,7 +180,7 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
}
});
}catch (e) {
} catch (e) {
console.log('getConstCostFee ', e)
}
@@ -49,7 +49,7 @@ export default function ConCostForm({
}) {
const {
constCostRes, // 표준사업비
rateFeeRes,
rateFeeRes, // 부대경비요율
coMatRvwUpdate,
ruseRvwCalUpdate,
getRateFee,
@@ -109,8 +109,16 @@ export default function ConCostForm({
const totalConstCost = form.watch("totalConstCost");
const cstrnCst = form.watch("demandCst.cstrnCst");
const splyList = form.watch("splyCndtList");
/**
* 표준공산비 산정 : "계산"버튼 click시
*/
const calculateConstCost = useCallback(() => {
const usgPrcsProcs = usgPrcsProcsWatch;
if (selectionVersion == 0) {
alert("먼저 목록에서 수요신청 건을 선택하세요.");
return;
}
if (!dmndQtyWatch) {
alert("요구수량(m³/일)을 확인해주세요 계산할수 없습니다. ");
return;
@@ -121,6 +129,14 @@ export default function ConCostForm({
);
return;
}
if (constCostRes?.length === 0) {
alert("표준공사비 데이터가 없습니다.");
return;
}
if (rateFeeRes?.length === 0) {
alert("표준공사비 데이터가 없습니다.");
return;
}
const dmndQtyYear = dmndQtyWatch;
if (usgPrcsProcs && usgPrcsProcs?.length > 0) {
@@ -159,7 +175,7 @@ export default function ConCostForm({
const groupedBounds: { [key: string]: { lower?: any; upper?: any } } = {};
for (const code of groupCodes) {
groupedBounds[code] = findBounds(
rateFeeRes,
rateFeeRes, // 부대경비요율
code,
"incExpCd",
"stdCost",
@@ -176,8 +192,15 @@ export default function ConCostForm({
form.setValue("demandCst.prcsFcltCpctCstrnCst", Math.round(result));
form.setValue("demandCst.fcltSbsdCstrnCst", Math.round(fcltSbsdCstrnCst));
form.setValue("totalConstCost", Math.round(realResult));
alert("표준공산비 산정이 완료되었습니다.");
}
}, [constCostRes, rateFeeRes, usgPrcsProcsWatch, dmndQtyWatch]);
/**
* 저장 버튼 click 시 실행
* @param value
* @returns
*/
const onSubmit = async (value: DmdCoReqType) => {
if (value.demandCst && !value.demandCst.prcsFcltCpctCstrnCst) {
alert("공사비 계산 진행 후 저장을 눌러주새요");
@@ -189,7 +212,7 @@ export default function ConCostForm({
// ? splycd[0]?.ruseUtztnFcltCd
// : "11000SW001R1";
const pk =lastSub?.ruseUtztnFcltCd??null
const pk =lastSub?.ruseUtztnFcltCd??null; // 후보지
if (type === "mat") {
if (value.demandCst) {
@@ -296,10 +319,17 @@ export default function ConCostForm({
}, []);
/**
* 후보지 조회
* @param e
*/
const searchCandidate = (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
if (selectionVersion == 0) {
alert("먼저 목록에서 수요신청 건을 선택하세요.");
return;
}
const dmdInfoId = form.getValues("dmdInfoId");
console.log(dmdInfoId)
@@ -206,7 +206,7 @@ GisOlStyle.prototype = {
element: overlayContainer,
positioning: 'bottom-center',
stopEvent: false,
offset: overLayOffset ? overLayOffset : [80, 0], // 오프셋 설정 (위치 조정)
offset: overLayOffset ? overLayOffset : [65, 0], // 오프셋 설정 (위치 조정)
});
this.overlays[overLayId] = overlay;