#900 YJSS
This commit is contained in:
parent
3762b6b81e
commit
20b90d0df6
@ -480,10 +480,6 @@ export default function Estimate({}) {
|
||||
|
||||
//Pricing 버튼
|
||||
const handlePricing = async (showPriceCd) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
const param = {
|
||||
saleStoreId: session.storeId,
|
||||
sapSalesStoreCd: session.custCd,
|
||||
@ -699,14 +695,10 @@ export default function Estimate({}) {
|
||||
|
||||
/* 케이블 select 변경시 */
|
||||
const onChangeDisplayCableItem = (value, itemList) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
itemList.map((item, index) => {
|
||||
if (item.dispCableFlg === '1') {
|
||||
if (value !== '') {
|
||||
onChangeDisplayItem(value, item.dispOrder, index)
|
||||
onChangeDisplayItem(value, item.dispOrder, index, true)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -714,11 +706,7 @@ export default function Estimate({}) {
|
||||
}
|
||||
|
||||
// 아이템 자동완성 검색시 아이템 추가/변경시
|
||||
const onChangeDisplayItem = (itemId, dispOrder, index) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
const onChangeDisplayItem = (itemId, dispOrder, index, flag) => {
|
||||
const param = {
|
||||
itemId: itemId,
|
||||
coldZoneFlg: estimateContextState?.coldRegionFlg,
|
||||
@ -748,7 +736,7 @@ export default function Estimate({}) {
|
||||
updates.itemGroup = res.itemGroup
|
||||
updates.delFlg = '0' // 삭제플래그 0
|
||||
updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString()
|
||||
updates.amount = ''
|
||||
updates.amount = flag ? estimateContextState.itemList[index].amount : ''
|
||||
updates.openFlg = res.openFlg
|
||||
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
@ -1032,7 +1020,6 @@ export default function Estimate({}) {
|
||||
})
|
||||
let dispCableFlgCnt = 0
|
||||
estimateContextState.itemList.forEach((item) => {
|
||||
// console.log('YJSS::::::::', item)
|
||||
if (item.delFlg === '0') {
|
||||
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
||||
let salePrice
|
||||
@ -1068,7 +1055,6 @@ export default function Estimate({}) {
|
||||
}
|
||||
|
||||
if (item.dispCableFlg === '1') {
|
||||
// console.log('YJSS22222::::::::', item)
|
||||
dispCableFlgCnt++
|
||||
setCableItem(item.itemId)
|
||||
}
|
||||
@ -1356,7 +1342,7 @@ export default function Estimate({}) {
|
||||
</th>
|
||||
<td colSpan={3}>
|
||||
<div className="radio-wrap">
|
||||
{/* <div className="d-check-radio light mr10">
|
||||
<div className="d-check-radio light mr10">
|
||||
<input
|
||||
type="radio"
|
||||
name="estimateType"
|
||||
@ -1370,7 +1356,7 @@ export default function Estimate({}) {
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="YJSS">{getMessage('estimate.detail.estimateType.yjss')}</label>
|
||||
</div> */}
|
||||
</div>
|
||||
<div className="d-check-radio light">
|
||||
<input
|
||||
type="radio"
|
||||
@ -1379,8 +1365,7 @@ export default function Estimate({}) {
|
||||
value={'YJOD'}
|
||||
checked={estimateContextState?.estimateType === 'YJOD' ? true : false}
|
||||
onChange={(e) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 주석풀기
|
||||
// setHandlePricingFlag(true)
|
||||
setHandlePricingFlag(true)
|
||||
setEstimateContextState({ estimateType: e.target.value })
|
||||
}}
|
||||
/>
|
||||
@ -1677,9 +1662,8 @@ export default function Estimate({}) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* //todo: 추후 YJSS가 다시 나타날 경우 주석 풀기 */}
|
||||
{/* YJOD면 아래영역 숨김 */}
|
||||
{/* <div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}>
|
||||
<div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style={{ width: '160px' }} />
|
||||
@ -1714,7 +1698,7 @@ export default function Estimate({}) {
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> */}
|
||||
</div>
|
||||
{/* 제품정보 끝 */}
|
||||
{/* 가격표시영역시작 */}
|
||||
<div className="estimate-product-option">
|
||||
@ -1871,7 +1855,7 @@ export default function Estimate({}) {
|
||||
options={originDisplayItemList}
|
||||
onChange={(e) => {
|
||||
if (isObjectNotEmpty(e)) {
|
||||
onChangeDisplayItem(e.itemId, item.dispOrder, index)
|
||||
onChangeDisplayItem(e.itemId, item.dispOrder, index, false)
|
||||
}
|
||||
}}
|
||||
menuPlacement={'auto'}
|
||||
@ -1895,11 +1879,6 @@ export default function Estimate({}) {
|
||||
classNamePrefix="custom"
|
||||
placeholder="Select"
|
||||
options={cableItemList}
|
||||
onChange={(e) => {
|
||||
if (isObjectNotEmpty(e)) {
|
||||
onChangeDisplayItem(e.clRefChr1, item.dispOrder, index)
|
||||
}
|
||||
}}
|
||||
menuPlacement={'auto'}
|
||||
getOptionLabel={(x) => x.clRefChr3}
|
||||
getOptionValue={(x) => x.clRefChr1}
|
||||
|
||||
@ -365,11 +365,6 @@ export default function CanvasMenu(props) {
|
||||
|
||||
// 견적서 초기화 버튼
|
||||
const handleEstimateReset = () => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateRecoilState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
swalFire({
|
||||
text: getMessage('estimate.detail.reset.confirmMsg'),
|
||||
type: 'confirm',
|
||||
|
||||
@ -371,6 +371,7 @@ export default function StuffDetail() {
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||
type: 'alert',
|
||||
icon: 'error',
|
||||
confirmFn: () => {
|
||||
router.push('/management/stuff', { scroll: false })
|
||||
},
|
||||
@ -388,6 +389,7 @@ export default function StuffDetail() {
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||
type: 'alert',
|
||||
icon: 'error',
|
||||
confirmFn: () => {
|
||||
router.push('/management/stuff', { scroll: false })
|
||||
},
|
||||
|
||||
@ -166,11 +166,6 @@ export const useEstimateController = (planNo, flag) => {
|
||||
|
||||
//견적서 저장
|
||||
const handleEstimateSubmit = async () => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateData.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
//0. 필수체크
|
||||
let flag = true
|
||||
let originFileFlg = false
|
||||
@ -300,6 +295,19 @@ export const useEstimateController = (planNo, flag) => {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//견적서를 복사하면 API에서 봄컴포넌트는 salePrice, unitPrice를 0으로 내려옴..front에서 처리
|
||||
if (item.salePrice === null) {
|
||||
item.salePrice = '0'
|
||||
} else if (isNaN(item.salePrice)) {
|
||||
item.salePrice = '0'
|
||||
}
|
||||
|
||||
if (item.unitPrice === null) {
|
||||
item.unitPrice = '0'
|
||||
} else if (isNaN(item.unitPrice)) {
|
||||
item.unitPrice = '0'
|
||||
}
|
||||
|
||||
//봄 컴포넌트 제품은 0으로
|
||||
item.openFlg = '0'
|
||||
}
|
||||
@ -386,6 +394,7 @@ export const useEstimateController = (planNo, flag) => {
|
||||
|
||||
estimateData.estimateOption = estimateOptions
|
||||
// console.log('최종아이템:::', estimateData.itemList)
|
||||
|
||||
if (fileList?.length > 0) {
|
||||
estimateData.fileList = fileList
|
||||
} else {
|
||||
@ -413,7 +422,7 @@ export const useEstimateController = (planNo, flag) => {
|
||||
})
|
||||
} catch (e) {
|
||||
setIsGlobalLoading(false)
|
||||
console.log('error::::::::::::', e.response.data.message)
|
||||
console.error('error::::::::::::', e.response.data.message)
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,10 +432,6 @@ export const useEstimateController = (planNo, flag) => {
|
||||
* T01관리자 계정 및 1차판매점에게만 제공
|
||||
*/
|
||||
const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId, setEstimateCopyPopupOpen) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateData.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
if (saleStoreId === '') {
|
||||
return swalFire({
|
||||
text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user