feat(calculate): 정산 페이지 엑셀 다운로드 방식 수정

- vue-excel-xlsx 사용방식에서 API 호출 방식으로 변경
This commit is contained in:
Yu Sung
2026-03-05 13:50:35 +09:00
parent dfcc746738
commit c9f49a208a
9 changed files with 248 additions and 442 deletions

View File

@@ -35,7 +35,7 @@
<v-col cols="2">
<v-btn
block
color="#9970ff"
color="#3bb9f1"
dark
depressed
@click="getCalculateContent"
@@ -48,22 +48,15 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="downloadExcel"
>
<v-btn
block
color="#9970ff"
dark
depressed
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
엑셀 다운로드
</v-btn>
</v-col>
</v-row>
<v-row>
@@ -144,60 +137,6 @@ export default {
start_date: null,
end_date: null,
items: [],
columns: [
{
label: '판매일',
field: 'saleDate',
},
{
label: '크리에이터',
field: 'nickname',
},
{
label: '제목',
field: 'title',
},
{
label: '구분',
field: 'orderType',
},
{
label: '판매금액(캔)',
field: 'orderPrice',
},
{
label: '판매수',
field: 'numberOfPeople',
},
{
label: '합계(캔)',
field: 'totalCan',
},
{
label: '원화',
field: 'totalKrw',
},
{
label: '수수료\n(6.6%)',
field: 'paymentFee',
},
{
label: '정산금액',
field: 'settlementAmount',
},
{
label: '원천세\n(3.3%)',
field: 'tax',
},
{
label: '입금액',
field: 'depositAmount',
},
{
label: '등록일',
field: 'registrationDate',
},
],
headers: [
{
text: '판매일',
@@ -333,6 +272,21 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateContentExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '콘텐츠정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}