diff --git a/src/api/agent.js b/src/api/agent.js index e6b1b5b..b14de7c 100644 --- a/src/api/agent.js +++ b/src/api/agent.js @@ -7,6 +7,42 @@ async function getAgentList() { return Vue.axios.get('/admin/partner/agent/list') } -export { - getAgentList +// 에이전트 정산 비율 목록 조회 +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 [] + } +} + +export { + getAgentList, + getAgentSettlementRatioList, + createAgentSettlementRatio, + updateAgentSettlementRatio, + searchAgentByNickname, } diff --git a/src/views/Agent/AgentSettlementRatio.vue b/src/views/Agent/AgentSettlementRatio.vue index b6201f3..d8c678a 100644 --- a/src/views/Agent/AgentSettlementRatio.vue +++ b/src/views/Agent/AgentSettlementRatio.vue @@ -1,19 +1,339 @@ - - - - 에이전트 정산 비율 - 에이전트 정산 비율을 설정/관리합니다. (구현 예정) - - - + + + + 에이전트 정산 비율 + + + 에이전트 비율 추가 + + + + + + + + + 총 에이전트 수: {{ totalCount | numberFormat }} + + + + + + + + + + + 에이전트 닉네임 + + + 정산 비율(%) + + + 관리 + + + + + + + {{ item.nickname }} + + + {{ (item.current && item.current.settlementRatio != null) ? item.current.settlementRatio : '-' }} + + + + 수정 + + + + + + 데이터가 없습니다. + + + + + + + + + + + + + + {{ isEdit ? '에이전트 비율 수정' : '에이전트 비율 등록' }} + + + + + + + + + + + + + + + + + + + + 취소 + + + 등록 + + + + +
에이전트 정산 비율을 설정/관리합니다. (구현 예정)