Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/inquiry

This commit is contained in:
Dayoung 2025-05-22 14:27:22 +09:00
commit 6991bcbf13
24 changed files with 595 additions and 266 deletions

View File

@ -1,3 +0,0 @@
<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 5L5 1L9 5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 207 B

View File

@ -19,34 +19,55 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
}
}
const getNewSrlNo = async (srlNo: string, storeId: string) => {
let newSrlNo = srlNo
console.log('srlNo:: ', srlNo)
if (srlNo.startsWith('一時保存')) {
//@ts-ignore
const lastSurvey = await prisma.SD_SURVEY_SALES_BASIC_INFO.findFirst({
where: {
SRL_NO: {
startsWith: storeId,
},
},
orderBy: {
ID: 'desc',
},
})
const lastNo = lastSurvey ? parseInt(lastSurvey.SRL_NO.slice(-3)) : 0
newSrlNo =
storeId +
new Date().getFullYear().toString().slice(-2) +
(new Date().getMonth() + 1).toString().padStart(2, '0') +
new Date().getDate().toString().padStart(2, '0') +
(lastNo + 1).toString().padStart(3, '0')
}
return newSrlNo
}
export async function PUT(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
try {
const { id } = await params
const body = await request.json()
const { DETAIL_INFO, ...basicInfo } = body
const { detailInfo, ...basicInfo } = body.survey
console.log('body:: ', body)
// PUT 요청 시 임시저장 여부 확인 후 임시저장 시 기존 SRL_NO 사용, 기본 저장 시 새로운 SRL_NO 생성
const newSrlNo = body.isTemporary ? body.survey.srlNo : await getNewSrlNo(body.survey.srlNo, body.storeId)
// @ts-ignore
const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
where: { ID: Number(id) },
data: {
...convertToSnakeCase(basicInfo),
SRL_NO: newSrlNo,
UPT_DT: new Date(),
DETAIL_INFO: DETAIL_INFO ? {
upsert: {
create: convertToSnakeCase(DETAIL_INFO),
update: convertToSnakeCase(DETAIL_INFO),
where: {
BASIC_INFO_ID: Number(id)
}
}
} : undefined
DETAIL_INFO: {
update: convertToSnakeCase(detailInfo),
},
},
include: {
DETAIL_INFO: true
}
DETAIL_INFO: true,
},
})
console.log('survey:: ', survey)
return NextResponse.json(survey)
} catch (error) {
console.error('Error updating survey:', error)
@ -92,49 +113,24 @@ export async function PATCH(request: NextRequest, { params }: { params: Promise<
const { id } = await params
const body = await request.json()
if (body.submit) {
// 제출 시 기존 SRL_NO 확인 후 '임시저장'으로 시작하면 새로운 SRL_NO 생성
const newSrlNo = await getNewSrlNo(body.srlNo, body.storeId)
if (body.targetId) {
// @ts-ignore
const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
where: { ID: Number(id) },
data: {
SUBMISSION_STATUS: true,
SUBMISSION_DATE: new Date(),
SUBMISSION_TARGET_ID: body.targetId,
UPT_DT: new Date(),
SRL_NO: newSrlNo,
},
})
console.log(survey)
return NextResponse.json({ message: 'Survey confirmed successfully' })
}
// } else {
// // @ts-ignore
// const hasDetails = await prisma.SD_SURVEY_SALES_DETAIL_INFO.findUnique({
// where: { BASIC_INFO_ID: Number(id) },
// })
// if (hasDetails) {
// //@ts-ignore
// const result = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
// where: { ID: Number(id) },
// data: {
// UPT_DT: new Date(),
// DETAIL_INFO: {
// update: convertToSnakeCase(body.DETAIL_INFO),
// },
// },
// })
// return NextResponse.json(result)
// } else {
// // @ts-ignore
// const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
// where: { ID: Number(id) },
// data: {
// DETAIL_INFO: {
// create: convertToSnakeCase(body.DETAIL_INFO),
// },
// },
// })
// return NextResponse.json({ message: 'Survey detail created successfully' })
// }
// }
} catch (error) {
console.error('Error updating survey:', error)
return NextResponse.json({ error: 'Failed to update survey' }, { status: 500 })

View File

@ -1,6 +1,7 @@
import { NextResponse } from 'next/server'
import { prisma } from '@/libs/prisma'
import { convertToSnakeCase } from '@/utils/common-utils'
import { equal } from 'assert'
/**
*
*/
@ -87,13 +88,14 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
switch (params.role) {
case 'Admin': // 1차점
// 같은 판매점에서 작성된 매물 + 2차점에서 제출받은 매물
where.OR = [
{
// 같은 판매점에서 작성한 제출/제출되지 않은 매물
AND: [{ STORE: { equals: params.store } }],
},
{
AND: [{ STORE: { startsWith: params.store } }, { SUBMISSION_STATUS: { equals: true } }],
// MUSUBI (시공권한 X) 가 ORDER 에 제출한 매물
AND: [{ SUBMISSION_TARGET_ID: { equals: params.store } }, { SUBMISSION_STATUS: { equals: true } }],
},
]
break
@ -101,6 +103,7 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
case 'Admin_Sub': // 2차점
where.OR = [
{
// MUSUBI (시공권한 X) 같은 판매점에서 작성한 제출/제출되지 않은 매물
AND: [
{ STORE: { equals: params.store } },
{
@ -109,8 +112,9 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
],
},
{
// MUSUBI (시공권한 O) 가 MUSUBI 에 제출한 매물 + PARTNER 가 제출한 매물
AND: [
{ STORE: { equals: params.store } },
{ SUBMISSION_TARGET_ID: { equals: params.store } },
{ CONSTRUCTION_POINT: { not: null } },
{ CONSTRUCTION_POINT: { not: '' } },
{ SUBMISSION_STATUS: { equals: true } },
@ -119,8 +123,8 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
]
break
case 'Builder': // 2차점 시공권한
case 'Partner': // Partner
case 'Builder': // MUSUBI (시공권한 O)
case 'Partner': // PARTNER
// 같은 시공ID에서 작성된 매물
where.AND?.push({
CONSTRUCTION_POINT: { equals: params.builderNo },
@ -128,6 +132,21 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
break
case 'T01':
where.OR = [
{
NOT: {
SRL_NO: {
startsWith: '一時保存',
},
},
},
{
STORE: {
equals: params.store,
},
},
]
break
case 'User':
// 모든 매물 조회 가능 (추가 조건 없음)
break
@ -222,19 +241,44 @@ export async function PUT(request: Request) {
export async function POST(request: Request) {
try {
const body = await request.json()
console.log('body:: ', body)
const { detailInfo, ...basicInfo } = body
// 임시 저장 시 임시저장 + 000 으로 저장
// 기본 저장 시 판매점ID + yyMMdd + 000 으로 저장
const baseSrlNo =
body.survey.srlNo ??
body.storeId +
new Date().getFullYear().toString().slice(-2) +
(new Date().getMonth() + 1).toString().padStart(2, '0') +
new Date().getDate().toString().padStart(2, '0')
// 기본 정보 생성
//@ts-ignore
// @ts-ignore
const lastSurvey = await prisma.SD_SURVEY_SALES_BASIC_INFO.findFirst({
where: {
SRL_NO: {
startsWith: body.storeId,
},
},
orderBy: {
SRL_NO: 'desc',
},
})
// 마지막 번호 추출
const lastNumber = lastSurvey ? parseInt(lastSurvey.SRL_NO.slice(-3)) : 0
// 새로운 srlNo 생성 - 임시저장일 경우 '임시저장' 으로 저장
const newSrlNo = baseSrlNo.startsWith('一時保存') ? baseSrlNo : baseSrlNo + (lastNumber + 1).toString().padStart(3, '0')
const { detailInfo, ...basicInfo } = body.survey
// @ts-ignore
const result = await prisma.SD_SURVEY_SALES_BASIC_INFO.create({
data: {
...convertToSnakeCase(basicInfo),
SRL_NO: newSrlNo,
DETAIL_INFO: {
create: convertToSnakeCase(detailInfo)
}
}
create: convertToSnakeCase(detailInfo),
},
},
})
return NextResponse.json(result)
} catch (error) {

View File

@ -25,7 +25,7 @@ export default function BasicForm(props: { basicInfo: SurveyBasicRequest; setBas
setBasicInfo({
...basicInfo,
representative: session.userNm ?? '',
store: session.storeNm ?? null,
store: session.role === 'Partner' ? null : session.storeNm ?? null,
constructionPoint: session.builderNo ?? null,
})
}

View File

@ -22,8 +22,15 @@ export default function ButtonForm(props: {
const params = useParams()
const routeId = params.id
const [isSubmitProcess, setIsSubmitProcess] = useState(false)
// ------------------------------------------------------------
const [saveData, setSaveData] = useState({
...props.data.basic,
detailInfo: props.data.roof,
})
// !!!!!!!!!!
const [tempTargetId, setTempTargetId] = useState('')
// --------------------------------------------------------------
// 권한
// 제출권한 ㅇ
@ -34,39 +41,63 @@ export default function ButtonForm(props: {
useEffect(() => {
if (session?.isLoggedIn) {
switch (session?.role) {
// T01 제출권한 없음
case 'T01':
setIsSubmiter(false)
break
// 1차 판매점(Order) + 2차 판매점(Musubi) => 같은 판매점 제출권한
case 'Admin':
case 'Admin_Sub':
setIsSubmiter(session.storeNm === props.data.basic.store && session.builderNo === props.data.basic.constructionPoint)
break
// 시공권한 User(Musubi) + Partner => 같은 시공ID 제출권한
case 'Builder':
case 'Partner':
setIsSubmiter(session.builderNo === props.data.basic.constructionPoint)
break
default:
setIsSubmiter(false)
break
}
setIsWriter(session.userNm === props.data.basic.representative)
}
setSaveData({
...props.data.basic,
detailInfo: props.data.roof,
})
}, [session, props.data])
// ------------------------------------------------------------
// 저장/임시저장/수정
const id = Number(routeId) ? Number(routeId) : Number(idParam)
const id = routeId ? Number(routeId) : Number(idParam)
const { deleteSurvey, submitSurvey, updateSurvey } = useServey(Number(id))
const { validateSurveyDetail, createSurvey } = useServey()
let saveData = {
...props.data.basic,
detailInfo: props.data.roof,
}
const handleSave = (isTemporary: boolean) => {
const handleSave = (isTemporary: boolean, isSubmitProcess = false) => {
const emptyField = validateSurveyDetail(props.data.roof)
console.log('handleSave, emptyField:: ', emptyField)
const hasEmptyField = emptyField?.trim() !== ''
if (isTemporary) {
tempSaveProcess()
hasEmptyField ? tempSaveProcess() : saveProcess(emptyField, false)
} else {
saveProcess(emptyField)
saveProcess(emptyField, isSubmitProcess)
}
}
const tempSaveProcess = async () => {
if (idParam) {
await updateSurvey(saveData)
router.push(`/survey-sale/detail?id=${idParam}&isTemporary=true`)
await updateSurvey({ survey: saveData, isTemporary: true })
router.push(`/survey-sale/${idParam}`)
} else {
const id = await createSurvey(saveData)
router.push(`/survey-sale/detail?id=${id}&isTemporary=true`)
const updatedData = {
...saveData,
srlNo: '一時保存',
}
const id = await createSurvey(updatedData)
router.push(`/survey-sale/${id}`)
}
alert('一時保存されました。')
}
@ -78,30 +109,40 @@ export default function ButtonForm(props: {
}
}
const saveProcess = async (emptyField: string) => {
if (emptyField.trim() === '') {
const saveProcess = async (emptyField: string | null, isSubmitProcess?: boolean) => {
if (emptyField?.trim() === '') {
if (idParam) {
// 수정 페이지에서 작성 후 제출
if (isSubmitProcess) {
saveData = {
const updatedData = {
...saveData,
submissionStatus: true,
submissionDate: new Date().toISOString(),
submissionTargetId: tempTargetId,
}
}
await updateSurvey(saveData)
await updateSurvey({ survey: updatedData, isTemporary: false, storeId: session.storeId ?? '' })
router.push(`/survey-sale/${idParam}`)
} else {
const id = await createSurvey(saveData)
if (isSubmitProcess) {
submitProcess(id)
return
await updateSurvey({ survey: saveData, isTemporary: false, storeId: session.storeId ?? '' })
router.push(`/survey-sale/${idParam}`)
}
} else {
if (isSubmitProcess) {
const updatedData = {
...saveData,
submissionStatus: true,
submissionDate: new Date().toISOString(),
submissionTargetId: tempTargetId,
}
const id = await createSurvey(updatedData)
submitProcess(id)
} else {
const id = await createSurvey(saveData)
router.push(`/survey-sale/${id}`)
}
}
alert('保存されました。')
} else {
if (emptyField.includes('Unit')) {
if (emptyField?.includes('Unit')) {
alert('電気契約容量の単位を入力してください。')
focusInput(emptyField as keyof SurveyDetailInfo)
} else {
@ -123,17 +164,25 @@ export default function ButtonForm(props: {
}
const handleSubmit = async () => {
if (props.data.basic.srlNo?.startsWith('一時保存')) {
alert('一時保存されたデータは提出できません。')
return
}
if (tempTargetId.trim() === '') {
alert('提出対象店舗を入力してください。')
return
}
window.neoConfirm('提出しますか?', async () => {
setIsSubmitProcess(true)
if (routeId) {
if (Number(routeId)) {
submitProcess()
} else {
handleSave(false)
handleSave(false, true)
}
})
}
const submitProcess = async (saveId?: number) => {
await submitSurvey(saveId)
await submitSurvey({ saveId: saveId, targetId: tempTargetId, storeId: session.storeId ?? '', srlNo: '一時保存' })
alert('提出されました。')
router.push('/survey-sale')
}
@ -159,7 +208,7 @@ export default function ButtonForm(props: {
<ListButton />
<EditButton setMode={setMode} id={id.toString()} mode={mode} />
{(isWriter || !isSubmiter) && <DeleteButton handleDelete={handleDelete} />}
{!isSubmit && isSubmiter && <SubmitButton handleSubmit={handleSubmit} />}
{!isSubmit && isSubmiter && <SubmitButton handleSubmit={handleSubmit} setTempTargetId={setTempTargetId} />}
</div>
</div>
)}
@ -170,7 +219,7 @@ export default function ButtonForm(props: {
<ListButton />
<TempButton setMode={setMode} handleSave={handleSave} />
<SaveButton handleSave={handleSave} />
<SubmitButton handleSubmit={handleSubmit} />
{session?.role !== 'T01' && <SubmitButton handleSubmit={handleSubmit} setTempTargetId={setTempTargetId} />}{' '}
</div>
</div>
)}
@ -210,15 +259,20 @@ function EditButton(props: { setMode: (mode: Mode) => void; id: string; mode: Mo
)
}
function SubmitButton(props: { handleSubmit: () => void }) {
const { handleSubmit } = props
function SubmitButton(props: { handleSubmit: () => void; setTempTargetId: (targetId: string) => void }) {
const { handleSubmit, setTempTargetId } = props
return (
<>
<div className="btn-bx">
{/* 제출 */}
<button className="btn-frame red icon" onClick={handleSubmit}>
<i className="btn-arr"></i>
</button>
</div>
<div>
<input type="text" placeholder="temp target id" onChange={(e) => setTempTargetId(e.target.value)} />
</div>
</>
)
}
@ -256,7 +310,6 @@ function TempButton(props: { setMode: (mode: Mode) => void; handleSave: (isTempo
<button
className="btn-frame n-blue icon"
onClick={() => {
setMode('TEMP')
handleSave(true)
}}
>

View File

@ -1,31 +1,22 @@
'use client'
import { useServey } from '@/hooks/useSurvey'
import { useParams, useSearchParams } from 'next/navigation'
import { useEffect, useState } from 'react'
import { useParams } from 'next/navigation'
import { useEffect } from 'react'
import DetailForm from './DetailForm'
import type { SurveyBasicInfo } from '@/types/Survey'
export default function DataTable() {
const params = useParams()
const id = params.id
const searchParams = useSearchParams()
const isTemp = searchParams.get('isTemporary')
useEffect(() => {
if (Number.isNaN(Number(id))) {
alert('間違ったアプローチです。')
window.location.href = '/survey-sale'
}
}, [id])
const { surveyDetail, isLoadingSurveyDetail } = useServey(Number(id))
const [isTemporary, setIsTemporary] = useState(isTemp === 'true')
const { validateSurveyDetail } = useServey(Number(id))
useEffect(() => {
if (surveyDetail?.detailInfo) {
const validate = validateSurveyDetail(surveyDetail.detailInfo)
if (validate.trim() !== '') {
setIsTemporary(false)
}
}
}, [surveyDetail])
if (isLoadingSurveyDetail) {
return <div>Loading...</div>
@ -42,12 +33,12 @@ export default function DataTable() {
<tbody>
<tr>
<th></th>
{isTemporary ? (
{surveyDetail?.srlNo?.startsWith('一時保存') ? (
<td>
<span className="text-red-500"></span>
</td>
) : (
<td>{surveyDetail?.id}</td>
<td>{surveyDetail?.srlNo}</td>
)}
</tr>
<tr>

View File

@ -5,7 +5,7 @@ import { useEffect, useState } from 'react'
import ButtonForm from './ButtonForm'
import BasicForm from './BasicForm'
import RoofForm from './RoofForm'
import { useParams, useSearchParams } from 'next/navigation'
import { useParams, useRouter, useSearchParams } from 'next/navigation'
import { useServey } from '@/hooks/useSurvey'
const roofInfoForm: SurveyDetailRequest = {
@ -58,34 +58,40 @@ const basicInfoForm: SurveyBasicRequest = {
addressDetail: null,
submissionStatus: false,
submissionDate: null,
submissionTargetId: null,
srlNo: null,
}
export default function DetailForm() {
const idParam = useSearchParams().get('id')
const routeId = useParams().id
const id = idParam ?? routeId
const modeset = Number(routeId) ? 'READ' : idParam ? 'EDIT' : 'CREATE'
const id = Number(routeId) ? Number(routeId) : Number(idParam)
const { surveyDetail } = useServey(Number(id))
const { surveyDetail, validateSurveyDetail } = useServey(Number(id))
const [mode, setMode] = useState<Mode>(idParam ? 'EDIT' : routeId ? 'READ' : 'CREATE')
const [mode, setMode] = useState<Mode>(modeset)
const [basicInfoData, setBasicInfoData] = useState<SurveyBasicRequest>(basicInfoForm)
const [roofInfoData, setRoofInfoData] = useState<SurveyDetailRequest>(roofInfoForm)
useEffect(() => {
if (Number(idParam) !== 0 && surveyDetail === null) {
alert('データが見つかりません。')
window.location.href = '/survey-sale'
}
if (surveyDetail && (mode === 'EDIT' || mode === 'READ')) {
const { id, uptDt, regDt, detailInfo, ...rest } = surveyDetail
setBasicInfoData(rest)
if (detailInfo) {
const { id, uptDt, regDt, basicInfoId, ...rest } = detailInfo
setRoofInfoData(rest)
if (validateSurveyDetail(rest).trim() !== '') {
}
}
}, [surveyDetail, mode])
// console.log('mode:: ', mode)
// console.log('surveyDetail:: ', surveyDetail)
// console.log('roofInfoData:: ', roofInfoData)
}
}, [surveyDetail, id])
const data = {
basic: basicInfoData,

View File

@ -230,6 +230,14 @@ export default function RoofForm(props: {
}
}
}
if (key === 'contractCapacity') {
const remainValue = roofInfo.contractCapacity?.split(' ')[1] ?? roofInfo.contractCapacity
if (Number.isNaN(Number(remainValue))) {
setRoofInfo({ ...roofInfo, [key]: value + ' ' + remainValue })
return
}
setRoofInfo({ ...roofInfo, [key]: value.toString() })
}
setRoofInfo({ ...roofInfo, [key]: value.toString() })
}
@ -237,7 +245,7 @@ export default function RoofForm(props: {
const numericValue = roofInfo.contractCapacity?.replace(/[^0-9.]/g, '') || ''
setRoofInfo({
...roofInfo,
contractCapacity: numericValue ? `${numericValue} ${value}` : value,
contractCapacity: numericValue ? `${numericValue} ${value}` : '0 ' + value,
})
}
@ -261,7 +269,7 @@ export default function RoofForm(props: {
{mode !== 'READ' && (
<div className="data-input mb5">
<input
type="text"
type="number"
id="contractCapacity"
className="input-frame"
value={roofInfo?.contractCapacity?.split(' ')[0] ?? ''}
@ -464,17 +472,17 @@ const SelectedBox = ({
}) => {
const selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
const etcValue = detailInfoData?.[`${column}Etc` as keyof SurveyDetailInfo]
const [isEtcSelected, setIsEtcSelected] = useState<boolean>(Boolean(etcValue))
const [isEtcSelected, setIsEtcSelected] = useState<boolean>(etcValue !== null && etcValue !== undefined && etcValue !== '')
const [etcVal, setEtcVal] = useState<string>(etcValue?.toString() ?? '')
const isSpecialCase = column === 'constructionYear' || column === 'installationAvailability'
const showEtcOption = !isSpecialCase
const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
const value = e.target.value
const isSpecialCase = column === 'constructionYear' || column === 'installationAvailability'
const isEtc = value === 'etc'
const isSpecialEtc = isSpecialCase && value === '2'
const updatedData: typeof detailInfoData = {
const updatedData = {
...detailInfoData,
[column]: isEtc ? null : value,
[`${column}Etc`]: isEtc ? '' : null,
@ -485,14 +493,20 @@ const SelectedBox = ({
}
setIsEtcSelected(isEtc || isSpecialEtc)
if (!isEtc) setEtcVal('')
setRoofInfo(updatedData)
}
const handleEtcInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value
setEtcVal(value)
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: value })
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: e.target.value })
}
const isInputDisabled = () => {
if (mode === 'READ') return true
if (column === 'installationAvailability') return false
if (column === 'constructionYear') {
return detailInfoData.constructionYear === '1' || detailInfoData.constructionYear === null
}
return !isEtcSelected && !etcValue
}
return (
@ -502,7 +516,7 @@ const SelectedBox = ({
name={column}
id={column}
disabled={mode === 'READ'}
value={selectedId ? Number(selectedId) : etcValue !== null ? 'etc' : ''}
value={selectedId ? Number(selectedId) : etcValue ? 'etc' : ''}
onChange={handleSelectChange}
>
{selectBoxOptions[column as keyof typeof selectBoxOptions].map((item) => (
@ -510,7 +524,7 @@ const SelectedBox = ({
{item.name}
</option>
))}
{column !== 'installationAvailability' && column !== 'constructionYear' && (
{showEtcOption && (
<option key="etc" value="etc">
()
</option>
@ -519,23 +533,16 @@ const SelectedBox = ({
</option>
</select>
<div className="data-input">
<div className={`data-input ${column === 'constructionYear' ? 'flex' : ''}`}>
<input
type="text"
type={column === 'constructionYear' ? 'number' : 'text'}
className="input-frame"
placeholder="-"
value={etcVal}
value={detailInfoData[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? ''}
onChange={handleEtcInputChange}
disabled={
mode === 'READ'
? true
: column === 'installationAvailability'
? false
: column === 'constructionYear'
? detailInfoData.constructionYear === '1' || detailInfoData.constructionYear === null
: !isEtcSelected
}
disabled={isInputDisabled()}
/>
{column === 'constructionYear' && <span></span>}
</div>
</>
)
@ -552,49 +559,51 @@ const RadioSelected = ({
detailInfoData: SurveyDetailInfo
setRoofInfo: (roofInfo: SurveyDetailRequest) => void
}) => {
let selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
if (column === 'leakTrace') {
selectedId = Number(selectedId)
if (!selectedId) selectedId = 2
}
const etcValue = detailInfoData?.[`${column}Etc` as keyof SurveyDetailInfo]
const [etcChecked, setEtcChecked] = useState<boolean>(Boolean(etcValue))
let etcValue = null
if (column !== 'rafterDirection') {
etcValue = detailInfoData?.[`${column}Etc` as keyof SurveyDetailInfo]
}
const [etcChecked, setEtcChecked] = useState<boolean>(etcValue !== null && etcValue !== undefined && etcValue !== '')
const [etcVal, setEtcVal] = useState<string>(etcValue?.toString() ?? '')
const selectedId =
column === 'leakTrace' ? Number(detailInfoData?.[column as keyof SurveyDetailInfo]) || 2 : detailInfoData?.[column as keyof SurveyDetailInfo]
const isSpecialColumn = column === 'rafterDirection' || column === 'leakTrace' || column === 'insulationPresence'
const showEtcOption = !isSpecialColumn
const handleRadioChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value
if (column === 'leakTrace') {
handleBooleanRadioChange(value)
setRoofInfo({ ...detailInfoData, leakTrace: value === '1' })
return
}
if (value === 'etc') {
setEtcChecked(true)
setRoofInfo({ ...detailInfoData, [column]: null, [`${column}Etc`]: '' })
} else {
if (column === 'insulationPresence' && value === '2') {
setEtcChecked(true)
} else {
setEtcChecked(false)
}
setRoofInfo({ ...detailInfoData, [column]: value, [`${column}Etc`]: null })
}
return
}
const handleBooleanRadioChange = (value: string) => {
if (value === '1') {
setRoofInfo({ ...detailInfoData, leakTrace: true })
} else {
setRoofInfo({ ...detailInfoData, leakTrace: false })
}
const isInsulationPresence = column === 'insulationPresence'
const isRafterDirection = column === 'rafterDirection'
setEtcChecked(isInsulationPresence && value === '2')
setRoofInfo({
...detailInfoData,
[column]: value,
[`${column}Etc`]: isRafterDirection ? detailInfoData[`${column}Etc` as keyof SurveyDetailInfo] : null,
})
}
const handleEtcInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value
setEtcVal(value)
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: value })
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: e.target.value })
}
const isInputDisabled = () => {
if (mode === 'READ') return true
if (column === 'insulationPresence') {
return detailInfoData.insulationPresence !== '2'
}
return !etcChecked && !etcValue
}
return (
@ -613,7 +622,7 @@ const RadioSelected = ({
<label htmlFor={`${column}_${item.id}`}>{item.label}</label>
</div>
))}
{column !== 'rafterDirection' && column !== 'leakTrace' && column !== 'insulationPresence' && (
{showEtcOption && (
<div className="radio-form-box mb10">
<input
type="radio"
@ -621,21 +630,21 @@ const RadioSelected = ({
id={`${column}Etc`}
value="etc"
disabled={mode === 'READ'}
checked={etcChecked}
checked={etcChecked || Boolean(etcValue)}
onChange={handleRadioChange}
/>
<label htmlFor={`${column}Etc`}> ()</label>
</div>
)}
{column !== 'leakTrace' && column !== 'rafterDirection' && (
{(showEtcOption || column === 'insulationPresence') && (
<div className="data-input">
<input
type="text"
className="input-frame"
placeholder="-"
value={etcVal}
value={detailInfoData[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? ''}
onChange={handleEtcInputChange}
disabled={mode === 'READ' || !etcChecked}
disabled={isInputDisabled()}
/>
</div>
)}
@ -655,51 +664,56 @@ const MultiCheck = ({
setRoofInfo: (roofInfo: SurveyDetailRequest) => void
}) => {
const multiCheckData = column === 'supplementaryFacilities' ? supplementaryFacilities : roofMaterial
const etcValue = roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo]
const [isOtherCheck, setIsOtherCheck] = useState<boolean>(Boolean(etcValue))
const [isOtherCheck, setIsOtherCheck] = useState<boolean>(false)
const [otherValue, setOtherValue] = useState<string>(roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? '')
const isRoofMaterial = column === 'roofMaterial'
const selectedValues = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? ''))
const handleCheckbox = (id: number) => {
const value = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? ''))
const isOtherSelected = roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo] !== null
const isOtherSelected = Boolean(etcValue)
let newValue: string[]
if (value.includes(String(id))) {
newValue = value.filter((v) => v !== String(id))
} else {
if (column === 'roofMaterial') {
const totalSelected = value.length + (isOtherSelected ? 1 : 0)
if (selectedValues.includes(String(id))) {
newValue = selectedValues.filter((v) => v !== String(id))
} else {
if (isRoofMaterial) {
const totalSelected = selectedValues.length + (isOtherSelected ? 1 : 0)
if (totalSelected >= 2) {
alert('屋根材は最大2個まで選択できます。')
return
}
}
newValue = [...value, String(id)]
newValue = [...selectedValues, String(id)]
}
setRoofInfo({ ...roofInfo, [column]: newValue.join(',') })
}
const handleOtherCheckbox = () => {
if (column === 'roofMaterial') {
const value = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? ''))
const currentSelected = value.length
if (isRoofMaterial) {
const currentSelected = selectedValues.length
if (!isOtherCheck && currentSelected >= 2) {
alert('屋根材は最大2個まで選択できます。')
return
}
}
const newIsOtherCheck = !isOtherCheck
setIsOtherCheck(newIsOtherCheck)
setOtherValue('')
setRoofInfo({ ...roofInfo, [`${column}Etc`]: newIsOtherCheck ? '' : null })
// 기타 선택 해제 시 값도 null로 설정
setRoofInfo({
...roofInfo,
[`${column}Etc`]: newIsOtherCheck ? '' : null,
})
}
const handleOtherInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value
setOtherValue(value)
setRoofInfo({ ...roofInfo, [`${column}Etc`]: value })
setRoofInfo({ ...roofInfo, [`${column}Etc`]: e.target.value })
}
const isInputDisabled = () => {
return mode === 'READ' || (!isOtherCheck && !etcValue)
}
return (
@ -710,7 +724,7 @@ const MultiCheck = ({
<input
type="checkbox"
id={`${column}_${item.id}`}
checked={makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? '')).includes(String(item.id))}
checked={selectedValues.includes(String(item.id))}
disabled={mode === 'READ'}
onChange={() => handleCheckbox(item.id)}
/>
@ -721,7 +735,7 @@ const MultiCheck = ({
<input
type="checkbox"
id={`${column}Etc`}
checked={roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo] !== null}
checked={isOtherCheck || Boolean(etcValue)}
disabled={mode === 'READ'}
onChange={handleOtherCheckbox}
/>
@ -733,9 +747,9 @@ const MultiCheck = ({
type="text"
className="input-frame"
placeholder="-"
value={otherValue}
value={roofInfo[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? ''}
onChange={handleOtherInputChange}
disabled={mode === 'READ' || !isOtherCheck}
disabled={isInputDisabled()}
/>
</div>
</>

View File

@ -2,8 +2,8 @@
import LoadMoreButton from '@/components/LoadMoreButton'
import { useServey } from '@/hooks/useSurvey'
import { useEffect, useState } from 'react'
import { useRouter } from 'next/navigation'
import { useEffect, useState, useMemo, useRef } from 'react'
import { useRouter, usePathname } from 'next/navigation'
import SearchForm from './SearchForm'
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
import { useSessionStore } from '@/store/session'
@ -11,13 +11,20 @@ import type { SurveyBasicInfo } from '@/types/Survey'
export default function ListTable() {
const router = useRouter()
const pathname = usePathname()
const { surveyList, isLoadingSurveyList } = useServey()
const { offset, setOffset } = useSurveyFilterStore()
const { session } = useSessionStore()
const [heldSurveyList, setHeldSurveyList] = useState<SurveyBasicInfo[]>([])
const [hasMore, setHasMore] = useState(false)
const { session } = useSessionStore()
useEffect(() => {
setOffset(0)
setHeldSurveyList([])
}, [pathname])
useEffect(() => {
if (!session.isLoggedIn || !('data' in surveyList)) return
@ -32,30 +39,25 @@ export default function ListTable() {
setHeldSurveyList([])
setHasMore(false)
}
}, [surveyList, offset, session])
}, [surveyList, offset, session.isLoggedIn])
const handleDetailClick = (id: number) => {
router.push(`/survey-sale/${id}`)
}
const handleItemsInit = () => {
setHeldSurveyList([])
setOffset(0)
}
// TODO: 로딩 처리 필요
return (
<>
<SearchForm memberRole={session?.role ?? ''} userId={session?.userId ?? ''} />
{heldSurveyList.length > 0 ? (
<SearchForm memberRole={session?.role ?? ''} userNm={session?.userNm ?? ''} />
<div className="sale-frame">
{heldSurveyList.length > 0 ? (
<ul className="sale-list-wrap">
{heldSurveyList.map((survey) => (
<li className="sale-list-item cursor-pointer" key={survey.id} onClick={() => handleDetailClick(survey.id)}>
<div className="sale-item-bx">
<div className="sale-item-date-bx">
<div className="sale-item-num">{survey.id}</div>
<div className="sale-item-num">{survey.srlNo}</div>
<div className="sale-item-date">{survey.investigationDate}</div>
</div>
<div className="sale-item-tit">{survey.buildingName}</div>
@ -68,15 +70,15 @@ export default function ListTable() {
</li>
))}
</ul>
) : (
<div className="compliace-nosearch">
<span className="mb10"></span>
</div>
)}
<div className="sale-edit-btn">
<LoadMoreButton hasMore={hasMore} onLoadMore={() => setOffset(offset + 10)} />
</div>
</div>
) : (
<div>
<p></p>
</div>
)}
</>
)
}

View File

@ -4,7 +4,7 @@ import { SEARCH_OPTIONS, SEARCH_OPTIONS_ENUM, SEARCH_OPTIONS_PARTNERS, useSurvey
import { useRouter } from 'next/navigation'
import { useState } from 'react'
export default function SearchForm({ memberRole, userId }: { memberRole: string; userId: string }) {
export default function SearchForm({ memberRole, userNm }: { memberRole: string; userNm: string }) {
const router = useRouter()
const { setSearchOption, setSort, setIsMySurvey, setKeyword, isMySurvey, keyword, searchOption, sort } = useSurveyFilterStore()
const [searchKeyword, setSearchKeyword] = useState(keyword)
@ -75,9 +75,9 @@ export default function SearchForm({ memberRole, userId }: { memberRole: string;
<input
type="checkbox"
id="ch01"
checked={isMySurvey === userId}
checked={isMySurvey === userNm}
onChange={() => {
setIsMySurvey(isMySurvey === userId ? null : userId)
setIsMySurvey(isMySurvey === userNm ? null : userNm)
}}
/>
<label htmlFor="ch01"></label>

View File

@ -34,7 +34,7 @@ export default function Main() {
<div className="main-bx-icon">
<img src="/assets/images/main/main_icon02.svg" alt="" />
</div>
<button className="main-bx-arr" onClick={() => router.push('/survey-sale/basic-info')}></button>
<button className="main-bx-arr" onClick={() => router.push('/survey-sale/regist')}></button>
</div>
<div className="grid-bx-body">
<div className="grid-bx-body-tit">調</div>

View File

@ -0,0 +1,7 @@
export default function Spinner() {
return (
<div className="spinner-wrap">
<span className="loader"></span>
</div>
)
}

93
src/hooks/useAxios.ts Normal file
View File

@ -0,0 +1,93 @@
import axios from 'axios'
import { useSpinnerStore } from '@/store/spinnerStore'
export const useAxios = () => {
const { setIsShow } = useSpinnerStore()
const axiosInstance = (url: string | null | undefined) => {
const baseURL = url || process.env.NEXT_PUBLIC_API_URL
const instance = axios.create({
baseURL,
headers: {
Accept: 'application/json',
},
})
instance.interceptors.request.use(
(config) => {
// console.log('🚀 ~ config:', config)
setIsShow(true)
return config
},
(error) => {
return Promise.reject(error)
},
)
instance.interceptors.response.use(
(response) => {
response.data = transferResponse(response)
setIsShow(false)
return response
},
(error) => {
// 에러 처리 로직
return Promise.reject(error)
},
)
return instance
}
// response데이터가 array, object에 따라 분기하여 키 변환
const transferResponse = (response: any) => {
if (!response.data) return response.data
// 배열인 경우 각 객체의 키를 변환
if (Array.isArray(response.data)) {
return response.data.map((item: any) => transformObjectKeys(item))
}
// 단일 객체인 경우
return transformObjectKeys(response.data)
}
// camel case object 반환
const transformObjectKeys = (obj: any): any => {
if (Array.isArray(obj)) {
return obj.map(transformObjectKeys)
}
if (obj !== null && typeof obj === 'object') {
return Object.keys(obj).reduce((acc: any, key: string) => {
let transformedKey = key
// Handle uppercase snake_case (e.g., USER_NAME -> userName)
// Handle lowercase snake_case (e.g., user_name -> userName)
if (/^[A-Z_]+$/.test(key) || /^[a-z_]+$/.test(key)) {
transformedKey = snakeToCamel(key)
}
// Handle single uppercase word (e.g., ROLE -> role)
else if (/^[A-Z]+$/.test(key)) {
transformedKey = key.toLowerCase()
}
// Preserve existing camelCase
acc[transformedKey] = transformObjectKeys(obj[key])
return acc
}, {})
}
return obj
}
const snakeToCamel = (str: string): string => {
return str.toLowerCase().replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace('-', '').replace('_', ''))
}
return {
axiosInstance,
transferResponse,
transformObjectKeys,
}
}

View File

@ -1,11 +1,10 @@
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import type { SurveyBasicInfo, SurveyDetailInfo, SurveyDetailRequest, SurveyDetailCoverRequest, SurveyRegistRequest } from '@/types/Survey'
import { axiosInstance } from '@/libs/axios'
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
import { queryStringFormatter } from '@/utils/common-utils'
import { useSessionStore } from '@/store/session'
import { useMemo } from 'react'
import { AxiosResponse } from 'axios'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
import { useSessionStore } from '@/store/session'
import { useAxios } from './useAxios'
import { queryStringFormatter } from '@/utils/common-utils'
export const requiredFields = [
{
@ -65,9 +64,9 @@ export function useServey(id?: number): {
isDeletingSurvey: boolean
createSurvey: (survey: SurveyRegistRequest) => Promise<number>
createSurveyDetail: (params: { surveyId: number; surveyDetail: SurveyDetailCoverRequest }) => void
updateSurvey: (survey: SurveyRegistRequest) => void
updateSurvey: ({ survey, isTemporary, storeId }: { survey: SurveyRegistRequest; isTemporary: boolean; storeId?: string }) => void
deleteSurvey: () => Promise<boolean>
submitSurvey: (saveId?: number) => void
submitSurvey: (params: { saveId?: number; targetId?: string; storeId?: string; srlNo?: string }) => void
validateSurveyDetail: (surveyDetail: SurveyDetailRequest) => string
getZipCode: (zipCode: string) => Promise<ZipCode[] | null>
refetchSurveyList: () => void
@ -75,6 +74,7 @@ export function useServey(id?: number): {
const queryClient = useQueryClient()
const { keyword, searchOption, isMySurvey, sort, offset } = useSurveyFilterStore()
const { session } = useSessionStore()
const { axiosInstance } = useAxios()
const {
data: surveyListData,
@ -119,7 +119,7 @@ export function useServey(id?: number): {
const { mutateAsync: createSurvey, isPending: isCreatingSurvey } = useMutation({
mutationFn: async (survey: SurveyRegistRequest) => {
const resp = await axiosInstance(null).post<SurveyBasicInfo>('/api/survey-sales', survey)
const resp = await axiosInstance(null).post<SurveyBasicInfo>('/api/survey-sales', { survey: survey, storeId: session?.storeId ?? null })
return resp.data.id ?? 0
},
onSuccess: (data) => {
@ -130,10 +130,14 @@ export function useServey(id?: number): {
})
const { mutate: updateSurvey, isPending: isUpdatingSurvey } = useMutation({
mutationFn: async (survey: SurveyRegistRequest) => {
mutationFn: async ({ survey, isTemporary, storeId }: { survey: SurveyRegistRequest; isTemporary: boolean; storeId?: string }) => {
console.log('updateSurvey, survey:: ', survey)
if (id === undefined) throw new Error('id is required')
const resp = await axiosInstance(null).put<SurveyRegistRequest>(`/api/survey-sales/${id}`, survey)
const resp = await axiosInstance(null).put<SurveyRegistRequest>(`/api/survey-sales/${id}`, {
survey: survey,
isTemporary: isTemporary,
storeId: storeId,
})
return resp.data
},
onSuccess: () => {
@ -166,11 +170,13 @@ export function useServey(id?: number): {
})
const { mutateAsync: submitSurvey } = useMutation({
mutationFn: async (saveId?: number) => {
mutationFn: async ({ saveId, targetId, storeId, srlNo }: { saveId?: number; targetId?: string; storeId?: string; srlNo?: string }) => {
const submitId = saveId ?? id
if (!submitId) throw new Error('id is required')
const resp = await axiosInstance(null).patch<boolean>(`/api/survey-sales/${submitId}`, {
submit: true,
targetId,
storeId,
srlNo,
})
return resp.data
},

View File

@ -1,3 +1,4 @@
import { useSpinnerStore } from '@/store/spinnerStore'
import axios from 'axios'
export const axiosInstance = (url: string | null | undefined) => {

View File

@ -8,6 +8,8 @@ import { usePopupController } from '@/store/popupController'
import { useSideNavState } from '@/store/sideNavState'
import { useSessionStore } from '@/store/session'
import { tracking } from '@/libs/tracking'
import Spinner from '@/components/ui/common/Spinner'
import { useSpinnerStore } from '@/store/spinnerStore'
declare global {
interface Window {
@ -28,6 +30,7 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
const { reset } = useSideNavState()
const { setAlertMsg, setAlertBtn, setAlert, setAlert2, setAlert2BtnYes, setAlert2BtnNo } = usePopupController()
const { session, setSession } = useSessionStore()
const { isShow, setIsShow } = useSpinnerStore()
/**
*
@ -110,5 +113,10 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
handlePageEvent(pathname)
}, [pathname])
return <>{children}</>
return (
<>
{children}
{isShow && <Spinner />}
</>
)
}

21
src/store/spinnerStore.ts Normal file
View File

@ -0,0 +1,21 @@
import { create } from 'zustand'
type SpinnerState = {
isShow: boolean
setIsShow: (isShow: boolean) => void
resetCount: () => void
}
type InitialState = {
isShow: boolean
}
const initialState: InitialState = {
isShow: false,
}
export const useSpinnerStore = create<SpinnerState>((set) => ({
...initialState,
setIsShow: (isShow: boolean) => set({ isShow }),
resetCount: () => set(initialState),
}))

View File

@ -49,14 +49,6 @@
background-size: cover;
margin-left: 12px;
}
.btn-arr-up{
display: block;
width: 10px;
height: 6px;
background: url(/assets/images/common/btn_arr_up.svg)no-repeat center;
background-size: cover;
margin-left: 12px;
}
.btn-edit{
display: block;
width: 10px;

View File

@ -201,7 +201,7 @@
}
}
input:checked + .slider {
background-color: #A8B6C7;
background-color: #0081b5;
&:after {
content: '';
left: 10px;

View File

@ -2,3 +2,5 @@
@forward 'login';
@forward 'pop-contents';
@forward 'sub';
@forward 'pdfview';
@forward 'spinner';

View File

@ -0,0 +1,57 @@
@use "../abstracts" as *;
.pdf-contents{
padding: 0 20px;
border-top: 1px solid #ececec;
}
.pdf-cont-head{
align-items: center;
padding: 24px 0 15px;
border-bottom: 2px solid $black-1010;
.pdf-cont-head-tit{
@include defaultFont($font-s-16, $font-w-600, $black-1010);
margin-bottom: 10px;
}
}
.pdf-cont-head-data-wrap{
@include flex(20px);
align-items: center;
.pdf-cont-head-data-tit{
@include defaultFont($font-s-13, $font-w-500, $black-1010);
}
.pdf-cont-head-data{
@include defaultFont($font-s-13, $font-w-400, #FF5656);
}
}
.pdf-cont-body{
padding: 24px 0 0;
}
.pdf-data-tit{
@include defaultFont($font-s-13, $font-w-500, $black-1010);
margin-bottom: 5px;
}
.pdf-table{
margin-bottom: 24px;
table{
width: 100%;
table-layout: fixed;
border-collapse: collapse;
th{
padding: 9.5px;
@include defaultFont($font-s-11, $font-w-500, $black-1010);
border: 1px solid #2E3A59;
background-color: #F5F6FA;
}
td{
padding: 9.5px;
@include defaultFont($font-s-11, $font-w-400, #FF5656);
border: 1px solid #2E3A59;
}
}
}
.pdf-textarea-data{
padding: 10px;
@include defaultFont($font-s-11, $font-w-400, #FF5656);
border: 1px solid $black-1010;
min-height: 150px;
}

View File

@ -103,16 +103,12 @@
@include defaultFont($font-s-13, $font-w-400, $font-c);
}
.pop-data-table-footer{
@include flex(0px);
.pop-data-table-footer-unit{
flex: 1;
padding: 10px;
@include defaultFont($font-s-13, $font-w-500, $font-c);
border-right: 1px solid #2E3A59;
border-bottom: 1px solid #2E3A59;
}
.pop-data-table-footer-data{
flex: none;
width: 104px;
padding: 10px;
@include defaultFont($font-s-13, $font-w-400, $font-c);
}

View File

@ -0,0 +1,37 @@
.spinner-wrap{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba($color: #101010, $alpha: 0.5);
z-index: 2000000;
}
.loader {
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #fff;
box-shadow: 32px 0 #fff, -32px 0 #fff;
position: relative;
animation: flash 0.5s ease-out infinite alternate;
}
@keyframes flash {
0% {
background-color: #FFF2;
box-shadow: 32px 0 #FFF2, -32px 0 #FFF;
}
50% {
background-color: #FFF;
box-shadow: 32px 0 #FFF2, -32px 0 #FFF2;
}
100% {
background-color: #FFF2;
box-shadow: 32px 0 #FFF, -32px 0 #FFF2;
}
}

View File

@ -14,6 +14,8 @@ export type SurveyBasicInfo = {
detailInfo: SurveyDetailInfo | null
regDt: Date
uptDt: Date
submissionTargetId: string | null
srlNo: string | null //판매점IDyyMMdd000
}
export type SurveyDetailInfo = {
@ -70,6 +72,8 @@ export type SurveyBasicRequest = {
addressDetail: string | null
submissionStatus: boolean
submissionDate: string | null
submissionTargetId: string | null
srlNo: string | null //판매점IDyyMMdd000
}
export type SurveyDetailRequest = {
@ -127,6 +131,8 @@ export type SurveyRegistRequest = {
submissionStatus: boolean
submissionDate: string | null
detailInfo: SurveyDetailRequest | null
submissionTargetId: string | null
srlNo: string | null //판매점IDyyMMdd000
}
export type Mode = 'CREATE' | 'EDIT' | 'READ' | 'TEMP' // 등록 | 수정 | 상세 | 임시저장