Bladeren bron

同城分销店拆分、分销店对应多个经销商

zhujindu 11 maanden geleden
bovenliggende
commit
e08fa6cd75

+ 9 - 1
src/views/deviceOutside/index.vue

@@ -253,7 +253,15 @@
                   <template
                     v-if="item.TCFXListTreeSelec"
                     v-for="(item, index) in item.TCFXListTreeSelec">
-                    <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                    <el-popover
+                      popper-class="zpover zpover6"
+                      placement="bottom-start"
+                      trigger="click">
+                      <div>
+                        {{ item.name }}
+                      </div>
+                      <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                    </el-popover>
                   </template>
                 </div>
               </template>

+ 14 - 1
src/views/deviceOutside/rangeStore.vue

@@ -356,7 +356,20 @@
                 >{{ info.telephone }}</a
               ><van-icon name="phone" size="16" color="#1989fa" />
             </p>
-            <p class="text">经销商:{{ info.chainName }}</p>
+            <!-- 分销店 -->
+            <template v-if="info.sfaStoreType.type == 'fxd'">
+              <div>
+                经销商:
+                <template
+                  v-if="info.TCFXListTreeSelec"
+                  v-for="(item, index) in info.TCFXListTreeSelec">
+                  <span :key="index">{{ item.name }},</span>
+                </template>
+              </div>
+            </template>
+            <template v-else>
+              <p class="text">经销商:{{ info.chainName }}</p>
+            </template>
             <p class="text">地址:{{ info.addressLine }}</p>
             <div class="text" style="height: 24px">
               <!--          <van-button @click="linkapp(info)" style="float: right;margin-top: -36px;" type="info" size="small" plain  class="centerBtn centerBtn1">-->

+ 31 - 30
src/views/deviceOutside/topStore.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor topStore">
     <div class="navBarTOP">
       <!--        顶部条-->
       <van-nav-bar class="navBar" title="高销额门店推荐" left-arrow @click-left="onClickLeft">
@@ -183,24 +183,6 @@
                         <van-icon :name="order60" size="26" />
                       </div>
                     </el-popover>
-                    <!--                  <el-popover-->
-                    <!--                      popper-class="zpover"-->
-                    <!--                      placement="bottom"-->
-                    <!--                      width="200"-->
-                    <!--                      trigger="click"-->
-                    <!--                      content="金牌店近30天未下单">-->
-
-                    <!--                    <div v-if="cstype==4" class="visitStoreIco" style="background-color: #fff;" slot="reference"><van-icon :name="order" size="26" /></div>-->
-                    <!--                  </el-popover>-->
-                    <!--                  <el-popover-->
-                    <!--                      popper-class="zpover zpover99"-->
-                    <!--                      placement="bottom"-->
-                    <!--                      width="200"-->
-                    <!--                      trigger="click"-->
-                    <!--                      content="本店没参加碰瓷专案">-->
-                    <!--                    <div  class="visitStoreIco"  v-if="cstype==2"  slot="reference" style="background-color: white"><van-icon :name="nocj" size="26" /></div>-->
-                    <!--                  </el-popover>-->
-
                     <el-popover
                       popper-class="zpover"
                       placement="bottom"
@@ -221,7 +203,6 @@
                       width="200"
                       trigger="click"
                       content="本店本月进过超好贴">
-                      <!--         v-if="item.storeLabels.zyssl"        -->
                       <div
                         v-if="item.storeLabels.chtczj"
                         class="visitStoreIco"
@@ -230,15 +211,6 @@
                       </div>
                     </el-popover>
-                    <!--                  <el-popover-->
-                    <!--                      placement="bottom"-->
-                    <!--                      width="200"-->
-                    <!--                      popper-class="zpover zpover2"-->
-                    <!--                      trigger="click"-->
-                    <!--                      content="本月未被拜访的信息">-->
-                    <!--                    <div v-if="item.storeLabels.noVisit" class="visitStoreIco" style="background-color: #fff" slot="reference">-->
-                    <!--                      <van-icon :name="visitTimess" size="26" /></div>-->
-                    <!--                  </el-popover>-->
                     <el-popover
                       placement="bottom"
                       popper-class="zpover zpover1 zpover1sb"
@@ -298,7 +270,28 @@
                   /></a>
                 </div>
                 <div class="info">地址:{{ item.addressLine }}</div>
-                <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+                <!-- 分销店 -->
+                <template v-if="item.sfaStoreType.type == 'fxd'">
+                  <div class="info" v-if="typeShow">
+                    经销商:
+                    <template
+                      v-if="item.TCFXListTreeSelec"
+                      v-for="(item, index) in item.TCFXListTreeSelec">
+                      <el-popover
+                        popper-class="zpover zpover6"
+                        placement="bottom-start"
+                        trigger="click">
+                        <div>
+                          {{ item.name }}
+                        </div>
+                        <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                      </el-popover>
+                    </template>
+                  </div>
+                </template>
+                <template v-else>
+                  <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+                </template>
                 <div class="info" style="color: #444">
                   门店销额(近三个月):¥{{ Micrometer(item.rolling3monthAMT) }}元
                   <span
@@ -2848,4 +2841,12 @@ export default {
 .visitStoreIcos {
   /*background: url("./../../assets/order1.png") center;*/
 }
+.topStore {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+  }
+}
 </style>

+ 31 - 271
src/views/deviceWithin/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor deviceWithin">
     <div class="navBarTOP">
       <!--        顶部条-->
       <van-nav-bar class="navBar" title="计划内"> </van-nav-bar>
@@ -250,7 +250,28 @@
                 :src="sbpmdh"
                 @click="linkapp(item)" />
             </div>
-            <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+            <!-- 分销店 -->
+            <template v-if="item.sfaStoreType.type == 'fxd'">
+              <div class="info" v-if="typeShow">
+                经销商:
+                <template
+                  v-if="item.TCFXListTreeSelec"
+                  v-for="(item, index) in item.TCFXListTreeSelec">
+                  <el-popover
+                    popper-class="zpover zpover6"
+                    placement="bottom-start"
+                    trigger="click">
+                    <div>
+                      {{ item.name }}
+                    </div>
+                    <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                  </el-popover>
+                </template>
+              </div>
+            </template>
+            <template v-else>
+              <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+            </template>
             <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
             <div class="info" v-if="item.storeLonExist">距离:{{ Micrometer(item.distance) }}m</div>
           </div>
