mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
fix invoice & estimate view issue
This commit is contained in:
@ -154,6 +154,7 @@ export default {
|
||||
id: null,
|
||||
count: null,
|
||||
invoices: [],
|
||||
invoice: null,
|
||||
currency: null,
|
||||
searchData: {
|
||||
orderBy: null,
|
||||
@ -167,9 +168,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
invoice () {
|
||||
return this.$store.getters['invoice/getInvoice'](this.$route.params.id)
|
||||
},
|
||||
|
||||
getOrderBy () {
|
||||
if (this.searchData.orderBy === 'asc' || this.searchData.orderBy == null) {
|
||||
return true
|
||||
@ -180,8 +179,14 @@ export default {
|
||||
return `/invoices/pdf/${this.invoice.unique_hash}`
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route (to, from) {
|
||||
this.loadInvoice()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadInvoices()
|
||||
this.loadInvoice()
|
||||
this.onSearch = _.debounce(this.onSearch, 500)
|
||||
},
|
||||
methods: {
|
||||
@ -192,7 +197,8 @@ export default {
|
||||
'markAsSent',
|
||||
'sendEmail',
|
||||
'deleteInvoice',
|
||||
'selectInvoice'
|
||||
'selectInvoice',
|
||||
'fetchViewInvoice'
|
||||
]),
|
||||
async loadInvoices () {
|
||||
let response = await this.fetchInvoices()
|
||||
@ -200,6 +206,13 @@ export default {
|
||||
this.invoices = response.data.invoices.data
|
||||
}
|
||||
},
|
||||
async loadInvoice () {
|
||||
let response = await this.fetchViewInvoice(this.$route.params.id)
|
||||
|
||||
if (response.data) {
|
||||
this.invoice = response.data.invoice
|
||||
}
|
||||
},
|
||||
async onSearch () {
|
||||
let data = ''
|
||||
if (this.searchData.searchText !== '' && this.searchData.searchText !== null && this.searchData.searchText !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user