Преглед на файлове

重复门店经销商维护

zhujindu преди 9 месеца
родител
ревизия
99a86c6c88
променени са 1 файла, в които са добавени 11 реда и са изтрити 72 реда
  1. 11 72
      src/views/storeManagement/storeDetail.vue

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

@@ -529,6 +529,7 @@ import { updateStoreAddress, valid } from '@/api/visitstore';
 import uploadImg from '@/components/viewaddreddUploadImg.vue';
 import helpPage from './helpPage.vue';
 import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
+import { getOrderUrlByStoreId } from '@/api/inventory';
 export default {
   components: { uploadImg, mapmarker, viewUploadImg, helpPage },
   data() {
@@ -1499,80 +1500,18 @@ export default {
         message: '加载中...',
         forbidClick: true,
       });
-      addStore(this.list).then((res) => {
+      getOrderUrlByStoreId({
+        storeId: this.$route.query.id,
+        from: 'storeDetail',
+      }).then((res) => {
         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 {
-          this.msgList = res.msg;
-          this.showDialog = true;
+          this.Toast({
+            message: res.msg,
+            duration: 5000,
+          });
         }
       });
     },