salix/modules/ticket/front/request/index/index.html

111 lines
4.0 KiB
HTML

<vn-crud-model
vn-id="model"
url="TicketRequests"
fields="['id', 'description', 'created', 'requesterFk', 'attenderFk', 'quantity', 'price', 'saleFk', 'isOk']"
order="created ASC"
link="{ticketFk: $ctrl.$params.id}"
filter="::$ctrl.filter"
data="purchaseRequests"
auto-load="true">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="purchaseRequests">
</vn-watcher>
<vn-data-viewer model="model">
<vn-card class="vn-w-xl">
<vn-table model="model">
<vn-thead>
<vn-tr>
<vn-th number>Id</vn-th>
<vn-th>Description</vn-th>
<vn-th expand>Created</vn-th>
<vn-th>Requester</vn-th>
<vn-th>Atender</vn-th>
<vn-th number>Quantity</vn-th>
<vn-th number>Price</vn-th>
<vn-th number>Item id</vn-th>
<vn-th number>State</vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="request in purchaseRequests">
<vn-td number>{{::request.id}}</vn-td>
<vn-td expand>
<vn-textfield
vn-one
disabled="$ctrl.isEditable(request.isOk)"
ng-model="::request.description"
on-change="$ctrl.updateData()">
</vn-textfield>
</vn-td>
<vn-td expand>{{::request.created | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td>
<span
class="link"
ng-click="workerDescriptor.show($event, request.requesterFk)">
{{::request.requester.user.nickname | dashIfEmpty}}
</span>
</vn-td>
<vn-td>
<span
class="link"
ng-click="workerDescriptor.show($event, request.attenderFk)">
{{::request.atender.user.nickname | dashIfEmpty}}
</span>
</vn-td>
<vn-td>
<vn-input-number
min="1"
disabled="$ctrl.isEditable(request.isOk)"
ng-model="::request.quantity"
on-change="$ctrl.updateData()">
</vn-input-number>
</vn-td>
<vn-td>
<vn-input-number
step="0.01"
disabled="$ctrl.isEditable(request.isOk)"
ng-model="::request.price"
on-change="$ctrl.updateData()">
</vn-input-number>
</vn-td>
<vn-td number>
<span
ng-show="::request.saleFk"
ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)"
class="link">
{{::request.saleFk}}
</span>
</vn-td>
<vn-td number
translate>
{{$ctrl.getRequestState(request.isOk)}}
</vn-td>
<vn-td number>
<vn-icon-button
disabled="::request.saleFk"
icon="delete"
ng-click="$ctrl.removeLine($index)"
vn-tooltip="Remove request"
tabindex="-1">
</vn-icon-button>
</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<a ui-sref="ticket.card.request.create"
vn-tooltip="New request"
vn-bind="+"
fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>
</a>