Explorar el Código

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

zhujindu hace 11 meses
padre
commit
9d83af36b7

+ 5 - 5
src/views/deviceOutside/index.vue

@@ -247,20 +247,20 @@
                   @click="linkapp(item)" />
               </div>
               <!-- 分销店 -->
-              <template v-if="item.sfaStoreType.type == 'fxd'">
+              <template v-if="item.sfaStoreType.type == 'fxd' || item.sfaStoreChainsContactList">
                 <div class="info" v-if="typeShow">
                   经销商:
                   <template
-                    v-if="item.TCFXListTreeSelec"
-                    v-for="(item, index) in item.TCFXListTreeSelec">
+                    v-if="item.sfaStoreChainsContactList"
+                    v-for="(item, index) in item.sfaStoreChainsContactList">
                     <el-popover
                       popper-class="zpover zpover6"
                       placement="bottom-start"
                       trigger="click">
                       <div>
-                        {{ item.name }}
+                        {{ item.CustomerName }}
                       </div>
-                      <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                      <span class="TCFXListItem" :key="index">{{ item.CategoryName }}</span>
                     </el-popover>
                   </template>
                 </div>

+ 4 - 4
src/views/deviceOutside/rangeStore.vue

@@ -366,13 +366,13 @@
               ><van-icon name="phone" size="16" color="#1989fa" />
             </p>
             <!-- 分销店 -->
-            <template v-if="info.sfaStoreType.type == 'fxd'">
+            <template v-if="info.sfaStoreType.type == 'fxd' || info.sfaStoreChainsContactList">
               <div>
                 经销商:
                 <template
-                  v-if="info.TCFXListTreeSelec"
-                  v-for="(item, index) in info.TCFXListTreeSelec">
-                  <span :key="index">{{ item.name }},</span>
+                  v-if="info.sfaStoreChainsContactList"
+                  v-for="(item, index) in info.sfaStoreChainsContactList">
+                  <span :key="index">{{ item.CustomerName }},</span>
                 </template>
               </div>
             </template>

+ 5 - 5
src/views/deviceOutside/topStore.vue

@@ -271,20 +271,20 @@
                 </div>
                 <div class="info">地址:{{ item.addressLine }}</div>
                 <!-- 分销店 -->
-                <template v-if="item.sfaStoreType.type == 'fxd'">
+                <template v-if="item.sfaStoreType.type == 'fxd' || item.sfaStoreChainsContactList">
                   <div class="info" v-if="typeShow">
                     经销商:
                     <template
-                      v-if="item.TCFXListTreeSelec"
-                      v-for="(item, index) in item.TCFXListTreeSelec">
+                      v-if="item.sfaStoreChainsContactList"
+                      v-for="(item, index) in item.sfaStoreChainsContactList">
                       <el-popover
                         popper-class="zpover zpover6"
                         placement="bottom-start"
                         trigger="click">
                         <div>
-                          {{ item.name }}
+                          {{ item.CustomerName }}
                         </div>
-                        <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                        <span class="TCFXListItem" :key="index">{{ item.CategoryName }}</span>
                       </el-popover>
                     </template>
                   </div>

+ 5 - 5
src/views/deviceWithin/index.vue

@@ -251,20 +251,20 @@
                 @click="linkapp(item)" />
             </div>
             <!-- 分销店 -->
-            <template v-if="item.sfaStoreType.type == 'fxd'">
+            <template v-if="item.sfaStoreType.type == 'fxd' || item.sfaStoreChainsContactList">
               <div class="info" v-if="typeShow">
                 经销商:
                 <template
-                  v-if="item.TCFXListTreeSelec"
-                  v-for="(item, index) in item.TCFXListTreeSelec">
+                  v-if="item.sfaStoreChainsContactList"
+                  v-for="(item, index) in item.sfaStoreChainsContactList">
                   <el-popover
                     popper-class="zpover zpover6"
                     placement="bottom-start"
                     trigger="click">
                     <div>
-                      {{ item.name }}
+                      {{ item.CustomerName }}
                     </div>
-                    <span class="TCFXListItem" :key="index">{{ item.name }}</span>
+                    <span class="TCFXListItem" :key="index">{{ item.CategoryName }}</span>
                   </el-popover>
                 </template>
               </div>

