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: '',
regDt: '',
reason: '',
contAtts: [],
page: 1,
row: 10,
flexColumn: [],
@@ -51,6 +52,7 @@ const completedPriceDataParams = reactive({
svyDt:'',
reason:'',
estimates: [],
contAtts: [],
page: 1,
row: 5,
})
@@ -100,7 +102,9 @@ function getDetailList(arg){
completedPriceDataParams.contAmt = arg.contAmt
// completedPriceDataParams.svyDt = arg.signDt 계약체결일 todo
completedPriceDataParams.reason = arg.reason
params.contAtts = arg.contAtts
params.contStatCd = arg.contStatCd
}
@@ -222,6 +226,15 @@ const onChangeSign = async() => {
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>
<template>
@@ -493,29 +506,28 @@ const onChangeSign = async() => {
<td>첨부파일</td>
<td colspan="1">
<VButton color="info" @click="showFileInputs = !showFileInputs">
등록
첨부파일 확인
</VButton>
</td>
<td colspan="5">
<!-- 첨부파일 입력영역: 등록 버튼 클릭 토글 -->
<div v-if="showFileInputs" class="file-upload-list" style="margin-top:10px;">
<div
v-for="(input, idx) in fileInputs"
:key="idx"
style="display: flex; align-items: center; margin-bottom: 8px;"
>
<!-- 파일선택 -->
<label class="file-label" style="margin-right: 10px;">
<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>
<VField>
<VControl>
<div
v-for="f in params.contAtts"
:key="f.logiFnm"
class="content estimate-file-wrapper"
>
<div class="estimate-file-name ml-2">
{{ f.logiFnm }}{{" ("}}{{Math.ceil(f.size / 1024)}}kb{{")"}}
</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>
</td>
</tr>