2018-10-30 13:57:22 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import './style.scss';
|
|
|
|
|
|
|
|
export default class Controller {
|
2018-11-02 14:44:27 +00:00
|
|
|
constructor($scope, vnApp, $translate) {
|
2018-10-30 13:57:22 +00:00
|
|
|
this.$scope = $scope;
|
2018-11-02 14:44:27 +00:00
|
|
|
this.vnApp = vnApp;
|
|
|
|
this._ = $translate;
|
|
|
|
|
2018-10-30 13:57:22 +00:00
|
|
|
this.ticketSelected = null;
|
|
|
|
this.filter = {
|
2018-11-02 14:44:27 +00:00
|
|
|
include: {
|
|
|
|
relation: 'ticket',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'clientFk', 'companyFk', 'warehouseFk'],
|
|
|
|
include: [
|
|
|
|
{
|
|
|
|
relation: 'client',
|
|
|
|
scope: {
|
|
|
|
fields: ['salesPersonFk', 'name'],
|
|
|
|
include: {
|
|
|
|
relation: 'salesPerson',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'firstName', 'name']
|
2018-10-30 13:57:22 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-02 14:44:27 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{relation: 'warehouse'}
|
|
|
|
]
|
2018-10-30 13:57:22 +00:00
|
|
|
}
|
2018-11-02 14:44:27 +00:00
|
|
|
}
|
2018-10-30 13:57:22 +00:00
|
|
|
};
|
2018-11-02 14:44:27 +00:00
|
|
|
|
2018-10-30 13:57:22 +00:00
|
|
|
this.weekdays = [
|
|
|
|
{id: 0, name: 'Monday'},
|
|
|
|
{id: 1, name: 'Tuesday'},
|
|
|
|
{id: 2, name: 'Wednesday'},
|
|
|
|
{id: 3, name: 'Thursday'},
|
|
|
|
{id: 4, name: 'Friday'},
|
|
|
|
{id: 5, name: 'Saturday'},
|
|
|
|
{id: 6, name: 'Sunday'}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
onSave() {
|
2018-11-02 14:44:27 +00:00
|
|
|
this.vnApp.showSuccess(this._.instant('Data saved!'));
|
2018-10-30 13:57:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
showClientDescriptor(event, clientFk) {
|
|
|
|
this.$scope.clientDescriptor.clientFk = clientFk;
|
|
|
|
this.$scope.clientDescriptor.parent = event.target;
|
|
|
|
this.$scope.clientDescriptor.show();
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
showTicketDescriptor(event, ticketFk) {
|
|
|
|
this.$scope.ticketDescriptor.ticketFk = ticketFk;
|
|
|
|
this.$scope.ticketDescriptor.parent = event.target;
|
|
|
|
this.$scope.ticketDescriptor.show();
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
onDescriptorLoad() {
|
|
|
|
this.$scope.popover.relocate();
|
|
|
|
}
|
|
|
|
|
|
|
|
deleteWeekly(expedition) {
|
|
|
|
this.expeditionId = expedition.id;
|
|
|
|
this.$scope.deleteWeekly.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-02 14:44:27 +00:00
|
|
|
Controller.$inject = ['$scope', 'vnApp', '$translate'];
|
2018-10-30 13:57:22 +00:00
|
|
|
|
|
|
|
ngModule.component('vnTicketWeekly', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|