salix/modules/invoiceOut/front/card/index.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-03-26 13:27:08 +00:00
import ngModule from '../module';
2019-11-10 10:08:44 +00:00
import ModuleCard from 'salix/components/module-card';
2019-03-26 13:27:08 +00:00
2019-11-10 10:08:44 +00:00
class Controller extends ModuleCard {
reload() {
const filter = {
2019-03-26 13:27:08 +00:00
fields: [
'id',
'ref',
'issued',
'amount',
'clientFk',
'companyFk',
'hasPdf'
2019-03-26 13:27:08 +00:00
],
include: [
{
relation: 'company',
scope: {
fields: ['id', 'code']
}
2019-03-28 10:55:23 +00:00
}, {
2019-03-26 13:27:08 +00:00
relation: 'client',
scope: {
2021-07-19 10:31:09 +00:00
fields: ['id', 'socialName', 'name', 'email']
2019-03-26 13:27:08 +00:00
}
}
]
};
2019-11-10 10:08:44 +00:00
this.$http.get(`InvoiceOuts/${this.$params.id}`, {filter})
.then(res => this.invoiceOut = res.data);
2019-03-26 13:27:08 +00:00
}
}
ngModule.vnComponent('vnInvoiceOutCard', {
2019-03-26 13:27:08 +00:00
template: require('./index.html'),
controller: Controller
});