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

40 lines
1008 B
JavaScript

import ngModule from '../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {
fields: [
'id',
'ref',
'issued',
'amount',
'clientFk',
'companyFk'
],
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
});