Merge Q-CAST-III-MR-307: 견적서 문서다운로드
This commit is contained in:
commit
2c1aa1f887
@ -13,13 +13,12 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
const [schDownload, setSchDownload] = useState('EXCEL')
|
const [schDownload, setSchDownload] = useState('EXCEL')
|
||||||
//다운로드 파일 EXCEL
|
//다운로드 파일 EXCEL
|
||||||
const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0')
|
const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0')
|
||||||
|
|
||||||
//견적제출서 표시명
|
//견적제출서 표시명
|
||||||
const [schDisplayFlg, setSchSchDisplayFlg] = useState('0')
|
const [schDisplayFlg, setSchSchDisplayFlg] = useState('0')
|
||||||
//가대 중량표 포함
|
//가대 중량표 포함(포함:1 미포함 : 0)
|
||||||
const [schWeightFlg, setSchWeightFlg] = useState('0')
|
const [schWeightFlg, setSchWeightFlg] = useState('1')
|
||||||
//도면/시뮬레이션 파일 포함
|
//도면/시뮬레이션 파일 포함(포함:1 미포함 : 0)
|
||||||
const [schDrawingFlg, setSchDrawingFlg] = useState('0')
|
const [schDrawingFlg, setSchDrawingFlg] = useState('1')
|
||||||
|
|
||||||
// recoil 물건번호
|
// recoil 물건번호
|
||||||
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
||||||
@ -48,22 +47,22 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
schDrawingFlg: schDrawingFlg,
|
schDrawingFlg: schDrawingFlg,
|
||||||
}
|
}
|
||||||
const options = { responseType: 'blob' }
|
const options = { responseType: 'blob' }
|
||||||
let fileName
|
|
||||||
console.log('다운로드 PARAM:::', params)
|
|
||||||
await promisePost({ url: url, data: params, option: options })
|
await promisePost({ url: url, data: params, option: options })
|
||||||
.then((resultData) => {
|
.then((resultData) => {
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
console.log('결과::::::', resultData)
|
let fileName = 'unknow'
|
||||||
const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' })
|
const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' })
|
||||||
const fileUrl = window.URL.createObjectURL(blob)
|
const fileUrl = window.URL.createObjectURL(blob)
|
||||||
|
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.href = fileUrl
|
link.href = fileUrl
|
||||||
|
|
||||||
if (schDownload === 'EXCEL') {
|
//서버에서 내려오는 파일명
|
||||||
fileName = 'EXCEL_DOWN.xlsx'
|
const contentDisposition = resultData.headers['content-disposition']
|
||||||
} else {
|
if (contentDisposition) {
|
||||||
fileName = 'PDF_DOWN.pdf'
|
fileName = contentDisposition.split('filename=')[1].replace(/['"]/g, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
link.download = fileName
|
link.download = fileName
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
@ -211,19 +210,6 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
<td>
|
<td>
|
||||||
<div className="form-flex-wrap">
|
<div className="form-flex-wrap">
|
||||||
<div className="d-check-radio light mr10">
|
<div className="d-check-radio light mr10">
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="schWeightFlg"
|
|
||||||
id="schWeightFlg0"
|
|
||||||
value={'0'}
|
|
||||||
checked={schWeightFlg === '0'}
|
|
||||||
onChange={(e) => {
|
|
||||||
setSchWeightFlg(e.target.value)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<label htmlFor="schWeightFlg0">{getMessage('estimate.detail.docPopup.schWeightFlg.schWeightFlg0')}</label>
|
|
||||||
</div>
|
|
||||||
<div className="d-check-radio light">
|
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="schWeightFlg"
|
name="schWeightFlg"
|
||||||
@ -236,6 +222,19 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
/>
|
/>
|
||||||
<label htmlFor="schWeightFlg1">{getMessage('estimate.detail.docPopup.schWeightFlg.schWeightFlg1')}</label>
|
<label htmlFor="schWeightFlg1">{getMessage('estimate.detail.docPopup.schWeightFlg.schWeightFlg1')}</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="d-check-radio light">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="schWeightFlg"
|
||||||
|
id="schWeightFlg0"
|
||||||
|
value={'0'}
|
||||||
|
checked={schWeightFlg === '0'}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSchWeightFlg(e.target.value)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label htmlFor="schWeightFlg0">{getMessage('estimate.detail.docPopup.schWeightFlg.schWeightFlg0')}</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -244,6 +243,19 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
<td>
|
<td>
|
||||||
<div className="form-flex-wrap">
|
<div className="form-flex-wrap">
|
||||||
<div className="d-check-radio light mr10">
|
<div className="d-check-radio light mr10">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="schDrawingFlg"
|
||||||
|
id="schDrawingFlg1"
|
||||||
|
value={'1'}
|
||||||
|
checked={schDrawingFlg === '1'}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSchDrawingFlg(e.target.value)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label htmlFor="schDrawingFlg1">{getMessage('estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1')}</label>
|
||||||
|
</div>
|
||||||
|
<div className="d-check-radio light">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="schDrawingFlg"
|
name="schDrawingFlg"
|
||||||
@ -256,19 +268,6 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
|||||||
/>
|
/>
|
||||||
<label htmlFor="schDrawingFlg0">{getMessage('estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0')}</label>
|
<label htmlFor="schDrawingFlg0">{getMessage('estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0')}</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="d-check-radio light">
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="schDrawingFlg"
|
|
||||||
id="schDrawingFlg01"
|
|
||||||
value={'1'}
|
|
||||||
checked={schDrawingFlg === '1'}
|
|
||||||
onChange={(e) => {
|
|
||||||
setSchDrawingFlg(e.target.value)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<label htmlFor="schDrawingFlg01">{getMessage('estimate.detail.docPopup.schDrawingFlg.schDrawingFlg1')}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -868,11 +868,11 @@
|
|||||||
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "販売店名",
|
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "販売店名",
|
||||||
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1": "案件名",
|
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1": "案件名",
|
||||||
"estimate.detail.docPopup.schWeightFlg": "架台重量表を含む",
|
"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": "図面/シミュレーションファイルを含む",
|
||||||
"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.close": "閉じる",
|
||||||
"estimate.detail.docPopup.docDownload": "文書のダウンロード",
|
"estimate.detail.docPopup.docDownload": "文書のダウンロード",
|
||||||
"estimate.detail.productFeaturesPopup.title": "製品特異事項",
|
"estimate.detail.productFeaturesPopup.title": "製品特異事項",
|
||||||
|
|||||||
@ -878,11 +878,11 @@
|
|||||||
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "판매점명",
|
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "판매점명",
|
||||||
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1": "안건명",
|
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1": "안건명",
|
||||||
"estimate.detail.docPopup.schWeightFlg": "가대 중량표 포함",
|
"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": "도면/시뮬레이션 파일 포함",
|
||||||
"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.close": "닫기",
|
||||||
"estimate.detail.docPopup.docDownload": "문서 다운로드",
|
"estimate.detail.docPopup.docDownload": "문서 다운로드",
|
||||||
"estimate.detail.productFeaturesPopup.title": "제품특이사항",
|
"estimate.detail.productFeaturesPopup.title": "제품특이사항",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user