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

24 lines
656 B
JavaScript

import ngModule from '../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {
where: {
id: this.$params.id}
};
return Promise.all([
this.$http.get(`Workers/summary`, {filter})
.then(res => this.worker = res.data[0]),
this.$http.get(`Workers/${this.$params.id}/activeContract`)
.then(res => this.hasWorkCenter = res.data?.workCenterFk)
]);
}
}
ngModule.vnComponent('vnWorkerCard', {
template: require('./index.html'),
controller: Controller
});