ticket module descriptor now takes warehouseFk from the ticket

This commit is contained in:
Carlos Jimenez Ruiz 2021-05-21 15:31:28 +02:00
parent 1bfe537186
commit 5c18c5c94c
10 changed files with 41 additions and 27 deletions

View File

@ -24,7 +24,7 @@
<tr class="initial"> <tr class="initial">
<td rowspan="{{::sale.components.length + 1}}" number> <td rowspan="{{::sale.components.length + 1}}" number>
<span <span
ng-click="descriptor.show($event, sale.itemFk, sale.id)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
@ -103,11 +103,11 @@
</div> </div>
</vn-side-menu> </vn-side-menu>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"> warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-zone-descriptor-popover <vn-zone-descriptor-popover
vn-id="zoneDescriptor"> vn-id="zone-descriptor">
</vn-zone-descriptor-popover> </vn-zone-descriptor-popover>

View File

@ -57,15 +57,15 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor" vn-id="item-descriptor"
warehouse-fk="this.ticket.warehouseFk", warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-confirm <vn-confirm
vn-id="deleteExpedition" vn-id="delete-expedition"
on-accept="$ctrl.onDialogAccept($data)" on-accept="$ctrl.onDialogAccept($data)"
question="Delete expedition" question="Delete expedition"
message="Are you sure you want to delete this expedition?"> message="Are you sure you want to delete this expedition?">

View File

@ -7,6 +7,12 @@
data="sales" data="sales"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-crud-model
url="tickets"
link="{id: $ctrl.$params.id}"
data="tickets"
auto-load="true">
</vn-crud-model>
<vn-vertical> <vn-vertical>
<vn-card <vn-card
ng-if="!model.data || model.data.length == 0" ng-if="!model.data || model.data.length == 0"
@ -25,7 +31,7 @@
</div> </div>
<div class="description"> <div class="description">
<h3> <h3>
<span class="link" ng-click="descriptor.show($event, sale.item.id)"> <span class="link" ng-click="itemDescriptor.show($event, sale.item.id)">
{{::sale.item.name}} {{::sale.item.name}}
</span> </span>
</h3> </h3>
@ -63,5 +69,6 @@
<vn-pagination model="model"></vn-pagination> <vn-pagination model="model"></vn-pagination>
</vn-vertical> </vn-vertical>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="tickets[0].warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -8,6 +8,12 @@
data="purchaseRequests" data="purchaseRequests"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-crud-model
url="tickets"
link="{id: $ctrl.$params.id}"
data="tickets"
auto-load="true">
</vn-crud-model>
<vn-watcher <vn-watcher
vn-id="watcher" vn-id="watcher"
data="purchaseRequests"> data="purchaseRequests">
@ -24,7 +30,7 @@
<vn-th>Atender</vn-th> <vn-th>Atender</vn-th>
<vn-th number>Quantity</vn-th> <vn-th number>Quantity</vn-th>
<vn-th number>Price</vn-th> <vn-th number>Price</vn-th>
<vn-th number>Sale id</vn-th> <vn-th number>Item id</vn-th>
<vn-th number>Ok</vn-th> <vn-th number>Ok</vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
@ -101,10 +107,11 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="tickets[0].warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<a ui-sref="ticket.card.request.create" <a ui-sref="ticket.card.request.create"
vn-tooltip="New request" vn-tooltip="New request"

View File

@ -29,7 +29,7 @@
</vn-td> </vn-td>
<vn-td number> <vn-td number>
<span <span
ng-click="$ctrl.showDescriptor($event, sale)" ng-click="$ctrl.showItemDescriptor($event, sale)"
class="link"> class="link">
{{::sale.itemFk | zeroFill:6}} {{::sale.itemFk | zeroFill:6}}
</span> </span>
@ -52,7 +52,7 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk" warehouse-fk="$ctrl.ticket.warehouseFk"
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -17,7 +17,7 @@ class Controller extends Section {
] ]
}; };
} }
showDescriptor(event, sale) { showItemDescriptor(event, sale) {
this.quicklinks = { this.quicklinks = {
btnThree: { btnThree: {
icon: 'icon-transaction', icon: 'icon-transaction',
@ -29,7 +29,7 @@ class Controller extends Section {
tooltip: 'Item diary' tooltip: 'Item diary'
} }
}; };
this.$.descriptor.show(event.target, sale.itemFk); this.$.itemDescriptor.show(event.target, sale.itemFk);
} }
} }

View File

@ -67,9 +67,9 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"> warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>

View File

@ -100,7 +100,7 @@
</vn-td> </vn-td>
<vn-td shrink> <vn-td shrink>
<span class="link" ng-if="sale.id" <span class="link" ng-if="sale.id"
ng-click="descriptor.show($event, sale.itemFk, sale.id)"> ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)">
{{sale.itemFk}} {{sale.itemFk}}
</span> </span>
<vn-autocomplete ng-if="!sale.id" class="dense" <vn-autocomplete ng-if="!sale.id" class="dense"
@ -190,7 +190,7 @@
fixed-bottom-right> fixed-bottom-right>
</vn-float-button> </vn-float-button>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk", warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -147,7 +147,7 @@
</vn-td> </vn-td>
<vn-td number shrink> <vn-td number shrink>
<span <span
ng-click="descriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
@ -259,7 +259,7 @@
<vn-td number> <vn-td number>
<span <span
ng-show="::request.saleFk" ng-show="::request.saleFk"
ng-click="descriptor.show($event, request.sale.itemFk, request.sale.id)" ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)"
class="link"> class="link">
{{request.sale.itemFk | zeroFill:6}} {{request.sale.itemFk | zeroFill:6}}
</span> </span>
@ -279,10 +279,10 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-route-descriptor-popover <vn-route-descriptor-popover
vn-id="routeDescriptor"> vn-id="route-descriptor">
</vn-route-descriptor-popover> </vn-route-descriptor-popover>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk", warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -37,7 +37,7 @@
<vn-tr ng-repeat="sale in $ctrl.sales"> <vn-tr ng-repeat="sale in $ctrl.sales">
<vn-td number> <vn-td number>
<span <span
ng-click="descriptor.show($event, sale.itemFk, sale.id)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
@ -63,7 +63,7 @@
</vn-card> </vn-card>
</vn-vertical> </vn-vertical>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"> warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>