report sample
This commit is contained in:
parent
353dc38e48
commit
4f2ca4af05
|
@ -0,0 +1,7 @@
|
||||||
|
const CssReader = require(`${appPath}/lib/cssReader`);
|
||||||
|
|
||||||
|
module.exports = new CssReader([
|
||||||
|
`${appPath}/common/css/layout.css`,
|
||||||
|
`${appPath}/common/css/misc.css`,
|
||||||
|
`${__dirname}/style.css`])
|
||||||
|
.mergeStyles();
|
|
@ -0,0 +1,3 @@
|
||||||
|
table.column-oriented {
|
||||||
|
margin-top: 50px !important
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="es">
|
||||||
|
<body>
|
||||||
|
<section class="container">
|
||||||
|
<report-header :locale="locale"></report-header>
|
||||||
|
<section class="main">
|
||||||
|
<!-- Report start -->
|
||||||
|
<h1 class="title">{{$t('title')}}</h1>
|
||||||
|
<p>{{$t('date')}} {{dated()}}</p>
|
||||||
|
<table class="column-oriented">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>{{$t('concept')}}</th>
|
||||||
|
<th>{{$t('quantity')}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="sale in sales" :key="sale.id">
|
||||||
|
<td class="font gray">{{sale.id}}</td>
|
||||||
|
<td>{{sale.concept}}</td>
|
||||||
|
<td>{{sale.quantity}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!-- Report end -->
|
||||||
|
</section>
|
||||||
|
<report-footer id="pageFooter"
|
||||||
|
:left-text="$t('client', [client.id])"
|
||||||
|
:center-text="client.name"
|
||||||
|
:locale="locale">
|
||||||
|
</report-footer>
|
||||||
|
</section>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,32 @@
|
||||||
|
const strftime = require('strftime');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: 'sample-report',
|
||||||
|
created() {
|
||||||
|
if (this.locale)
|
||||||
|
this.$i18n.locale = this.locale;
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
client: {
|
||||||
|
id: 10252,
|
||||||
|
name: 'Batman',
|
||||||
|
},
|
||||||
|
sales: [
|
||||||
|
{id: 1, concept: 'My item 1', quantity: 25},
|
||||||
|
{id: 2, concept: 'My item 2', quantity: 50},
|
||||||
|
{id: 3, concept: 'My item 3', quantity: 150}
|
||||||
|
],
|
||||||
|
locale: 'es'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
dated: () => {
|
||||||
|
return strftime('%d-%m-%Y', new Date());
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
'report-header': require('../report-header'),
|
||||||
|
'report-footer': require('../report-footer'),
|
||||||
|
},
|
||||||
|
};
|
|
@ -0,0 +1,11 @@
|
||||||
|
module.exports = {
|
||||||
|
messages: {
|
||||||
|
es: {
|
||||||
|
title: 'Sample report',
|
||||||
|
date: 'Fecha',
|
||||||
|
quantity: 'Cantidad',
|
||||||
|
concept: 'Concepto',
|
||||||
|
client: 'Cliente {0}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in New Issue