@@ -426,34 +447,9 @@ export default {
   },
   watch: {
     $route(to, from) {
-      // this.getMonth();
-      // this.storeName = localStorage.getItem("deviveStoreName");
       if (from.path == '/deviceWithin/index' && to.path == '/storeVisitpage') {
         localStorage.setItem('startTime', new Date());
       }
-      // if (from.path == "/abnormalVisit" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      //   this.$dialog.close();
-      // }
-      // if (from.path == "/home" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      //   // localStorage.removeItem("startTime")
-      // }
-      // if (from.path == "/outsidelist/index" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/storeVisitpage" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/topStore" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/storeDetail" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/storeEdit" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
     },
   },
   activated() {
@@ -466,15 +462,6 @@ export default {
       this.getUserInPlanList();
     });
   },
-  // created() {
-  //   let that = this;
-  //   that.query = that.$route.query;
-  //   this.timeData = this.parseTime(new Date(), "{yy}-{mm}-{dd}");
-  //   this.storeName = localStorage.getItem("deviveStoreName");
-  //   localStorage.removeItem("visitId");
-  //   this.getUserInPlanList();
-  //   this.getMonth();
-  // },
   methods: {
     linkapp(val) {
       var poind = this.gcj02BD(val.lat, val.lon);
@@ -801,7 +788,6 @@ export default {
                     this.lon = TXisBD.lon;
                     localStorage.setItem('lat', this.lat);
                     localStorage.setItem('lon', this.lon);
-                    // var location = this.CJ02BD(res.latitude, res.longitude);
                     this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
                   })
                   .catch((error) => {
@@ -809,169 +795,6 @@ export default {
                       message: error,
                     });
                   });
-                // let loading1 = this.$toast.loading({
-                //   duration: 0,
-                //   message: '加载中...',
-                //   forbidClick: true,
-                // });
-                // let url = window.location.href;
-                // let wx = this.wx;
-                // let qiyeData;
-                // const instance = axios.create();
-                // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
-                // instance
-                //   .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
-                //     params: {
-                //       url: url,
-                //     },
-                //   })
-                //   .then((response) => {
-                //     if (response.status == 200) {
-                //       this.cont = 3;
-                //       var flat = true;
-                //       var times = setInterval(() => {
-                //         this.cont--;
-                //         if (this.cont == '0') {
-                //           if (flat) {
-                //             loading1.clear();
-                //             clearInterval(times);
-                //             that.$dialog
-                //               .alert({
-                //                 message: '定位失败,请开启企微定位权限',
-                //               })
-                //               .then(() => {});
-                //           } else {
-                //             clearInterval(times);
-                //           }
-                //         }
-                //       }, 1000);
-                //       qiyeData = response.data.data;
-                //       wx.config({
-                //         beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-                //         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-                //         appId: qiyeData.appId, // 必填,企业微信的corpID
-                //         timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-                //         nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-                //         signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-                //         jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-                //       });
-                //       wx.ready(() => {
-                //         wx.getLocation({
-                //           type: 'gcj02',
-                //           success: (res) => {
-                //             flat = false;
-                //             var location = this.CJ02BD(res.latitude, res.longitude);
-                //             this.location = location;
-                //             checkStoreAddressByStoreCode({
-                //               storeCode: val.storeCode,
-                //               lon: location.lon,
-                //               lat: location.lat,
-                //             }).then((response) => {
-                //               loading1.clear();
-                //               if (val.lat == '' || val.lat == null) {
-                //                 that.lat = location.lat;
-                //                 that.lon = location.lon;
-                //               } else {
-                //                 that.lat = val.lat;
-                //                 that.lon = val.lon;
-                //               }
-                //               let PointSum = that
-                //                 .twoPointSum(that.lat, that.lon, location.lat, location.lon)
-                //                 .toFixed(2);
-                //               let PointSumval = that
-                //                 .twoPointSum(location.lat, location.lon, location.lat, location.lon)
-                //                 .toFixed(2);
-                //               // GZ:工装店铺 直接进入拜访
-                //               if (localStorage.getItem('postType') == 'GZ') {
-                //                 localStorage.setItem('startTime', new Date());
-                //                 localStorage.setItem('ORGName', val.deptName);
-                //                 localStorage.setItem('chainNameR', val.storeName);
-                //                 this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-                //                 return;
-                //               }
-                //               // 门店编码校验门店地址不通过
-                //               if (response.code != 200) {
-                //                 // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
-                //                 if (response.data.updateAddress == 0) {
-                //                   // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
-                //                   this.$dialog
-                //                     .confirm({
-                //                       confirmButtonText: '确定拜访',
-                //                       cancelButtonText: '取消拜访',
-                //                       title: '系统提示',
-                //                       message:
-                //                         '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
-                //                       closeOnClickOverlay: true,
-                //                     })
-                //                     .then(() => {
-                //                       this.toSuishenbangOutstoreVisit(
-                //                         res,
-                //                         val,
-                //                         location,
-                //                         PointSumval
-                //                       );
-                //                     });
-                //                 } else if (response.data.updateAddress == 1) {
-                //                   // 同城AB+金牌,去修改地址
-                //                   // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
-                //                   if (!response.data.addressUpdateTimesOver) {
-                //                     this.$dialog
-                //                       .confirm({
-                //                         title: '系统提示',
-                //                         message: response.msg + '请立即修改后再拜访',
-                //                         messageAlign: 'left',
-                //                         confirmButtonText: '立即修改',
-                //                         cancelButtonText: '取消',
-                //                       })
-                //                       .then(() => {
-                //                         this.$router.push({
-                //                           path: '/storeDetail',
-                //                           query: {
-                //                             id: val.storeId,
-                //                             type: 'address',
-                //                             storeAddressId: val.storeAddressId,
-                //                           },
-                //                         });
-                //                       });
-                //                   } else {
-                //                     this.$dialog.confirm({
-                //                       title: '系统提示',
-                //                       message: '已经达到最大修改次数',
-                //                       messageAlign: 'left',
-                //                       confirmButtonText: '确定',
-                //                     });
-                //                   }
-                //                 } else if (response.data.updateAddress == 2) {
-                //                   // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
-                //                   this.resetCoord(res, val, location, PointSumval);
-                //                   return;
-                //                 }
-                //               } else {
-                //                 // 门店编码校验门店地址通过 进入拜访
-                //                 this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-                //               }
-                //             });
-                //           },
-                //           fail: function () {
-                //             loading1.clear();
-                //             that.$dialog.alert({
-                //               message: 'GPS未开启',
-                //             });
-                //           },
-                //         });
-                //       });
-                //       wx.error(function (res) {
-                //         loading1.clear();
-                //         that.$dialog
-                //           .alert({
-                //             message: '定位失败,请开启企微定位权限',
-                //           })
-                //           .then(() => {});
-                //       });
-                //     } else {
-                //       loading1.clear();
-                //     }
-                //   });
               }
             }
           }
