Commit d6538bc6 authored by 赵茹林's avatar 赵茹林

提测 团队概况

parent 3f708ac9
......@@ -2,8 +2,6 @@
<el-dialog :title="title" append-to-body :visible.sync="show" width="960px">
<div v-loading="loading">
<div></div>
<!--回访 开始-->
<el-table v-if="dialogObj.type == 'callback'" :data="list" border size="small">
<el-table-column label="销售顾问" prop="staff_name"></el-table-column>
......@@ -91,15 +89,19 @@
<el-table v-if="dialogObj.type == 'class'" :data="list" border size="small">
<el-table-column label="销售顾问" prop="staff_name"></el-table-column>
<el-table-column label="老师名" prop="teacher_name"></el-table-column>
<el-table-column label="期数名称" prop="user_id"></el-table-column>
<el-table-column label="期数名称" prop="user_id">
<template slot-scope="scope">
{{periodName(scope.row)}}
</template>
</el-table-column>
<el-table-column label="班级名称">
<template slot-scope="scope">{{scope.row.contact_name || '-'}}</template>
<template slot-scope="scope">{{scope.row.class_name || '-'}}</template>
</el-table-column>
<el-table-column label="开课时间">
<template slot-scope="scope">{{scope.row.contact_phone || '-'}}</template>
<template slot-scope="scope">{{scope.row.start_at || '-'}}</template>
</el-table-column>
<el-table-column label="进班人数">
<template slot-scope="scope">{{scope.row.intention || '-'}}</template>
<template slot-scope="scope">{{scope.row.join_num || '-'}}</template>
</el-table-column>
</el-table>
<!--开课班级 结束-->
......@@ -111,17 +113,17 @@
</el-table-column>
<el-table-column label="销售顾问">
<!--todo 优化-->
<template slot-scope="scope">{{(dialogObj.total || String(scope.row.staff_name).indexOf(',')>-1) ? '-' : dialogObj.staff_name}}</template>
<template slot-scope="scope">{{(dialogObj.isTotal || String(scope.row.staff_name).indexOf(',')>-1) ? '-' : dialogObj.staff_name}}</template>
</el-table-column>
<el-table-column label="平均转化率" prop="trans_rate"></el-table-column>
<el-table-column label="日课/体验课" prop="day_order_rate" width="90px"></el-table-column>
<el-table-column label="月课/季课" prop="month_order_rate"></el-table-column>
<el-table-column label="总订单" prop="total_order_num"></el-table-column>
<el-table-column label="一年课" prop="year_order_num">
<!--todo 跳转-->
</el-table-column>
<el-table-column label="两年课" prop="two_order_num">
<!--todo 跳转-->
</el-table-column>
<el-table-column label="总业绩" prop="total_order_money"></el-table-column>
<el-table-column label="一年课" prop="year_order_money"></el-table-column>
......@@ -129,7 +131,7 @@
</el-table>
<!--业绩 结束-->
<!--todo 分页有问题 权限有问题-->
<!--todo 权限有问题-->
<!--<page v-if="total" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>-->
<page :current-page="nowPage" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
......@@ -175,6 +177,26 @@
}
},
periodName(val) {
let str = '';
if (val.goods_id) {
str += `【${val.goods_id}】`
}
if (val.title) {
str += `${val.title}`
}
if (val.watch_num) {
str += `${val.watch_num}课时`
}
if (val.start_at) {
str += `(${val.start_at.slice(5).replace('-', '')})`
}
if (val.has_watch_num || val.has_watch_num == 0) {
str += `-d${val.has_watch_num}`
}
return str
},
getData() { // todo 名字
if (this.dialogObj.type == 'callback') {
this.getVisited();
......@@ -196,8 +218,8 @@
getVisited() { // 已回访
let json = {
// teacher_id: this.dialogObj.teacher_id,
teacher_id: '82',
teacher_id: this.dialogObj.teacher_id,
// teacher_id: '82',
start_at: this.dialogObj.start_at,
page: this.nowPage,
limit: this.limit
......@@ -218,8 +240,13 @@
limit: this.limit
}
getValidchatApi(json.alias, json).then(res => {
this.list = res.chat_friend_list.page_data;
this.total = res.chat_friend_list.total;
if (Object.keys(res).length && res.chat_friend_list) {
this.list = res.chat_friend_list.page_data;
this.total = res.chat_friend_list.total;
} else {
this.list = [];
this.total = 0;
}
this.loading = false;
})
},
......@@ -236,6 +263,9 @@
if (Object.keys(res).length && res.phone_record_list) {
this.list = res.phone_record_list.page_data || [];
this.total = res.phone_record_list.total || 0;
} else {
this.list = [];
this.total = 0;
}
this.loading = false;
})
......@@ -243,7 +273,8 @@
getClass() {
let json = {
teacher_id: this.dialogObj.teacher_id.toString(),
teacher_id: this.dialogObj.teacher_id,
// teacher_id: 75,
start_at: this.dialogObj.start_at,
page: this.nowPage,
limit: this.limit
......@@ -266,7 +297,7 @@
getAchievementApi(json).then(res => {
if (typeof res === 'object') {
res.squad = this.dialogObj.squad;
res.staff_name = this.dialogObj.total ? '-' : this.dialogObj.staff_name;
res.staff_name = this.dialogObj.isTotal ? '-' : this.dialogObj.staff_name;
this.list = [res];
this.total = 0
}
......
<template>
<div class="admin-refresh">
<el-date-picker
style="margin: 10px 0 0 10px; width: 185px;" :clearable="false"
v-model="search.start_at" value-format="yyyy-MM-dd"
align="right" type="date" placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
<el-date-picker
style="margin: 10px 0 0 10px; width: 185px;" :clearable="false"
v-model="search.start_at" value-format="yyyy-MM-dd"
align="right" type="date" placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
<el-tabs v-model="search.team" type="card" class="tabs-refresh" @tab-click="getData">
<el-tab-pane label="总计" name="1,2,3,4,5,6,7,8,9,10"/>
<el-tab-pane v-for="i in 10" :key="i" :label="'T'+i" :name="i.toString()"/>
<el-tab-pane v-for="i in 10" :key="i" :label="'T'+i" :name="i.toString()"/>
</el-tabs>
<el-table class="team-table" border size="small" :data="list" v-loading="loading" :row-class-name="tableRowClassName">
......@@ -266,7 +266,7 @@
transStaff(row) {
if (row.total) {
return '合计'
} else if (row.staff_name.indexOf(',')>-1){
} else if (row.staff_name.indexOf(',') > -1) {
return row.staff_name.split(',').join('<br>')
} else {
return row.staff_name
......@@ -296,7 +296,7 @@
user_id: row.user_id,
teacher_id: row.teacher_id,
start_at: this.search.start_at,
staff_name: row.staff_name.indexOf(',')>-1 ? row.staff_name.split(',').join(',') : row.staff_name
staff_name: row.staff_name.indexOf(',') > -1 ? row.staff_name.split(',').join(',') : row.staff_name
}
},
getData() {
......@@ -308,7 +308,7 @@
}
getTeamApi(json).then(res => {
if (Object.keys(res).length && res.team_list && res.team_list.page_data) {
if (Object.keys(res.team_total).length ) {
if (Object.keys(res.team_total).length) {
res.team_total.total = true; // 方便"合计" 可以这样写,也可以用scope.$index
res.team_list.page_data.unshift(res.team_total);
}
......
<template>
<div class="admin-refresh">
<el-date-picker
style="margin: 10px 0 0 10px; width: 185px;" :clearable="false"
v-model="search.start_at" value-format="yyyy-MM-dd"
align="right" type="date" placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
<el-date-picker
style="margin: 10px 0 0 10px; width: 185px;" :clearable="false"
v-model="search.start_at" value-format="yyyy-MM-dd"
align="right" type="date" placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
<el-tabs v-model="search.team" type="card" class="tabs-refresh" @tab-click="getData">
<el-tab-pane label="总计" name="1,2,3,4,5,6,7,8,9,10"/>
<el-tab-pane v-for="i in 10" :key="i" :label="'T'+i" :name="i.toString()"/>
<el-tab-pane v-for="i in 10" :key="i" :label="'T'+i" :name="i.toString()"/>
</el-tabs>
<el-table class="team-table" border size="small" :data="list" v-loading="loading" :row-class-name="tableRowClassName">
<el-table-column label="组别" width="50px">
<template slot-scope="scope">{{(String(scope.row.squad).indexOf(',') > -1 && scope.row.total) ? '合计' : `T${scope.row.squad}`}}</template>
<template slot-scope="scope">{{scope.row.isTotal ? '合计' : `T${scope.row.squad}`}}</template>
</el-table-column>
<!--<el-table-column label="销售顾问">
......@@ -25,7 +25,7 @@
</el-table-column>-->
<el-table-column v-if="this.search.team != '1,2,3,4,5,6,7,8,9,10'" label="销售顾问">
<template slot-scope="scope">{{scope.row.total ? '-' : scope.row.staff_name}}</template>
<template slot-scope="scope">{{scope.row.isTotal ? '-' : scope.row.staff_name}}</template>
</el-table-column>
<el-table-column prop="reach_class_num">
......@@ -119,7 +119,7 @@
<el-table-column prop="phone_total_time">
<template slot="header" slot-scope="scope">
<!--TODO-->
<!--TODO 时间展示-->
<el-tooltip effect="dark" :content="TIP_TEAM['phone_total_time']" placement="top">
<span class="table-refresh-header">
当日 <i class="el-icon-question"></i><br>有效通
......@@ -199,9 +199,9 @@
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var year = date.getFullYear();//
var month = date.getMonth() + 1;//
var strDate = date.getDate(); //
var year = date.getFullYear(); //
var month = date.getMonth() + 1; //
var strDate = date.getDate(); //
if (month >= 1 && month <= 9) {
month = "0" + month;
}
......@@ -217,6 +217,7 @@
components: {page, TeamDialog},
data() {
return {
isTotal: false,
TIP_TEAM: TIP_TEAM,
loading: true,
search: {
......@@ -264,9 +265,9 @@
},
methods: {
transStaff(row) {
if (row.total) {
if (row.isTotal) {
return '合计'
} else if (row.staff_name.indexOf(',')>-1){
} else if (row.staff_name.indexOf(',') > -1) {
return row.staff_name.split(',').join('<br>')
} else {
return row.staff_name
......@@ -289,14 +290,14 @@
dialogToggle(row, type) {
this.dialogObj = {
alias: row.alias, // 老师微信号
squad: (String(row.squad).indexOf(',') > -1 && row.total) ? '' : `${row.squad}`,
squad: (String(row.squad).indexOf(',') > -1 && row.isTotal) ? '' : `${row.squad}`,
show: true,
total: row.total,
isTotal: row.isTotal,
type: type,
user_id: row.user_id,
teacher_id: row.teacher_id,
start_at: this.search.start_at,
staff_name: row.staff_name.indexOf(',')>-1 ? row.staff_name.split(',').join(',') : row.staff_name
staff_name: row.staff_name.indexOf(',') > -1 ? row.staff_name.split(',').join(',') : row.staff_name
}
},
getData() {
......@@ -308,8 +309,8 @@
}
getTeamApi(json).then(res => {
if (Object.keys(res).length && res.team_list && res.team_list.page_data) {
if (Object.keys(res.team_total).length ) {
res.team_total.total = true; // 方便"合计" 可以这样写,也可以用scope.$index
if (Object.keys(res.team_total).length) {
res.team_total.isTotal = true; // 方便"合计" 可以这样写,也可以用scope.$index
res.team_list.page_data.unshift(res.team_total);
}
this.list = res.team_list.page_data;
......
......@@ -195,7 +195,8 @@ export default [
name: 'team',
component: e => require(['@/components/team'], e),
}
}, {
},
/*{
value: '小时动态',
routerName: 'hour',
path: '/hour',
......@@ -205,7 +206,7 @@ export default [
name: 'hour',
component: e => require(['@/components/team/hour'], e),
}
},
},*/
]
}, {
name: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment