|
|
@@ -201,8 +201,10 @@ export default {
|
|
|
this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
|
|
|
this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 1));
|
|
|
this.powerGrade = localStorage.getItem('powerGrade');
|
|
|
+ // userDeptLevel用户部门等级字段,0-总部,1-公司,2-大区,3-销售部,4-业务员
|
|
|
+ this.userDeptLevel = localStorage.getItem('userDeptLevel');
|
|
|
this.getDeptInfo('dept');
|
|
|
- if (this.powerGrade == 5) {
|
|
|
+ if (this.userDeptLevel == 0) {
|
|
|
setTimeout(() => {
|
|
|
if (this.$route.query.regionCode == undefined) {
|
|
|
this.companyName = this.companyList[0].deptName;
|
|
|
@@ -211,17 +213,17 @@ export default {
|
|
|
this.getDeptInfo('dept', 1);
|
|
|
}, 1000);
|
|
|
}
|
|
|
- if (this.powerGrade == 4) {
|
|
|
+ if (this.userDeptLevel == 1) {
|
|
|
setTimeout(() => {
|
|
|
this.getDeptInfo('dept', 1);
|
|
|
}, 1000);
|
|
|
}
|
|
|
- if (this.powerGrade == 3) {
|
|
|
+ if (this.userDeptLevel == 2) {
|
|
|
setTimeout(() => {
|
|
|
this.getDeptInfo('dept', 2);
|
|
|
}, 1000);
|
|
|
}
|
|
|
- if (this.powerGrade == 2) {
|
|
|
+ if (this.userDeptLevel == 3) {
|
|
|
setTimeout(() => {
|
|
|
this.getDeptInfo('user');
|
|
|
}, 2000);
|
|
|
@@ -243,6 +245,8 @@ export default {
|
|
|
watch: {
|
|
|
$route(to, from) {
|
|
|
this.powerGrade = localStorage.getItem('powerGrade');
|
|
|
+ // userDeptLevel用户部门等级字段,0-总部,1-公司,2-大区,3-销售部,4-业务员
|
|
|
+ this.userDeptLevel = localStorage.getItem('userDeptLevel');
|
|
|
if (to.path == '/doubleWeeklyHistorical' && from.path != '/doubleHistoricalWeeklyDetils') {
|
|
|
if (this.$route.query.regionCode != undefined) {
|
|
|
this.companyName = this.$route.query.companyName;
|
|
|
@@ -259,7 +263,7 @@ export default {
|
|
|
this.list = [];
|
|
|
this.tableList = [];
|
|
|
this.getDeptInfo('dept');
|
|
|
- if (this.powerGrade == 5) {
|
|
|
+ if (this.userDeptLevel == 0) {
|
|
|
setTimeout(() => {
|
|
|
if (this.$route.query.regionCode == undefined) {
|
|
|
this.companyName = this.companyList[0].deptName;
|
|
|
@@ -268,17 +272,17 @@ export default {
|
|
|
this.getDeptInfo('dept', 1);
|
|
|
}, 1000);
|
|
|
}
|
|
|
- if (this.powerGrade == 4) {
|
|
|
+ if (this.userDeptLevel == 1) {
|
|
|
setTimeout(() => {
|
|
|
this.getDeptInfo('dept', 1);
|
|
|
}, 1000);
|
|
|
}
|
|
|
- if (this.powerGrade == 3) {
|
|
|
+ if (this.userDeptLevel == 2) {
|
|
|
setTimeout(() => {
|
|
|
this.getDeptInfo('dept', 2);
|
|
|
}, 1000);
|
|
|
}
|
|
|
- if (this.powerGrade == 2) {
|
|
|
+ if (this.userDeptLevel == 3) {
|
|
|
setTimeout(() => {
|
|
|
this.getDeptInfo('user');
|
|
|
}, 2000);
|
|
|
@@ -429,7 +433,7 @@ export default {
|
|
|
this.deptList = [{ deptName: '全部销售部', deptId: '' }].concat(res.data.dept);
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.powerGrade == 5) {
|
|
|
+ if (this.userDeptLevel == 0) {
|
|
|
this.companyList = [{ deptName: '全部公司', deptId: '' }].concat(res.data.company);
|
|
|
} else {
|
|
|
this.companyList = res.data.company;
|