diff --git a/src/components/estimate/popup/DocDownOptionPop.jsx b/src/components/estimate/popup/DocDownOptionPop.jsx index 139f6f7b..128b2dd0 100644 --- a/src/components/estimate/popup/DocDownOptionPop.jsx +++ b/src/components/estimate/popup/DocDownOptionPop.jsx @@ -13,13 +13,12 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) { const [schDownload, setSchDownload] = useState('EXCEL') //다운로드 파일 EXCEL const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0') - //견적제출서 표시명 const [schDisplayFlg, setSchSchDisplayFlg] = useState('0') - //가대 중량표 포함 - const [schWeightFlg, setSchWeightFlg] = useState('0') - //도면/시뮬레이션 파일 포함 - const [schDrawingFlg, setSchDrawingFlg] = useState('0') + //가대 중량표 포함(포함:1 미포함 : 0) + const [schWeightFlg, setSchWeightFlg] = useState('1') + //도면/시뮬레이션 파일 포함(포함:1 미포함 : 0) + const [schDrawingFlg, setSchDrawingFlg] = useState('1') // recoil 물건번호 const objectRecoil = useRecoilValue(floorPlanObjectState) @@ -48,22 +47,22 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) { schDrawingFlg: schDrawingFlg, } const options = { responseType: 'blob' } - let fileName - console.log('다운로드 PARAM:::', params) await promisePost({ url: url, data: params, option: options }) .then((resultData) => { if (resultData) { - console.log('결과::::::', resultData) + let fileName = 'unknow' const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' }) const fileUrl = window.URL.createObjectURL(blob) + const link = document.createElement('a') link.href = fileUrl - if (schDownload === 'EXCEL') { - fileName = 'EXCEL_DOWN.xlsx' - } else { - fileName = 'PDF_DOWN.pdf' + //서버에서 내려오는 파일명 + const contentDisposition = resultData.headers['content-disposition'] + if (contentDisposition) { + fileName = contentDisposition.split('filename=')[1].replace(/['"]/g, '') } + link.download = fileName document.body.appendChild(link) link.click() @@ -211,19 +210,6 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
- { - setSchWeightFlg(e.target.value) - }} - /> - -
-
+
+ { + setSchWeightFlg(e.target.value) + }} + /> + +
@@ -244,6 +243,19 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
+ { + setSchDrawingFlg(e.target.value) + }} + /> + +
+
-
- { - setSchDrawingFlg(e.target.value) - }} - /> - -
diff --git a/src/locales/ja.json b/src/locales/ja.json index 6889f39e..d5165248 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -868,11 +868,11 @@ "estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "販売店名", "estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1": "案件名", "estimate.detail.docPopup.schWeightFlg": "架台重量表を含む", - "estimate.detail.docPopup.schWeightFlg.schWeightFlg0": "含む", - "estimate.detail.docPopup.schWeightFlg.schWeightFlg1": "含まない", + "estimate.detail.docPopup.schWeightFlg.schWeightFlg1": "含む", + "estimate.detail.docPopup.schWeightFlg.schWeightFlg0": "含まない", "estimate.detail.docPopup.schDrawingFlg": "図面/シミュレーションファイルを含む", - "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0": "含む", - "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "含まない", + "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "含む", + "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0": "含まない", "estimate.detail.docPopup.close": "閉じる", "estimate.detail.docPopup.docDownload": "文書のダウンロード", "estimate.detail.productFeaturesPopup.title": "製品特異事項", diff --git a/src/locales/ko.json b/src/locales/ko.json index 2916c9ed..15fbe6f5 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -878,11 +878,11 @@ "estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "판매점명", "estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1": "안건명", "estimate.detail.docPopup.schWeightFlg": "가대 중량표 포함", - "estimate.detail.docPopup.schWeightFlg.schWeightFlg0": "포함", - "estimate.detail.docPopup.schWeightFlg.schWeightFlg1": "미포함", + "estimate.detail.docPopup.schWeightFlg.schWeightFlg1": "포함", + "estimate.detail.docPopup.schWeightFlg.schWeightFlg0": "미포함", "estimate.detail.docPopup.schDrawingFlg": "도면/시뮬레이션 파일 포함", - "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0": "포함", - "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "미포함", + "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1": "포함", + "estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0": "미포함", "estimate.detail.docPopup.close": "닫기", "estimate.detail.docPopup.docDownload": "문서 다운로드", "estimate.detail.productFeaturesPopup.title": "제품특이사항",