Просмотр исходного кода

Merge branch 'feature_20260211_同城分销店-主营竞品品牌' into uat(dev)

zhujindu 1 неделя назад
Родитель
Сommit
d01039bfa6
2 измененных файлов с 118 добавлено и 11 удалено
  1. 63 7
      src/views/storeManagement/storeAdd.vue
  2. 55 4
      src/views/storeManagement/storeEdit.vue

+ 63 - 7
src/views/storeManagement/storeAdd.vue

@@ -417,6 +417,34 @@
                   </van-row>
                 </van-radio-group>
               </div>
+              <!-- 主营竞品品牌 -->
+              <p style="color: #666"><span class="van-f-red">*</span>主营竞品品牌</p>
+              <div style="padding: 4px">
+                <van-checkbox-group
+                  v-model="fromValue.storeCompetitorList"
+                  direction="horizontal"
+                  class="typeRadioStore1">
+                  <van-row gutter="24">
+                    <van-col
+                      span="12"
+                      v-for="(item, index) in storeCompetitorlist"
+                      style="margin-bottom: 10px">
+                      <van-checkbox
+                        v-if="item.dictLabel != '其他'"
+                        :name="item.dictValue"
+                        shape="square"
+                        :key="index">
+                        {{ item.dictValue }}
+                      </van-checkbox>
+                    </van-col>
+                  </van-row>
+                </van-checkbox-group>
+                <van-field
+                  class="otherCompetitor"
+                  v-model="otherCompetitor"
+                  label="其他"
+                  placeholder="请输入" />
+              </div>
             </div>
             <div v-if="dictTypeAFormShow" style="background-color: #ffffff; padding: 10px">
               <p style="color: #666"><span class="van-f-red">*</span>属性</p>
