mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
refactor reports in downloading on diffrent os
This commit is contained in:
@ -196,7 +196,14 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
downloadReport () {
|
downloadReport () {
|
||||||
this.url += '&download=true'
|
if (!this.getReports()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
||||||
|
this.url += '&download=true'
|
||||||
|
} else {
|
||||||
|
window.open(this.getReportUrl + '&download=true')
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|||||||
@ -200,7 +200,14 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
downloadReport () {
|
downloadReport () {
|
||||||
this.url += '&download=true'
|
if (!this.getReports()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
||||||
|
this.url += '&download=true'
|
||||||
|
} else {
|
||||||
|
window.open(this.getReportUrl + '&download=true')
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|||||||
@ -238,7 +238,14 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
downloadReport () {
|
downloadReport () {
|
||||||
this.url += '&download=true'
|
if (!this.getReports()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
||||||
|
this.url += '&download=true'
|
||||||
|
} else {
|
||||||
|
window.open(this.getReportUrl + '&download=true')
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.selectedType === 'By Customer') {
|
if (this.selectedType === 'By Customer') {
|
||||||
this.url = `${this.customerSiteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.customerSiteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
|
|||||||
@ -189,14 +189,21 @@ export default {
|
|||||||
this.$v.formData.$touch()
|
this.$v.formData.$touch()
|
||||||
|
|
||||||
if (this.$v.$invalid) {
|
if (this.$v.$invalid) {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
downloadReport () {
|
downloadReport () {
|
||||||
this.url += '&download=true'
|
if (!this.getReports()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (navigator.appVersion.indexOf('Mac') !== -1) {
|
||||||
|
this.url += '&download=true'
|
||||||
|
} else {
|
||||||
|
window.open(this.url + '&download=true')
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
this.url = `${this.siteURL}?from_date=${moment(this.formData.from_date).format('DD/MM/YYYY')}&to_date=${moment(this.formData.to_date).format('DD/MM/YYYY')}`
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|||||||
Reference in New Issue
Block a user