+ 7 - 7
src/views/historicalVisit/historAllVisit.vue

@@ -101,19 +101,19 @@
                 <div class="info" v-if="item.dwellTime">拜访时长:{{ item.dwellTime }}</div>
                 <div class="info">地址:{{ item.addressLine }}</div>
                 <!-- 分销店 -->
-                <!-- <template v-if="item.sfaStoreType.type == 'fxd'">
+                <template v-if="item.sfaStoreType.type == 'fxd' || item.sfaStoreChainsContactList">
                   <div class="info">
                     经销商:
                     <template
-                      v-if="item.TCFXListTreeSelec"
-                      v-for="(item, index) in item.TCFXListTreeSelec">
-                      <span :key="index">{{ item.name }},</span>
+                      v-if="item.sfaStoreChainsContactList"
+                      v-for="(item, index) in item.sfaStoreChainsContactList">
+                      <span :key="index">{{ item.CustomerName }},</span>
                     </template>
                   </div>
                 </template>
-                <template v-else> -->
-                <div class="info">经销商:{{ item.chainName }}</div>
-                <!-- </template> -->
+                <template v-else>
+                  <div class="info">经销商:{{ item.chainName }}</div>
+                </template>
               </div>
             </van-cell>
             <div class="lineGrey"></div>

+ 7 - 7
src/views/storeManagement/index.vue

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

+ 43 - 57
src/views/storeManagement/storeAdd.vue

@@ -1698,16 +1698,7 @@ export default {
       });
       var fromValue = this.fromValue;
       var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
