diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 11a67b59..64b0ffbb 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -13,7 +13,7 @@ import dayjs from 'dayjs' import { useCommonCode } from '@/hooks/common/useCommonCode' import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController' import { SessionContext } from '@/app/SessionProvider' -import Select, {components} from 'react-select' +import Select, { components } from 'react-select' import { convertNumberToPriceDecimal, convertNumberToPriceDecimalToFixed } from '@/util/common-utils' import ProductFeaturesPop from './popup/ProductFeaturesPop' import { v4 as uuidv4 } from 'uuid' @@ -504,7 +504,8 @@ export default function Estimate({}) { saleStoreId: estimateContextState.sapSaleStoreId, sapSalesStoreCd: estimateContextState.sapSalesStoreCd, docTpCd: estimateContextState.estimateType, - secSapSalesStoreCd:(estimateContextState.secSapSalesStoreCd?.length > 0 && showPriceCd === 'QSP_PRICE')? estimateContextState.secSapSalesStoreCd :'', + secSapSalesStoreCd: + estimateContextState.secSapSalesStoreCd?.length > 0 && showPriceCd === 'QSP_PRICE' ? estimateContextState.secSapSalesStoreCd : '', priceCd: showPriceCd, itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0' && item.paDispOrder === null), } @@ -1220,19 +1221,17 @@ export default function Estimate({}) { const [agencyCustList, setAgencyCustList] = useState([]) useEffect(() => { // 952 - 2차점 특가 sapSalesStoreCd - if(estimateContextState?.sapSalesStoreCd && session?.storeLvl === '1') { + if (estimateContextState?.sapSalesStoreCd && session?.storeLvl === '1') { const param = { sapSalesStoreCd: estimateContextState.sapSalesStoreCd, } const apiUrl = `api/estimate/agency-cust-list?${queryStringFormatter(param)}` get({ url: apiUrl }).then((res) => { if (isNotEmptyArray(res?.data)) { - setAgencyCustList(res?.data); + setAgencyCustList(res?.data) } - }) } - }, [estimateContextState?.sapSalesStoreCd]) return (
@@ -1381,11 +1380,16 @@ export default function Estimate({}) {
{/*pkgRank is null, empty 인 경우 : 사용불가, 이전에 등록된 경우 사용가능, style로 제어*/} -
0 - && storePriceList[0].pkgRank !== null - && storePriceList[0].pkgRank !== '' - || estimateContextState?.estimateType === 'YJSS') ? "" : "none"}}> +
0 && storePriceList[0].pkgRank !== null && storePriceList[0].pkgRank !== '') || + estimateContextState?.estimateType === 'YJSS' + ? '' + : 'none', + }} + > {getMessage('estimate.detail.estimateType.yjod')}
- { (session?.storeLvl === '1' && agencyCustList.length > 0 )? ( -
- -
- { + if (isObjectNotEmpty(e)) { + setEstimateContextState({ secSapSalesStoreCd: e.sapSalesStoreCd }) + } else { + setEstimateContextState({ secSapSalesStoreCd: '' }) + } + }} + getOptionLabel={(x) => x.sapSalesStoreNm} + getOptionValue={(x) => x.sapSalesStoreCd} + isClearable={true} + isSearchable={true} + value={agencyCustList.filter(function (option) { + return option.sapSalesStoreCd === estimateContextState.secSapSalesStoreCd + })} + /> +
+
+ ) : ( + '' + )}
@@ -1932,16 +1938,12 @@ export default function Estimate({}) { } }} menuPlacement={'auto'} - getOptionLabel={(x) => x.itemName + " (" + x.itemNo + ")"} + getOptionLabel={(x) => x.itemName + ' (' + x.itemNo + ')'} getOptionValue={(x) => x.itemNo} components={{ - SingleValue:({children, ...props}) =>{ - return ( - - {props.data.itemName} - - ) - } + SingleValue: ({ children, ...props }) => { + return {props.data.itemName} + }, }} isClearable={false} isDisabled={!!item?.paDispOrder} @@ -1962,16 +1964,12 @@ export default function Estimate({}) { placeholder="Select" options={cableItemList} menuPlacement={'auto'} - getOptionLabel={(x) => x.clRefChr3 + " (" + x.clRefChr1 + ")"} + getOptionLabel={(x) => x.clRefChr3 + ' (' + x.clRefChr1 + ')'} getOptionValue={(x) => x.clRefChr1} components={{ - SingleValue:({children, ...props}) =>{ - return ( - - {props.data.clRefChr3} - - ) - } + SingleValue: ({ children, ...props }) => { + return {props.data.clRefChr3} + }, }} isClearable={false} isDisabled={true} @@ -2027,7 +2025,11 @@ export default function Estimate({}) {