salix/print/templates/email/backup-printer-selected/backup-printer-selected.js

34 lines
942 B
JavaScript
Raw Normal View History

const Component = require(`vn-print/core/component`);
const emailBody = new Component('email-body');
module.exports = {
name: 'backup-printer-selected',
2023-05-29 10:55:20 +00:00
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.backupPrinterFk]);
2023-05-29 10:55:20 +00:00
this.worker = await this.findOneFromDef('worker', [this.workerId]);
},
components: {
'email-body': emailBody.build(),
},
props: {
2023-05-29 10:55:20 +00:00
labelerId: {
type: Number,
required: true
},
2023-05-29 10:55:20 +00:00
sectorId: {
type: Number,
required: true
},
2023-05-29 10:55:20 +00:00
workerId: {
type: Number,
required: true
}
}
};