34 lines
918 B
JavaScript
Executable File
34 lines
918 B
JavaScript
Executable File
const Component = require(`vn-print/core/component`);
|
|
const reportHeader = new Component('report-header');
|
|
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-header': reportHeader.build(),
|
|
'report-footer': reportFooter.build()
|
|
},
|
|
props: {
|
|
id: {
|
|
type: Number,
|
|
required: true,
|
|
description: 'The client id'
|
|
},
|
|
companyId: {
|
|
type: Number,
|
|
required: true
|
|
}
|
|
}
|
|
};
|