37 lines
799 B
JavaScript
37 lines
799 B
JavaScript
import ngModule from '../module';
|
|
import Descriptor from 'salix/components/descriptor';
|
|
|
|
class Controller extends Descriptor {
|
|
get invoiceIn() {
|
|
return this.entity;
|
|
}
|
|
|
|
set invoiceIn(value) {
|
|
this.entity = value;
|
|
}
|
|
|
|
loadData() {
|
|
const filter = {
|
|
include: [
|
|
{
|
|
relation: 'company',
|
|
scope: {
|
|
fields: ['id', 'code']
|
|
}
|
|
}
|
|
]
|
|
};
|
|
|
|
return this.getData(`InvoiceIns/${this.id}`, {filter})
|
|
.then(res => this.entity = res.data);
|
|
}
|
|
}
|
|
|
|
ngModule.vnComponent('vnInvoiceInDescriptor', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
invoiceIn: '<'
|
|
}
|
|
});
|