@@ -796,6 +824,7 @@ export default {
         managementModel: '',
         mainProjectType: '',
         mainRelationFrom: '',
+        storeCompetitorList: [],
       },
       location: {
         lat: '34.6174',
@@ -849,10 +878,13 @@ export default {
       sfaStoreChainsContactList: [], //选中确定的经销商
       activatedTCFXList: [], //选中的经销商
       // addStoreType:null, //新增门店类型,TCFX:同城分销(包括分销店和金牌店);C917:潜在客户;C912:工地
+      storeCompetitorlist: [], //主营竞品品牌
+      otherCompetitor: '', //主营竞品品牌-其他
     };
   },
   created() {
     this.getTCFXList();
+    this.getTCompetitiveProduct();
     this.getSJSList();
     this.getQGJZist();
     this.getpotentialCustomerTypeList();
@@ -924,12 +956,14 @@ export default {
           managementModel: '',
           mainProjectType: '',
           mainRelationFrom: '',
+          storeCompetitorList: [],
         };
         setTimeout(() => {
           // this.getLocation()
         });
         this.fromValue.salesmanName = localStorage.getItem('nickName');
         this.getTCFXList();
+        this.getTCompetitiveProduct();
         this.getpotentialCustomerTypeList();
         this.getSJSList();
         this.getQGJZist();
@@ -971,7 +1005,7 @@ export default {
             val.location.lat +
             ',' +
             val.location.lng +
-            ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
+            ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6',
         ).then((res) => {
           that.maplist = res.data;
           that.marker.setGeometries([]);
@@ -999,7 +1033,7 @@ export default {
           this.location.lat1 +
           ',' +
           this.location.lon1 +
-          '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20&region_fix=1'
+          '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20&region_fix=1',
       ).then((res) => {
         this.searchSHow = true;
         that.mapsearchlist = res.data;
@@ -1013,7 +1047,7 @@ export default {
             styleId: 'abc',
             position: new TMap.LatLng(
               this.maplist[val].location.lat,
-              this.maplist[val].location.lng
+              this.maplist[val].location.lng,
             ),
           },
         ]);
@@ -1033,7 +1067,7 @@ export default {
           this.location.lat1 +
           ',' +
           this.location.lon1 +
-          ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
+          ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6',
       ).then((res) => {
         this.maplist = res.data;
         setTimeout(() => {
@@ -1258,7 +1292,7 @@ export default {
           } else {
             this.$toast.fail('请求超时');
           }
-        }
+        },
       );
     },
     newimgarr1(val) {
@@ -1333,7 +1367,7 @@ export default {
               }
               if (
                 res.data.StreetInfoList[j2].countyName.indexOf(
-                  this.fromValue.districtNameOld + ''
+                  this.fromValue.districtNameOld + '',
                 ) != -1
               ) {
                 this.fromValue.district = res.data.StreetInfoList[j2].countyCode;
@@ -1381,6 +1415,7 @@ export default {
       });
     },
     addVisits() {
+      that.beforeAddFn(); //测试使用,,,,,
       var that = this;
       var map = new TMap.Map('allmap', {
         zoom: 15,
@@ -1507,6 +1542,12 @@ export default {
         this.TCFXList = TCFXList;
       });
     },
+    // 竞品品牌
+    getTCompetitiveProduct() {
+      getDictOption({}, 'main_competitor_brands').then((res) => {
+        this.storeCompetitorlist = res.data;
+      });
+    },
     getSJSList() {
       getSJSList({}).then((res) => {
         var SJSList = [];
@@ -1831,6 +1872,10 @@ export default {
           this.$toast('属性未填写');
           return;
         }
+        if (!fromValue.storeCompetitorList.length && this.otherCompetitor == '') {
+          this.$toast('主营竞品品牌未填写');
+          return;
+        }
       } else {
         // 非同城分销店 经销商必填校验
         if (
@@ -1882,6 +1927,10 @@ export default {
               })
               .then(() => {
                 this.toastLoading(0, '上传中...', true);
+                this.fromValue.storeCompetitorList =
+                  this.otherCompetitor != ''
+                    ? this.fromValue.storeCompetitorList.push(this.otherCompetitor)
+                    : this.fromValue.storeCompetitorList;
                 this.addStoreFun();
               });
           }
@@ -1945,7 +1994,7 @@ export default {
                           '&marklat=' +
                           this.mlan +
                           '&marklon=' +
-                          this.mlon
+                          this.mlon,
                       );
                     } else {
                       this.$dialog
@@ -2199,5 +2248,12 @@ export default {
       }
     }
   }
+  .otherCompetitor {
+    padding: 10px 0px;
+    border-bottom: 1px solid #b6b6b6;
+    .van-cell__title {
+      width: 50px;
+    }
+  }
 }
 </style>

+ 55 - 4
src/views/storeManagement/storeEdit.vue

@@ -399,6 +399,34 @@
                   </van-row>
                 </van-radio-group>
               </div>
+              <!-- 主营竞品品牌 -->
+              <p style="color: #666"><span class="van-f-red">*</span>主营竞品品牌</p>
+              <div style="padding: 4px">
+                <van-checkbox-group
+                  v-model="fromValue.storeCompetitorList"
+                  direction="horizontal"
+                  class="typeRadioStore1">
+                  <van-row gutter="24">
+                    <van-col
+                      span="12"
+                      v-for="(item, index) in storeCompetitorlist"
+                      style="margin-bottom: 10px">
+                      <van-checkbox
+                        v-if="item.dictLabel != '其他'"
+                        :name="item.dictValue"
+                        shape="square"
+                        :key="index">
+                        {{ item.dictValue }}
+                      </van-checkbox>
+                    </van-col>
+                  </van-row>
+                </van-checkbox-group>
+                <van-field
+                  class="otherCompetitor"
+                  v-model="otherCompetitor"
+                  label="其他"
+                  placeholder="请输入" />
+              </div>
             </div>
             <div v-if="dictTypeSJSFormShow" style="background-color: #ffffff; padding: 10px">
               <p style="color: #666"><span class="van-f-red">*</span>属性</p>
@@ -755,6 +783,7 @@ export default {
         managementModel: '',
         mainProjectType: '',
         mainRelationFrom: '',
+        storeCompetitorList: [],
       },
       img: 'https://svs-test.oss-cn-shanghai.aliyuncs.com/1647398239620微信截图_20220315112921.png',
       location: {
@@ -815,6 +844,8 @@ export default {
       sfaStoreChainsContactList: [], //选中确定的经销商
       activatedTCFXList: [], //选中的经销商
       chainUser: false, //是否经销商用户 true
+      storeCompetitorlist: [], //主营竞品品牌
+      otherCompetitor: '', //主营竞品品牌-其他
     };
   },
   activated() {
@@ -824,6 +855,7 @@ export default {
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.getTCFXList();
+      this.getTCompetitiveProduct();
       this.getSJSList();
       this.getQGJZist();
       this.getDetail();
@@ -872,10 +904,8 @@ export default {
       });
     },
     searchFn(val) {
-      debugger;
       this.searchSHow = false;
       getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, val).then((res) => {
-        debugger;
         // 不显示下拉选择
         if (!res.data.length && !val) {
           this.searchSHow = false;
@@ -895,7 +925,7 @@ export default {
             styleId: 'abc',
             position: new TMap.LatLng(
               this.maplist[val].location.lat,
-              this.maplist[val].location.lng
+              this.maplist[val].location.lng,
             ),
           },
         ]);
@@ -1252,7 +1282,7 @@ export default {
             }
             this.provinceList = provinceList;
           }
-        }
+        },
       );
     },
     getDetail() {
@@ -1501,6 +1531,12 @@ export default {
         this.TCFXList = TCFXList;
       });
     },
+    // 竞品品牌
+    getTCompetitiveProduct() {
+      getDictOption({}, 'main_competitor_brands').then((res) => {
+        this.storeCompetitorlist = res.data;
+      });
+    },
     getSJSList() {
       getSJSList({}).then((res) => {
         var SJSList = [];
@@ -1812,6 +1848,10 @@ export default {
           this.$toast('图片未上传');
           return;
         }
+        if (!fromValue.storeCompetitorList.length && this.otherCompetitor == '') {
+          this.$toast('主营竞品品牌未填写');
+          return;
+        }
       } else {
         // 非同城分销店 经销商必填校验
         if (
@@ -1834,6 +1874,10 @@ export default {
       this.fromValue.myLat = this.location.lat;
       this.fromValue.myLon = this.location.lon;
       console.log(this.fromValue);
+      this.fromValue.storeCompetitorList =
+        this.otherCompetitor != ''
+          ? this.fromValue.storeCompetitorList.push(this.otherCompetitor)
+          : this.fromValue.storeCompetitorList;
       updateStore(this.fromValue).then((res) => {
         loading1.clear();
         if (res.code == 200) {
@@ -2127,5 +2171,12 @@ export default {
       }
     }
   }
+  .otherCompetitor {
+    padding: 10px 0px;
+    border-bottom: 1px solid #b6b6b6;
+    .van-cell__title {
+      width: 50px;
+    }
+  }
 }
 </style>