50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
import ngModule from '../module';
|
|
import './style.scss';
|
|
|
|
class Controller {
|
|
constructor($translate) {
|
|
this.translate = $translate;
|
|
}
|
|
|
|
set order(value) {
|
|
this._order = value;
|
|
|
|
if (value.isConfirmed) {
|
|
this._quicklinks = {
|
|
btnOne: {
|
|
icon: 'icon-ticket',
|
|
state: `ticket.index({q: '{"orderFk": ${value.id}}'})`,
|
|
tooltip: 'Order ticket list'
|
|
},
|
|
btnTwo: {
|
|
icon: 'person',
|
|
state: `client.card.summary({id: ${value.clientFk}})`,
|
|
tooltip: 'Client card'
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
get order() {
|
|
return this._order;
|
|
}
|
|
|
|
set quicklinks(value = {}) {
|
|
this._quicklinks = Object.assign(value, this._quicklinks);
|
|
}
|
|
|
|
get quicklinks() {
|
|
return this._quicklinks;
|
|
}
|
|
}
|
|
|
|
Controller.$inject = ['$translate'];
|
|
|
|
ngModule.component('vnOrderDescriptor', {
|
|
template: require('./index.html'),
|
|
bindings: {
|
|
order: '<'
|
|
},
|
|
controller: Controller
|
|
});
|