Browse Source

Merge branch 'feature_20250205_重复门店经销商维护' into uat(dev)

zhujindu 9 months ago
parent
commit
6e1d15095b
2 changed files with 20 additions and 81 deletions
  1. 11 72
      src/views/storeManagement/storeDetail.vue
  2. 9 9
      src/views/storeManagement/storeEdit.vue

+ 11 - 72
src/views/storeManagement/storeDetail.vue

@@ -541,6 +541,7 @@ import { updateStoreAddress, valid } from '@/api/visitstore';
 import uploadImg from '@/components/viewaddreddUploadImg.vue';
 import uploadImg from '@/components/viewaddreddUploadImg.vue';
 import helpPage from './helpPage.vue';
 import helpPage from './helpPage.vue';
 import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
 import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
+import { getOrderUrlByStoreId } from '@/api/inventory';
 export default {
 export default {
   components: { uploadImg, mapmarker, viewUploadImg, helpPage },
   components: { uploadImg, mapmarker, viewUploadImg, helpPage },
   data() {
   data() {
@@ -1512,80 +1513,18 @@ export default {
         message: '加载中...',
         message: '加载中...',
         forbidClick: true,
         forbidClick: true,
       });
       });
-      addStore(this.list).then((res) => {
+      getOrderUrlByStoreId({
+        storeId: this.$route.query.id,
+        from: 'storeDetail',
+      }).then((res) => {
         loading1.clear();
         loading1.clear();
-        if (res.code == 200) {
-          if (res.data.serverCode) {
-            if (
-              res.data.orderUrl != null &&
-              (res.data.orderUrl != '') & (res.data.orderUrl != undefined)
-            ) {
-              window.location.replace(res.data.orderUrl);
-            } else {
-              checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
-                localStorage.setItem('startTime', new Date());
-                localStorage.setItem('ORGName', this.list.deptName);
-                localStorage.setItem('chainNameR', this.list.storeName);
-                if (response.code == 200) {
-                  that.$dialog
-                    .confirm({
-                      title: '系统提示',
-                      message: '建店成功,是否立即拜访?',
-                      confirmButtonText: '立即拜访',
-                      cancelButtonText: '返回上一页',
-                    })
-                    .then(() => {
-                      localStorage.setItem('startTime', new Date());
-                      localStorage.setItem('ORGName', res.data.sfaStore.deptName);
-                      localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
-                      window.location.replace(
-                        window.location.origin +
-                          '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
-                          res.data.sfaStore.storeId +
-                          '&lat=' +
-                          that.list.lat +
-                          '&lon=' +
-                          that.list.lon +
-                          '&addressLine=' +
-                          that.list.addressLine +
-                          '&storeCategory=' +
-                          res.data.sfaStore.storeCategory +
-                          '&storeName=' +
-                          that.list.storeName +
-                          '&contactName=' +
-                          that.list.contactName +
-                          '&storeCode=' +
-                          res.data.sfaStore.storeCode +
-                          '&latNew=' +
-                          that.list.lat +
-                          '&lonNew=' +
-                          that.list.lon
-                      );
-                    })
-                    .catch(() => {
-                      that.$router.go(-2);
-                    });
-                } else {
-                  that.$dialog
-                    .alert({
-                      title: '系统提示',
-                      message: response.msg,
-                    })
-                    .then((res) => {});
-                }
-              });
-            }
-          } else {
-            this.list.storeCode = res.data.sfaStore.storeCode;
-            this.list.storeId = res.data.sfaStore.storeId;
-            this.$dialog.alert({
-              title: '系统提示',
-              message: res.data.serverMsg,
-            });
-          }
+        if (res.code == 200 && res.data) {
+          window.location.href = res.data;
         } else {
         } else {
-          this.msgList = res.msg;
-          this.showDialog = true;
+          this.Toast({
+            message: res.msg,
+            duration: 5000,
+          });
         }
         }
       });
       });
     },
     },

+ 9 - 9
src/views/storeManagement/storeEdit.vue

@@ -59,11 +59,7 @@
                 ">
                 ">
                 <van-row style="border-bottom: 1px solid #ebedf0">
                 <van-row style="border-bottom: 1px solid #ebedf0">
                   <van-col span="24">
                   <van-col span="24">
-                    <van-field
-                      label="经销商名称"
-                      :readonly="chainUser == 'true'"
-                      @click="showPickerChainsListFn"
-                      class="TCFXList">
+                    <van-field label="经销商名称" @click="showPickerChainsListFn" class="TCFXList">
                       <template #left-icon>
                       <template #left-icon>
                         <span class="van-f-red">*</span>
                         <span class="van-f-red">*</span>
                       </template>
                       </template>
@@ -822,7 +818,7 @@ export default {
     };
     };
   },
   },
   activated() {
   activated() {
-    this.chainUser = localStorage.getItem('chainUser');
+    this.chainUser = localStorage.getItem('chainUser'); //经销商人员(包含分销、先锋)
     this.tabVal = 'insidePlan';
     this.tabVal = 'insidePlan';
     this.treeSelect = [];
     this.treeSelect = [];
     // 授权
     // 授权
@@ -1470,6 +1466,7 @@ export default {
         });
         });
     },
     },
     showPickerChainsListFn() {
     showPickerChainsListFn() {
+      if (this.chainUser == 'true') return;
       if (this.fromValue.storeCategoryName == '') {
       if (this.fromValue.storeCategoryName == '') {
         this.$toast('类型未选择');
         this.$toast('类型未选择');
         return;
         return;
@@ -1654,9 +1651,12 @@ export default {
         this.fromValue.ifJzStoreType = value.ifJzStoreType;
         this.fromValue.ifJzStoreType = value.ifJzStoreType;
         this.getChainsByDeptCode(null, value.ifJzStoreType);
         this.getChainsByDeptCode(null, value.ifJzStoreType);
         // 切换门店类型删除选定经销商
         // 切换门店类型删除选定经销商
-        this.treeSelect = [];
-        this.sfaStoreChainsContactList = []; //选中确定的经销商
-        this.activatedTCFXList = []; //选中的经销商
+        // 同城分销人员禁止切换经销商
+        if (this.chainUser == 'false') {
+          this.treeSelect = [];
+          this.sfaStoreChainsContactList = []; //选中确定的经销商
+          this.activatedTCFXList = []; //选中的经销商
+        }
         this.showPicker = false;
         this.showPicker = false;
       }
       }
       if (value.dictValue == 'C912') {
       if (value.dictValue == 'C912') {