30 lines
791 B
JavaScript
30 lines
791 B
JavaScript
|
const Component = require(`${appPath}/core/component`);
|
||
|
const reportHeader = new Component('report-header');
|
||
|
const reportFooter = new Component('report-footer');
|
||
|
|
||
|
module.exports = {
|
||
|
name: 'cmr-authorization',
|
||
|
async serverPrefetch() {
|
||
|
this.ticket = await this.findOneFromDef('ticket', [this.ticketId]);
|
||
|
if (!this.ticket)
|
||
|
throw new Error('Something went wrong');
|
||
|
|
||
|
this.client = await this.findOneFromDef('client', [this.ticket.clientFk]);
|
||
|
|
||
|
},
|
||
|
computed: {
|
||
|
issued: function() {
|
||
|
return new Date();
|
||
|
}
|
||
|
},
|
||
|
components: {
|
||
|
'report-header': reportHeader.build(),
|
||
|
'report-footer': reportFooter.build()
|
||
|
},
|
||
|
props: {
|
||
|
ticketId: {
|
||
|
required: true
|
||
|
}
|
||
|
}
|
||
|
};
|