diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 3a511a3..5fef0a2 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -79,13 +79,13 @@ model SD_SERVEY_SALES_DETAIL_INFO {
id Int @id @default(autoincrement())
contract_capacity String? @db.VarChar(20)
retail_company String? @db.VarChar(100)
- supplementary_facilities Int?
+ supplementary_facilities String? @db.VarChar(20)
supplementary_facilities_etc String? @db.VarChar(200)
installation_system Int?
installation_system_etc String? @db.VarChar(200)
construction_year Int?
construction_year_etc String? @db.VarChar(200)
- roof_material Int?
+ roof_material String? @db.VarChar(20)
roof_material_etc String? @db.VarChar(200)
roof_shape Int?
roof_shape_etc String? @db.VarChar(200)
diff --git a/src/app/survey-sale/[id]/page.tsx b/src/app/survey-sale/[id]/page.tsx
index cfc35d3..5ecf1a7 100644
--- a/src/app/survey-sale/[id]/page.tsx
+++ b/src/app/survey-sale/[id]/page.tsx
@@ -5,7 +5,6 @@ export default function page() {
return (
<>
- {/* */}
>
)
}
diff --git a/src/components/survey-sale/detail/RoofDetailForm.tsx b/src/components/survey-sale/detail/RoofDetailForm.tsx
index e88c938..5677264 100644
--- a/src/components/survey-sale/detail/RoofDetailForm.tsx
+++ b/src/components/survey-sale/detail/RoofDetailForm.tsx
@@ -1,5 +1,8 @@
-import { SurveyBasicInfo } from '@/types/Survey'
+import { SurveyBasicInfo, SurveyDetailInfo } from '@/types/Survey'
import DetailButton from './DetailButton'
+import { roof_material, supplementary_facilities } from './form/MultiCheckEtc'
+import { selectBoxOptions } from './form/SelectBoxEtc'
+import { radioEtcData } from './form/RadioEtc'
export default function RoofDetailForm({
surveyDetail,
@@ -8,6 +11,15 @@ export default function RoofDetailForm({
surveyDetail: SurveyBasicInfo | null
isLoadingSurveyDetail: boolean
}) {
+ console.log(surveyDetail)
+
+ const makeNumArr = (value: string) => {
+ return value
+ .split(',')
+ .map((v) => v.trim())
+ .filter((v) => v.length > 0)
+ }
+
if (isLoadingSurveyDetail) {
return
Loading...
}
@@ -15,8 +27,173 @@ export default function RoofDetailForm({
<>
+
+ {/* 전기 계약 용량 */}
+
電気契約容量
+
+
+ {/* 전기 소매 회사 */}
+
+ {/* 전기 부대 설비 */}
+
+ {/* 설치 희망 시스템 */}
+
+ {/* 건축 연수 */}
+
+ {/* 지붕재 */}
+ {/* 지붕 모양 */}
+
+ {/* 지붕 경사도 */}
+
+ {/* 주택 구조 */}
+
+ {/* 서까래 재질 */}
+
+ {/* 서까래 크기 */}
+
+ {/* 서까래 피치 */}
+
+ {/* 서까래 방향 */}
+
+ {/* 노지판 종류 */}
+
+ {/* 노지판 두께 */}
+
+ {/* 누수 흔적 */}
+
+ {/* 방수재 종류 */}
+
+ {/* 단열재 유무 */}
+
+ {/* 구조 순서 */}
+
+ {/* 설치 가능 여부 */}
+
+ {/* 메모 */}
+
@@ -24,3 +201,56 @@ export default function RoofDetailForm({
>
)
}
+
+const SelectedBox = ({ column, detailInfoData }: { column: string; detailInfoData: SurveyDetailInfo | null }) => {
+ const selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
+ const etcValue = detailInfoData?.[`${column}_etc` as keyof SurveyDetailInfo]
+
+ return (
+ <>
+
+ {etcValue &&
}
+ >
+ )
+}
+
+const RadioSelected = ({ column, detailInfoData }: { column: string; detailInfoData: SurveyDetailInfo | null }) => {
+ let selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
+ if (column === 'leak_trace') {
+ selectedId = Number(selectedId)
+ }
+
+ let etcValue = null
+ if (column !== 'rafter_direction') {
+ etcValue = detailInfoData?.[`${column}_etc` as keyof SurveyDetailInfo]
+ }
+ const etcChecked = etcValue !== null && etcValue !== undefined && etcValue !== ''
+
+ return (
+ <>
+ {radioEtcData[column as keyof typeof radioEtcData].map((item) => (
+
+
+
+
+ ))}
+ {column !== 'rafter_direction' && column !== 'leak_trace' && column !== 'insulation_presence' && (
+
+
+
+
+ )}
+ {etcChecked && (
+
+
+
+ )}
+ >
+ )
+}
diff --git a/src/components/survey-sale/detail/form/MultiCheckEtc.tsx b/src/components/survey-sale/detail/form/MultiCheckEtc.tsx
index 2ba0951..637d202 100644
--- a/src/components/survey-sale/detail/form/MultiCheckEtc.tsx
+++ b/src/components/survey-sale/detail/form/MultiCheckEtc.tsx
@@ -1,14 +1,14 @@
import { SurveyDetailRequest } from '@/types/Survey'
import { useEffect, useState } from 'react'
-const supplementary_facilities = [
+export const supplementary_facilities = [
{ id: 1, name: 'エコキュート' }, //에코큐트
{ id: 2, name: 'エネパーム' }, //에네팜
{ id: 3, name: '蓄電池システム' }, //축전지시스템
{ id: 4, name: '太陽光発電' }, //태양광발전
]
-const roof_material = [
+export const roof_material = [
{ id: 1, name: 'スレート' }, //슬레이트
{ id: 2, name: 'アスファルトシングル' }, //아스팔트 싱글
{ id: 3, name: '瓦' }, //기와
diff --git a/src/components/survey-sale/detail/form/RadioEtc.tsx b/src/components/survey-sale/detail/form/RadioEtc.tsx
index ebb6757..ea9eabc 100644
--- a/src/components/survey-sale/detail/form/RadioEtc.tsx
+++ b/src/components/survey-sale/detail/form/RadioEtc.tsx
@@ -2,16 +2,18 @@
import { useEffect, useState } from 'react'
import { SurveyDetailRequest } from '@/types/Survey'
-type RadioEtcKeys = 'house_structure' | 'rafter_material' | 'waterproof_material' | 'insulation_presence'
+type RadioEtcKeys = 'house_structure' | 'rafter_material' | 'waterproof_material' | 'insulation_presence' | 'rafter_direction' | 'leak_trace'
const translateJapanese: Record
= {
house_structure: '住宅構造',
rafter_material: '垂木材質',
waterproof_material: '防水材の種類',
insulation_presence: '断熱材の有無',
+ rafter_direction: '垂木の方向',
+ leak_trace: '水漏れの痕跡',
}
-const radioEtcData: Record = {
+export const radioEtcData: Record = {
house_structure: [
{
id: 1,
@@ -44,6 +46,26 @@ const radioEtcData: Record = {
label: 'あり',
},
],
+ rafter_direction: [
+ {
+ id: 1,
+ label: '垂直垂木',
+ },
+ {
+ id: 2,
+ label: '水平垂木',
+ },
+ ],
+ leak_trace: [
+ {
+ id: 1,
+ label: 'あり',
+ },
+ {
+ id: 2,
+ label: 'なし',
+ },
+ ],
}
export default function RadioEtc({
diff --git a/src/components/survey-sale/detail/form/SelectBoxEtc.tsx b/src/components/survey-sale/detail/form/SelectBoxEtc.tsx
index 40a570d..63b01ca 100644
--- a/src/components/survey-sale/detail/form/SelectBoxEtc.tsx
+++ b/src/components/survey-sale/detail/form/SelectBoxEtc.tsx
@@ -1,7 +1,7 @@
import type { SurveyDetailRequest } from '@/types/Survey'
import { useEffect, useState } from 'react'
-type SelectBoxKeys =
+export type SelectBoxKeys =
| 'installation_system'
| 'construction_year'
| 'roof_shape'
@@ -33,7 +33,7 @@ const translateJapanese: Record = {
installation_availability: '屋根製品名 設置可否確認',
}
-const selectBoxOptions: Record = {
+export const selectBoxOptions: Record = {
installation_system: [
{
id: 1,