dev #859

Merged
ysCha merged 2 commits from dev into dev-deploy 2026-05-15 12:30:14 +09:00
4 changed files with 99 additions and 74 deletions

View File

@ -23,6 +23,7 @@ import { QcastContext } from '@/app/QcastProvider'
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
import { useSwal } from '@/hooks/useSwal' import { useSwal } from '@/hooks/useSwal'
import { sanitizeIntegerInputEvent } from '@/util/input-utils' import { sanitizeIntegerInputEvent } from '@/util/input-utils'
import { logger } from '@/util/logger'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
import Image from 'next/image' import Image from 'next/image'
@ -1008,93 +1009,115 @@ export default function StuffDetail() {
// //
const setPlanReqInfo = (info) => { const setPlanReqInfo = (info) => {
form.setValue('planReqNo', info.planReqNo) // [PLANREQ-DEBUG 2026-05-15] import
logger.debug('[PLANREQ-DEBUG] setPlanReqInfo entry', {
form.setValue('objectStatusId', info.building) session: { storeId: session?.storeId, storeLvl: session?.storeLvl },
setSelectObjectStatusId(info.building) info: { planReqNo: info?.planReqNo, saleStoreId: info?.saleStoreId, saleStoreLevel: info?.saleStoreLevel, saleStoreName: info?.saleStoreName },
saleStoreList: saleStoreList.map((s) => s.saleStoreId),
form.setValue('objectName', info.title) otherSaleStoreList: otherSaleStoreList.map((o) => o.saleStoreId),
form.setValue('zipNo', info.zipNo)
form.setValue('address', info.address2)
prefCodeList.map((row) => {
if (row.prefName == info.address1) {
setPrefValue(row.prefId)
form.setValue('prefId', row.prefId)
form.setValue('prefName', info.address1)
}
}) })
// WL_ // [PLANREQ-MATCH 2026-05-15] all-or-nothing: saleStore
if (info.windSpeed !== '') { const applyFields = () => {
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`) form.setValue('planReqNo', info.planReqNo)
} else { form.setValue('objectStatusId', info.building)
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`) setSelectObjectStatusId(info.building)
form.setValue('objectName', info.title)
form.setValue('zipNo', info.zipNo)
form.setValue('address', info.address2)
prefCodeList.map((row) => {
if (row.prefName == info.address1) {
setPrefValue(row.prefId)
form.setValue('prefId', row.prefId)
form.setValue('prefName', info.address1)
}
})
// WL_
if (info.windSpeed !== '') {
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`)
} else {
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`)
}
form.setValue('verticalSnowCover', info.verticalSnowCover)
form.setValue('surfaceType', info.surfaceType)
if (info.surfaceType === 'Ⅱ') {
form.setValue('saltAreaFlg', true)
} else {
form.setValue('saltAreaFlg', false)
}
const installHeight = info.installHeight ? info.installHeight.split('.')[0] : ''
form.setValue('installHeight', installHeight)
form.setValue('remarks', info.remarks)
} }
form.setValue('verticalSnowCover', info.verticalSnowCover)
form.setValue('surfaceType', info.surfaceType)
if (info.surfaceType === 'Ⅱ') {
form.setValue('saltAreaFlg', true)
} else {
form.setValue('saltAreaFlg', false)
}
let installHeight = info.installHeight ? info.installHeight.split('.')[0] : ''
form.setValue('installHeight', installHeight)
form.setValue('remarks', info.remarks)
if (info.saleStoreLevel === '1') { if (info.saleStoreLevel === '1') {
// 1 ID: ( )
applyFields()
setSelOptions(info.saleStoreId) setSelOptions(info.saleStoreId)
form.setValue('saleStoreId', info.saleStoreId) form.setValue('saleStoreId', info.saleStoreId)
form.setValue('saleStoreName', info.saleStoreName) form.setValue('saleStoreName', info.saleStoreName)
form.setValue('saleStoreLevel', info.saleStoreLevel) form.setValue('saleStoreLevel', info.saleStoreLevel)
} else { return
// [PLANREQ-MATCH 2026-05-15] 2 user: planReqNo + store 2 select disable }
if (session?.storeLvl === '2') {
const matched = otherSaleStoreList.some((o) => o.saleStoreId === info.saleStoreId) // info.saleStoreLevel !== '1' (2 ID)
if (!matched) { if (session?.storeLvl === '2') {
form.setValue('planReqNo', '') const matched = otherSaleStoreList.some((o) => o.saleStoreId === info.saleStoreId)
setOtherSelOptions(session?.storeId) logger.debug('[PLANREQ-DEBUG] 2차 user match check', { matched, target: info.saleStoreId })
form.setValue('otherSaleStoreId', session?.storeId) if (!matched) {
form.setValue('otherSaleStoreName', '') // +
form.setValue('otherSaleStoreLevel', session?.storeLvl) swalFire({
return title: getMessage('stuff.detail.planReq.message.notMatch'),
} type: 'alert',
icon: 'warning',
})
return
} }
applyFields()
setOtherSelOptions(info.saleStoreId) setOtherSelOptions(info.saleStoreId)
form.setValue('otherSaleStoreId', info.saleStoreId) form.setValue('otherSaleStoreId', info.saleStoreId)
form.setValue('otherSaleStoreName', info.saleStoreName) form.setValue('otherSaleStoreName', info.saleStoreName)
form.setValue('otherSaleStoreLevel', info.saleStoreLevel) form.setValue('otherSaleStoreLevel', info.saleStoreLevel)
get({ url: `/api/object/saleStore/${info.saleStoreId}/firstAgent` }).then((res) => { return
if (res?.firstAgentId) {
const firstAgent = { saleStoreId: res.firstAgentId, saleStoreName: res.firstAgentName }
setSaleStoreList((prev) => {
const exists = prev.some((s) => s.saleStoreId === res.firstAgentId)
return exists ? prev : [...prev, firstAgent]
})
setShowSaleStoreList((prev) => {
const exists = prev.some((s) => s.saleStoreId === res.firstAgentId)
return exists ? prev : [...prev, firstAgent]
})
setSelOptions(res.firstAgentId)
form.setValue('saleStoreId', res.firstAgentId)
form.setValue('saleStoreName', res.firstAgentName)
form.setValue('saleStoreLevel', '1')
} else {
setSelOptions('')
form.setValue('saleStoreId', '')
form.setValue('saleStoreName', '')
form.setValue('saleStoreLevel', '')
}
}).catch(() => {
setSelOptions('')
form.setValue('saleStoreId', '')
form.setValue('saleStoreName', '')
form.setValue('saleStoreLevel', '')
})
} }
// T01 / 1 user + 2 ID: firstAgent ( )
get({ url: `/api/object/saleStore/${info.saleStoreId}/firstAgent` }).then((res) => {
logger.debug('[PLANREQ-DEBUG] firstAgent result', { firstAgentId: res?.firstAgentId })
if (!res?.firstAgentId) {
swalFire({
title: getMessage('stuff.detail.planReq.message.notMatch'),
type: 'alert',
icon: 'warning',
})
return
}
applyFields()
setOtherSelOptions(info.saleStoreId)
form.setValue('otherSaleStoreId', info.saleStoreId)
form.setValue('otherSaleStoreName', info.saleStoreName)
form.setValue('otherSaleStoreLevel', info.saleStoreLevel)
const firstAgent = { saleStoreId: res.firstAgentId, saleStoreName: res.firstAgentName }
setSaleStoreList((prev) => {
const exists = prev.some((s) => s.saleStoreId === res.firstAgentId)
return exists ? prev : [...prev, firstAgent]
})
setShowSaleStoreList((prev) => {
const exists = prev.some((s) => s.saleStoreId === res.firstAgentId)
return exists ? prev : [...prev, firstAgent]
})
setSelOptions(res.firstAgentId)
form.setValue('saleStoreId', res.firstAgentId)
form.setValue('saleStoreName', res.firstAgentName)
form.setValue('saleStoreLevel', '1')
}).catch(() => {
// +
swalFire({
title: getMessage('stuff.detail.planReq.message.notMatch'),
type: 'alert',
icon: 'warning',
})
})
} }
// //

