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

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

parent df5dca73
......@@ -37,7 +37,9 @@
return x.cover === j.cover;
});
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.delete = !!find.delete;
j.router.meta.export = !!find.export;
......@@ -288,6 +290,7 @@
.table-refresh-header {
display: inline-block;
cursor: help;
i {
color: #409eff;
}
......@@ -301,16 +304,20 @@
text-decoration: underline;
transition: color 240ms, background-color 240ms;
color: #444;
& + .cell-link {
margin-left: 0;
}
a {
color: #444;
transition: color 240ms, background-color 240ms;
}
&:hover {
background-color: #cce4ff;
color: #007fff;
a {
color: #007fff;
}
......@@ -330,6 +337,7 @@
.tabs-refresh {
margin-top: 10px;
&.el-tabs--card > .el-tabs__header {
margin-bottom: 10px;
/*margin-top: 10px;*/
......@@ -362,20 +370,25 @@
border: solid 1px #EBEEF5;
border-spacing: 0;
border-collapse: collapse;
thead {
color: #909399;
font-weight: 500;
th {
padding: 12px 10px;
border: 1px solid #EBEEF5;
}
}
tbody {
tr {
transition: background-color 240ms;
&:hover {
background-color: #F5F7FA;
}
td {
padding: 12px 10px;
border: 1px solid #EBEEF5;
......
......@@ -10,7 +10,8 @@
<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 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>
<!--<table class="custom-table" v-loading="loading">
......@@ -93,6 +94,9 @@
components: {page, HourDialog},
data() {
return {
index: '',
// teamTotalString: '',
teamLength: 10,
time: [],
table: {
th: [],
......@@ -141,10 +145,44 @@
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() {
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;
......@@ -188,6 +226,7 @@
this.loading = true;
let json = {
team: this.search.team,
type: this.search.type,
page: this.nowPage,
limit: this.limit,
start_at: this.search.start_at
......
......@@ -9,8 +9,9 @@
</el-date-picker>
<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 v-for="i in 10" :key="i" :label="'T'+i" :name="i.toString()"/>
<!--<el-tab-pane label="总计" name="1,2,3,4,5,6,7,8,9,10"/>-->
<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-table class="team-table" border size="small" :data="list" v-loading="loading" :row-class-name="tableRowClassName">
......@@ -24,7 +25,8 @@
</template>
</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>
</el-table-column>
......@@ -196,6 +198,7 @@
import {getTeamApi} from '@service/api';
import {TIP_TEAM} from '@util/tipArr';
import CommonJs from '@util/common';
import {TEACHER_TYPE} from '@/util/wordbook'
function getNowFormatDate() {
var date = new Date();
......@@ -218,11 +221,15 @@
components: {page, TeamDialog},
data() {
return {
index: '',
teamTotalString: '',
teamLength: 10,
isTotal: false,
TIP_TEAM: TIP_TEAM,
loading: true,
search: {
team: '1',
type: '',
start_at: getNowFormatDate()
// start_at: new Date()
},
......@@ -262,10 +269,44 @@
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() {
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;
......@@ -317,9 +358,10 @@
this.loading = true;
let json = {
team: this.search.team,
type: this.search.type,
page: this.nowPage,
limit: this.limit,
start_at: this.search.start_at
start_at: this.search.start_at,
}
getTeamApi(json).then(res => {
if (Object.keys(res).length && res.team_list && res.team_list.page_data) {
......
......@@ -224,6 +224,7 @@ export default [
path: '/team1',
name: 'team1',
component: e => require(['@/components/team'], e),
meta: {index: 1, type: 0}
}
}, {
value: '团队概况(2部)',
......@@ -234,6 +235,7 @@ export default [
path: '/team2',
name: 'team2',
component: e => require(['@/components/team'], e),
meta: {index: 2, type: 5}
}
}, {
value: '团队概况(3部)',
......@@ -244,6 +246,7 @@ export default [
path: '/team3',
name: 'team3',
component: e => require(['@/components/team'], e),
meta: {index: 3, type: 6}
}
}, {
value: '小时动态(1部)',
......@@ -254,6 +257,7 @@ export default [
path: '/hour1',
name: 'hour1',
component: e => require(['@/components/team/hour'], e),
meta: {index: 1, type: 0}
}
}, {
value: '小时动态(2部)',
......@@ -264,6 +268,7 @@ export default [
path: '/hour2',
name: 'hour2',
component: e => require(['@/components/team/hour'], e),
meta: {index: 2, type: 5}
}
}, {
value: '小时动态(3部)',
......@@ -274,6 +279,7 @@ export default [
path: '/hour3',
name: 'hour3',
component: e => require(['@/components/team/hour'], e),
meta: {index: 3, type: 6}
}
},
]
......
......@@ -283,6 +283,49 @@ export const STAFF_TYPE = [{
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 = [
{
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