feat: add option "move expedition"
gitea/salix/pipeline/head This commit is unstable Details

This commit is contained in:
Vicent Llopis 2022-09-22 14:58:38 +02:00
parent 9d7e12d861
commit 2a64fde57c
2 changed files with 82 additions and 48 deletions

View File

@ -8,11 +8,35 @@
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-data-viewer model="model"> <vn-data-viewer model="model">
<vn-card class="vn-w-xl"> <vn-card class="vn-pa-lg">
<vn-horizontal class="header">
<vn-tool-bar class="vn-mb-md">
<vn-button icon="keyboard_arrow_down"
label="More"
ng-click="moreOptions.show($event)"
ng-show="$ctrl.hasSelectedSales()">
</vn-button>
<vn-button
disabled="!$ctrl.hasSelectedSales() || !$ctrl.isEditable"
icon="delete"
ng-click="deleteExpedition.show(expedition.id)"
vn-tooltip="Delete expedition">
</vn-button>
</vn-tool-bar>
<vn-one class="taxes" ng-if="$ctrl.sales.length > 0">
<p><vn-label translate>Subtotal</vn-label> {{$ctrl.ticket.totalWithoutVat | currency: 'EUR':2}}</p>
<p><vn-label translate>VAT</vn-label> {{$ctrl.ticket.totalWithVat - $ctrl.ticket.totalWithoutVat | currency: 'EUR':2}}</p>
<p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.ticket.totalWithVat | currency: 'EUR':2}}</strong></p>
</vn-one>
</vn-horizontal>
<vn-table model="model"> <vn-table model="model">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th></vn-th> <vn-th shrink>
<vn-multi-check
model="model">
</vn-multi-check>
</vn-th>
<vn-th field="itemFk" number>Expedition</vn-th> <vn-th field="itemFk" number>Expedition</vn-th>
<vn-th field="itemFk" number>Item</vn-th> <vn-th field="itemFk" number>Item</vn-th>
<vn-th field="packageItemName">Name</vn-th> <vn-th field="packageItemName">Name</vn-th>
@ -26,11 +50,10 @@
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
<vn-tr ng-repeat="expedition in expeditions"> <vn-tr ng-repeat="expedition in expeditions">
<vn-td class="vn-px-md" style="width:30px; color:#FFA410;"> <vn-td shrink>
<vn-icon-button icon="delete" <vn-check tabindex="-1"
ng-click="deleteExpedition.show(expedition.id)" ng-model="expedition.checked">
vn-tooltip="Delete expedition"> </vn-check>
</vn-icon-button>
</vn-td> </vn-td>
<vn-td number expand>{{expedition.id | zeroFill:6}}</vn-td> <vn-td number expand>{{expedition.id | zeroFill:6}}</vn-td>
<vn-td number> <vn-td number>

View File

@ -11,6 +11,17 @@ class Controller extends Section {
this.expedition = expedition; this.expedition = expedition;
this.$.statusLog.show(); this.$.statusLog.show();
} }
get checked() {
const rows = this.$.model.data || [];
const checkedRows = [];
for (let row of rows) {
if (row.checked)
checkedRows.push(row);
}
return checkedRows;
}
} }
ngModule.vnComponent('vnTicketExpedition', { ngModule.vnComponent('vnTicketExpedition', {