Sfoglia il codice sorgente

提示类建店指标跳转页

zhujindu 10 mesi fa
parent
commit
a4558915a0

+ 10 - 0
src/api/home.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request';
+
+// 提示类建店未完工、未结案列表信息
+export function getStoreInfos(query) {
+  return request({
+    url: '/mobile/storeStatistics/getStoreInfos',
+    method: 'get',
+    params: query,
+  });
+}

+ 1 - 0
src/store/getters.js

@@ -2,5 +2,6 @@ const getters = {
   userInfo: (state) => state.user.userInfo,
   refreshClewPage: (state) => state.isRefreshPage.refreshClewPage,
   storeType: (state) => state.user.storeType,
+  activaCreateTypeStore: (state) => state.user.activaCreateTypeStore,
 };
 export default getters;

+ 9 - 1
src/store/modules/user.js

@@ -3,7 +3,8 @@ import { getMobileUserInfo, getDictOption } from '@/api/index';
 const user = {
   state: {
     userInfo: null,
-    activaTypeStore: null,
+    activaTypeStore: null, //未拜访门店
+    activaCreateTypeStore: null, //建店未完工、未结案门店
     storeType: [],
   },
 
@@ -20,6 +21,9 @@ const user = {
     SET_STORE_TYPE: (state, value) => {
       state.storeType = value;
     },
+    SET_ACTIVA_CREATE_TYPE_STORE: (state, value) => {
+      state.activaCreateTypeStore = value;
+    },
   },
 
   actions: {
@@ -50,6 +54,10 @@ const user = {
     setActivaTypeStore({ commit }, value) {
       commit('SET_ACTIVA_TYPE_STORE', value);
     },
+    // 储存提示类-建店-从那个店铺类型进入未完工、未结案列表
+    activaCreateTypeStore({ commit }, value) {
+      commit('SET_ACTIVA_CREATE_TYPE_STORE', value);
+    },
   },
 };
 

+ 38 - 0
src/utils/index.js

@@ -217,3 +217,41 @@ export function verifyStoreType(dictValue) {
   let remarkType = storeData ? JSON.parse(storeData.remark) : null;
   return remarkType;
 }
+
+export function getMonthCommon() {
+  let timeData = '';
+  // 获取当前日期
+  var currentDate = new Date();
+  // 获取当前月份
+  var currentMonth = currentDate.getMonth();
+  var previousMonthDate1 = new Date();
+  if (currentDate.getDate() == 1) {
+    previousMonthDate1.setMonth(currentMonth - 1);
+  }
+  var previousMonth1 = previousMonthDate1.getMonth();
+  var previousYear1 = previousMonthDate1.getFullYear();
+  // 计算前三个月的年份和月份
+  var previousMonthDate = new Date();
+  if (currentDate.getDate() == 1) {
+    previousMonthDate.setMonth(currentMonth - 3);
+  } else {
+    previousMonthDate.setMonth(currentMonth - 2);
+  }
+  var previousMonth = previousMonthDate.getMonth();
+  var previousYear = previousMonthDate.getFullYear();
+  //前三个月
+  if (previousYear1 == previousYear) {
+    var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
+    // 格式化年份和月份
+    var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
+    timeData =
+      formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
+  } else {
+    var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
+    // .toString().padStart(2, '0');
+    // 格式化年份和月份
+    var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
+    timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
+  }
+  return timeData;
+}

+ 1 - 1
src/views/home/hintTabPage/noVisit.vue

@@ -43,7 +43,7 @@
                 </div>
               </div>
             </template>
-            <template v-else><div style="text-align: center">暂无数据</div></template>
+            <van-empty description="暂无数据" v-else />
           </div>
         </van-collapse-item>
       </van-collapse>

+ 30 - 46
src/views/home/hintTabPage/unCreateStore.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="noVisit">
+  <div class="unCreateStore">
     <div class="header">
       <van-nav-bar class="navBar" title="建店" left-arrow @click-left="onClickLeft" />
     </div>
@@ -8,11 +8,11 @@
         <van-collapse-item v-for="(val, key, ind) in list" :key="ind" :name="key">
           <template #title>
             <div class="title">{{ key | storeType }}</div>
-            <div class="num">{{ val.storeNum }}家</div>
+            <div class="num">{{ val ? val.length : 0 }}家</div>
           </template>
           <div class="itemContent">
-            <template v-if="val.storeList && val.storeList.length">
-              <div class="item" v-for="(item, index) in val.storeList" :key="index">
+            <template v-if="val && val.length">
+              <div class="item" v-for="(item, index) in val" :key="index">
                 <van-cell>
                   <div class="card">
                     <div></div>
@@ -96,7 +96,7 @@
                               ">
                               {{ item.storeLabels.zysslNums }}
                             </p>
-                            <van-icon :name="ord" size="26" />
+                            <van-icon :name="require('@/assets/ord.png')" size="26" />
                           </div>
                         </el-popover>
                         <el-popover
@@ -258,7 +258,7 @@
                 </van-cell>
               </div>
             </template>
-            <template v-else><div style="text-align: center">暂无数据</div></template>
+            <van-empty description="暂无数据" v-else />
           </div>
         </van-collapse-item>
       </van-collapse>
@@ -266,15 +266,15 @@
   </div>
 </template>
 <script>
-import { selectUserStoreNoVisits } from '@/api/index';
-import { getPosition, getTicketFun } from '@/utils/TXApiFun';
+import { getStoreInfos } from '@/api/home';
 import { mapState } from 'vuex';
 import store from '@/store';
+import { getMonthCommon } from '@/utils';
 export default {
   name: 'unCreateStore',
   computed: {
     ...mapState({
-      activaTypeStore: (state) => state.user.activaTypeStore,
+      activaCreateTypeStore: (state) => state.user.activaCreateTypeStore,
     }),
   },
   data() {
@@ -286,54 +286,38 @@ export default {
       activatStoreVal: {}, //当前点击门店数据
       visitRoutePath: '', //拜访页面路径
       clickIsFlage: true,
+      timeData: '',
     };
   },
   filters: {
     storeType(value) {
       let type = '';
-      if (value == 'keKong') {
-        type = '可控店';
-      } else if (value == 'jinPai') {
-        type = '金牌店';
-      } else if (value == 'TuLiao') {
-        type = '同城分销-涂料店';
-      } else if (value == 'QiTa') {
-        type = '同城分销-其他店';
+      if (value == 'keKongAbnormalNum') {
+        type = '可控店45天未结案列表';
+      } else if (value == 'jinPaiUnfinishedNum') {
+        type = '金牌店7天未完工列表';
+      } else if (value == 'jinPaiAbnormalNum') {
+        type = '金牌店30天未结案列表';
+      } else if (value == 'TuLiaoAbnormalNum') {
+        type = '涂料店7天未结案列表';
+      } else if (value == 'QiTaAbnormalNum') {
+        type = '其他店7天未结案列表';
       }
       return type;
     },
   },
   created() {
-    // 授权
-    getTicketFun()
-      .then(() => {
-        // 获取定位
-        getPosition()
-          .then((res) => {
-            let { TXisBD } = res;
-            this.toastLoading(0, '加载中...', true);
-            this.getList(TXisBD);
-          })
-          .catch((error) => {
-            this.$dialog.alert({
-              message: error,
-            });
-          });
-      })
-      .catch(() => {
-        this.toastLoading().clear();
-      });
-    this.activeName = this.activaTypeStore || '';
+    this.timeData = getMonthCommon();
+    this.getList();
+    this.activeName = this.activaCreateTypeStore || '';
   },
   methods: {
     collapseCange(value) {
-      store.dispatch('setActivaTypeStore', value);
+      store.dispatch('activaCreateTypeStore', value);
     },
-    getList(TXisBD) {
-      selectUserStoreNoVisits({
-        lat: TXisBD.lat,
-        lon: TXisBD.lon,
-      })
+    getList() {
+      this.toastLoading(0, '加载中...', true);
+      getStoreInfos()
         .then((res) => {
           this.toastLoading().clear();
           this.list = res.data;
@@ -356,7 +340,7 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
-.noVisit {
+.unCreateStore {
   height: 100%;
   width: 100%;
   /* overflow-y: auto; */
@@ -439,9 +423,9 @@ export default {
 }
 </style>
 <style lang="scss">
-.noVisit {
+.unCreateStore {
   .van-cell__title {
-    font-size: 15px;
+    font-size: 16px;
     font-weight: bold;
     color: #333;
     display: flex;

+ 1 - 0
src/views/home/hintTabPage/visitPage.vue

@@ -101,6 +101,7 @@ export default {
           // localStorage.setItem('storeStatus', storeStatus);
           // this.$router.push({ path: '/storemanagementlist', query: { storeStatus: storeStatus } });
           // 2025.01.16 销售员 建店进入新建页面 unCreateStore
+          store.dispatch('activaCreateTypeStore', list.rightProp);
           this.$router.push({ path: '/unCreateStore' });
         }
       } else {

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

@@ -522,7 +522,6 @@ export default {
       } else {
         previousMonthDate.setMonth(currentMonth - 2);
       }
-      1;
       var previousMonth = previousMonthDate.getMonth();
       var previousYear = previousMonthDate.getFullYear();