Files
exchange-2.0/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue
T

52 lines
1.7 KiB
Vue

<template>
<div class="row m-b-10 parentContainer">
<div class="col">
<div class="row p-b-10 b-b b-grey">
<div class="col-2">{{ item.imported_date }}</div>
<div class="col-2">
<button class="btn btn-xs btn-outline-success b-rad-none m-r-5" @click="downloadInvoiceMapped(item.imported_date)">
Download Receipts Mapped
</button>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
stage: {
type: Number,
default: 0
},
section:{
type: String,
required: true
},
},
methods: {
downloadInvoiceMapped(importedDate) {
var arrDateTime = importedDate.split(" ");
const fileName = 'ReceiptMapped';
const url = this.route('importedReceiptMapped.export')+'?date='+arrDateTime[0]+'&time='+arrDateTime[1]+'&fileName='+fileName;
if(window.LARAVEL_VAPOR_ENABLED){
this.submit(url, 'get', this.section, false, false);
}
else{
window.open(url, '_blank');
}
},
successHandler(response) {
if(window.LARAVEL_VAPOR_ENABLED){
if (response.src) {
window.location.href = response.src;
}
}
},
},
mixins: [componentHandler]
}
</script>