chenrui  2 жил өмнө
parent
commit
d4204ef122

+ 8 - 0
src/api/statistics/statistics.js

@@ -36,6 +36,14 @@ export function waybill(query) {
   })
 }
 
+export function waybilleclex(query) {
+  return request({
+    url: '/system/waybill/pageexcle',
+    method: 'get',
+    params: query
+  })
+}
+
 // // 航线货物关联统计接口(重量)
 export function agent(query) {
   return request({

+ 40 - 4
src/views/system/securityCheck/views/waybillTable.vue

@@ -41,7 +41,7 @@
 import SecurityCheckHeader from '../components/securityCheckHeader.vue'
 import PrintTable from '../components/securityCheckTable.vue'
 import SecurityCheckTable from '../components/securityCheckTableWaybill.vue'
-import { waybill } from '@/api/statistics/statistics.js'
+import { waybill, waybilleclex } from '@/api/statistics/statistics.js'
 import XLSX from 'xlsx'
 import FileSaver from 'file-saver'
 export default {
@@ -190,7 +190,7 @@ export default {
       pageNum: '1',
       pageSize: '20',
     }
-    if(queryData){
+    if (queryData) {
       this.getData()
       this.getPrintData()
     }
@@ -201,8 +201,44 @@ export default {
   methods: {
     //导出
     async exportex() {
-      this.downFile()
+      let that = this
+      this.$confirm({
+        title: '是否确认导出',
+        content: '是否确认导出',
+        onOk() {
+          return waybilleclex(this.FormData).then((response) => {
+            that.download(response.msg)
+            that.$message.success('导出成功')
+          })
+        },
+      })
+      // this.downlodTable()
+    },
+    //导出
+    downlodTable() {
+      this.$confirm('是否需要导出xlsx文档, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          // this.downFile()
+          this.$message({
+            type: 'success',
+            message: '导出成功!',
+          })
+        })
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消导出',
+          })
+        })
     },
+    // //导出
+    // async exportex() {
+    //   this.downFile()
+    // },
     downFile() {
       var wb = XLSX.utils.table_to_book(document.querySelector('#table2'))
       var wbout = XLSX.write(wb, {
@@ -237,7 +273,7 @@ export default {
     },
     searchHandler(arr) {
       this.FormData.waybillNo = arr[0]
-      if(this.$route.params){
+      if (this.$route.params) {
         this.getData()
       }
     },