浏览代码

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

zhujindu 2 天之前
父节点
当前提交
f2dbc6b4cc
共有 2 个文件被更改,包括 29 次插入22 次删除
  1. 13 8
      src/views/storeManagement/storeAdd.vue
  2. 16 14
      src/views/storeManagement/storeEdit.vue

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

@@ -421,7 +421,7 @@
               <p style="color: #666"><span class="van-f-red">*</span>主营竞品品牌</p>
               <div style="padding: 4px">
                 <van-checkbox-group
-                  v-model="fromValue.storeCompetitorList"
+                  v-model="storeCompetitorList"
                   direction="horizontal"
                   class="typeRadioStore1">
                   <van-row gutter="24">
@@ -441,7 +441,7 @@
                 </van-checkbox-group>
                 <van-field
                   class="otherCompetitor"
-                  v-model="fromValue.otherCompetitor"
+                  v-model="otherCompetitor"
                   label="其他"
                   maxlength="20"
                   autosize
@@ -828,7 +828,7 @@ export default {
         mainProjectType: '',
         mainRelationFrom: '',
         storeCompetitorList: [],
-        otherCompetitor: '',
+        otherCompetitor: '', //主营竞品品牌-其他
       },
       location: {
         lat: '34.6174',
@@ -884,6 +884,8 @@ export default {
       // addStoreType:null, //新增门店类型,TCFX:同城分销(包括分销店和金牌店);C917:潜在客户;C912:工地
       storeCompetitorlist: [], //主营竞品品牌
       otherCompetitor: '', //主营竞品品牌-其他
+      storeCompetitorList: [],
+      activatedStoreCompetitor: [],
     };
   },
   created() {
@@ -961,7 +963,7 @@ export default {
           mainProjectType: '',
           mainRelationFrom: '',
           storeCompetitorList: [],
-          otherCompetitor: '',
+          otherCompetitor: '', //主营竞品品牌-其他
         };
         setTimeout(() => {
           // this.getLocation()
@@ -1771,6 +1773,7 @@ export default {
       ) {
         this.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('部门未选择');
@@ -1883,18 +1886,20 @@ export default {
           this.$toast('属性未填写');
           return;
         }
-        if (!fromValue.storeCompetitorList.length && !fromValue.otherCompetitor) {
+        if (!this.storeCompetitorList.length && !this.otherCompetitor) {
           this.$toast('主营竞品品牌未填写');
           return;
         }
-        if (this.fromValue.otherCompetitor) {
-          if (this.fromValue.otherCompetitor.length < 2) {
+        this.activatedStoreCompetitor = this.storeCompetitorList;
+        if (this.otherCompetitor) {
+          if (this.otherCompetitor.length < 2) {
             this.$toast('主营竞品品牌其他文本信息最少2个字');
             return;
           } else {
-            this.fromValue.storeCompetitorList.push(this.fromValue.otherCompetitor);
+            this.activatedStoreCompetitor.push(this.otherCompetitor);
           }
         }
+        this.fromValue.storeCompetitorList = this.activatedStoreCompetitor;
       } else {
         // 非同城分销店 经销商必填校验
         if (

+ 16 - 14
src/views/storeManagement/storeEdit.vue

@@ -788,6 +788,7 @@ export default {
         mainProjectType: '',
         mainRelationFrom: '',
         storeCompetitorList: [],
+        otherCompetitor: '',
       },
       img: 'https://svs-test.oss-cn-shanghai.aliyuncs.com/1647398239620微信截图_20220315112921.png',
       location: {
@@ -850,6 +851,7 @@ export default {
       chainUser: false, //是否经销商用户 true
       storeCompetitorlist: [], //主营竞品品牌
       otherCompetitor: '', //主营竞品品牌-其他
+      activatedStoreCompetitor: [],
     };
   },
   activated() {
@@ -1740,13 +1742,11 @@ export default {
           }
         }
       }
-      var fromValue = this.fromValue;
-      if (
-        this.fromValue.storeCompetitorList == null ||
-        this.fromValue.storeCompetitorList == undefined
-      ) {
-        this.fromValue.storeCompetitorList = [];
+      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('部门未选择');
@@ -1862,6 +1862,16 @@ export default {
           this.$toast('主营竞品品牌未填写');
           return;
         }
+        this.activatedStoreCompetitor = 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 = this.activatedStoreCompetitor;
       } else {
         // 非同城分销店 经销商必填校验
         if (
@@ -1884,14 +1894,6 @@ export default {
       this.fromValue.myLat = this.location.lat;
       this.fromValue.myLon = this.location.lon;
       console.log(this.fromValue);
-      if (this.fromValue.otherCompetitor) {
-        if (this.fromValue.otherCompetitor.length < 2) {
-          this.$toast('主营竞品品牌其他文本信息最少2个字');
-          return;
-        } else {
-          this.fromValue.storeCompetitorList.push(this.fromValue.otherCompetitor);
-        }
-      }
       updateStore(this.fromValue).then((res) => {
         loading1.clear();
         if (res.code == 200) {