salix/modules/ticket/front/future-search-panel/index.js

47 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

import ngModule from '../module';
import SearchPanel from 'core/components/searchbar/search-panel';
class Controller extends SearchPanel {
constructor($, $element) {
super($, $element);
this.filter = this.$.filter;
2022-11-10 14:54:00 +00:00
this.getGroupedStates();
this.getItemPackingTypes();
}
getGroupedStates() {
let groupedStates = [];
this.$http.get('AlertLevels').then(res => {
for (let state of res.data) {
groupedStates.push({
id: state.id,
code: state.code,
name: this.$t(state.code)
});
}
this.groupedStates = groupedStates;
});
}
getItemPackingTypes() {
let itemPackingTypes = [];
const filter = {
where: {isActive: true}
};
this.$http.get('ItemPackingTypes', {filter}).then(res => {
2022-11-10 14:54:00 +00:00
for (let ipt of res.data) {
itemPackingTypes.push({
2022-12-14 11:17:12 +00:00
description: this.$t(ipt.description),
2022-11-10 14:54:00 +00:00
code: ipt.code,
});
}
this.itemPackingTypes = itemPackingTypes;
});
}
}
ngModule.vnComponent('vnFutureTicketSearchPanel', {
template: require('./index.html'),
controller: Controller
});