diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index a3a0a607..12eef9ff 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -1046,6 +1046,33 @@ export default function StuffDetail() { form.setValue('otherSaleStoreId', info.saleStoreId) form.setValue('otherSaleStoreName', info.saleStoreName) form.setValue('otherSaleStoreLevel', info.saleStoreLevel) + get({ url: `/api/object/saleStore/${info.saleStoreId}/firstAgent` }).then((res) => { + 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', '') + }) } } diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx index 2714a4e4..25df22f0 100644 --- a/src/components/management/popup/PlanRequestPop.jsx +++ b/src/components/management/popup/PlanRequestPop.jsx @@ -11,7 +11,7 @@ import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils' import QPagination from '@/components/common/pagination/QPagination' import { useSwal } from '@/hooks/useSwal' import { QcastContext } from '@/app/QcastProvider' -import { sanitizeDecimalInputEvent } from '@/util/input-utils' +import { sanitizeDecimalInputEvent, sanitizeIntegerInputEvent } from '@/util/input-utils' export default function PlanRequestPop(props) { const [pageNo, setPageNo] = useState(1) //현재 페이지 번호 @@ -212,6 +212,7 @@ export default function PlanRequestPop(props) { //설계의뢰 그리드에서 선택한 설계의뢰 정보 const getSelectedRowdata = (data) => { if (isNotEmptyArray(data)) { + console.log('planReqObject fields:', data[0]) setPlanReqObject(data[0]) } else { setPlanReqObject({})