2018-08-30 06:50:03 +00:00
|
|
|
import ngModule from '../module';
|
2020-04-25 09:50:04 +00:00
|
|
|
import DescriptorPopover from 'salix/components/descriptor-popover';
|
2018-10-18 09:41:25 +00:00
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
class Controller extends DescriptorPopover {
|
2018-10-18 09:41:25 +00:00
|
|
|
get ticket() {
|
2020-04-25 09:50:04 +00:00
|
|
|
return this.entity;
|
2019-05-07 09:32:35 +00:00
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
loadData() {
|
|
|
|
const filter = {
|
2018-10-18 09:41:25 +00:00
|
|
|
include: [
|
2019-01-31 13:14:39 +00:00
|
|
|
{
|
|
|
|
relation: 'warehouse',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
2020-04-25 09:50:04 +00:00
|
|
|
}, {
|
2019-01-31 13:14:39 +00:00
|
|
|
relation: 'agencyMode',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
2020-04-25 09:50:04 +00:00
|
|
|
}, {
|
2018-10-18 09:41:25 +00:00
|
|
|
relation: 'client',
|
|
|
|
scope: {
|
2020-04-25 09:50:04 +00:00
|
|
|
fields: [
|
|
|
|
'salesPersonFk',
|
|
|
|
'name',
|
|
|
|
'isActive',
|
|
|
|
'isFreezed',
|
|
|
|
'isTaxDataChecked'
|
|
|
|
],
|
2018-10-18 09:41:25 +00:00
|
|
|
include: {
|
|
|
|
relation: 'salesPerson',
|
2019-01-31 13:14:39 +00:00
|
|
|
scope: {
|
|
|
|
fields: ['userFk'],
|
|
|
|
include: {
|
|
|
|
relation: 'user',
|
|
|
|
scope: {
|
|
|
|
fields: ['nickname']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-10-18 09:41:25 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-25 09:50:04 +00:00
|
|
|
}, {
|
2019-01-31 13:14:39 +00:00
|
|
|
relation: 'state',
|
2018-10-18 09:41:25 +00:00
|
|
|
scope: {
|
|
|
|
fields: ['stateFk'],
|
|
|
|
include: {
|
|
|
|
relation: 'state',
|
2019-01-31 13:14:39 +00:00
|
|
|
fields: ['id', 'name'],
|
2018-10-18 09:41:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
2020-04-25 09:50:04 +00:00
|
|
|
|
|
|
|
return this.getData(`Tickets/${this.id}`, {filter})
|
|
|
|
.then(res => this.entity = res.data);
|
2018-10-18 09:41:25 +00:00
|
|
|
}
|
2018-08-30 06:50:03 +00:00
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
ngModule.vnComponent('vnTicketDescriptorPopover', {
|
|
|
|
slotTemplate: require('./index.html'),
|
|
|
|
controller: Controller
|
2018-08-30 06:50:03 +00:00
|
|
|
});
|