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,54 +8,77 @@
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-table model="model"> <vn-horizontal class="header">
<vn-thead> <vn-tool-bar class="vn-mb-md">
<vn-tr> <vn-button icon="keyboard_arrow_down"
<vn-th></vn-th> label="More"
<vn-th field="itemFk" number>Expedition</vn-th> ng-click="moreOptions.show($event)"
<vn-th field="itemFk" number>Item</vn-th> ng-show="$ctrl.hasSelectedSales()">
<vn-th field="packageItemName">Name</vn-th> </vn-button>
<vn-th field="freightItemName">Package type</vn-th> <vn-button
<vn-th field="counter" number>Counter</vn-th> disabled="!$ctrl.hasSelectedSales() || !$ctrl.isEditable"
<vn-th field="externalId" number>externalId</vn-th> icon="delete"
<vn-th field="created" expand>Created</vn-th> ng-click="deleteExpedition.show(expedition.id)"
<vn-th field="state" expand>State</vn-th> vn-tooltip="Delete expedition">
<vn-th></vn-th> </vn-button>
</vn-tr> </vn-tool-bar>
</vn-thead> <vn-one class="taxes" ng-if="$ctrl.sales.length > 0">
<vn-tbody> <p><vn-label translate>Subtotal</vn-label> {{$ctrl.ticket.totalWithoutVat | currency: 'EUR':2}}</p>
<vn-tr ng-repeat="expedition in expeditions"> <p><vn-label translate>VAT</vn-label> {{$ctrl.ticket.totalWithVat - $ctrl.ticket.totalWithoutVat | currency: 'EUR':2}}</p>
<vn-td class="vn-px-md" style="width:30px; color:#FFA410;"> <p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.ticket.totalWithVat | currency: 'EUR':2}}</strong></p>
<vn-icon-button icon="delete" </vn-one>
ng-click="deleteExpedition.show(expedition.id)" </vn-horizontal>
vn-tooltip="Delete expedition"> <vn-table model="model">
</vn-icon-button> <vn-thead>
</vn-td> <vn-tr>
<vn-td number expand>{{expedition.id | zeroFill:6}}</vn-td> <vn-th shrink>
<vn-td number> <vn-multi-check
<span model="model">
ng-class="{link: expedition.packagingItemFk}" </vn-multi-check>
ng-click="itemDescriptor.show($event, expedition.packagingItemFk)"> </vn-th>
{{expedition.packagingFk}} <vn-th field="itemFk" number>Expedition</vn-th>
</span> <vn-th field="itemFk" number>Item</vn-th>
</vn-td> <vn-th field="packageItemName">Name</vn-th>
<vn-td>{{::expedition.packageItemName}}</vn-td> <vn-th field="freightItemName">Package type</vn-th>
<vn-td>{{::expedition.freightItemName}}</vn-td> <vn-th field="counter" number>Counter</vn-th>
<vn-td number>{{::expedition.counter}}</vn-td> <vn-th field="externalId" number>externalId</vn-th>
<vn-td expand>{{::expedition.externalId}}</vn-td> <vn-th field="created" expand>Created</vn-th>
<vn-td shrink-datetime>{{::expedition.created | date:'dd/MM/yyyy HH:mm'}}</vn-td> <vn-th field="state" expand>State</vn-th>
<vn-td>{{::expedition.state}}</vn-td> <vn-th></vn-th>
<vn-td> </vn-tr>
<vn-icon-button </vn-thead>
vn-click-stop="$ctrl.showLog(expedition)" <vn-tbody>
vn-tooltip="Status log" <vn-tr ng-repeat="expedition in expeditions">
icon="history"> <vn-td shrink>
</vn-icon-button> <vn-check tabindex="-1"
</vn-td> ng-model="expedition.checked">
</vn-tr> </vn-check>
</vn-tbody> </vn-td>
</vn-table> <vn-td number expand>{{expedition.id | zeroFill:6}}</vn-td>
<vn-td number>
<span
ng-class="{link: expedition.packagingItemFk}"
ng-click="itemDescriptor.show($event, expedition.packagingItemFk)">
{{expedition.packagingFk}}
</span>
</vn-td>
<vn-td>{{::expedition.packageItemName}}</vn-td>
<vn-td>{{::expedition.freightItemName}}</vn-td>
<vn-td number>{{::expedition.counter}}</vn-td>
<vn-td expand>{{::expedition.externalId}}</vn-td>
<vn-td shrink-datetime>{{::expedition.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::expedition.state}}</vn-td>
<vn-td>
<vn-icon-button
vn-click-stop="$ctrl.showLog(expedition)"
vn-tooltip="Status log"
icon="history">
</vn-icon-button>
</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover

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', {