View File

@ -782,6 +782,7 @@
"stuff.detail.tempSave.message2": "担当者名は全角20文字半角40文字以下で入力してください.", "stuff.detail.tempSave.message2": "担当者名は全角20文字半角40文字以下で入力してください.",
"stuff.detail.tempSave.message3": "二次販売店を選択してください。", "stuff.detail.tempSave.message3": "二次販売店を選択してください。",
"stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?", "stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?",
"stuff.detail.planReq.message.notMatch": "設計依頼の販売店情報が一致しないため、インポートできません。",
"stuff.detail.delete.message1": "仕様が確定したものは削除できません。", "stuff.detail.delete.message1": "仕様が確定したものは削除できません。",
"stuff.detail.planList.title": "プランリスト", "stuff.detail.planList.title": "プランリスト",
"stuff.detail.planList.cnt": "全体", "stuff.detail.planList.cnt": "全体",

View File

@ -782,6 +782,7 @@
"stuff.detail.tempSave.message2": "담당자이름은 전각20자(반각40자) 이하로 입력해 주십시오.", "stuff.detail.tempSave.message2": "담당자이름은 전각20자(반각40자) 이하로 입력해 주십시오.",
"stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.", "stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.",
"stuff.detail.confirm.message1": "판매점 정보를 변경하면 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?", "stuff.detail.confirm.message1": "판매점 정보를 변경하면 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?",
"stuff.detail.planReq.message.notMatch": "설계의뢰의 판매점 정보가 일치하지 않아 가져올 수 없습니다.",
"stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.", "stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.",
"stuff.detail.planList.title": "플랜목록", "stuff.detail.planList.title": "플랜목록",
"stuff.detail.planList.cnt": "전체", "stuff.detail.planList.cnt": "전체",

View File

@ -1994,11 +1994,11 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode, isOver
let movedLines = [] let movedLines = []
// 조건에 맞는 라인들만 필터링 // 조건에 맞는 라인들만 필터링
const validWallLines = [...wallLines].sort((a, b) => a.idx - b.idx).filter((wallLine, index) => wallLine.idx - 1 === index) const validWallLines = [...wallLines].sort((a, b) => a.idx - b.idx).filter((wallLine, index) => wallLine.idx - 1 === index); // [ASI-FIX 2026-05-15] 세미콜론 없으면 다음 줄 `(` 가 함수호출로 묶여 .filter(...)(...) → "is not a function" → SK 빌드 실패 + 확장선 누락
// logger.log('', sortRoofLines, sortWallLines, sortWallBaseLines); // logger.log('', sortRoofLines, sortWallLines, sortWallBaseLines);
(sortWallLines.length === sortWallBaseLines.length && sortWallBaseLines.length > 3) && ;(sortWallLines.length === sortWallBaseLines.length && sortWallBaseLines.length > 3) &&
sortWallLines.forEach((wallLine, index) => { sortWallLines.forEach((wallLine, index) => {
const roofLine = sortRoofLines[index] const roofLine = sortRoofLines[index]