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

update

parent 21e65c86
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-dialog :title="title" append-to-body :visible.sync="show" width="800px"> <el-dialog :title="title" append-to-body :visible.sync="show" width="800px">
<div v-loading="loading"> <div v-loading="loading">
<div>销售顾问:{{dialogObj.staff_name}}</div> <div></div>
<el-table :data="list"> <el-table :data="list">
<el-table-column prop="month_order_rate"> <el-table-column prop="month_order_rate">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</template> </template>
<script> <script>
import { getVisitedApi,getClassOpenedApi } from "@service/api"; import { getVisitedApi,getClassOpenedApi,getAchievementApi } from "@service/api";
import page from '@framework/page' import page from '@framework/page'
export default { export default {
...@@ -52,11 +52,28 @@ ...@@ -52,11 +52,28 @@
this.show = this.dialogObj.show; this.show = this.dialogObj.show;
if (this.dialogObj.type == 'callback') { if (this.dialogObj.type == 'callback') {
this.getVisited(); this.getVisited();
this.title = `销售顾问:${this.dialogObj.staff_name} T${this.dialogObj.team}`
} else if (this.dialogObj.type == 'class') { } else if (this.dialogObj.type == 'class') {
this.getClass(); this.getClass();
this.title = `销售顾问:${this.dialogObj.staff_name} T${this.dialogObj.team}`
} else if (this.dialogObj.type == 'achievement') {
this.getAchievement();
this.title = `业绩详情:${this.dialogObj.staff_name} T${this.dialogObj.team}`
} }
} }
}, },
getAchievement() {
let json = {
teacher_id: this.dialogObj.teacher_id,
start_at: this.dialogObj.start_at,
page: this.nowPage,
limit: this.limit
}
getAchievementApi(json).then(res => {
this.loading = false;
console.log(res)
})
},
getVisited() { getVisited() {
let json = { let json = {
teacher_id: this.dialogObj.teacher_id, teacher_id: this.dialogObj.teacher_id,
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<el-table class="team-table" border size="small" :data="list" v-loading="loading" :row-class-name="tableRowClassName"> <el-table class="team-table" border size="small" :data="list" v-loading="loading" :row-class-name="tableRowClassName">
<el-table-column label="组别" width="50px"> <el-table-column label="组别" width="50px">
<template slot-scope="scope">{{`T${scope.row.squad}`}}</template> <template slot-scope="scope">{{(String(scope.row.squad).indexOf(',') > -1 && scope.row.total) ? '合计' : `T${scope.row.squad}`}}</template>
</el-table-column> </el-table-column>
<el-table-column label="销售顾问"> <el-table-column label="销售顾问">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.total ? '合计' : scope.row.staff_name}} <span v-html="transStaff(scope.row)"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="reach_class_num"> <el-table-column prop="reach_class_num">
...@@ -149,7 +149,9 @@ ...@@ -149,7 +149,9 @@
</el-tooltip> </el-tooltip>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link @click="dialogToggle">{{scope.row.month_order_rate}}</el-link> <el-link @click="dialogToggle">
{{transRate(scope.row.month_trans_order_num, scope.row.month_trans_user_num)}}
</el-link>
</template> </template>
</el-table-column> </el-table-column>
...@@ -247,6 +249,22 @@ ...@@ -247,6 +249,22 @@
this.getData(); this.getData();
}, },
methods: { methods: {
transStaff(row) {
if (row.total) {
return '合计'
} else if (row.staff_name.indexOf(',')>-1){
return row.staff_name.split(',').join('<br>')
} else {
return row.staff_name
}
},
transRate(child, mother) {
if (mother) {
return `${Math.floor(child * 100) / mother}%`
} else {
return '-'
}
},
tableRowClassName({row, rowIndex}) { tableRowClassName({row, rowIndex}) {
if (rowIndex === 0) { if (rowIndex === 0) {
return 'primary-row'; return 'primary-row';
...@@ -256,6 +274,7 @@ ...@@ -256,6 +274,7 @@
dialogToggle(row, type) { dialogToggle(row, type) {
console.log('row', row); console.log('row', row);
this.dialogObj = { this.dialogObj = {
team: this.search.team,
show: true, show: true,
type: type, type: type,
teacher_id: row.teacher_id, teacher_id: row.teacher_id,
...@@ -269,15 +288,17 @@ ...@@ -269,15 +288,17 @@
team: this.search.team team: this.search.team
} }
getTeamApi(json).then(res => { getTeamApi(json).then(res => {
if (Object.keys(res).length) { if (Object.keys(res).length && res.team_list && res.team_list.page_data) {
if (res.team_total[1]) { if (Object.keys(res.team_total).length ) {
res.team_total[1].total = true; // 方便"合计" 可以这样写,也可以用scope.$index res.team_total.total = true; // 方便"合计" 可以这样写,也可以用scope.$index
res.team_list.page_data.unshift(res.team_total[1]); res.team_list.page_data.unshift(res.team_total);
} }
this.list = res.team_list.page_data; this.list = res.team_list.page_data;
this.total = res.team_list.total; this.total = res.team_list.total;
this.loading = false; this.loading = false;
} else { } else {
this.list = [];
this.total = 0;
this.loading = false; this.loading = false;
} }
}) })
......
...@@ -1481,3 +1481,7 @@ export const getVisitedApi = function (json) { ...@@ -1481,3 +1481,7 @@ export const getVisitedApi = function (json) {
export const getClassOpenedApi = function (json) { export const getClassOpenedApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/admin/teacher/reachstartclasslist`, json) return Vue.prototype.$fetch(`${_baseUrl}api/admin/teacher/reachstartclasslist`, json)
}; };
// 获取业绩详情
export const getAchievementApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/admin/teacher/teamachievement`, json)
};
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