Parcourir la source

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

zhujindu il y a 1 an
Parent
commit
3474b53c0e
3 fichiers modifiés avec 122 ajouts et 262 suppressions
  1. 19 1
      src/api/index.js
  2. 70 197
      src/views/home/hintTabPage/hintDetail.vue
  3. 33 64
      src/views/home/hintTabPage/index.vue

+ 19 - 1
src/api/index.js

@@ -845,9 +845,27 @@ export function getReportMaterial(query) {
 }
 
 // 提示类页签-查询下属业务员色卡指标接口
-export function getReportMaterialType(query) {
+export function getReportMaterialType(data) {
   return request({
     url: '/mobile/reportMobile/getReportMaterialType',
+    method: 'post',
+    data: data,
+  });
+}
+
+// 提示类拜访(实时)接口
+export function selectVisitsRealTime(query) {
+  return request({
+    url: '/mobile/storeStatistics/selectVisitsRealTime',
+    method: 'get',
+    params: query,
+  });
+}
+
+// 提示类建店统计接口
+export function selectBuildingStore(query) {
+  return request({
+    url: '/mobile/storeStatistics/selectBuildingStore',
     method: 'get',
     params: query,
   });

+ 70 - 197
src/views/home/hintTabPage/hintDetail.vue

@@ -13,15 +13,15 @@
       </van-tabs>
       <van-tabs
         class="myTab"
-        v-model="activeTabPantoneName"
+        v-model="activaPantoneName"
         color="#0057ba"
         @change="tabChangePantone"
         v-if="activeTabName == 'pantone'">
         <van-tab
-          :title="item.materialDataName"
-          :name="index"
-          v-for="(item, index) in tabsItemPantone"
-          :key="index"></van-tab>
+          v-for="(val, key, index) in tabsItemPantone"
+          :key="index"
+          :title="key"
+          :name="key"></van-tab>
       </van-tabs>
     </div>
     <div class="content">
@@ -32,7 +32,7 @@
         border
         class="elTreeTable"
         lazy
-        row-key="id"
+        row-key="onlyId"
         :key="toggleIndex">
         <el-table-column
           class="firstName"
@@ -50,6 +50,7 @@
           width="46"
           align="center"
           v-for="(item, index) in tableColumn"
+          :key="index"
           v-if="tableColumn.length">
           <el-table-column
             :label="val.label"
@@ -57,7 +58,8 @@
             width="46"
             align="center"
             v-if="item.childredColumn"
-            v-for="(val, ind) in item.childredColumn">
+            v-for="(val, ind) in item.childredColumn"
+            :key="ind">
           </el-table-column>
         </el-table-column>
       </el-table>
@@ -65,7 +67,7 @@
   </div>
 </template>
 <script>
-import { selectNoVisitsInfo, getReportMaterialType } from '@/api/index';
+import { selectNoVisitsInfo, getReportMaterialType, getReportMaterial } from '@/api/index';
 import { mapState } from 'vuex';
 export default {
   computed: {
@@ -79,7 +81,7 @@ export default {
       deptId: null,
       fromType: null,
       activeTabName: 'noVisit',
-      activeTabPantoneName: 0,
+      activaPantoneName: 0,
       tabsItem: [
         {
           title: '未拜访',
@@ -239,15 +241,17 @@ export default {
     this.tableColumn = this[this.fromType]; //初始化表格头
     this.activeTabName = this.fromType;
     this.deptId = this.userInfo.deptId; // 当前用户部门id
+    this.activaPantoneName = this.$route.query.pantoneName; //当前色卡
+    this.materialCode = this.$route.query.materialCode; // 色卡code
     this.initData();
   },
   methods: {
-    initData() {
+    initData(resolve) {
       if (this.fromType == 'noVisit') {
-        this.selectNoVisitsInfoFun(this.deptId);
+        this.selectNoVisitsInfoFun(resolve);
       } else if (this.fromType == 'createStore') {
       } else if (this.fromType == 'pantone') {
-        this.getReportMaterialTypeFun();
+        this.getPantoneData();
       }
     },
     tabChange(val) {
@@ -257,8 +261,8 @@ export default {
       }, 2000);
     },
     tabChangePantone(val) {
-      // activeTabName;
-      // this.tableColumn = this[val];
+      this.materialCode = this.tabsItemPantone[val].materialCode;
+      this.getPantoneData();
     },
     onClickLeft() {
       this.$router.go(-1);
@@ -276,8 +280,8 @@ export default {
       //   } else {
       //     this.seacherFormload.parentId = '';
       //   }
-      this.deptId = tree.deptId;
-      this.initData();
+      this.deptId = tree.onlyId;
+      this.initData(resolve);
       //   request({
       //     url: 'mobile/reportMobile/queryRates',
       //     method: 'get',
@@ -298,191 +302,57 @@ export default {
       //   });
     },
     // 未拜访
-    selectNoVisitsInfoFun() {
-      let resData = [
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 0,
-          tongANotVisited: 3,
-          onlyId: 970,
-          onlyName: '北京销售(公司)',
-          jinPaiNotVisited: 52,
-        },
-        {
-          keKongNotVisited: 75,
-          tongBNotVisited: 432,
-          tongANotVisited: 127,
-          onlyId: 1210,
-          onlyName: '华北销售(公司)',
-          jinPaiNotVisited: 427,
-        },
-        {
-          keKongNotVisited: 1,
-          tongBNotVisited: 0,
-          tongANotVisited: 0,
-          onlyId: 969,
-          onlyName: '东北销售(公司)',
-          jinPaiNotVisited: 40,
-        },
-        {
-          keKongNotVisited: 1,
-          tongBNotVisited: 0,
-          tongANotVisited: 0,
-          onlyId: 1208,
-          onlyName: '山东销售(公司)',
-          jinPaiNotVisited: 80,
-        },
-        {
-          keKongNotVisited: -1,
-          tongBNotVisited: 38,
-          tongANotVisited: 75,
-          onlyId: 1206,
-          onlyName: '河南销售(公司)',
-          jinPaiNotVisited: 145,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 40,
-          tongANotVisited: -1,
-          onlyId: 1202,
-          onlyName: '西北销售(公司)',
-          jinPaiNotVisited: 129,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 3,
-          tongANotVisited: 9,
-          onlyId: 1203,
-          onlyName: '上海销售(公司)',
-          jinPaiNotVisited: 10,
-        },
-        {
-          keKongNotVisited: -2,
-          tongBNotVisited: 0,
-          tongANotVisited: 0,
-          onlyId: 967,
-          onlyName: '浙江销售(公司)',
-          jinPaiNotVisited: 167,
-        },
-        {
-          keKongNotVisited: -8,
-          tongBNotVisited: 30,
-          tongANotVisited: 79,
-          onlyId: 966,
-          onlyName: '江苏销售(公司)',
-          jinPaiNotVisited: 112,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 0,
-          tongANotVisited: 0,
-          onlyId: 964,
-          onlyName: '安徽销售(公司)',
-          jinPaiNotVisited: 78,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 0,
-          tongANotVisited: 0,
-          onlyId: 1207,
-          onlyName: '湘鄂销售(公司)',
-          jinPaiNotVisited: 230,
-        },
-        {
-          keKongNotVisited: 2,
-          tongBNotVisited: 2,
-          tongANotVisited: 1,
-          onlyId: 968,
-          onlyName: '广东销售(公司)',
-          jinPaiNotVisited: 89,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 0,
-          tongANotVisited: 1,
-          onlyId: 1205,
-          onlyName: '深桂海销售(公司)',
-          jinPaiNotVisited: 76,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: -3,
-          tongANotVisited: 0,
-          onlyId: 1209,
-          onlyName: '闽赣销售(公司)',
-          jinPaiNotVisited: 110,
-        },
-        {
-          keKongNotVisited: 2,
-          tongBNotVisited: 114,
-          tongANotVisited: 42,
-          onlyId: 965,
-          onlyName: '川渝销售(公司)',
-          jinPaiNotVisited: 123,
-        },
-        {
-          keKongNotVisited: 0,
-          tongBNotVisited: 0,
-          tongANotVisited: 0,
-          onlyId: 1204,
-          onlyName: '云贵销售(公司)',
-          jinPaiNotVisited: 94,
-        },
-      ];
-      this.tableList = resData;
-      //   selectNoVisitsInfo({ deptId: this.deptId }).then((res) => {});
+    selectNoVisitsInfoFun(resolve) {
+      selectNoVisitsInfo({ deptId: this.deptId }).then((res) => {
+        res.data.forEach((val) => {
+          val.hasChildren = true;
+        });
+        if (resolve) {
+          resolve && resolve(res.data);
+        } else {
+          this.tableList = res.data;
+        }
+      });
+    },
+    // 色卡tab
+    getPantoneData() {
+      if (this.tabsItemPantone.length) {
+        this.getReportMaterialTypeFun();
+      } else {
+        getReportMaterial().then((res) => {
+          this.tabsItemPantone = res.data;
+          delete this.tabsItemPantone.tip;
+          this.getReportMaterialTypeFun();
+        });
+      }
     },
-    // 色卡
+    // 色卡详情
     getReportMaterialTypeFun() {
-      let resData = {
-        colorCardList: [
+      getReportMaterialType({ materialCode: this.materialCode }).then((res) => {
+        let resData = [
           {
-            ywyylyNum: '21',
-            wqsmdNum: '0',
-            materialDataId: 141,
-            ywyyffNum: '21',
-            materialTypeId: 139,
-            zfxsbNum: '0',
-            mdwqsNum: '0',
-            materialDataName: '1988色卡1',
-            materialCode: 'WL20240904063',
-            warehouseName: '吴康',
-            warehouseCode: '00040681',
-            materialTypeName: '直发类色卡',
+            ...this.tabsItemPantone[this.activaPantoneName],
+            children: res.data.colorCardList || [],
           },
-          {
-            ywyylyNum: '21',
-            wqsmdNum: '0',
-            materialDataId: 141,
-            ywyyffNum: '21',
-            materialTypeId: 139,
-            zfxsbNum: '0',
-            mdwqsNum: '0',
-            materialDataName: '1988色卡2',
-            materialCode: 'WL20240904063',
-            warehouseName: '朱彬',
-            warehouseCode: '00044125',
-            materialTypeName: '直发类色卡',
-          },
-          {
-            ywyylyNum: '22',
-            wqsmdNum: '0',
-            materialDataId: 141,
-            ywyyffNum: '22',
-            materialTypeId: 139,
-            zfxsbNum: '0',
-            mdwqsNum: '0',
-            materialDataName: '1988色卡3',
-            materialCode: 'WL20240904063',
-            warehouseName: '岳阿龙',
-            warehouseCode: '00044633',
-            materialTypeName: '直发类色卡',
-          },
-        ],
-      };
-      this.tabsItemPantone = resData.colorCardList;
-      this.tableList = resData.colorCardList;
-      // getReportMaterialType({materialCode:this.$route.query.materialCode}).then((res)=>{})
+        ];
+        // [
+        //   {
+        //     id: 3,
+        //     date: '2016-05-01',
+        //     name: '王小虎',
+        //     address: '上海市普陀区金沙江路 1519 弄',
+        //     children: [
+        //       {
+        //         id: 32,
+        //         date: '2016-05-01',
+        //         name: '王小虎',
+        //         address: '上海市普陀区金沙江路 1519 弄',
+        //       },
+        //     ],
+        //   },
+        // ],
+        this.tableList = resData;
+      });
     },
   },
 };
@@ -511,5 +381,8 @@ export default {
   .el-table__empty-block {
     width: 99.9% !important;
   }
+  .elTreeTable .el-table__expand-icon {
+    float: right;
+  }
 }
 </style>

+ 33 - 64
src/views/home/hintTabPage/index.vue

@@ -121,7 +121,9 @@
                     </div>
                     <div class="right">
                       <div class="lebel">门店未签收:</div>
-                      <div class="value valueIsClick" @click="pantoneClick">{{ val.wqsmdNum }}</div>
+                      <div class="value valueIsClick" @click="pantoneClick(val, key)">
+                        {{ val.wqsmdNum }}
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -148,7 +150,7 @@
                     </div>
                     <div class="right">
                       <div class="lebel">门店未签收:</div>
-                      <div class="value valueIsClick" @click="pantoneClick(val)">
+                      <div class="value valueIsClick" @click="pantoneClick(val, key)">
                         {{ val.wqsmdNum }}
                       </div>
                     </div>
@@ -163,7 +165,12 @@
   </div>
 </template>
 <script>
-import { getReportTarget, getReportMaterial } from '@/api/index';
+import {
+  selectVisitsRealTime,
+  selectBuildingStore,
+  getReportTarget,
+  getReportMaterial,
+} from '@/api/index';
 import hintIcon from '@/assets/hintIcon.png';
 import visitPage from './visitPage.vue';
 import { mapState } from 'vuex';
@@ -383,6 +390,8 @@ export default {
     this.empLevel = this.userInfo.empLevel;
     // 获取拜访数据
     this.getVisitCollapseData();
+    // 获取建店数据
+    this.getSelectBuildingStore();
     // 获取汇报数据 日报、周报、半月报
     this.getReportData();
     // 获取色卡数据
@@ -390,32 +399,18 @@ export default {
   },
   methods: {
     getVisitCollapseData() {
-      let resData = {
-        reminderContent: [
-          '1.本月拜访率:2024-10-01~2024-10-31',
-          '2.近2月拜访率:2024-08-01~2024-10-31',
-          '3.近3月拜访率:2024-07-01~2024-10-31',
-        ],
-        jinPai: {
-          notVisited: 2007,
-          visitRateThisMonth: '0.5%',
-        },
-        tongB: {
-          notVisited: 838,
-          visitRateInThePastThreeMonths: '6.2%',
-        },
-        tongA: {
-          visitRateInThePastTwoMonths: '8.8%',
-          notVisited: 384,
-        },
-        keKong: {
-          notVisited: 73,
-          visitRateThisMonth: '27.0%',
-        },
-      };
-      this.visitCollapse.resData = resData;
-      this.visitCollapse.tipsPopoverlabel = resData.reminderContent;
-      this.visitCollapse.collapseLosding = false;
+      selectVisitsRealTime().then((res) => {
+        this.visitCollapse.resData = res.data;
+        this.visitCollapse.tipsPopoverlabel = res.data.reminderContent;
+        this.visitCollapse.collapseLosding = false;
+      });
+    },
+    getSelectBuildingStore() {
+      selectBuildingStore().then((res) => {
+        // this.visitCollapse.resData = res.data;
+        // this.visitCollapse.tipsPopoverlabel = res.data.reminderContent;
+        // this.visitCollapse.collapseLosding = false;
+      });
     },
     getReportData() {
       if (this.empLevel == '1') {
@@ -437,39 +432,13 @@ export default {
       });
     },
     getPantoneData() {
-      let resData = {
-        ColorCard1988: {
-          materialDataId: 141,
-          ywyylyNum: 64,
-          wqsmdNum: 0,
-          ywyyffNum: 64,
-          materialTypeId: 139,
-          deptId: 1105,
-          materialDataName: '1988色卡',
-          zfxsbNum: 64,
-          mdwqsNum: 0,
-          materialCode: 'WL20240904063',
-          materialTypeName: '直发类色卡',
-        },
-        ColorCard388: {
-          materialDataId: 140,
-          ywyylyNum: 174,
-          wqsmdNum: 2,
-          ywyyffNum: 173,
-          materialTypeId: 139,
-          deptId: 1105,
-          materialDataName: '趋势经典色卡384',
-          zfxsbNum: 279,
-          mdwqsNum: 5,
-          materialCode: 'WL20240904062',
-          materialTypeName: '直发类色卡',
-        },
-        tip: '2024年色卡累计发放情况',
-      };
-      this.pantone.tip = resData.tip;
-      this.pantone.pantoneData = resData;
-      delete this.pantone.pantoneData.tip;
-      // getReportMaterial().then((res)=>{})
+      if (this.empLevel == 2 || this.empLevel == 3) {
+        getReportMaterial().then((res) => {
+          this.pantone.tip = res.data.tip;
+          this.pantone.pantoneData = res.data;
+          delete this.pantone.pantoneData.tip;
+        });
+      }
     },
     // 汇报下属详情-点击
     reportClick(type) {
@@ -482,7 +451,7 @@ export default {
       }
     },
     // 色卡查看详情
-    pantoneClick(val) {
+    pantoneClick(val, key) {
       // 业务员进入未拜访列表
       if (this.empLevel == '3') {
         this.$router.push({ path: '/noVIsit' });
@@ -490,7 +459,7 @@ export default {
         // 销售部主管
         this.$router.push({
           path: '/hintDetail',
-          query: { fromType: 'pantone', materialCode: val.materialCode }, // materialCode物料来源
+          query: { fromType: 'pantone', materialCode: val.materialCode, pantoneName: key }, // materialCode物料来源
         });
       }
     },