This commit is contained in:
Gerard 2019-02-05 11:44:12 +01:00
commit 2e1b47b0c5
8 changed files with 94 additions and 4 deletions

View File

@ -37,7 +37,7 @@ module.exports = Self => {
},
});
Self.catalogFilter = async (orderFk, orderBy, filter, tags) => {
Self.catalogFilter = async(orderFk, orderBy, filter, tags) => {
let conn = Self.dataSource.connector;
const stmts = [];
let stmt;

View File

@ -19,9 +19,7 @@
</vn-one>
</vn-horizontal>
<vn-horizontal class="input">
<vn-autocomplete
vn-one
vn-id="type"
<vn-autocomplete vn-id="type" vn-one
data="$ctrl.itemTypes"
on-change="$ctrl.type = {
id: value,

View File

@ -41,4 +41,8 @@ vn-catalog-filter > div {
flex-wrap: wrap;
@extend .pad-medium;
}
vn-autocomplete[vn-id="type"] .list {
max-height: 20em
}
}

View File

@ -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();

View File

@ -0,0 +1,3 @@
table.column-oriented {
margin-top: 50px !important
}

View File

@ -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>

View File

@ -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'),
},
};

View File

@ -0,0 +1,11 @@
module.exports = {
messages: {
es: {
title: 'Sample report',
date: 'Fecha',
quantity: 'Cantidad',
concept: 'Concepto',
client: 'Cliente {0}',
},
},
};