zhujindu 10 ay önce
ebeveyn
işleme
3f1f0ed307
1 değiştirilmiş dosya ile 156 ekleme ve 153 silme
  1. 156 153
      src/views/storeManagement/storeDetail.vue

+ 156 - 153
src/views/storeManagement/storeDetail.vue

@@ -1219,175 +1219,179 @@ export default {
       ImagePreview(val.split(','));
     },
     getStoreType() {
+      this.toastLoading(0, '加载中...', true);
       // 先授权
-      getTicketFun().then(() => {
-        if (localStorage.getItem('storeType') == '2') {
-          this.DIYshow = true;
-          getStoreyslTypeList({}).then((res) => {
-            this.storeTypeList = res.data;
-            this.getDetail();
-          });
-        } else {
-          this.DIYshow = false;
-          getStoreTypeList({}).then((res) => {
-            this.storeTypeList = res.data;
-            this.getDetail();
-          });
-        }
-      });
+      getTicketFun()
+        .then(() => {
+          if (localStorage.getItem('storeType') == '2') {
+            this.DIYshow = true;
+            getStoreyslTypeList({}).then((res) => {
+              this.storeTypeList = res.data;
+              this.getDetail();
+            });
+          } else {
+            this.DIYshow = false;
+            getStoreTypeList({}).then((res) => {
+              this.storeTypeList = res.data;
+              this.getDetail();
+            });
+          }
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
     },
     getDetail() {
       this.pageShow = false;
       this.lat = '';
       this.lon = '';
-      let loading1 = this.$toast.loading({
-        duration: 0,
-        message: '加载中...',
-        forbidClick: true,
-      });
-      getById({ storeId: this.$route.query.id }).then((res) => {
-        loading1.clear();
-        localStorage.setItem('locationRemark', res.data.addressLine);
-        localStorage.setItem('orgName', res.data.orgName);
-        localStorage.setItem('chainName', res.data.storeName);
-        if (res.code == 200) {
-          if (res.data.lat != null) {
-            this.lat = res.data.lat;
-            this.lon = res.data.lon;
-          }
-          this.list = res.data;
-          if (this.list.imgSed && this.list.imgSed != '') {
-            this.displayImg = this.list.imgSed.split(',');
-          } else {
-            this.displayImg = [];
-          }
-          if (
-            this.verifyStoreType(this.list.storeCategory) &&
-            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
-          ) {
-            this.cityABStore = true;
-          } else {
-            this.cityABStore = false;
-          }
-          if (
-            res.data.province != null &&
-            res.data.province != undefined &&
-            res.data.province != ''
-          ) {
-            this.getStreetQuery('1');
-          }
-          if (res.data.city != null && res.data.city != undefined && res.data.city != '') {
-            this.getStreetQuery('2');
-          }
-          if (
-            res.data.district != null &&
-            res.data.district != undefined &&
-            res.data.district != ''
-          ) {
-            this.getStreetQuery('3');
-          }
-          if (this.list.carShopImgList != null) {
-          } else {
-            this.list.carShopImgList = [];
-          }
-          if (
-            this.verifyStoreType(this.list.storeCategory) &&
-            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
-          ) {
-            this.typeABshow = true;
-          } else {
-            this.typeABshow = false;
-          }
-          if (this.list.storeCategory == 'C917') {
-            this.GZAttributeFormShow = true;
-            this.dictTypeSJSFormShow = false;
-            this.dictTypeQGJZFormShow = false;
-            this.dictTypeFormShow = false;
-            this.dictTypeAFormShow = false;
-            this.typeABshow = false;
-            for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
-              if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
-                this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
+      getById({ storeId: this.$route.query.id })
+        .then((res) => {
+          localStorage.setItem('locationRemark', res.data.addressLine);
+          localStorage.setItem('orgName', res.data.orgName);
+          localStorage.setItem('chainName', res.data.storeName);
+          this.toastLoading().clear();
+          if (res.code == 200) {
+            if (res.data.lat != null) {
+              this.lat = res.data.lat;
+              this.lon = res.data.lon;
+            }
+            this.list = res.data;
+            if (this.list.imgSed && this.list.imgSed != '') {
+              this.displayImg = this.list.imgSed.split(',');
+            } else {
+              this.displayImg = [];
+            }
+            if (
+              this.verifyStoreType(this.list.storeCategory) &&
+              this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+            ) {
+              this.cityABStore = true;
+            } else {
+              this.cityABStore = false;
+            }
+            if (
+              res.data.province != null &&
+              res.data.province != undefined &&
+              res.data.province != ''
+            ) {
+              this.getStreetQuery('1');
+            }
+            if (res.data.city != null && res.data.city != undefined && res.data.city != '') {
+              this.getStreetQuery('2');
+            }
+            if (
+              res.data.district != null &&
+              res.data.district != undefined &&
+              res.data.district != ''
+            ) {
+              this.getStreetQuery('3');
+            }
+            if (this.list.carShopImgList != null) {
+            } else {
+              this.list.carShopImgList = [];
+            }
+            if (
+              this.verifyStoreType(this.list.storeCategory) &&
+              this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+            ) {
+              this.typeABshow = true;
+            } else {
+              this.typeABshow = false;
+            }
+            if (this.list.storeCategory == 'C917') {
+              this.GZAttributeFormShow = true;
+              this.dictTypeSJSFormShow = false;
+              this.dictTypeQGJZFormShow = false;
+              this.dictTypeFormShow = false;
+              this.dictTypeAFormShow = false;
+              this.typeABshow = false;
+              for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
+                if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
+                  this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
+                }
               }
+            } else {
+              this.GZAttributeFormShow = false;
             }
-          } else {
-            this.GZAttributeFormShow = false;
-          }
-          // if (this.list.storeCategory == '129081') {
-          //   this.dictTypeFormShow = true;
-          //   if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
-          //     this.list.tcfxName = this.list.attribute3;
-          //   } else {
-          //     this.list.tcfxName = this.list.attribute5;
-          //   }
-          // }
-          if (
-            this.verifyStoreType(this.list.storeCategory) &&
-            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
-          ) {
-            this.dictTypeFormShow = true;
-            for (var k = 0; k < this.TCFXList.length; k++) {
-              if (this.TCFXList[k].dictCode == this.list.tcfxName) {
-                this.list.tcfxName = this.TCFXList[k].text;
+            // if (this.list.storeCategory == '129081') {
+            //   this.dictTypeFormShow = true;
+            //   if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
+            //     this.list.tcfxName = this.list.attribute3;
+            //   } else {
+            //     this.list.tcfxName = this.list.attribute5;
+            //   }
+            // }
+            if (
+              this.verifyStoreType(this.list.storeCategory) &&
+              this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+            ) {
+              this.dictTypeFormShow = true;
+              for (var k = 0; k < this.TCFXList.length; k++) {
+                if (this.TCFXList[k].dictCode == this.list.tcfxName) {
+                  this.list.tcfxName = this.TCFXList[k].text;
+                }
               }
             }
-          }
 
-          if (this.list.storeCategory == 'sjs61') {
-            this.dictTypeFormShow = true;
-            for (var k = 0; k < this.SJSList.length; k++) {
-              if (this.SJSList[k].dictCode == this.list.tcfxName) {
-                this.list.tcfxName = this.SJSList[k].text;
+            if (this.list.storeCategory == 'sjs61') {
+              this.dictTypeFormShow = true;
+              for (var k = 0; k < this.SJSList.length; k++) {
+                if (this.SJSList[k].dictCode == this.list.tcfxName) {
+                  this.list.tcfxName = this.SJSList[k].text;
+                }
               }
             }
-          }
-          if (this.list.storeCategory == 'zyjz63') {
-            this.dictTypeFormShow = true;
-            for (var k = 0; k < this.QGJZist.length; k++) {
-              if (this.QGJZist[k].dictCode == this.list.tcfxName) {
-                this.list.tcfxName = this.QGJZist[k].text;
+            if (this.list.storeCategory == 'zyjz63') {
+              this.dictTypeFormShow = true;
+              for (var k = 0; k < this.QGJZist.length; k++) {
+                if (this.QGJZist[k].dictCode == this.list.tcfxName) {
+                  this.list.tcfxName = this.QGJZist[k].text;
+                }
               }
             }
-          }
-          if (this.list.storeCategory == 'C912') {
-            this.storeTypePOP = false;
-            this.storeName = '铭牌上项目名称';
-            this.address = '地址';
-          } else if (this.list.storeCategory == 'C917') {
-            this.storeTypePOP = false;
-            this.storeName = '名称';
-            this.address = '地址';
+            if (this.list.storeCategory == 'C912') {
+              this.storeTypePOP = false;
+              this.storeName = '铭牌上项目名称';
+              this.address = '地址';
+            } else if (this.list.storeCategory == 'C917') {
+              this.storeTypePOP = false;
+              this.storeName = '名称';
+              this.address = '地址';
+            } else {
+              this.storeTypePOP = true;
+              this.storeName = '名称';
+              this.address = '地址';
+            }
+            // 获取定位
+            getPosition()
+              .then((res) => {
+                let { TXisBD, resData } = res;
+                this.lat = TXisBD.lat;
+                this.lon = TXisBD.lon;
+                this.myLat = TXisBD.lat;
+                this.myLon = TXisBD.lon;
+                this.list.lon = TXisBD.lon;
+                this.list.lat = TXisBD.lat;
+              })
+              .catch((err) => {
+                console.log(err);
+              });
+            // 同城店铺 未结案时获取
+            if (this.list.approvalStatus == 0 && this.cityABStore) {
+              // 获取门店订单
+              this.getStoreOrderList(this.list.storeCode);
+              // 获取审批历史
+              this.storeApprovaHistoryFun();
+            }
+            this.pageShow = true;
           } else {
-            this.storeTypePOP = true;
-            this.storeName = '名称';
-            this.address = '地址';
+            this.$toast.fail(res.msg);
           }
-          // 获取定位
-          getPosition()
-            .then((res) => {
-              let { TXisBD, resData } = res;
-              this.lat = TXisBD.lat;
-              this.lon = TXisBD.lon;
-              this.myLat = TXisBD.lat;
-              this.myLon = TXisBD.lon;
-              this.list.lon = TXisBD.lon;
-              this.list.lat = TXisBD.lat;
-            })
-            .catch((err) => {
-              console.log(err);
-            });
-          // 同城店铺 未结案时获取
-          if (this.list.approvalStatus == 0 && this.cityABStore) {
-            // 获取门店订单
-            this.getStoreOrderList(this.list.storeCode);
-            // 获取审批历史
-            this.storeApprovaHistoryFun();
-          }
-          this.pageShow = true;
-        } else {
-          this.$toast.fail(res.msg);
-        }
-      });
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
     },
     // 获取门店订单
     getStoreOrderList(storeCode) {
@@ -1604,7 +1608,6 @@ export default {
       submitApproval({
         storeId: this.list.storeId, // 店铺id
       }).then((res) => {
-        this.toastLoading().clear();
         if (res.code == 200) {
           this.$toast.success('提交成功');
           this.getDetail();