Compare commits
90 Commits
test
...
2769c3c9f0
| Author | SHA1 | Date | |
|---|---|---|---|
| 2769c3c9f0 | |||
| 648d4d3a97 | |||
| 4baf253b7e | |||
| e0c63df2a6 | |||
| 892923becc | |||
| d3ea703204 | |||
| 70298b8f8f | |||
| 9fa9f3e699 | |||
| d82531583c | |||
| 6240a285c2 | |||
| f577ab575e | |||
| 0c3e3fc3fd | |||
| 6886c372aa | |||
| 8dd3dcb770 | |||
| 1a435b6074 | |||
| 492859dae3 | |||
| 18b59b5598 | |||
| 5fcdd7f06d | |||
| 1e149f7e41 | |||
| aca3767a24 | |||
| d51655f15e | |||
| 47dd32939f | |||
| 2e1891ab08 | |||
| 99d70cc8f7 | |||
| 9f1675e82d | |||
| c2838be2ed | |||
| b5c2941c0d | |||
| d5c01d8d23 | |||
| 7118b0649a | |||
| 8f5346581e | |||
| e43f2e30be | |||
| 397fd267e0 | |||
| fe4b88350b | |||
| 537474e162 | |||
| b5abdf3cf5 | |||
| a2e457b5e8 | |||
| 05ddd417cd | |||
| e70426af68 | |||
| 81b33e1322 | |||
| 588fcfbe90 | |||
| ff2c126382 | |||
| 702daca29f | |||
| 8e9008a3c1 | |||
| 5c0c00aad4 | |||
| e0949c6d73 | |||
| 0449bac8d5 | |||
| d412c15c9d | |||
| ed16a6ddad | |||
| f06e2d41e0 | |||
| 7505269db3 | |||
| 15eeb6943d | |||
| 7e7ed46cea | |||
| fd01786649 | |||
| c48c1c2f09 | |||
| 9bcf3a3cdb | |||
| 4c5b987d98 | |||
| f168403048 | |||
| 82ee1584e7 | |||
| 65cb918389 | |||
| 784baf9a2f | |||
| 7a85ac41cc | |||
| 9d4c9437cf | |||
| 68845aeae1 | |||
| bbdca29337 | |||
| c14c041daa | |||
| a515a144eb | |||
| 54a6773905 | |||
| d97087b4e9 | |||
| ddb2449053 | |||
| 8aca07cdf7 | |||
| 0ba845d95a | |||
| 64b1fd5395 | |||
| 639bea70fa | |||
| 6a89ba059b | |||
| ff83041585 | |||
| e660be0bf4 | |||
| 62cdd57069 | |||
| f8346ed5ef | |||
| 9656b9a9d1 | |||
| 97a58266bb | |||
| 8fc0cfa345 | |||
| 22f9c2287d | |||
| 9284f7d5c3 | |||
| e6f27a4529 | |||
| 6a33d1c024 | |||
| 3b83789c15 | |||
| 55f0ab9af3 | |||
| 9b168a6112 | |||
| c47937933e | |||
| 4744fe7d9a |
145
src/api/agent.js
145
src/api/agent.js
@@ -1,145 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
|
|
||||||
// 공통: 페이지 파라미터 변환(1-based UI → 0-based Spring Pageable)
|
|
||||||
function toZeroBased(page) {
|
|
||||||
const p = Number(page || 1)
|
|
||||||
return Math.max(0, p - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트 리스트 조회
|
|
||||||
// 서버 스펙에 페이지네이션이 없다면 단순 GET으로 사용
|
|
||||||
// 추후 필요 시 params(page,size) 확장 가능
|
|
||||||
async function getAgentList() {
|
|
||||||
return Vue.axios.get('/admin/partner/agent/list')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트 정산 비율 목록 조회
|
|
||||||
async function getAgentSettlementRatioList() {
|
|
||||||
return Vue.axios.get('/admin/partner/agent/ratio')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트 정산 비율 등록
|
|
||||||
// payload: { memberId: number, settlementRatio: number, effectiveFrom: string(yyyy-MM-ddTHH:mm:ss) }
|
|
||||||
async function createAgentSettlementRatio(payload) {
|
|
||||||
return Vue.axios.post('/admin/partner/agent/ratio', payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트 정산 비율 수정
|
|
||||||
// payload: { memberId: number, settlementRatio: number, effectiveFrom: string(yyyy-MM-ddTHH:mm:ss) }
|
|
||||||
async function updateAgentSettlementRatio(payload) {
|
|
||||||
return Vue.axios.post('/admin/partner/agent/ratio/update', payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트 닉네임 검색
|
|
||||||
// 반환: [{ id, nickname }]
|
|
||||||
async function searchAgentByNickname(query) {
|
|
||||||
try {
|
|
||||||
const res = await Vue.axios.get('/admin/partner/agent/search-by-nickname', {
|
|
||||||
params: { nickname: query, search_word: query }
|
|
||||||
})
|
|
||||||
if (res && Array.isArray(res.data)) return res.data
|
|
||||||
if (res && res.data && Array.isArray(res.data.data)) return res.data.data
|
|
||||||
return []
|
|
||||||
} catch (e) {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트 소속 크리에이터 목록 조회
|
|
||||||
// GET /admin/partner/agent/{agentId}/creator/list
|
|
||||||
// params: { page, size }
|
|
||||||
async function getAgentAssignedCreatorList(agentId, page = 1, size = 20) {
|
|
||||||
// Spring Pageable은 일반적으로 0-based page index를 사용
|
|
||||||
const zeroBasedPage = Math.max(0, Number(page || 1) - 1)
|
|
||||||
return Vue.axios.get(`/admin/partner/agent/${agentId}/creator/list`, {
|
|
||||||
params: { page: zeroBasedPage, size }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 추가 가능한 크리에이터 검색
|
|
||||||
// GET /admin/partner/agent/creator/search?search_word=...
|
|
||||||
async function searchAdminAgentAssignableCreators(search_word) {
|
|
||||||
return Vue.axios.get('/admin/partner/agent/creator/search', {
|
|
||||||
params: { search_word }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 에이전트에 크리에이터 소속 시키기
|
|
||||||
// POST /admin/partner/agent/assignment
|
|
||||||
// payload: { agentId, creatorId, assignedAt } // assignedAt: LocalDateTime string (yyyy-MM-ddTHH:mm:ss)
|
|
||||||
async function assignAgentCreator(payload) {
|
|
||||||
return Vue.axios.post('/admin/partner/agent/assignment', payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 크리에이터 소속 해제
|
|
||||||
// POST /admin/partner/agent/assignment/remove
|
|
||||||
// payload: { creatorId, unassignedAt } // unassignedAt: LocalDateTime string
|
|
||||||
async function removeAgentCreator(payload) {
|
|
||||||
return Vue.axios.post('/admin/partner/agent/assignment/remove', payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
// =========================
|
|
||||||
// 정산 상세 - 에이전트별(크리에이터 기준 집계)
|
|
||||||
// 공통 Request: startDateStr, endDateStr, Spring Pageable(page,size,sort)
|
|
||||||
// 공통 Response: ApiResponse<GetAgentSettlementByCreatorResponse>
|
|
||||||
// { success, message, data: { totalCount, total:{...}, items:[...] } }
|
|
||||||
|
|
||||||
function buildSettlementParams({ startDateStr, endDateStr, page = 1, size = 20, sort }) {
|
|
||||||
const params = {
|
|
||||||
startDateStr,
|
|
||||||
endDateStr,
|
|
||||||
page: toZeroBased(page),
|
|
||||||
size
|
|
||||||
}
|
|
||||||
if (sort) params.sort = sort
|
|
||||||
return params
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAgentLiveSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
|
|
||||||
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/live-by-creator`, {
|
|
||||||
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAgentContentSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
|
|
||||||
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/content-by-creator`, {
|
|
||||||
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAgentCommunitySettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
|
|
||||||
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/community-by-creator`, {
|
|
||||||
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAgentContentDonationSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
|
|
||||||
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/content-donation-by-creator`, {
|
|
||||||
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAgentChannelDonationSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
|
|
||||||
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/channel-donation-by-creator`, {
|
|
||||||
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
getAgentList,
|
|
||||||
getAgentSettlementRatioList,
|
|
||||||
createAgentSettlementRatio,
|
|
||||||
updateAgentSettlementRatio,
|
|
||||||
searchAgentByNickname,
|
|
||||||
// 에이전트 상세 - 소속 크리에이터 관리
|
|
||||||
getAgentAssignedCreatorList,
|
|
||||||
searchAdminAgentAssignableCreators,
|
|
||||||
assignAgentCreator,
|
|
||||||
removeAgentCreator,
|
|
||||||
// 에이전트 정산 상세 (크리에이터 기준)
|
|
||||||
getAgentLiveSettlementByCreator,
|
|
||||||
getAgentContentSettlementByCreator,
|
|
||||||
getAgentCommunitySettlementByCreator,
|
|
||||||
getAgentContentDonationSettlementByCreator,
|
|
||||||
getAgentChannelDonationSettlementByCreator,
|
|
||||||
}
|
|
||||||
@@ -43,7 +43,7 @@ async function getSeriesBannerList(page = 1, size = 20) {
|
|||||||
async function createSeriesBanner(bannerData) {
|
async function createSeriesBanner(bannerData) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
if (bannerData.image) formData.append("image", bannerData.image);
|
if (bannerData.image) formData.append("image", bannerData.image);
|
||||||
const requestData = { seriesId: bannerData.seriesId, lang: bannerData.lang };
|
const requestData = { seriesId: bannerData.seriesId };
|
||||||
formData.append("request", JSON.stringify(requestData));
|
formData.append("request", JSON.stringify(requestData));
|
||||||
return Vue.axios.post("/admin/audio-content/series/banner/register", formData, {
|
return Vue.axios.post("/admin/audio-content/series/banner/register", formData, {
|
||||||
headers: { "Content-Type": "multipart/form-data" }
|
headers: { "Content-Type": "multipart/form-data" }
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
async function getCalculateLive(startDate, endDate, page, size) {
|
async function getCalculateLive(startDate, endDate) {
|
||||||
return Vue.axios.get('/admin/calculate/live?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size);
|
return Vue.axios.get('/admin/calculate/live?startDateStr=' + startDate + '&endDateStr=' + endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCalculateContent(startDate, endDate, page, size) {
|
async function getCalculateContent(startDate, endDate) {
|
||||||
return Vue.axios.get('/admin/calculate/content-list?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size);
|
return Vue.axios.get('/admin/calculate/content-list?startDateStr=' + startDate + '&endDateStr=' + endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCumulativeSalesByContent(page, size) {
|
async function getCumulativeSalesByContent(page, size) {
|
||||||
return Vue.axios.get('/admin/calculate/cumulative-sales-by-content?page=' + (page - 1) + "&size=" + size);
|
return Vue.axios.get('/admin/calculate/cumulative-sales-by-content?page=' + (page - 1) + "&size=" + size);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCalculateContentDonation(startDate, endDate, page, size) {
|
async function getCalculateContentDonation(startDate, endDate) {
|
||||||
return Vue.axios.get('/admin/calculate/content-donation-list?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size);
|
return Vue.axios.get('/admin/calculate/content-donation-list?startDateStr=' + startDate + '&endDateStr=' + endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCalculateCommunityPost(startDate, endDate, page, size) {
|
async function getCalculateCommunityPost(startDate, endDate, page, size) {
|
||||||
@@ -63,66 +63,6 @@ async function getCalculateChannelDonationByCreator(startDate, endDate, page, si
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCalculateChannelDonationByDate(startDate, endDate, page, size) {
|
|
||||||
return Vue.axios.get('/admin/calculate/channel-donation-by-date?startDateStr=' +
|
|
||||||
startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateChannelDonationByCreatorExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/channel-donation-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateLiveExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/live/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateContentExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/content-list/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateContentDonationExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/content-donation-list/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateCommunityPostExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/community-post/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateLiveByCreatorExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/live-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateContentByCreatorExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/content-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateCommunityByCreatorExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/community-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadCalculateChannelDonationByDateExcel(startDate, endDate) {
|
|
||||||
return Vue.axios.get('/admin/calculate/channel-donation-by-date/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updateCreatorSettlementRatio(creatorSettlementRatio) {
|
async function updateCreatorSettlementRatio(creatorSettlementRatio) {
|
||||||
const request = {
|
const request = {
|
||||||
memberId: creatorSettlementRatio.creator_id,
|
memberId: creatorSettlementRatio.creator_id,
|
||||||
@@ -138,15 +78,6 @@ async function deleteCreatorSettlementRatio(memberId) {
|
|||||||
return Vue.axios.post('/admin/calculate/ratio/delete/' + memberId);
|
return Vue.axios.post('/admin/calculate/ratio/delete/' + memberId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function refundLive(roomId, canUsageStr) {
|
|
||||||
const request = {
|
|
||||||
roomId: roomId,
|
|
||||||
canUsageStr: canUsageStr
|
|
||||||
};
|
|
||||||
|
|
||||||
return Vue.axios.post('/admin/calculate/live/refund', request);
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getCalculateLive,
|
getCalculateLive,
|
||||||
getCalculateContent,
|
getCalculateContent,
|
||||||
@@ -157,19 +88,8 @@ export {
|
|||||||
createCreatorSettlementRatio,
|
createCreatorSettlementRatio,
|
||||||
updateCreatorSettlementRatio,
|
updateCreatorSettlementRatio,
|
||||||
deleteCreatorSettlementRatio,
|
deleteCreatorSettlementRatio,
|
||||||
refundLive,
|
|
||||||
getCalculateLiveByCreator,
|
getCalculateLiveByCreator,
|
||||||
getCalculateContentByCreator,
|
getCalculateContentByCreator,
|
||||||
getCalculateCommunityByCreator,
|
getCalculateCommunityByCreator,
|
||||||
getCalculateChannelDonationByCreator,
|
getCalculateChannelDonationByCreator
|
||||||
getCalculateChannelDonationByDate,
|
|
||||||
downloadCalculateChannelDonationByCreatorExcel,
|
|
||||||
downloadCalculateLiveExcel,
|
|
||||||
downloadCalculateContentExcel,
|
|
||||||
downloadCalculateContentDonationExcel,
|
|
||||||
downloadCalculateCommunityPostExcel,
|
|
||||||
downloadCalculateLiveByCreatorExcel,
|
|
||||||
downloadCalculateContentByCreatorExcel,
|
|
||||||
downloadCalculateCommunityByCreatorExcel,
|
|
||||||
downloadCalculateChannelDonationByDateExcel
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,10 +115,9 @@ async function createCharacterBanner(bannerData) {
|
|||||||
// 이미지 FormData에 추가
|
// 이미지 FormData에 추가
|
||||||
if (bannerData.image) formData.append('image', bannerData.image)
|
if (bannerData.image) formData.append('image', bannerData.image)
|
||||||
|
|
||||||
// 캐릭터 ID와 언어 코드를 JSON 문자열로 변환하여 request 필드에 추가
|
// 캐릭터 ID를 JSON 문자열로 변환하여 request 필드에 추가
|
||||||
const requestData = {
|
const requestData = {
|
||||||
characterId: bannerData.characterId,
|
characterId: bannerData.characterId
|
||||||
lang: bannerData.lang
|
|
||||||
}
|
}
|
||||||
|
|
||||||
formData.append('request', JSON.stringify(requestData))
|
formData.append('request', JSON.stringify(requestData))
|
||||||
|
|||||||
@@ -11,8 +11,4 @@ async function getChargeStatusDetail(startDate, paymentGateway, currency) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function refundCharge(chargeId) {
|
export { getChargeStatus, getChargeStatusDetail }
|
||||||
return Vue.axios.post('/admin/charge/refund', { chargeId });
|
|
||||||
}
|
|
||||||
|
|
||||||
export { getChargeStatus, getChargeStatusDetail, refundCharge }
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
async function login(email, password) {
|
async function login(email, password) {
|
||||||
return Vue.axios.post('/admin/member/login', {
|
return Vue.axios.post('/member/login', {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
@@ -52,11 +52,6 @@ async function resetPassword(id) {
|
|||||||
return Vue.axios.post("/admin/member/password/reset", request)
|
return Vue.axios.post("/admin/member/password/reset", request)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function blockMember(memberId, reason) {
|
|
||||||
const request = {memberId, reason}
|
|
||||||
return Vue.axios.post("/admin/member/block", request)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 닉네임으로 회원 검색 API
|
* 닉네임으로 회원 검색 API
|
||||||
* - 서버 구현 차이를 흡수하기 위해 nickname, search_word 두 파라미터 모두 전송
|
* - 서버 구현 차이를 흡수하기 위해 nickname, search_word 두 파라미터 모두 전송
|
||||||
@@ -89,9 +84,8 @@ export {
|
|||||||
searchMember,
|
searchMember,
|
||||||
getCreatorList,
|
getCreatorList,
|
||||||
searchCreator,
|
searchCreator,
|
||||||
updateMember,
|
updateMember,
|
||||||
getCreatorAllList,
|
getCreatorAllList,
|
||||||
resetPassword,
|
resetPassword,
|
||||||
blockMember,
|
searchMembersByNickname
|
||||||
searchMembersByNickname
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
import Vue from 'vue';
|
|
||||||
|
|
||||||
// 소지 유저 조회
|
|
||||||
async function getOwners() {
|
|
||||||
return Vue.axios.get('/admin/calculate/original-series/owners');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 정산 내역 조회 (page는 1부터 시작하는 UI 기준, 서버에는 0부터 전달)
|
|
||||||
async function getSettlementDetails({ startDate, endDate, creatorId, page = 1, size = 10 }) {
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
// 서버 파라미터 스펙 변경: start_date, end_date, creator_id
|
|
||||||
if (startDate) params.append('start_date', startDate);
|
|
||||||
if (endDate) params.append('end_date', endDate);
|
|
||||||
if (creatorId != null) params.append("creator_id", creatorId);
|
|
||||||
params.append('page', Math.max(0, (page || 1) - 1));
|
|
||||||
params.append('size', size || 10);
|
|
||||||
|
|
||||||
return Vue.axios.get(`/admin/calculate/original-series/settlement-details?${params.toString()}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 엑셀 다운로드 (xlsx 바이너리)
|
|
||||||
async function downloadSettlementExcel({ startDate, endDate }) {
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
// 서버 파라미터 스펙 변경: start_date, end_date
|
|
||||||
if (startDate) params.append('start_date', startDate);
|
|
||||||
if (endDate) params.append('end_date', endDate);
|
|
||||||
|
|
||||||
return Vue.axios.get(`/admin/calculate/original-series/settlement-details/excel?${params.toString()}` , {
|
|
||||||
responseType: 'blob'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
getOwners,
|
|
||||||
getSettlementDetails,
|
|
||||||
downloadSettlementExcel,
|
|
||||||
};
|
|
||||||
@@ -94,135 +94,80 @@ export default {
|
|||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
try {
|
try {
|
||||||
let res = await api.getMenus();
|
let res = await api.getMenus();
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true && res.data.data.length > 0) {
|
||||||
// 기본 메뉴 설정 (API 결과가 비어있을 수 있음)
|
this.items = res.data.data
|
||||||
this.items = Array.isArray(res.data.data) ? res.data.data : []
|
|
||||||
|
|
||||||
// 현재 사용자 역할 확인
|
// '시리즈 관리' 메뉴에 '배너 등록' 하위 메뉴 추가
|
||||||
const role = (this.$store && this.$store.state && this.$store.state.accountStore && this.$store.state.accountStore.role)
|
try {
|
||||||
|| localStorage.role
|
const seriesMenu = this.items.find(m => m && m.title === '시리즈 관리')
|
||||||
|
if (seriesMenu) {
|
||||||
// ADMIN 권한 전용 추가 메뉴들
|
if (!Array.isArray(seriesMenu.items)) {
|
||||||
if (role === 'ADMIN') {
|
seriesMenu.items = seriesMenu.items ? [].concat(seriesMenu.items) : []
|
||||||
// '시리즈 관리' 메뉴에 '배너 등록' 하위 메뉴 추가
|
|
||||||
try {
|
|
||||||
const seriesMenu = this.items.find(m => m && m.title === '시리즈 관리')
|
|
||||||
if (seriesMenu) {
|
|
||||||
if (!Array.isArray(seriesMenu.items)) {
|
|
||||||
seriesMenu.items = seriesMenu.items ? [].concat(seriesMenu.items) : []
|
|
||||||
}
|
|
||||||
const exists = seriesMenu.items.some(ci => ci && ci.route === '/content/series/banner')
|
|
||||||
if (!exists) {
|
|
||||||
seriesMenu.items.push({
|
|
||||||
title: '배너 등록',
|
|
||||||
route: '/content/series/banner',
|
|
||||||
items: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
const exists = seriesMenu.items.some(ci => ci && ci.route === '/content/series/banner')
|
||||||
// ignore
|
if (!exists) {
|
||||||
}
|
seriesMenu.items.push({
|
||||||
|
|
||||||
// 캐릭터 챗봇 메뉴 추가
|
|
||||||
this.items.push({
|
|
||||||
title: '캐릭터 챗봇',
|
|
||||||
route: null,
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
title: '배너 등록',
|
title: '배너 등록',
|
||||||
route: '/character/banner',
|
route: '/content/series/banner',
|
||||||
items: null
|
items: null
|
||||||
},
|
})
|
||||||
{
|
|
||||||
title: '캐릭터 리스트',
|
|
||||||
route: '/character',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '큐레이션',
|
|
||||||
route: '/character/curation',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '정산',
|
|
||||||
route: '/character/calculate',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '원작',
|
|
||||||
route: '/original-work',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
// 에이전트 관리 메뉴를 '크리에이터 관리' 바로 아래에 추가
|
|
||||||
try {
|
|
||||||
const insertAfterTitle = '크리에이터 관리'
|
|
||||||
const agentMenu = {
|
|
||||||
title: '에이전트 관리',
|
|
||||||
route: null,
|
|
||||||
items: [
|
|
||||||
{ title: '에이전트 리스트', route: '/agent/list', items: null },
|
|
||||||
{ title: '에이전트 정산 비율', route: '/agent/settlement-ratio', items: null },
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const idx = this.items.findIndex(m => m && m.title === insertAfterTitle)
|
|
||||||
if (idx >= 0) {
|
|
||||||
this.items.splice(idx + 1, 0, agentMenu)
|
|
||||||
} else {
|
|
||||||
// 기준 메뉴가 없으면 하단에 추가
|
|
||||||
this.items.push(agentMenu)
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
// 정산현황 메뉴에 '채널 후원 정산' 및 '오리지널 시리즈 정산' 추가
|
|
||||||
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const existsOriginal = calculateMenu.items.some(ci => ci && ci.route === '/calculate/original-series')
|
|
||||||
if (!existsOriginal) {
|
|
||||||
calculateMenu.items.push({
|
|
||||||
title: '오리지널 시리즈 정산',
|
|
||||||
route: '/calculate/original-series',
|
|
||||||
items: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
// 조회한 메뉴가 비어 있고, 콘텐츠 매니저라면 기본 메뉴 추가
|
// 캐릭터 챗봇 메뉴 추가
|
||||||
if (this.items.length === 0 && role === 'CONTENT_MANAGER') {
|
this.items.push({
|
||||||
this.items.push({
|
title: '캐릭터 챗봇',
|
||||||
title: '콘텐츠 리스트',
|
route: null,
|
||||||
route: '/content/list',
|
items: [
|
||||||
items: null
|
{
|
||||||
})
|
title: '배너 등록',
|
||||||
}
|
route: '/character/banner',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '캐릭터 리스트',
|
||||||
|
route: '/character',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '큐레이션',
|
||||||
|
route: '/character/curation',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '정산',
|
||||||
|
route: '/character/calculate',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '원작',
|
||||||
|
route: '/original-work',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
// 그래도 비어있다면 이전 동작과 동일하게 처리
|
// 정산 관리 메뉴에 '채널 후원 정산' 추가
|
||||||
if (this.items.length === 0) {
|
try {
|
||||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
const calculateMenu = this.items.find(m => m && m.title === '정산 관리')
|
||||||
this.logout();
|
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 {
|
} else {
|
||||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
||||||
|
|||||||
@@ -50,58 +50,6 @@ const routes = [
|
|||||||
name: 'CreatorReview',
|
name: 'CreatorReview',
|
||||||
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorSettlementRatio.vue')
|
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorSettlementRatio.vue')
|
||||||
},
|
},
|
||||||
// Agent Management
|
|
||||||
{
|
|
||||||
path: '/calculate/original-series',
|
|
||||||
name: 'OriginalSeriesSettlement',
|
|
||||||
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/OriginalSeriesSettlement.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/list',
|
|
||||||
name: 'AgentList',
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentList.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/:agentId/settlement/live',
|
|
||||||
name: 'AgentSettlementLive',
|
|
||||||
props: true,
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentLiveSettlement.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/:agentId/settlement/content',
|
|
||||||
name: 'AgentSettlementContent',
|
|
||||||
props: true,
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentContentSettlement.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/:agentId/settlement/community',
|
|
||||||
name: 'AgentSettlementCommunity',
|
|
||||||
props: true,
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentCommunitySettlement.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/:agentId/settlement/content-donation',
|
|
||||||
name: 'AgentSettlementContentDonation',
|
|
||||||
props: true,
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentContentDonationSettlement.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/:agentId/settlement/channel-donation',
|
|
||||||
name: 'AgentSettlementChannelDonation',
|
|
||||||
props: true,
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentChannelDonationSettlement.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/settlement-ratio',
|
|
||||||
name: 'AgentSettlementRatio',
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentSettlementRatio.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/agent/:agentId',
|
|
||||||
name: 'AgentDetail',
|
|
||||||
props: true,
|
|
||||||
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentDetail.vue')
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/live/tags',
|
path: '/live/tags',
|
||||||
name: 'LiveTags',
|
name: 'LiveTags',
|
||||||
@@ -267,11 +215,6 @@ const routes = [
|
|||||||
name: 'CalculateChannelDonation',
|
name: 'CalculateChannelDonation',
|
||||||
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateChannelDonation.vue')
|
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateChannelDonation.vue')
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/calculate/channel-donation-by-creator',
|
|
||||||
name: 'CalculateChannelDonationByCreator',
|
|
||||||
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateChannelDonationByCreator.vue')
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/notice',
|
path: '/notice',
|
||||||
name: 'NoticeView',
|
name: 'NoticeView',
|
||||||
|
|||||||
@@ -12,13 +12,17 @@ enhanceAccessToken();
|
|||||||
const accountStore = {
|
const accountStore = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
|
userId: '',
|
||||||
|
nickname: '',
|
||||||
accessToken: '',
|
accessToken: '',
|
||||||
role: '',
|
profileImage: '',
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
isAuthenticated(state) {
|
isAuthenticated(state) {
|
||||||
|
state.userId = state.userId || localStorage.userId
|
||||||
|
state.nickname = state.nickname || localStorage.nickname
|
||||||
|
state.profileImage = state.profileImage || localStorage.profileImage
|
||||||
state.accessToken = state.accessToken || localStorage.accessToken
|
state.accessToken = state.accessToken || localStorage.accessToken
|
||||||
state.role = state.role || localStorage.role
|
|
||||||
|
|
||||||
return state.accessToken !== undefined &&
|
return state.accessToken !== undefined &&
|
||||||
state.accessToken !== null &&
|
state.accessToken !== null &&
|
||||||
@@ -27,19 +31,27 @@ const accountStore = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
LOGIN(state, {token, role}) {
|
LOGIN(state, {userId, nickname, token, profileImage}) {
|
||||||
|
state.userId = userId
|
||||||
|
localStorage.userId = userId
|
||||||
|
|
||||||
|
state.nickname = nickname
|
||||||
|
localStorage.nickname = nickname
|
||||||
|
|
||||||
|
state.profileImage = profileImage
|
||||||
|
localStorage.profileImage = profileImage
|
||||||
|
|
||||||
state.accessToken = token
|
state.accessToken = token
|
||||||
localStorage.accessToken = token
|
localStorage.accessToken = token
|
||||||
|
|
||||||
state.role = role
|
|
||||||
localStorage.role = role
|
|
||||||
|
|
||||||
Vue.axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
Vue.axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
LOGOUT(state) {
|
LOGOUT(state) {
|
||||||
|
state.userId = ''
|
||||||
|
state.nickname = ''
|
||||||
|
state.profileImage = ''
|
||||||
state.accessToken = ''
|
state.accessToken = ''
|
||||||
state.role = ''
|
|
||||||
|
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
if (location.pathname === '/') {
|
if (location.pathname === '/') {
|
||||||
|
|||||||
@@ -1,254 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 채널 후원</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 필터 영역 -->
|
|
||||||
<v-row
|
|
||||||
class="mt-2 mb-2"
|
|
||||||
align="center"
|
|
||||||
justify="end"
|
|
||||||
>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuStart"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="시작일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="startDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="startDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuStart = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuEnd"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="종료일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="endDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="endDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuEnd = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="2"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="isLoading"
|
|
||||||
@click="onSearch"
|
|
||||||
>
|
|
||||||
조회
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 테이블 영역 -->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="items"
|
|
||||||
:loading="isLoading"
|
|
||||||
:items-per-page="pageSize"
|
|
||||||
class="elevation-1"
|
|
||||||
disable-pagination
|
|
||||||
hide-default-footer
|
|
||||||
>
|
|
||||||
<!-- 표 최상단 합계 행 -->
|
|
||||||
<template v-slot:body.prepend>
|
|
||||||
<tr>
|
|
||||||
<td class="text-center">
|
|
||||||
합계
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.count) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.totalCan) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.krw) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.fee) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.settlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.tax) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.depositAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.agentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.count="{ item }">
|
|
||||||
{{ numberFormat(item.count) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalCan="{ item }">
|
|
||||||
{{ numberFormat(item.totalCan) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.krw="{ item }">
|
|
||||||
{{ currencyKRW(item.krw) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.fee="{ item }">
|
|
||||||
{{ currencyKRW(item.fee) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.settlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.settlementAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.tax="{ item }">
|
|
||||||
{{ currencyKRW(item.tax) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.depositAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.depositAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.agentSettlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.agentSettlementAmount) }}
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
|
|
||||||
<!-- 페이지네이션 -->
|
|
||||||
<div class="d-flex justify-center mt-2">
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="totalPages"
|
|
||||||
:total-visible="7"
|
|
||||||
@input="onPageChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAgentChannelDonationSettlementByCreator } from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentChannelDonationSettlement',
|
|
||||||
props: { agentId: { type: [String, Number], required: true } },
|
|
||||||
data() {
|
|
||||||
const today = new Date()
|
|
||||||
const yyyy = today.getFullYear()
|
|
||||||
const mm = String(today.getMonth() + 1).padStart(2, '0')
|
|
||||||
const dd = String(today.getDate()).padStart(2, '0')
|
|
||||||
const firstDay = `${yyyy}-${mm}-01`
|
|
||||||
const endDay = `${yyyy}-${mm}-${dd}`
|
|
||||||
return {
|
|
||||||
startDateStr: firstDay,
|
|
||||||
endDateStr: endDay,
|
|
||||||
menuStart: false,
|
|
||||||
menuEnd: false,
|
|
||||||
page: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
isLoading: false,
|
|
||||||
totalCount: 0,
|
|
||||||
totalPages: 1,
|
|
||||||
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
|
|
||||||
items: [],
|
|
||||||
headers: [
|
|
||||||
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
|
|
||||||
{ text: '건수', value: 'count', align: 'center', width: 100 },
|
|
||||||
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
|
|
||||||
{ text: '원화', value: 'krw', align: 'center', width: 140 },
|
|
||||||
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
|
|
||||||
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '세금', value: 'tax', align: 'center', width: 120 },
|
|
||||||
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
displayNickname() {
|
|
||||||
const q = (this.$route && this.$route.query) || {}
|
|
||||||
return q.nickname || '에이전트'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() { this.fetchList() },
|
|
||||||
methods: {
|
|
||||||
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
|
|
||||||
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
|
|
||||||
onSearch() { this.page = 1; this.fetchList() },
|
|
||||||
onPageChange() { this.fetchList() },
|
|
||||||
async fetchList() {
|
|
||||||
this.isLoading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentChannelDonationSettlementByCreator(this.agentId, {
|
|
||||||
startDateStr: this.startDateStr,
|
|
||||||
endDateStr: this.endDateStr,
|
|
||||||
page: this.page,
|
|
||||||
size: this.pageSize,
|
|
||||||
})
|
|
||||||
let payload = res && res.data ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
|
|
||||||
const data = payload || { totalCount: 0, total: {}, items: [] }
|
|
||||||
this.totalCount = Number(data.totalCount || 0)
|
|
||||||
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
|
|
||||||
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.total = Object.assign({}, defTotal, data.total || {})
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.totalPages = 1
|
|
||||||
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.items = []
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
@@ -1,254 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 커뮤니티</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 필터 영역 -->
|
|
||||||
<v-row
|
|
||||||
class="mt-2 mb-2"
|
|
||||||
align="center"
|
|
||||||
justify="end"
|
|
||||||
>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuStart"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="시작일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="startDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="startDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuStart = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuEnd"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="종료일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="endDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="endDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuEnd = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="2"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="isLoading"
|
|
||||||
@click="onSearch"
|
|
||||||
>
|
|
||||||
조회
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 테이블 영역 -->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="items"
|
|
||||||
:loading="isLoading"
|
|
||||||
:items-per-page="pageSize"
|
|
||||||
class="elevation-1"
|
|
||||||
disable-pagination
|
|
||||||
hide-default-footer
|
|
||||||
>
|
|
||||||
<!-- 표 최상단 합계 행 -->
|
|
||||||
<template v-slot:body.prepend>
|
|
||||||
<tr>
|
|
||||||
<td class="text-center">
|
|
||||||
합계
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.count) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.totalCan) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.krw) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.fee) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.settlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.tax) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.depositAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.agentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.count="{ item }">
|
|
||||||
{{ numberFormat(item.count) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalCan="{ item }">
|
|
||||||
{{ numberFormat(item.totalCan) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.krw="{ item }">
|
|
||||||
{{ currencyKRW(item.krw) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.fee="{ item }">
|
|
||||||
{{ currencyKRW(item.fee) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.settlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.settlementAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.tax="{ item }">
|
|
||||||
{{ currencyKRW(item.tax) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.depositAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.depositAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.agentSettlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.agentSettlementAmount) }}
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
|
|
||||||
<!-- 페이지네이션 -->
|
|
||||||
<div class="d-flex justify-center mt-2">
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="totalPages"
|
|
||||||
:total-visible="7"
|
|
||||||
@input="onPageChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAgentCommunitySettlementByCreator } from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentCommunitySettlement',
|
|
||||||
props: { agentId: { type: [String, Number], required: true } },
|
|
||||||
data() {
|
|
||||||
const today = new Date()
|
|
||||||
const yyyy = today.getFullYear()
|
|
||||||
const mm = String(today.getMonth() + 1).padStart(2, '0')
|
|
||||||
const dd = String(today.getDate()).padStart(2, '0')
|
|
||||||
const firstDay = `${yyyy}-${mm}-01`
|
|
||||||
const endDay = `${yyyy}-${mm}-${dd}`
|
|
||||||
return {
|
|
||||||
startDateStr: firstDay,
|
|
||||||
endDateStr: endDay,
|
|
||||||
menuStart: false,
|
|
||||||
menuEnd: false,
|
|
||||||
page: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
isLoading: false,
|
|
||||||
totalCount: 0,
|
|
||||||
totalPages: 1,
|
|
||||||
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
|
|
||||||
items: [],
|
|
||||||
headers: [
|
|
||||||
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
|
|
||||||
{ text: '건수', value: 'count', align: 'center', width: 100 },
|
|
||||||
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
|
|
||||||
{ text: '원화', value: 'krw', align: 'center', width: 140 },
|
|
||||||
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
|
|
||||||
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '세금', value: 'tax', align: 'center', width: 120 },
|
|
||||||
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
displayNickname() {
|
|
||||||
const q = (this.$route && this.$route.query) || {}
|
|
||||||
return q.nickname || '에이전트'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() { this.fetchList() },
|
|
||||||
methods: {
|
|
||||||
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
|
|
||||||
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
|
|
||||||
onSearch() { this.page = 1; this.fetchList() },
|
|
||||||
onPageChange() { this.fetchList() },
|
|
||||||
async fetchList() {
|
|
||||||
this.isLoading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentCommunitySettlementByCreator(this.agentId, {
|
|
||||||
startDateStr: this.startDateStr,
|
|
||||||
endDateStr: this.endDateStr,
|
|
||||||
page: this.page,
|
|
||||||
size: this.pageSize,
|
|
||||||
})
|
|
||||||
let payload = res && res.data ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
|
|
||||||
const data = payload || { totalCount: 0, total: {}, items: [] }
|
|
||||||
this.totalCount = Number(data.totalCount || 0)
|
|
||||||
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
|
|
||||||
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.total = Object.assign({}, defTotal, data.total || {})
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.totalPages = 1
|
|
||||||
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.items = []
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
@@ -1,254 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 콘텐츠 후원</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 필터 영역 -->
|
|
||||||
<v-row
|
|
||||||
class="mt-2 mb-2"
|
|
||||||
align="center"
|
|
||||||
justify="end"
|
|
||||||
>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuStart"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="시작일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="startDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="startDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuStart = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuEnd"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="종료일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="endDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="endDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuEnd = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="2"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="isLoading"
|
|
||||||
@click="onSearch"
|
|
||||||
>
|
|
||||||
조회
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 테이블 영역 -->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="items"
|
|
||||||
:loading="isLoading"
|
|
||||||
:items-per-page="pageSize"
|
|
||||||
class="elevation-1"
|
|
||||||
disable-pagination
|
|
||||||
hide-default-footer
|
|
||||||
>
|
|
||||||
<!-- 표 최상단 합계 행 -->
|
|
||||||
<template v-slot:body.prepend>
|
|
||||||
<tr>
|
|
||||||
<td class="text-center">
|
|
||||||
합계
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.count) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.totalCan) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.krw) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.fee) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.settlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.tax) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.depositAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.agentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.count="{ item }">
|
|
||||||
{{ numberFormat(item.count) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalCan="{ item }">
|
|
||||||
{{ numberFormat(item.totalCan) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.krw="{ item }">
|
|
||||||
{{ currencyKRW(item.krw) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.fee="{ item }">
|
|
||||||
{{ currencyKRW(item.fee) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.settlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.settlementAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.tax="{ item }">
|
|
||||||
{{ currencyKRW(item.tax) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.depositAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.depositAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.agentSettlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.agentSettlementAmount) }}
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
|
|
||||||
<!-- 페이지네이션 -->
|
|
||||||
<div class="d-flex justify-center mt-2">
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="totalPages"
|
|
||||||
:total-visible="7"
|
|
||||||
@input="onPageChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAgentContentDonationSettlementByCreator } from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentContentDonationSettlement',
|
|
||||||
props: { agentId: { type: [String, Number], required: true } },
|
|
||||||
data() {
|
|
||||||
const today = new Date()
|
|
||||||
const yyyy = today.getFullYear()
|
|
||||||
const mm = String(today.getMonth() + 1).padStart(2, '0')
|
|
||||||
const dd = String(today.getDate()).padStart(2, '0')
|
|
||||||
const firstDay = `${yyyy}-${mm}-01`
|
|
||||||
const endDay = `${yyyy}-${mm}-${dd}`
|
|
||||||
return {
|
|
||||||
startDateStr: firstDay,
|
|
||||||
endDateStr: endDay,
|
|
||||||
menuStart: false,
|
|
||||||
menuEnd: false,
|
|
||||||
page: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
isLoading: false,
|
|
||||||
totalCount: 0,
|
|
||||||
totalPages: 1,
|
|
||||||
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
|
|
||||||
items: [],
|
|
||||||
headers: [
|
|
||||||
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
|
|
||||||
{ text: '건수', value: 'count', align: 'center', width: 100 },
|
|
||||||
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
|
|
||||||
{ text: '원화', value: 'krw', align: 'center', width: 140 },
|
|
||||||
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
|
|
||||||
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '세금', value: 'tax', align: 'center', width: 120 },
|
|
||||||
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
displayNickname() {
|
|
||||||
const q = (this.$route && this.$route.query) || {}
|
|
||||||
return q.nickname || '에이전트'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() { this.fetchList() },
|
|
||||||
methods: {
|
|
||||||
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
|
|
||||||
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
|
|
||||||
onSearch() { this.page = 1; this.fetchList() },
|
|
||||||
onPageChange() { this.fetchList() },
|
|
||||||
async fetchList() {
|
|
||||||
this.isLoading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentContentDonationSettlementByCreator(this.agentId, {
|
|
||||||
startDateStr: this.startDateStr,
|
|
||||||
endDateStr: this.endDateStr,
|
|
||||||
page: this.page,
|
|
||||||
size: this.pageSize,
|
|
||||||
})
|
|
||||||
let payload = res && res.data ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
|
|
||||||
const data = payload || { totalCount: 0, total: {}, items: [] }
|
|
||||||
this.totalCount = Number(data.totalCount || 0)
|
|
||||||
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
|
|
||||||
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.total = Object.assign({}, defTotal, data.total || {})
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.totalPages = 1
|
|
||||||
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.items = []
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
@@ -1,254 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 콘텐츠</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 필터 영역 -->
|
|
||||||
<v-row
|
|
||||||
class="mt-2 mb-2"
|
|
||||||
align="center"
|
|
||||||
justify="end"
|
|
||||||
>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuStart"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="시작일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="startDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="startDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuStart = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuEnd"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="종료일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="endDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="endDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuEnd = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="2"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="isLoading"
|
|
||||||
@click="onSearch"
|
|
||||||
>
|
|
||||||
조회
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 테이블 영역 -->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="items"
|
|
||||||
:loading="isLoading"
|
|
||||||
:items-per-page="pageSize"
|
|
||||||
class="elevation-1"
|
|
||||||
disable-pagination
|
|
||||||
hide-default-footer
|
|
||||||
>
|
|
||||||
<!-- 표 최상단 합계 행 -->
|
|
||||||
<template v-slot:body.prepend>
|
|
||||||
<tr>
|
|
||||||
<td class="text-center">
|
|
||||||
합계
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.count) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.totalCan) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.krw) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.fee) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.settlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.tax) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.depositAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.agentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.count="{ item }">
|
|
||||||
{{ numberFormat(item.count) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalCan="{ item }">
|
|
||||||
{{ numberFormat(item.totalCan) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.krw="{ item }">
|
|
||||||
{{ currencyKRW(item.krw) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.fee="{ item }">
|
|
||||||
{{ currencyKRW(item.fee) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.settlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.settlementAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.tax="{ item }">
|
|
||||||
{{ currencyKRW(item.tax) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.depositAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.depositAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.agentSettlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.agentSettlementAmount) }}
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
|
|
||||||
<!-- 페이지네이션 -->
|
|
||||||
<div class="d-flex justify-center mt-2">
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="totalPages"
|
|
||||||
:total-visible="7"
|
|
||||||
@input="onPageChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAgentContentSettlementByCreator } from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentContentSettlement',
|
|
||||||
props: { agentId: { type: [String, Number], required: true } },
|
|
||||||
data() {
|
|
||||||
const today = new Date()
|
|
||||||
const yyyy = today.getFullYear()
|
|
||||||
const mm = String(today.getMonth() + 1).padStart(2, '0')
|
|
||||||
const dd = String(today.getDate()).padStart(2, '0')
|
|
||||||
const firstDay = `${yyyy}-${mm}-01`
|
|
||||||
const endDay = `${yyyy}-${mm}-${dd}`
|
|
||||||
return {
|
|
||||||
startDateStr: firstDay,
|
|
||||||
endDateStr: endDay,
|
|
||||||
menuStart: false,
|
|
||||||
menuEnd: false,
|
|
||||||
page: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
isLoading: false,
|
|
||||||
totalCount: 0,
|
|
||||||
totalPages: 1,
|
|
||||||
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
|
|
||||||
items: [],
|
|
||||||
headers: [
|
|
||||||
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
|
|
||||||
{ text: '건수', value: 'count', align: 'center', width: 100 },
|
|
||||||
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
|
|
||||||
{ text: '원화', value: 'krw', align: 'center', width: 140 },
|
|
||||||
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
|
|
||||||
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '세금', value: 'tax', align: 'center', width: 120 },
|
|
||||||
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
displayNickname() {
|
|
||||||
const q = (this.$route && this.$route.query) || {}
|
|
||||||
return q.nickname || '에이전트'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() { this.fetchList() },
|
|
||||||
methods: {
|
|
||||||
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
|
|
||||||
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
|
|
||||||
onSearch() { this.page = 1; this.fetchList() },
|
|
||||||
onPageChange() { this.fetchList() },
|
|
||||||
async fetchList() {
|
|
||||||
this.isLoading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentContentSettlementByCreator(this.agentId, {
|
|
||||||
startDateStr: this.startDateStr,
|
|
||||||
endDateStr: this.endDateStr,
|
|
||||||
page: this.page,
|
|
||||||
size: this.pageSize,
|
|
||||||
})
|
|
||||||
let payload = res && res.data ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
|
|
||||||
const data = payload || { totalCount: 0, total: {}, items: [] }
|
|
||||||
this.totalCount = Number(data.totalCount || 0)
|
|
||||||
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
|
|
||||||
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.total = Object.assign({}, defTotal, data.total || {})
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.totalPages = 1
|
|
||||||
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.items = []
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
@@ -1,515 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>{{ (agentNickname || '-') + ' 소속 크리에이터' }}</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
color="#3bb9f1"
|
|
||||||
dark
|
|
||||||
:loading="assignDialog.loading"
|
|
||||||
@click="openAssignDialog"
|
|
||||||
>
|
|
||||||
소속 추가
|
|
||||||
</v-btn>
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 소속 크리에이터 목록 -->
|
|
||||||
<v-row>
|
|
||||||
<v-col>
|
|
||||||
<v-simple-table class="elevation-10">
|
|
||||||
<template>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="text-center">
|
|
||||||
닉네임
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
소속일
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
관리
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr v-if="is_loading">
|
|
||||||
<td
|
|
||||||
colspan="3"
|
|
||||||
class="text-center"
|
|
||||||
>
|
|
||||||
불러오는 중...
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr v-else-if="items.length === 0">
|
|
||||||
<td
|
|
||||||
colspan="3"
|
|
||||||
class="text-center"
|
|
||||||
>
|
|
||||||
소속된 크리에이터가 없습니다.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr
|
|
||||||
v-for="row in items"
|
|
||||||
:key="row.creatorId"
|
|
||||||
>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ row.creatorNickname }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ formatDateTime(row.assignedAt) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<v-btn
|
|
||||||
text
|
|
||||||
small
|
|
||||||
color="error"
|
|
||||||
@click="openUnassignDialog(row)"
|
|
||||||
>
|
|
||||||
소속 해제
|
|
||||||
</v-btn>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</template>
|
|
||||||
</v-simple-table>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<v-row
|
|
||||||
v-if="total_page > 1"
|
|
||||||
class="text-center"
|
|
||||||
>
|
|
||||||
<v-col>
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="total_page"
|
|
||||||
circle
|
|
||||||
@input="fetchList"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
|
||||||
|
|
||||||
<!-- 소속 추가 다이얼로그 -->
|
|
||||||
<v-dialog
|
|
||||||
v-model="assignDialog.visible"
|
|
||||||
max-width="600px"
|
|
||||||
>
|
|
||||||
<v-card>
|
|
||||||
<v-card-title>크리에이터 소속 추가</v-card-title>
|
|
||||||
<v-card-text>
|
|
||||||
<v-autocomplete
|
|
||||||
v-model="assignDialog.selectedCreatorId"
|
|
||||||
:items="assignDialog.searchItems"
|
|
||||||
:loading="assignDialog.searchLoading"
|
|
||||||
:search-input.sync="assignDialog.searchQuery"
|
|
||||||
hide-no-data
|
|
||||||
hide-selected
|
|
||||||
clearable
|
|
||||||
label="크리에이터 검색"
|
|
||||||
item-text="creatorNickname"
|
|
||||||
item-value="creatorId"
|
|
||||||
@update:search-input="onSearchCreators"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<v-menu
|
|
||||||
ref="menuAssignedDate"
|
|
||||||
v-model="assignDialog.menu"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-model="assignDialog.assignedDate"
|
|
||||||
label="소속 날짜(자정으로 처리)"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
v-bind="attrs"
|
|
||||||
clearable
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="assignDialog.assignedDate"
|
|
||||||
locale="ko-kr"
|
|
||||||
@input="$refs.menuAssignedDate.save(assignDialog.assignedDate)"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-actions>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
text
|
|
||||||
@click="closeAssignDialog"
|
|
||||||
>
|
|
||||||
취소
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:disabled="!canAssign"
|
|
||||||
:loading="assignDialog.loading"
|
|
||||||
@click="onAssign"
|
|
||||||
>
|
|
||||||
추가
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
|
|
||||||
<!-- 소속 해제 다이얼로그 -->
|
|
||||||
<v-dialog
|
|
||||||
v-model="unassignDialog.visible"
|
|
||||||
max-width="600px"
|
|
||||||
>
|
|
||||||
<v-card>
|
|
||||||
<v-card-title>소속 해제</v-card-title>
|
|
||||||
<v-card-text>
|
|
||||||
<div class="mb-3">
|
|
||||||
크리에이터: <strong>{{ unassignDialog.target && unassignDialog.target.creatorNickname || '-' }}</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<v-menu
|
|
||||||
ref="menuUnassignDate"
|
|
||||||
v-model="unassignDialog.menuDate"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-model="unassignDialog.date"
|
|
||||||
label="해제 날짜"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
v-bind="attrs"
|
|
||||||
clearable
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="unassignDialog.date"
|
|
||||||
locale="ko-kr"
|
|
||||||
@input="$refs.menuUnassignDate.save(unassignDialog.date)"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
|
|
||||||
<v-menu
|
|
||||||
ref="menuUnassignTime"
|
|
||||||
v-model="unassignDialog.menuTime"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="290px"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-model="unassignDialog.time"
|
|
||||||
label="해제 시간(시:분)"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
v-bind="attrs"
|
|
||||||
clearable
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-time-picker
|
|
||||||
v-if="unassignDialog.menuTime"
|
|
||||||
v-model="unassignDialog.time"
|
|
||||||
format="24hr"
|
|
||||||
full-width
|
|
||||||
@click:minute="$refs.menuUnassignTime.save(unassignDialog.time)"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-actions>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
text
|
|
||||||
@click="closeUnassignDialog"
|
|
||||||
>
|
|
||||||
취소
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
color="error"
|
|
||||||
:disabled="!canUnassign"
|
|
||||||
:loading="unassignDialog.loading"
|
|
||||||
@click="onUnassign"
|
|
||||||
>
|
|
||||||
해제
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getAgentAssignedCreatorList,
|
|
||||||
searchAdminAgentAssignableCreators,
|
|
||||||
assignAgentCreator,
|
|
||||||
removeAgentCreator
|
|
||||||
} from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentDetail',
|
|
||||||
props: {
|
|
||||||
agentId: {
|
|
||||||
type: [String, Number],
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
agentNickname: this.$route && this.$route.query ? this.$route.query.nickname : '',
|
|
||||||
is_loading: false,
|
|
||||||
items: [],
|
|
||||||
totalCount: 0,
|
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
|
|
||||||
assignDialog: {
|
|
||||||
visible: false,
|
|
||||||
loading: false,
|
|
||||||
selectedCreatorId: null,
|
|
||||||
assignedDate: this.todayStr(),
|
|
||||||
menu: false,
|
|
||||||
searchQuery: '',
|
|
||||||
searchItems: [],
|
|
||||||
searchLoading: false,
|
|
||||||
// 디바운스 타이머 보관
|
|
||||||
searchDebounceTimer: null,
|
|
||||||
},
|
|
||||||
|
|
||||||
unassignDialog: {
|
|
||||||
visible: false,
|
|
||||||
loading: false,
|
|
||||||
target: null,
|
|
||||||
date: this.todayStr(),
|
|
||||||
time: this.nowTimeHHmm(),
|
|
||||||
menuDate: false,
|
|
||||||
menuTime: false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
total_page() {
|
|
||||||
return Math.max(1, Math.ceil((this.totalCount || 0) / this.page_size))
|
|
||||||
},
|
|
||||||
canAssign() {
|
|
||||||
return !!(this.assignDialog.selectedCreatorId && this.assignDialog.assignedDate)
|
|
||||||
},
|
|
||||||
canUnassign() {
|
|
||||||
return !!(this.unassignDialog.target && this.unassignDialog.date && this.unassignDialog.time)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fetchList(1)
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
// 검색 디바운스 타이머 정리
|
|
||||||
if (this.assignDialog && this.assignDialog.searchDebounceTimer) {
|
|
||||||
clearTimeout(this.assignDialog.searchDebounceTimer)
|
|
||||||
this.assignDialog.searchDebounceTimer = null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
notifyError(message) {
|
|
||||||
// vuetify-dialog 플러그인을 통해 오류 노출
|
|
||||||
if (this.$dialog && this.$dialog.notify && this.$dialog.notify.error) {
|
|
||||||
this.$dialog.notify.error(message)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getErrorMessage(e) {
|
|
||||||
const fallback = '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.'
|
|
||||||
try {
|
|
||||||
if (!e) return fallback
|
|
||||||
// axios 형태의 에러 응답을 우선 사용
|
|
||||||
const msg = (e.response && e.response.data && (e.response.data.message || e.response.data.error || e.response.data.msg))
|
|
||||||
|| e.message
|
|
||||||
return msg || fallback
|
|
||||||
} catch (_) {
|
|
||||||
return fallback
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async fetchList(page = this.page) {
|
|
||||||
if (this.is_loading) return
|
|
||||||
this.is_loading = true
|
|
||||||
try {
|
|
||||||
this.page = page
|
|
||||||
const res = await getAgentAssignedCreatorList(this.agentId, Math.max(1, this.page), this.page_size)
|
|
||||||
if (res && res.status === 200 && res.data && res.data.success === true) {
|
|
||||||
const data = (res.data && res.data.data) || { totalCount: 0, items: [] }
|
|
||||||
this.totalCount = data.totalCount || 0
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} else {
|
|
||||||
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
|
|
||||||
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.items = []
|
|
||||||
this.notifyError(this.getErrorMessage(e))
|
|
||||||
} finally {
|
|
||||||
this.is_loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
openAssignDialog() {
|
|
||||||
this.assignDialog.visible = true
|
|
||||||
this.assignDialog.selectedCreatorId = null
|
|
||||||
this.assignDialog.assignedDate = this.todayStr()
|
|
||||||
this.assignDialog.searchQuery = ''
|
|
||||||
this.assignDialog.searchItems = []
|
|
||||||
},
|
|
||||||
closeAssignDialog() {
|
|
||||||
this.assignDialog.visible = false
|
|
||||||
// 다이얼로그 닫힐 때 디바운스 및 로딩 상태 초기화
|
|
||||||
if (this.assignDialog.searchDebounceTimer) {
|
|
||||||
clearTimeout(this.assignDialog.searchDebounceTimer)
|
|
||||||
this.assignDialog.searchDebounceTimer = null
|
|
||||||
}
|
|
||||||
this.assignDialog.searchLoading = false
|
|
||||||
},
|
|
||||||
onSearchCreators(q) {
|
|
||||||
const query = (q || '').trim()
|
|
||||||
this.assignDialog.searchQuery = query
|
|
||||||
|
|
||||||
// 기존 타이머가 있으면 취소
|
|
||||||
if (this.assignDialog.searchDebounceTimer) {
|
|
||||||
clearTimeout(this.assignDialog.searchDebounceTimer)
|
|
||||||
this.assignDialog.searchDebounceTimer = null
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!query) {
|
|
||||||
// 검색어 없으면 결과/로딩 초기화
|
|
||||||
this.assignDialog.searchItems = []
|
|
||||||
this.assignDialog.searchLoading = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 디바운스: 300ms 이후 최신 검색어로 요청
|
|
||||||
this.assignDialog.searchDebounceTimer = setTimeout(async () => {
|
|
||||||
// 요청 직전 로딩 시작
|
|
||||||
this.assignDialog.searchLoading = true
|
|
||||||
const currentQuery = this.assignDialog.searchQuery
|
|
||||||
try {
|
|
||||||
const res = await searchAdminAgentAssignableCreators(currentQuery)
|
|
||||||
// 사용자가 그 사이에 검색어를 바꿨다면 이 응답은 무시
|
|
||||||
if (this.assignDialog.searchQuery !== currentQuery) return
|
|
||||||
|
|
||||||
if (res && res.status === 200 && res.data && res.data.success === true) {
|
|
||||||
const data = (res.data && res.data.data) || { totalCount: 0, items: [] }
|
|
||||||
this.assignDialog.searchItems = Array.isArray(data.items) ? data.items : []
|
|
||||||
} else {
|
|
||||||
this.assignDialog.searchItems = []
|
|
||||||
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
|
|
||||||
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// 에러 시에도 최신 검색어와 일치할 때만 처리
|
|
||||||
if (this.assignDialog.searchQuery === currentQuery) {
|
|
||||||
this.assignDialog.searchItems = []
|
|
||||||
this.notifyError(this.getErrorMessage(e))
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
// 최신 검색어와 일치할 때만 로딩 해제
|
|
||||||
if (this.assignDialog.searchQuery === currentQuery) {
|
|
||||||
this.assignDialog.searchLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 300)
|
|
||||||
},
|
|
||||||
async onAssign() {
|
|
||||||
if (!this.canAssign) return
|
|
||||||
this.assignDialog.loading = true
|
|
||||||
try {
|
|
||||||
const assignedAt = `${this.assignDialog.assignedDate}T00:00:00`
|
|
||||||
const res = await assignAgentCreator({
|
|
||||||
agentId: Number(this.agentId),
|
|
||||||
creatorId: Number(this.assignDialog.selectedCreatorId),
|
|
||||||
assignedAt,
|
|
||||||
})
|
|
||||||
if (res && res.status === 200 && res.data && res.data.success === true) {
|
|
||||||
this.closeAssignDialog()
|
|
||||||
this.fetchList(1)
|
|
||||||
} else {
|
|
||||||
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
|
|
||||||
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError(this.getErrorMessage(e))
|
|
||||||
} finally {
|
|
||||||
this.assignDialog.loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
openUnassignDialog(row) {
|
|
||||||
this.unassignDialog.visible = true
|
|
||||||
this.unassignDialog.loading = false
|
|
||||||
this.unassignDialog.target = row
|
|
||||||
this.unassignDialog.date = this.todayStr()
|
|
||||||
this.unassignDialog.time = this.nowTimeHHmm()
|
|
||||||
},
|
|
||||||
closeUnassignDialog() {
|
|
||||||
this.unassignDialog.visible = false
|
|
||||||
},
|
|
||||||
async onUnassign() {
|
|
||||||
if (!this.canUnassign) return
|
|
||||||
this.unassignDialog.loading = true
|
|
||||||
try {
|
|
||||||
const time = this.unassignDialog.time || '00:00'
|
|
||||||
const unassignedAt = `${this.unassignDialog.date}T${time}:00`
|
|
||||||
const res = await removeAgentCreator({
|
|
||||||
creatorId: Number(this.unassignDialog.target.creatorId),
|
|
||||||
unassignedAt,
|
|
||||||
})
|
|
||||||
if (res && res.status === 200 && res.data && res.data.success === true) {
|
|
||||||
this.closeUnassignDialog()
|
|
||||||
this.fetchList(this.page)
|
|
||||||
} else {
|
|
||||||
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
|
|
||||||
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError(this.getErrorMessage(e))
|
|
||||||
} finally {
|
|
||||||
this.unassignDialog.loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatDateTime(s) {
|
|
||||||
if (!s) return '-'
|
|
||||||
try {
|
|
||||||
// s는 LocalDateTime 문자열(예: 2026-01-01T00:00:00)
|
|
||||||
const [d, t] = String(s).split('T')
|
|
||||||
const hhmm = (t || '').slice(0,5)
|
|
||||||
return `${d} ${hhmm}`
|
|
||||||
} catch (e) {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
},
|
|
||||||
todayStr() {
|
|
||||||
const d = new Date()
|
|
||||||
const mm = String(d.getMonth() + 1).padStart(2, '0')
|
|
||||||
const dd = String(d.getDate()).padStart(2, '0')
|
|
||||||
return `${d.getFullYear()}-${mm}-${dd}`
|
|
||||||
},
|
|
||||||
nowTimeHHmm() {
|
|
||||||
const d = new Date()
|
|
||||||
const hh = String(d.getHours()).padStart(2, '0')
|
|
||||||
const mm = String(d.getMinutes()).padStart(2, '0')
|
|
||||||
return `${hh}:${mm}`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,242 +0,0 @@
|
|||||||
<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="6"
|
|
||||||
class="text-left"
|
|
||||||
>
|
|
||||||
<strong>{{ settlementMonthLabel }}</strong>
|
|
||||||
</v-col>
|
|
||||||
<v-col
|
|
||||||
cols="6"
|
|
||||||
class="text-right"
|
|
||||||
>
|
|
||||||
총 에이전트 수: <strong>{{ totalCount | numberFormat }}</strong>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<v-row>
|
|
||||||
<v-col>
|
|
||||||
<v-simple-table class="elevation-10">
|
|
||||||
<template>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="text-center">
|
|
||||||
에이전트 닉네임
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
소속 크리에이터 수
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
라이브
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
콘텐츠
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
커뮤니티
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
콘텐츠 후원
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
채널 후원
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
합계
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr
|
|
||||||
v-for="item in agentList"
|
|
||||||
:key="item.agentId"
|
|
||||||
>
|
|
||||||
<td
|
|
||||||
class="link"
|
|
||||||
@click="goAgentDetail(item)"
|
|
||||||
>
|
|
||||||
{{ item.agentNickname }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ item.assignedCreatorCount | numberFormat }}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="text-center clickable"
|
|
||||||
@click="goSettlement(item, 'live')"
|
|
||||||
>
|
|
||||||
{{ formatCurrency(item.liveAgentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="text-center clickable"
|
|
||||||
@click="goSettlement(item, 'content')"
|
|
||||||
>
|
|
||||||
{{ formatCurrency(item.contentAgentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="text-center clickable"
|
|
||||||
@click="goSettlement(item, 'community')"
|
|
||||||
>
|
|
||||||
{{ formatCurrency(item.communityAgentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="text-center clickable"
|
|
||||||
@click="goSettlement(item, 'content-donation')"
|
|
||||||
>
|
|
||||||
{{ formatCurrency(item.contentDonationAgentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="text-center clickable"
|
|
||||||
@click="goSettlement(item, 'channel-donation')"
|
|
||||||
>
|
|
||||||
{{ formatCurrency(item.channelDonationAgentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ formatCurrency(totalAmount(item)) }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</template>
|
|
||||||
</v-simple-table>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<!-- 페이지네이션은 서버 지원 시 활성화
|
|
||||||
<v-row class="text-center">
|
|
||||||
<v-col>
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="total_page"
|
|
||||||
circle
|
|
||||||
@input="fetchList"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
-->
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAgentList } from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentList',
|
|
||||||
filters: {
|
|
||||||
numberFormat(v) {
|
|
||||||
if (v === null || v === undefined) return '-'
|
|
||||||
try {
|
|
||||||
return new Intl.NumberFormat('ko-KR').format(v)
|
|
||||||
} catch (e) {
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
agentList: [],
|
|
||||||
totalCount: 0,
|
|
||||||
// 페이지네이션(필요 시)
|
|
||||||
page: 1,
|
|
||||||
total_page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
is_loading: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
settlementMonthLabel() {
|
|
||||||
const now = new Date()
|
|
||||||
const month = now.getMonth() + 1 // 1~12
|
|
||||||
return `${month}월 정산 내역`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fetchList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async fetchList() {
|
|
||||||
if (this.is_loading) return
|
|
||||||
this.is_loading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentList(/* this.page, this.page_size */)
|
|
||||||
// 일부 API는 { data: { totalCount, items } } 형태로 한 번 더 래핑됨을 대비
|
|
||||||
let payload = (res && res.data) ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) {
|
|
||||||
payload = payload.data
|
|
||||||
}
|
|
||||||
const data = payload || { totalCount: 0, items: [] }
|
|
||||||
this.totalCount = data.totalCount || 0
|
|
||||||
this.agentList = Array.isArray(data.items) ? data.items : []
|
|
||||||
// 서버가 페이지네이션 정보를 주면 설정하도록 남김
|
|
||||||
this.total_page = Math.max(1, Math.ceil(this.totalCount / this.page_size))
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.agentList = []
|
|
||||||
} finally {
|
|
||||||
this.is_loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatCurrency(n) {
|
|
||||||
const num = Number(n || 0)
|
|
||||||
return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(num)
|
|
||||||
},
|
|
||||||
totalAmount(item) {
|
|
||||||
const {
|
|
||||||
liveAgentSettlementAmount = 0,
|
|
||||||
contentAgentSettlementAmount = 0,
|
|
||||||
communityAgentSettlementAmount = 0,
|
|
||||||
contentDonationAgentSettlementAmount = 0,
|
|
||||||
channelDonationAgentSettlementAmount = 0,
|
|
||||||
} = item || {}
|
|
||||||
return (
|
|
||||||
(liveAgentSettlementAmount || 0) +
|
|
||||||
(contentAgentSettlementAmount || 0) +
|
|
||||||
(communityAgentSettlementAmount || 0) +
|
|
||||||
(contentDonationAgentSettlementAmount || 0) +
|
|
||||||
(channelDonationAgentSettlementAmount || 0)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
goAgentDetail(item) {
|
|
||||||
this.$router.push({ name: 'AgentDetail', params: { agentId: item.agentId }, query: { nickname: item.agentNickname } })
|
|
||||||
},
|
|
||||||
goSettlement(item, type) {
|
|
||||||
const id = item.agentId
|
|
||||||
const nameMap = {
|
|
||||||
'live': 'AgentSettlementLive',
|
|
||||||
'content': 'AgentSettlementContent',
|
|
||||||
'community': 'AgentSettlementCommunity',
|
|
||||||
'content-donation': 'AgentSettlementContentDonation',
|
|
||||||
'channel-donation': 'AgentSettlementChannelDonation',
|
|
||||||
}
|
|
||||||
const name = nameMap[type]
|
|
||||||
if (!name) return
|
|
||||||
this.$router.push({ name, params: { agentId: id }, query: { nickname: item.agentNickname } })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.link {
|
|
||||||
color: #3f51b5;
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
.clickable {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
/* 테이블 셀 가운데 정렬 */
|
|
||||||
table th,
|
|
||||||
table td {
|
|
||||||
text-align: center !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,290 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 라이브</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 필터 영역 -->
|
|
||||||
<v-row
|
|
||||||
class="mt-2 mb-2"
|
|
||||||
align="center"
|
|
||||||
justify="end"
|
|
||||||
>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuStart"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="시작일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="startDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="startDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuStart = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuEnd"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="종료일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="endDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="endDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuEnd = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="2"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="isLoading"
|
|
||||||
@click="onSearch"
|
|
||||||
>
|
|
||||||
조회
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 테이블 영역 -->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="items"
|
|
||||||
:loading="isLoading"
|
|
||||||
:items-per-page="pageSize"
|
|
||||||
class="elevation-1"
|
|
||||||
disable-pagination
|
|
||||||
hide-default-footer
|
|
||||||
>
|
|
||||||
<!-- 표 최상단 합계 행 -->
|
|
||||||
<template v-slot:body.prepend>
|
|
||||||
<tr>
|
|
||||||
<td class="text-center">
|
|
||||||
합계
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.count) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ numberFormat(total.totalCan) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.krw) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.fee) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.settlementAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.tax) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.depositAmount) }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ currencyKRW(total.agentSettlementAmount) }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.count="{ item }">
|
|
||||||
{{ numberFormat(item.count) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalCan="{ item }">
|
|
||||||
{{ numberFormat(item.totalCan) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.krw="{ item }">
|
|
||||||
{{ currencyKRW(item.krw) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.fee="{ item }">
|
|
||||||
{{ currencyKRW(item.fee) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.settlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.settlementAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.tax="{ item }">
|
|
||||||
{{ currencyKRW(item.tax) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.depositAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.depositAmount) }}
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.agentSettlementAmount="{ item }">
|
|
||||||
{{ currencyKRW(item.agentSettlementAmount) }}
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
|
|
||||||
<!-- 페이지네이션 -->
|
|
||||||
<div class="d-flex justify-center mt-2">
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="totalPages"
|
|
||||||
:total-visible="7"
|
|
||||||
@input="onPageChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAgentLiveSettlementByCreator } from '@/api/agent'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AgentLiveSettlement',
|
|
||||||
props: {
|
|
||||||
agentId: { type: [String, Number], required: true }
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
const today = new Date()
|
|
||||||
const yyyy = today.getFullYear()
|
|
||||||
const mm = String(today.getMonth() + 1).padStart(2, '0')
|
|
||||||
const dd = String(today.getDate()).padStart(2, '0')
|
|
||||||
const firstDay = `${yyyy}-${mm}-01`
|
|
||||||
const endDay = `${yyyy}-${mm}-${dd}`
|
|
||||||
return {
|
|
||||||
// 필터
|
|
||||||
startDateStr: firstDay,
|
|
||||||
endDateStr: endDay,
|
|
||||||
menuStart: false,
|
|
||||||
menuEnd: false,
|
|
||||||
page: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
|
|
||||||
// 데이터
|
|
||||||
isLoading: false,
|
|
||||||
totalCount: 0,
|
|
||||||
totalPages: 1,
|
|
||||||
total: {
|
|
||||||
count: 0,
|
|
||||||
totalCan: 0,
|
|
||||||
krw: 0,
|
|
||||||
fee: 0,
|
|
||||||
settlementAmount: 0,
|
|
||||||
tax: 0,
|
|
||||||
depositAmount: 0,
|
|
||||||
agentSettlementAmount: 0
|
|
||||||
},
|
|
||||||
items: [],
|
|
||||||
|
|
||||||
headers: [
|
|
||||||
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
|
|
||||||
{ text: '건수', value: 'count', align: 'center', width: 100 },
|
|
||||||
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
|
|
||||||
{ text: '원화', value: 'krw', align: 'center', width: 140 },
|
|
||||||
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
|
|
||||||
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '세금', value: 'tax', align: 'center', width: 120 },
|
|
||||||
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
|
|
||||||
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
displayNickname() {
|
|
||||||
const q = (this.$route && this.$route.query) || {}
|
|
||||||
return q.nickname || '에이전트'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.fetchList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
numberFormat(n) {
|
|
||||||
const v = Number(n || 0)
|
|
||||||
return new Intl.NumberFormat('ko-KR').format(v)
|
|
||||||
},
|
|
||||||
currencyKRW(n) {
|
|
||||||
const v = Number(n || 0)
|
|
||||||
return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(v)
|
|
||||||
},
|
|
||||||
onSearch() {
|
|
||||||
this.page = 1
|
|
||||||
this.fetchList()
|
|
||||||
},
|
|
||||||
onPageChange() {
|
|
||||||
this.fetchList()
|
|
||||||
},
|
|
||||||
async fetchList() {
|
|
||||||
this.isLoading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentLiveSettlementByCreator(this.agentId, {
|
|
||||||
startDateStr: this.startDateStr,
|
|
||||||
endDateStr: this.endDateStr,
|
|
||||||
// UI는 1-based, API 유틸이 0-based로 변환함
|
|
||||||
page: this.page,
|
|
||||||
size: this.pageSize,
|
|
||||||
})
|
|
||||||
// 일부 API가 { data: {...} } 래핑일 수 있으므로 방어적으로 파싱
|
|
||||||
let payload = res && res.data ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) {
|
|
||||||
payload = payload.data
|
|
||||||
}
|
|
||||||
const data = payload || { totalCount: 0, total: {}, items: [] }
|
|
||||||
this.totalCount = Number(data.totalCount || 0)
|
|
||||||
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
|
|
||||||
const defTotal = {
|
|
||||||
count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0
|
|
||||||
}
|
|
||||||
this.total = Object.assign({}, defTotal, data.total || {})
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.totalPages = 1
|
|
||||||
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
|
|
||||||
this.items = []
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
@@ -1,339 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-spacer />
|
|
||||||
<v-toolbar-title>에이전트 정산 비율</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
dark
|
|
||||||
@click="onClickCreate"
|
|
||||||
>
|
|
||||||
에이전트 비율 추가
|
|
||||||
</v-btn>
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<v-row>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
class="text-right"
|
|
||||||
>
|
|
||||||
총 에이전트 수: <strong>{{ totalCount | numberFormat }}</strong>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<v-row>
|
|
||||||
<v-col>
|
|
||||||
<v-simple-table class="elevation-10">
|
|
||||||
<template>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="text-center">
|
|
||||||
에이전트 닉네임
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
정산 비율(%)
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
|
||||||
관리
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr
|
|
||||||
v-for="item in items"
|
|
||||||
:key="item.memberId"
|
|
||||||
>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ item.nickname }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ (item.current && item.current.settlementRatio != null) ? item.current.settlementRatio : '-' }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<v-btn
|
|
||||||
small
|
|
||||||
outlined
|
|
||||||
color="primary"
|
|
||||||
@click="onClickEdit(item)"
|
|
||||||
>
|
|
||||||
수정
|
|
||||||
</v-btn>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr v-if="!loading && (!items || items.length===0)">
|
|
||||||
<td
|
|
||||||
colspan="3"
|
|
||||||
class="text-center grey--text"
|
|
||||||
>
|
|
||||||
데이터가 없습니다.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</template>
|
|
||||||
</v-simple-table>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
|
||||||
|
|
||||||
<!-- 등록/수정 팝업 -->
|
|
||||||
<v-dialog
|
|
||||||
v-model="dialog"
|
|
||||||
max-width="560px"
|
|
||||||
persistent
|
|
||||||
>
|
|
||||||
<v-card>
|
|
||||||
<v-card-title class="headline">
|
|
||||||
{{ isEdit ? '에이전트 비율 수정' : '에이전트 비율 등록' }}
|
|
||||||
</v-card-title>
|
|
||||||
<v-card-text>
|
|
||||||
<v-form
|
|
||||||
ref="form"
|
|
||||||
v-model="formValid"
|
|
||||||
>
|
|
||||||
<!-- 에이전트 선택/표시 -->
|
|
||||||
<div v-if="!isEdit">
|
|
||||||
<v-autocomplete
|
|
||||||
v-model="selectedAgent"
|
|
||||||
:items="agentSearchItems"
|
|
||||||
:loading="agentSearchLoading"
|
|
||||||
:search-input.sync="agentSearchQuery"
|
|
||||||
hide-selected
|
|
||||||
hide-no-data
|
|
||||||
label="에이전트 닉네임 검색"
|
|
||||||
item-text="nickname"
|
|
||||||
item-value="id"
|
|
||||||
return-object
|
|
||||||
clearable
|
|
||||||
:rules="[v=>!!v || '에이전트를 선택하세요.']"
|
|
||||||
@update:search-input="onSearchAgent"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<v-text-field
|
|
||||||
v-model="form.nickname"
|
|
||||||
label="에이전트"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<v-text-field
|
|
||||||
v-model.number="form.settlementRatio"
|
|
||||||
label="정산 비율(%)"
|
|
||||||
type="number"
|
|
||||||
min="0"
|
|
||||||
max="100"
|
|
||||||
:rules="ratioRules"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<v-text-field
|
|
||||||
v-model="form.effectiveFrom"
|
|
||||||
label="적용 시작 날짜"
|
|
||||||
type="date"
|
|
||||||
:rules="[v=>!!v || '적용 시작 날짜를 선택하세요.']"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</v-form>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-actions>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
text
|
|
||||||
:disabled="submitting"
|
|
||||||
@click="closeDialog"
|
|
||||||
>
|
|
||||||
취소
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
dark
|
|
||||||
:loading="submitting"
|
|
||||||
:disabled="!formValid || submitting"
|
|
||||||
@click="onSubmit"
|
|
||||||
>
|
|
||||||
등록
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getAgentSettlementRatioList,
|
|
||||||
createAgentSettlementRatio,
|
|
||||||
updateAgentSettlementRatio,
|
|
||||||
searchAgentByNickname
|
|
||||||
} from '@/api/agent'
|
|
||||||
export default {
|
|
||||||
name: 'AgentSettlementRatio',
|
|
||||||
filters: {
|
|
||||||
numberFormat(v) {
|
|
||||||
if (v === null || v === undefined) return '-'
|
|
||||||
try {
|
|
||||||
return new Intl.NumberFormat('ko-KR').format(v)
|
|
||||||
} catch (e) {
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
items: [],
|
|
||||||
totalCount: 0,
|
|
||||||
|
|
||||||
dialog: false,
|
|
||||||
isEdit: false,
|
|
||||||
submitting: false,
|
|
||||||
formValid: false,
|
|
||||||
form: {
|
|
||||||
memberId: null,
|
|
||||||
nickname: '',
|
|
||||||
settlementRatio: null,
|
|
||||||
effectiveFrom: ''
|
|
||||||
},
|
|
||||||
ratioRules: [
|
|
||||||
v => (v !== null && v !== '' && !isNaN(v)) || '숫자를 입력하세요.',
|
|
||||||
v => (v >= 0 && v <= 100) || '0~100 사이 값이어야 합니다.'
|
|
||||||
],
|
|
||||||
|
|
||||||
// 에이전트 검색
|
|
||||||
selectedAgent: null,
|
|
||||||
agentSearchQuery: '',
|
|
||||||
agentSearchItems: [],
|
|
||||||
agentSearchLoading: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fetchList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async fetchList() {
|
|
||||||
if (this.loading) return
|
|
||||||
this.loading = true
|
|
||||||
try {
|
|
||||||
const res = await getAgentSettlementRatioList()
|
|
||||||
let payload = (res && res.data) ? res.data : null
|
|
||||||
if (payload && payload.data && (!payload.items && !payload.totalCount)) {
|
|
||||||
payload = payload.data
|
|
||||||
}
|
|
||||||
const data = payload || { totalCount: 0, items: [] }
|
|
||||||
this.totalCount = data.totalCount || 0
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : []
|
|
||||||
} catch (e) {
|
|
||||||
this.totalCount = 0
|
|
||||||
this.items = []
|
|
||||||
} finally {
|
|
||||||
this.loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onClickCreate() {
|
|
||||||
this.isEdit = false
|
|
||||||
this.resetForm()
|
|
||||||
this.dialog = true
|
|
||||||
},
|
|
||||||
onClickEdit(item) {
|
|
||||||
this.isEdit = true
|
|
||||||
this.resetForm()
|
|
||||||
this.form.memberId = item.memberId
|
|
||||||
this.form.nickname = item.nickname
|
|
||||||
this.form.settlementRatio = item && item.current ? item.current.settlementRatio : null
|
|
||||||
this.form.effectiveFrom = this.defaultDateTimeLocal()
|
|
||||||
this.dialog = true
|
|
||||||
},
|
|
||||||
closeDialog() {
|
|
||||||
if (this.submitting) return
|
|
||||||
this.dialog = false
|
|
||||||
},
|
|
||||||
resetForm() {
|
|
||||||
this.submitting = false
|
|
||||||
this.formValid = false
|
|
||||||
this.form = {
|
|
||||||
memberId: null,
|
|
||||||
nickname: '',
|
|
||||||
settlementRatio: null,
|
|
||||||
effectiveFrom: this.defaultDateTimeLocal()
|
|
||||||
}
|
|
||||||
this.selectedAgent = null
|
|
||||||
this.agentSearchQuery = ''
|
|
||||||
this.agentSearchItems = []
|
|
||||||
if (this.$refs.form && this.$refs.form.resetValidation) this.$refs.form.resetValidation()
|
|
||||||
},
|
|
||||||
defaultDateTimeLocal() {
|
|
||||||
// 날짜만 선택하도록 기본값은 오늘 날짜 (YYYY-MM-DD)
|
|
||||||
const d = new Date()
|
|
||||||
const pad = n => n.toString().padStart(2, '0')
|
|
||||||
const yyyy = d.getFullYear()
|
|
||||||
const MM = pad(d.getMonth() + 1)
|
|
||||||
const dd = pad(d.getDate())
|
|
||||||
return `${yyyy}-${MM}-${dd}`
|
|
||||||
},
|
|
||||||
toLocalDateTimeString(v) {
|
|
||||||
// 입력 타입이 date이므로 "YYYY-MM-DD"를 받아 "YYYY-MM-DDT00:00:00"로 변환
|
|
||||||
// 과거 호환: datetime-local("YYYY-MM-DDTHH:mm")가 들어오면 초를 붙여 반환
|
|
||||||
if (!v) return null
|
|
||||||
if (v.length === 10) return `${v}T00:00:00`
|
|
||||||
if (v.length === 16) return `${v}:00`
|
|
||||||
// 이미 초까지 포함된 형태면 그대로 사용
|
|
||||||
if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/.test(v)) {
|
|
||||||
return v.length === 16 ? `${v}:00` : v
|
|
||||||
}
|
|
||||||
return `${v}T00:00:00`
|
|
||||||
},
|
|
||||||
async onSubmit() {
|
|
||||||
if (this.submitting) return
|
|
||||||
const ok = await this.$refs.form.validate?.()
|
|
||||||
if (!ok) return
|
|
||||||
try {
|
|
||||||
this.submitting = true
|
|
||||||
const payload = {
|
|
||||||
memberId: this.isEdit ? this.form.memberId : (this.selectedAgent && this.selectedAgent.id),
|
|
||||||
settlementRatio: Number(this.form.settlementRatio),
|
|
||||||
effectiveFrom: this.toLocalDateTimeString(this.form.effectiveFrom)
|
|
||||||
}
|
|
||||||
if (!payload.memberId) {
|
|
||||||
this.submitting = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.isEdit) {
|
|
||||||
await updateAgentSettlementRatio(payload)
|
|
||||||
} else {
|
|
||||||
await createAgentSettlementRatio(payload)
|
|
||||||
}
|
|
||||||
this.dialog = false
|
|
||||||
await this.fetchList()
|
|
||||||
} catch (e) {
|
|
||||||
// 실패 시에도 버튼 로딩 해제
|
|
||||||
} finally {
|
|
||||||
this.submitting = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async onSearchAgent(q) {
|
|
||||||
if (!q) {
|
|
||||||
this.agentSearchItems = []
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.agentSearchLoading = true
|
|
||||||
try {
|
|
||||||
const list = await searchAgentByNickname(q)
|
|
||||||
this.agentSearchItems = Array.isArray(list) ? list : []
|
|
||||||
} catch (e) {
|
|
||||||
this.agentSearchItems = []
|
|
||||||
} finally {
|
|
||||||
this.agentSearchLoading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.clickable { cursor: pointer; }
|
|
||||||
.link { color: #1976d2; cursor: pointer; text-decoration: underline; }
|
|
||||||
</style>
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
color="#3bb9f1"
|
color="#3bb9f1"
|
||||||
dark
|
dark
|
||||||
depressed
|
depressed
|
||||||
@click="getCalculateChannelDonationByDate"
|
@click="getCalculateChannelDonationByCreator"
|
||||||
>
|
>
|
||||||
조회
|
조회
|
||||||
</v-btn>
|
</v-btn>
|
||||||
@@ -47,15 +47,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="excelColumns"
|
||||||
dark
|
:file-name="'채널후원정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#3bb9f1"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -180,6 +187,17 @@ export default {
|
|||||||
{ text: '정산금액', align: 'center', sortable: false, value: 'settlementAmount' },
|
{ text: '정산금액', align: 'center', sortable: false, value: 'settlementAmount' },
|
||||||
{ text: '원천세(3.3%)', align: 'center', sortable: false, value: 'withholdingTax' },
|
{ text: '원천세(3.3%)', align: 'center', sortable: false, value: 'withholdingTax' },
|
||||||
{ text: '입금액', align: 'center', sortable: false, value: 'depositAmount' }
|
{ 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' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -192,7 +210,7 @@ export default {
|
|||||||
this.start_date = this.formatDate(firstDate)
|
this.start_date = this.formatDate(firstDate)
|
||||||
this.end_date = this.formatDate(lastDate)
|
this.end_date = this.formatDate(lastDate)
|
||||||
|
|
||||||
await this.getCalculateChannelDonationByDate()
|
await this.getCalculateChannelDonationByCreator()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -208,13 +226,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async next() {
|
async next() {
|
||||||
await this.getCalculateChannelDonationByDate()
|
await this.getCalculateChannelDonationByCreator()
|
||||||
},
|
},
|
||||||
|
|
||||||
async getCalculateChannelDonationByDate() {
|
async getCalculateChannelDonationByCreator() {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
try {
|
try {
|
||||||
const res = await api.getCalculateChannelDonationByDate(
|
const res = await api.getCalculateChannelDonationByCreator(
|
||||||
this.start_date.substring(0, 10),
|
this.start_date.substring(0, 10),
|
||||||
this.end_date.substring(0, 10),
|
this.end_date.substring(0, 10),
|
||||||
this.page,
|
this.page,
|
||||||
@@ -234,24 +252,6 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateChannelDonationByDateExcel(
|
|
||||||
this.start_date.substring(0, 10),
|
|
||||||
this.end_date.substring(0, 10)
|
|
||||||
)
|
|
||||||
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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,262 +0,0 @@
|
|||||||
<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">
|
|
||||||
<v-btn
|
|
||||||
block
|
|
||||||
color="#3bb9f1"
|
|
||||||
dark
|
|
||||||
depressed
|
|
||||||
@click="downloadExcel"
|
|
||||||
>
|
|
||||||
엑셀 다운로드
|
|
||||||
</v-btn>
|
|
||||||
</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>
|
|
||||||
합계
|
|
||||||
</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.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: 'CalculateChannelDonationByCreator',
|
|
||||||
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: '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' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateChannelDonationByCreatorExcel(
|
|
||||||
this.start_date.substring(0, 10),
|
|
||||||
this.end_date.substring(0, 10)
|
|
||||||
)
|
|
||||||
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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.datepicker {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -47,15 +47,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#3bb9f1"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -149,6 +156,40 @@ export default {
|
|||||||
page_size: 20,
|
page_size: 20,
|
||||||
total_page: 0,
|
total_page: 0,
|
||||||
items: [],
|
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: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '이메일',
|
text: '이메일',
|
||||||
@@ -268,21 +309,6 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateCommunityByCreatorExcel(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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
depressed
|
depressed
|
||||||
@click="getCalculateCommunityPost"
|
@click="getCalculateCommunityPost"
|
||||||
@@ -47,15 +47,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'커뮤니티-정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'커뮤니티-정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#9970ff"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -129,6 +136,52 @@ export default {
|
|||||||
page_size: 20,
|
page_size: 20,
|
||||||
total_page: 0,
|
total_page: 0,
|
||||||
items: [],
|
items: [],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
label: '날짜',
|
||||||
|
field: 'date',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '크리에이터',
|
||||||
|
field: 'nickname',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '내용(앞 10글자)',
|
||||||
|
field: 'title'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '판매금액(캔)',
|
||||||
|
field: 'can',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '구매유저수',
|
||||||
|
field: 'numberOfPurchase',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '합계(캔)',
|
||||||
|
field: 'totalCan',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '원화',
|
||||||
|
field: 'totalKrw',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '수수료\n(6.6%)',
|
||||||
|
field: 'paymentFee',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '정산금액',
|
||||||
|
field: 'settlementAmount',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '원천세\n(3.3%)',
|
||||||
|
field: 'tax',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '입금액',
|
||||||
|
field: 'depositAmount',
|
||||||
|
}
|
||||||
|
],
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '날짜',
|
text: '날짜',
|
||||||
@@ -256,21 +309,6 @@ export default {
|
|||||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateCommunityPostExcel(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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
depressed
|
depressed
|
||||||
@click="getCalculateContent"
|
@click="getCalculateContent"
|
||||||
@@ -48,15 +48,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#9970ff"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -119,16 +126,6 @@
|
|||||||
</v-data-table>
|
</v-data-table>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="text-center">
|
|
||||||
<v-col>
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="total_page"
|
|
||||||
circle
|
|
||||||
@input="next"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -146,10 +143,61 @@ export default {
|
|||||||
is_loading: false,
|
is_loading: false,
|
||||||
start_date: null,
|
start_date: null,
|
||||||
end_date: null,
|
end_date: null,
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
total_page: 0,
|
|
||||||
items: [],
|
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: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '판매일',
|
text: '판매일',
|
||||||
@@ -273,10 +321,9 @@ export default {
|
|||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.getCalculateContent(this.start_date, this.end_date, this.page, this.page_size)
|
const res = await api.getCalculateContent(this.start_date, this.end_date)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
this.items = res.data.data.items
|
this.items = res.data.data
|
||||||
this.total_page = Math.ceil(res.data.data.totalCount / this.page_size)
|
|
||||||
} else {
|
} else {
|
||||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
}
|
}
|
||||||
@@ -286,25 +333,6 @@ export default {
|
|||||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
next() {
|
|
||||||
this.getCalculateContent()
|
|
||||||
},
|
|
||||||
|
|
||||||
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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,15 +47,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#3bb9f1"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -149,6 +156,40 @@ export default {
|
|||||||
page_size: 20,
|
page_size: 20,
|
||||||
total_page: 0,
|
total_page: 0,
|
||||||
items: [],
|
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: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '이메일',
|
text: '이메일',
|
||||||
@@ -268,21 +309,6 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateContentByCreatorExcel(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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
depressed
|
depressed
|
||||||
@click="getCalculateContentDonation"
|
@click="getCalculateContentDonation"
|
||||||
@@ -48,15 +48,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#9970ff"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -111,16 +118,6 @@
|
|||||||
</v-data-table>
|
</v-data-table>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="text-center">
|
|
||||||
<v-col>
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="total_page"
|
|
||||||
circle
|
|
||||||
@input="next"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -138,10 +135,57 @@ export default {
|
|||||||
is_loading: false,
|
is_loading: false,
|
||||||
start_date: null,
|
start_date: null,
|
||||||
end_date: null,
|
end_date: null,
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
total_page: 0,
|
|
||||||
items: [],
|
items: [],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
label: '후원날짜',
|
||||||
|
field: 'donationDate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '크리에이터',
|
||||||
|
field: 'nickname',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '콘텐츠 제목',
|
||||||
|
field: 'title',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '구분',
|
||||||
|
field: 'paidOrFree',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '후원수',
|
||||||
|
field: 'numberOfDonation',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '후원날짜',
|
text: '후원날짜',
|
||||||
@@ -259,10 +303,9 @@ export default {
|
|||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.getCalculateContentDonation(this.start_date, this.end_date, this.page, this.page_size)
|
const res = await api.getCalculateContentDonation(this.start_date, this.end_date)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
this.items = res.data.data.items
|
this.items = res.data.data
|
||||||
this.total_page = Math.ceil(res.data.data.totalCount / this.page_size)
|
|
||||||
} else {
|
} else {
|
||||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
}
|
}
|
||||||
@@ -272,25 +315,6 @@ export default {
|
|||||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
next() {
|
|
||||||
this.getCalculateContentDonation()
|
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateContentDonationExcel(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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
depressed
|
depressed
|
||||||
@click="getCalculateLive"
|
@click="getCalculateLive"
|
||||||
@@ -47,15 +47,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#9970ff"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -69,6 +76,10 @@
|
|||||||
class="elevation-1"
|
class="elevation-1"
|
||||||
hide-default-footer
|
hide-default-footer
|
||||||
>
|
>
|
||||||
|
<template v-slot:item.email="{ item }">
|
||||||
|
{{ item.email }}
|
||||||
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.nickname="{ item }">
|
<template v-slot:item.nickname="{ item }">
|
||||||
{{ item.nickname }}
|
{{ item.nickname }}
|
||||||
</template>
|
</template>
|
||||||
@@ -112,29 +123,9 @@
|
|||||||
<template v-slot:item.depositAmount="{ item }">
|
<template v-slot:item.depositAmount="{ item }">
|
||||||
{{ item.depositAmount.toLocaleString() }} 원
|
{{ item.depositAmount.toLocaleString() }} 원
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.actions="{ item }">
|
|
||||||
<v-btn
|
|
||||||
small
|
|
||||||
color="error"
|
|
||||||
@click="refund(item)"
|
|
||||||
>
|
|
||||||
환불
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
</v-data-table>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="text-center">
|
|
||||||
<v-col>
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="total_page"
|
|
||||||
circle
|
|
||||||
@input="next"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -152,11 +143,68 @@ export default {
|
|||||||
is_loading: false,
|
is_loading: false,
|
||||||
start_date: null,
|
start_date: null,
|
||||||
end_date: null,
|
end_date: null,
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
total_page: 0,
|
|
||||||
items: [],
|
items: [],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
label: "이메일",
|
||||||
|
field: "email",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "크리에이터",
|
||||||
|
field: "nickname",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "날짜",
|
||||||
|
field: "date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "제목",
|
||||||
|
field: "title",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "구분",
|
||||||
|
field: "canUsageStr",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "입장캔",
|
||||||
|
field: "entranceFee",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "인원",
|
||||||
|
field: "numberOfPeople",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "합계(캔)",
|
||||||
|
field: "totalAmount",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "원화",
|
||||||
|
field: "totalKrw",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "결제수수료(6.6%)",
|
||||||
|
field: "paymentFee",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "정산금액",
|
||||||
|
field: "settlementAmount",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "원천세(3.3%)",
|
||||||
|
field: "tax",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "입금액",
|
||||||
|
field: "depositAmount",
|
||||||
|
},
|
||||||
|
],
|
||||||
headers: [
|
headers: [
|
||||||
|
{
|
||||||
|
text: '이메일',
|
||||||
|
align: 'center',
|
||||||
|
sortable: false,
|
||||||
|
value: 'email',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: '크리에이터',
|
text: '크리에이터',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -227,12 +275,6 @@ export default {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
value: 'depositAmount',
|
value: 'depositAmount',
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '관리',
|
|
||||||
align: 'center',
|
|
||||||
sortable: false,
|
|
||||||
value: 'actions',
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -273,10 +315,9 @@ export default {
|
|||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.getCalculateLive(this.start_date, this.end_date, this.page, this.page_size)
|
const res = await api.getCalculateLive(this.start_date, this.end_date)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
this.items = res.data.data.items
|
this.items = res.data.data
|
||||||
this.total_page = Math.ceil(res.data.data.totalCount / this.page_size)
|
|
||||||
} else {
|
} else {
|
||||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
}
|
}
|
||||||
@@ -286,41 +327,6 @@ export default {
|
|||||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
next() {
|
|
||||||
this.getCalculateLive()
|
|
||||||
},
|
|
||||||
|
|
||||||
async refund(item) {
|
|
||||||
if (confirm('정말로 환불하시겠습니까?')) {
|
|
||||||
try {
|
|
||||||
const res = await api.refundLive(item.roomId, item.canUsageStr)
|
|
||||||
if (res.status === 200 && res.data.success === true) {
|
|
||||||
this.notifySuccess('환불 처리가 완료되었습니다.')
|
|
||||||
await this.getCalculateLive()
|
|
||||||
} else {
|
|
||||||
this.notifyError(res.data.message || '환불 처리 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError('환불 처리 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async downloadExcel() {
|
|
||||||
try {
|
|
||||||
const res = await api.downloadCalculateLiveExcel(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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,15 +47,22 @@
|
|||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<vue-excel-xlsx
|
||||||
block
|
:data="items"
|
||||||
color="#3bb9f1"
|
:columns="columns"
|
||||||
dark
|
:file-name="'정산'"
|
||||||
depressed
|
:file-type="'xlsx'"
|
||||||
@click="downloadExcel"
|
:sheet-name="'정산'"
|
||||||
>
|
>
|
||||||
엑셀 다운로드
|
<v-btn
|
||||||
</v-btn>
|
block
|
||||||
|
color="#3bb9f1"
|
||||||
|
dark
|
||||||
|
depressed
|
||||||
|
>
|
||||||
|
엑셀 다운로드
|
||||||
|
</v-btn>
|
||||||
|
</vue-excel-xlsx>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
@@ -149,6 +156,40 @@ export default {
|
|||||||
page_size: 20,
|
page_size: 20,
|
||||||
total_page: 0,
|
total_page: 0,
|
||||||
items: [],
|
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: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '이메일',
|
text: '이메일',
|
||||||
@@ -268,21 +309,6 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
this.is_loading = false
|
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('엑셀 다운로드 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,340 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-toolbar dark>
|
|
||||||
<v-btn
|
|
||||||
icon
|
|
||||||
@click="$router.back()"
|
|
||||||
>
|
|
||||||
<v-icon>mdi-arrow-left</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
<v-toolbar-title>오리지널 시리즈 정산</v-toolbar-title>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="excelLoading"
|
|
||||||
@click="onDownloadExcel"
|
|
||||||
>
|
|
||||||
엑셀 다운로드
|
|
||||||
</v-btn>
|
|
||||||
</v-toolbar>
|
|
||||||
|
|
||||||
<v-container>
|
|
||||||
<!-- 필터 영역 -->
|
|
||||||
<v-row
|
|
||||||
class="mt-2 mb-2"
|
|
||||||
align="center"
|
|
||||||
justify="end"
|
|
||||||
>
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-autocomplete
|
|
||||||
v-model="selectedCreatorId"
|
|
||||||
:items="ownerOptions"
|
|
||||||
:loading="ownersLoading"
|
|
||||||
item-text="nickname"
|
|
||||||
item-value="creatorId"
|
|
||||||
label="멤버 선택"
|
|
||||||
dense
|
|
||||||
clearable
|
|
||||||
hide-details
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuStart"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="시작일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="startDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="startDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuStart = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="3"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="menuEnd"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
min-width="auto"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-text-field
|
|
||||||
v-bind="attrs"
|
|
||||||
label="종료일"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
:value="endDateStr"
|
|
||||||
v-on="on"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-date-picker
|
|
||||||
v-model="endDateStr"
|
|
||||||
scrollable
|
|
||||||
@input="menuEnd = false"
|
|
||||||
/>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
|
||||||
cols="12"
|
|
||||||
md="2"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
color="primary"
|
|
||||||
:loading="isLoading"
|
|
||||||
@click="onSearch"
|
|
||||||
>
|
|
||||||
조회
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<!-- 테이블 영역 -->
|
|
||||||
<v-data-table
|
|
||||||
:headers="headers"
|
|
||||||
:items="items"
|
|
||||||
:loading="isLoading"
|
|
||||||
:items-per-page="pageSize"
|
|
||||||
class="elevation-1"
|
|
||||||
disable-pagination
|
|
||||||
hide-default-footer
|
|
||||||
>
|
|
||||||
<template v-slot:no-data>
|
|
||||||
<div class="text-center grey--text pa-6">
|
|
||||||
데이터가 없습니다.
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.price="{ item }">
|
|
||||||
<span>{{ numberFormat(item.price) }}</span>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalCan="{ item }">
|
|
||||||
<span>{{ numberFormat(item.totalCan) }}</span>
|
|
||||||
</template>
|
|
||||||
<template v-slot:item.totalPoint="{ item }">
|
|
||||||
<span>{{ numberFormat(item.totalPoint) }}</span>
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
|
|
||||||
<v-row
|
|
||||||
class="mt-4"
|
|
||||||
justify="center"
|
|
||||||
>
|
|
||||||
<v-pagination
|
|
||||||
v-model="page"
|
|
||||||
:length="totalPages"
|
|
||||||
:total-visible="7"
|
|
||||||
@input="fetchList"
|
|
||||||
/>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getOwners,
|
|
||||||
getSettlementDetails,
|
|
||||||
downloadSettlementExcel,
|
|
||||||
} from "@/api/original_series_settlement";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "OriginalSeriesSettlement",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 필터 상태
|
|
||||||
ownersLoading: false,
|
|
||||||
ownerOptions: [],
|
|
||||||
selectedCreatorId: null,
|
|
||||||
startDateStr: "",
|
|
||||||
endDateStr: "",
|
|
||||||
menuStart: false,
|
|
||||||
menuEnd: false,
|
|
||||||
|
|
||||||
// 목록 상태
|
|
||||||
isLoading: false,
|
|
||||||
items: [],
|
|
||||||
totalCount: 0,
|
|
||||||
page: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
|
|
||||||
excelLoading: false,
|
|
||||||
|
|
||||||
headers: [
|
|
||||||
{ text: "시리즈 제목", value: "seriesTitle", align: "center" },
|
|
||||||
{ text: "콘텐츠 제목", value: "contentTitle", align: "center" },
|
|
||||||
{ text: "가격", value: "price", align: "center" },
|
|
||||||
{ text: "구분", value: "orderType", align: "center" },
|
|
||||||
{ text: "판매 수", value: "salesCount", align: "center" },
|
|
||||||
{ text: "합계(캔)", value: "totalCan", align: "center" },
|
|
||||||
{ text: "합계(포인트)", value: "totalPoint", align: "center" },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
totalPages() {
|
|
||||||
return Math.max(1, Math.ceil(this.totalCount / this.pageSize));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.initDefaultDates();
|
|
||||||
this.loadOwners();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
numberFormat(v) {
|
|
||||||
if (v === null || v === undefined) return "-";
|
|
||||||
try {
|
|
||||||
return Number(v).toLocaleString();
|
|
||||||
} catch (e) {
|
|
||||||
return String(v);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
notifyError(message) {
|
|
||||||
this.$dialog.notify.error(message);
|
|
||||||
},
|
|
||||||
notifySuccess(message) {
|
|
||||||
this.$dialog.notify.success(message);
|
|
||||||
},
|
|
||||||
|
|
||||||
// 이번 달 1일 ~ 오늘
|
|
||||||
initDefaultDates() {
|
|
||||||
const now = new Date();
|
|
||||||
const y = now.getFullYear();
|
|
||||||
const m = now.getMonth();
|
|
||||||
const first = new Date(y, m, 1);
|
|
||||||
const pad = (n) => (n < 10 ? "0" + n : "" + n);
|
|
||||||
this.startDateStr = `${first.getFullYear()}-${pad(
|
|
||||||
first.getMonth() + 1
|
|
||||||
)}-${pad(first.getDate())}`;
|
|
||||||
this.endDateStr = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(
|
|
||||||
now.getDate()
|
|
||||||
)}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
async loadOwners() {
|
|
||||||
this.ownersLoading = true;
|
|
||||||
try {
|
|
||||||
const res = await getOwners();
|
|
||||||
if (res.status === 200 && res.data && res.data.success) {
|
|
||||||
const list = Array.isArray(res.data.data) ? res.data.data : [];
|
|
||||||
this.ownerOptions = list;
|
|
||||||
// 가장 조회된 값 순서로 온다고 가정, 첫 번째를 기본 선택
|
|
||||||
if (list.length > 0) {
|
|
||||||
this.selectedCreatorId = list[0].creatorId;
|
|
||||||
}
|
|
||||||
// 초기 조회 (이번 달 범위, 기본 멤버)
|
|
||||||
this.page = 1;
|
|
||||||
await this.fetchList();
|
|
||||||
} else {
|
|
||||||
this.notifyError(
|
|
||||||
res.data && res.data.message
|
|
||||||
? res.data.message
|
|
||||||
: "소지 유저 조회 실패"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError("소지 유저 조회 중 오류가 발생했습니다.");
|
|
||||||
} finally {
|
|
||||||
this.ownersLoading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async onSearch() {
|
|
||||||
this.page = 1;
|
|
||||||
await this.fetchList();
|
|
||||||
},
|
|
||||||
|
|
||||||
async fetchList() {
|
|
||||||
if (!this.selectedCreatorId) {
|
|
||||||
this.items = [];
|
|
||||||
this.totalCount = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.isLoading = true;
|
|
||||||
try {
|
|
||||||
const res = await getSettlementDetails({
|
|
||||||
startDate: this.startDateStr,
|
|
||||||
endDate: this.endDateStr,
|
|
||||||
creatorId: this.selectedCreatorId,
|
|
||||||
page: this.page,
|
|
||||||
size: this.pageSize,
|
|
||||||
});
|
|
||||||
if (res.status === 200 && res.data) {
|
|
||||||
if (res.data.success) {
|
|
||||||
const data = res.data.data || { totalCount: 0, items: [] };
|
|
||||||
this.totalCount = data.totalCount || 0;
|
|
||||||
this.items = Array.isArray(data.items) ? data.items : [];
|
|
||||||
} else {
|
|
||||||
this.notifyError(res.data.message || "정산 내역 조회 실패");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.notifyError("정산 내역 조회 실패");
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError("정산 내역 조회 중 오류가 발생했습니다.");
|
|
||||||
} finally {
|
|
||||||
this.isLoading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async onDownloadExcel() {
|
|
||||||
this.excelLoading = true;
|
|
||||||
try {
|
|
||||||
const res = await downloadSettlementExcel({
|
|
||||||
startDate: this.startDateStr,
|
|
||||||
endDate: this.endDateStr,
|
|
||||||
});
|
|
||||||
const blob = new Blob([res.data], {
|
|
||||||
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
||||||
});
|
|
||||||
const url = window.URL.createObjectURL(blob);
|
|
||||||
const link = document.createElement("a");
|
|
||||||
link.href = url;
|
|
||||||
link.setAttribute("download", "오리지널_시리즈_정산.xlsx");
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
link.parentNode.removeChild(link);
|
|
||||||
window.URL.revokeObjectURL(url);
|
|
||||||
this.notifySuccess("엑셀 다운로드가 시작되었습니다.");
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError("엑셀 다운로드 중 오류가 발생했습니다.");
|
|
||||||
} finally {
|
|
||||||
this.excelLoading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 테이블 헤더/바디 모두 가운데 정렬 */
|
|
||||||
.v-data-table table thead th,
|
|
||||||
.v-data-table table tbody td {
|
|
||||||
text-align: center !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -135,8 +135,7 @@ export default {
|
|||||||
currency: 'KRW',
|
currency: 'KRW',
|
||||||
currencies: [
|
currencies: [
|
||||||
{ text: 'KRW (한국 원)', value: 'KRW' },
|
{ text: 'KRW (한국 원)', value: 'KRW' },
|
||||||
{ text: 'USD (미국 달러)', value: 'USD' },
|
{ text: 'USD (미국 달러)', value: 'USD' }
|
||||||
{ text: 'JPY (일본 엔)', value: 'JPY' }
|
|
||||||
],
|
],
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,6 +94,10 @@
|
|||||||
class="elevation-1"
|
class="elevation-1"
|
||||||
hide-default-footer
|
hide-default-footer
|
||||||
>
|
>
|
||||||
|
<template v-slot:item.accountId="{ item }">
|
||||||
|
{{ item.accountId }}
|
||||||
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.nickname="{ item }">
|
<template v-slot:item.nickname="{ item }">
|
||||||
{{ item.nickname }}
|
{{ item.nickname }}
|
||||||
</template>
|
</template>
|
||||||
@@ -109,16 +113,6 @@
|
|||||||
<template v-slot:item.datetime="{ item }">
|
<template v-slot:item.datetime="{ item }">
|
||||||
{{ item.datetime }}
|
{{ item.datetime }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.refund="{ item }">
|
|
||||||
<v-btn
|
|
||||||
color="error"
|
|
||||||
small
|
|
||||||
@click="confirmRefund(item)"
|
|
||||||
>
|
|
||||||
환불
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
</v-data-table>
|
||||||
<v-card-actions v-show="!is_loading">
|
<v-card-actions v-show="!is_loading">
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
@@ -152,9 +146,14 @@ export default {
|
|||||||
end_date: null,
|
end_date: null,
|
||||||
items: [],
|
items: [],
|
||||||
detail_items: null,
|
detail_items: null,
|
||||||
selected_date_item: null,
|
|
||||||
show_popup_dialog: false,
|
show_popup_dialog: false,
|
||||||
detail_headers: [
|
detail_headers: [
|
||||||
|
{
|
||||||
|
text: 'no',
|
||||||
|
align: 'center',
|
||||||
|
sortable: false,
|
||||||
|
value: 'accountId',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: '닉네임',
|
text: '닉네임',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -185,12 +184,6 @@ export default {
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
value: 'datetime',
|
value: 'datetime',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: '환불',
|
|
||||||
align: 'center',
|
|
||||||
sortable: false,
|
|
||||||
value: 'refund',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
@@ -291,7 +284,6 @@ export default {
|
|||||||
async getChargeStatusDetail(value) {
|
async getChargeStatusDetail(value) {
|
||||||
if (value.date !== '합계') {
|
if (value.date !== '합계') {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
this.selected_date_item = value
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.getChargeStatusDetail(value.date, value.pg, value.currency)
|
const res = await api.getChargeStatusDetail(value.date, value.pg, value.currency)
|
||||||
@@ -308,45 +300,6 @@ export default {
|
|||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
async confirmRefund(item) {
|
|
||||||
let canText = `${item.chargeCan}캔`
|
|
||||||
if (item.rewardCan > 0) {
|
|
||||||
canText += ` + ${item.rewardCan}캔`
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirm = await this.$dialog.confirm({
|
|
||||||
title: '환불 확인',
|
|
||||||
text: `${item.nickname}님의 ${canText}을 환불하시겠습니까?`,
|
|
||||||
actions: {
|
|
||||||
false: '취소',
|
|
||||||
true: '환불'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (confirm) {
|
|
||||||
await this.refundCharge(item.chargeId)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async refundCharge(chargeId) {
|
|
||||||
this.is_loading = true
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await api.refundCharge(chargeId)
|
|
||||||
if (res.status === 200 && res.data.success === true) {
|
|
||||||
this.notifySuccess('환불이 완료되었습니다.')
|
|
||||||
await this.getChargeStatusDetail(this.selected_date_item)
|
|
||||||
await this.getChargeStatus()
|
|
||||||
} else {
|
|
||||||
this.notifyError(res.data.message || '환불 처리 중 오류가 발생했습니다.')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError('환불 처리 중 오류가 발생했습니다.')
|
|
||||||
} finally {
|
|
||||||
this.is_loading = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,18 +184,6 @@
|
|||||||
</v-alert>
|
</v-alert>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-if="!isEdit">
|
|
||||||
<v-col cols="12">
|
|
||||||
<v-select
|
|
||||||
v-model="bannerForm.lang"
|
|
||||||
:items="languageOptions"
|
|
||||||
label="언어 선택"
|
|
||||||
item-text="text"
|
|
||||||
item-value="value"
|
|
||||||
outlined
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row v-if="selectedCharacter">
|
<v-row v-if="selectedCharacter">
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-alert
|
<v-alert
|
||||||
@@ -314,14 +302,8 @@ export default {
|
|||||||
image: null,
|
image: null,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
characterId: null,
|
characterId: null,
|
||||||
bannerId: null,
|
bannerId: null
|
||||||
lang: 'ko'
|
|
||||||
},
|
},
|
||||||
languageOptions: [
|
|
||||||
{ text: '한국어', value: 'ko' },
|
|
||||||
{ text: '일본어', value: 'ja' },
|
|
||||||
{ text: '영어', value: 'en' }
|
|
||||||
],
|
|
||||||
imageRules: [
|
imageRules: [
|
||||||
v => !!v || this.isEdit || '이미지를 선택하세요'
|
v => !!v || this.isEdit || '이미지를 선택하세요'
|
||||||
]
|
]
|
||||||
@@ -330,7 +312,7 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
isFormValid() {
|
isFormValid() {
|
||||||
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedCharacter && this.bannerForm.lang;
|
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedCharacter;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -411,8 +393,7 @@ export default {
|
|||||||
image: null,
|
image: null,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
characterId: null,
|
characterId: null,
|
||||||
bannerId: null,
|
bannerId: null
|
||||||
lang: 'ko'
|
|
||||||
};
|
};
|
||||||
this.previewImage = null;
|
this.previewImage = null;
|
||||||
this.searchKeyword = '';
|
this.searchKeyword = '';
|
||||||
@@ -433,8 +414,7 @@ export default {
|
|||||||
image: null,
|
image: null,
|
||||||
imageUrl: banner.imageUrl,
|
imageUrl: banner.imageUrl,
|
||||||
characterId: banner.characterId,
|
characterId: banner.characterId,
|
||||||
bannerId: banner.id,
|
bannerId: banner.id
|
||||||
lang: banner.lang || banner.language || null
|
|
||||||
};
|
};
|
||||||
this.previewImage = null;
|
this.previewImage = null;
|
||||||
this.searchKeyword = '';
|
this.searchKeyword = '';
|
||||||
@@ -450,8 +430,7 @@ export default {
|
|||||||
image: null,
|
image: null,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
characterId: null,
|
characterId: null,
|
||||||
bannerId: null,
|
bannerId: null
|
||||||
lang: 'ko'
|
|
||||||
};
|
};
|
||||||
this.previewImage = null;
|
this.previewImage = null;
|
||||||
this.searchKeyword = '';
|
this.searchKeyword = '';
|
||||||
@@ -522,8 +501,7 @@ export default {
|
|||||||
// 배너 추가
|
// 배너 추가
|
||||||
const response = await createCharacterBanner({
|
const response = await createCharacterBanner({
|
||||||
image: this.bannerForm.image,
|
image: this.bannerForm.image,
|
||||||
characterId: this.selectedCharacter.id,
|
characterId: this.selectedCharacter.id
|
||||||
lang: this.bannerForm.lang
|
|
||||||
});
|
});
|
||||||
if (response && response.status === 200 && response.data && response.data.success === true) {
|
if (response && response.status === 200 && response.data && response.data.success === true) {
|
||||||
this.notifySuccess('배너가 추가되었습니다.');
|
this.notifySuccess('배너가 추가되었습니다.');
|
||||||
|
|||||||
@@ -353,11 +353,10 @@
|
|||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="character.systemPrompt"
|
v-model="character.systemPrompt"
|
||||||
label="시스템 프롬프트 (최대 2000자)"
|
label="시스템 프롬프트"
|
||||||
outlined
|
outlined
|
||||||
auto-grow
|
auto-grow
|
||||||
rows="4"
|
rows="4"
|
||||||
counter="2000"
|
|
||||||
:class="{ 'required-asterisk': !isEdit }"
|
:class="{ 'required-asterisk': !isEdit }"
|
||||||
:rules="systemPromptRules"
|
:rules="systemPromptRules"
|
||||||
/>
|
/>
|
||||||
@@ -1183,8 +1182,7 @@ export default {
|
|||||||
],
|
],
|
||||||
typeOptions: ['Clone', 'Character'],
|
typeOptions: ['Clone', 'Character'],
|
||||||
systemPromptRules: [
|
systemPromptRules: [
|
||||||
v => (this.isEdit ? true : (!!v && v.trim().length > 0) || '시스템 프롬프트를 입력하세요'),
|
v => (this.isEdit ? true : (!!v && v.trim().length > 0) || '시스템 프롬프트를 입력하세요')
|
||||||
v => (!!v && v.length <= 2000) || '최대 2000자까지 입력 가능합니다'
|
|
||||||
],
|
],
|
||||||
// 인물 관계 옵션 및 검증 규칙
|
// 인물 관계 옵션 및 검증 규칙
|
||||||
relationshipTypeOptions: ['가족', '친구', '동료', '연인', '기타'],
|
relationshipTypeOptions: ['가족', '친구', '동료', '연인', '기타'],
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
>
|
>
|
||||||
<v-btn
|
<v-btn
|
||||||
slot="append"
|
slot="append"
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
@click="search"
|
@click="search"
|
||||||
>
|
>
|
||||||
@@ -75,9 +75,6 @@
|
|||||||
<th class="text-center">
|
<th class="text-center">
|
||||||
가격
|
가격
|
||||||
</th>
|
</th>
|
||||||
<th class="text-center">
|
|
||||||
정산요율
|
|
||||||
</th>
|
|
||||||
<th class="text-center">
|
<th class="text-center">
|
||||||
한정판
|
한정판
|
||||||
</th>
|
</th>
|
||||||
@@ -96,10 +93,7 @@
|
|||||||
<th class="text-center">
|
<th class="text-center">
|
||||||
오픈 예정일
|
오픈 예정일
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th class="text-center">
|
||||||
v-if="isAdmin"
|
|
||||||
class="text-center"
|
|
||||||
>
|
|
||||||
관리
|
관리
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -163,12 +157,6 @@
|
|||||||
<td v-else>
|
<td v-else>
|
||||||
무료
|
무료
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<!-- settlementRatio가 null 또는 빈값이면 빈칸으로 표시 -->
|
|
||||||
<span v-if="item.settlementRatio !== null && item.settlementRatio !== undefined && String(item.settlementRatio).trim() !== ''">
|
|
||||||
{{ item.settlementRatio }}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td
|
<td
|
||||||
v-if="
|
v-if="
|
||||||
item.totalContentCount > 0 &&
|
item.totalContentCount > 0 &&
|
||||||
@@ -217,7 +205,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ item.date }}</td>
|
<td>{{ item.date }}</td>
|
||||||
<td>{{ item.releaseDate }}</td>
|
<td>{{ item.releaseDate }}</td>
|
||||||
<td v-if="isAdmin">
|
<td>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
@@ -367,36 +355,6 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-text v-if="selected_audio_content.price > 0">
|
|
||||||
<v-row align="center">
|
|
||||||
<v-col cols="4">
|
|
||||||
정산요율
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="8">
|
|
||||||
<v-text-field
|
|
||||||
v-model="audio_content.settlement_ratio"
|
|
||||||
label="정산요율"
|
|
||||||
placeholder="예: 30"
|
|
||||||
type="number"
|
|
||||||
hide-details="auto"
|
|
||||||
:disabled="audio_content.is_settlement_ratio_deleted"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-text v-if="selected_audio_content.price > 0">
|
|
||||||
<v-row>
|
|
||||||
<v-col cols="4">
|
|
||||||
정산요율 삭제
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="8">
|
|
||||||
<input
|
|
||||||
v-model="audio_content.is_settlement_ratio_deleted"
|
|
||||||
type="checkbox"
|
|
||||||
>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="4">
|
<v-col cols="4">
|
||||||
@@ -530,14 +488,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
|
||||||
isAdmin() {
|
|
||||||
const role = (this.$store && this.$store.state && this.$store.state.accountStore && this.$store.state.accountStore.role)
|
|
||||||
|| (typeof localStorage !== 'undefined' ? localStorage.role : '');
|
|
||||||
return role === 'ADMIN';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
this.audio_content = {
|
this.audio_content = {
|
||||||
id: null,
|
id: null,
|
||||||
@@ -547,13 +497,8 @@ export default {
|
|||||||
is_adult: false,
|
is_adult: false,
|
||||||
is_comment_available: false,
|
is_comment_available: false,
|
||||||
is_default_cover_image: false,
|
is_default_cover_image: false,
|
||||||
is_settlement_ratio_deleted: false,
|
|
||||||
settlement_ratio: "",
|
|
||||||
};
|
};
|
||||||
// ADMIN 권한일 때만 테마 리스트 조회
|
await this.getAudioContentThemeList();
|
||||||
if (this.isAdmin) {
|
|
||||||
await this.getAudioContentThemeList();
|
|
||||||
}
|
|
||||||
await this.getAudioContent();
|
await this.getAudioContent();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -586,11 +531,6 @@ export default {
|
|||||||
this.audio_content.is_adult = item.isAdult;
|
this.audio_content.is_adult = item.isAdult;
|
||||||
this.audio_content.is_comment_available = item.isCommentAvailable;
|
this.audio_content.is_comment_available = item.isCommentAvailable;
|
||||||
this.audio_content.is_default_cover_image = false;
|
this.audio_content.is_default_cover_image = false;
|
||||||
this.audio_content.is_settlement_ratio_deleted = false;
|
|
||||||
this.audio_content.settlement_ratio =
|
|
||||||
item.settlementRatio !== null && item.settlementRatio !== undefined
|
|
||||||
? String(item.settlementRatio)
|
|
||||||
: "";
|
|
||||||
|
|
||||||
this.image_preview = item.coverImageUrl;
|
this.image_preview = item.coverImageUrl;
|
||||||
this.cover_image_file = null;
|
this.cover_image_file = null;
|
||||||
@@ -650,8 +590,6 @@ export default {
|
|||||||
is_adult: false,
|
is_adult: false,
|
||||||
is_comment_available: false,
|
is_comment_available: false,
|
||||||
is_default_cover_image: false,
|
is_default_cover_image: false,
|
||||||
is_settlement_ratio_deleted: false,
|
|
||||||
settlement_ratio: "",
|
|
||||||
};
|
};
|
||||||
this.image_preview = null;
|
this.image_preview = null;
|
||||||
this.cover_image_file = null;
|
this.cover_image_file = null;
|
||||||
@@ -693,12 +631,6 @@ export default {
|
|||||||
isDefaultCoverImage: this.audio_content.is_default_cover_image,
|
isDefaultCoverImage: this.audio_content.is_default_cover_image,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 유료 콘텐츠인 경우에만 정산요율 관련 플래그/값 전송 고려
|
|
||||||
const isPaid = this.selected_audio_content && this.selected_audio_content.price > 0;
|
|
||||||
if (isPaid) {
|
|
||||||
request.isSettlementRatioDeleted = this.audio_content.is_settlement_ratio_deleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.audio_content.title !== this.selected_audio_content.title &&
|
this.audio_content.title !== this.selected_audio_content.title &&
|
||||||
this.audio_content.title.trim().length > 0
|
this.audio_content.title.trim().length > 0
|
||||||
@@ -725,21 +657,6 @@ export default {
|
|||||||
request.isCommentAvailable = this.audio_content.is_comment_available;
|
request.isCommentAvailable = this.audio_content.is_comment_available;
|
||||||
}
|
}
|
||||||
|
|
||||||
// settlementRatio 처리 (null/빈문자 케이스 포함)
|
|
||||||
const originalRatio =
|
|
||||||
this.selected_audio_content.settlementRatio !== null &&
|
|
||||||
this.selected_audio_content.settlementRatio !== undefined
|
|
||||||
? String(this.selected_audio_content.settlementRatio)
|
|
||||||
: "";
|
|
||||||
const newRatio =
|
|
||||||
this.audio_content.settlement_ratio !== null &&
|
|
||||||
this.audio_content.settlement_ratio !== undefined
|
|
||||||
? String(this.audio_content.settlement_ratio)
|
|
||||||
: "";
|
|
||||||
if (isPaid && !this.audio_content.is_settlement_ratio_deleted && newRatio !== originalRatio) {
|
|
||||||
request.settlementRatio = newRatio;
|
|
||||||
}
|
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("request", JSON.stringify(request));
|
formData.append("request", JSON.stringify(request));
|
||||||
|
|
||||||
|
|||||||
@@ -109,23 +109,6 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<!-- 언어 선택: 등록 시에만 노출 (수정 시 비노출) -->
|
|
||||||
<v-card-text v-if="!is_modify">
|
|
||||||
<v-row align="center">
|
|
||||||
<v-col cols="4">
|
|
||||||
언어
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="8">
|
|
||||||
<v-select
|
|
||||||
v-model="banner.lang"
|
|
||||||
:items="langItems"
|
|
||||||
item-text="text"
|
|
||||||
item-value="value"
|
|
||||||
label="언어 선택"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row align="center">
|
<v-row align="center">
|
||||||
<v-col cols="4">
|
<v-col cols="4">
|
||||||
@@ -344,7 +327,7 @@ export default {
|
|||||||
show_write_dialog: false,
|
show_write_dialog: false,
|
||||||
show_delete_confirm_dialog: false,
|
show_delete_confirm_dialog: false,
|
||||||
selected_banner: {},
|
selected_banner: {},
|
||||||
banner: {type: 'CREATOR', tab_id: 1, lang: 'ko'},
|
banner: {type: 'CREATOR', tab_id: 1},
|
||||||
banners: [],
|
banners: [],
|
||||||
events: [],
|
events: [],
|
||||||
creators: [],
|
creators: [],
|
||||||
@@ -352,12 +335,7 @@ export default {
|
|||||||
search_query_creator: '',
|
search_query_creator: '',
|
||||||
search_query_series: '',
|
search_query_series: '',
|
||||||
tabs: [],
|
tabs: [],
|
||||||
selected_tab_id: 1,
|
selected_tab_id: 1
|
||||||
langItems: [
|
|
||||||
{ text: '한국어', value: 'ko' },
|
|
||||||
{ text: '일본어', value: 'ja' },
|
|
||||||
{ text: '영어', value: 'en' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -401,7 +379,7 @@ export default {
|
|||||||
this.is_selecting = false
|
this.is_selecting = false
|
||||||
this.show_write_dialog = false
|
this.show_write_dialog = false
|
||||||
this.show_delete_confirm_dialog = false
|
this.show_delete_confirm_dialog = false
|
||||||
this.banner = {type: 'CREATOR', tab_id: 1, lang: 'ko'}
|
this.banner = {type: 'CREATOR', tab_id: 1}
|
||||||
this.selected_banner = {}
|
this.selected_banner = {}
|
||||||
this.search_query_creator = ''
|
this.search_query_creator = ''
|
||||||
this.search_query_series = ''
|
this.search_query_series = ''
|
||||||
@@ -454,10 +432,6 @@ export default {
|
|||||||
this.banner.link = banner.link
|
this.banner.link = banner.link
|
||||||
this.banner.is_adult = banner.isAdult
|
this.banner.is_adult = banner.isAdult
|
||||||
this.banner.tab_id = banner.tabId
|
this.banner.tab_id = banner.tabId
|
||||||
// 수정 시 언어는 변경 불가하므로 UI를 표시하지 않음. 필요 시 내부 유지만 함 (기본값 또는 서버 값 사용)
|
|
||||||
if (banner.lang) {
|
|
||||||
this.banner.lang = banner.lang
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.is_selecting = false; // 선택 상태 해제
|
this.is_selecting = false; // 선택 상태 해제
|
||||||
@@ -523,8 +497,7 @@ export default {
|
|||||||
|
|
||||||
let request = {
|
let request = {
|
||||||
type: this.banner.type,
|
type: this.banner.type,
|
||||||
isAdult: this.banner.is_adult,
|
isAdult: this.banner.is_adult
|
||||||
lang: this.banner.lang || 'ko'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.banner.type === 'CREATOR') {
|
if (this.banner.type === 'CREATOR') {
|
||||||
|
|||||||
@@ -153,22 +153,6 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-text v-if="selected_recommend_live === null">
|
|
||||||
<v-row align="center">
|
|
||||||
<v-col cols="4">
|
|
||||||
언어
|
|
||||||
</v-col>
|
|
||||||
<v-col cols="8">
|
|
||||||
<v-select
|
|
||||||
v-model="lang"
|
|
||||||
:items="languageOptions"
|
|
||||||
item-text="label"
|
|
||||||
item-value="value"
|
|
||||||
label="언어 선택"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row align="center">
|
<v-row align="center">
|
||||||
<v-col cols="4">
|
<v-col cols="4">
|
||||||
@@ -250,12 +234,6 @@ export default {
|
|||||||
start_date: null,
|
start_date: null,
|
||||||
end_date: null,
|
end_date: null,
|
||||||
is_adult: false,
|
is_adult: false,
|
||||||
lang: 'ko',
|
|
||||||
languageOptions: [
|
|
||||||
{ label: '한국어', value: 'ko' },
|
|
||||||
{ label: '일본어', value: 'ja' },
|
|
||||||
{ label: '영어', value: 'en' },
|
|
||||||
],
|
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: '이미지',
|
text: '이미지',
|
||||||
@@ -380,7 +358,6 @@ export default {
|
|||||||
formData.append("start_date", this.start_date)
|
formData.append("start_date", this.start_date)
|
||||||
formData.append("end_date", this.end_date)
|
formData.append("end_date", this.end_date)
|
||||||
formData.append("is_adult", this.is_adult)
|
formData.append("is_adult", this.is_adult)
|
||||||
formData.append("lang", this.lang)
|
|
||||||
|
|
||||||
const res = await api.createRecommendCreatorBanner(formData);
|
const res = await api.createRecommendCreatorBanner(formData);
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
@@ -406,8 +383,7 @@ export default {
|
|||||||
this.image === null ||
|
this.image === null ||
|
||||||
this.creator_id === null ||
|
this.creator_id === null ||
|
||||||
this.start_date === null ||
|
this.start_date === null ||
|
||||||
this.end_date === null ||
|
this.end_date === null
|
||||||
this.lang === null
|
|
||||||
) {
|
) {
|
||||||
this.notifyError('내용을 입력하세요')
|
this.notifyError('내용을 입력하세요')
|
||||||
} else {
|
} else {
|
||||||
@@ -422,9 +398,6 @@ export default {
|
|||||||
this.creator_id = null
|
this.creator_id = null
|
||||||
this.start_date = null
|
this.start_date = null
|
||||||
this.end_date = null
|
this.end_date = null
|
||||||
this.is_adult = false
|
|
||||||
this.lang = 'ko'
|
|
||||||
this.selected_recommend_live = null
|
|
||||||
},
|
},
|
||||||
|
|
||||||
notifyError(message) {
|
notifyError(message) {
|
||||||
@@ -498,8 +471,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
showWriteDialog() {
|
showWriteDialog() {
|
||||||
this.selected_recommend_live = null
|
|
||||||
this.lang = 'ko'
|
|
||||||
this.show_write_dialog = true
|
this.show_write_dialog = true
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
>
|
>
|
||||||
<v-btn
|
<v-btn
|
||||||
slot="append"
|
slot="append"
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
@click="search"
|
@click="search"
|
||||||
>
|
>
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row align="center">
|
<v-row align="center">
|
||||||
<v-col cols="4">
|
<v-col cols="4">
|
||||||
권한
|
사용 여부
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="8">
|
<v-col cols="8">
|
||||||
<v-radio-group
|
<v-radio-group
|
||||||
@@ -183,32 +183,16 @@
|
|||||||
value="CREATOR"
|
value="CREATOR"
|
||||||
label="크리에이터"
|
label="크리에이터"
|
||||||
/>
|
/>
|
||||||
<v-radio
|
|
||||||
value="AGENT"
|
|
||||||
label="에이전트"
|
|
||||||
/>
|
|
||||||
<v-radio
|
<v-radio
|
||||||
value="USER"
|
value="USER"
|
||||||
label="일반회원"
|
label="일반회원"
|
||||||
/>
|
/>
|
||||||
<v-radio
|
|
||||||
value="CONTENT_MANAGER"
|
|
||||||
label="콘텐츠 관리자"
|
|
||||||
/>
|
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
</v-radio-group>
|
</v-radio-group>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions v-show="!is_loading">
|
<v-card-actions v-show="!is_loading">
|
||||||
<v-btn
|
|
||||||
color="error"
|
|
||||||
text
|
|
||||||
@click="showBlockReasonDialog"
|
|
||||||
>
|
|
||||||
차단
|
|
||||||
</v-btn>
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
<v-btn
|
||||||
color="blue darken-1"
|
color="blue darken-1"
|
||||||
text
|
text
|
||||||
@@ -216,6 +200,7 @@
|
|||||||
>
|
>
|
||||||
비밀번호 재설정
|
비밀번호 재설정
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
<v-spacer />
|
||||||
<v-btn
|
<v-btn
|
||||||
color="blue darken-1"
|
color="blue darken-1"
|
||||||
text
|
text
|
||||||
@@ -267,74 +252,6 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-row>
|
|
||||||
<v-dialog
|
|
||||||
v-model="show_block_reason_dialog"
|
|
||||||
max-width="500px"
|
|
||||||
persistent
|
|
||||||
>
|
|
||||||
<v-card>
|
|
||||||
<v-card-title>차단(탈퇴) 사유 입력</v-card-title>
|
|
||||||
<v-card-text>
|
|
||||||
<v-textarea
|
|
||||||
v-model="block_reason"
|
|
||||||
label="사유를 입력해주세요"
|
|
||||||
outlined
|
|
||||||
hide-details
|
|
||||||
/>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-actions v-show="!is_loading">
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
color="error"
|
|
||||||
text
|
|
||||||
@click="confirmBlock"
|
|
||||||
>
|
|
||||||
차단
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
color="blue darken-1"
|
|
||||||
text
|
|
||||||
@click="cancelBlock"
|
|
||||||
>
|
|
||||||
취소
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<v-row>
|
|
||||||
<v-dialog
|
|
||||||
v-model="show_confirm_block_dialog"
|
|
||||||
max-width="500px"
|
|
||||||
persistent
|
|
||||||
>
|
|
||||||
<v-card>
|
|
||||||
<v-card-title class="text-h6">
|
|
||||||
'{{ nickname }}' 계정과 본인인증 정보, 같은 본인인증 정보를 사용하는 모든 계정을 차단합니다.
|
|
||||||
</v-card-title>
|
|
||||||
<v-card-actions v-show="!is_loading">
|
|
||||||
<v-spacer />
|
|
||||||
<v-btn
|
|
||||||
color="error"
|
|
||||||
text
|
|
||||||
@click="blockMember"
|
|
||||||
>
|
|
||||||
차단
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
color="blue darken-1"
|
|
||||||
text
|
|
||||||
@click="cancelBlock"
|
|
||||||
>
|
|
||||||
취소
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</v-row>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -357,9 +274,6 @@ export default {
|
|||||||
user_type: null,
|
user_type: null,
|
||||||
show_popup_dialog: false,
|
show_popup_dialog: false,
|
||||||
show_confirm_reset_password_dialog: false,
|
show_confirm_reset_password_dialog: false,
|
||||||
show_block_reason_dialog: false,
|
|
||||||
show_confirm_block_dialog: false,
|
|
||||||
block_reason: '',
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -453,10 +367,6 @@ export default {
|
|||||||
this.user_type = 'USER'
|
this.user_type = 'USER'
|
||||||
} else if (member.userType === '크리에이터') {
|
} else if (member.userType === '크리에이터') {
|
||||||
this.user_type = 'CREATOR'
|
this.user_type = 'CREATOR'
|
||||||
} else if (member.userType === '에이전트') {
|
|
||||||
this.user_type = 'AGENT'
|
|
||||||
} else if (member.userType === '콘텐츠 관리자') {
|
|
||||||
this.user_type = 'CONTENT_MANAGER'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.email = member.email
|
this.email = member.email
|
||||||
@@ -472,51 +382,6 @@ export default {
|
|||||||
this.user_type = null
|
this.user_type = null
|
||||||
this.show_popup_dialog = false
|
this.show_popup_dialog = false
|
||||||
this.show_confirm_reset_password_dialog = false
|
this.show_confirm_reset_password_dialog = false
|
||||||
this.show_block_reason_dialog = false
|
|
||||||
this.show_confirm_block_dialog = false
|
|
||||||
this.block_reason = ''
|
|
||||||
},
|
|
||||||
|
|
||||||
showBlockReasonDialog() {
|
|
||||||
this.show_popup_dialog = false
|
|
||||||
this.show_block_reason_dialog = true
|
|
||||||
},
|
|
||||||
|
|
||||||
cancelBlock() {
|
|
||||||
this.show_block_reason_dialog = false
|
|
||||||
this.show_confirm_block_dialog = false
|
|
||||||
this.block_reason = ''
|
|
||||||
this.show_popup_dialog = true
|
|
||||||
},
|
|
||||||
|
|
||||||
confirmBlock() {
|
|
||||||
if (this.block_reason.length === 0) {
|
|
||||||
this.notifyError('차단 사유를 입력해주세요.')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.show_block_reason_dialog = false
|
|
||||||
this.show_confirm_block_dialog = true
|
|
||||||
},
|
|
||||||
|
|
||||||
async blockMember() {
|
|
||||||
this.is_loading = true
|
|
||||||
try {
|
|
||||||
const res = await api.blockMember(this.member.id, this.block_reason)
|
|
||||||
if (res.status === 200 && res.data.success === true) {
|
|
||||||
this.notifySuccess('차단되었습니다.')
|
|
||||||
this.cancel()
|
|
||||||
|
|
||||||
this.page = 1
|
|
||||||
await this.getMemberList()
|
|
||||||
} else {
|
|
||||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.is_loading = false
|
|
||||||
} catch (e) {
|
|
||||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
|
||||||
this.is_loading = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async modify() {
|
async modify() {
|
||||||
@@ -524,9 +389,7 @@ export default {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
(this.user_type === 'CREATOR' && this.member.userType === '크리에이터') ||
|
(this.user_type === 'CREATOR' && this.member.userType === '크리에이터') ||
|
||||||
(this.user_type === 'USER' && this.member.userType === '일반회원') ||
|
(this.user_type === 'USER' && this.member.userType === '일반회원')
|
||||||
(this.user_type === 'AGENT' && this.member.userType === '에이전트') ||
|
|
||||||
(this.user_type === 'CONTENT_MANAGER' && this.member.userType === '콘텐츠 관리자')
|
|
||||||
) {
|
) {
|
||||||
this.notifyError("변경사항이 없습니다.")
|
this.notifyError("변경사항이 없습니다.")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -66,14 +66,6 @@
|
|||||||
/>
|
/>
|
||||||
<v-card-text class="text-center">
|
<v-card-text class="text-center">
|
||||||
<div>{{ resolveSeriesTitle(banner) }}</div>
|
<div>{{ resolveSeriesTitle(banner) }}</div>
|
||||||
<v-chip
|
|
||||||
v-if="banner.lang"
|
|
||||||
x-small
|
|
||||||
label
|
|
||||||
class="mt-1"
|
|
||||||
>
|
|
||||||
{{ banner.lang === 'ko' ? '한국어' : banner.lang === 'ja' ? '일본어' : '영어' }}
|
|
||||||
</v-chip>
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
@@ -154,17 +146,6 @@
|
|||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-if="!isEdit">
|
|
||||||
<v-col cols="12">
|
|
||||||
<v-select
|
|
||||||
v-model="bannerForm.lang"
|
|
||||||
:items="languages"
|
|
||||||
label="언어 선택"
|
|
||||||
outlined
|
|
||||||
:rules="[v => !!v || '언어를 선택하세요']"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@@ -312,17 +293,11 @@ export default {
|
|||||||
searchResults: [],
|
searchResults: [],
|
||||||
searchPerformed: false,
|
searchPerformed: false,
|
||||||
previewImage: null,
|
previewImage: null,
|
||||||
languages: [
|
|
||||||
{ text: '한국어', value: 'ko' },
|
|
||||||
{ text: '일본어', value: 'ja' },
|
|
||||||
{ text: '영어', value: 'en' }
|
|
||||||
],
|
|
||||||
bannerForm: {
|
bannerForm: {
|
||||||
image: null,
|
image: null,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
seriesId: null,
|
seriesId: null,
|
||||||
bannerId: null,
|
bannerId: null
|
||||||
lang: 'ko'
|
|
||||||
},
|
},
|
||||||
imageRules: [
|
imageRules: [
|
||||||
v => !!v || this.isEdit || '이미지를 선택하세요'
|
v => !!v || this.isEdit || '이미지를 선택하세요'
|
||||||
@@ -331,7 +306,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isFormValid() {
|
isFormValid() {
|
||||||
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedSeries && (this.isEdit || this.bannerForm.lang)
|
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedSeries
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -393,7 +368,7 @@ export default {
|
|||||||
showAddDialog() {
|
showAddDialog() {
|
||||||
this.isEdit = false
|
this.isEdit = false
|
||||||
this.selectedSeries = null
|
this.selectedSeries = null
|
||||||
this.bannerForm = { image: null, imageUrl: '', seriesId: null, bannerId: null, lang: 'ko' }
|
this.bannerForm = { image: null, imageUrl: '', seriesId: null, bannerId: null }
|
||||||
this.previewImage = null
|
this.previewImage = null
|
||||||
this.searchKeyword = ''
|
this.searchKeyword = ''
|
||||||
this.searchResults = []
|
this.searchResults = []
|
||||||
@@ -412,8 +387,7 @@ export default {
|
|||||||
image: null,
|
image: null,
|
||||||
imageUrl: banner.imageUrl || banner.imagePath,
|
imageUrl: banner.imageUrl || banner.imagePath,
|
||||||
seriesId: banner.seriesId,
|
seriesId: banner.seriesId,
|
||||||
bannerId: banner.id,
|
bannerId: banner.id
|
||||||
lang: banner.lang || 'ko'
|
|
||||||
}
|
}
|
||||||
this.previewImage = null
|
this.previewImage = null
|
||||||
this.searchKeyword = ''
|
this.searchKeyword = ''
|
||||||
@@ -424,7 +398,7 @@ export default {
|
|||||||
closeDialog() {
|
closeDialog() {
|
||||||
this.showDialog = false
|
this.showDialog = false
|
||||||
this.selectedSeries = null
|
this.selectedSeries = null
|
||||||
this.bannerForm = { image: null, imageUrl: '', seriesId: null, bannerId: null, lang: 'ko' }
|
this.bannerForm = { image: null, imageUrl: '', seriesId: null, bannerId: null }
|
||||||
this.previewImage = null
|
this.previewImage = null
|
||||||
this.searchKeyword = ''
|
this.searchKeyword = ''
|
||||||
this.searchResults = []
|
this.searchResults = []
|
||||||
@@ -476,16 +450,13 @@ export default {
|
|||||||
})
|
})
|
||||||
if (response && response.status === 200 && response.data && response.data.success === true) {
|
if (response && response.status === 200 && response.data && response.data.success === true) {
|
||||||
this.notifySuccess('배너가 수정되었습니다.')
|
this.notifySuccess('배너가 수정되었습니다.')
|
||||||
this.closeDialog()
|
|
||||||
this.refreshBanners()
|
|
||||||
} else {
|
} else {
|
||||||
this.notifyError('배너 수정을 실패했습니다.')
|
this.notifyError('배너 수정을 실패했습니다.')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const response = await createSeriesBanner({
|
const response = await createSeriesBanner({
|
||||||
image: this.bannerForm.image,
|
image: this.bannerForm.image,
|
||||||
seriesId: this.selectedSeries.id,
|
seriesId: this.selectedSeries.id
|
||||||
lang: this.bannerForm.lang
|
|
||||||
})
|
})
|
||||||
if (response && response.status === 200 && response.data && response.data.success === true) {
|
if (response && response.status === 200 && response.data && response.data.success === true) {
|
||||||
this.notifySuccess('배너가 추가되었습니다.')
|
this.notifySuccess('배너가 추가되었습니다.')
|
||||||
|
|||||||
Reference in New Issue
Block a user