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

40 lines
997 B
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'
],
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: {
2019-04-08 14:53:37 +00:00
fields: ['id', 'socialName', 'name']
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.component('vnInvoiceOutCard', {
template: require('./index.html'),
controller: Controller
});