chore: update API URL in development and localhost environment files; enhance SurveySaleDownloadPdf component to handle null values gracefully
This commit is contained in:
parent
0d8dc7dc02
commit
56f8ad9aaf
@ -2,7 +2,7 @@ NEXT_PUBLIC_RUN_MODE=development
|
||||
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
|
||||
# 다시 로컬에서 개발할때는 localhost로 변경
|
||||
#route handler
|
||||
NEXT_PUBLIC_API_URL=http://172.30.1.65:3000
|
||||
NEXT_PUBLIC_API_URL=http://172.30.1.23:3000
|
||||
|
||||
#qsp 로그인 api
|
||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||
|
||||
@ -2,7 +2,7 @@ NEXT_PUBLIC_RUN_MODE=local
|
||||
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
|
||||
# 다시 로컬에서 개발할때는 localhost로 변경
|
||||
#route handler
|
||||
NEXT_PUBLIC_API_URL=http://172.30.1.65:3000
|
||||
NEXT_PUBLIC_API_URL=http://172.30.1.23:3000
|
||||
|
||||
#qsp 로그인 api
|
||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||
|
||||
@ -50,9 +50,13 @@ export default function SurveySaleDownloadPdf() {
|
||||
router.push(`/survey-sale/${id}`)
|
||||
})
|
||||
}
|
||||
const supplementList = supplementaryFacilities
|
||||
.filter((facility) => surveyDetail?.detailInfo?.supplementaryFacilities?.includes(facility.id.toString()))
|
||||
.map((facility) => facility.name)
|
||||
|
||||
return (
|
||||
<>
|
||||
<button onClick={handleDownPdf}>down</button>
|
||||
{/* <button onClick={handleDownPdf}>down</button> */}
|
||||
<div
|
||||
ref={targetRef}
|
||||
style={{
|
||||
@ -80,13 +84,13 @@ export default function SurveySaleDownloadPdf() {
|
||||
現地明登施工店名
|
||||
</p>
|
||||
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#FF5656', fontWeight: 400, fontFamily: 'M-Gothic' }}>
|
||||
{surveyDetail?.store}
|
||||
{surveyDetail?.store ?? '-'}
|
||||
</p>
|
||||
</div>
|
||||
<div style={{ float: 'right' }}>
|
||||
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#101010', fontWeight: 500, fontFamily: 'M-Gothic' }}>現地阴買日</p>
|
||||
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#FF5656', fontWeight: 400, fontFamily: 'M-Gothic' }}>
|
||||
{surveyDetail?.investigationDate}
|
||||
{surveyDetail?.investigationDate ?? '-'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -122,7 +126,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{surveyDetail?.customerName}
|
||||
{surveyDetail?.customerName ?? '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -189,7 +193,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{surveyDetail?.detailInfo?.contractCapacity}
|
||||
{surveyDetail?.detailInfo?.contractCapacity ?? '-'}
|
||||
</td>
|
||||
<th
|
||||
style={{
|
||||
@ -216,7 +220,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{surveyDetail?.detailInfo?.retailCompany}
|
||||
{surveyDetail?.detailInfo?.retailCompany ?? '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -246,13 +250,11 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{supplementaryFacilities
|
||||
.filter((facility) => surveyDetail?.detailInfo?.supplementaryFacilities?.includes(facility.id.toString()))
|
||||
.map((facility) => facility.name)
|
||||
.join(', ')}
|
||||
{surveyDetail?.detailInfo?.supplementaryFacilitiesEtc
|
||||
? `, (その他) ${surveyDetail?.detailInfo?.supplementaryFacilitiesEtc}`
|
||||
: '-'}
|
||||
{supplementList === null && surveyDetail?.detailInfo?.supplementaryFacilitiesEtc === null
|
||||
? '-'
|
||||
: surveyDetail?.detailInfo?.supplementaryFacilitiesEtc
|
||||
? `${supplementList.join(', ')}, ${surveyDetail?.detailInfo?.supplementaryFacilitiesEtc}`
|
||||
: supplementList.join(', ')}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -282,11 +284,16 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{
|
||||
selectBoxOptions.installationSystem.find((system) => system.id.toString() === surveyDetail?.detailInfo?.installationSystem)
|
||||
?.name
|
||||
}
|
||||
{surveyDetail?.detailInfo?.installationSystemEtc ? `, (その他) ${surveyDetail?.detailInfo?.installationSystemEtc}` : '-'}
|
||||
{/* {selectBoxOptions.installationSystem.find ((system) => system.id.toString() === surveyDetail?.detailInfo?.installationSystem)
|
||||
?.name ?? surveyDetail?.detailInfo?.installationSystemEtc !== null
|
||||
? `${surveyDetail?.detailInfo?.installationSystemEtc}`
|
||||
: '-'} */}
|
||||
{surveyDetail?.detailInfo?.installationSystem === null && surveyDetail?.detailInfo?.installationSystemEtc === null
|
||||
? '-'
|
||||
: surveyDetail?.detailInfo?.installationSystemEtc
|
||||
? `${surveyDetail?.detailInfo?.installationSystemEtc}`
|
||||
: selectBoxOptions.installationSystem.find((system) => system.id.toString() === surveyDetail?.detailInfo?.installationSystem)
|
||||
?.name}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -351,11 +358,13 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{roofMaterial
|
||||
.filter((material) => surveyDetail?.detailInfo?.roofMaterial?.includes(material.id.toString()))
|
||||
.map((material) => material.name)
|
||||
.join(', ')}
|
||||
{surveyDetail?.detailInfo?.roofMaterialEtc ? `, (その他) ${surveyDetail?.detailInfo?.roofMaterialEtc}` : '-'}
|
||||
{surveyDetail?.detailInfo?.roofMaterial === null && surveyDetail?.detailInfo?.roofMaterialEtc === null
|
||||
? '-'
|
||||
: roofMaterial
|
||||
.filter((material) => surveyDetail?.detailInfo?.roofMaterial?.includes(material.id.toString()))
|
||||
.map((material) => material.name)
|
||||
.join(', ')}
|
||||
{surveyDetail?.detailInfo?.roofMaterialEtc ? `, ${surveyDetail?.detailInfo?.roofMaterialEtc}` : ''}
|
||||
</td>
|
||||
<th
|
||||
style={{
|
||||
@ -382,7 +391,8 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{selectBoxOptions.roofShape.find((shape) => shape.id.toString() === surveyDetail?.detailInfo?.roofShape)?.name}
|
||||
{selectBoxOptions.roofShape.find((shape) => shape.id.toString() === surveyDetail?.detailInfo?.roofShape)?.name ??
|
||||
(surveyDetail?.detailInfo?.roofShapeEtc ? ` ${surveyDetail?.detailInfo?.roofShapeEtc}` : '-')}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -411,7 +421,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{`${surveyDetail?.detailInfo?.roofSlope} 寸`}
|
||||
{surveyDetail?.detailInfo?.roofSlope ? `${surveyDetail?.detailInfo?.roofSlope} 寸` : '-'}
|
||||
</td>
|
||||
<th
|
||||
style={{
|
||||
@ -439,7 +449,8 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{`${surveyDetail?.detailInfo?.houseStructure ? '木製' : '(その他)'} ${surveyDetail?.detailInfo?.houseStructureEtc}`}
|
||||
{surveyDetail?.detailInfo?.houseStructure ? '木製' : ''}
|
||||
{surveyDetail?.detailInfo?.houseStructureEtc ? ` ${surveyDetail?.detailInfo?.houseStructureEtc}` : '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -468,8 +479,10 @@ export default function SurveySaleDownloadPdf() {
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
>
|
||||
{radioEtcData.rafterMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.rafterMaterial)?.label ??
|
||||
(surveyDetail?.detailInfo?.rafterMaterialEtc ? `(その他) ${surveyDetail?.detailInfo?.rafterMaterialEtc}` : '-')}
|
||||
{surveyDetail?.detailInfo?.rafterMaterial === null && surveyDetail?.detailInfo?.rafterMaterialEtc === null
|
||||
? '-'
|
||||
: radioEtcData.rafterMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.rafterMaterial)?.label ??
|
||||
surveyDetail?.detailInfo?.rafterMaterialEtc}
|
||||
</td>
|
||||
<th
|
||||
style={{
|
||||
@ -498,7 +511,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
}}
|
||||
>
|
||||
{selectBoxOptions.rafterSize.find((size) => size.id.toString() === surveyDetail?.detailInfo?.rafterSize)?.name ??
|
||||
(surveyDetail?.detailInfo?.rafterSizeEtc ? `(その他) ${surveyDetail?.detailInfo?.rafterSizeEtc}` : '-')}
|
||||
(surveyDetail?.detailInfo?.rafterSizeEtc ? ` ${surveyDetail?.detailInfo?.rafterSizeEtc}` : '-')}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -528,7 +541,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
}}
|
||||
>
|
||||
{selectBoxOptions.rafterPitch.find((pitch) => pitch.id.toString() === surveyDetail?.detailInfo?.rafterPitch)?.name ??
|
||||
(surveyDetail?.detailInfo?.rafterPitchEtc ? `(その他) ${surveyDetail?.detailInfo?.rafterPitchEtc}` : '-')}
|
||||
(surveyDetail?.detailInfo?.rafterPitchEtc ? ` ${surveyDetail?.detailInfo?.rafterPitchEtc}` : '-')}
|
||||
</td>
|
||||
<th
|
||||
style={{
|
||||
@ -587,7 +600,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
}}
|
||||
>
|
||||
{selectBoxOptions.openFieldPlateKind.find((kind) => kind.id.toString() === surveyDetail?.detailInfo?.openFieldPlateKind)?.name ??
|
||||
(surveyDetail?.detailInfo?.openFieldPlateKindEtc ? `(その他) ${surveyDetail?.detailInfo?.openFieldPlateKindEtc}` : '-')}
|
||||
(surveyDetail?.detailInfo?.openFieldPlateKindEtc ? `${surveyDetail?.detailInfo?.openFieldPlateKindEtc}` : '-')}
|
||||
</td>
|
||||
<th
|
||||
style={{
|
||||
@ -676,8 +689,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
}}
|
||||
>
|
||||
{radioEtcData.waterproofMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.waterproofMaterial)
|
||||
?.label ??
|
||||
(surveyDetail?.detailInfo?.waterproofMaterialEtc ? `(その他) ${surveyDetail?.detailInfo?.waterproofMaterialEtc}` : '-')}
|
||||
?.label ?? (surveyDetail?.detailInfo?.waterproofMaterialEtc ? ` ${surveyDetail?.detailInfo?.waterproofMaterialEtc}` : '-')}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -711,7 +723,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
radioEtcData.insulationPresence.find((presence) => presence.id.toString() === surveyDetail?.detailInfo?.insulationPresence)
|
||||
?.label
|
||||
}
|
||||
{surveyDetail?.detailInfo?.insulationPresenceEtc ? `(その他) ${surveyDetail?.detailInfo?.insulationPresenceEtc}` : '-'}
|
||||
{surveyDetail?.detailInfo?.insulationPresenceEtc ? ` ${surveyDetail?.detailInfo?.insulationPresenceEtc}` : '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -742,7 +754,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
}}
|
||||
>
|
||||
{selectBoxOptions.structureOrder.find((order) => order.id.toString() === surveyDetail?.detailInfo?.structureOrder)?.name ??
|
||||
(surveyDetail?.detailInfo?.structureOrderEtc ? `(その他) ${surveyDetail?.detailInfo?.structureOrderEtc}` : '-')}
|
||||
(surveyDetail?.detailInfo?.structureOrderEtc ? ` ${surveyDetail?.detailInfo?.structureOrderEtc}` : '-')}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -785,9 +797,7 @@ export default function SurveySaleDownloadPdf() {
|
||||
(availability) => availability.id.toString() === surveyDetail?.detailInfo?.installationAvailability,
|
||||
)?.name
|
||||
}
|
||||
{surveyDetail?.detailInfo?.installationAvailabilityEtc
|
||||
? `(その他) ${surveyDetail?.detailInfo?.installationAvailabilityEtc}`
|
||||
: '-'}
|
||||
{surveyDetail?.detailInfo?.installationAvailabilityEtc ? ` ${surveyDetail?.detailInfo?.installationAvailabilityEtc}` : '-'}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user