瀏覽代碼

修改导出多次点击问题

chenrui 2 年之前
父節點
當前提交
597eaa296c

+ 5 - 2
src/views/allocationManagement/transferOut/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -89,7 +89,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -126,8 +127,10 @@ export default {
     handleExport () {
       const _this = this
       _this.spinning = true
+      _this.exportLoading = true
       allocateBillDownload({}).then(res => {
         _this.spinning = false
+        _this.exportLoading = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 5 - 2
src/views/allocationManagement/transferReturn/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -89,7 +89,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -126,8 +127,10 @@ export default {
     handleExport () {
       const _this = this
       _this.spinning = true
+      _this.exportLoading = true
       allocateBillDownload({}).then(res => {
         _this.spinning = false
+        _this.exportLoading = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 5 - 2
src/views/inventoryManagement/intelligentReplenishment/set.vue

@@ -22,7 +22,7 @@
                 <li>4) “是否淘汰”字段,如果确定淘汰,则输入“是”,如果不淘汰,则不需要输入,保持为空即可</li>
                 <li>5) “淘汰描述”字段,只有当是否淘汰为“是”时,才能录入淘汰描述,否则,淘汰描述只能保持为空</li>
               </ul>
-              <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+              <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
             </div>
             <div class="explain-item">
               <div class="explain-tit">
@@ -84,7 +84,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -109,8 +110,10 @@ export default {
     handleExport () {
       const _this = this
       _this.spinning = true
+      _this.exportLoading = true
       predictProductInfoExport({}).then(res => {
         _this.spinning = false
+        _this.exportLoading = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 6 - 3
src/views/productManagement/productPricing/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) “产品编码”必须是列表中已存在的产品</li>
             <li>3) 省级价、市级价、特约价、终端价、车主价均可为空,为空表示不对原有价格做改变</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -88,7 +88,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -123,9 +124,11 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      this.spinning = true
+      _this.spinning = true
+      _this.exportLoading = true
       hdExportExcel(productPriceTplDownload, {}, '产品定价导入模板', function () {
         _this.spinning = false
+        _this.exportLoading = false
       })
     }
   },

+ 5 - 2
src/views/productManagement/shelfNoManage/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) “产品编码”必须是列表中已存在的产品</li>
             <li>3) “货位编号”可为空,为空表示此产品没有货位信息</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -88,7 +88,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -124,8 +125,10 @@ export default {
     handleExport () {
       const _this = this
       this.spinning = true
+      this.exportLoading = true
       hdExportExcel(stackPlaceImportTemplate, {}, '货位编号管理导入模板', function () {
         _this.spinning = false
+        _this.exportLoading = false
       })
     }
   },

+ 3 - 2
src/views/purchasingManagement/bulkWarehousingOrder/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -88,7 +88,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {

+ 3 - 2
src/views/salesManagement/salesQuery/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -90,7 +90,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {

+ 5 - 2
src/views/supplierManagement/associatedProduct/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“成本”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -87,7 +87,8 @@ export default {
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
-      }
+      },
+      exportLoading: false
     }
   },
   methods: {
@@ -124,8 +125,10 @@ export default {
     handleExport () {
       const _this = this
       _this.spinning = true
+      _this.exportLoading = true
       supplierProductDownload({}).then(res => {
         _this.spinning = false
+        _this.exportLoading = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {