浏览代码

遮罩优化,使用请求遮罩方式

yangbo 4 年之前
父节点
当前提交
cf78fa0926

+ 3 - 4
eccs-ui/src/api/mall/mallinvemng.js

@@ -53,17 +53,16 @@ export function exportMallinvemng(query) {
 }
 
 // 拉取kmall的所有商品数据
-export function pullKmallInvemng(query,loading,_this) {
+export function pullKmallInvemng(query,_this) {
   return request({
     url: '/biz/mallinvemng/pullKmallInveMng',
     method: 'POST',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 }

+ 5 - 1
eccs-ui/src/api/mall/mallshopmng.js

@@ -53,12 +53,16 @@ export function exportMallshopmng(query) {
 }
 
 // 拉取kmall的所有商品数据
-export function pullKmallStoreInvemng(query) {
+export function pullKmallStoreInvemng(query, _this) {
   return request({
     url: '/biz/mallshopmng/pullKmallStoreInveMng',
     method: 'POST',
     params: query,
     timeout: 3600 * 1000,
     loading: document.body
+  }).then(function (response) {
+    _this.$alert("拉取成功...");
+  }).catch(function () {
+    _this.$alert("拉取异常...");
   })
 }

+ 3 - 4
eccs-ui/src/api/warehouse/adjustmentorder.js

@@ -69,16 +69,15 @@ export function pullAdjustmentorder(query,loading,_this) {
 }
 
 // 拉取结转明细
-export function pullAdjustmentorderDetail(adjustmentOrderSn,loading,_this) {
+export function pullAdjustmentorderDetail(adjustmentOrderSn,_this) {
   return request({
     url: '/biz/adjustmentorder/pullAdjustmentorderDetail/' + adjustmentOrderSn,
     method: 'post',
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 }

+ 3 - 4
eccs-ui/src/api/warehouse/invemng.js

@@ -53,17 +53,16 @@ export function exportInvemng(query) {
 }
 
 // 导出库存管理,wms入库回传时,增加库存数
-export function pullInvemng(query,loading,_this) {
+export function pullInvemng(query,_this) {
   return request({
     url: '/biz/invemng/pullInveMng',
     method: 'post',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 }

+ 3 - 4
eccs-ui/src/api/warehouse/invereceiptgoods.js

@@ -53,17 +53,16 @@ export function exportInvereceiptgoods(query) {
 }
 
 // 导出库存管理,wms入库回传时,增加库存数
-export function pullInveReceiptGoods(query,loading,_this) {
+export function pullInveReceiptGoods(query,_this) {
   return request({
     url: '/biz/invereceiptgoods/pullReceiptGoods',
     method: 'post',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 }

+ 3 - 4
eccs-ui/src/api/warehouse/shopin.js

@@ -53,17 +53,16 @@ export function exportShopin(query) {
 }
 
 // 拉取门店进货记录
-export function pullShopInRecord(query,loading,_this) {
+export function pullShopInRecord(query,_this) {
   return request({
     url: '/biz/shopin/pullShopInRecord',
     method: 'post',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 

+ 3 - 4
eccs-ui/src/api/warehouse/shopinve.js

@@ -53,17 +53,16 @@ export function exportShopinve(query) {
 }
 
 // 拉取库存
-export function pullStoreInvemng(query,loading,_this) {
+export function pullStoreInvemng(query,_this) {
   return request({
     url: '/biz/shopinve/pullStoreInveMng',
     method: 'post',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 }

+ 3 - 5
eccs-ui/src/api/warehouse/shopmoverecord.js

@@ -53,18 +53,16 @@ export function exportShopmoverecord(query) {
 }
 
 // 拉取门店转移记录
-export function pullShopMoveRecord(query,loading,_this) {
+export function pullShopMoveRecord(query,_this) {
   return request({
     url: '/biz/shopmoverecord/pullShopMoveRecord',
     method: 'post',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
-
   })
 }

+ 3 - 4
eccs-ui/src/api/warehouse/shopout.js

@@ -52,17 +52,16 @@ export function exportShopout(query) {
   })
 }
 // 拉取门店出场记录
-export function pullShopOutRecord(query,loading,_this) {
+export function pullShopOutRecord(query,_this) {
   return request({
     url: '/biz/shopout/pullShopOutRecord',
     method: 'post',
     params: query,
-    timeout: 3600 * 1000
+    timeout: 3600 * 1000,
+    loading: document.body
   }).then(function (response) {
-    loading.close();
     _this.$alert("拉取成功...");
   }).catch(function () {
-    loading.close();
     _this.$alert("拉取异常...");
   })
 

+ 1 - 7
eccs-ui/src/views/mall/mallinvemng/index.vue

@@ -418,13 +418,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(()=> {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullKmallInvemng(queryParams,loading,_this);
+        return pullKmallInvemng(queryParams,_this);
 
       })
 

+ 3 - 11
eccs-ui/src/views/mall/mallshopinvemng/index.vue

@@ -454,21 +454,13 @@ export default {
     /** 拉取按钮操作 */
     handlePull() {
       const queryParams = this.queryParams;
-      const _this=this
-      // 添加遮罩
-
+      const _this = this
       this.$confirm('是否确认拉取电商门店所有库存?', "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullKmallStoreInvemng(queryParams,loading,_this);
+      }).then(() => {
+        return pullKmallStoreInvemng(queryParams, _this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/adjustmentorder/index.vue

@@ -413,13 +413,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullAdjustmentorderDetail(adjustmentOrderSns,loading,_this);
+        return pullAdjustmentorderDetail(adjustmentOrderSns,_this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/invemng/index.vue

@@ -473,13 +473,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullInvemng(queryParams,loading,_this);
+        return pullInvemng(queryParams,_this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/invereceiptgoods/index.vue

@@ -373,13 +373,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullInveReceiptGoods(queryParams,loading,_this);
+        return pullInveReceiptGoods(queryParams,_this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/shopin/index.vue

@@ -429,13 +429,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullShopInRecord(queryParams,loading,_this);
+        return pullShopInRecord(queryParams,_this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/shopinve/index.vue

@@ -515,13 +515,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullStoreInvemng(queryParams,loading,_this);
+        return pullStoreInvemng(queryParams,_this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/shopmoverecord/index.vue

@@ -426,13 +426,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullShopMoveRecord(queryParams,loading,_this);
+        return pullShopMoveRecord(queryParams,_this);
       })
     }
   }

+ 1 - 7
eccs-ui/src/views/warehouse/shopout/index.vue

@@ -415,13 +415,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        const loading = _this.$loading({
-          lock: true,
-          text: 'Loading',
-          spinner: 'el-icon-loading',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        return pullShopOutRecord(queryParams,loading,_this);
+        return pullShopOutRecord(queryParams,_this);
       })
     }
   }