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

42 lines
1.0 KiB
JavaScript

import ngModule from '../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {
fields: [
'id',
'ref',
'issued',
'serial',
'amount',
'clientFk',
'companyFk',
'hasPdf'
],
include: [
{
relation: 'company',
scope: {
fields: ['id', 'code']
}
}, {
relation: 'client',
scope: {
fields: ['id', 'socialName', 'name', 'email']
}
}
]
};
this.$http.get(`InvoiceOuts/${this.$params.id}`, {filter})
.then(res => this.invoiceOut = res.data);
}
}
ngModule.vnComponent('vnInvoiceOutCard', {
template: require('./index.html'),
controller: Controller
});