Explorar o código

经销商拜访

zhujindu hai 9 meses
pai
achega
1db6324af2
Modificáronse 4 ficheiros con 83 adicións e 76 borrados
  1. 7 7
      .env.test
  2. 1 1
      src/router/index.js
  3. 73 65
      src/views/home/index.vue
  4. 2 3
      vue.config.js

+ 7 - 7
.env.test

@@ -3,15 +3,15 @@ VUE_APP_TITLE = 经销商拜访
 ENV = 'test'
 
 # 本地开发环境配置
-VUE_APP_Target=http://192.168.100.190:9560/
-VUE_APP_SSB_LINK=http://suishenbangtest.nipponpaint.com.cn
-VUE_APP_XD_LINK=http://b2btest.nipponpaint.com.cn
-VUE_APP_BASE_API = '/'
-#测试环境
-# VUE_APP_Target=https://ssbsfatest.nipponpaint.com.cn
+# VUE_APP_Target=http://192.168.100.190:9560/
 # VUE_APP_SSB_LINK=http://suishenbangtest.nipponpaint.com.cn
 # VUE_APP_XD_LINK=http://b2btest.nipponpaint.com.cn
-# VUE_APP_BASE_API = '/ssbsfa/'
+# VUE_APP_BASE_API = '/'
+#测试环境
+VUE_APP_Target=https://ssbsfatest.nipponpaint.com.cn
+VUE_APP_SSB_LINK=http://suishenbangtest.nipponpaint.com.cn
+VUE_APP_XD_LINK=http://b2btest.nipponpaint.com.cn
+VUE_APP_BASE_API = '/ssbsfa/'
 
 # 正式环境
 # VUE_APP_Target=https://ssbsfa.nipponpaint.com.cn

+ 1 - 1
src/router/index.js

