show itemDiary icon on ticket descriptor popover. #441 - CR Javi
This commit is contained in:
parent
b5356eb07d
commit
d83665a0c5
|
@ -1,4 +1,7 @@
|
|||
<vn-popover vn-id="popover">
|
||||
<vn-client-descriptor client="$ctrl.client" clientFk="$ctrl.clientFk">
|
||||
<vn-client-descriptor
|
||||
client="$ctrl.client"
|
||||
clientFk="$ctrl.clientFk"
|
||||
quicklinks="$ctrl.quicklinks">
|
||||
</vn-client-descriptor>
|
||||
</vn-popover>
|
||||
|
|
|
@ -9,6 +9,22 @@ class Controller extends Component {
|
|||
this.$timeout = $timeout;
|
||||
this.isTooltip = true;
|
||||
this.client = {};
|
||||
this.links = {};
|
||||
}
|
||||
|
||||
set clientFk(value) {
|
||||
if (value) {
|
||||
this._getClient(value);
|
||||
this._getClientDebt(value);
|
||||
}
|
||||
}
|
||||
|
||||
set quicklinks(value = {}) {
|
||||
this._quicklinks = Object.assign(value, this.links);
|
||||
}
|
||||
|
||||
get quicklinks() {
|
||||
return this._quicklinks;
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
@ -34,13 +50,6 @@ class Controller extends Component {
|
|||
this.$state.go('ticket.index', {q: `{"clientFk": ${this.client.id}}`});
|
||||
}
|
||||
|
||||
set clientFk(value) {
|
||||
if (value) {
|
||||
this._getClient(value);
|
||||
this._getClientDebt(value);
|
||||
}
|
||||
}
|
||||
|
||||
show() {
|
||||
this.$.popover.parent = this.parent;
|
||||
setTimeout(() => {
|
||||
|
@ -56,6 +65,7 @@ ngModule.component('vnClientDescriptorPopover', {
|
|||
controller: Controller,
|
||||
bindings: {
|
||||
client: '<',
|
||||
clientFk: '<'
|
||||
clientFk: '<',
|
||||
quicklinks: '<'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -53,11 +53,23 @@
|
|||
ng-class="{bright: $ctrl.client.isTaxDataChecked == false}">
|
||||
</vn-icon>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal pad-small class="buttons">
|
||||
<vn-button
|
||||
vn-tooltip="Client ticket list"
|
||||
icon="icon-ticket"
|
||||
ng-click="$ctrl.goToClientTickets()">
|
||||
<vn-horizontal pad-small class="quicklinks">
|
||||
<vn-button ng-if="$ctrl.quicklinks.btnOne" pad-small-right
|
||||
vn-tooltip="{{::$ctrl.quicklinks.btnOne.tooltip}}"
|
||||
icon="{{::$ctrl.quicklinks.btnOne.icon}}"
|
||||
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnOne.state, $ctrl.quicklinks.btnOne.params)">
|
||||
</vn-button>
|
||||
|
||||
<vn-button ng-if="$ctrl.quicklinks.btnTwo" pad-small-right
|
||||
vn-tooltip="{{::$ctrl.quicklinks.btnTwo.tooltip}}"
|
||||
icon="{{::$ctrl.quicklinks.btnTwo.icon}}"
|
||||
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnTwo.state, $ctrl.quicklinks.btnTwo.params)">
|
||||
</vn-button>
|
||||
|
||||
<vn-button ng-if="$ctrl.quicklinks.btnThree" pad-small-right
|
||||
vn-tooltip="{{::$ctrl.quicklinks.btnThree.tooltip}}"
|
||||
icon="{{::$ctrl.quicklinks.btnThree.icon}}"
|
||||
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnThree.state, $ctrl.quicklinks.btnThree.params)">
|
||||
</vn-button>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
|
@ -4,7 +4,31 @@ class Controller {
|
|||
constructor($http, $state) {
|
||||
this.$state = $state;
|
||||
this.$http = $http;
|
||||
this.links = {
|
||||
btnOne: {
|
||||
icon: 'icon-ticket',
|
||||
state: 'ticket.index',
|
||||
params: {q: `{"clientFk": ${$state.params.id}}`},
|
||||
tooltip: 'Client ticket list'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
set clientFk(value) {
|
||||
if (value) {
|
||||
this._getClient(value);
|
||||
this._getClientDebt(value);
|
||||
}
|
||||
}
|
||||
|
||||
set quicklinks(value = {}) {
|
||||
this._quicklinks = Object.assign(value, this.links);
|
||||
}
|
||||
|
||||
get quicklinks() {
|
||||
return this._quicklinks;
|
||||
}
|
||||
|
||||
_getClientDebt(clientFk) {
|
||||
this.$http.get(`/client/api/Clients/${clientFk}/getDebt`)
|
||||
.then(response => {
|
||||
|
@ -23,11 +47,8 @@ class Controller {
|
|||
this.$state.go('ticket.index', {q: `{"clientFk": ${this.client.id}}`});
|
||||
}
|
||||
|
||||
set clientFk(value) {
|
||||
if (value) {
|
||||
this._getClient(value);
|
||||
this._getClientDebt(value);
|
||||
}
|
||||
quicklinkGo(state, params) {
|
||||
this.$state.go(state, params);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +58,8 @@ ngModule.component('vnClientDescriptor', {
|
|||
template: require('./index.html'),
|
||||
bindings: {
|
||||
client: '<',
|
||||
clientFk: '<?'
|
||||
clientFk: '<?',
|
||||
quicklinks: '<'
|
||||
},
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<vn-item-descriptor
|
||||
item="$ctrl.item"
|
||||
item-tags="$ctrl.itemTags"
|
||||
tags="$ctrl.tags">
|
||||
tags="$ctrl.tags"
|
||||
quicklinks="$ctrl.quicklinks">
|
||||
</vn-item-descriptor>
|
||||
</vn-popover>
|
||||
|
|
|
@ -7,11 +7,19 @@ class Controller extends Component {
|
|||
super($element, $scope);
|
||||
this.$http = $http;
|
||||
this.$timeout = $timeout;
|
||||
|
||||
this.links = {};
|
||||
this.isTooltip = true;
|
||||
this.clear();
|
||||
}
|
||||
|
||||
set quicklinks(value = {}) {
|
||||
this._quicklinks = Object.assign(value, this.links);
|
||||
}
|
||||
|
||||
get quicklinks() {
|
||||
return this._quicklinks;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.item = null;
|
||||
this.tags = {};
|
||||
|
@ -90,7 +98,8 @@ Controller.$inject = ['$element', '$scope', '$http', '$timeout'];
|
|||
ngModule.component('vnItemDescriptorPopover', {
|
||||
template: require('./index.html'),
|
||||
bindings: {
|
||||
itemFk: '<'
|
||||
itemFk: '<',
|
||||
quicklinks: '<'
|
||||
},
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -37,4 +37,23 @@
|
|||
</vn-label-value>
|
||||
</vn-auto>
|
||||
</vn-vertical>
|
||||
<vn-horizontal pad-small class="quicklinks">
|
||||
<vn-button ng-if="$ctrl.quicklinks.btnOne" pad-small-right
|
||||
vn-tooltip="{{::$ctrl.quicklinks.btnOne.tooltip}}"
|
||||
icon="{{::$ctrl.quicklinks.btnOne.icon}}"
|
||||
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnOne.state, $ctrl.quicklinks.btnOne.params)">
|
||||
</vn-button>
|
||||
|
||||
<vn-button ng-if="$ctrl.quicklinks.btnTwo" pad-small-right
|
||||
vn-tooltip="{{::$ctrl.quicklinks.btnTwo.tooltip}}"
|
||||
icon="{{::$ctrl.quicklinks.btnTwo.icon}}"
|
||||
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnTwo.state, $ctrl.quicklinks.btnTwo.params)">
|
||||
</vn-button>
|
||||
|
||||
<vn-button ng-if="$ctrl.quicklinks.btnThree" pad-small-right
|
||||
vn-tooltip="{{::$ctrl.quicklinks.btnThree.tooltip}}"
|
||||
icon="{{::$ctrl.quicklinks.btnThree.icon}}"
|
||||
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnThree.state, $ctrl.quicklinks.btnThree.params)">
|
||||
</vn-button>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
|
|
|
@ -1,11 +1,34 @@
|
|||
import ngModule from '../module';
|
||||
import './style.scss';
|
||||
|
||||
class Controller {
|
||||
constructor($state) {
|
||||
this.$state = $state;
|
||||
this.links = {};
|
||||
}
|
||||
|
||||
set quicklinks(value = {}) {
|
||||
this._quicklinks = Object.assign(value, this.links);
|
||||
}
|
||||
|
||||
get quicklinks() {
|
||||
return this._quicklinks;
|
||||
}
|
||||
|
||||
quicklinkGo(state, params) {
|
||||
this.$state.go(state, params);
|
||||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$state'];
|
||||
|
||||
ngModule.component('vnItemDescriptor', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
item: '<',
|
||||
itemTags: '<',
|
||||
tags: '<'
|
||||
tags: '<',
|
||||
quicklinks: '<'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -206,7 +206,7 @@ vn-main-block {
|
|||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
.quicklinks {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
|
|
|
@ -164,7 +164,8 @@
|
|||
</vn-table>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-item-descriptor-popover vn-id="descriptor">
|
||||
<vn-item-descriptor-popover vn-id="descriptor"
|
||||
quicklinks="$ctrl.quicklinks">
|
||||
</vn-item-descriptor-popover>
|
||||
|
||||
<!-- Add Turn Dialog -->
|
||||
|
|
|
@ -20,6 +20,25 @@ class Controller {
|
|||
];
|
||||
}
|
||||
|
||||
set ticket(value) {
|
||||
this._ticket = value;
|
||||
|
||||
if (!value) return;
|
||||
|
||||
this.quicklinks = {
|
||||
btnThree: {
|
||||
icon: 'icon-transaction',
|
||||
state: 'item.card.diary',
|
||||
params: {id: value.id, q: `{"warehouseFk": ${value.warehouseFk}}`},
|
||||
tooltip: 'Item diary'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
get ticket() {
|
||||
return this._ticket;
|
||||
}
|
||||
|
||||
onDataChange() {
|
||||
this.sales = this.$scope.model.data;
|
||||
this.getTaxes();
|
||||
|
|
Loading…
Reference in New Issue