瀏覽代碼

供应商产能报表-明细导出

jbb 2 年之前
父節點
當前提交
0cc2801317
共有 1 個文件被更改,包括 24 次插入2 次删除
  1. 24 2
      src/views/reportForms/supply-capacity-table.vue

+ 24 - 2
src/views/reportForms/supply-capacity-table.vue

@@ -104,8 +104,9 @@
           >月份供应商合计导出</a-button
         >
         <a-button type="primary" @click="monthDepartExport('月份部门合计导出')" icon="download"
-          >月份部门合计导出</a-button
-        >
+          >月份部门合计导出</a-button>
+          <a-button type="primary" @click="detailExport()" icon="download"
+          >明细导出</a-button>
       </div>
 
       <!-- 合计 table  rowKey="id" :scroll="{ x: 1500 }" :pagination="ipagination  -->
@@ -360,6 +361,27 @@ export default {
         }
       })
     },
+    detailExport(){
+      downFile('/scas/supplierCapacity/excel4', this.queryParam).then(data => {
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName + '.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+    },
 
     // 查询按钮
     searchQuery() {