Przeglądaj źródła

预装箱单-列表导入

jbb 2 lat temu
rodzic
commit
1023458c86
1 zmienionych plików z 23 dodań i 1 usunięć
  1. 23 1
      src/views/advance-packingList/adPaList-clothes.vue

+ 23 - 1
src/views/advance-packingList/adPaList-clothes.vue

@@ -142,6 +142,7 @@
         <a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
         <a-button type="primary" icon="download" @click="handleExportXls1('预装箱单-成衣','0')">预装箱单成衣导出</a-button>
         <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣','1')">预装箱单成衣导出-装箱单</a-button>
+        <a-button type="primary" icon="download" @click="handleExportXls2('预装箱单列表')">预装箱单列表导出</a-button>
         <a-upload productName="file" :showUploadList="false"  :multiple="false"  :headers="tokenHeader"  :action="importExcelUrl"   @change="handleImportExcel" :customRequest="uploadFlie">
           <a-button type="primary" icon="import">导入-来源出运明细</a-button>
         </a-upload>
@@ -723,7 +724,28 @@ export default {
         }
       })
     },
-
+    handleExportXls2(fileName) {
+      const data = this.queryParam
+      downFile('/spapl/syPreAssembledPackingList/exportXls3',data).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 + '.xlsx')
+        } 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 + '.xlsx')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+    },
 
      // 导入信息
     uploadFlie(file) {