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

团队概况、小时动态 [新增] 销售分部页面

parent df5dca73
...@@ -37,7 +37,9 @@ ...@@ -37,7 +37,9 @@
return x.cover === j.cover; return x.cover === j.cover;
}); });
if (find) { if (find) {
j.router.meta = {}; if (!j.router.meta || JSON.stringify(j.router.meta) == '{}') {
j.router.meta = {};
}
j.router.meta.readonly = !!find.readonly; j.router.meta.readonly = !!find.readonly;
j.router.meta.delete = !!find.delete; j.router.meta.delete = !!find.delete;
j.router.meta.export = !!find.export; j.router.meta.export = !!find.export;
...@@ -288,6 +290,7 @@ ...@@ -288,6 +290,7 @@
.table-refresh-header { .table-refresh-header {
display: inline-block; display: inline-block;
cursor: help; cursor: help;
i { i {
color: #409eff; color: #409eff;
} }
...@@ -301,16 +304,20 @@ ...@@ -301,16 +304,20 @@
text-decoration: underline; text-decoration: underline;
transition: color 240ms, background-color 240ms; transition: color 240ms, background-color 240ms;
color: #444; color: #444;
& + .cell-link { & + .cell-link {
margin-left: 0; margin-left: 0;
} }
a { a {
color: #444; color: #444;
transition: color 240ms, background-color 240ms; transition: color 240ms, background-color 240ms;
} }
&:hover { &:hover {
background-color: #cce4ff; background-color: #cce4ff;
color: #007fff; color: #007fff;
a { a {
color: #007fff; color: #007fff;
} }
...@@ -330,6 +337,7 @@ ...@@ -330,6 +337,7 @@
.tabs-refresh { .tabs-refresh {
margin-top: 10px; margin-top: 10px;
&.el-tabs--card > .el-tabs__header { &.el-tabs--card > .el-tabs__header {
margin-bottom: 10px; margin-bottom: 10px;
/*margin-top: 10px;*/ /*margin-top: 10px;*/
...@@ -362,20 +370,25 @@ ...@@ -362,20 +370,25 @@
border: solid 1px #EBEEF5; border: solid 1px #EBEEF5;
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
thead { thead {
color: #909399; color: #909399;
font-weight: 500; font-weight: 500;
th { th {
padding: 12px 10px; padding: 12px 10px;
border: 1px solid #EBEEF5; border: 1px solid #EBEEF5;
} }
} }
tbody { tbody {
tr { tr {
transition: background-color 240ms; transition: background-color 240ms;
&:hover { &:hover {
background-color: #F5F7FA; background-color: #F5F7FA;
} }
td { td {
padding: 12px 10px; padding: 12px 10px;
border: 1px solid #EBEEF5; border: 1px solid #EBEEF5;
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<el-tabs v-if="teacherType == ''" v-model="search.team" type="card" class="tabs-refresh" @tab-click="getData"> <el-tabs v-if="teacherType == ''" 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 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-tab-pane v-for="i in 10" :key="i+(index-1)*10" :label="'T'+(i+(index-1)*10)" :name="(i+(index-1)*10).toString()"/>
</el-tabs> </el-tabs>
<!--<table class="custom-table" v-loading="loading"> <!--<table class="custom-table" v-loading="loading">
...@@ -93,6 +94,9 @@ ...@@ -93,6 +94,9 @@
components: {page, HourDialog}, components: {page, HourDialog},
data() { data() {
return { return {
index: '',
// teamTotalString: '',
teamLength: 10,
time: [], time: [],
table: { table: {
th: [], th: [],
...@@ -141,10 +145,44 @@ ...@@ -141,10 +145,44 @@
teacherType: '' // 'teacher_leader' // 'teacher' // '' teacherType: '' // 'teacher_leader' // 'teacher' // ''
} }
}, },
watch: {
$route() {
this.index = this.$route.meta.index;
this.search.type = this.$route.meta.type;
/*var arr = [];
for (var i = 0; i < this.teamLength; i++) {
arr.push(i + 1 + (this.index - 1) * 10)
}
this.teamTotalString = arr.join(',');*/
var phoneNum = localStorage.getItem("phoneNum");
this.teacherType = phoneNum && JSON.parse(phoneNum) && JSON.parse(phoneNum).teacher_type ? JSON.parse(phoneNum).teacher_type : '';
if (this.teacherType == '') { // 总监
this.search.team = ((this.index - 1) * 10 + 1).toString();
this.getData();
} else if (this.teacherType == 'teacher_leader') { // 组长
this.search.team = JSON.parse(phoneNum).squad;
this.getData();
} else if (this.teacherType == 'teacher') { // 组员
console.log('组员无权限!')
}
},
},
mounted() { mounted() {
this.index = this.$route.meta.index;
this.search.type = this.$route.meta.type;
/*var arr = [];
for (var i = 0; i < this.teamLength; i++) {
arr.push(i + 1 + (this.index - 1) * 10)
}
this.teamTotalString = arr.join(',');*/
var phoneNum = localStorage.getItem("phoneNum"); var phoneNum = localStorage.getItem("phoneNum");
this.teacherType = phoneNum && JSON.parse(phoneNum) && JSON.parse(phoneNum).teacher_type ? JSON.parse(phoneNum).teacher_type : ''; this.teacherType = phoneNum && JSON.parse(phoneNum) && JSON.parse(phoneNum).teacher_type ? JSON.parse(phoneNum).teacher_type : '';
if (this.teacherType == '') { // 总监 if (this.teacherType == '') { // 总监
this.search.team = ((this.index - 1) * 10 + 1).toString();
this.getData(); this.getData();
} else if (this.teacherType == 'teacher_leader') { // 组长 } else if (this.teacherType == 'teacher_leader') { // 组长
this.search.team = JSON.parse(phoneNum).squad; this.search.team = JSON.parse(phoneNum).squad;
...@@ -188,6 +226,7 @@ ...@@ -188,6 +226,7 @@
this.loading = true; this.loading = true;
let json = { let json = {
team: this.search.team, team: this.search.team,
type: this.search.type,
page: this.nowPage, page: this.nowPage,
limit: this.limit, limit: this.limit,
start_at: this.search.start_at start_at: this.search.start_at
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
</el-date-picker> </el-date-picker>
<el-tabs v-if="teacherType == ''" v-model="search.team" type="card" class="tabs-refresh" @tab-click="getData"> <el-tabs v-if="teacherType == ''" 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 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 label="总计" :name="teamTotalString"/>
<el-tab-pane v-for="i in 10" :key="i+(index-1)*10" :label="'T'+(i+(index-1)*10)" :name="(i+(index-1)*10).toString()"/>
</el-tabs> </el-tabs>
<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">
...@@ -24,7 +25,8 @@ ...@@ -24,7 +25,8 @@
</template> </template>
</el-table-column>--> </el-table-column>-->
<el-table-column v-if="this.search.team != '1,2,3,4,5,6,7,8,9,10'" label="销售顾问"> <!--<el-table-column v-if="this.search.team != '1,2,3,4,5,6,7,8,9,10'" label="销售顾问">-->
<el-table-column v-if="search.team != teamTotalString" label="销售顾问">
<template slot-scope="scope">{{scope.row.isTotal ? '-' : scope.row.staff_name}}</template> <template slot-scope="scope">{{scope.row.isTotal ? '-' : scope.row.staff_name}}</template>
</el-table-column> </el-table-column>
...@@ -196,6 +198,7 @@ ...@@ -196,6 +198,7 @@
import {getTeamApi} from '@service/api'; import {getTeamApi} from '@service/api';
import {TIP_TEAM} from '@util/tipArr'; import {TIP_TEAM} from '@util/tipArr';
import CommonJs from '@util/common'; import CommonJs from '@util/common';
import {TEACHER_TYPE} from '@/util/wordbook'
function getNowFormatDate() { function getNowFormatDate() {
var date = new Date(); var date = new Date();
...@@ -218,11 +221,15 @@ ...@@ -218,11 +221,15 @@
components: {page, TeamDialog}, components: {page, TeamDialog},
data() { data() {
return { return {
index: '',
teamTotalString: '',
teamLength: 10,
isTotal: false, isTotal: false,
TIP_TEAM: TIP_TEAM, TIP_TEAM: TIP_TEAM,
loading: true, loading: true,
search: { search: {
team: '1', team: '1',
type: '',
start_at: getNowFormatDate() start_at: getNowFormatDate()
// start_at: new Date() // start_at: new Date()
}, },
...@@ -262,10 +269,44 @@ ...@@ -262,10 +269,44 @@
teacherType: '' // 'teacher_leader' // 'teacher' // '' teacherType: '' // 'teacher_leader' // 'teacher' // ''
} }
}, },
watch: {
$route() {
this.index = this.$route.meta.index;
this.search.type = this.$route.meta.type;
var arr = [];
for (var i = 0; i < this.teamLength; i++) {
arr.push(i + 1 + (this.index - 1) * 10)
}
this.teamTotalString = arr.join(',');
var phoneNum = localStorage.getItem("phoneNum");
this.teacherType = phoneNum && JSON.parse(phoneNum) && JSON.parse(phoneNum).teacher_type ? JSON.parse(phoneNum).teacher_type : '';
if (this.teacherType == '') { // 总监
this.search.team = ((this.index - 1) * 10 + 1).toString();
this.getData();
} else if (this.teacherType == 'teacher_leader') { // 组长
this.search.team = JSON.parse(phoneNum).squad;
this.getData();
} else if (this.teacherType == 'teacher') { // 组员
console.log('组员无权限!')
}
},
},
mounted() { mounted() {
this.index = this.$route.meta.index;
this.search.type = this.$route.meta.type;
var arr = [];
for (var i = 0; i < this.teamLength; i++) {
arr.push(i + 1 + (this.index - 1) * 10)
}
this.teamTotalString = arr.join(',');
var phoneNum = localStorage.getItem("phoneNum"); var phoneNum = localStorage.getItem("phoneNum");
this.teacherType = phoneNum && JSON.parse(phoneNum) && JSON.parse(phoneNum).teacher_type ? JSON.parse(phoneNum).teacher_type : ''; this.teacherType = phoneNum && JSON.parse(phoneNum) && JSON.parse(phoneNum).teacher_type ? JSON.parse(phoneNum).teacher_type : '';
if (this.teacherType == '') { // 总监 if (this.teacherType == '') { // 总监
this.search.team = ((this.index - 1) * 10 + 1).toString();
this.getData(); this.getData();
} else if (this.teacherType == 'teacher_leader') { // 组长 } else if (this.teacherType == 'teacher_leader') { // 组长
this.search.team = JSON.parse(phoneNum).squad; this.search.team = JSON.parse(phoneNum).squad;
...@@ -317,9 +358,10 @@ ...@@ -317,9 +358,10 @@
this.loading = true; this.loading = true;
let json = { let json = {
team: this.search.team, team: this.search.team,
type: this.search.type,
page: this.nowPage, page: this.nowPage,
limit: this.limit, limit: this.limit,
start_at: this.search.start_at start_at: this.search.start_at,
} }
getTeamApi(json).then(res => { getTeamApi(json).then(res => {
if (Object.keys(res).length && res.team_list && res.team_list.page_data) { if (Object.keys(res).length && res.team_list && res.team_list.page_data) {
......
...@@ -224,6 +224,7 @@ export default [ ...@@ -224,6 +224,7 @@ export default [
path: '/team1', path: '/team1',
name: 'team1', name: 'team1',
component: e => require(['@/components/team'], e), component: e => require(['@/components/team'], e),
meta: {index: 1, type: 0}
} }
}, { }, {
value: '团队概况(2部)', value: '团队概况(2部)',
...@@ -234,6 +235,7 @@ export default [ ...@@ -234,6 +235,7 @@ export default [
path: '/team2', path: '/team2',
name: 'team2', name: 'team2',
component: e => require(['@/components/team'], e), component: e => require(['@/components/team'], e),
meta: {index: 2, type: 5}
} }
}, { }, {
value: '团队概况(3部)', value: '团队概况(3部)',
...@@ -244,6 +246,7 @@ export default [ ...@@ -244,6 +246,7 @@ export default [
path: '/team3', path: '/team3',
name: 'team3', name: 'team3',
component: e => require(['@/components/team'], e), component: e => require(['@/components/team'], e),
meta: {index: 3, type: 6}
} }
}, { }, {
value: '小时动态(1部)', value: '小时动态(1部)',
...@@ -254,6 +257,7 @@ export default [ ...@@ -254,6 +257,7 @@ export default [
path: '/hour1', path: '/hour1',
name: 'hour1', name: 'hour1',
component: e => require(['@/components/team/hour'], e), component: e => require(['@/components/team/hour'], e),
meta: {index: 1, type: 0}
} }
}, { }, {
value: '小时动态(2部)', value: '小时动态(2部)',
...@@ -264,6 +268,7 @@ export default [ ...@@ -264,6 +268,7 @@ export default [
path: '/hour2', path: '/hour2',
name: 'hour2', name: 'hour2',
component: e => require(['@/components/team/hour'], e), component: e => require(['@/components/team/hour'], e),
meta: {index: 2, type: 5}
} }
}, { }, {
value: '小时动态(3部)', value: '小时动态(3部)',
...@@ -274,6 +279,7 @@ export default [ ...@@ -274,6 +279,7 @@ export default [
path: '/hour3', path: '/hour3',
name: 'hour3', name: 'hour3',
component: e => require(['@/components/team/hour'], e), component: e => require(['@/components/team/hour'], e),
meta: {index: 3, type: 6}
} }
}, },
] ]
......
...@@ -283,6 +283,49 @@ export const STAFF_TYPE = [{ ...@@ -283,6 +283,49 @@ export const STAFF_TYPE = [{
value: 4 value: 4
}]; }];
/*export const STAFF_TYPE = [{
label: '销售1部',
value: 1
}, {
label: '销售2部',
value: 5
}, {
label: '销售3部',
value: 6
}, {
label: '助教',
value: 2
}, {
label: 'TMK',
value: 3
}, {
label: '增长',
value: 4
}];*/
export const TEACHER_TYPE = [{
label: '销售1部',
value: 0,
}, {
label: '销售2部',
value: 5
}, {
label: '销售3部',
value: 6
}, {
label: '新星妈妈',
value: 1
}, {
label: '用户服务',
value: 2
}, {
label: '增长运营',
value: 3
}, {
label: 'TMK',
value: 4
}];
export const STAFF = [ export const STAFF = [
{ {
label: '岗位名称' label: '岗位名称'
......
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