2018-11-21 07:58:34 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
|
|
|
|
class Controller {
|
2019-02-15 11:39:21 +00:00
|
|
|
constructor($scope, $stateParams) {
|
2018-11-21 07:58:34 +00:00
|
|
|
this.$stateParams = $stateParams;
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$ = $scope;
|
2018-11-21 07:58:34 +00:00
|
|
|
this.filter = {
|
|
|
|
include: [
|
2019-01-31 13:14:39 +00:00
|
|
|
{
|
|
|
|
relation: 'atender',
|
2018-12-21 11:35:34 +00:00
|
|
|
scope: {
|
|
|
|
include: {
|
2019-01-31 13:14:39 +00:00
|
|
|
relation: 'user',
|
|
|
|
scope: {
|
|
|
|
fields: ['nickname']
|
|
|
|
}
|
2018-12-21 11:35:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-01-31 13:14:39 +00:00
|
|
|
{
|
|
|
|
relation: 'requester',
|
2018-12-21 11:35:34 +00:00
|
|
|
scope: {
|
|
|
|
include: {
|
2019-01-31 13:14:39 +00:00
|
|
|
relation: 'user',
|
|
|
|
scope: {
|
|
|
|
fields: ['nickname']
|
|
|
|
}
|
2018-12-21 11:35:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-01-31 13:14:39 +00:00
|
|
|
{
|
|
|
|
relation: 'sale'
|
|
|
|
}
|
2018-11-21 07:58:34 +00:00
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
removeLine(index) {
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.model.remove(index);
|
|
|
|
this.$.watcher.check();
|
|
|
|
this.$.model.save().then(() => {
|
|
|
|
this.$.watcher.notifySaved();
|
|
|
|
this.$.watcher.updateOriginalData();
|
2018-11-21 07:58:34 +00:00
|
|
|
});
|
|
|
|
}
|
2019-02-15 11:39:21 +00:00
|
|
|
|
2019-02-20 17:46:30 +00:00
|
|
|
showItemDescriptor(event, itemFk) {
|
2018-11-21 07:58:34 +00:00
|
|
|
this.quicklinks = {
|
|
|
|
btnThree: {
|
|
|
|
icon: 'icon-transaction',
|
|
|
|
state: `item.card.diary({
|
2019-02-20 17:46:30 +00:00
|
|
|
id: ${itemFk},
|
2018-11-21 07:58:34 +00:00
|
|
|
ticketFk: ${this.$stateParams.id}
|
|
|
|
})`,
|
|
|
|
tooltip: 'Item diary'
|
|
|
|
}
|
|
|
|
};
|
2019-02-20 17:46:30 +00:00
|
|
|
this.$.itemDescriptor.itemFk = itemFk;
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.itemDescriptor.parent = event.target;
|
|
|
|
this.$.itemDescriptor.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
showWorkerDescriptor(event, userId) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
this.selectedWorker = userId;
|
|
|
|
this.$.workerDescriptor.parent = event.target;
|
|
|
|
this.$.workerDescriptor.show();
|
2018-11-21 07:58:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-15 11:39:21 +00:00
|
|
|
Controller.$inject = ['$scope', '$stateParams'];
|
2018-11-21 07:58:34 +00:00
|
|
|
|
|
|
|
ngModule.component('vnTicketRequestIndex', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|