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

Merge branch 'feature_20260211_同城分销店-主营竞品品牌' into release

# Conflicts:
#	src/views/storeManagement/storeAdd.vue
zhujindu 12 часов назад
Родитель
Сommit
87a2ae24e8

+ 22 - 0
src/views/signApproval/newStoreApprovalDetail.vue

@@ -228,6 +228,22 @@
               v-if="item.dictValue == list.tcfxName"
               v-model="item.text" />
           </template>
+          <template>
+            <van-field
+              v-if="storeCompetitorList"
+              readonly
+              label="主营竞品品牌"
+              autosize
+              type="textarea"
+              v-model="storeCompetitorList" />
+            <van-field
+              v-if="list.otherCompetitor"
+              readonly
+              label="其他"
+              autosize
+              type="textarea"
+              v-model="list.otherCompetitor" />
+          </template>
         </van-tab>
       </van-tabs>
       <br />
@@ -345,6 +361,7 @@ export default {
       rejectMessage: '',
       displayImg: [],
       orderPrice: 0, //订单总金额
+      storeCompetitorList: '',
     };
   },
   activated() {
@@ -525,6 +542,11 @@ export default {
         localStorage.setItem('chainName', res.data.storeName);
         if (res.code == 200) {
           this.list = res.data;
+          if (this.list.storeCompetitorList) {
+            this.storeCompetitorList = this.list.storeCompetitorList.join(',');
+          } else {
+            this.list.storeCompetitorList = [];
+          }
           if (this.list.imgSed && this.list.imgSed != '') {
             this.displayImg = this.list.imgSed.split(',');
           } else {

+ 98 - 1
src/views/storeManagement/storeAdd.vue

@@ -402,7 +402,7 @@
           <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>
+              <p style="color: #666; font-size: 14px"><span class="van-f-red">*</span>属性</p>
               <div style="padding: 4px">
                 <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
                   <van-row gutter="20">
@@ -417,6 +417,39 @@
                   </van-row>
                 </van-radio-group>
               </div>
+              <!-- 主营竞品品牌 -->
+              <p style="color: #666; font-size: 14px">
+                <span class="van-f-red">*</span>主营竞品品牌
+              </p>
+              <div style="padding: 4px">
+                <van-checkbox-group
+                  v-model="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="其他"
+                  maxlength="20"
+                  autosize
+                  type="textarea"
+                  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 +829,8 @@ export default {
         managementModel: '',
         mainProjectType: '',
         mainRelationFrom: '',
+        storeCompetitorList: [],
+        otherCompetitor: '', //主营竞品品牌-其他
       },
       location: {
         lat: '34.6174',
@@ -849,10 +884,15 @@ export default {
       sfaStoreChainsContactList: [], //选中确定的经销商
       activatedTCFXList: [], //选中的经销商
       // addStoreType:null, //新增门店类型,TCFX:同城分销(包括分销店和金牌店);C917:潜在客户;C912:工地
+      storeCompetitorlist: [], //主营竞品品牌
+      otherCompetitor: '', //主营竞品品牌-其他
+      storeCompetitorList: [],
+      activatedStoreCompetitor: [],
     };
   },
   created() {
     this.getTCFXList();
+    this.getTCompetitiveProduct();
     this.getSJSList();
     this.getQGJZist();
     this.getpotentialCustomerTypeList();
@@ -926,12 +966,15 @@ export default {
           managementModel: '',
           mainProjectType: '',
           mainRelationFrom: '',
+          storeCompetitorList: [],
+          otherCompetitor: '', //主营竞品品牌-其他
         };
         setTimeout(() => {
           // this.getLocation()
         });
         this.fromValue.salesmanName = localStorage.getItem('nickName');
         this.getTCFXList();
+        this.getTCompetitiveProduct();
         this.getpotentialCustomerTypeList();
         this.getSJSList();
         this.getQGJZist();
@@ -1381,6 +1424,7 @@ export default {
       });
     },
     addVisits() {
+      // that.beforeAddFn(); //测试使用,,,,,
       var that = this;
       var map = new TMap.Map('allmap', {
         zoom: 15,
@@ -1507,6 +1551,12 @@ export default {
         this.TCFXList = TCFXList;
       });
     },
+    // 竞品品牌
+    getTCompetitiveProduct() {
+      getDictOption({}, 'main_competitor_brands').then((res) => {
+        this.storeCompetitorlist = res.data;
+      });
+    },
     getSJSList() {
       getSJSList({}).then((res) => {
         var SJSList = [];
@@ -1720,6 +1770,13 @@ export default {
       this.toastLoading(0, '上传中...', true);
       var fromValue = this.fromValue;
       var telrg = /^1[123456789]\d{9}$/;
+      if (
+        this.fromValue.storeCompetitorList == null ||
+        this.fromValue.storeCompetitorList == undefined
+      ) {
+        this.fromValue.storeCompetitorList = [];
+      }
+      this.activatedStoreCompetitor = [];
       if (fromValue.orgId == '') {
         this.$toast('部门未选择');
         return;
@@ -1827,6 +1884,22 @@ export default {
           this.$toast('属性未填写');
           return;
         }
+        if (!this.storeCompetitorList.length && !this.otherCompetitor) {
+          this.$toast('主营竞品品牌未填写');
+          return;
+        }
+        this.activatedStoreCompetitor = JSON.parse(JSON.stringify(this.storeCompetitorList));
+        if (this.otherCompetitor) {
+          if (this.otherCompetitor.length < 2) {
+            this.$toast('主营竞品品牌其他文本信息最少2个字');
+            return;
+          } else {
+            this.activatedStoreCompetitor.push(this.otherCompetitor);
+          }
+        }
+        this.fromValue.storeCompetitorList = JSON.parse(
+          JSON.stringify(this.activatedStoreCompetitor),
+        );
       } else {
         // 非同城分销店 经销商必填校验
         if (
@@ -2151,9 +2224,26 @@ export default {
   color: #1989fa;
   border-color: #1989fa !important;
 }
+.typeRadioStore1 .van-radio .van-radio__label {
+  font-size: 14px;
+}
 .typeRadioStore1 .van-radio[aria-checked='true'] .van-radio__label {
   color: #1989fa;
 }
+.typeRadioStore1 .van-checkbox__icon .van-icon {
+  border-color: #ccc !important;
+}
+.typeRadioStore1 .van-checkbox__icon--checked .van-icon {
+  background-color: transparent;
+  color: #1989fa;
+  border-color: #1989fa !important;
+}
+.typeRadioStore1 .van-checkbox .van-checkbox__label {
+  font-size: 14px;
+}
+.typeRadioStore1 .van-checkbox[aria-checked='true'] .van-checkbox__label {
+  color: #1989fa;
+}
 .morelaji .van-cell {
   padding: 10px 0;
 }
@@ -2195,5 +2285,12 @@ export default {
       }
     }
   }
+  .otherCompetitor {
+    padding: 10px 0px;
+    border-bottom: 1px solid #b6b6b6;
+    .van-cell__title {
+      width: 50px;
+    }
+  }
 }
 </style>

+ 30 - 7
src/views/storeManagement/storeDetail.vue

@@ -397,12 +397,29 @@
                 label="紧急联系人电话" />
             </div>
           </template>
-          <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow" v-else>
-            <van-field
-              readonly
-              label="属性"
-              v-if="item.dictValue == list.tcfxName"
-              v-model="item.text" />
+          <template v-else>
+            <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow">
+              <van-field
+                readonly
+                label="属性"
+                v-if="item.dictValue == list.tcfxName"
+                v-model="item.text" />
+            </template>
+            <template>
+              <van-field
+                readonly
+                label="主营竞品品牌"
+                autosize
+                type="textarea"
+                v-model="storeCompetitorList" />
+              <van-field
+                v-if="list.otherCompetitor"
+                readonly
+                label="其他"
+                autosize
+                type="textarea"
+                v-model="list.otherCompetitor" />
+            </template>
           </template>
         </van-tab>
       </van-tabs>
@@ -707,6 +724,7 @@ export default {
       orderList: [],
       cityABStore: false, //同城分销A/B店
       displayImg: [],
+      storeCompetitorList: '',
     };
   },
   watch: {
@@ -825,7 +843,7 @@ export default {
             styleId: 'abc',
             position: new TMap.LatLng(
               this.maplist[val].location.lat,
-              this.maplist[val].location.lng
+              this.maplist[val].location.lng,
             ),
           },
         ]);
@@ -1384,6 +1402,11 @@ export default {
               this.lon = res.data.lon;
             }
             this.list = res.data;
+            if (this.list.storeCompetitorList) {
+              this.storeCompetitorList = this.list.storeCompetitorList.join(',');
+            } else {
+              this.list.storeCompetitorList = [];
+            }
             if (this.list.imgSed && this.list.imgSed != '') {
               this.displayImg = this.list.imgSed.split(',');
             } else {

+ 100 - 11
src/views/storeManagement/storeEdit.vue

@@ -382,7 +382,7 @@
           <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>
+              <p style="color: #666; font-size: 14px"><span class="van-f-red">*</span>属性</p>
               <div style="padding: 4px">
                 <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
                   <van-row gutter="20">
@@ -399,6 +399,40 @@
                   </van-row>
                 </van-radio-group>
               </div>
+              <!-- 主营竞品品牌 -->
+              <p style="color: #666; font-size: 14px">
+                <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
+                  name="otherCompetitor"
+                  class="otherCompetitor"
+                  v-model="fromValue.otherCompetitor"
+                  autosize
+                  type="textarea"
+                  label="其他"
+                  maxlength="20"
+                  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 +789,8 @@ export default {
         managementModel: '',
         mainProjectType: '',
         mainRelationFrom: '',
+        storeCompetitorList: [],
+        otherCompetitor: '',
       },
       img: 'https://svs-test.oss-cn-shanghai.aliyuncs.com/1647398239620微信截图_20220315112921.png',
       location: {
@@ -815,6 +851,9 @@ export default {
       sfaStoreChainsContactList: [], //选中确定的经销商
       activatedTCFXList: [], //选中的经销商
       chainUser: false, //是否经销商用户 true
+      storeCompetitorlist: [], //主营竞品品牌
+      otherCompetitor: '', //主营竞品品牌-其他
+      activatedStoreCompetitor: [],
     };
   },
   activated() {
@@ -824,6 +863,7 @@ export default {
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.getTCFXList();
+      this.getTCompetitiveProduct();
       this.getSJSList();
       this.getQGJZist();
       this.getDetail();
@@ -872,10 +912,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 +933,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 +1290,7 @@ export default {
             }
             this.provinceList = provinceList;
           }
-        }
+        },
       );
     },
     getDetail() {
@@ -1277,6 +1315,7 @@ export default {
 
         if (res.code == 200) {
           this.fromValue = res.data;
+          this.fromValue.storeCompetitorList = this.fromValue.storeCompetitorList || [];
           this.sfaStoreChainsContactList = this.fromValue.sfaStoreChainsContactList;
           if (this.fromValue.imgSed && this.fromValue.imgSed != '') {
             this.displayImg = this.fromValue.imgSed.split(',');
@@ -1501,6 +1540,12 @@ export default {
         this.TCFXList = TCFXList;
       });
     },
+    // 竞品品牌
+    getTCompetitiveProduct() {
+      getDictOption({}, 'main_competitor_brands').then((res) => {
+        this.storeCompetitorlist = res.data;
+      });
+    },
     getSJSList() {
       getSJSList({}).then((res) => {
         var SJSList = [];
@@ -1700,7 +1745,11 @@ export default {
           }
         }
       }
-      var fromValue = this.fromValue;
+      var fromValue = JSON.parse(JSON.stringify(this.fromValue));
+      if (fromValue.storeCompetitorList == null || fromValue.storeCompetitorList == undefined) {
+        fromValue.storeCompetitorList = [];
+      }
+      this.activatedStoreCompetitor = [];
       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.orgId == '') {
         this.$toast('部门未选择');
@@ -1799,7 +1848,7 @@ export default {
         this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
       ) {
         // 同城分销多经销商
-        this.fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
+        fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
         if (!this.sfaStoreChainsContactList || !this.sfaStoreChainsContactList.length) {
           this.$toast('经销商未填写');
           return;
@@ -1812,6 +1861,22 @@ export default {
           this.$toast('图片未上传');
           return;
         }
+        if (!fromValue.storeCompetitorList.length && !fromValue.otherCompetitor) {
+          this.$toast('主营竞品品牌未填写');
+          return;
+        }
+        this.activatedStoreCompetitor = JSON.parse(
+          JSON.stringify(this.fromValue.storeCompetitorList),
+        );
+        if (this.fromValue.otherCompetitor) {
+          if (this.fromValue.otherCompetitor.length < 2) {
+            this.$toast('主营竞品品牌其他文本信息最少2个字');
+            return;
+          } else {
+            this.activatedStoreCompetitor.push(this.fromValue.otherCompetitor);
+          }
+        }
+        fromValue.storeCompetitorList = JSON.parse(JSON.stringify(this.activatedStoreCompetitor));
       } else {
         // 非同城分销店 经销商必填校验
         if (
@@ -1831,10 +1896,10 @@ export default {
         forbidClick: true,
       });
       // 当前定位复制
-      this.fromValue.myLat = this.location.lat;
-      this.fromValue.myLon = this.location.lon;
-      console.log(this.fromValue);
-      updateStore(this.fromValue).then((res) => {
+      fromValue.myLat = this.location.lat;
+      fromValue.myLon = this.location.lon;
+      console.log(fromValue);
+      updateStore(fromValue).then((res) => {
         loading1.clear();
         if (res.code == 200) {
           this.$dialog
@@ -2083,9 +2148,26 @@ export default {
   color: #1989fa;
   border-color: #1989fa !important;
 }
+.typeRadioStore1 .van-radio .van-radio__label {
+  font-size: 14px;
+}
 .typeRadioStore1 .van-radio[aria-checked='true'] .van-radio__label {
   color: #1989fa;
 }
+.typeRadioStore1 .van-checkbox__icon .van-icon {
+  border-color: #ccc !important;
+}
+.typeRadioStore1 .van-checkbox__icon--checked .van-icon {
+  background-color: transparent;
+  color: #1989fa;
+  border-color: #1989fa !important;
+}
+.typeRadioStore1 .van-checkbox .van-checkbox__label {
+  font-size: 14px;
+}
+.typeRadioStore1 .van-checkbox[aria-checked='true'] .van-checkbox__label {
+  color: #1989fa;
+}
 .morelaji .van-cell {
   padding: 10px 0;
 }
@@ -2127,5 +2209,12 @@ export default {
       }
     }
   }
+  .otherCompetitor {
+    padding: 10px 0px;
+    border-bottom: 1px solid #b6b6b6;
+    .van-cell__title {
+      width: 50px;
+    }
+  }
 }
 </style>