Compare commits
No commits in common. "03d91f3fa0208fdce5d7cd744515474f17da3fdf" and "6d837d3e9894413600aebb902e54020d0e811819" have entirely different histories.
03d91f3fa0
...
6d837d3e98
@ -2,11 +2,10 @@ NEXT_PUBLIC_RUN_MODE=development
|
|||||||
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
|
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
|
||||||
# 다시 로컬에서 개발할때는 localhost로 변경
|
# 다시 로컬에서 개발할때는 localhost로 변경
|
||||||
#route handler
|
#route handler
|
||||||
NEXT_PUBLIC_API_URL=http://172.30.1.23:3000
|
NEXT_PUBLIC_API_URL=http://172.30.1.65:3000
|
||||||
|
|
||||||
#qsp 로그인 api
|
#qsp 로그인 api
|
||||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||||
# NEXT_PUBLIC_QSP_API_URL=https://jp-dev.qsalesplatform.com
|
|
||||||
|
|
||||||
#1:1문의 api
|
#1:1문의 api
|
||||||
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
||||||
@ -17,10 +16,3 @@ DB_USER=readonly
|
|||||||
DB_PASSWORD=aAjmFW12iHKW84l1
|
DB_PASSWORD=aAjmFW12iHKW84l1
|
||||||
DB_DATABASE=qpartners
|
DB_DATABASE=qpartners
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
|
|
||||||
SMTP_HOST=autodiscover.qcells.com
|
|
||||||
SMTP_PORT=25
|
|
||||||
SMTP_SECURE=true
|
|
||||||
SMTP_USER=hss404.u021@cleverse.dev
|
|
||||||
SMTP_PASSWORD=0000
|
|
||||||
SMTP_FROM=qsalesplatform@qcells.com
|
|
||||||
@ -2,11 +2,10 @@ NEXT_PUBLIC_RUN_MODE=local
|
|||||||
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
|
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
|
||||||
# 다시 로컬에서 개발할때는 localhost로 변경
|
# 다시 로컬에서 개발할때는 localhost로 변경
|
||||||
#route handler
|
#route handler
|
||||||
NEXT_PUBLIC_API_URL=http://172.30.1.23:3000
|
NEXT_PUBLIC_API_URL=http://172.30.1.65:3000
|
||||||
|
|
||||||
#qsp 로그인 api
|
#qsp 로그인 api
|
||||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||||
# NEXT_PUBLIC_QSP_API_URL=https://jp-dev.qsalesplatform.com
|
|
||||||
|
|
||||||
#1:1문의 api
|
#1:1문의 api
|
||||||
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
||||||
@ -17,10 +16,3 @@ DB_USER=readonly
|
|||||||
DB_PASSWORD=aAjmFW12iHKW84l1
|
DB_PASSWORD=aAjmFW12iHKW84l1
|
||||||
DB_DATABASE=qpartners
|
DB_DATABASE=qpartners
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
|
|
||||||
SMTP_HOST=autodiscover.qcells.com
|
|
||||||
SMTP_PORT=25
|
|
||||||
SMTP_SECURE=true
|
|
||||||
SMTP_USER=hss404.u021@cleverse.dev
|
|
||||||
SMTP_PASSWORD=0000
|
|
||||||
SMTP_FROM=qsalesplatform@qcells.com
|
|
||||||
|
|||||||
@ -3,8 +3,7 @@ NEXT_PUBLIC_RUN_MODE=production
|
|||||||
NEXT_PUBLIC_API_URL=http://1.248.227.176:3000
|
NEXT_PUBLIC_API_URL=http://1.248.227.176:3000
|
||||||
|
|
||||||
#qsp 로그인 api
|
#qsp 로그인 api
|
||||||
# NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||||
NEXT_PUBLIC_QSP_API_URL=https://jp.qsalesplatform.com
|
|
||||||
|
|
||||||
#1:1문의 api
|
#1:1문의 api
|
||||||
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
NEXT_PUBLIC_INQUIRY_API_URL=http://172.23.4.129:8110
|
||||||
@ -15,10 +14,3 @@ DB_USER=readonly
|
|||||||
DB_PASSWORD=aAjmFW12iHKW84l1
|
DB_PASSWORD=aAjmFW12iHKW84l1
|
||||||
DB_DATABASE=qpartners
|
DB_DATABASE=qpartners
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
|
|
||||||
SMTP_HOST=autodiscover.qcells.com
|
|
||||||
SMTP_PORT=25
|
|
||||||
SMTP_SECURE=true
|
|
||||||
SMTP_USER=hss404.u021@cleverse.dev
|
|
||||||
SMTP_PASSWORD=0000
|
|
||||||
SMTP_FROM=qsalesplatform@qcells.com
|
|
||||||
10
package-lock.json
generated
10
package-lock.json
generated
@ -18,7 +18,6 @@
|
|||||||
"mssql": "^11.0.1",
|
"mssql": "^11.0.1",
|
||||||
"mysql2": "^3.14.1",
|
"mysql2": "^3.14.1",
|
||||||
"next": "15.2.4",
|
"next": "15.2.4",
|
||||||
"nodemailer": "^7.0.3",
|
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-to-pdf": "^2.0.0",
|
"react-to-pdf": "^2.0.0",
|
||||||
@ -3701,15 +3700,6 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/nodemailer": {
|
|
||||||
"version": "7.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.3.tgz",
|
|
||||||
"integrity": "sha512-Ajq6Sz1x7cIK3pN6KesGTah+1gnwMnx5gKl3piQlQQE/PwyJ4Mbc8is2psWYxK3RJTVeqsDaCv8ZzXLCDHMTZw==",
|
|
||||||
"license": "MIT-0",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/open": {
|
"node_modules/open": {
|
||||||
"version": "10.1.0",
|
"version": "10.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz",
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
"@prisma/client": "^6.7.0",
|
"@prisma/client": "^6.7.0",
|
||||||
"@tanstack/react-query": "^5.71.0",
|
"@tanstack/react-query": "^5.71.0",
|
||||||
"@tanstack/react-query-devtools": "^5.71.0",
|
"@tanstack/react-query-devtools": "^5.71.0",
|
||||||
"@types/nodemailer": "^6.4.17",
|
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.8.4",
|
||||||
"env-cmd": "^10.1.0",
|
"env-cmd": "^10.1.0",
|
||||||
"iron-session": "^8.0.4",
|
"iron-session": "^8.0.4",
|
||||||
@ -26,7 +25,6 @@
|
|||||||
"mssql": "^11.0.1",
|
"mssql": "^11.0.1",
|
||||||
"mysql2": "^3.14.1",
|
"mysql2": "^3.14.1",
|
||||||
"next": "15.2.4",
|
"next": "15.2.4",
|
||||||
"nodemailer": "^7.0.3",
|
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-to-pdf": "^2.0.0",
|
"react-to-pdf": "^2.0.0",
|
||||||
|
|||||||
@ -83,10 +83,6 @@ export default function Login() {
|
|||||||
loginId: account.loginId,
|
loginId: account.loginId,
|
||||||
pwd: account.pwd,
|
pwd: account.pwd,
|
||||||
})
|
})
|
||||||
// const { data } = await axiosInstance(`${process.env.NEXT_PUBLIC_QSP_API_URL}`).post(`/api/user/login`, {
|
|
||||||
// loginId: account.loginId,
|
|
||||||
// pwd: account.pwd,
|
|
||||||
// })
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,29 +2,22 @@
|
|||||||
|
|
||||||
import { useEffect, useRef } from 'react'
|
import { useEffect, useRef } from 'react'
|
||||||
import generatePDF, { Margin, Resolution } from 'react-to-pdf'
|
import generatePDF, { Margin, Resolution } from 'react-to-pdf'
|
||||||
import { useParams, useRouter } from 'next/navigation'
|
import { useParams } from 'next/navigation'
|
||||||
import { useSurvey } from '@/hooks/useSurvey'
|
import { useSurvey } from '@/hooks/useSurvey'
|
||||||
import { radioEtcData, roofMaterial, selectBoxOptions, supplementaryFacilities } from '../survey-sale/detail/RoofForm'
|
import { radioEtcData, roofMaterial, selectBoxOptions, supplementaryFacilities } from '../survey-sale/detail/RoofForm'
|
||||||
import { useSpinnerStore } from '@/store/spinnerStore'
|
|
||||||
|
|
||||||
export default function SurveySaleDownloadPdf() {
|
export default function SurveySaleDownloadPdf() {
|
||||||
const params = useParams()
|
const params = useParams()
|
||||||
const id = params.id
|
const id = params.id
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const { surveyDetail, isLoadingSurveyDetail } = useSurvey(Number(id))
|
const { surveyDetail, isLoadingSurveyDetail } = useSurvey(Number(id))
|
||||||
const { setIsShow } = useSpinnerStore()
|
|
||||||
|
|
||||||
const targetRef = useRef<HTMLDivElement>(null)
|
|
||||||
const isGeneratedRef = useRef(false)
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsShow(true)
|
if (isLoadingSurveyDetail) return
|
||||||
if (isLoadingSurveyDetail || !surveyDetail || isGeneratedRef.current) return
|
|
||||||
isGeneratedRef.current = true
|
|
||||||
handleDownPdf()
|
handleDownPdf()
|
||||||
}, [surveyDetail?.id, isLoadingSurveyDetail])
|
}, [surveyDetail, isLoadingSurveyDetail])
|
||||||
|
|
||||||
|
const targetRef = useRef<HTMLDivElement>(null)
|
||||||
const handleDownPdf = () => {
|
const handleDownPdf = () => {
|
||||||
const options = {
|
const options = {
|
||||||
method: 'open' as const,
|
method: 'open' as const,
|
||||||
@ -48,31 +41,14 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
generatePDF(targetRef, options).then(() => {
|
generatePDF(targetRef, options)
|
||||||
setIsShow(false)
|
// generatePDF(targetRef, { filename: 'page.pdf' })
|
||||||
router.push(`/survey-sale/${id}`)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const supplementList = supplementaryFacilities
|
|
||||||
.filter((facility) => surveyDetail?.detailInfo?.supplementaryFacilities?.includes(facility.id.toString()))
|
|
||||||
.map((facility) => facility.name)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
{/* <button onClick={handleDownPdf}>down</button> */}
|
||||||
ref={targetRef}
|
<div ref={targetRef} style={{ boxSizing: 'border-box' }}>
|
||||||
style={{
|
<div style={{ margin: '0 auto', padding: 0, maxWidth: '800px', minWidth: '800px' }}>
|
||||||
width: '794px', // A4 너비
|
|
||||||
minHeight: '1123px', // A4 높이
|
|
||||||
transform: 'scale(1.0)',
|
|
||||||
transformOrigin: 'top left',
|
|
||||||
padding: '20px',
|
|
||||||
boxSizing: 'border-box',
|
|
||||||
backgroundColor: '#fff',
|
|
||||||
fontSize: '12px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<div style={{ padding: '20px 20px 50px', borderBottom: '2px solid #2E3A59' }}>
|
<div style={{ padding: '20px 20px 50px', borderBottom: '2px solid #2E3A59' }}>
|
||||||
<div style={{ float: 'left', verticalAlign: 'middle', fontSize: '18px', color: '#101010', fontWeight: 600, fontFamily: 'M-Gothic' }}>
|
<div style={{ float: 'left', verticalAlign: 'middle', fontSize: '18px', color: '#101010', fontWeight: 600, fontFamily: 'M-Gothic' }}>
|
||||||
HWJ 現地調査シート1/2
|
HWJ 現地調査シート1/2
|
||||||
@ -83,13 +59,13 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
現地明登施工店名
|
現地明登施工店名
|
||||||
</p>
|
</p>
|
||||||
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#FF5656', fontWeight: 400, fontFamily: 'M-Gothic' }}>
|
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#FF5656', fontWeight: 400, fontFamily: 'M-Gothic' }}>
|
||||||
{surveyDetail?.store ?? '-'}
|
{surveyDetail?.store}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ float: 'right' }}>
|
<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: '#101010', fontWeight: 500, fontFamily: 'M-Gothic' }}>現地阴買日</p>
|
||||||
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#FF5656', fontWeight: 400, fontFamily: 'M-Gothic' }}>
|
<p style={{ margin: 0, padding: 0, fontSize: '13px', color: '#FF5656', fontWeight: 400, fontFamily: 'M-Gothic' }}>
|
||||||
{surveyDetail?.investigationDate ?? '-'}
|
{surveyDetail?.investigationDate}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -125,7 +101,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.customerName ?? '-'}
|
{surveyDetail?.customerName}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -192,7 +168,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.detailInfo?.contractCapacity ?? '-'}
|
{surveyDetail?.detailInfo?.contractCapacity}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
@ -219,7 +195,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.detailInfo?.retailCompany ?? '-'}
|
{surveyDetail?.detailInfo?.retailCompany}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -249,11 +225,13 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{supplementList === null && surveyDetail?.detailInfo?.supplementaryFacilitiesEtc === null
|
{supplementaryFacilities
|
||||||
? '-'
|
.filter((facility) => surveyDetail?.detailInfo?.supplementaryFacilities?.includes(facility.id.toString()))
|
||||||
: surveyDetail?.detailInfo?.supplementaryFacilitiesEtc
|
.map((facility) => facility.name)
|
||||||
? `${supplementList.join(', ')}, ${surveyDetail?.detailInfo?.supplementaryFacilitiesEtc}`
|
.join(', ')}
|
||||||
: supplementList.join(', ')}
|
{surveyDetail?.detailInfo?.supplementaryFacilitiesEtc
|
||||||
|
? `, (その他) ${surveyDetail?.detailInfo?.supplementaryFacilitiesEtc}`
|
||||||
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -283,16 +261,11 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* {selectBoxOptions.installationSystem.find ((system) => system.id.toString() === surveyDetail?.detailInfo?.installationSystem)
|
{
|
||||||
?.name ?? surveyDetail?.detailInfo?.installationSystemEtc !== null
|
selectBoxOptions.installationSystem.find((system) => system.id.toString() === surveyDetail?.detailInfo?.installationSystem)
|
||||||
? `${surveyDetail?.detailInfo?.installationSystemEtc}`
|
?.name
|
||||||
: '-'} */}
|
}
|
||||||
{surveyDetail?.detailInfo?.installationSystem === null && surveyDetail?.detailInfo?.installationSystemEtc === null
|
{surveyDetail?.detailInfo?.installationSystemEtc ? `, (その他) ${surveyDetail?.detailInfo?.installationSystemEtc}` : '-'}
|
||||||
? '-'
|
|
||||||
: surveyDetail?.detailInfo?.installationSystemEtc
|
|
||||||
? `${surveyDetail?.detailInfo?.installationSystemEtc}`
|
|
||||||
: selectBoxOptions.installationSystem.find((system) => system.id.toString() === surveyDetail?.detailInfo?.installationSystem)
|
|
||||||
?.name}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -357,13 +330,11 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.detailInfo?.roofMaterial === null && surveyDetail?.detailInfo?.roofMaterialEtc === null
|
{roofMaterial
|
||||||
? '-'
|
|
||||||
: roofMaterial
|
|
||||||
.filter((material) => surveyDetail?.detailInfo?.roofMaterial?.includes(material.id.toString()))
|
.filter((material) => surveyDetail?.detailInfo?.roofMaterial?.includes(material.id.toString()))
|
||||||
.map((material) => material.name)
|
.map((material) => material.name)
|
||||||
.join(', ')}
|
.join(', ')}
|
||||||
{surveyDetail?.detailInfo?.roofMaterialEtc ? `, ${surveyDetail?.detailInfo?.roofMaterialEtc}` : ''}
|
{surveyDetail?.detailInfo?.roofMaterialEtc ? `, (その他) ${surveyDetail?.detailInfo?.roofMaterialEtc}` : '-'}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
@ -390,8 +361,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -420,7 +390,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.detailInfo?.roofSlope ? `${surveyDetail?.detailInfo?.roofSlope} 寸` : '-'}
|
{`${surveyDetail?.detailInfo?.roofSlope} 寸`}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
@ -448,8 +418,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{radioEtcData.houseStructure.find((structure) => structure.id.toString() === surveyDetail?.detailInfo?.houseStructure)?.label ??
|
{`${surveyDetail?.detailInfo?.houseStructure ? '木製' : '(その他)'} ${surveyDetail?.detailInfo?.houseStructureEtc}`}
|
||||||
(surveyDetail?.detailInfo?.houseStructureEtc ? ` ${surveyDetail?.detailInfo?.houseStructureEtc}` : '-')}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -478,12 +447,8 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* {surveyDetail?.detailInfo?.rafterMaterial === null && surveyDetail?.detailInfo?.rafterMaterialEtc === null
|
|
||||||
? '-'
|
|
||||||
: radioEtcData.rafterMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.rafterMaterial)?.label ??
|
|
||||||
surveyDetail?.detailInfo?.rafterMaterialEtc} */}
|
|
||||||
{radioEtcData.rafterMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.rafterMaterial)?.label ??
|
{radioEtcData.rafterMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.rafterMaterial)?.label ??
|
||||||
(surveyDetail?.detailInfo?.rafterMaterialEtc ? ` ${surveyDetail?.detailInfo?.rafterMaterialEtc}` : '-')}
|
(surveyDetail?.detailInfo?.rafterMaterialEtc ? `(その他) ${surveyDetail?.detailInfo?.rafterMaterialEtc}` : '-')}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
@ -512,7 +477,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{selectBoxOptions.rafterSize.find((size) => size.id.toString() === surveyDetail?.detailInfo?.rafterSize)?.name ??
|
{selectBoxOptions.rafterSize.find((size) => size.id.toString() === surveyDetail?.detailInfo?.rafterSize)?.name ??
|
||||||
(surveyDetail?.detailInfo?.rafterSizeEtc ? ` ${surveyDetail?.detailInfo?.rafterSizeEtc}` : '-')}
|
(surveyDetail?.detailInfo?.rafterSizeEtc ? `(その他) ${surveyDetail?.detailInfo?.rafterSizeEtc}` : '-')}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -542,7 +507,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{selectBoxOptions.rafterPitch.find((pitch) => pitch.id.toString() === surveyDetail?.detailInfo?.rafterPitch)?.name ??
|
{selectBoxOptions.rafterPitch.find((pitch) => pitch.id.toString() === surveyDetail?.detailInfo?.rafterPitch)?.name ??
|
||||||
(surveyDetail?.detailInfo?.rafterPitchEtc ? ` ${surveyDetail?.detailInfo?.rafterPitchEtc}` : '-')}
|
(surveyDetail?.detailInfo?.rafterPitchEtc ? `(その他) ${surveyDetail?.detailInfo?.rafterPitchEtc}` : '-')}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
@ -601,7 +566,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{selectBoxOptions.openFieldPlateKind.find((kind) => kind.id.toString() === surveyDetail?.detailInfo?.openFieldPlateKind)?.name ??
|
{selectBoxOptions.openFieldPlateKind.find((kind) => kind.id.toString() === surveyDetail?.detailInfo?.openFieldPlateKind)?.name ??
|
||||||
(surveyDetail?.detailInfo?.openFieldPlateKindEtc ? `${surveyDetail?.detailInfo?.openFieldPlateKindEtc}` : '-')}
|
(surveyDetail?.detailInfo?.openFieldPlateKindEtc ? `(その他) ${surveyDetail?.detailInfo?.openFieldPlateKindEtc}` : '-')}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
@ -690,7 +655,8 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{radioEtcData.waterproofMaterial.find((material) => material.id.toString() === surveyDetail?.detailInfo?.waterproofMaterial)
|
{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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -724,7 +690,7 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
radioEtcData.insulationPresence.find((presence) => presence.id.toString() === surveyDetail?.detailInfo?.insulationPresence)
|
radioEtcData.insulationPresence.find((presence) => presence.id.toString() === surveyDetail?.detailInfo?.insulationPresence)
|
||||||
?.label
|
?.label
|
||||||
}
|
}
|
||||||
{surveyDetail?.detailInfo?.insulationPresenceEtc ? `, ${surveyDetail?.detailInfo?.insulationPresenceEtc}` : ''}
|
{surveyDetail?.detailInfo?.insulationPresenceEtc ? `(その他) ${surveyDetail?.detailInfo?.insulationPresenceEtc}` : '-'}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -754,8 +720,8 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{radioEtcData.structureOrder.find((order) => order.id.toString() === surveyDetail?.detailInfo?.structureOrder)?.label ??
|
{selectBoxOptions.structureOrder.find((order) => order.id.toString() === surveyDetail?.detailInfo?.structureOrder)?.name ??
|
||||||
(surveyDetail?.detailInfo?.structureOrderEtc ? `${surveyDetail?.detailInfo?.structureOrderEtc}` : '-')}
|
(surveyDetail?.detailInfo?.structureOrderEtc ? `(その他) ${surveyDetail?.detailInfo?.structureOrderEtc}` : '-')}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -793,12 +759,14 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.detailInfo?.installationAvailability === null && surveyDetail.detailInfo?.installationAvailabilityEtc === null
|
{
|
||||||
? '-'
|
selectBoxOptions.installationAvailability.find(
|
||||||
: selectBoxOptions.installationAvailability.find(
|
|
||||||
(availability) => availability.id.toString() === surveyDetail?.detailInfo?.installationAvailability,
|
(availability) => availability.id.toString() === surveyDetail?.detailInfo?.installationAvailability,
|
||||||
)?.name}
|
)?.name
|
||||||
{surveyDetail?.detailInfo?.installationAvailabilityEtc ? `, ${surveyDetail?.detailInfo?.installationAvailabilityEtc}` : ''}
|
}
|
||||||
|
{surveyDetail?.detailInfo?.installationAvailabilityEtc
|
||||||
|
? `(その他) ${surveyDetail?.detailInfo?.installationAvailabilityEtc}`
|
||||||
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -6,14 +6,12 @@ import { useEffect, useState } from 'react'
|
|||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
import { useCommCode } from '@/hooks/useCommCode'
|
import { useCommCode } from '@/hooks/useCommCode'
|
||||||
import { CommCode } from '@/types/CommCode'
|
import { CommCode } from '@/types/CommCode'
|
||||||
// import { sendEmail } from '@/libs/mailer'
|
|
||||||
import { useSpinnerStore } from '@/store/spinnerStore'
|
|
||||||
|
|
||||||
interface SubmitFormData {
|
interface SubmitFormData {
|
||||||
saleBase: string | null
|
saleBase: string | null
|
||||||
store: string
|
store: string
|
||||||
sender: string
|
sender: string
|
||||||
receiver: string[] | string
|
receiver: string[]
|
||||||
reference: string | null
|
reference: string | null
|
||||||
title: string
|
title: string
|
||||||
contents: string
|
contents: string
|
||||||
@ -31,7 +29,6 @@ export default function SurveySaleSubmitPopup() {
|
|||||||
const params = useParams()
|
const params = useParams()
|
||||||
const routeId = params.id
|
const routeId = params.id
|
||||||
|
|
||||||
const { setIsShow } = useSpinnerStore()
|
|
||||||
const [commCodeList, setCommCodeList] = useState<CommCode[]>([])
|
const [commCodeList, setCommCodeList] = useState<CommCode[]>([])
|
||||||
|
|
||||||
const { getCommCode } = useCommCode()
|
const { getCommCode } = useCommCode()
|
||||||
@ -89,22 +86,10 @@ export default function SurveySaleSubmitPopup() {
|
|||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (validateData(submitData)) {
|
if (validateData(submitData)) {
|
||||||
window.neoConfirm('送信しますか? 送信後は変更・修正することはできません。', () => {
|
window.neoConfirm('送信しますか? 送信後は変更・修正することはできません。', () => {
|
||||||
setIsShow(true)
|
|
||||||
submitSurvey({ targetId: submitData.store })
|
submitSurvey({ targetId: submitData.store })
|
||||||
// sendEmail({
|
|
||||||
// to: submitData.receiver,
|
|
||||||
// subject: submitData.title,
|
|
||||||
// content: submitData.contents,
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
if (!isSubmittingSurvey) {
|
if (!isSubmittingSurvey) {
|
||||||
popupController.setSurveySaleSubmitPopup(false)
|
popupController.setSurveySaleSubmitPopup(false)
|
||||||
}
|
}
|
||||||
// })
|
|
||||||
// .catch((error) => {
|
|
||||||
// console.error('Error sending email:', error)
|
|
||||||
// alert('メール送信に失敗しました。')
|
|
||||||
// })
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useSurvey } from '@/hooks/useSurvey'
|
import { useSurvey } from '@/hooks/useSurvey'
|
||||||
import { useParams, useRouter } from 'next/navigation'
|
import { useParams } from 'next/navigation'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import DetailForm from './DetailForm'
|
import DetailForm from './DetailForm'
|
||||||
|
|
||||||
export default function DataTable() {
|
export default function DataTable() {
|
||||||
const params = useParams()
|
const params = useParams()
|
||||||
const id = params.id
|
const id = params.id
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (Number.isNaN(Number(id))) {
|
if (Number.isNaN(Number(id))) {
|
||||||
@ -68,7 +67,7 @@ export default function DataTable() {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>ダウンロード</th>
|
<th>ダウンロード</th>
|
||||||
<td>
|
<td>
|
||||||
<button className="data-down" onClick={() => router.push(`/pdf/survey-sale/${id}`)}>
|
<button className="data-down" onClick={() => window.open(`/pdf/survey-sale/${id}`, '_blank')}>
|
||||||
HWJ現地調査票確認<i className="down-icon"></i>
|
HWJ現地調査票確認<i className="down-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -1,14 +1,7 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import type { Mode, SurveyDetailInfo, SurveyDetailRequest } from '@/types/Survey'
|
import type { Mode, SurveyDetailInfo, SurveyDetailRequest } from '@/types/Survey'
|
||||||
|
|
||||||
type RadioEtcKeys =
|
type RadioEtcKeys = 'houseStructure' | 'rafterMaterial' | 'waterproofMaterial' | 'insulationPresence' | 'rafterDirection' | 'leakTrace'
|
||||||
| 'structureOrder'
|
|
||||||
| 'houseStructure'
|
|
||||||
| 'rafterMaterial'
|
|
||||||
| 'waterproofMaterial'
|
|
||||||
| 'insulationPresence'
|
|
||||||
| 'rafterDirection'
|
|
||||||
| 'leakTrace'
|
|
||||||
type SelectBoxKeys =
|
type SelectBoxKeys =
|
||||||
| 'installationSystem'
|
| 'installationSystem'
|
||||||
| 'constructionYear'
|
| 'constructionYear'
|
||||||
@ -16,6 +9,7 @@ type SelectBoxKeys =
|
|||||||
| 'rafterPitch'
|
| 'rafterPitch'
|
||||||
| 'rafterSize'
|
| 'rafterSize'
|
||||||
| 'openFieldPlateKind'
|
| 'openFieldPlateKind'
|
||||||
|
| 'structureOrder'
|
||||||
| 'installationAvailability'
|
| 'installationAvailability'
|
||||||
|
|
||||||
export const supplementaryFacilities = [
|
export const supplementaryFacilities = [
|
||||||
@ -121,6 +115,24 @@ export const selectBoxOptions: Record<SelectBoxKeys, { id: number; name: string
|
|||||||
name: '小幅板', //소판
|
name: '小幅板', //소판
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
structureOrder: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: '屋根材', //지붕재
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: '防水材', //방수재
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: '屋根の基礎', //지붕의기초
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: '垂木', //서까래
|
||||||
|
},
|
||||||
|
],
|
||||||
installationAvailability: [
|
installationAvailability: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -134,12 +146,6 @@ export const selectBoxOptions: Record<SelectBoxKeys, { id: number; name: string
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const radioEtcData: Record<RadioEtcKeys, { id: number; label: string }[]> = {
|
export const radioEtcData: Record<RadioEtcKeys, { id: number; label: string }[]> = {
|
||||||
structureOrder: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
label: '屋根材 - 防水材 - 屋根の基礎 - 垂木', //지붕재 방수재 지붕의기초 서까래
|
|
||||||
},
|
|
||||||
],
|
|
||||||
houseStructure: [
|
houseStructure: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -432,7 +438,7 @@ export default function RoofForm(props: {
|
|||||||
<div className="data-input-form-bx">
|
<div className="data-input-form-bx">
|
||||||
{/* 지붕 구조의 순서 */}
|
{/* 지붕 구조의 순서 */}
|
||||||
<div className="data-input-form-tit red-f">屋根構造の順序</div>
|
<div className="data-input-form-tit red-f">屋根構造の順序</div>
|
||||||
<RadioSelected mode={mode} column="structureOrder" detailInfoData={roofInfo as SurveyDetailInfo} setRoofInfo={setRoofInfo} />
|
<SelectedBox mode={mode} column="structureOrder" detailInfoData={roofInfo as SurveyDetailInfo} setRoofInfo={setRoofInfo} />
|
||||||
</div>
|
</div>
|
||||||
<div className="data-input-form-bx">
|
<div className="data-input-form-bx">
|
||||||
{/* 지붕 제품명 설치 가능 여부 확인 */}
|
{/* 지붕 제품명 설치 가능 여부 확인 */}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import getConfigs from '@/config/config.common'
|
import getConfigs from '@/config/config.common'
|
||||||
|
|
||||||
// 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 local 환경에 맞는 값을 지정합니다.)
|
// 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 local 환경에 맞는 값을 지정합니다.)
|
||||||
const baseUrl = 'http://172.30.1.23:3000'
|
const baseUrl = 'http://localhost:3000'
|
||||||
const mode = 'local'
|
const mode = 'local'
|
||||||
|
|
||||||
// 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.
|
// 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
import nodemailer from 'nodemailer'
|
|
||||||
|
|
||||||
interface EmailParams {
|
|
||||||
to: string | string[]
|
|
||||||
cc?: string | string[]
|
|
||||||
subject: string
|
|
||||||
content: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function sendEmail({ to, cc, subject, content }: EmailParams): Promise<void> {
|
|
||||||
// Create a transporter using SMTP
|
|
||||||
const transporter = nodemailer.createTransport({
|
|
||||||
host: process.env.SMTP_HOST,
|
|
||||||
port: Number(process.env.SMTP_PORT),
|
|
||||||
secure: process.env.SMTP_SECURE === 'true',
|
|
||||||
auth: {
|
|
||||||
user: process.env.SMTP_USER,
|
|
||||||
pass: process.env.SMTP_PASSWORD,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// Email options
|
|
||||||
const mailOptions = {
|
|
||||||
from: process.env.SMTP_USER,
|
|
||||||
to: Array.isArray(to) ? to.join(', ') : to,
|
|
||||||
cc: cc ? (Array.isArray(cc) ? cc.join(', ') : cc) : undefined,
|
|
||||||
subject,
|
|
||||||
html: content,
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Send email
|
|
||||||
await transporter.sendMail(mailOptions)
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error sending email:', error)
|
|
||||||
throw new Error('Failed to send email')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function sendEmailTest() {
|
|
||||||
await sendEmail({
|
|
||||||
to: 'test@test.com',
|
|
||||||
cc: 'test2@test.com',
|
|
||||||
subject: 'Test Email',
|
|
||||||
content: '<h1>Hello</h1><p>This is a test email.</p>',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user