From ddf7cb9f13cc12f0d760231cef72b1b90f5f1b90 Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 5 Jun 2026 11:00:29 +0900 Subject: [PATCH] =?UTF-8?q?[1423]=20=EC=84=A4=EA=B3=84=EA=B0=80=EC=A0=B8?= =?UTF-8?q?=EC=98=A4=EA=B8=B0=20T01=20=EC=A0=84=EC=9A=A9=20+=202=EC=B0=A8?= =?UTF-8?q?=EC=A0=90=20=EA=B0=95=EC=A0=9C=20select=20=EB=B0=98=EC=98=81=20?= =?UTF-8?q?=E2=80=94=20No=20data/=EB=84=A4=ED=8A=B8=EC=9B=8C=ED=81=AC=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=B6=84=EB=A6=AC=20+=20vExt=20cascade=20?= =?UTF-8?q?=ED=8F=89=ED=96=89=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffDetail.jsx | 88 +++++++++++++---------- src/locales/ja.json | 1 + src/locales/ko.json | 1 + src/util/kerab-offset-surgical.js | 27 +++++-- 4 files changed, 73 insertions(+), 44 deletions(-) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 874aa8fd..30370d73 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -1082,39 +1082,49 @@ export default function StuffDetail() { return } - // 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 - } + // [PLANREQ-FORCE-SELECT 2026-06-05] T01 / 1차 user + 2차 ID + // 매핑 실패해도 모든 필드 적용 + 2차점을 옵션에 강제 추가 + selected + // 1차점 정보(firstAgent) 가 있으면 1차점도 함께 반영 + // 'No data' 응답(4xx + message)도 매핑 실패와 동일하게 처리, 진짜 네트워크 에러만 알림 + const applyOtherSaleStore = () => { applyFields() + setOtherSaleStoreList((prev) => { + const exists = prev.some((o) => o.saleStoreId === info.saleStoreId) + return exists ? prev : [...prev, { saleStoreId: info.saleStoreId, saleStoreName: info.saleStoreName }] + }) 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(() => { - // 매핑 실패 — 아무것도 적용 안 함 + 사용자에게 알림 + } + get({ url: `/api/object/saleStore/${info.saleStoreId}/firstAgent` }).then((res) => { + logger.debug('[PLANREQ-DEBUG] firstAgent result', { firstAgentId: res?.firstAgentId }) + applyOtherSaleStore() + 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') + } + }).catch((error) => { + // 'No data' 는 1차점 매핑 정보가 없을 뿐 — 2차점만 옵션 추가+select + const message = error?.response?.data?.message + if (message === 'No data') { + applyOtherSaleStore() + return + } + // 진짜 네트워크/서버 에러 swalFire({ - title: getMessage('stuff.detail.planReq.message.notMatch'), + title: getMessage('stuff.detail.planReq.message.networkError'), type: 'alert', icon: 'warning', }) @@ -1878,16 +1888,18 @@ export default function StuffDetail() { )) || null} - + {session?.storeId === 'T01' && ( + + )} @@ -2468,7 +2480,7 @@ export default function StuffDetail() { > ) : null} - {managementState?.tempFlg === '1' ? ( + {managementState?.tempFlg === '1' && session?.storeId === 'T01' ? ( <>