Merge pull request 'feature/survey - 조사매물 목록 조회 필터링 조건 변경 및 임시저장 구현' (#42) from feature/survey into dev
Reviewed-on: #42
This commit is contained in:
commit
956e4ed910
@ -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 }> }) {
|
export async function PUT(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
|
||||||
try {
|
try {
|
||||||
const { id } = await params
|
const { id } = await params
|
||||||
const body = await request.json()
|
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
|
// @ts-ignore
|
||||||
const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
|
const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
|
||||||
where: { ID: Number(id) },
|
where: { ID: Number(id) },
|
||||||
data: {
|
data: {
|
||||||
...convertToSnakeCase(basicInfo),
|
...convertToSnakeCase(basicInfo),
|
||||||
|
SRL_NO: newSrlNo,
|
||||||
UPT_DT: new Date(),
|
UPT_DT: new Date(),
|
||||||
DETAIL_INFO: DETAIL_INFO ? {
|
DETAIL_INFO: {
|
||||||
upsert: {
|
update: convertToSnakeCase(detailInfo),
|
||||||
create: convertToSnakeCase(DETAIL_INFO),
|
},
|
||||||
update: convertToSnakeCase(DETAIL_INFO),
|
|
||||||
where: {
|
|
||||||
BASIC_INFO_ID: Number(id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} : undefined
|
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
DETAIL_INFO: true
|
DETAIL_INFO: true,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
console.log('survey:: ', survey)
|
|
||||||
return NextResponse.json(survey)
|
return NextResponse.json(survey)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error updating survey:', 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 { id } = await params
|
||||||
const body = await request.json()
|
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
|
// @ts-ignore
|
||||||
const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
|
const survey = await prisma.SD_SURVEY_SALES_BASIC_INFO.update({
|
||||||
where: { ID: Number(id) },
|
where: { ID: Number(id) },
|
||||||
data: {
|
data: {
|
||||||
SUBMISSION_STATUS: true,
|
SUBMISSION_STATUS: true,
|
||||||
SUBMISSION_DATE: new Date(),
|
SUBMISSION_DATE: new Date(),
|
||||||
|
SUBMISSION_TARGET_ID: body.targetId,
|
||||||
UPT_DT: new Date(),
|
UPT_DT: new Date(),
|
||||||
|
SRL_NO: newSrlNo,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
console.log(survey)
|
||||||
return NextResponse.json({ message: 'Survey confirmed successfully' })
|
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) {
|
} catch (error) {
|
||||||
console.error('Error updating survey:', error)
|
console.error('Error updating survey:', error)
|
||||||
return NextResponse.json({ error: 'Failed to update survey' }, { status: 500 })
|
return NextResponse.json({ error: 'Failed to update survey' }, { status: 500 })
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { NextResponse } from 'next/server'
|
import { NextResponse } from 'next/server'
|
||||||
import { prisma } from '@/libs/prisma'
|
import { prisma } from '@/libs/prisma'
|
||||||
import { convertToSnakeCase } from '@/utils/common-utils'
|
import { convertToSnakeCase } from '@/utils/common-utils'
|
||||||
|
import { equal } from 'assert'
|
||||||
/**
|
/**
|
||||||
* 검색 파라미터
|
* 검색 파라미터
|
||||||
*/
|
*/
|
||||||
@ -87,13 +88,14 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
|
|||||||
|
|
||||||
switch (params.role) {
|
switch (params.role) {
|
||||||
case 'Admin': // 1차점
|
case 'Admin': // 1차점
|
||||||
// 같은 판매점에서 작성된 매물 + 2차점에서 제출받은 매물
|
|
||||||
where.OR = [
|
where.OR = [
|
||||||
{
|
{
|
||||||
|
// 같은 판매점에서 작성한 제출/제출되지 않은 매물
|
||||||
AND: [{ STORE: { equals: params.store } }],
|
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
|
break
|
||||||
@ -101,6 +103,7 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
|
|||||||
case 'Admin_Sub': // 2차점
|
case 'Admin_Sub': // 2차점
|
||||||
where.OR = [
|
where.OR = [
|
||||||
{
|
{
|
||||||
|
// MUSUBI (시공권한 X) 같은 판매점에서 작성한 제출/제출되지 않은 매물
|
||||||
AND: [
|
AND: [
|
||||||
{ STORE: { equals: params.store } },
|
{ STORE: { equals: params.store } },
|
||||||
{
|
{
|
||||||
@ -109,8 +112,9 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// MUSUBI (시공권한 O) 가 MUSUBI 에 제출한 매물 + PARTNER 가 제출한 매물
|
||||||
AND: [
|
AND: [
|
||||||
{ STORE: { equals: params.store } },
|
{ SUBMISSION_TARGET_ID: { equals: params.store } },
|
||||||
{ CONSTRUCTION_POINT: { not: null } },
|
{ CONSTRUCTION_POINT: { not: null } },
|
||||||
{ CONSTRUCTION_POINT: { not: '' } },
|
{ CONSTRUCTION_POINT: { not: '' } },
|
||||||
{ SUBMISSION_STATUS: { equals: true } },
|
{ SUBMISSION_STATUS: { equals: true } },
|
||||||
@ -119,8 +123,8 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
|
|||||||
]
|
]
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'Builder': // 2차점 시공권한
|
case 'Builder': // MUSUBI (시공권한 O)
|
||||||
case 'Partner': // Partner
|
case 'Partner': // PARTNER
|
||||||
// 같은 시공ID에서 작성된 매물
|
// 같은 시공ID에서 작성된 매물
|
||||||
where.AND?.push({
|
where.AND?.push({
|
||||||
CONSTRUCTION_POINT: { equals: params.builderNo },
|
CONSTRUCTION_POINT: { equals: params.builderNo },
|
||||||
@ -128,6 +132,21 @@ const createMemberRoleCondition = (params: SearchParams): WhereCondition => {
|
|||||||
break
|
break
|
||||||
|
|
||||||
case 'T01':
|
case 'T01':
|
||||||
|
where.OR = [
|
||||||
|
{
|
||||||
|
NOT: {
|
||||||
|
SRL_NO: {
|
||||||
|
startsWith: '一時保存',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
STORE: {
|
||||||
|
equals: params.store,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
break
|
||||||
case 'User':
|
case 'User':
|
||||||
// 모든 매물 조회 가능 (추가 조건 없음)
|
// 모든 매물 조회 가능 (추가 조건 없음)
|
||||||
break
|
break
|
||||||
@ -219,22 +238,47 @@ export async function PUT(request: Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function POST(request: Request) {
|
export async function POST(request: Request) {
|
||||||
try {
|
try {
|
||||||
const body = await request.json()
|
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({
|
const result = await prisma.SD_SURVEY_SALES_BASIC_INFO.create({
|
||||||
data: {
|
data: {
|
||||||
...convertToSnakeCase(basicInfo),
|
...convertToSnakeCase(basicInfo),
|
||||||
|
SRL_NO: newSrlNo,
|
||||||
DETAIL_INFO: {
|
DETAIL_INFO: {
|
||||||
create: convertToSnakeCase(detailInfo)
|
create: convertToSnakeCase(detailInfo),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
return NextResponse.json(result)
|
return NextResponse.json(result)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export default function BasicForm(props: { basicInfo: SurveyBasicRequest; setBas
|
|||||||
setBasicInfo({
|
setBasicInfo({
|
||||||
...basicInfo,
|
...basicInfo,
|
||||||
representative: session.userNm ?? '',
|
representative: session.userNm ?? '',
|
||||||
store: session.storeNm ?? null,
|
store: session.role === 'Partner' ? null : session.storeNm ?? null,
|
||||||
constructionPoint: session.builderNo ?? null,
|
constructionPoint: session.builderNo ?? null,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,15 @@ export default function ButtonForm(props: {
|
|||||||
const params = useParams()
|
const params = useParams()
|
||||||
const routeId = params.id
|
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(() => {
|
useEffect(() => {
|
||||||
if (session?.isLoggedIn) {
|
if (session?.isLoggedIn) {
|
||||||
setIsSubmiter(session.storeNm === props.data.basic.store && session.builderNo === props.data.basic.constructionPoint)
|
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)
|
setIsWriter(session.userNm === props.data.basic.representative)
|
||||||
}
|
}
|
||||||
|
setSaveData({
|
||||||
|
...props.data.basic,
|
||||||
|
detailInfo: props.data.roof,
|
||||||
|
})
|
||||||
}, [session, props.data])
|
}, [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 { deleteSurvey, submitSurvey, updateSurvey } = useServey(Number(id))
|
||||||
const { validateSurveyDetail, createSurvey } = useServey()
|
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)
|
const emptyField = validateSurveyDetail(props.data.roof)
|
||||||
console.log('handleSave, emptyField:: ', emptyField)
|
const hasEmptyField = emptyField?.trim() !== ''
|
||||||
|
|
||||||
if (isTemporary) {
|
if (isTemporary) {
|
||||||
tempSaveProcess()
|
hasEmptyField ? tempSaveProcess() : saveProcess(emptyField, false)
|
||||||
} else {
|
} else {
|
||||||
saveProcess(emptyField)
|
saveProcess(emptyField, isSubmitProcess)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const tempSaveProcess = async () => {
|
const tempSaveProcess = async () => {
|
||||||
if (idParam) {
|
if (idParam) {
|
||||||
await updateSurvey(saveData)
|
await updateSurvey({ survey: saveData, isTemporary: true })
|
||||||
router.push(`/survey-sale/detail?id=${idParam}&isTemporary=true`)
|
router.push(`/survey-sale/${idParam}`)
|
||||||
} else {
|
} else {
|
||||||
const id = await createSurvey(saveData)
|
const updatedData = {
|
||||||
router.push(`/survey-sale/detail?id=${id}&isTemporary=true`)
|
...saveData,
|
||||||
|
srlNo: '一時保存',
|
||||||
|
}
|
||||||
|
const id = await createSurvey(updatedData)
|
||||||
|
router.push(`/survey-sale/${id}`)
|
||||||
}
|
}
|
||||||
alert('一時保存されました。')
|
alert('一時保存されました。')
|
||||||
}
|
}
|
||||||
@ -78,30 +109,40 @@ export default function ButtonForm(props: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveProcess = async (emptyField: string) => {
|
const saveProcess = async (emptyField: string | null, isSubmitProcess?: boolean) => {
|
||||||
if (emptyField.trim() === '') {
|
if (emptyField?.trim() === '') {
|
||||||
if (idParam) {
|
if (idParam) {
|
||||||
// 수정 페이지에서 작성 후 제출
|
|
||||||
if (isSubmitProcess) {
|
if (isSubmitProcess) {
|
||||||
saveData = {
|
const updatedData = {
|
||||||
...saveData,
|
...saveData,
|
||||||
submissionStatus: true,
|
submissionStatus: true,
|
||||||
submissionDate: new Date().toISOString(),
|
submissionDate: new Date().toISOString(),
|
||||||
|
submissionTargetId: tempTargetId,
|
||||||
}
|
}
|
||||||
|
await updateSurvey({ survey: updatedData, isTemporary: false, storeId: session.storeId ?? '' })
|
||||||
|
router.push(`/survey-sale/${idParam}`)
|
||||||
|
} else {
|
||||||
|
await updateSurvey({ survey: saveData, isTemporary: false, storeId: session.storeId ?? '' })
|
||||||
|
router.push(`/survey-sale/${idParam}`)
|
||||||
}
|
}
|
||||||
await updateSurvey(saveData)
|
|
||||||
router.push(`/survey-sale/${idParam}`)
|
|
||||||
} else {
|
} else {
|
||||||
const id = await createSurvey(saveData)
|
|
||||||
if (isSubmitProcess) {
|
if (isSubmitProcess) {
|
||||||
|
const updatedData = {
|
||||||
|
...saveData,
|
||||||
|
submissionStatus: true,
|
||||||
|
submissionDate: new Date().toISOString(),
|
||||||
|
submissionTargetId: tempTargetId,
|
||||||
|
}
|
||||||
|
const id = await createSurvey(updatedData)
|
||||||
submitProcess(id)
|
submitProcess(id)
|
||||||
return
|
} else {
|
||||||
|
const id = await createSurvey(saveData)
|
||||||
|
router.push(`/survey-sale/${id}`)
|
||||||
}
|
}
|
||||||
router.push(`/survey-sale/${id}`)
|
|
||||||
}
|
}
|
||||||
alert('保存されました。')
|
alert('保存されました。')
|
||||||
} else {
|
} else {
|
||||||
if (emptyField.includes('Unit')) {
|
if (emptyField?.includes('Unit')) {
|
||||||
alert('電気契約容量の単位を入力してください。')
|
alert('電気契約容量の単位を入力してください。')
|
||||||
focusInput(emptyField as keyof SurveyDetailInfo)
|
focusInput(emptyField as keyof SurveyDetailInfo)
|
||||||
} else {
|
} else {
|
||||||
@ -123,17 +164,25 @@ export default function ButtonForm(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
|
if (props.data.basic.srlNo?.startsWith('一時保存')) {
|
||||||
|
alert('一時保存されたデータは提出できません。')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (tempTargetId.trim() === '') {
|
||||||
|
alert('提出対象店舗を入力してください。')
|
||||||
|
return
|
||||||
|
}
|
||||||
window.neoConfirm('提出しますか?', async () => {
|
window.neoConfirm('提出しますか?', async () => {
|
||||||
setIsSubmitProcess(true)
|
if (Number(routeId)) {
|
||||||
if (routeId) {
|
|
||||||
submitProcess()
|
submitProcess()
|
||||||
} else {
|
} else {
|
||||||
handleSave(false)
|
handleSave(false, true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const submitProcess = async (saveId?: number) => {
|
const submitProcess = async (saveId?: number) => {
|
||||||
await submitSurvey(saveId)
|
await submitSurvey({ saveId: saveId, targetId: tempTargetId, storeId: session.storeId ?? '', srlNo: '一時保存' })
|
||||||
alert('提出されました。')
|
alert('提出されました。')
|
||||||
router.push('/survey-sale')
|
router.push('/survey-sale')
|
||||||
}
|
}
|
||||||
@ -159,7 +208,7 @@ export default function ButtonForm(props: {
|
|||||||
<ListButton />
|
<ListButton />
|
||||||
<EditButton setMode={setMode} id={id.toString()} mode={mode} />
|
<EditButton setMode={setMode} id={id.toString()} mode={mode} />
|
||||||
{(isWriter || !isSubmiter) && <DeleteButton handleDelete={handleDelete} />}
|
{(isWriter || !isSubmiter) && <DeleteButton handleDelete={handleDelete} />}
|
||||||
{!isSubmit && isSubmiter && <SubmitButton handleSubmit={handleSubmit} />}
|
{!isSubmit && isSubmiter && <SubmitButton handleSubmit={handleSubmit} setTempTargetId={setTempTargetId} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -170,7 +219,7 @@ export default function ButtonForm(props: {
|
|||||||
<ListButton />
|
<ListButton />
|
||||||
<TempButton setMode={setMode} handleSave={handleSave} />
|
<TempButton setMode={setMode} handleSave={handleSave} />
|
||||||
<SaveButton handleSave={handleSave} />
|
<SaveButton handleSave={handleSave} />
|
||||||
<SubmitButton handleSubmit={handleSubmit} />
|
{session?.role !== 'T01' && <SubmitButton handleSubmit={handleSubmit} setTempTargetId={setTempTargetId} />}{' '}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -210,15 +259,20 @@ function EditButton(props: { setMode: (mode: Mode) => void; id: string; mode: Mo
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function SubmitButton(props: { handleSubmit: () => void }) {
|
function SubmitButton(props: { handleSubmit: () => void; setTempTargetId: (targetId: string) => void }) {
|
||||||
const { handleSubmit } = props
|
const { handleSubmit, setTempTargetId } = props
|
||||||
return (
|
return (
|
||||||
<div className="btn-bx">
|
<>
|
||||||
{/* 제출 */}
|
<div className="btn-bx">
|
||||||
<button className="btn-frame red icon" onClick={handleSubmit}>
|
{/* 제출 */}
|
||||||
提出<i className="btn-arr"></i>
|
<button className="btn-frame red icon" onClick={handleSubmit}>
|
||||||
</button>
|
提出<i className="btn-arr"></i>
|
||||||
</div>
|
</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
|
<button
|
||||||
className="btn-frame n-blue icon"
|
className="btn-frame n-blue icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMode('TEMP')
|
|
||||||
handleSave(true)
|
handleSave(true)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,31 +1,22 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useServey } from '@/hooks/useSurvey'
|
import { useServey } from '@/hooks/useSurvey'
|
||||||
import { useParams, useSearchParams } from 'next/navigation'
|
import { useParams } from 'next/navigation'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect } from 'react'
|
||||||
import DetailForm from './DetailForm'
|
import DetailForm from './DetailForm'
|
||||||
import type { SurveyBasicInfo } from '@/types/Survey'
|
|
||||||
|
|
||||||
export default function DataTable() {
|
export default function DataTable() {
|
||||||
const params = useParams()
|
const params = useParams()
|
||||||
const id = params.id
|
const id = params.id
|
||||||
|
|
||||||
const searchParams = useSearchParams()
|
useEffect(() => {
|
||||||
const isTemp = searchParams.get('isTemporary')
|
if (Number.isNaN(Number(id))) {
|
||||||
|
alert('間違ったアプローチです。')
|
||||||
|
window.location.href = '/survey-sale'
|
||||||
|
}
|
||||||
|
}, [id])
|
||||||
|
|
||||||
const { surveyDetail, isLoadingSurveyDetail } = useServey(Number(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) {
|
if (isLoadingSurveyDetail) {
|
||||||
return <div>Loading...</div>
|
return <div>Loading...</div>
|
||||||
@ -42,12 +33,12 @@ export default function DataTable() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>登録番号</th>
|
<th>登録番号</th>
|
||||||
{isTemporary ? (
|
{surveyDetail?.srlNo?.startsWith('一時保存') ? (
|
||||||
<td>
|
<td>
|
||||||
<span className="text-red-500">仮保存</span>
|
<span className="text-red-500">仮保存</span>
|
||||||
</td>
|
</td>
|
||||||
) : (
|
) : (
|
||||||
<td>{surveyDetail?.id}</td>
|
<td>{surveyDetail?.srlNo}</td>
|
||||||
)}
|
)}
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import ButtonForm from './ButtonForm'
|
import ButtonForm from './ButtonForm'
|
||||||
import BasicForm from './BasicForm'
|
import BasicForm from './BasicForm'
|
||||||
import RoofForm from './RoofForm'
|
import RoofForm from './RoofForm'
|
||||||
import { useParams, useSearchParams } from 'next/navigation'
|
import { useParams, useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useServey } from '@/hooks/useSurvey'
|
import { useServey } from '@/hooks/useSurvey'
|
||||||
|
|
||||||
const roofInfoForm: SurveyDetailRequest = {
|
const roofInfoForm: SurveyDetailRequest = {
|
||||||
@ -58,34 +58,40 @@ const basicInfoForm: SurveyBasicRequest = {
|
|||||||
addressDetail: null,
|
addressDetail: null,
|
||||||
submissionStatus: false,
|
submissionStatus: false,
|
||||||
submissionDate: null,
|
submissionDate: null,
|
||||||
|
submissionTargetId: null,
|
||||||
|
srlNo: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DetailForm() {
|
export default function DetailForm() {
|
||||||
const idParam = useSearchParams().get('id')
|
const idParam = useSearchParams().get('id')
|
||||||
const routeId = useParams().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 [basicInfoData, setBasicInfoData] = useState<SurveyBasicRequest>(basicInfoForm)
|
||||||
const [roofInfoData, setRoofInfoData] = useState<SurveyDetailRequest>(roofInfoForm)
|
const [roofInfoData, setRoofInfoData] = useState<SurveyDetailRequest>(roofInfoForm)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (Number(idParam) !== 0 && surveyDetail === null) {
|
||||||
|
alert('データが見つかりません。')
|
||||||
|
window.location.href = '/survey-sale'
|
||||||
|
}
|
||||||
|
|
||||||
if (surveyDetail && (mode === 'EDIT' || mode === 'READ')) {
|
if (surveyDetail && (mode === 'EDIT' || mode === 'READ')) {
|
||||||
const { id, uptDt, regDt, detailInfo, ...rest } = surveyDetail
|
const { id, uptDt, regDt, detailInfo, ...rest } = surveyDetail
|
||||||
setBasicInfoData(rest)
|
setBasicInfoData(rest)
|
||||||
if (detailInfo) {
|
if (detailInfo) {
|
||||||
const { id, uptDt, regDt, basicInfoId, ...rest } = detailInfo
|
const { id, uptDt, regDt, basicInfoId, ...rest } = detailInfo
|
||||||
setRoofInfoData(rest)
|
setRoofInfoData(rest)
|
||||||
|
if (validateSurveyDetail(rest).trim() !== '') {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [surveyDetail, mode])
|
}, [surveyDetail, id])
|
||||||
|
|
||||||
// console.log('mode:: ', mode)
|
|
||||||
// console.log('surveyDetail:: ', surveyDetail)
|
|
||||||
// console.log('roofInfoData:: ', roofInfoData)
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
basic: basicInfoData,
|
basic: basicInfoData,
|
||||||
|
|||||||
@ -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() })
|
setRoofInfo({ ...roofInfo, [key]: value.toString() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +245,7 @@ export default function RoofForm(props: {
|
|||||||
const numericValue = roofInfo.contractCapacity?.replace(/[^0-9.]/g, '') || ''
|
const numericValue = roofInfo.contractCapacity?.replace(/[^0-9.]/g, '') || ''
|
||||||
setRoofInfo({
|
setRoofInfo({
|
||||||
...roofInfo,
|
...roofInfo,
|
||||||
contractCapacity: numericValue ? `${numericValue} ${value}` : value,
|
contractCapacity: numericValue ? `${numericValue} ${value}` : '0 ' + value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +269,7 @@ export default function RoofForm(props: {
|
|||||||
{mode !== 'READ' && (
|
{mode !== 'READ' && (
|
||||||
<div className="data-input mb5">
|
<div className="data-input mb5">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="number"
|
||||||
id="contractCapacity"
|
id="contractCapacity"
|
||||||
className="input-frame"
|
className="input-frame"
|
||||||
value={roofInfo?.contractCapacity?.split(' ')[0] ?? ''}
|
value={roofInfo?.contractCapacity?.split(' ')[0] ?? ''}
|
||||||
@ -464,17 +472,17 @@ const SelectedBox = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
|
const selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
|
||||||
const etcValue = detailInfoData?.[`${column}Etc` 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 isSpecialCase = column === 'constructionYear' || column === 'installationAvailability'
|
||||||
const [etcVal, setEtcVal] = useState<string>(etcValue?.toString() ?? '')
|
const showEtcOption = !isSpecialCase
|
||||||
|
|
||||||
const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||||
const value = e.target.value
|
const value = e.target.value
|
||||||
const isSpecialCase = column === 'constructionYear' || column === 'installationAvailability'
|
|
||||||
const isEtc = value === 'etc'
|
const isEtc = value === 'etc'
|
||||||
const isSpecialEtc = isSpecialCase && value === '2'
|
const isSpecialEtc = isSpecialCase && value === '2'
|
||||||
|
|
||||||
const updatedData: typeof detailInfoData = {
|
const updatedData = {
|
||||||
...detailInfoData,
|
...detailInfoData,
|
||||||
[column]: isEtc ? null : value,
|
[column]: isEtc ? null : value,
|
||||||
[`${column}Etc`]: isEtc ? '' : null,
|
[`${column}Etc`]: isEtc ? '' : null,
|
||||||
@ -485,14 +493,20 @@ const SelectedBox = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
setIsEtcSelected(isEtc || isSpecialEtc)
|
setIsEtcSelected(isEtc || isSpecialEtc)
|
||||||
if (!isEtc) setEtcVal('')
|
|
||||||
setRoofInfo(updatedData)
|
setRoofInfo(updatedData)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEtcInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleEtcInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value
|
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: e.target.value })
|
||||||
setEtcVal(value)
|
}
|
||||||
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: 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 (
|
return (
|
||||||
@ -502,7 +516,7 @@ const SelectedBox = ({
|
|||||||
name={column}
|
name={column}
|
||||||
id={column}
|
id={column}
|
||||||
disabled={mode === 'READ'}
|
disabled={mode === 'READ'}
|
||||||
value={selectedId ? Number(selectedId) : etcValue !== null ? 'etc' : ''}
|
value={selectedId ? Number(selectedId) : etcValue ? 'etc' : ''}
|
||||||
onChange={handleSelectChange}
|
onChange={handleSelectChange}
|
||||||
>
|
>
|
||||||
{selectBoxOptions[column as keyof typeof selectBoxOptions].map((item) => (
|
{selectBoxOptions[column as keyof typeof selectBoxOptions].map((item) => (
|
||||||
@ -510,7 +524,7 @@ const SelectedBox = ({
|
|||||||
{item.name}
|
{item.name}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
{column !== 'installationAvailability' && column !== 'constructionYear' && (
|
{showEtcOption && (
|
||||||
<option key="etc" value="etc">
|
<option key="etc" value="etc">
|
||||||
その他 (直接入力)
|
その他 (直接入力)
|
||||||
</option>
|
</option>
|
||||||
@ -519,23 +533,16 @@ const SelectedBox = ({
|
|||||||
選択してください
|
選択してください
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<div className="data-input">
|
<div className={`data-input ${column === 'constructionYear' ? 'flex' : ''}`}>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type={column === 'constructionYear' ? 'number' : 'text'}
|
||||||
className="input-frame"
|
className="input-frame"
|
||||||
placeholder="-"
|
placeholder="-"
|
||||||
value={etcVal}
|
value={detailInfoData[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? ''}
|
||||||
onChange={handleEtcInputChange}
|
onChange={handleEtcInputChange}
|
||||||
disabled={
|
disabled={isInputDisabled()}
|
||||||
mode === 'READ'
|
|
||||||
? true
|
|
||||||
: column === 'installationAvailability'
|
|
||||||
? false
|
|
||||||
: column === 'constructionYear'
|
|
||||||
? detailInfoData.constructionYear === '1' || detailInfoData.constructionYear === null
|
|
||||||
: !isEtcSelected
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
{column === 'constructionYear' && <span>年</span>}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
@ -552,49 +559,51 @@ const RadioSelected = ({
|
|||||||
detailInfoData: SurveyDetailInfo
|
detailInfoData: SurveyDetailInfo
|
||||||
setRoofInfo: (roofInfo: SurveyDetailRequest) => void
|
setRoofInfo: (roofInfo: SurveyDetailRequest) => void
|
||||||
}) => {
|
}) => {
|
||||||
let selectedId = detailInfoData?.[column as keyof SurveyDetailInfo]
|
const etcValue = detailInfoData?.[`${column}Etc` as keyof SurveyDetailInfo]
|
||||||
if (column === 'leakTrace') {
|
const [etcChecked, setEtcChecked] = useState<boolean>(Boolean(etcValue))
|
||||||
selectedId = Number(selectedId)
|
|
||||||
if (!selectedId) selectedId = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
let etcValue = null
|
const selectedId =
|
||||||
if (column !== 'rafterDirection') {
|
column === 'leakTrace' ? Number(detailInfoData?.[column as keyof SurveyDetailInfo]) || 2 : detailInfoData?.[column as keyof SurveyDetailInfo]
|
||||||
etcValue = detailInfoData?.[`${column}Etc` as keyof SurveyDetailInfo]
|
|
||||||
}
|
const isSpecialColumn = column === 'rafterDirection' || column === 'leakTrace' || column === 'insulationPresence'
|
||||||
const [etcChecked, setEtcChecked] = useState<boolean>(etcValue !== null && etcValue !== undefined && etcValue !== '')
|
const showEtcOption = !isSpecialColumn
|
||||||
const [etcVal, setEtcVal] = useState<string>(etcValue?.toString() ?? '')
|
|
||||||
|
|
||||||
const handleRadioChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleRadioChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value
|
const value = e.target.value
|
||||||
|
|
||||||
if (column === 'leakTrace') {
|
if (column === 'leakTrace') {
|
||||||
handleBooleanRadioChange(value)
|
setRoofInfo({ ...detailInfoData, leakTrace: value === '1' })
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value === 'etc') {
|
if (value === 'etc') {
|
||||||
setEtcChecked(true)
|
setEtcChecked(true)
|
||||||
setRoofInfo({ ...detailInfoData, [column]: null, [`${column}Etc`]: '' })
|
setRoofInfo({ ...detailInfoData, [column]: null, [`${column}Etc`]: '' })
|
||||||
} else {
|
return
|
||||||
if (column === 'insulationPresence' && value === '2') {
|
|
||||||
setEtcChecked(true)
|
|
||||||
} else {
|
|
||||||
setEtcChecked(false)
|
|
||||||
}
|
|
||||||
setRoofInfo({ ...detailInfoData, [column]: value, [`${column}Etc`]: null })
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const handleBooleanRadioChange = (value: string) => {
|
const isInsulationPresence = column === 'insulationPresence'
|
||||||
if (value === '1') {
|
const isRafterDirection = column === 'rafterDirection'
|
||||||
setRoofInfo({ ...detailInfoData, leakTrace: true })
|
|
||||||
} else {
|
setEtcChecked(isInsulationPresence && value === '2')
|
||||||
setRoofInfo({ ...detailInfoData, leakTrace: false })
|
|
||||||
}
|
setRoofInfo({
|
||||||
|
...detailInfoData,
|
||||||
|
[column]: value,
|
||||||
|
[`${column}Etc`]: isRafterDirection ? detailInfoData[`${column}Etc` as keyof SurveyDetailInfo] : null,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEtcInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleEtcInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value
|
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: e.target.value })
|
||||||
setEtcVal(value)
|
}
|
||||||
setRoofInfo({ ...detailInfoData, [`${column}Etc`]: value })
|
|
||||||
|
const isInputDisabled = () => {
|
||||||
|
if (mode === 'READ') return true
|
||||||
|
if (column === 'insulationPresence') {
|
||||||
|
return detailInfoData.insulationPresence !== '2'
|
||||||
|
}
|
||||||
|
return !etcChecked && !etcValue
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -613,7 +622,7 @@ const RadioSelected = ({
|
|||||||
<label htmlFor={`${column}_${item.id}`}>{item.label}</label>
|
<label htmlFor={`${column}_${item.id}`}>{item.label}</label>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
{column !== 'rafterDirection' && column !== 'leakTrace' && column !== 'insulationPresence' && (
|
{showEtcOption && (
|
||||||
<div className="radio-form-box mb10">
|
<div className="radio-form-box mb10">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
@ -621,21 +630,21 @@ const RadioSelected = ({
|
|||||||
id={`${column}Etc`}
|
id={`${column}Etc`}
|
||||||
value="etc"
|
value="etc"
|
||||||
disabled={mode === 'READ'}
|
disabled={mode === 'READ'}
|
||||||
checked={etcChecked}
|
checked={etcChecked || Boolean(etcValue)}
|
||||||
onChange={handleRadioChange}
|
onChange={handleRadioChange}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`${column}Etc`}>その他 (直接入力)</label>
|
<label htmlFor={`${column}Etc`}>その他 (直接入力)</label>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{column !== 'leakTrace' && column !== 'rafterDirection' && (
|
{(showEtcOption || column === 'insulationPresence') && (
|
||||||
<div className="data-input">
|
<div className="data-input">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-frame"
|
className="input-frame"
|
||||||
placeholder="-"
|
placeholder="-"
|
||||||
value={etcVal}
|
value={detailInfoData[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? ''}
|
||||||
onChange={handleEtcInputChange}
|
onChange={handleEtcInputChange}
|
||||||
disabled={mode === 'READ' || !etcChecked}
|
disabled={isInputDisabled()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -655,51 +664,56 @@ const MultiCheck = ({
|
|||||||
setRoofInfo: (roofInfo: SurveyDetailRequest) => void
|
setRoofInfo: (roofInfo: SurveyDetailRequest) => void
|
||||||
}) => {
|
}) => {
|
||||||
const multiCheckData = column === 'supplementaryFacilities' ? supplementaryFacilities : roofMaterial
|
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 isRoofMaterial = column === 'roofMaterial'
|
||||||
const [otherValue, setOtherValue] = useState<string>(roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? '')
|
const selectedValues = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? ''))
|
||||||
|
|
||||||
const handleCheckbox = (id: number) => {
|
const handleCheckbox = (id: number) => {
|
||||||
const value = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? ''))
|
const isOtherSelected = Boolean(etcValue)
|
||||||
const isOtherSelected = roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo] !== null
|
|
||||||
|
|
||||||
let newValue: string[]
|
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) {
|
if (totalSelected >= 2) {
|
||||||
alert('屋根材は最大2個まで選択できます。')
|
alert('屋根材は最大2個まで選択できます。')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newValue = [...value, String(id)]
|
newValue = [...selectedValues, String(id)]
|
||||||
}
|
}
|
||||||
setRoofInfo({ ...roofInfo, [column]: newValue.join(',') })
|
setRoofInfo({ ...roofInfo, [column]: newValue.join(',') })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOtherCheckbox = () => {
|
const handleOtherCheckbox = () => {
|
||||||
if (column === 'roofMaterial') {
|
if (isRoofMaterial) {
|
||||||
const value = makeNumArr(String(roofInfo[column as keyof SurveyDetailInfo] ?? ''))
|
const currentSelected = selectedValues.length
|
||||||
const currentSelected = value.length
|
|
||||||
if (!isOtherCheck && currentSelected >= 2) {
|
if (!isOtherCheck && currentSelected >= 2) {
|
||||||
alert('屋根材は最大2個まで選択できます。')
|
alert('屋根材は最大2個まで選択できます。')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const newIsOtherCheck = !isOtherCheck
|
const newIsOtherCheck = !isOtherCheck
|
||||||
setIsOtherCheck(newIsOtherCheck)
|
setIsOtherCheck(newIsOtherCheck)
|
||||||
setOtherValue('')
|
|
||||||
|
|
||||||
setRoofInfo({ ...roofInfo, [`${column}Etc`]: newIsOtherCheck ? '' : null })
|
// 기타 선택 해제 시 값도 null로 설정
|
||||||
|
setRoofInfo({
|
||||||
|
...roofInfo,
|
||||||
|
[`${column}Etc`]: newIsOtherCheck ? '' : null,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOtherInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleOtherInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = e.target.value
|
setRoofInfo({ ...roofInfo, [`${column}Etc`]: e.target.value })
|
||||||
setOtherValue(value)
|
}
|
||||||
setRoofInfo({ ...roofInfo, [`${column}Etc`]: value })
|
|
||||||
|
const isInputDisabled = () => {
|
||||||
|
return mode === 'READ' || (!isOtherCheck && !etcValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -710,7 +724,7 @@ const MultiCheck = ({
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={`${column}_${item.id}`}
|
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'}
|
disabled={mode === 'READ'}
|
||||||
onChange={() => handleCheckbox(item.id)}
|
onChange={() => handleCheckbox(item.id)}
|
||||||
/>
|
/>
|
||||||
@ -721,7 +735,7 @@ const MultiCheck = ({
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={`${column}Etc`}
|
id={`${column}Etc`}
|
||||||
checked={roofInfo?.[`${column}Etc` as keyof SurveyDetailInfo] !== null}
|
checked={isOtherCheck || Boolean(etcValue)}
|
||||||
disabled={mode === 'READ'}
|
disabled={mode === 'READ'}
|
||||||
onChange={handleOtherCheckbox}
|
onChange={handleOtherCheckbox}
|
||||||
/>
|
/>
|
||||||
@ -733,9 +747,9 @@ const MultiCheck = ({
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-frame"
|
className="input-frame"
|
||||||
placeholder="-"
|
placeholder="-"
|
||||||
value={otherValue}
|
value={roofInfo[`${column}Etc` as keyof SurveyDetailInfo]?.toString() ?? ''}
|
||||||
onChange={handleOtherInputChange}
|
onChange={handleOtherInputChange}
|
||||||
disabled={mode === 'READ' || !isOtherCheck}
|
disabled={isInputDisabled()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import LoadMoreButton from '@/components/LoadMoreButton'
|
import LoadMoreButton from '@/components/LoadMoreButton'
|
||||||
import { useServey } from '@/hooks/useSurvey'
|
import { useServey } from '@/hooks/useSurvey'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState, useMemo, useRef } from 'react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter, usePathname } from 'next/navigation'
|
||||||
import SearchForm from './SearchForm'
|
import SearchForm from './SearchForm'
|
||||||
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
|
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
@ -11,13 +11,20 @@ import type { SurveyBasicInfo } from '@/types/Survey'
|
|||||||
|
|
||||||
export default function ListTable() {
|
export default function ListTable() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const pathname = usePathname()
|
||||||
|
|
||||||
const { surveyList, isLoadingSurveyList } = useServey()
|
const { surveyList, isLoadingSurveyList } = useServey()
|
||||||
const { offset, setOffset } = useSurveyFilterStore()
|
const { offset, setOffset } = useSurveyFilterStore()
|
||||||
|
|
||||||
|
const { session } = useSessionStore()
|
||||||
|
|
||||||
const [heldSurveyList, setHeldSurveyList] = useState<SurveyBasicInfo[]>([])
|
const [heldSurveyList, setHeldSurveyList] = useState<SurveyBasicInfo[]>([])
|
||||||
const [hasMore, setHasMore] = useState(false)
|
const [hasMore, setHasMore] = useState(false)
|
||||||
|
|
||||||
const { session } = useSessionStore()
|
useEffect(() => {
|
||||||
|
setOffset(0)
|
||||||
|
setHeldSurveyList([])
|
||||||
|
}, [pathname])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!session.isLoggedIn || !('data' in surveyList)) return
|
if (!session.isLoggedIn || !('data' in surveyList)) return
|
||||||
@ -32,30 +39,25 @@ export default function ListTable() {
|
|||||||
setHeldSurveyList([])
|
setHeldSurveyList([])
|
||||||
setHasMore(false)
|
setHasMore(false)
|
||||||
}
|
}
|
||||||
}, [surveyList, offset, session])
|
}, [surveyList, offset, session.isLoggedIn])
|
||||||
|
|
||||||
const handleDetailClick = (id: number) => {
|
const handleDetailClick = (id: number) => {
|
||||||
router.push(`/survey-sale/${id}`)
|
router.push(`/survey-sale/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleItemsInit = () => {
|
|
||||||
setHeldSurveyList([])
|
|
||||||
setOffset(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: 로딩 처리 필요
|
// TODO: 로딩 처리 필요
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SearchForm memberRole={session?.role ?? ''} userId={session?.userId ?? ''} />
|
<SearchForm memberRole={session?.role ?? ''} userNm={session?.userNm ?? ''} />
|
||||||
{heldSurveyList.length > 0 ? (
|
|
||||||
<div className="sale-frame">
|
<div className="sale-frame">
|
||||||
<ul className="sale-list-wrap">
|
{heldSurveyList.length > 0 ? (
|
||||||
|
<ul className="sale-list-wrap">
|
||||||
{heldSurveyList.map((survey) => (
|
{heldSurveyList.map((survey) => (
|
||||||
<li className="sale-list-item cursor-pointer" key={survey.id} onClick={() => handleDetailClick(survey.id)}>
|
<li className="sale-list-item cursor-pointer" key={survey.id} onClick={() => handleDetailClick(survey.id)}>
|
||||||
<div className="sale-item-bx">
|
<div className="sale-item-bx">
|
||||||
<div className="sale-item-date-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 className="sale-item-date">{survey.investigationDate}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="sale-item-tit">{survey.buildingName}</div>
|
<div className="sale-item-tit">{survey.buildingName}</div>
|
||||||
@ -65,18 +67,18 @@ export default function ListTable() {
|
|||||||
<div className="sale-item-update">{new Date(survey.uptDt).toLocaleString()}</div>
|
<div className="sale-item-update">{new Date(survey.uptDt).toLocaleString()}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
) : (
|
||||||
|
<div className="compliace-nosearch">
|
||||||
|
<span className="mb10">作成された物件はありません。</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className="sale-edit-btn">
|
<div className="sale-edit-btn">
|
||||||
<LoadMoreButton hasMore={hasMore} onLoadMore={() => setOffset(offset + 10)} />
|
<LoadMoreButton hasMore={hasMore} onLoadMore={() => setOffset(offset + 10)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<div>
|
|
||||||
<p>作成された物件はありません。</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { SEARCH_OPTIONS, SEARCH_OPTIONS_ENUM, SEARCH_OPTIONS_PARTNERS, useSurvey
|
|||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { useState } from 'react'
|
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 router = useRouter()
|
||||||
const { setSearchOption, setSort, setIsMySurvey, setKeyword, isMySurvey, keyword, searchOption, sort } = useSurveyFilterStore()
|
const { setSearchOption, setSort, setIsMySurvey, setKeyword, isMySurvey, keyword, searchOption, sort } = useSurveyFilterStore()
|
||||||
const [searchKeyword, setSearchKeyword] = useState(keyword)
|
const [searchKeyword, setSearchKeyword] = useState(keyword)
|
||||||
@ -75,9 +75,9 @@ export default function SearchForm({ memberRole, userId }: { memberRole: string;
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id="ch01"
|
id="ch01"
|
||||||
checked={isMySurvey === userId}
|
checked={isMySurvey === userNm}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
setIsMySurvey(isMySurvey === userId ? null : userId)
|
setIsMySurvey(isMySurvey === userNm ? null : userNm)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="ch01">私が書いた物件</label>
|
<label htmlFor="ch01">私が書いた物件</label>
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export default function Main() {
|
|||||||
<div className="main-bx-icon">
|
<div className="main-bx-icon">
|
||||||
<img src="/assets/images/main/main_icon02.svg" alt="" />
|
<img src="/assets/images/main/main_icon02.svg" alt="" />
|
||||||
</div>
|
</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>
|
||||||
<div className="grid-bx-body">
|
<div className="grid-bx-body">
|
||||||
<div className="grid-bx-body-tit">調査物件登録</div>
|
<div className="grid-bx-body-tit">調査物件登録</div>
|
||||||
|
|||||||
@ -65,9 +65,9 @@ export function useServey(id?: number): {
|
|||||||
isDeletingSurvey: boolean
|
isDeletingSurvey: boolean
|
||||||
createSurvey: (survey: SurveyRegistRequest) => Promise<number>
|
createSurvey: (survey: SurveyRegistRequest) => Promise<number>
|
||||||
createSurveyDetail: (params: { surveyId: number; surveyDetail: SurveyDetailCoverRequest }) => void
|
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>
|
deleteSurvey: () => Promise<boolean>
|
||||||
submitSurvey: (saveId?: number) => void
|
submitSurvey: (params: { saveId?: number; targetId?: string; storeId?: string; srlNo?: string }) => void
|
||||||
validateSurveyDetail: (surveyDetail: SurveyDetailRequest) => string
|
validateSurveyDetail: (surveyDetail: SurveyDetailRequest) => string
|
||||||
getZipCode: (zipCode: string) => Promise<ZipCode[] | null>
|
getZipCode: (zipCode: string) => Promise<ZipCode[] | null>
|
||||||
refetchSurveyList: () => void
|
refetchSurveyList: () => void
|
||||||
@ -119,7 +119,7 @@ export function useServey(id?: number): {
|
|||||||
|
|
||||||
const { mutateAsync: createSurvey, isPending: isCreatingSurvey } = useMutation({
|
const { mutateAsync: createSurvey, isPending: isCreatingSurvey } = useMutation({
|
||||||
mutationFn: async (survey: SurveyRegistRequest) => {
|
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
|
return resp.data.id ?? 0
|
||||||
},
|
},
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
@ -130,10 +130,14 @@ export function useServey(id?: number): {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const { mutate: updateSurvey, isPending: isUpdatingSurvey } = useMutation({
|
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)
|
console.log('updateSurvey, survey:: ', survey)
|
||||||
if (id === undefined) throw new Error('id is required')
|
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
|
return resp.data
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
@ -166,11 +170,13 @@ export function useServey(id?: number): {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const { mutateAsync: submitSurvey } = useMutation({
|
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
|
const submitId = saveId ?? id
|
||||||
if (!submitId) throw new Error('id is required')
|
if (!submitId) throw new Error('id is required')
|
||||||
const resp = await axiosInstance(null).patch<boolean>(`/api/survey-sales/${submitId}`, {
|
const resp = await axiosInstance(null).patch<boolean>(`/api/survey-sales/${submitId}`, {
|
||||||
submit: true,
|
targetId,
|
||||||
|
storeId,
|
||||||
|
srlNo,
|
||||||
})
|
})
|
||||||
return resp.data
|
return resp.data
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,6 +14,8 @@ export type SurveyBasicInfo = {
|
|||||||
detailInfo: SurveyDetailInfo | null
|
detailInfo: SurveyDetailInfo | null
|
||||||
regDt: Date
|
regDt: Date
|
||||||
uptDt: Date
|
uptDt: Date
|
||||||
|
submissionTargetId: string | null
|
||||||
|
srlNo: string | null //판매점IDyyMMdd000
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SurveyDetailInfo = {
|
export type SurveyDetailInfo = {
|
||||||
@ -70,6 +72,8 @@ export type SurveyBasicRequest = {
|
|||||||
addressDetail: string | null
|
addressDetail: string | null
|
||||||
submissionStatus: boolean
|
submissionStatus: boolean
|
||||||
submissionDate: string | null
|
submissionDate: string | null
|
||||||
|
submissionTargetId: string | null
|
||||||
|
srlNo: string | null //판매점IDyyMMdd000
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SurveyDetailRequest = {
|
export type SurveyDetailRequest = {
|
||||||
@ -127,6 +131,8 @@ export type SurveyRegistRequest = {
|
|||||||
submissionStatus: boolean
|
submissionStatus: boolean
|
||||||
submissionDate: string | null
|
submissionDate: string | null
|
||||||
detailInfo: SurveyDetailRequest | null
|
detailInfo: SurveyDetailRequest | null
|
||||||
|
submissionTargetId: string | null
|
||||||
|
srlNo: string | null //판매점IDyyMMdd000
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Mode = 'CREATE' | 'EDIT' | 'READ' | 'TEMP' // 등록 | 수정 | 상세 | 임시저장
|
export type Mode = 'CREATE' | 'EDIT' | 'READ' | 'TEMP' // 등록 | 수정 | 상세 | 임시저장
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user