2022-11-14 13:30:35 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import SearchPanel from 'core/components/searchbar/search-panel';
|
|
|
|
|
|
|
|
class Controller extends SearchPanel {
|
|
|
|
constructor($, $element) {
|
|
|
|
super($, $element);
|
|
|
|
this.filter = this.$.filter;
|
|
|
|
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 = [];
|
|
|
|
this.$http.get('ItemPackingTypes').then(res => {
|
|
|
|
for (let ipt of res.data) {
|
|
|
|
itemPackingTypes.push({
|
|
|
|
code: ipt.code,
|
2022-12-20 10:36:37 +00:00
|
|
|
description: this.$t(ipt.description)
|
2022-11-14 13:30:35 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
this.itemPackingTypes = itemPackingTypes;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnAdvanceTicketSearchPanel', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|