zhujindu недель назад: 2
Родитель
Сommit
0f0c66d23b

+ 8 - 1
src/components/shareCommonTarget.vue

@@ -104,7 +104,14 @@
             </van-collapse-item>
             <van-collapse-item v-if="homePageItem.labelStyle == 4" :name="(index + 1).toString()">
               <template #title>
-                <div class="text">{{ homePageItem.name }}</div>
+                <div style="display: flex; justify-content: space-between">
+                  <span>{{ homePageItem.name }}</span>
+                  <p
+                    v-if="homePageItem.indicatorDate"
+                    style="color: #999; margin-top: 0; margin-right: 20px">
+                    {{ homePageItem.indicatorDate }}
+                  </p>
+                </div>
               </template>
               <!-- 外层循环:遍历主要类别 -->
               <template v-for="(category, index) in homePageItem.children">

+ 97 - 32
src/views/home/ABtarget.vue

@@ -1,15 +1,12 @@
 <template>
   <div class="ABtarage">
-    <template v-if="reportInfoData.BMDType && reportInfoData.BMDType == 'BMD'">
+    <template v-if="BMDType && BMDType == 'BMD'">
       <HomeTarget ref="HomeTarget"></HomeTarget>
     </template>
     <template v-else>
-      <!-- 其他内容 -->
-      <p class="updataTime" v-if="type != 4 && tabVal != '-1' && updataTime">
-        更新时间:{{ updataTime }}
-      </p>
+      <p class="updataTime" v-if="userType != 4 && tabVal != '-1'">更新时间:{{ updataTime }}</p>
       <template v-if="tabVal == 0 || tabVal == 1">
-        <div v-if="tabVal == 1 && type != 4" class="container linep">
+        <div v-if="tabVal == 1 && userType != 4" class="container linep">
           <van-collapse v-model="activeNames">
             <!-- 拜访数据(实时) -->
             <van-collapse-item name="7" v-if="powerGrade == 1 && !GZdata">
@@ -39,10 +36,10 @@
             </van-collapse-item>
           </van-collapse>
         </div>
-        <div v-if="tabVal == 0 && type != 4" class="container linep">
+        <div v-if="tabVal == 0 && userType != 4" class="container linep">
           <van-collapse v-model="activeNames">
             <!-- performanceSAP 业绩目标SAP(千元)/公裝业绩SAP(千元) -->
-            <van-collapse-item v-if="type != 3 && type != 4" name="1" :title="saptitle">
+            <van-collapse-item v-if="userType != 3 && userType != 4" name="1" :title="saptitle">
               <performanceSAP
                 :reportTargetAll="reportTargetAll"
                 :JZQuota="JZQuota"></performanceSAP>
@@ -363,33 +360,12 @@
             </van-collapse-item>
           </van-collapse>
         </div>
-        <div v-if="tabVal == 1 && type != 4" class="container linep">
+        <div v-if="tabVal == 1 && userType != 4" class="container linep">
           <van-collapse v-model="activeNames">
             <!-- 超好贴分销店下单 -->
             <van-collapse-item name="17" v-if="!JZQuota && !GZdata" title="超好贴分销店下单">
               <veryGoodPlaceOrder :reportTargetAll="reportTargetAll"></veryGoodPlaceOrder>
             </van-collapse-item>
-            <van-collapse-item
-              v-if="powerGrade != 1 && !JZQuota && !GZdata"
-              name="32"
-              title="客户开拓">
-              <van-row>
-                <van-col span="24"><span class="leftTitle">非片客户开发</span></van-col>
-                <van-col span="24">
-                  <p>
-                    全年开发数:<span class="colorbalck">{{
-                      Micrometer(reportTargetAll.customerAct)
-                    }}</span>
-                  </p>
-                </van-col>
-                <van-col span="24">
-                  <p>
-                    全年进度率:
-                    <span class="colorbalck"> {{ reportTargetAll.customerYearRate }}% </span>
-                  </p>
-                </van-col>
-              </van-row>
-            </van-collapse-item>
             <van-collapse-item v-if="powerGrade == 2" name="8" title="当日门店拜访情况(实时)">
               <div v-if="reportTargetAll.realTimeVisits == null" style="margin-top: -10px">
                 <p style="text-align: center; color: #666">暂无数据</p>
@@ -424,7 +400,7 @@
           </van-collapse>
         </div>
         <!-- 经销商负责人 查看下属 -->
-        <div v-if="tabVal == 1 && type == 4" class="container linep">
+        <div v-if="tabVal == 1 && userType == 4" class="container linep">
           <van-collapse v-model="activeNames" v-if="reportInfoData.customerUserTargets">
             <van-collapse-item
               :name="index + ''"
@@ -563,6 +539,10 @@ export default {
       type: [String, Number],
       default: '-1',
     },
