salix/print/templates/reports/cmr-authorization/cmr-authorization.js

30 lines
814 B
JavaScript
Raw Normal View History

2021-12-13 07:23:44 +00:00
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');
2022-01-17 11:44:43 +00:00
this.client = await this.findOneFromDef('client', [this.ticket.clientFk]);
2021-12-13 07:23:44 +00:00
},
computed: {
issued: function() {
return new Date();
}
},
components: {
'report-header': reportHeader.build(),
'report-footer': reportFooter.build()
},
props: {
ticketId: {
2022-01-17 11:44:43 +00:00
type: [Number, String],
2021-12-13 07:23:44 +00:00
required: true
}
}
};