|
|
@ -43,14 +43,14 @@ |
|
|
<view class="table-container"> |
|
|
<view class="table-container"> |
|
|
<view class="table-header"> |
|
|
<view class="table-header"> |
|
|
<view class="th th-channel" style="width: 100px;">渠道</view> |
|
|
<view class="th th-channel" style="width: 100px;">渠道</view> |
|
|
<view class="th" v-for="(school, index) in schoolList" :key="index">{{school.name}}</view> |
|
|
<view class="th" v-for="(school, index) in schoolList" :key="index">{{school.campus_name}}</view> |
|
|
<view class="th th-total">渠道合计</view> |
|
|
<view class="th th-total">渠道合计</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="table-body"> |
|
|
<view class="table-body"> |
|
|
<view class="table-row" v-for="(channel, index) in channelSchoolData" :key="index"> |
|
|
<view class="table-row" v-for="(channel, index) in channelList" :key="index"> |
|
|
<view class="td td-channel" style="width: 100px;">{{channel.name}}</view> |
|
|
<view class="td td-channel" style="width: 100px;">{{channel.name}}</view> |
|
|
<view class="td" v-for="(school, sIndex) in schoolList" :key="sIndex"> |
|
|
<view class="td" v-for="(school, sIndex) in schoolList" :key="sIndex"> |
|
|
{{channel.schools[school.id] || 0}} |
|
|
{{channel[school.id] || 0}} |
|
|
</view> |
|
|
</view> |
|
|
<view class="td td-total">{{channel.total}}</view> |
|
|
<view class="td td-total">{{channel.total}}</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -64,14 +64,14 @@ |
|
|
<view class="table-container"> |
|
|
<view class="table-container"> |
|
|
<view class="table-header"> |
|
|
<view class="table-header"> |
|
|
<view class="th th-channel" style="width: 100px;">渠道</view> |
|
|
<view class="th th-channel" style="width: 100px;">渠道</view> |
|
|
<view class="th" v-for="(staff, index) in marketStaffList" :key="index">市场{{staff.name}}</view> |
|
|
<view class="th" v-for="(staff, index) in staffData" :key="index">市场{{staff.name}}</view> |
|
|
<view class="th th-total">资源合计</view> |
|
|
<view class="th th-total">资源合计</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="table-body"> |
|
|
<view class="table-body"> |
|
|
<view class="table-row" v-for="(channel, index) in channelStaffData" :key="index"> |
|
|
<view class="table-row" v-for="(channel, index) in channelList" :key="index"> |
|
|
<view class="td td-channel" style="width: 100px;">{{channel.name}}</view> |
|
|
<view class="td td-channel" style="width: 100px;">{{channel.name}}</view> |
|
|
<view class="td" v-for="(staff, sIndex) in marketStaffList" :key="sIndex"> |
|
|
<view class="td" v-for="(staff, sIndex) in staffData" :key="sIndex"> |
|
|
{{channel.staffs[staff.id] || 0}} |
|
|
{{staff['channel'][channel.value] || 0}} |
|
|
</view> |
|
|
</view> |
|
|
<view class="td td-total">{{channel.total}}</view> |
|
|
<view class="td td-total">{{channel.total}}</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -90,30 +90,11 @@ export default { |
|
|
currentDate: this.formatDate(new Date()), |
|
|
currentDate: this.formatDate(new Date()), |
|
|
currentMonth: new Date().getMonth() + 1, |
|
|
currentMonth: new Date().getMonth() + 1, |
|
|
// 市场人员资源量统计 |
|
|
// 市场人员资源量统计 |
|
|
staffData: [ |
|
|
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 } |
|
|
|
|
|
], |
|
|
|
|
|
// 校区列表 |
|
|
// 校区列表 |
|
|
schoolList: [ |
|
|
schoolList: [], |
|
|
{ id: 1, name: '校区1' }, |
|
|
|
|
|
{ id: 2, name: '校区2' }, |
|
|
|
|
|
{ id: 3, name: '校区3' }, |
|
|
|
|
|
{ id: 4, name: '校区4' }, |
|
|
|
|
|
{ id: 5, name: '校区5' } |
|
|
|
|
|
], |
|
|
|
|
|
// 渠道列表 |
|
|
// 渠道列表 |
|
|
channelList: [ |
|
|
channelList: [], |
|
|
{ id: 1, name: '地推' }, |
|
|
|
|
|
{ id: 2, name: '转介绍' }, |
|
|
|
|
|
{ id: 3, name: '美团/大众' }, |
|
|
|
|
|
{ id: 4, name: '抖音' }, |
|
|
|
|
|
{ id: 5, name: '小红书' }, |
|
|
|
|
|
{ id: 6, name: '其他' } |
|
|
|
|
|
], |
|
|
|
|
|
// 市场人员列表 |
|
|
// 市场人员列表 |
|
|
marketStaffList: [ |
|
|
marketStaffList: [ |
|
|
{ id: 'A', name: 'A' }, |
|
|
{ id: 'A', name: 'A' }, |
|
|
@ -147,28 +128,23 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 初始化数据 |
|
|
// 初始化数据 |
|
|
initData() { |
|
|
async initData() { |
|
|
// 模拟获取数据,实际项目中应该调用API |
|
|
// 模拟获取数据,实际项目中应该调用API |
|
|
this.getStaffStatistics(); |
|
|
await this.getStaffStatistics(); |
|
|
this.getChannelSchoolStatistics(); |
|
|
// await this.getChannelSchoolStatistics(); |
|
|
this.getChannelStaffStatistics(); |
|
|
// this.getChannelStaffStatistics(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 获取人员资源量统计 |
|
|
// 获取人员资源量统计 |
|
|
getStaffStatistics() { |
|
|
async getStaffStatistics() { |
|
|
// 模拟数据,实际项目中应该调用API |
|
|
// 模拟数据,实际项目中应该调用API |
|
|
// 示例:apiRoute.getStaffStatistics({date: this.currentDate}).then(res => {}) |
|
|
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 |
|
|
|
|
|
|
|
|
// 模拟随机数据 |
|
|
|
|
|
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) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 获取校区渠道统计 |
|
|
// 获取校区渠道统计 |
|
|
|