Browse Source

计划内、计划外-我的、计划外-销售部,增 下拉刷新功能

zhujindu 20 hours ago
parent
commit
db02d43e96
2 changed files with 11 additions and 12 deletions
  1. 8 8
      src/views/deviceOutside/index.vue
  2. 3 4
      src/views/deviceWithin/index.vue

+ 8 - 8
src/views/deviceOutside/index.vue

@@ -1222,10 +1222,6 @@ export default {
     getUserOrgStoreList() {
       this.storeType = localStorage.getItem('storeType');
       this.endShow = false;
-      if (this.refreshing) {
-        this.list = [];
-        this.refreshing = false;
-      }
       var that = this;
       this.disabled = true;
       this.toastLoading(0, '加载中...', true);
@@ -1241,6 +1237,9 @@ export default {
         genDate: this.genDate,
       }).then((res) => {
         this.disabled = false;
+        if (this.refreshing) {
+          this.refreshing = false;
+        }
         this.toastLoading().clear();
         if (res.code == 200) {
           this.loading = false;
@@ -1268,6 +1267,7 @@ export default {
             this.showPopoverZ.push({ showPopover: false });
           });
         } else {
+          this.list = [];
           this.$toast(res.msg);
         }
       });
@@ -1304,10 +1304,6 @@ export default {
         forbidClick: true,
       });
       this.endShow = false;
-      if (this.refreshing) {
-        this.list = [];
-        this.refreshing = false;
-      }
       getUserOutPlaList({
         lat: that.lat,
         lon: that.lon,
@@ -1320,6 +1316,9 @@ export default {
         genDate: this.genDate,
       }).then((res) => {
         this.disabled = false;
+        if (this.refreshing) {
+          this.refreshing = false;
+        }
         if (res.code == 200) {
           loading3.clear();
           this.loading = false;
@@ -1343,6 +1342,7 @@ export default {
             this.showPopoverZ.push({ showPopover: false });
           });
         } else {
+          this.list = [];
           this.$toast(res.msg);
         }
       });

+ 3 - 4
src/views/deviceWithin/index.vue

@@ -643,7 +643,6 @@ export default {
   },
   methods: {
     onRefresh() {
-      this.list = [];
       this.getUserInPlanList();
     },
     closePopup(flag, filterParams) {
@@ -884,9 +883,6 @@ export default {
     },
     getUserInPlanListFun(TXisBD) {
       this.toastLoading(0, '加载中...', true);
-      if (this.refreshing) {
-        this.refreshing = false;
-      }
       getUserInPlanList({
         storeName: this.storeName.trim(),
         genDate: this.genDate,
@@ -895,6 +891,9 @@ export default {
         ...this.filterParams,
       }).then((res) => {
         this.toastLoading().clear();
+        if (this.refreshing) {
+          this.refreshing = false;
+        }
         if (res.code == 200) {
           this.list = res.data;
           this.list.forEach((item) => {