feat(calculate): 정산 페이지 엑셀 다운로드 방식 수정
- vue-excel-xlsx 사용방식에서 API 호출 방식으로 변경
This commit is contained in:
@@ -47,22 +47,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="#3bb9f1"
|
||||
dark
|
||||
depressed
|
||||
>
|
||||
엑셀 다운로드
|
||||
</v-btn>
|
||||
</vue-excel-xlsx>
|
||||
엑셀 다운로드
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -156,40 +149,6 @@ export default {
|
||||
page_size: 20,
|
||||
total_page: 0,
|
||||
items: [],
|
||||
columns: [
|
||||
{
|
||||
label: "이메일",
|
||||
field: "email",
|
||||
},
|
||||
{
|
||||
label: "크리에이터",
|
||||
field: "nickname",
|
||||
},
|
||||
{
|
||||
label: "합계(캔)",
|
||||
field: "totalCan",
|
||||
},
|
||||
{
|
||||
label: "원화",
|
||||
field: "totalKrw",
|
||||
},
|
||||
{
|
||||
label: "결제수수료(6.6%)",
|
||||
field: "paymentFee",
|
||||
},
|
||||
{
|
||||
label: "정산금액",
|
||||
field: "settlementAmount",
|
||||
},
|
||||
{
|
||||
label: "원천세(3.3%)",
|
||||
field: "tax",
|
||||
},
|
||||
{
|
||||
label: "입금액",
|
||||
field: "depositAmount",
|
||||
},
|
||||
],
|
||||
headers: [
|
||||
{
|
||||
text: '이메일',
|
||||
@@ -309,6 +268,21 @@ export default {
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async downloadExcel() {
|
||||
try {
|
||||
const res = await api.downloadCalculateLiveByCreatorExcel(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('엑셀 다운로드 중 오류가 발생했습니다.')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user