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