@@ -1654,77 +1477,6 @@ export default {
       this.$router.push({
         path: '/topStore',
       });
-      // let loading1 = this.$toast.loading({
-      //   duration: 0,
-      //   message: '加载中...',
-      //   forbidClick: true,
-      // });
-      // let url = window.location.href;
-      // let wx = this.wx;
-      // var that = this;
-      // let qiyeData;
-      // const instance = axios.create();
-      // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
-      // instance
-      //   .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
-      //     params: {
-      //       url: url,
-      //     },
-      //   })
-      //   .then((response) => {
-      //     if (response.status == 200) {
-      //       this.cont = 5;
-      //       var flat = true;
-      //       var times = setInterval(() => {
-      //         this.cont--;
-      //         if (this.cont == '0') {
-      //           if (flat) {
-      //             loading1.clear();
-      //             clearInterval(times);
-      //             that.$dialog.alert({
-      //               message: '定位失败,请开启企微定位权限',
-      //             });
-      //           } else {
-      //             clearInterval(times);
-      //           }
-      //         }
-      //       }, 1000);
-      //       qiyeData = response.data.data;
-      //       wx.config({
-      //         beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-      //         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-      //         appId: qiyeData.appId, // 必填,企业微信的corpID
-      //         timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-      //         nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-      //         signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-      //         jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-      //       });
-      //       wx.ready(function () {
-      //         wx.getLocation({
-      //           type: 'gcj02',
-      //           success: function (res) {
-      //             flat = false;
-      //             loading1.clear();
-      //             that.$router.push({
-      //               path: '/topStore',
-      //             });
-      //           },
-      //           fail: function () {
-      //             loading1.clear();
-      //             that.$dialog.alert({
-      //               message: 'GPS未开启',
-      //             });
-      //           },
-      //         });
-      //       });
-      //       wx.error(function (res) {
-      //         loading1.clear();
-      //         that.$dialog.alert({
-      //           message: '定位失败,请开启企微定位权限',
-      //         });
-      //       });
-      //     }
-      //   });
     },
     formLink() {
       this.$router.push('/storeVisit/questions');
@@ -1920,4 +1672,12 @@ export default {
   font-size: 16px;
   font-weight: 600;
 }
+.deviceWithin {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+  }
+}
 </style>

+ 346 - 298
src/views/historicalVisit/historAllVisit.vue

@@ -2,46 +2,57 @@
   <div class="bgcolor">
     <div class="navBarTOP">
       <!--        顶部条-->
-      <van-nav-bar
-          class="navBar"
-          title="历史拜访"
-          left-arrow
-          @click-left="onClickLeft"
-      />
+      <van-nav-bar class="navBar" title="历史拜访" left-arrow @click-left="onClickLeft" />
       <div class="searcTime">
         <van-row class="serchInput">
           <van-col span="12">
-            <van-cell class="monthNow selectcell" :title="companyName"  is-link arrow-direction="down" @click="regionClick"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="companyName"
+              is-link
+              arrow-direction="down"
+              @click="regionClick" />
           </van-col>
           <van-col span="12">
-            <van-cell  class="monthNow selectcell"  :title="regionName"  is-link @click="SalesRegionClick" arrow-direction="down"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="regionName"
+              is-link
+              @click="SalesRegionClick"
+              arrow-direction="down" />
           </van-col>
           <van-col span="12">
-            <van-cell  class="monthNow selectcell"  :title="deptName" is-link @click="SalesDepartmentClick" arrow-direction="down"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="deptName"
+              is-link
+              @click="SalesDepartmentClick"
+              arrow-direction="down" />
           </van-col>
           <van-col span="12">
-            <van-cell  class="monthNow selectcell"  :title="userName" is-link @click="StaffClick" arrow-direction="down"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="userName"
+              is-link
+              @click="StaffClick"
+              arrow-direction="down" />
           </van-col>
           <van-col span="12">
             <div class="monthNow" @click="startTimeshow = true">
               <span class="month">{{ startTime }}</span>
-              <van-icon class="CalendarIcon" :name="timeico"/>
+              <van-icon class="CalendarIcon" :name="timeico" />
             </div>
           </van-col>
           <van-col span="12">
             <div class="monthNow" @click="endTimeshow = true">
               <span class="month">{{ endTime }}</span>
-              <van-icon class="CalendarIcon" :name="timeico"/>
+              <van-icon class="CalendarIcon" :name="timeico" />
             </div>
           </van-col>
         </van-row>
       </div>
       <div class="searchDiv">
-        <van-search
-            v-model="storeName"
-            show-action
-            placeholder="搜索名称/编号/地址/拜访人"
-        >
+        <van-search v-model="storeName" show-action placeholder="搜索名称/编号/地址/拜访人">
           <template #action>
             <div @click="onSearch">搜索</div>
           </template>
@@ -50,125 +61,156 @@
       <div class="lineGrey"></div>
     </div>
     <!--        主体内容-->
-    <div class="container" style="margin-top: 262px;">
+    <div class="container" style="margin-top: 262px">
       <van-list
-      class="myList1"
-      v-model="loading"
-      :finished="finished"
-      finished-text="没有更多了"
-      @load="onLoad"
-      >
-        <div v-if="list.length>0">
-          <div class="cellcontent" v-for="(item,index) in list" :key="index">
+        class="myList1"
+        v-model="loading"
+        :finished="finished"
+        finished-text="没有更多了"
+        @load="onLoad">
+        <div v-if="list.length > 0">
+          <div class="cellcontent" v-for="(item, index) in list" :key="index">
             <van-cell @click="detilsFn(item)">
