فهرست منبع

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

zhujindu 1 سال پیش
والد
کامیت
4d92b6460b
2فایلهای تغییر یافته به همراه20 افزوده شده و 8 حذف شده
  1. 8 5
      src/views/home/ABtarget.vue
  2. 12 3
      src/views/home/index.vue

+ 8 - 5
src/views/home/ABtarget.vue

@@ -1372,13 +1372,16 @@ export default {
     };
   },
   created() {
-    this.getReportInfo();
-    this.userTodayPlanNum();
-    this.isGetABFlag = false;
-    this.num = 0;
-    this.timeFn();
+    this.initData();
   },
   methods: {
+    initData() {
+      this.getReportInfo();
+      this.userTodayPlanNum();
+      this.isGetABFlag = false;
+      this.num = 0;
+      this.timeFn();
+    },
     storeJoinVisit(val) {
       joinInPlan({ storeId: val.storeId }).then((res) => {
         if (res.code == 200) {

+ 12 - 3
src/views/home/index.vue

@@ -5,8 +5,12 @@
       <van-tab title="提示类" name="-1">
         <hintTabPage :tabVal="tabVal" ref="hintTabPage"></hintTabPage
       ></van-tab>
-      <van-tab title="A类指标" name="0"><ABtarget :tabVal="tabVal"></ABtarget></van-tab>
-      <van-tab title="B类指标" name="1"><ABtarget :tabVal="tabVal"></ABtarget></van-tab>
+      <van-tab title="A类指标" name="0"
+        ><ABtarget :tabVal="tabVal" ref="Atarget"></ABtarget
+      ></van-tab>
+      <van-tab title="B类指标" name="1"
+        ><ABtarget :tabVal="tabVal" ref="Btarget"></ABtarget
+      ></van-tab>
     </van-tabs>
     <!-- <van-dialog v-model="shows" @confirm="titleconfirm">
       <div class="tipTitleBox" style="padding: 10px">
@@ -47,6 +51,7 @@ export default {
     };
   },
   watch: {
+    // 监听切换用户
     'userInfo.userName': {
       handler(val) {
         this.tabVal = '-1';
@@ -55,9 +60,13 @@ export default {
     },
   },
   activated() {
-    // 从其他页面调过来如果上次离开时是-1;要重新获取数据
+    // 从其他页面跳转过来如果;要重新获取对应tab数据
     if (this.tabVal == '-1') {
       if (this.$refs.hintTabPage) this.$refs.hintTabPage.initData();
+    } else 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();
     }
   },
   methods: {