Explorar o código

总部移动端筛选全国数据

zhujindu hai 6 meses
pai
achega
50d334163b

+ 8 - 7
src/views/historicalVisit/historAllVisit.vue

@@ -256,11 +256,10 @@ export default {
       deptForm: { type: '', parentId: '' },
       pageNum: 1, // 当前页码  int类型
       pageSize: 10, // 当前每页条数  int类型
-      deptLevel: null,
+      userDeptLevel: null,
     };
   },
   activated() {
-    this.deptLevel = localStorage.getItem('deptLevel');
     setTimeout(() => {
       this.onSearch();
     }, 1000);
@@ -272,8 +271,10 @@ export default {
     this.list = [];
     // powerGrade:等级(1-销售员 2-销售部主管 3-大区主管 4-区域公司总经理 5-DIY公司)
     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.userCode == undefined) {
           this.companyName = this.companyList[0].deptName;
@@ -282,17 +283,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 || this.powerGrade == 1) {
+    if (this.userDeptLevel == 3 || this.userDeptLevel == 4) {
       setTimeout(() => {
         this.getDeptInfo('user');
       }, 2000);
@@ -499,7 +500,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;

+ 1 - 0
src/views/home/ABtarget.vue

@@ -689,6 +689,7 @@ export default {
           }
           loading1.clear();
           localStorage.setItem('powerGrade', res.data.positionId);
+          localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
           localStorage.setItem('isDiy', res.data.diy);
           localStorage.setItem('uType', res.data.userType);
           localStorage.setItem('jzType', res.data.jzType);

+ 1 - 0
src/views/home/bottomBtn.vue

@@ -137,6 +137,7 @@ export default {
             this.JZQuota = false;
           }
           localStorage.setItem('powerGrade', res.data.positionId);
+          localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
           localStorage.setItem('isDiy', res.data.diy);
           localStorage.setItem('uType', res.data.userType);
           localStorage.setItem('jzType', res.data.jzType);

+ 1 - 0
src/views/home/index.vue

@@ -142,6 +142,7 @@ export default {
       getReportInfo({ isContent: false }).then((res) => {
         if (res.code == 200) {
           localStorage.setItem('powerGrade', res.data.positionId);
+          localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
           localStorage.setItem('isDiy', res.data.diy);
           localStorage.setItem('uType', res.data.userType);
           localStorage.setItem('jzType', res.data.jzType);

+ 7 - 5
src/views/week/VisitSummary.vue

@@ -189,8 +189,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}'), 2));
     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.userCode == undefined) {
           this.companyName = this.companyList[0].deptName;
@@ -199,17 +201,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 || this.powerGrade == 1) {
+    if (this.userDeptLevel == 3 || this.userDeptLevel == 4) {
       setTimeout(() => {
         this.getDeptInfo('user');
       }, 2000);
@@ -417,7 +419,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;

+ 2 - 0
src/views/week/daily.vue

@@ -602,6 +602,7 @@ export default {
               });
           } else {
             localStorage.setItem('powerGrade', res.data.positionId);
+            localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
             this.GZQuota = false;
             this.JZQuota = false;
             this.YFQuota = res.data.postType == 'YF' ? true : false;
@@ -778,6 +779,7 @@ export default {
       getReportInfo({ isContent: true }).then((res) => {
         loading1.clear();
         localStorage.setItem('powerGrade', res.data.positionId);
+        localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
         this.powerGrade = res.data.positionId;
         this.showButton = res.data.showButton;
         this.type = res.data.userType;

+ 14 - 9
src/views/week/dailyHistorical.vue

@@ -183,6 +183,7 @@ export default {
         pageSize: 10, // 当前每页条数  int类型
       },
       tableList: [],
+      userDeptLevel: null,
     };
   },
   beforeDestroy() {
@@ -197,8 +198,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}'), 2));
     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.userCode == undefined) {
           this.companyName = this.companyList[0].deptName;
@@ -207,17 +210,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 || this.powerGrade == 1) {
+    if (this.userDeptLevel == 3 || this.userDeptLevel == 4) {
       setTimeout(() => {
         this.getDeptInfo('user');
       }, 2000);
@@ -273,8 +276,10 @@ export default {
           this.userCode = '';
           this.userName = '全部业务员';
           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.userCode == undefined) {
                 this.companyName = this.companyList[0].deptName;
@@ -283,17 +288,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 || this.powerGrade == 1) {
+          if (this.userDeptLevel == 3 || this.userDeptLevel == 4) {
             setTimeout(() => {
               this.getDeptInfo('user');
             }, 2000);
@@ -444,7 +449,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;

+ 1 - 0
src/views/week/doubleWeekly.vue

@@ -650,6 +650,7 @@ export default {
       getReportInfo({ isContent: true }).then((res) => {
         loading1.clear();
         localStorage.setItem('powerGrade', res.data.positionId);
+        localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
         this.powerGrade = res.data.positionId;
         this.showButton = res.data.showButton;
         this.reportTargetAll = res.data.reportTargetAll;

+ 13 - 9
src/views/week/doubleWeeklyHistorical.vue

@@ -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;

+ 1 - 0
src/views/week/index.vue

@@ -328,6 +328,7 @@ export default {
         this.list = res.data.summaryTasks;
         this.historyButton = res.data.historyButton;
         localStorage.setItem('powerGrade', res.data.positionId);
+        localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
         this.existReject = res.data.existReject;
         this.powerGrade = res.data.positionId;
         this.showButton = res.data.showButton;

+ 1 - 0
src/views/week/weekly.vue

@@ -523,6 +523,7 @@ export default {
       getReportInfo({ isContent: true }).then((res) => {
         loading1.clear();
         localStorage.setItem('powerGrade', res.data.positionId);
+        localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
         this.type = res.data.userType;
         var dayTime = res.data.date;
         this.YFQuota = res.data.postType == 'YF' ? true : false;

+ 13 - 9
src/views/week/weeklyHistorical.vue

@@ -200,8 +200,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}'), 2));
     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.deptCode == undefined) {
           this.companyName = this.companyList[0].deptName;
@@ -210,17 +212,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);
@@ -265,8 +267,10 @@ export default {
           this.deptCode = '';
           this.tableList = [];
           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.deptCode == undefined) {
                 this.companyName = this.companyList[0].deptName;
@@ -275,17 +279,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);
@@ -436,7 +440,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;