Jelajahi Sumber

优化带条件的订单查询数据渲染一直loading的问题

cgp 3 hari lalu
induk
melakukan
ce06311dc0
1 mengubah file dengan 6 tambahan dan 9 penghapusan
  1. 6 9
      src/views/his/storeOrder/order1.vue

+ 6 - 9
src/views/his/storeOrder/order1.vue

@@ -1382,15 +1382,9 @@ export default {
           this.payRemainTotal = "0"
           this.productInfo = response.productInfo;
         }
-        
-        this.loading = false;
-        
-        if(response.msg == 'jnmy'){
-          this.SFDFopen = true;
-        } else{
-          this.SFDFopen = false;
-        }
-        
+
+        this.SFDFopen = false;
+
         // 如果有排序,显示排序结果提示
         if (this.currentSort.prop) {
           const fieldLabel = this.getSortLabel(this.currentSort.prop);
@@ -1401,6 +1395,9 @@ export default {
         console.error('查询失败:', error);
         this.loading = false;
         this.$message.error('查询数据失败');
+      }).finally(() => {
+        //无论如何都会执行,确保 loading 关闭
+        this.loading = false;
       });
     },
     // 处理键盘按下事件