Compare commits

..

No commits in common. "2da7ea0c784b73484f75c654d0c0cf6770ac2772" and "00a201704b5346c60d894de4f6c0e1c6be37f09b" have entirely different histories.

View File

@ -13,7 +13,7 @@ import dayjs from 'dayjs'
import { useCommonCode } from '@/hooks/common/useCommonCode' import { useCommonCode } from '@/hooks/common/useCommonCode'
import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController' import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
import { SessionContext } from '@/app/SessionProvider' 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 { convertNumberToPriceDecimal, convertNumberToPriceDecimalToFixed } from '@/util/common-utils'
import ProductFeaturesPop from './popup/ProductFeaturesPop' import ProductFeaturesPop from './popup/ProductFeaturesPop'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
@ -504,8 +504,7 @@ export default function Estimate({}) {
saleStoreId: estimateContextState.sapSaleStoreId, saleStoreId: estimateContextState.sapSaleStoreId,
sapSalesStoreCd: estimateContextState.sapSalesStoreCd, sapSalesStoreCd: estimateContextState.sapSalesStoreCd,
docTpCd: estimateContextState.estimateType, docTpCd: estimateContextState.estimateType,
secSapSalesStoreCd: secSapSalesStoreCd:(estimateContextState.secSapSalesStoreCd?.length > 0 && showPriceCd === 'QSP_PRICE')? estimateContextState.secSapSalesStoreCd :'',
estimateContextState.secSapSalesStoreCd?.length > 0 && showPriceCd === 'QSP_PRICE' ? estimateContextState.secSapSalesStoreCd : '',
priceCd: showPriceCd, priceCd: showPriceCd,
itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0' && item.paDispOrder === null), itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0' && item.paDispOrder === null),
} }
@ -1221,17 +1220,19 @@ export default function Estimate({}) {
const [agencyCustList, setAgencyCustList] = useState([]) const [agencyCustList, setAgencyCustList] = useState([])
useEffect(() => { useEffect(() => {
// 952 - 2 sapSalesStoreCd // 952 - 2 sapSalesStoreCd
if (estimateContextState?.sapSalesStoreCd && session?.storeLvl === '1') { if(estimateContextState?.sapSalesStoreCd && session?.storeLvl === '1') {
const param = { const param = {
sapSalesStoreCd: estimateContextState.sapSalesStoreCd, sapSalesStoreCd: estimateContextState.sapSalesStoreCd,
} }
const apiUrl = `api/estimate/agency-cust-list?${queryStringFormatter(param)}` const apiUrl = `api/estimate/agency-cust-list?${queryStringFormatter(param)}`
get({ url: apiUrl }).then((res) => { get({ url: apiUrl }).then((res) => {
if (isNotEmptyArray(res?.data)) { if (isNotEmptyArray(res?.data)) {
setAgencyCustList(res?.data) setAgencyCustList(res?.data);
} }
}) })
} }
}, [estimateContextState?.sapSalesStoreCd]) }, [estimateContextState?.sapSalesStoreCd])
return ( return (
<div className="sub-content estimate"> <div className="sub-content estimate">
@ -1380,16 +1381,11 @@ export default function Estimate({}) {
<div className="form-flex-wrap"> <div className="form-flex-wrap">
<div className="radio-wrap"> <div className="radio-wrap">
{/*pkgRank is null, empty 인 경우 : 사용불가, 이전에 등록된 경우 사용가능, style로 제어*/} {/*pkgRank is null, empty 인 경우 : 사용불가, 이전에 등록된 경우 사용가능, style로 제어*/}
<div <div className="d-check-radio light mr10" style={{display:
className="d-check-radio light mr10" (isNotEmptyArray(storePriceList) > 0
style={{ && storePriceList[0].pkgRank !== null
display: && storePriceList[0].pkgRank !== ''
(isNotEmptyArray(storePriceList) > 0 && storePriceList[0].pkgRank !== null && storePriceList[0].pkgRank !== '') || || estimateContextState?.estimateType === 'YJSS') ? "" : "none"}}>
estimateContextState?.estimateType === 'YJSS'
? ''
: 'none',
}}
>
<input <input
type="radio" type="radio"
name="estimateType" name="estimateType"
@ -1419,37 +1415,35 @@ export default function Estimate({}) {
<label htmlFor="YJOD">{getMessage('estimate.detail.estimateType.yjod')}</label> <label htmlFor="YJOD">{getMessage('estimate.detail.estimateType.yjod')}</label>
</div> </div>
</div> </div>
{session?.storeLvl === '1' && agencyCustList.length > 0 ? ( { (session?.storeLvl === '1' && agencyCustList.length > 0 )? (
<div className="form-flex-select ml10"> <div className="form-flex-select ml10">
<label htmlFor="">{getMessage('estimate.detail.agency')}</label> <label htmlFor="">{getMessage('estimate.detail.agency')}</label>
<div className="select-wrap" style={{ width: '400px' }}> <div className="select-wrap" style={{ width: '400px' }}>
<Select <Select
id="agencyName" id="agencyName"
instanceId="agencyName" instanceId="agencyName"
className="react-select-custom" className="react-select-custom"
classNamePrefix="custom" classNamePrefix="custom"
placeholder="Select" placeholder="Select"
options={agencyCustList} options={agencyCustList}
onChange={(e) => { onChange={(e) => {
if (isObjectNotEmpty(e)) { if (isObjectNotEmpty(e)) {
setEstimateContextState({ secSapSalesStoreCd: e.sapSalesStoreCd }) setEstimateContextState({ secSapSalesStoreCd: e.sapSalesStoreCd })
} else { } else {
setEstimateContextState({ secSapSalesStoreCd: '' }) setEstimateContextState({ secSapSalesStoreCd: '' })
} }
}} }}
getOptionLabel={(x) => x.sapSalesStoreNm} getOptionLabel={(x) => x.sapSalesStoreNm}
getOptionValue={(x) => x.sapSalesStoreCd} getOptionValue={(x) => x.sapSalesStoreCd}
isClearable={true} isClearable={true}
isSearchable={true} isSearchable={true}
value={agencyCustList.filter(function (option) { value={agencyCustList.filter(function (option) {
return option.sapSalesStoreCd === estimateContextState.secSapSalesStoreCd return option.sapSalesStoreCd === estimateContextState.secSapSalesStoreCd
})} })}
/> />
</div> </div>
</div> </div>
) : ( ) : ('')}
''
)}
</div> </div>
</td> </td>
</tr> </tr>
@ -1938,12 +1932,16 @@ export default function Estimate({}) {
} }
}} }}
menuPlacement={'auto'} menuPlacement={'auto'}
getOptionLabel={(x) => x.itemName + ' (' + x.itemNo + ')'} getOptionLabel={(x) => x.itemName + " (" + x.itemNo + ")"}
getOptionValue={(x) => x.itemNo} getOptionValue={(x) => x.itemNo}
components={{ components={{
SingleValue: ({ children, ...props }) => { SingleValue:({children, ...props}) =>{
return <components.SingleValue {...props}>{props.data.itemName}</components.SingleValue> return (
}, <components.SingleValue{...props}>
{props.data.itemName}
</components.SingleValue>
)
}
}} }}
isClearable={false} isClearable={false}
isDisabled={!!item?.paDispOrder} isDisabled={!!item?.paDispOrder}
@ -1964,12 +1962,16 @@ export default function Estimate({}) {
placeholder="Select" placeholder="Select"
options={cableItemList} options={cableItemList}
menuPlacement={'auto'} menuPlacement={'auto'}
getOptionLabel={(x) => x.clRefChr3 + ' (' + x.clRefChr1 + ')'} getOptionLabel={(x) => x.clRefChr3 + " (" + x.clRefChr1 + ")"}
getOptionValue={(x) => x.clRefChr1} getOptionValue={(x) => x.clRefChr1}
components={{ components={{
SingleValue: ({ children, ...props }) => { SingleValue:({children, ...props}) =>{
return <components.SingleValue {...props}>{props.data.clRefChr3}</components.SingleValue> return (
}, <components.SingleValue{...props}>
{props.data.clRefChr3}
</components.SingleValue>
)
}
}} }}
isClearable={false} isClearable={false}
isDisabled={true} isDisabled={true}
@ -2025,11 +2027,7 @@ export default function Estimate({}) {
<input <input
type="text" type="text"
className="input-light al-r" className="input-light al-r"
value={ value={convertNumberToPriceDecimal(item?.showSalePrice === '0' ? null : item?.salePrice?.replaceAll(',', ''))}
item.openFlg === '1'
? 'OPEN'
: convertNumberToPriceDecimal(item?.showSalePrice === '0' ? null : item?.salePrice?.replaceAll(',', ''))
}
disabled={ disabled={
item.openFlg === '1' item.openFlg === '1'
? true ? true