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

27 lines
681 B
JavaScript
Executable File

const Component = require(`vn-print/core/component`);
const reportBody = new Component('report-body');
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-body': reportBody.build()
},
props: {
eventIds: {
type: [Array],
required: true
}
}
};