34 lines
910 B
JavaScript
Executable File
34 lines
910 B
JavaScript
Executable File
const Component = require(`vn-print/core/component`);
|
|
const reportBody = new Component('report-body');
|
|
const reportFooter = new Component('report-footer');
|
|
|
|
module.exports = {
|
|
name: 'incoterms-authorization',
|
|
async serverPrefetch() {
|
|
this.client = await this.findOneFromDef('client', [this.id]);
|
|
this.company = await this.findOneFromDef('company', [this.companyId]);
|
|
if (!this.client)
|
|
throw new Error('Something went wrong');
|
|
},
|
|
computed: {
|
|
issued: function() {
|
|
return new Date();
|
|
}
|
|
},
|
|
components: {
|
|
'report-body': reportBody.build(),
|
|
'report-footer': reportFooter.build()
|
|
},
|
|
props: {
|
|
id: {
|
|
type: Number,
|
|
required: true,
|
|
description: 'The client id'
|
|
},
|
|
companyId: {
|
|
type: Number,
|
|
required: true
|
|
}
|
|
}
|
|
};
|