견적서 탭에서 탭 이동시

This commit is contained in:
basssy 2025-02-18 15:20:46 +09:00
parent 9213edb9dd
commit 3ed4325775

View File

@ -88,8 +88,6 @@ export default function Estimate({}) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { setMenuNumber } = useCanvasMenu()
const { closeAll } = usePopup() const { closeAll } = usePopup()
// props // props
@ -101,8 +99,6 @@ export default function Estimate({}) {
const initEstimate = (currPid = currentPid) => { const initEstimate = (currPid = currentPid) => {
console.log('🚀 ~ initEstimate ~ currPid:', currPid) console.log('🚀 ~ initEstimate ~ currPid:', currPid)
closeAll() closeAll()
setMenuNumber(5)
setObjectNo(objectRecoil.floorPlanObjectNo) setObjectNo(objectRecoil.floorPlanObjectNo)
setPlanNo(currPid) setPlanNo(currPid)
@ -120,11 +116,13 @@ export default function Estimate({}) {
const apiUrl = `/api/display-item/item-list?${queryStringFormatter(param)}` const apiUrl = `/api/display-item/item-list?${queryStringFormatter(param)}`
post({ url: apiUrl, data: param }).then((res) => { post({ url: apiUrl, data: param }).then((res) => {
if (res.length > 0) { if (res.length > 0) {
let tempList let tempList = []
let updatedRes = [] let updatedRes = []
if (estimateContextState?.itemList.length > 0) { if (estimateContextState?.itemList.length > 0) {
tempList = estimateContextState.itemList.filter((item) => !res.some((resItem) => resItem.itemId === item.itemId)) tempList = estimateContextState.itemList.filter((item) => !res.some((resItem) => resItem.itemId === item.itemId))
updatedRes = [...res, ...tempList] updatedRes = [...res, ...tempList]
// console.log('tempList::::::::', tempList)
// console.log('updatedRes::::::::', updatedRes)
} else { } else {
updatedRes = [...res] updatedRes = [...res]
} }