@@ -16,7 +16,7 @@ const router = new VueRouter({
   //     return { x: 0, y: 0 };
   //   }
   // },
-  base: '/mobile/',
+  base: '/agent/',
 
   routes: [
     {

+ 73 - 65
src/views/home/index.vue

@@ -538,6 +538,7 @@ export default {
     },
     // 进入拜访
     storeVisit(val) {
+      this.toastLoading(0, '加载中...', true);
       localStorage.setItem('tabVal', this.tabVal);
       localStorage.removeItem('visitId');
       this.buryingPoint({
@@ -551,6 +552,7 @@ export default {
         localStorage.setItem('startTime', new Date());
         localStorage.setItem('ORGName', val.deptName);
         localStorage.setItem('chainNameR', val.chainName);
+        this.toastLoading().clear();
         this.$router.push({
           path: '/visitPage',
           query: {
@@ -593,6 +595,7 @@ export default {
             this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
           })
           .catch((error) => {
+            this.toastLoading().clear();
             this.$dialog.alert({
               message: error,
             });
@@ -604,80 +607,85 @@ export default {
         chainCode: val.chainCode,
         lon: location.lon,
         lat: location.lat,
-      }).then((response) => {
-        if (val.lat == '' || val.lat == null) {
-          this.lat = location.lat;
-          this.lon = location.lon;
-        }
-        let PointSumval = this.twoPointSum(
-          location.lat,
-          location.lon,
-          location.lat,
-          location.lon
-        ).toFixed(2);
-        //  直接进入拜访 不校验经纬度
-        // localStorage.setItem('startTime', new Date());
-        // localStorage.setItem('ORGName', val.deptName);
-        // localStorage.setItem('chainNameR', val.chainName);
-        // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-        // return;
-        // 门店校验 地址不通过
-        if (response.code != 200) {
-          // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
-          if (response.data.updateAddress == 0) {
-            // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
-            this.$dialog
-              .confirm({
-                confirmButtonText: '确定拜访',
-                cancelButtonText: '取消拜访',
-                title: '系统提示',
-                message:
-                  '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
-                closeOnClickOverlay: true,
-              })
-              .then(() => {
-                this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-              });
-          } else if (response.data.updateAddress == 1) {
-            // 同城AB+金牌,去修改地址
-            // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
-            if (!response.data.addressUpdateTimesOver) {
+      })
+        .then((response) => {
+          this.toastLoading().clear();
+          if (val.lat == '' || val.lat == null) {
+            this.lat = location.lat;
+            this.lon = location.lon;
+          }
+          let PointSumval = this.twoPointSum(
+            location.lat,
+            location.lon,
+            location.lat,
+            location.lon
+          ).toFixed(2);
+          //  直接进入拜访 不校验经纬度
+          // localStorage.setItem('startTime', new Date());
+          // localStorage.setItem('ORGName', val.deptName);
+          // localStorage.setItem('chainNameR', val.chainName);
+          // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
+          // return;
+          // 门店校验 地址不通过
+          if (response.code != 200) {
+            // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
+            if (response.data.updateAddress == 0) {
+              // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
               this.$dialog
                 .confirm({
+                  confirmButtonText: '确定拜访',
+                  cancelButtonText: '取消拜访',
                   title: '系统提示',
-                  message: response.msg + '请立即修改后再拜访',
-                  messageAlign: 'left',
-                  confirmButtonText: '立即修改',
-                  cancelButtonText: '取消',
+                  message:
+                    '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
+                  closeOnClickOverlay: true,
                 })
                 .then(() => {
-                  this.$router.push({
-                    path: '/storeDetail',
-                    query: {
-                      id: val.chainId,
-                      type: 'address',
-                      storeAddressId: val.storeAddressId,
-                    },
+                  this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
+                });
+            } else if (response.data.updateAddress == 1) {
+              // 同城AB+金牌,去修改地址
+              // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
+              if (!response.data.addressUpdateTimesOver) {
+                this.$dialog
+                  .confirm({
+                    title: '系统提示',
+                    message: response.msg + '请立即修改后再拜访',
+                    messageAlign: 'left',
+                    confirmButtonText: '立即修改',
+                    cancelButtonText: '取消',
+                  })
+                  .then(() => {
+                    this.$router.push({
+                      path: '/storeDetail',
+                      query: {
+                        id: val.chainId,
+                        type: 'address',
+                        storeAddressId: val.storeAddressId,
+                      },
+                    });
                   });
+              } else {
+                this.$dialog.confirm({
+                  title: '系统提示',
+                  message: '已经达到最大修改次数',
+                  messageAlign: 'left',
+                  confirmButtonText: '确定',
                 });
-            } else {
-              this.$dialog.confirm({
-                title: '系统提示',
-                message: '已经达到最大修改次数',
-                messageAlign: 'left',
-                confirmButtonText: '确定',
-              });
+              }
+            } else if (response.data.updateAddress == 2) {
+              // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
+              this.resetCoord(res, val, location, PointSumval);
+              return;
             }
-          } else if (response.data.updateAddress == 2) {
-            // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
-            this.resetCoord(res, val, location, PointSumval);
-            return;
+          } else {
+            // 门店编码校验门店地址通过 进入拜访
+            this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
           }
-        } else {
-          // 门店编码校验门店地址通过 进入拜访
-          this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-        }
-      });
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
     },
     // 重置经纬度
     resetCoord(res, val, location, PointSumval) {

+ 2 - 3
vue.config.js

@@ -6,9 +6,8 @@ function resolve(dir) {
 const name = process.env.VUE_APP_TITLE || '经销商拜访'; // 网页标题
 const port = 9999; // 端口
 module.exports = {
-  // publicPath: process.env.NODE_ENV === "production" ? "/mobile/" : "/",
-  publicPath: '/mobile/',
-  outputDir: 'mobile',
+  publicPath: '/agent/',
+  outputDir: 'agent',
   assetsDir: 'static',
   lintOnSave: false,
   productionSourceMap: false,