diff --git a/src/components/survey-sale/detail/RoofForm.tsx b/src/components/survey-sale/detail/RoofForm.tsx index 1d2b544..553acf2 100644 --- a/src/components/survey-sale/detail/RoofForm.tsx +++ b/src/components/survey-sale/detail/RoofForm.tsx @@ -206,7 +206,7 @@ export default function RoofForm(props: { - {roofInfo.openFieldPlateKind === '4' && ( + {roofInfo.openFieldPlateKind === 'S' && (
{/* 노지판 두께 */}
@@ -309,7 +309,7 @@ const SelectedBox = ({ const handleSelectChange = (e: React.ChangeEvent) => { const value = e.target.value const isEtc = value === 'etc' - const isSpecialEtc = isSpecialCase && value === '2' + const isSpecialEtc = isSpecialCase && value === 'O' const updatedData = { ...detailInfoData, @@ -339,7 +339,7 @@ const SelectedBox = ({ if (mode === 'READ') return true if (column === 'installationAvailability') return false if (column === 'constructionYear') { - return detailInfoData.constructionYear === '1' || detailInfoData.constructionYear === null + return detailInfoData.constructionYear === 'N' || detailInfoData.constructionYear === null } return !isEtcSelected && !etcValue } @@ -351,11 +351,11 @@ const SelectedBox = ({ name={column} id={column} disabled={mode === 'READ'} - value={selectedId ? Number(selectedId) : etcValue || isEtcSelected ? 'etc' : ''} + value={selectedId ? String(selectedId) : etcValue || isEtcSelected ? 'etc' : ''} onChange={handleSelectChange} > {selectBoxOptions[column as keyof typeof selectBoxOptions].map((item) => ( - ))} @@ -458,17 +458,17 @@ const RadioSelected = ({ return ( <> {radioEtcData[column as keyof typeof radioEtcData].map((item) => ( -
+
- +
))} {showEtcOption && ( @@ -528,12 +528,12 @@ const MultiCheck = ({ const selectedValues = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? '')) /** 다중 선택 처리 */ - const handleCheckbox = (id: number) => { + const handleCheckbox = (item: { id: number; code: string | null; name: string }) => { const isOtherSelected = Boolean(etcValue) let newValue: string[] - if (selectedValues.includes(String(id))) { - newValue = selectedValues.filter((v) => v !== String(id)) + if (selectedValues.includes(item.code ?? String(item.id))) { + newValue = selectedValues.filter((v) => v !== item.code && v !== String(item.id)) } else { /** 지붕 재료 처리 - 최대 2개 선택 처리 */ if (isRoofMaterial) { @@ -543,7 +543,7 @@ const MultiCheck = ({ return } } - newValue = [...selectedValues, String(id)] + newValue = [...selectedValues, item.code ?? String(item.id)] } setRoofInfo({ ...roofInfo, [column]: newValue.join(',') }) } @@ -586,9 +586,9 @@ const MultiCheck = ({ handleCheckbox(item.id)} + onChange={() => handleCheckbox(item)} />