34 lines
944 B
JavaScript
Executable File
34 lines
944 B
JavaScript
Executable File
const Component = require(`vn-print/core/component`);
|
|
const emailBody = new Component('email-body');
|
|
|
|
module.exports = {
|
|
name: 'not-main-printer-configured',
|
|
async serverPrefetch() {
|
|
this.sector = await this.findOneFromDef('sector', [this.sectorId]);
|
|
|
|
if (!this.sector)
|
|
throw new Error('Something went wrong');
|
|
|
|
this.labeler = await this.findOneFromDef('printer', [this.labelerId]);
|
|
this.mainPrinter = await this.findOneFromDef('printer', [this.sector.mainPrinterFk]);
|
|
this.worker = await this.findOneFromDef('worker', [this.workerId]);
|
|
},
|
|
components: {
|
|
'email-body': emailBody.build(),
|
|
},
|
|
props: {
|
|
labelerId: {
|
|
type: Number,
|
|
required: true
|
|
},
|
|
sectorId: {
|
|
type: Number,
|
|
required: true
|
|
},
|
|
workerId: {
|
|
type: Number,
|
|
required: true
|
|
}
|
|
}
|
|
};
|