채널 후원 정산 페이지 추가
This commit is contained in:
@@ -57,6 +57,12 @@ async function getCalculateCommunityByCreator(startDate, endDate, page, size) {
|
||||
)
|
||||
}
|
||||
|
||||
async function getCalculateChannelDonationByCreator(startDate, endDate, page, size) {
|
||||
return Vue.axios.get('/admin/calculate/channel-donation-by-creator?startDateStr=' +
|
||||
startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size
|
||||
)
|
||||
}
|
||||
|
||||
async function updateCreatorSettlementRatio(creatorSettlementRatio) {
|
||||
const request = {
|
||||
memberId: creatorSettlementRatio.creator_id,
|
||||
@@ -84,5 +90,6 @@ export {
|
||||
deleteCreatorSettlementRatio,
|
||||
getCalculateLiveByCreator,
|
||||
getCalculateContentByCreator,
|
||||
getCalculateCommunityByCreator
|
||||
getCalculateCommunityByCreator,
|
||||
getCalculateChannelDonationByCreator
|
||||
}
|
||||
|
||||
@@ -149,6 +149,26 @@ export default {
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
// 정산 관리 메뉴에 '채널 후원 정산' 추가
|
||||
try {
|
||||
const calculateMenu = this.items.find(m => m && m.title === '정산 관리')
|
||||
if (calculateMenu) {
|
||||
if (!Array.isArray(calculateMenu.items)) {
|
||||
calculateMenu.items = calculateMenu.items ? [].concat(calculateMenu.items) : []
|
||||
}
|
||||
const exists = calculateMenu.items.some(ci => ci && ci.route === '/calculate/channel-donation')
|
||||
if (!exists) {
|
||||
calculateMenu.items.push({
|
||||
title: '채널 후원 정산',
|
||||
route: '/calculate/channel-donation',
|
||||
items: null
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
} else {
|
||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
||||
this.logout();
|
||||
|
||||
@@ -210,6 +210,11 @@ const routes = [
|
||||
name: 'CalculateCommunityByCreator',
|
||||
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateCommunityByCreator.vue')
|
||||
},
|
||||
{
|
||||
path: '/calculate/channel-donation',
|
||||
name: 'CalculateChannelDonation',
|
||||
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateChannelDonation.vue')
|
||||
},
|
||||
{
|
||||
path: '/notice',
|
||||
name: 'NoticeView',
|
||||
|
||||
267
src/views/Calculate/CalculateChannelDonation.vue
Normal file
267
src/views/Calculate/CalculateChannelDonation.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar dark>
|
||||
<v-spacer />
|
||||
<v-toolbar-title>채널 후원 정산</v-toolbar-title>
|
||||
<v-spacer />
|
||||
</v-toolbar>
|
||||
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="2">
|
||||
<datetime
|
||||
v-model="start_date"
|
||||
class="datepicker"
|
||||
format="YYYY-MM-DD"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="1">
|
||||
~
|
||||
</v-col>
|
||||
|
||||
<v-col cols="2">
|
||||
<datetime
|
||||
v-model="end_date"
|
||||
class="datepicker"
|
||||
format="YYYY-MM-DD"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="1" />
|
||||
|
||||
<v-col cols="2">
|
||||
<v-btn
|
||||
block
|
||||
color="#3bb9f1"
|
||||
dark
|
||||
depressed
|
||||
@click="getCalculateChannelDonationByCreator"
|
||||
>
|
||||
조회
|
||||
</v-btn>
|
||||
</v-col>
|
||||
|
||||
<v-spacer />
|
||||
|
||||
<v-col cols="2">
|
||||
<vue-excel-xlsx
|
||||
:data="items"
|
||||
:columns="excelColumns"
|
||||
:file-name="'채널후원정산'"
|
||||
:file-type="'xlsx'"
|
||||
:sheet-name="'정산'"
|
||||
>
|
||||
<v-btn
|
||||
block
|
||||
color="#3bb9f1"
|
||||
dark
|
||||
depressed
|
||||
>
|
||||
엑셀 다운로드
|
||||
</v-btn>
|
||||
</vue-excel-xlsx>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="items"
|
||||
:loading="is_loading"
|
||||
:items-per-page="-1"
|
||||
class="elevation-1"
|
||||
hide-default-footer
|
||||
>
|
||||
<template slot="body.prepend">
|
||||
<tr v-if="total">
|
||||
<td colspan="2">
|
||||
합계
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.count.toLocaleString() }} 건
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.totalCan.toLocaleString() }} 캔
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.krw.toLocaleString() }} 원
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.fee.toLocaleString() }} 원
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.settlementAmount.toLocaleString() }} 원
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.withholdingTax.toLocaleString() }} 원
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ total.depositAmount.toLocaleString() }} 원
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:item.date="{ item }">
|
||||
{{ item.date }}
|
||||
</template>
|
||||
|
||||
<template v-slot:item.creator="{ item }">
|
||||
{{ item.creator }}
|
||||
</template>
|
||||
|
||||
<template v-slot:item.count="{ item }">
|
||||
{{ item.count.toLocaleString() }} 건
|
||||
</template>
|
||||
|
||||
<template v-slot:item.totalCan="{ item }">
|
||||
{{ item.totalCan.toLocaleString() }} 캔
|
||||
</template>
|
||||
|
||||
<template v-slot:item.krw="{ item }">
|
||||
{{ item.krw.toLocaleString() }} 원
|
||||
</template>
|
||||
|
||||
<template v-slot:item.fee="{ item }">
|
||||
{{ item.fee.toLocaleString() }} 원
|
||||
</template>
|
||||
|
||||
<template v-slot:item.settlementAmount="{ item }">
|
||||
{{ item.settlementAmount.toLocaleString() }} 원
|
||||
</template>
|
||||
|
||||
<template v-slot:item.withholdingTax="{ item }">
|
||||
{{ item.withholdingTax.toLocaleString() }} 원
|
||||
</template>
|
||||
|
||||
<template v-slot:item.depositAmount="{ item }">
|
||||
{{ item.depositAmount.toLocaleString() }} 원
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="total_page"
|
||||
:total-visible="7"
|
||||
@input="next"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as api from '@/api/calculate'
|
||||
import datetime from 'vuejs-datetimepicker'
|
||||
|
||||
export default {
|
||||
name: 'CalculateChannelDonation',
|
||||
components: {
|
||||
datetime
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
is_loading: false,
|
||||
items: [],
|
||||
total: null,
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
total_page: 1,
|
||||
headers: [
|
||||
{ text: '날짜', align: 'center', sortable: false, value: 'date' },
|
||||
{ text: '크리에이터', align: 'center', sortable: false, value: 'creator' },
|
||||
{ text: '건수', align: 'center', sortable: false, value: 'count' },
|
||||
{ text: '캔', align: 'center', sortable: false, value: 'totalCan' },
|
||||
{ text: '원화', align: 'center', sortable: false, value: 'krw' },
|
||||
{ text: '수수료(6.6%)', align: 'center', sortable: false, value: 'fee' },
|
||||
{ text: '정산금액', align: 'center', sortable: false, value: 'settlementAmount' },
|
||||
{ text: '원천세(3.3%)', align: 'center', sortable: false, value: 'withholdingTax' },
|
||||
{ text: '입금액', align: 'center', sortable: false, value: 'depositAmount' }
|
||||
],
|
||||
excelColumns: [
|
||||
{ label: '날짜', field: 'date' },
|
||||
{ label: '크리에이터', field: 'creator' },
|
||||
{ label: '건수', field: 'count' },
|
||||
{ label: '캔', field: 'totalCan' },
|
||||
{ label: '원화', field: 'krw' },
|
||||
{ label: '수수료(6.6%)', field: 'fee' },
|
||||
{ label: '정산금액', field: 'settlementAmount' },
|
||||
{ label: '원천세(3.3%)', field: 'withholdingTax' },
|
||||
{ label: '입금액', field: 'depositAmount' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
const date = new Date()
|
||||
const firstDate = new Date(date.getFullYear(), date.getMonth(), 1)
|
||||
const lastDate = new Date(date.getFullYear(), date.getMonth() + 1, 0)
|
||||
|
||||
this.start_date = this.formatDate(firstDate)
|
||||
this.end_date = this.formatDate(lastDate)
|
||||
|
||||
await this.getCalculateChannelDonationByCreator()
|
||||
},
|
||||
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
const year = date.getFullYear()
|
||||
const month = ('0' + (date.getMonth() + 1)).slice(-2)
|
||||
const day = ('0' + date.getDate()).slice(-2)
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
async next() {
|
||||
await this.getCalculateChannelDonationByCreator()
|
||||
},
|
||||
|
||||
async getCalculateChannelDonationByCreator() {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const res = await api.getCalculateChannelDonationByCreator(
|
||||
this.start_date.substring(0, 10),
|
||||
this.end_date.substring(0, 10),
|
||||
this.page,
|
||||
this.page_size
|
||||
)
|
||||
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
this.items = data.items
|
||||
this.total = data.total
|
||||
this.total_page = Math.ceil(data.totalCount / this.page_size) || 1
|
||||
} else {
|
||||
this.notifyError(res.data.message || '데이터를 불러오는 중 오류가 발생했습니다.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('서버와의 통신 중 오류가 발생했습니다.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.datepicker {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user