added client descriptor popover to ticket descriptor

This commit is contained in:
gerard 2018-07-26 14:02:23 +02:00
parent fa9494fe03
commit d2359af6ba
3 changed files with 28 additions and 12 deletions

View File

@ -20,7 +20,7 @@ input[type=reset]::-moz-focus-inner
.link{
text-decoration: underline;
&:hover{
color: $main-01;
color: $main-01!important;
}
}

View File

@ -9,30 +9,32 @@
</a>
</vn-horizontal>
<div pad-medium>
<h5>{{$ctrl.client.name}}</h5>
<h5>{{::$ctrl.client.name}}</h5>
<vn-label-value label="Id"
value="{{$ctrl.ticket.id}}">
value="{{::$ctrl.ticket.id}}">
</vn-label-value>
<vn-label-value label="Client"
value="{{$ctrl.ticket.client.name}}">
class="link"
ng-click="$ctrl.showDescriptor($event, $ctrl.ticket.client.id)"
value="{{::$ctrl.ticket.client.name}}">
</vn-label-value>
<vn-label-value label="State"
value="{{$ctrl.ticket.tracking.state.name}}">
value="{{::$ctrl.ticket.tracking.state.name}}">
</vn-label-value>
<vn-label-value label="Sales person"
value="{{$ctrl.ticket.client.salesPerson.firstName}} {{$ctrl.ticket.client.salesPerson.name}}">
value="{{::$ctrl.ticket.client.salesPerson.firstName}} {{::$ctrl.ticket.client.salesPerson.name}}">
</vn-label-value>
<vn-label-value label="Shipped"
value="{{$ctrl.ticket.shipped | date: 'dd/MM/yyyy HH:mm' }}">
value="{{::$ctrl.ticket.shipped | date: 'dd/MM/yyyy HH:mm' }}">
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.ticket.agencyMode.name}}">
value="{{::$ctrl.ticket.agencyMode.name}}">
</vn-label-value>
<vn-label-value label="Warehouse"
value="{{$ctrl.ticket.warehouse.name}}">
value="{{::$ctrl.ticket.warehouse.name}}">
</vn-label-value>
<vn-label-value label="Alias"
value="{{$ctrl.ticket.nickname}}">
value="{{::$ctrl.ticket.nickname}}">
</vn-label-value>
</div>
<vn-horizontal pad-medium-bottom class="footer">
@ -58,3 +60,4 @@
</vn-icon>
</vn-horizontal>
</vn-card>
<vn-client-descriptor-popover vn-id="descriptor"></vn-client-descriptor-popover>

View File

@ -2,7 +2,8 @@ import ngModule from '../module';
class Controller {
constructor($http) {
constructor($http, $scope) {
this.$ = $scope;
this.$http = $http;
}
@ -12,13 +13,25 @@ class Controller {
});
}
showDescriptor(event, clientFk) {
this.$.descriptor.clientFk = clientFk;
this.$.descriptor.parent = event.target;
this.$.descriptor.show();
event.preventDefault();
event.stopImmediatePropagation();
}
onDescriptorLoad() {
this.$.popover.relocate();
}
$onChanges() {
if (this.ticket)
this.getClientDebt(this.ticket.clientFk);
}
}
Controller.$inject = ['$http'];
Controller.$inject = ['$http', '$scope'];
ngModule.component('vnTicketDescriptor', {
template: require('./index.html'),