-              <div class="card" style="position: relative;">
-                <span v-if="item.visitSource==2" class="stateAbnormal">异常拜访</span>
+              <div class="card" style="position: relative">
+                <span v-if="item.visitSource == 2" class="stateAbnormal">异常拜访</span>
                 <!--<span v-if="item.visitModel==5" class="state">偏差过大</span>-->
-                <span v-if="item.visitSource==1" class="state">正常拜访</span>
-                <div class="title"><span>{{ item.storeName }}</span>
-                  (<span style="color:#0057ba">{{
-                      item.storeCode
-                    }}</span>)
+                <span v-if="item.visitSource == 1" class="state">正常拜访</span>
+                <div class="title">
+                  <span>{{ item.storeName }}</span> (<span style="color: #0057ba">{{
+                    item.storeCode
+                  }}</span
+                  >)
                 </div>
                 <div class="info">拜访人:{{ item.nickName }}</div>
-                <div class="info">拜访时间:{{ item.visitsTime }}
-                  <span class="textRight" v-if="item.status=='1'&&item.taskId==null">审批中</span>
-                  <span class="textRight" v-if="item.status=='1'&&item.taskId!=null" style="color:red;">退回修改</span>
-                  <span  class="textRight" style="color: #07c160;" v-if="item.status==2">审批完成</span>
-                  <span class="textRight" v-if="item.status=='3'" style="color:red;">拒绝</span></div>
+                <div class="info">
+                  拜访时间:{{ item.visitsTime }}
+                  <span class="textRight" v-if="item.status == '1' && item.taskId == null"
+                    >审批中</span
+                  >
+                  <span
+                    class="textRight"
+                    v-if="item.status == '1' && item.taskId != null"
+                    style="color: red"
+                    >退回修改</span
+                  >
+                  <span class="textRight" style="color: #07c160" v-if="item.status == 2"
+                    >审批完成</span
+                  >
+                  <span class="textRight" v-if="item.status == '3'" style="color: red">拒绝</span>
+                </div>
                 <div class="info" v-if="item.dwellTime">拜访时长:{{ item.dwellTime }}</div>
                 <div class="info">地址:{{ item.addressLine }}</div>
+                <!-- 分销店 -->
+                <!-- <template v-if="item.sfaStoreType.type == 'fxd'">
+                  <div class="info">
+                    经销商:
+                    <template
+                      v-if="item.TCFXListTreeSelec"
+                      v-for="(item, index) in item.TCFXListTreeSelec">
+                      <span :key="index">{{ item.name }},</span>
+                    </template>
+                  </div>
+                </template>
+                <template v-else> -->
                 <div class="info">经销商:{{ item.chainName }}</div>
+                <!-- </template> -->
               </div>
             </van-cell>
             <div class="lineGrey"></div>
           </div>
-       </div>
+        </div>
       </van-list>
-<!--      <p style="text-align: center;color: #ccc;font-size: 12px;" v-if="list.length!=0">&#45;&#45;已经到底了&#45;&#45;</p>-->
-<!--      <van-empty description="&#45;&#45;已经到底了&#45;&#45;" v-if="list.length==0"/>-->
+      <!--      <p style="text-align: center;color: #ccc;font-size: 12px;" v-if="list.length!=0">&#45;&#45;已经到底了&#45;&#45;</p>-->
+      <!--      <van-empty description="&#45;&#45;已经到底了&#45;&#45;" v-if="list.length==0"/>-->
     </div>
     <van-popup v-model="startTimeshow" position="bottom" :style="{ height: '30%' }">
       <van-datetime-picker
-          v-model="startcurrentDate"
-          type="date"
-          title="开始日期"
-          :min-date="minDate"
-          :max-date="startmaxDate"
-          @confirm="dateeconfirm"
-          @cancel="startTimeshow=false"
-      />
+        v-model="startcurrentDate"
+        type="date"
+        title="开始日期"
+        :min-date="minDate"
+        :max-date="startmaxDate"
+        @confirm="dateeconfirm"
+        @cancel="startTimeshow = false" />
     </van-popup>
     <van-popup v-model="endTimeshow" position="bottom" :style="{ height: '50%' }">
       <van-datetime-picker
-          v-model="currentDate"
-          type="date"
-          title="开始日期"
-          :min-date="endminDate"
-          :max-date="maxDate"
-          @confirm="endTimeconfirm"
-          @cancel="endTimeshow=false"
-      />
+        v-model="currentDate"
+        type="date"
+        title="开始日期"
+        :min-date="endminDate"
+        :max-date="maxDate"
+        @confirm="endTimeconfirm"
+        @cancel="endTimeshow = false" />
     </van-popup>
     <van-popup v-model="RegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="companyList"
-          value-key="deptName"
-          @confirm="onregionConfirm"
-          @cancel="RegionShow = false"
-      />
+        show-toolbar
+        :columns="companyList"
+        value-key="deptName"
+        @confirm="onregionConfirm"
+        @cancel="RegionShow = false" />
     </van-popup>
     <van-popup v-model="SalesRegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="regionList"
-          value-key="deptName"
-          @confirm="onSalesRegionConfirm"
-          @cancel="SalesRegionShow = false"
-      />
+        show-toolbar
+        :columns="regionList"
+        value-key="deptName"
+        @confirm="onSalesRegionConfirm"
+        @cancel="SalesRegionShow = false" />
     </van-popup>
     <van-popup v-model="SalesDepartmentShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="deptList"
-          value-key="deptName"
-          @confirm="onSalesDepartmentConfirm"
-          @cancel="SalesDepartmentShow = false"
-      />
+        show-toolbar
+        :columns="deptList"
+        value-key="deptName"
+        @confirm="onSalesDepartmentConfirm"
+        @cancel="SalesDepartmentShow = false" />
     </van-popup>
     <van-popup v-model="StaffShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="userList"
-          @confirm="onStaffConfirm"
-          value-key="nickName"
-          @cancel="StaffShow = false"
-      />
+        show-toolbar
+        :columns="userList"
+        @confirm="onStaffConfirm"
+        value-key="nickName"
+        @cancel="StaffShow = false" />
     </van-popup>
   </div>
 </template>
 
 <script>
