salix/print/templates/reports/zone/zone.js

28 lines
622 B
JavaScript
Raw Normal View History

const Component = require(`vn-print/core/component`);
2022-11-10 07:57:42 +00:00
const reportBody = new Component('report-body');
2019-11-04 12:55:20 +00:00
module.exports = {
name: 'zone',
async serverPrefetch() {
2022-09-26 11:33:27 +00:00
this.zone = await this.fetchZone(this.id);
2019-11-04 12:55:20 +00:00
if (!this.zone)
throw new Error('Something went wrong');
},
methods: {
2022-09-26 11:33:27 +00:00
fetchZone(id) {
return this.findOneFromDef('zone', [id]);
2019-11-04 12:55:20 +00:00
}
},
2022-11-10 07:57:42 +00:00
components: {
'report-body': reportBody.build()
},
2019-11-04 12:55:20 +00:00
props: {
2022-09-26 11:33:27 +00:00
id: {
2022-10-28 13:53:57 +00:00
type: Number,
2022-09-26 11:33:27 +00:00
required: true,
description: 'The zone id'
2019-11-04 12:55:20 +00:00
}
}
};