2019-09-25 18:06:42 +00:00
|
|
|
import ngModule from '../module';
|
2019-11-14 13:37:18 +00:00
|
|
|
import Section from 'salix/components/section';
|
2019-09-25 18:06:42 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2019-11-14 13:37:18 +00:00
|
|
|
class Controller extends Section {
|
|
|
|
$onInit() {
|
|
|
|
this.$.params = {};
|
2019-09-25 18:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onSubmit() {
|
2020-01-08 12:27:43 +00:00
|
|
|
this.$.data = null;
|
2019-11-14 13:37:18 +00:00
|
|
|
this.$http.get(`Zones/getEvents`, {params: this.$.params})
|
2020-01-08 12:27:43 +00:00
|
|
|
.then(res => {
|
|
|
|
let data = res.data;
|
|
|
|
this.$.data = data;
|
|
|
|
if (!data.events.length)
|
|
|
|
this.vnApp.showMessage(this.$t('No service for the specified zone'));
|
|
|
|
});
|
2019-09-25 18:06:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.component('vnZoneDeliveryDays', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|