salix/print/templates/reports/vehicle-event-expired/vehicle-event-expired.js

29 lines
791 B
JavaScript
Raw Normal View History

2022-09-21 06:11:04 +00:00
const Component = require(`${appPath}/core/component`);
const reportHeader = new Component('report-header');
const reportFooter = new Component('report-footer');
module.exports = {
name: 'vehicle-event-expired',
async serverPrefetch() {
this.vehicleEvents = await this.fetchVehicleEvent(this.eventIds);
if (!this.vehicleEvents)
throw new Error('Something went wrong');
},
methods: {
fetchVehicleEvent(vehicleEventIds) {
return this.rawSqlFromDef('vehicleEvents', [vehicleEventIds]);
},
},
components: {
'report-header': reportHeader.build(),
'report-footer': reportFooter.build()
},
props: {
eventIds: {
type: [Array],
2022-09-21 06:12:08 +00:00
required: true
2022-09-21 06:11:04 +00:00
}
}
};