Ver código fonte

首页增加提示类tab,B类指标页优化,我的-增加业务员日常工作统计

zhujindu 1 ano atrás
pai
commit
80f15d5623

+ 1 - 0
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -515,6 +515,7 @@ export default {
             message: '加载中...',
             forbidClick: true,
           });
+          debugger;
           getStoreGroupTask(params).then((res) => {
             loading2.clear();
             if (res.code == 200) {

+ 1 - 0
src/views/deviceWithin/storeVisit.vue

@@ -449,6 +449,7 @@ export default {
               forbidClick: true,
             });
             that.list = [];
+            debugger;
             getStoreGroupTask(params).then((res) => {
               loading2.clear();
               if (res.code == 200) {

+ 11 - 3
src/views/home/ABtarget.vue

@@ -1397,11 +1397,19 @@ export default {
       GZdata: false,
     };
   },
-  created() {
-    this.initData();
-  },
+  // watch: {
+  //   tabVal: {
+  //     handler(val) {
+  //       if (val == 0 || val == 1) {
+  //         this.initData();
+  //       }
+  //     },
+  //     immediate: true,
+  //   },
+  // },
   methods: {
     initData() {
+      console.log(this.tabVal);
       this.getReportInfo();
       this.userTodayPlanNum();
       this.isGetABFlag = false;

+ 36 - 8
src/views/home/hintTabPage/noVisit.vue

@@ -127,8 +127,42 @@ export default {
       localStorage.removeItem('visitId');
       checkVisit({ storeId: val.storeId }).then((res) => {
         if (res.code == 200) {
+          this.activatStoreVal = val;
+          // 拜访页面分为 计划外、计划内; 0计划内 1计划外
+          this.visitRoutePath =
+            this.activatStoreVal.visitEntry == '1'
+              ? '/suishenbangOutstoreVisit'
+              : '/storeVisitpage';
           if (val.stateString.indexOf('拜访中') != -1) {
-            this.toSuishenbangOutstoreVisit(0);
+            this.clickIsFlage = true;
+            localStorage.setItem('startTime', new Date());
+            localStorage.setItem('ORGName', this.activatStoreVal.deptName);
+            localStorage.setItem('chainNameR', this.activatStoreVal.storeName);
+            this.$router.push({
+              path: this.visitRoutePath,
+              query: {
+                storeId: this.activatStoreVal.storeId,
+                rdId: this.activatStoreVal.rdId,
+                lat: this.activatStoreVal.lat,
+                lon: this.activatStoreVal.lon,
+                visitId: this.activatStoreVal.visitId,
+                pageType: 'out',
+                addressLine: this.activatStoreVal.addressLine,
+                storeCategory: this.activatStoreVal.storeCategoryName,
+                storeName: this.activatStoreVal.storeName,
+                hisTime: this.activatStoreVal.hisTime,
+                contactName: this.activatStoreVal.contactName,
+                storeCode: this.activatStoreVal.storeCode,
+                tabVal: this.tabVal,
+                visitModel: '1',
+                latNew: this.activatStoreVal.lat,
+                lonNew: this.activatStoreVal.lon,
+                PointSum: 0,
+                marklat: this.activatStoreVal.lat,
+                marklon: this.activatStoreVal.lon,
+                from: 'outPlan',
+              },
+            });
           } else {
             // 拜访时重新获取定位
             getPosition()
@@ -138,12 +172,6 @@ export default {
                 this.TXPiont = resData;
                 localStorage.setItem('lat', TXisBD.lat);
                 localStorage.setItem('lon', TXisBD.lon);
-                this.activatStoreVal = val;
-                // 拜访页面分为 计划外、计划内; 0计划内 1计划外
-                this.visitRoutePath =
-                  this.activatStoreVal.visitEntry == '1'
-                    ? '/suishenbangOutstoreVisit'
-                    : '/storeVisitpage';
                 this.checkStoreAddressByStoreCodeFun();
               })
               .catch((error) => {
@@ -280,7 +308,7 @@ export default {
           visitId: this.activatStoreVal.visitId,
           pageType: 'out',
           addressLine: this.activatStoreVal.addressLine,
-          storeCategory: this.activatStoreVal.storeCategory,
+          storeCategory: this.activatStoreVal.storeCategoryName,
           storeName: this.activatStoreVal.storeName,
           hisTime: this.activatStoreVal.hisTime,
           contactName: this.activatStoreVal.contactName,

+ 25 - 4
src/views/home/index.vue

@@ -32,6 +32,7 @@
 </template>
 
 <script>
+import { getReportInfo } from '@/api/index';
 import hintTabPage from './hintTabPage/index.vue';
 import tabBar from '@/components/tabBar';
 import ABtarget from './ABtarget.vue';
@@ -69,18 +70,38 @@ export default {
       if (this.$refs.Btarget) this.$refs.Btarget.initData();
     }
   },
-  mounted() {
-    if (this.$refs.Atarget) this.$refs.Atarget.initData();
+  created() {
+    this.getReportInfo();
   },
   methods: {
     onClickTabs(val) {
-      // this.$refs.homePage.scrollTop = 0;
-      // document.getElementById('app').scrollTop = 0;
+      this.$nextTick(() => {
+        // this.tabVal == '-1' 有watch监听不需要在触发
+        if (this.tabVal == '0') {
+          if (this.$refs.Atarget) this.$refs.Atarget.initData();
+        } else if (this.tabVal == '1') {
+          if (this.$refs.Btarget) this.$refs.Btarget.initData();
+        }
+      });
     },
     onClickLeft() {
       this.$router.go(-1);
       // window.location.href = process.env.VUE_APP_SSB_LINK + "/homeIndex"
     },
+    getReportInfo() {
+      getReportInfo({ isContent: false }).then((res) => {
+        if (res.code == 200) {
+          localStorage.setItem('powerGrade', res.data.positionId);
+          localStorage.setItem('isDiy', res.data.diy);
+          localStorage.setItem('uType', res.data.userType);
+          localStorage.setItem('jzType', res.data.jzType);
+          localStorage.setItem('customerVisits', res.data.customerManagerVisits);
+          localStorage.setItem('postType', res.data.postType);
+        } else {
+          this.$toast(res.msg);
+        }
+      });
+    },
   },
 };
 </script>