salix/modules/shelving/front/summary/index.js

42 lines
1.0 KiB
JavaScript
Raw Normal View History

2022-05-24 10:50:22 +00:00
import ngModule from '../module';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Summary {
set shelving(value) {
this._shelving = value;
this.summary = null;
if (!value) return;
const filter = {
include: [
{relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}},
{relation: 'parking'}
]
};
this.$http.get(`Shelvings/${value.id}`, {filter})
.then(res => this.summary = res.data);
}
get shelving() {
return this._shelving;
}
}
ngModule.vnComponent('vnShelvingSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
shelving: '<'
}
});