견적서 상세

This commit is contained in:
basssy 2024-11-19 11:14:05 +09:00
parent bb84f31c64
commit cdc0480db8
2 changed files with 6 additions and 7 deletions

View File

@ -234,12 +234,12 @@ export default function Estimate({ params }) {
}
//Pricing
const handlePricing = async (priceCd) => {
const handlePricing = async (showPriceCd) => {
const param = {
saleStoreId: session.storeId,
sapSalesStoreCd: session.custCd,
docTpCd: state.estimateType,
priceCd: priceCd,
priceCd: showPriceCd,
//itemIdList: state.itemList, // delFlg 0..
itemIdList: state.itemList.filter((item) => item.delFlg === '0'),
}
@ -283,7 +283,7 @@ export default function Estimate({ params }) {
})
setState({
priceCd: priceCd,
priceCd: showPriceCd,
itemList: updateList,
})
@ -1030,7 +1030,7 @@ export default function Estimate({ params }) {
type="button"
className="btn-origin grey ml5"
onClick={() => {
handlePricing(state?.priceCd)
handlePricing(showPriceCd)
}}
>
{getMessage('estimate.detail.showPrice.pricingBtn')}

View File

@ -49,7 +49,7 @@ export const useEstimateController = (planNo) => {
const [state, setState] = useReducer(reducer, defaultEstimateData)
useEffect(() => {
if (!isLoading) {
if (planNo && !isLoading) {
if (objectRecoil.floorPlanObjectNo && planNo) {
fetchSetting()
}
@ -188,15 +188,14 @@ export const useEstimateController = (planNo) => {
// console.log('최종 남은 아이템정보:::', estimateData.itemList)
console.log('최종 정보::;', estimateData)
//drawingFlg null ????
//2. 상세데이터 저장
// return
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/save-estimate`, data: estimateData }).then((res) => {
console.log('res::::::::::::', res)
if (res.status === 201) {
console.log('201:::::::::')
alert(getMessage('estimate.detail.save.alertMsg'))
//어디로 보낼지
router.push(`/floor-plan/estimate/5/${estimateData.planNo}`)
}
})
}