-import {getVisits,getvisitDeptInfo} from "@/api/index";
-import timeico from "@/assets/Icon/datatims.png";
+import { getVisits, getvisitDeptInfo } from '@/api/index';
+import timeico from '@/assets/Icon/datatims.png';
 
 export default {
-  name: "index.vue",
+  name: 'index.vue',
   data() {
     return {
       timeico: timeico,
       defaultDate: new Date(),
       searchValue: '',
       calendarShow: '',
-      monthNames: ['-01', '-02', '-03', '-04', '-05', '-06', '-07', '-08', '-09', '-10', '-11', '-12',],
+      monthNames: [
+        '-01',
+        '-02',
+        '-03',
+        '-04',
+        '-05',
+        '-06',
+        '-07',
+        '-08',
+        '-09',
+        '-10',
+        '-11',
+        '-12',
+      ],
       calendarIsshow: false,
       tabVal: 'insidePlan',
       list: [],
       loading: false,
       finished: true,
       listActive: null,
-      query: "",
+      query: '',
       show: false,
       minDate: new Date(2022, 0, 1),
       maxDate: new Date(),
@@ -176,142 +218,142 @@ export default {
       startcurrentDate: new Date(),
       endminDate: new Date(),
       startmaxDate: new Date(),
-      endTime: "",
-      startTime: "",
+      endTime: '',
+      startTime: '',
       endTimeshow: false,
       startTimeshow: false,
-      storeName: "",
-      companyName:"全部公司",
-      deptName:"全部销售部",
-      regionName:"全部大区",
-      userName:"全部业务员",
-      companyCode:"",
-      deptCode:"",
-      regionCode:"",
-      userCode:"",
-      companyList:[],
-      deptList:[],
-      regionList:[],
-      userList:[],
+      storeName: '',
+      companyName: '全部公司',
+      deptName: '全部销售部',
+      regionName: '全部大区',
+      userName: '全部业务员',
+      companyCode: '',
+      deptCode: '',
+      regionCode: '',
+      userCode: '',
+      companyList: [],
+      deptList: [],
+      regionList: [],
+      userList: [],
       RegionShow: false,
       SalesRegionShow: false,
       SalesDepartmentShow: false,
       StaffShow: false,
-      deptForm:{type:"",parentId:""},
-      pageNum:1 , // 当前页码  int类型
-      pageSize:10, // 当前每页条数  int类型
-      formData:{
-        companyId:"", // 公司id,必传 Long类型
-        regionId:"", // 大区id,必传  Long类型
-        deptId:"", // 部门id,如果为周报或日报为必传  Long类型
-        userId:"", // 业务员id,如果为日报为必传      Long类型
-        startTime:"", // 开始时间,必传  格式:yyyy-MM-dd  String类型
-        endTime:"", // 结束时间,必传  格式:yyyy-MM-dd  String类型
-        pageNum:1 , // 当前页码  int类型
-        pageSize:10, // 当前每页条数  int类型
+      deptForm: { type: '', parentId: '' },
+      pageNum: 1, // 当前页码  int类型
+      pageSize: 10, // 当前每页条数  int类型
+      formData: {
+        companyId: '', // 公司id,必传 Long类型
+        regionId: '', // 大区id,必传  Long类型
+        deptId: '', // 部门id,如果为周报或日报为必传  Long类型
+        userId: '', // 业务员id,如果为日报为必传      Long类型
+        startTime: '', // 开始时间,必传  格式:yyyy-MM-dd  String类型
+        endTime: '', // 结束时间,必传  格式:yyyy-MM-dd  String类型
+        pageNum: 1, // 当前页码  int类型
+        pageSize: 10, // 当前每页条数  int类型
       },
-    }
+    };
   },
   activated() {
-  // watch: {
-  //   $route(to, from) {
-  //     if (from.path == "/My/index" && to.path == "/historAllVisit") {
-  //       this.info();
-  //       this.userList=[]
-        this.pageNum=1;
-        this.list=[];
-        // this.powerGrade = localStorage.getItem("powerGrade")
-        // this.getDeptInfo("dept")
-        // if(this.powerGrade==5){
-        //   setTimeout(()=>{
-        //     if(this.$route.query.userCode==undefined){
-        //       this.companyName=this.companyList[0].deptName;
-        //       this.companyCode=this.companyList[0].deptId;
-        //     }
-        //     this.getDeptInfo("dept",1)
-        //   },1000)
-        // }
-        // if(this.powerGrade==4){
-        //   setTimeout(()=>{
-        //     this.getDeptInfo("dept",1)
-        //   },1000)
-        // }
-        // if(this.powerGrade==3){
-        //   setTimeout(()=>{
-        //     this.getDeptInfo("dept",2)
-        //   },1000)
-        // }
-        // if(this.powerGrade==2||this.powerGrade==1){
-        //   setTimeout(()=>{
-        //     this.getDeptInfo("user")
-        //   },2000)
-        // }
-        setTimeout(()=>{
-          this.onSearch();
-        },1000)
-      // }
+    // watch: {
+    //   $route(to, from) {
+    //     if (from.path == "/My/index" && to.path == "/historAllVisit") {
+    //       this.info();
+    //       this.userList=[]
+    this.pageNum = 1;
+    this.list = [];
+    // this.powerGrade = localStorage.getItem("powerGrade")
+    // this.getDeptInfo("dept")
+    // if(this.powerGrade==5){
+    //   setTimeout(()=>{
+    //     if(this.$route.query.userCode==undefined){
+    //       this.companyName=this.companyList[0].deptName;
+    //       this.companyCode=this.companyList[0].deptId;
+    //     }
+    //     this.getDeptInfo("dept",1)
+    //   },1000)
+    // }
+    // if(this.powerGrade==4){
+    //   setTimeout(()=>{
+    //     this.getDeptInfo("dept",1)
+    //   },1000)
+    // }
+    // if(this.powerGrade==3){
+    //   setTimeout(()=>{
+    //     this.getDeptInfo("dept",2)
+    //   },1000)
+    // }
+    // if(this.powerGrade==2||this.powerGrade==1){
+    //   setTimeout(()=>{
+    //     this.getDeptInfo("user")
+    //   },2000)
     // }
-  // },
-},
+    setTimeout(() => {
+      this.onSearch();
+    }, 1000);
+    // }
+    // }
+    // },
+  },
   created() {
     this.info();
-    this.userList=[]
-    this.pageNum=1;
-    this.list=[];
-    this.powerGrade = localStorage.getItem("powerGrade")
-    this.getDeptInfo("dept")
-    if(this.powerGrade==5){
-      setTimeout(()=>{
-        if(this.$route.query.userCode==undefined){
-          this.companyName=this.companyList[0].deptName;
-          this.companyCode=this.companyList[0].deptId;
+    this.userList = [];
+    this.pageNum = 1;
+    this.list = [];
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.getDeptInfo('dept');
+    if (this.powerGrade == 5) {
+      setTimeout(() => {
+        if (this.$route.query.userCode == undefined) {
+          this.companyName = this.companyList[0].deptName;
+          this.companyCode = this.companyList[0].deptId;
         }
-        this.getDeptInfo("dept",1)
-      },1000)
+        this.getDeptInfo('dept', 1);
+      }, 1000);
     }
-    if(this.powerGrade==4){
-      setTimeout(()=>{
-        this.getDeptInfo("dept",1)
-      },1000)
+    if (this.powerGrade == 4) {
+      setTimeout(() => {
+        this.getDeptInfo('dept', 1);
+      }, 1000);
     }
-    if(this.powerGrade==3){
-      setTimeout(()=>{
-        this.getDeptInfo("dept",2)
-      },1000)
+    if (this.powerGrade == 3) {
+      setTimeout(() => {
+        this.getDeptInfo('dept', 2);
+      }, 1000);
     }
-    if(this.powerGrade==2||this.powerGrade==1){
-      setTimeout(()=>{
-        this.getDeptInfo("user")
-      },2000)
+    if (this.powerGrade == 2 || this.powerGrade == 1) {
+      setTimeout(() => {
+        this.getDeptInfo('user');
+      }, 2000);
     }
     // setTimeout(()=>{
     //   this.onSearch();
     // },1000)
   },
   methods: {
-    onLoad(){
+    onLoad() {
       // this.loading = false;
       this.getVisitsListFn();
     },
-    info(){
+    info() {
       this.query = this.$route.query;
-      this.startTime = this.getDay(-7)
-      this.startcurrentDate = new Date(this.getDay(-7))
-      this.endTime = this.parseTime(new Date(), '{y}-{m}-{d}')
-      this.endminDate = new Date(this.getDay(-7))
+      this.startTime = this.getDay(-7);
+      this.startcurrentDate = new Date(this.getDay(-7));
+      this.endTime = this.parseTime(new Date(), '{y}-{m}-{d}');
+      this.endminDate = new Date(this.getDay(-7));
     },
     detilsFn(val) {
       this.$router.push({
-        path: "/historicalDetails",
+        path: '/historicalDetails',
         query: {
           visitId: val.id,
-          storeId:val.storeId,
-          storeCode:val.storeCode,
-          taskId:val.taskId,
-          userId:val.userId,
-          storeCategory:val.storeCategory
-        }
-      })
+          storeId: val.storeId,
+          storeCode: val.storeCode,
+          taskId: val.taskId,
+          userId: val.userId,
+          storeCategory: val.storeCategory,
+        },
+      });
     },
     timeBefore7(date) {
       if (!date) {
@@ -324,9 +366,9 @@ export default {
         m = date.getMonth();
         var d1 = new Date(y, m, 0);
         var d2 = d1.getDate();
-        return y + '/' + (m < 10 ? ('0' + m) : m) + '/' + (d2 + d);
+        return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d2 + d);
       } else {
-        return y + '/' + (m < 10 ? ('0' + m) : m) + '/' + (d < 10 ? ('0' + d) : d);
+        return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d < 10 ? '0' + d : d);
       }
     },
     getDay(day) {
@@ -338,33 +380,33 @@ export default {
       var tDate = today.getDate();
       tMonth = this.doHandleMonth(tMonth + 1);
       tDate = this.doHandleMonth(tDate);
-      return tYear + "-" + tMonth + "-" + tDate;
+      return tYear + '-' + tMonth + '-' + tDate;
     },
     doHandleMonth(month) {
       var m = month;
       if (month.toString().length == 1) {
-        m = "0" + month;
+        m = '0' + month;
       }
       return m;
     },
     dateeconfirm() {
-      this.startTimeshow = false
-      this.startTime = this.parseTime(this.startcurrentDate, '{yy}-{mm}-{dd}')
-      this.endminDate = new Date(this.startcurrentDate)
-      this.onSearch()
+      this.startTimeshow = false;
+      this.startTime = this.parseTime(this.startcurrentDate, '{yy}-{mm}-{dd}');
+      this.endminDate = new Date(this.startcurrentDate);
+      this.onSearch();
     },
     endTimeconfirm() {
-      this.endTimeshow = false
-      this.endTime = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}')
-      this.startmaxDate = new Date(this.currentDate)
-      this.onSearch()
+      this.endTimeshow = false;
+      this.endTime = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
+      this.startmaxDate = new Date(this.currentDate);
+      this.onSearch();
     },
     onClickLeft() {
-      this.$router.go(-1)
+      this.$router.go(-1);
     },
     onSearch() {
-      this.pageNum=1;
-      this.list=[];
+      this.pageNum = 1;
+      this.list = [];
       this.getVisitsListFn();
     },
     getVisitsListFn() {
@@ -378,27 +420,30 @@ export default {
         this.refreshing = false;
       }
       getVisits({
-        startTime: this.startTime+ " 00:00:00",//
-        stopTime: this.endTime+ " 24:00:00", //
+        startTime: this.startTime + ' 00:00:00', //
+        stopTime: this.endTime + ' 24:00:00', //
         storeRequest: this.storeName.trim(),
-        pageNum:this.pageNum,
-        pageSize:this.pageSize,
-        companyId: this.companyCode, regionId: this.regionCode, userId: this.userCode, deptId: this.deptCode
-      }).then(res => {
-        loading1.clear()
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        companyId: this.companyCode,
+        regionId: this.regionCode,
+        userId: this.userCode,
+        deptId: this.deptCode,
+      }).then((res) => {
+        loading1.clear();
         if (res.code == 200) {
-          this.loading=false
-          this.list = this.list.concat(res.data)
-          if (this.list.length >=res.total) {
+          this.loading = false;
+          this.list = this.list.concat(res.data);
+          if (this.list.length >= res.total) {
             this.finished = true;
-          }else{
+          } else {
             this.finished = false;
           }
-          this.pageNum=this.pageNum+1
+          this.pageNum = this.pageNum + 1;
         } else {
-          this.$toast.fail(res.msg)
+          this.$toast.fail(res.msg);
         }
-      })
+      });
     },
     regionClick() {
       // if(this.powerGrade>4){
@@ -420,101 +465,101 @@ export default {
     },
     StartTimeClick() {
       this.StartTimeShow = true;
-    },onregionConfirm(val) {
+    },
+    onregionConfirm(val) {
       this.RegionShow = false;
-      this.companyName=val.deptName;
-      this.companyCode=val.deptId;
-      this.regionName="全部大区";
-      this.regionCode="";
-      this.deptName="全部销售部";
-      this.deptCode="";
-      this.userName="全部业务员";
-      this.userCode="";
-      this.getDeptInfo("dept",1)
+      this.companyName = val.deptName;
+      this.companyCode = val.deptId;
+      this.regionName = '全部大区';
+      this.regionCode = '';
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+      this.userName = '全部业务员';
+      this.userCode = '';
+      this.getDeptInfo('dept', 1);
     },
     onSalesRegionConfirm(val) {
       this.SalesRegionShow = false;
-      this.regionName=val.deptName;
-      this.regionCode=val.deptId;
-      if(val.deptId!=""){
-        this.getDeptInfo("dept",2)
+      this.regionName = val.deptName;
+      this.regionCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('dept', 2);
       }
-      this.deptName="全部销售部";
-      this.deptCode="";
-      this.userName="全部业务员";
-      this.userCode="";
-      this.userList=[]
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+      this.userName = '全部业务员';
+      this.userCode = '';
+      this.userList = [];
     },
     onSalesDepartmentConfirm(val) {
       this.SalesDepartmentShow = false;
-      this.deptName=val.deptName;
-      this.deptCode=val.deptId;
-      if(val.deptId!=""){
-
-        this.getDeptInfo("user")
+      this.deptName = val.deptName;
+      this.deptCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('user');
       }
-      this.userName="全部业务员";
-      this.userCode="";
+      this.userName = '全部业务员';
+      this.userCode = '';
     },
     onStaffConfirm(val) {
       this.StaffShow = false;
-      this.userName=val.nickName;
-      this.userCode=val.userId;
+      this.userName = val.nickName;
+      this.userCode = val.userId;
     },
-    getDeptInfo(type,grade){
-      this.deptForm.type=type
-      if(type=="dept"){
-        if(grade=="1"){
-          this.deptForm.parentId=this.companyCode
-        }else if(grade=="2"){
-          this.deptForm.parentId=this.regionCode
-        }else{
-          this.deptForm.type=""
-          this.deptForm.parentId=""
+    getDeptInfo(type, grade) {
+      this.deptForm.type = type;
+      if (type == 'dept') {
+        if (grade == '1') {
+          this.deptForm.parentId = this.companyCode;
+        } else if (grade == '2') {
+          this.deptForm.parentId = this.regionCode;
+        } else {
+          this.deptForm.type = '';
+          this.deptForm.parentId = '';
         }
-      }else if(type=="user"){
-        this.deptForm.parentId=this.deptCode
+      } else if (type == 'user') {
+        this.deptForm.parentId = this.deptCode;
       }
-      getvisitDeptInfo(this.deptForm).then(res=>{
-        if(type=="dept"){
-          if(grade=="1"){
-            if(res.data.region!=null){
-              this.regionList=[{deptName:"全部大区",deptId:""}].concat(res.data.region)
+      getvisitDeptInfo(this.deptForm).then((res) => {
+        if (type == 'dept') {
+          if (grade == '1') {
+            if (res.data.region != null) {
+              this.regionList = [{ deptName: '全部大区', deptId: '' }].concat(res.data.region);
             }
-          }else if(grade=="2"){
-            if(res.data.dept!=null){
-              this.deptList=[{deptName:"全部销售部",deptId:""}].concat(res.data.dept)
+          } else if (grade == '2') {
+            if (res.data.dept != null) {
+              this.deptList = [{ deptName: '全部销售部', deptId: '' }].concat(res.data.dept);
             }
-          }else{
-            this.companyList=res.data.company
-            if(this.$route.query.userCode==undefined){
-              this.companyName=res.data.company[0].deptName
-              this.companyCode=res.data.company[0].deptId
+          } else {
+            this.companyList = res.data.company;
+            if (this.$route.query.userCode == undefined) {
+              this.companyName = res.data.company[0].deptName;
+              this.companyCode = res.data.company[0].deptId;
             }
-            if(res.data.dept!=null){
-              this.deptName=res.data.dept[0].deptName
-              this.deptCode=res.data.dept[0].deptId
-              this.deptList=res.data.dept
+            if (res.data.dept != null) {
+              this.deptName = res.data.dept[0].deptName;
+              this.deptCode = res.data.dept[0].deptId;
+              this.deptList = res.data.dept;
             }
-            if(res.data.region!=null){
-              this.regionName=res.data.region[0].deptName
-              this.regionCode=res.data.region[0].deptId
-              this.regionList=res.data.region
+            if (res.data.region != null) {
+              this.regionName = res.data.region[0].deptName;
+              this.regionCode = res.data.region[0].deptId;
+              this.regionList = res.data.region;
             }
-            if(res.data.user!=null){
-              this.userList=res.data.user
-              this.userCode=""
+            if (res.data.user != null) {
+              this.userList = res.data.user;
+              this.userCode = '';
             }
           }
-        }else if(type=="user"){
-          if(res.data.user!=null){
-            this.userList=[{nickName:"全部业务员",userId:""}].concat(res.data.user)
+        } else if (type == 'user') {
+          if (res.data.user != null) {
+            this.userList = [{ nickName: '全部业务员', userId: '' }].concat(res.data.user);
           }
         }
-      })
+      });
     },
-  }
-}
+  },
+};
 </script>
 <style lang="scss">
 .searchDiv {
@@ -533,7 +578,7 @@ export default {
   }
 
   .van-search--show-action {
-    padding-right: 12px
+    padding-right: 12px;
   }
 
   .van-search__content {
@@ -573,12 +618,13 @@ export default {
   box-sizing: border-box;
   background-color: #f1f1f1;
   border-radius: 20px;
-  margin:8px;
+  margin: 8px;
   border: 1px solid #ccc;
   position: relative;
   color: #333;
   font-size: 14px;
-  .van-cell__left-icon, .van-cell__right-icon{
+  .van-cell__left-icon,
+  .van-cell__right-icon {
     line-height: 34px;
   }
   .CalendarIcon {
@@ -593,10 +639,12 @@ export default {
     }
   }
 }
-.serchInput{
-  padding: 0 4px ;
+.serchInput {
+  padding: 0 4px;
+}
+.selectcell {
+  width: 92%;
 }
-.selectcell{width: 92%}
 .card {
   box-sizing: border-box;
 
@@ -620,7 +668,7 @@ export default {
   background-color: white;
 }
 .btnbox {
-  padding: 0 16px
+  padding: 0 16px;
 }
 .cellcontent .centerBtn {
   margin: 0 auto 10px;
@@ -672,4 +720,4 @@ export default {
   float: right;
   color: #0057ba;
 }
-</style>
+</style>

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

@@ -267,7 +267,20 @@
               </div>
               <div class="info">联系电话:{{ item.telephone }}</div>
               <div class="info">地址:{{ item.addressLine }}</div>
+              <!-- 分销店 -->
+              <!-- <template v-if="item.sfaStoreType.type == 'fxd'">
+                <div class="info" v-if="addShow1">
+                  经销商:
+                  <template
+                    v-if="item.TCFXListTreeSelec"
+                    v-for="(item, index) in item.TCFXListTreeSelec">
+                    <span :key="index">{{ item.name }},</span>
+                  </template>
+                </div>
+              </template>
+              <template v-else> -->
               <div class="info" v-if="addShow1">经销商:{{ item.chainName }}</div>
+              <!-- </template> -->
             </div>
           </van-cell>
           <div class="lineGrey"></div>

+ 24 - 21
src/views/storeManagement/storeAdd.vue

@@ -1,14 +1,14 @@
 <template>
   <div class="storeAdd">
     <div class="navBarTOP">
-      <!--        顶部条-->
+      <!-- 新建同城分销店必须要下单 -->
       <van-nav-bar
         class="navBar"
         title="新增信息"
         left-arrow
         @click-left="onClickLeft"
         :right-text="
-          fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131'
+          verifyStoreType(fromValue.storeCategory) && verifyStoreType(fromValue.storeCategory).tcfx
             ? '去下单'
             : '保存'
         "
@@ -335,7 +335,8 @@
                   <!-- 新建同城A、B店不显示陈列照 -->
                   <template
                     v-if="
-                      fromValue.storeCategory !== '129081' && fromValue.storeCategory !== '10131'
+                      verifyStoreType(fromValue.storeCategory) &&
+                      !verifyStoreType(fromValue.storeCategory).tcfx
                     ">
                     <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
                       <div v-if="storeTypePOP">
@@ -375,7 +376,8 @@
                   <!-- 新建同城A、B店不显示陈列照 -->
                   <template
                     v-if="
-                      fromValue.storeCategory !== '129081' && fromValue.storeCategory !== '10131'
+                      verifyStoreType(fromValue.storeCategory) &&
+                      !verifyStoreType(fromValue.storeCategory).tcfx
                     ">
                     <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
                       <div v-if="storeTypePOP">
@@ -395,6 +397,7 @@
             </div>
           </van-tab>
           <van-tab title="属性信息" name="Planpic">
+            <!-- 同城分销店-属性信息 -->
             <div v-if="dictTypeFormShow" style="background-color: #ffffff; padding: 10px">
               <p style="color: #666"><span class="van-f-red">*</span>属性</p>
               <div style="padding: 4px">
@@ -404,7 +407,8 @@
                       span="12"
                       v-for="(item, index) in TCFXList"
                       :key="index"
-                      style="margin-bottom: 10px">
+                      style="margin-bottom: 10px"
+                      v-if="item.remark == fromValue.storeCategory">
                       <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
                     </van-col>
                   </van-row>
@@ -901,7 +905,6 @@ export default {
     this.getTCFXList();
     this.getSJSList();
     this.getQGJZist();
-    this.getbrands();
     this.getpotentialCustomerTypeList();
     setTimeout(() => {
       // this.getLocation()
@@ -980,7 +983,6 @@ export default {
         this.getpotentialCustomerTypeList();
         this.getSJSList();
         this.getQGJZist();
-        this.getbrands();
         this.getStreetQuery();
       }
     },
@@ -1533,7 +1535,11 @@ export default {
       getTCFXList({}).then((res) => {
         var TCFXList = [];
         for (var t = 0; t < res.data.length; t++) {
-          TCFXList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
+          TCFXList.push({
+            text: res.data[t].dictLabel,
+            dictCode: res.data[t].dictValue,
+            remark: res.data[t].remark,
+          });
         }
         this.TCFXList = TCFXList;
       });
@@ -1627,20 +1633,24 @@ export default {
     onConfirm(value) {
       this.fromValue.storeCategoryName = value.text;
       this.fromValue.storeCategory = value.dictValue;
-      if (value.dictValue == '129081' || value.dictValue == '10131') {
+      if (
+        this.verifyStoreType(this.fromValue.storeCategory) &&
+        this.verifyStoreType(this.fromValue.storeCategory).tcfx
+      ) {
+        this.getbrands();
+        // 是否车铺开店
         this.typeABshow = true;
+        // 属性信息
+        this.dictTypeFormShow = true;
       } else {
         this.typeABshow = false;
         this.fromValue.carShop = '';
         this.fromValue.carShopImgList = [];
-      }
-      if (value.dictValue == '129081') {
-        this.dictTypeAFormShow = true;
-      } else {
         this.fromValue.tcfxName = '';
         this.fromValue.tcfxCode = '';
-        this.dictTypeAFormShow = false;
+        this.dictTypeFormShow = false;
       }
+
       if (value.dictValue == 'C917') {
         this.GZAttributeFormShow = true;
         this.dictTypeSJSFormShow = false;
@@ -1653,13 +1663,6 @@ export default {
         this.fromValue.tcfxCode = '';
         this.GZAttributeFormShow = false;
       }
-      if (value.dictValue == '10131') {
-        this.dictTypeFormShow = true;
-      } else {
-        this.fromValue.tcfxName = '';
-        this.fromValue.tcfxCode = '';
-        this.dictTypeFormShow = false;
-      }
       if (value.dictValue == 'sjs61') {
         this.dictTypeSJSFormShow = true;
       } else {