Browse Source

发票数据导出

master
453530270@qq.com 3 years ago
parent
commit
08f3866934
  1. 19
      src/components/page/afterService/invoice.vue

19
src/components/page/afterService/invoice.vue

@ -65,6 +65,7 @@
<a-space :size="21">
<a-button type="primary" class="query_button" @click="getAllDate(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space>
</a-col>
</a-row>
@ -72,7 +73,7 @@
<div class="table">
<div class="table_title">
<span>查询结果</span>
<a-button type="primary" class="query_button"> </a-button>
<!-- <a-button type="primary" class="query_button"> </a-button> -->
<!-- <a-button type="primary" class="query_button"> </a-button> -->
</div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
@ -234,6 +235,22 @@ export default {
// return
location.href=this.$host+'/admin/order.InvoiceManagement/downloadInvoice?id='+id
},
// xls
xlsdc(){
xlsdc(this.query).then(res=>{
const fname = new Date().getTime()+".xlsx"
let bloburl = window.URL.createObjectURL(new Blob([res]))
const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
})
.catch(err=>{
console.error(err)
});
},
// query
resetQurey(){
Object.assign(this.query, this.$options.data().query)

Loading…
Cancel
Save