+    userType: {
+      type: [String, Number],
+      default: 1,
+    },
     BMDType: {
       type: String,
       default: '',
@@ -650,12 +630,18 @@ export default {
       handler(val) {
         if (val == 0) {
           // keep-alive 模式watch执行了两次
-          this.initData();
+          // this.initData();
         }
       },
       immediate: true,
     },
   },
+  activated() {
+    this.initData();
+  },
+  created() {
+    this.initData();
+  },
   methods: {
     initData() {
       console.log(this.tabVal);
@@ -738,6 +724,7 @@ export default {
             this.updataTime = res.data.reportTargetAll.updateTime;
           }
           this.approvalPendingNum = res.data.approvalPendingNum;
+          // 用户类型(默认0):0=DIY员工;1=DIY经销商-分销人员;2=YSL;3=DIY经销商-倍增和先锋;4=DIY经销商-老板;经销商多身份时:1,4
           this.type = res.data.userType;
           // if (res.data.userType == 4) {
           //   this.tabVal = '1';
@@ -1073,3 +1060,81 @@ export default {
   }
 }
 </style>
+<style lang="scss">
+.ABtarage {
+  p {
+    margin: 10px 0 0 0;
+    font-size: 14px;
+    /* color: #666; */
+  }
+  .leftTitle {
+    background-color: #74a4d9;
+    color: #fff;
+    display: inline-block;
+    padding: 0 4px;
+    border-radius: 2px;
+  }
+  .rightTitle {
+    background-color: #e7b4bb;
+    color: #fff;
+    display: inline-block;
+    padding: 0 4px;
+    border-radius: 2px;
+  }
+
+  .colBack {
+    width: 100%;
+    height: 100%;
+    display: block;
+    /* overflow: unset; */
+    position: relative;
+    z-index: 2;
+    float: left;
+    z-index: 2;
+    .back {
+      position: absolute;
+      background: rgb(226, 240, 217);
+      height: 100%;
+      display: block;
+      overflow: hidden;
+      /* z-index: 1; */
+      border-radius: 12px;
+      bottom: -4px;
+    }
+    .backLeft {
+      width: 45%;
+      left: -12px;
+    }
+    .backRight {
+      width: 50%;
+      left: calc(50% - 12px);
+    }
+    .van-col {
+      position: relative;
+      z-index: 3;
+    }
+  }
+  .colLabel {
+    display: inline-block;
+    padding: 2px 5px;
+    color: #fff;
+    margin-right: 10px;
+    border-radius: 3px;
+  }
+  .colLabel_KK {
+    background: rgb(235, 104, 119);
+  }
+  .colLabel_FX {
+    background: rgb(253 120 88);
+  }
+  .colLabel_JP {
+    background: rgb(241, 183, 137);
+  }
+  .colLabel_JPBJ {
+    background: rgb(248 215 189);
+  }
+  .colLabel_TCFX {
+    background: rgb(131 204 202);
+  }
+}
+</style>

+ 11 - 4
src/views/home/HomeTarget.vue

@@ -105,10 +105,17 @@
                 </div>
               </van-row>
             </van-collapse-item>
-            <van-collapse-item
-              v-if="homePageItem.labelStyle == 4"
-              :name="(index + 1).toString()"
-              :title="homePageItem.name">
+            <van-collapse-item v-if="homePageItem.labelStyle == 4" :name="(index + 1).toString()">
+              <template #title>
+                <div style="display: flex; justify-content: space-between">
+                  <span>{{ homePageItem.name }}</span>
+                  <p
+                    v-if="homePageItem.indicatorDate"
+                    style="color: #999; margin-top: 0; margin-right: 20px">
+                    {{ homePageItem.indicatorDate }}
+                  </p>
+                </div>
+              </template>
               <!-- 外层循环:遍历主要类别 -->
               <template v-for="(category, index) in homePageItem.children">
                 <van-row

+ 11 - 4
src/views/week/target.vue

@@ -102,10 +102,17 @@
                 </div>
               </van-row>
             </van-collapse-item>
-            <van-collapse-item
-              v-if="homePageItem.labelStyle == 4"
-              :name="(index + 1).toString()"
-              :title="homePageItem.name">
+            <van-collapse-item v-if="homePageItem.labelStyle == 4" :name="(index + 1).toString()">
+              <template #title>
+                <div style="display: flex; justify-content: space-between">
+                  <span>{{ homePageItem.name }}</span>
+                  <p
+                    v-if="homePageItem.indicatorDate"
+                    style="color: #999; margin-top: 0; margin-right: 20px">
+                    {{ homePageItem.indicatorDate }}
+                  </p>
+                </div>
+              </template>
               <!-- 外层循环:遍历主要类别 -->
               <template v-for="(category, index) in homePageItem.children">
                 <van-row