Merge pull request '4308-report_vehicleEventExpired' (#1058) from 4308-report_vehicleEventExpired into dev
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
Reviewed-on: #1058 Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
commit
9d7e12d861
|
@ -0,0 +1,9 @@
|
||||||
|
const Stylesheet = require(`${appPath}/core/stylesheet`);
|
||||||
|
|
||||||
|
module.exports = new Stylesheet([
|
||||||
|
`${appPath}/common/css/spacing.css`,
|
||||||
|
`${appPath}/common/css/misc.css`,
|
||||||
|
`${appPath}/common/css/layout.css`,
|
||||||
|
`${appPath}/common/css/report.css`,
|
||||||
|
`${__dirname}/style.css`])
|
||||||
|
.mergeStyles();
|
|
@ -0,0 +1,19 @@
|
||||||
|
.column-oriented {
|
||||||
|
margin-top: 50px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-line > tr {
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-line tr:nth-last-child() {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.report-info {
|
||||||
|
font-size: 20px
|
||||||
|
}
|
||||||
|
|
||||||
|
.description strong {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
title: Expiración Tarjetas Vehículos
|
||||||
|
Plate: Matrícula
|
||||||
|
Concept: Concepto
|
||||||
|
expirationDate: Fecha caducidad
|
|
@ -0,0 +1,7 @@
|
||||||
|
SELECT
|
||||||
|
v.numberPlate,
|
||||||
|
ve.description,
|
||||||
|
ve.finished
|
||||||
|
FROM vehicleEvent ve
|
||||||
|
JOIN vehicle v ON v.id = ve.vehicleFk
|
||||||
|
WHERE ve.id IN (?)
|
|
@ -0,0 +1,39 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html v-bind:lang="$i18n.locale">
|
||||||
|
<body>
|
||||||
|
<table class="grid">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<!-- Header block -->
|
||||||
|
<report-header v-bind="$props"></report-header>
|
||||||
|
<!-- Block -->
|
||||||
|
<div class="grid-row">
|
||||||
|
<div class="grid-block">
|
||||||
|
<div class="content">
|
||||||
|
<h1 class="title centered uppercase">{{$t('title')}}</h1>
|
||||||
|
</div>
|
||||||
|
<table class="column-oriented">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{$t('Plate')}}</th>
|
||||||
|
<th>{{$t('Concept')}}</th>
|
||||||
|
<th>{{$t('expirationDate')}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody v-for="vehicleEvent in vehicleEvents">
|
||||||
|
<tr>
|
||||||
|
<td>{{vehicleEvent.numberPlate}}</td>
|
||||||
|
<td>{{vehicleEvent.description}}</td>
|
||||||
|
<td>{{vehicleEvent.finished | date('%d-%m-%Y')}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,28 @@
|
||||||
|
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],
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue