2018-07-24 10:55:10 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-17 14:18:02 +00:00
|
|
|
import Section from 'salix/components/section';
|
2018-07-24 10:55:10 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2020-03-17 14:18:02 +00:00
|
|
|
class Controller extends Section {
|
|
|
|
constructor($element, $) {
|
|
|
|
super($element, $);
|
2018-07-24 10:55:10 +00:00
|
|
|
this.filter = {
|
2023-05-08 14:30:21 +00:00
|
|
|
include: {
|
2018-11-06 09:49:38 +00:00
|
|
|
relation: 'item'
|
2023-05-08 14:30:21 +00:00
|
|
|
},
|
|
|
|
order: 'itemFk'
|
2018-07-24 10:55:10 +00:00
|
|
|
};
|
|
|
|
this.order = {};
|
|
|
|
this.ticketVolumes = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
onDataChange() {
|
2020-03-17 14:18:02 +00:00
|
|
|
this.$http.get(`Orders/${this.$params.id}/getVolumes`)
|
2020-04-28 12:26:02 +00:00
|
|
|
.then(res => {
|
|
|
|
this.$.model.data.forEach(order => {
|
|
|
|
res.data.volumes.forEach(volume => {
|
|
|
|
if (order.itemFk === volume.itemFk)
|
|
|
|
order.volume = volume.volume;
|
2018-07-24 10:55:10 +00:00
|
|
|
});
|
2020-04-28 12:26:02 +00:00
|
|
|
});
|
2018-11-06 09:49:38 +00:00
|
|
|
});
|
2018-07-24 10:55:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnOrderVolume', {
|
2018-07-24 10:55:10 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
order: '<'
|
|
|
|
}
|
|
|
|
});
|