diff --git a/api/apiRoute.js b/api/apiRoute.js index bc91222..f4c10f3 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -346,7 +346,19 @@ export default { async scheduleList(data = {}) { return await http.get('/course/scheduleList', data); }, + async getStaffStatistics(data = {}) { + return await http.get('/statistics/getStaffStatistics', data); + }, + async reimbursement_list(data = {}) { + return await http.get('/personnel/reimbursement_list', data); + }, + async reimbursement_add(data = {}) { + return await http.post('/personnel/reimbursement_add', data); + }, + async reimbursement_info(data = {}) { + return await http.get('/personnel/reimbursement_info', data); + }, diff --git a/pages/market/data/statistics.vue b/pages/market/data/statistics.vue index b37b0e9..5959306 100644 --- a/pages/market/data/statistics.vue +++ b/pages/market/data/statistics.vue @@ -43,14 +43,14 @@ 渠道 - {{school.name}} + {{school.campus_name}} 渠道合计 - + {{channel.name}} - {{channel.schools[school.id] || 0}} + {{channel[school.id] || 0}} {{channel.total}} @@ -64,14 +64,14 @@ 渠道 - 市场{{staff.name}} + 市场{{staff.name}} 资源合计 - + {{channel.name}} - - {{channel.staffs[staff.id] || 0}} + + {{staff['channel'][channel.value] || 0}} {{channel.total}} @@ -90,30 +90,11 @@ export default { currentDate: this.formatDate(new Date()), currentMonth: new Date().getMonth() + 1, // 市场人员资源量统计 - staffData: [ - { name: 'A', weekCount: 0, monthCount: 0, yearCount: 0 }, - { name: 'B', weekCount: 0, monthCount: 0, yearCount: 0 }, - { name: 'C', weekCount: 0, monthCount: 0, yearCount: 0 }, - { name: 'D', weekCount: 0, monthCount: 0, yearCount: 0 }, - { name: 'E', weekCount: 0, monthCount: 0, yearCount: 0 } - ], + staffData: [], // 校区列表 - schoolList: [ - { id: 1, name: '校区1' }, - { id: 2, name: '校区2' }, - { id: 3, name: '校区3' }, - { id: 4, name: '校区4' }, - { id: 5, name: '校区5' } - ], + schoolList: [], // 渠道列表 - channelList: [ - { id: 1, name: '地推' }, - { id: 2, name: '转介绍' }, - { id: 3, name: '美团/大众' }, - { id: 4, name: '抖音' }, - { id: 5, name: '小红书' }, - { id: 6, name: '其他' } - ], + channelList: [], // 市场人员列表 marketStaffList: [ { id: 'A', name: 'A' }, @@ -147,28 +128,23 @@ export default { }, // 初始化数据 - initData() { + async initData() { // 模拟获取数据,实际项目中应该调用API - this.getStaffStatistics(); - this.getChannelSchoolStatistics(); - this.getChannelStaffStatistics(); + await this.getStaffStatistics(); + // await this.getChannelSchoolStatistics(); + // this.getChannelStaffStatistics(); }, // 获取人员资源量统计 - getStaffStatistics() { + async getStaffStatistics() { // 模拟数据,实际项目中应该调用API - // 示例:apiRoute.getStaffStatistics({date: this.currentDate}).then(res => {}) - - // 模拟随机数据 - this.staffData = this.staffData.map(staff => { - const monthCount = Math.floor(Math.random() * 100); - return { - ...staff, - weekCount: Math.floor(Math.random() * 30), - monthCount: monthCount, - yearCount: monthCount + Math.floor(Math.random() * 200) - } - }); + let res = await apiRoute.getStaffStatistics({date: this.currentDate}) + + console.log(res.data.staffData,"================"); + this.staffData = res.data.staffData + this.schoolList = res.data.schoolList + this.channelList = res.data.channelList + }, // 获取校区渠道统计 diff --git a/pages/market/reimbursement/add.vue b/pages/market/reimbursement/add.vue index d300ea8..6b330df 100644 --- a/pages/market/reimbursement/add.vue +++ b/pages/market/reimbursement/add.vue @@ -1,222 +1,272 @@