견적서 문서다운로드
This commit is contained in:
parent
d780380ba1
commit
071091135b
@ -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 }) {
|
||||
<td>
|
||||
<div className="form-flex-wrap">
|
||||
<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
|
||||
type="radio"
|
||||
name="schWeightFlg"
|
||||
@ -236,6 +222,19 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
||||
/>
|
||||
<label htmlFor="schWeightFlg1">{getMessage('estimate.detail.docPopup.schWeightFlg.schWeightFlg1')}</label>
|
||||
</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>
|
||||
</td>
|
||||
</tr>
|
||||
@ -244,6 +243,19 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
||||
<td>
|
||||
<div className="form-flex-wrap">
|
||||
<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
|
||||
type="radio"
|
||||
name="schDrawingFlg"
|
||||
@ -256,19 +268,6 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
|
||||
/>
|
||||
<label htmlFor="schDrawingFlg0">{getMessage('estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0')}</label>
|
||||
</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>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -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": "製品特異事項",
|
||||
|
||||
@ -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": "제품특이사항",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user