2018-07-18 12:38:43 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
export default class Controller {
|
|
|
|
constructor($scope) {
|
2018-09-06 10:47:25 +00:00
|
|
|
this.$scope = $scope;
|
2018-07-18 12:38:43 +00:00
|
|
|
this.ticketSelected = null;
|
2018-09-06 10:47:25 +00:00
|
|
|
this.filter = {
|
|
|
|
include: [
|
|
|
|
{
|
|
|
|
relation: 'client',
|
|
|
|
fields: ['name']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
relation: 'company',
|
|
|
|
fields: ['code']
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
2018-07-18 12:38:43 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 09:43:57 +00:00
|
|
|
exprBuilder(param, value) {
|
|
|
|
switch (param) {
|
|
|
|
case 'search':
|
|
|
|
return {id: value};
|
|
|
|
case 'from':
|
|
|
|
return {landed: {gte: value}};
|
|
|
|
case 'to':
|
|
|
|
return {landed: {lte: value}};
|
|
|
|
case 'id':
|
|
|
|
case 'clientFk':
|
|
|
|
case 'workerFk':
|
|
|
|
case 'sourceApp':
|
|
|
|
case 'agencyModeFk':
|
|
|
|
case 'isConfirmed':
|
|
|
|
return {[param]: value};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-06 10:47:25 +00:00
|
|
|
showDescriptor(event, clientFk) {
|
|
|
|
this.$scope.descriptor.clientFk = clientFk;
|
|
|
|
this.$scope.descriptor.parent = event.target;
|
|
|
|
this.$scope.descriptor.show();
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
onDescriptorLoad() {
|
|
|
|
this.$scope.popover.relocate();
|
|
|
|
}
|
|
|
|
|
2018-10-17 10:49:18 +00:00
|
|
|
preview(order) {
|
2018-10-10 12:03:56 +00:00
|
|
|
this.$scope.orderSummaryDialog.show();
|
|
|
|
this.order = order;
|
2018-07-18 12:38:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Controller.$inject = ['$scope'];
|
|
|
|
|
|
|
|
ngModule.component('vnOrderIndex', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|