LiFei 2 rokov pred
rodič
commit
b92413acca
1 zmenil súbory, kde vykonal 40 pridanie a 1 odobranie
  1. 40 1
      src/views/hlwpayment/HlwPaymentDetailList.vue

+ 40 - 1
src/views/hlwpayment/HlwPaymentDetailList.vue

@@ -1,4 +1,5 @@
 <template>
 <template>
+  <a-spin size="large" :spinning="exportLoading" tip="正在导出...">
   <a-card :bordered="false">
   <a-card :bordered="false">
     <!-- 查询区域 -->
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
     <div class="table-page-search-wrapper">
@@ -29,6 +30,8 @@
     <!-- 操作按钮区域 -->
     <!-- 操作按钮区域 -->
     <div class="table-operator">
     <div class="table-operator">
       <a-button @click="handleChargeBack" type="primary" icon="rollback" v-if="paymentLane === 1">退单处理</a-button>
       <a-button @click="handleChargeBack" type="primary" icon="rollback" v-if="paymentLane === 1">退单处理</a-button>
+
+      <a-button v-has="'paymentDetail:exportDetail'"  type="primary"  icon="download" @click="handleExportXls('付款明细')">导出</a-button>
     </div>
     </div>
 
 
     <!-- table区域-begin -->
     <!-- table区域-begin -->
@@ -69,6 +72,7 @@
     </div>
     </div>
     <HlwPaymentReissueModal ref="modalPayBackForm" @ok="modalFormOk"></HlwPaymentReissueModal>
     <HlwPaymentReissueModal ref="modalPayBackForm" @ok="modalFormOk"></HlwPaymentReissueModal>
   </a-card>
   </a-card>
+  </a-spin>
 </template>
 </template>
 
 
 <script>
 <script>
@@ -76,7 +80,7 @@
   import '@/assets/less/TableExpand.less'
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { httpAction, getAction, putAction } from '@/api/manage'
+  import { httpAction, getAction, putAction,downFile } from '@/api/manage'
   import HlwPaymentReissueModal from './modules/HlwPaymentReissueModal'
   import HlwPaymentReissueModal from './modules/HlwPaymentReissueModal'
 
 
   export default {
   export default {
@@ -87,6 +91,7 @@
     },
     },
     data () {
     data () {
       return {
       return {
+        exportLoading: false,
         description: '付款明细表管理页面',
         description: '付款明细表管理页面',
         paymentLane: 0,
         paymentLane: 0,
         // 表头
         // 表头
@@ -295,6 +300,40 @@
           }
           }
         })
         })
       },
       },
+
+
+      handleExportXls(fileName){
+        if(!fileName || typeof fileName != "string"){
+          fileName = "导出文件"
+        }
+        let param = {...this.queryParam};
+        param.paymentId =  this.$route.query.paymentId;
+        console.log("导出参数",param)
+        this.exportLoading = true;
+        downFile(this.url.exportXlsUrl,param).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对象
+          }
+        }).finally(() => {
+          this.exportLoading = false;
+        })
+      },
+
+
     }
     }
   }
   }
 </script>
 </script>