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

feature_20260211_同城分销店-主营竞品品牌

zhujindu 1 неделя назад
Родитель
Сommit
ed374d2003
2 измененных файлов с 103 добавлено и 12 удалено
  1. 48 8
      src/views/storeManagement/storeAdd.vue
  2. 55 4
      src/views/storeManagement/storeEdit.vue

+ 48 - 8
src/views/storeManagement/storeAdd.vue

@@ -420,18 +420,30 @@
               <!-- 主营竞品品牌 -->
               <!-- 主营竞品品牌 -->
               <p style="color: #666"><span class="van-f-red">*</span>主营竞品品牌</p>
               <p style="color: #666"><span class="van-f-red">*</span>主营竞品品牌</p>
               <div style="padding: 4px">
               <div style="padding: 4px">
-                <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
-                  <van-row gutter="20">
+                <van-checkbox-group
+                  v-model="fromValue.storeCompetitorList"
+                  direction="horizontal"
+                  class="typeRadioStore1">
+                  <van-row gutter="24">
                     <van-col
                     <van-col
                       span="12"
                       span="12"
-                      v-for="(item, index) in TCFXList"
-                      :key="index"
-                      style="margin-bottom: 10px"
-                      v-if="item.remark == fromValue.storeCategory">
-                      <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
+                      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-col>
                   </van-row>
                   </van-row>
-                </van-radio-group>
+                </van-checkbox-group>
+                <van-field
+                  class="otherCompetitor"
+                  v-model="otherCompetitor"
+                  label="其他"
+                  placeholder="请输入" />
               </div>
               </div>
             </div>
             </div>
             <div v-if="dictTypeAFormShow" style="background-color: #ffffff; padding: 10px">
             <div v-if="dictTypeAFormShow" style="background-color: #ffffff; padding: 10px">
@@ -812,6 +824,7 @@ export default {
         managementModel: '',
         managementModel: '',
         mainProjectType: '',
         mainProjectType: '',
         mainRelationFrom: '',
         mainRelationFrom: '',
+        storeCompetitorList: [],
       },
       },
       location: {
       location: {
         lat: '34.6174',
         lat: '34.6174',
@@ -866,6 +879,7 @@ export default {
       activatedTCFXList: [], //选中的经销商
       activatedTCFXList: [], //选中的经销商
       // addStoreType:null, //新增门店类型,TCFX:同城分销(包括分销店和金牌店);C917:潜在客户;C912:工地
       // addStoreType:null, //新增门店类型,TCFX:同城分销(包括分销店和金牌店);C917:潜在客户;C912:工地
       storeCompetitorlist: [], //主营竞品品牌
       storeCompetitorlist: [], //主营竞品品牌
+      otherCompetitor: '', //主营竞品品牌-其他
     };
     };
   },
   },
   created() {
   created() {
@@ -944,6 +958,7 @@ export default {
           managementModel: '',
           managementModel: '',
           mainProjectType: '',
           mainProjectType: '',
           mainRelationFrom: '',
           mainRelationFrom: '',
+          storeCompetitorList: [],
         };
         };
         setTimeout(() => {
         setTimeout(() => {
           // this.getLocation()
           // this.getLocation()
@@ -1400,6 +1415,7 @@ export default {
       });
       });
     },
     },
     addVisits() {
     addVisits() {
+      that.beforeAddFn(); //测试使用,,,,,
       var that = this;
       var that = this;
       var map = new TMap.Map('allmap', {
       var map = new TMap.Map('allmap', {
         zoom: 15,
         zoom: 15,
@@ -1532,6 +1548,15 @@ export default {
         this.storeCompetitorlist = res.data;
         this.storeCompetitorlist = res.data;
       });
       });
     },
     },
+    getSJSList() {
+      getSJSList({}).then((res) => {
+        var SJSList = [];
+        for (var t = 0; t < res.data.length; t++) {
+          SJSList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
+        }
+        this.SJSList = SJSList;
+      });
+    },
     getQGJZist() {
     getQGJZist() {
       getQGJZist({}).then((res) => {
       getQGJZist({}).then((res) => {
         var QGJZist = [];
         var QGJZist = [];
@@ -1847,6 +1872,10 @@ export default {
           this.$toast('属性未填写');
           this.$toast('属性未填写');
           return;
           return;
         }
         }
+        if (!fromValue.storeCompetitorList.length && this.otherCompetitor == '') {
+          this.$toast('主营竞品品牌未填写');
+          return;
+        }
       } else {
       } else {
         // 非同城分销店 经销商必填校验
         // 非同城分销店 经销商必填校验
         if (
         if (
@@ -1898,6 +1927,10 @@ export default {
               })
               })
               .then(() => {
               .then(() => {
                 this.toastLoading(0, '上传中...', true);
                 this.toastLoading(0, '上传中...', true);
+                this.fromValue.storeCompetitorList =
+                  this.otherCompetitor != ''
+                    ? this.fromValue.storeCompetitorList.push(this.otherCompetitor)
+                    : this.fromValue.storeCompetitorList;
                 this.addStoreFun();
                 this.addStoreFun();
               });
               });
           }
           }
@@ -2215,5 +2248,12 @@ export default {
       }
       }
     }
     }
   }
   }
+  .otherCompetitor {
+    padding: 10px 0px;
+    border-bottom: 1px solid #b6b6b6;
+    .van-cell__title {
+      width: 50px;
+    }
+  }
 }
 }
 </style>
 </style>

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

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