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

24 lines
656 B
JavaScript
Raw Normal View History

2019-01-28 15:24:45 +00:00
import ngModule from '../module';
2019-11-10 10:08:44 +00:00
import ModuleCard from 'salix/components/module-card';
2019-01-28 15:24:45 +00:00
2019-11-10 10:08:44 +00:00
class Controller extends ModuleCard {
2019-01-28 15:24:45 +00:00
reload() {
2023-07-14 09:51:15 +00:00
const filter = {
2024-04-15 12:44:18 +00:00
where: {
id: this.$params.id}
2019-01-29 20:00:27 +00:00
};
2023-07-14 09:51:15 +00:00
return Promise.all([
2024-04-15 12:44:18 +00:00
this.$http.get(`Workers/summary`, {filter})
.then(res => this.worker = res.data[0]),
2023-07-14 09:51:15 +00:00
this.$http.get(`Workers/${this.$params.id}/activeContract`)
2023-07-28 12:40:03 +00:00
.then(res => this.hasWorkCenter = res.data?.workCenterFk)
2023-07-14 09:51:15 +00:00
]);
2019-01-28 15:24:45 +00:00
}
}
ngModule.vnComponent('vnWorkerCard', {
2019-01-28 15:24:45 +00:00
template: require('./index.html'),
controller: Controller
});