-      if (
-        fromValue.chainName == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        fromValue.storeCategory != 'C912' &&
-        fromValue.storeCategory != 'C917'
-      ) {
-        // fromValue.storeCategory!='C912'
-        this.$toast('经销商未填写');
-        return;
-      } else if (fromValue.orgId == '') {
+      if (fromValue.orgId == '') {
         this.$toast('部门未选择');
         return;
       } else if (fromValue.storeName == '') {
@@ -1782,71 +1773,66 @@ export default {
           this.$toast('照片未上传');
         }
         return;
-      } else if (
-        fromValue.imgSed == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        this.storeTypePOP &&
-        fromValue.storeCategory != 'C917' &&
-        this.verifyStoreType(this.fromValue.storeCategory) &&
-        !this.verifyStoreType(this.fromValue.storeCategory).tcfx
-      ) {
-        this.$toast('图片未上传');
-        return;
       } else if (fromValue.lon == '') {
         this.$toast('请获取定位坐标');
         return;
       } else if (
-        ((this.verifyStoreType(this.fromValue.storeCategory) &&
-          this.verifyStoreType(this.fromValue.storeCategory).tcfx) ||
-          fromValue.storeCategory == 'sjs61' ||
-          fromValue.storeCategory == 'zyjz63') &&
+        (fromValue.storeCategory == 'sjs61' || fromValue.storeCategory == 'zyjz63') &&
         fromValue.tcfxName == ''
       ) {
         this.$toast('属性未填写');
         return;
-      } else if (
-        this.verifyStoreType(this.fromValue.storeCategory) &&
-        this.verifyStoreType(this.fromValue.storeCategory).tcfx &&
-        fromValue.carShop == ''
-      ) {
-        this.$toast('请选择是否车铺开店');
-        return;
-      } else if (
-        this.verifyStoreType(this.fromValue.storeCategory) &&
-        this.verifyStoreType(this.fromValue.storeCategory).tcfx &&
-        fromValue.carShop == '1' &&
-        fromValue.carShopImgList.length < 1
-      ) {
-        this.$toast('请上传车铺开店照片');
-        return;
       }
       if (fromValue.area.trim() == '' && fromValue.ifJzStoreType == 1) {
         this.$toast('家装展厅面积未填写');
         return;
       }
-
-      // if (fromValue.storeCategory == '129081' && fromValue.attribute3 == '') {
-      //   this.$toast('属性未填写');
-      //   return;
-      // }
-      // if (
-      //   fromValue.storeCategory == '129081' &&
-      //   fromValue.attribute3 == '0' &&
-      //   fromValue.attribute5 == ''
-      // ) {
-      //   this.$toast('属性未填写');
-      //   return;
-      // }
-      if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
-        this.$toast('潜在客户类型未填写');
-        return;
-      }
-      // 同城分销多经销商
+      // 同城分销类型门店
       if (
         this.verifyStoreType(this.fromValue.storeCategory) &&
         this.verifyStoreType(this.fromValue.storeCategory).tcfx
       ) {
+        // 同城分销多经销商
         this.fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
+        if (!this.fromValue.sfaStoreChainsContactList.length) {
+          this.$toast('经销商未填写');
+          return;
+        }
+        if (fromValue.carShop == '') {
+          this.$toast('请选择是否车铺开店');
+          return;
+        } else if (fromValue.carShop == '1' && fromValue.carShopImgList.length < 1) {
+          this.$toast('请上传车铺开店照片');
+          return;
+        }
+        if (fromValue.tcfxName == '') {
+          this.$toast('属性未填写');
+          return;
+        }
+      } else {
+        // 非同城分销店 经销商必填校验
+        if (
+          fromValue.chainName == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          fromValue.storeCategory != 'C912' &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('经销商未填写');
+          return;
+        }
+        if (
+          fromValue.imgSed == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          this.storeTypePOP &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('图片未上传');
+          return;
+        }
+      }
+      if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
+        this.$toast('潜在客户类型未填写');
+        return;
       }
       addStore(this.fromValue).then((res) => {
         loading1.clear();

+ 37 - 31
src/views/storeManagement/storeEdit.vue

@@ -1673,15 +1673,7 @@ export default {
       }
       var fromValue = this.fromValue;
       var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
-      if (
-        fromValue.chainName == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        fromValue.storeCategory != 'C912' &&
-        fromValue.storeCategory != 'C917'
-      ) {
-        this.$toast('经销商未选择');
-        return;
-      } else if (fromValue.orgId == '') {
+      if (fromValue.orgId == '') {
         this.$toast('部门未选择');
         return;
       } else if (fromValue.storeName == '') {
@@ -1756,14 +1748,6 @@ export default {
           this.$toast('照片未上传');
         }
         return;
-      } else if (
-        fromValue.imgSed == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        this.storeTypePOP &&
-        fromValue.storeCategory != 'C917'
-      ) {
-        this.$toast('图片未上传');
-        return;
       } else if (
         (fromValue.storeCategory == 'sjs61' || fromValue.storeCategory == 'zyjz63') &&
         fromValue.tcfxName == ''
@@ -1775,26 +1759,48 @@ export default {
         this.$toast('家装展厅面积未填写');
         return;
       }
-      if (
-        this.verifyStoreType(this.fromValue.storeCategory) &&
-        this.verifyStoreType(this.fromValue.storeCategory).tcfx
-      ) {
-        this.$toast('属性未填写');
+      if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
+        this.$toast('潜在客户类型未填写');
         return;
       }
+
+      // 同城分销类型门店
       if (
         this.verifyStoreType(this.fromValue.storeCategory) &&
-        this.verifyStoreType(this.fromValue.storeCategory).tcfx &&
-        fromValue.attribute3 == '0' &&
-        fromValue.attribute5 == ''
+        this.verifyStoreType(this.fromValue.storeCategory).tcfx
       ) {
-        this.$toast('属性未填写');
-        return;
-      }
-      if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
-        this.$toast('潜在客户类型未填写');
-        return;
+        // 同城分销多经销商
+        this.fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
+        if (!this.fromValue.sfaStoreChainsContactList.length) {
+          this.$toast('经销商未填写');
+          return;
+        }
+        if (fromValue.tcfxName == '') {
+          this.$toast('属性未填写');
+          return;
+        }
+      } else {
+        // 非同城分销店 经销商必填校验
+        if (
+          fromValue.chainName == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          fromValue.storeCategory != 'C912' &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('经销商未选择');
+          return;
+        }
+        if (
+          fromValue.imgSed == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          this.storeTypePOP &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('图片未上传');
+          return;
+        }
       }
+
       let loading1 = this.$toast.loading({
         duration: 0,
         message: '加载中...',