fix : 파일 다운로드 기능 추가 확인 필요

This commit is contained in:
Yesol Choi
2025-06-02 14:39:57 +09:00
parent 392122f608
commit b184bdd886

View File

@@ -26,6 +26,7 @@ const params = reactive({
regNm: '', regNm: '',
regDt: '', regDt: '',
reason: '', reason: '',
contAtts: [],
page: 1, page: 1,
row: 10, row: 10,
flexColumn: [], flexColumn: [],
@@ -51,6 +52,7 @@ const completedPriceDataParams = reactive({
svyDt:'', svyDt:'',
reason:'', reason:'',
estimates: [], estimates: [],
contAtts: [],
page: 1, page: 1,
row: 5, row: 5,
}) })
@@ -100,7 +102,9 @@ function getDetailList(arg){
completedPriceDataParams.contAmt = arg.contAmt completedPriceDataParams.contAmt = arg.contAmt
// completedPriceDataParams.svyDt = arg.signDt 계약체결일 todo // completedPriceDataParams.svyDt = arg.signDt 계약체결일 todo
completedPriceDataParams.reason = arg.reason completedPriceDataParams.reason = arg.reason
params.contAtts = arg.contAtts
params.contStatCd = arg.contStatCd params.contStatCd = arg.contStatCd
} }
@@ -222,6 +226,15 @@ const onChangeSign = async() => {
loading.value = false loading.value = false
} }
} }
const onPrcsFileDownload = async (contNo: string, fileOrd: number, logiFnm: string) => {
const link = document.createElement('a')
link.href = `https://svcm.hmsn.ink/api/prcs/${contNo}/${fileOrd}` //todo
link.setAttribute('download', logiFnm)
link.setAttribute('target', '_blank')
document.body.appendChild(link)
link.click()
}
</script> </script>
<template> <template>
@@ -493,29 +506,28 @@ const onChangeSign = async() => {
<td>첨부파일</td> <td>첨부파일</td>
<td colspan="1"> <td colspan="1">
<VButton color="info" @click="showFileInputs = !showFileInputs"> <VButton color="info" @click="showFileInputs = !showFileInputs">
등록 첨부파일 확인
</VButton> </VButton>
</td> </td>
<td colspan="5"> <td colspan="5">
<!-- 첨부파일 입력영역: 등록 버튼 클릭 토글 --> <!-- 첨부파일 입력영역: 등록 버튼 클릭 토글 -->
<div v-if="showFileInputs" class="file-upload-list" style="margin-top:10px;"> <div v-if="showFileInputs" class="file-upload-list" style="margin-top:10px;">
<VField>
<VControl>
<div <div
v-for="(input, idx) in fileInputs" v-for="f in params.contAtts"
:key="idx" :key="f.logiFnm"
style="display: flex; align-items: center; margin-bottom: 8px;" class="content estimate-file-wrapper"
> >
<!-- 파일선택 --> <div class="estimate-file-name ml-2">
<label class="file-label" style="margin-right: 10px;"> {{ f.logiFnm }}{{" ("}}{{Math.ceil(f.size / 1024)}}kb{{")"}}
<input
type="file"
class="file-input"
@change="e => handleFileChange(e, idx)"
/>
<span class="file-cta">파일선택</span>
</label>
<span style="flex:1; margin-right: 10px;">{{ input.file ? input.file.name : '첨부된 파일 없음' }}</span>
<span style="flex:2; color: #666;">{{ input.description }}</span>
</div> </div>
<div>
<i class="fa fa-download estimate-file-download pr-2" @click="onPrcsFileDownload(f.contNo, f.fileOrd, f.logiFnm)" />
</div>
</div>
</VControl>
</VField>
</div> </div>
</td> </td>
</tr> </tr>