2029 - Item request fixes & searchbar filters working
gitea/salix/2029-fix_item_request_filters This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-02-06 14:33:28 +01:00
parent a3a7b4cbaa
commit 3e0fd10b41
2 changed files with 12 additions and 20 deletions

View File

@ -6,14 +6,15 @@
order="shipped DESC, isOk ASC">
</vn-crud-model>
<vn-portal slot="topbar">
<vn-searchbar
vn-focus
<vn-searchbar vn-focus
panel="vn-request-search-panel"
on-search="$ctrl.onSearch($params)"
info="Search request by id or alias"
suggested-filter="$ctrl.filter.where">
suggested-filter="$ctrl.filter.where"
info="Search request by id or alias">
</vn-searchbar>
</vn-portal>
<vn-auto-search
on-search="$ctrl.onSearch($params)">
</vn-auto-search>
<vn-data-viewer model="model">
<vn-card>
<vn-table model="model">
@ -21,8 +22,6 @@
<vn-tr>
<vn-th field="ticketFk" number>Ticket ID</vn-th>
<vn-th field="shipped">Shipped</vn-th>
<vn-th field="warehouse">Warehouse</vn-th>
<vn-th field="salesPersonNickname">SalesPerson</vn-th>
<vn-th field="description">Description</vn-th>
<vn-th field="quantity" number editable>Requested</vn-th>
<vn-th field="price" number>Price</vn-th>
@ -47,15 +46,7 @@
{{::request.shipped | date: 'dd/MM/yyyy'}}
</span>
</vn-td>
<vn-td>{{::request.warehouse}}</vn-td>
<vn-td>
<span
class="link"
ng-click="$ctrl.showWorkerDescriptor($event, request.salesPersonFk)">
{{::request.salesPersonNickname}}
</span>
</vn-td>
<vn-td title="{{::request.description}}">{{::request.description}}</vn-td>
<vn-td title="{{::request.description}}" expand>{{::request.description}}</vn-td>
<vn-td number>{{::request.quantity}}</vn-td>
<vn-td number>{{::request.price | currency: 'EUR':2}}</vn-td>
<vn-td>
@ -82,7 +73,7 @@
</vn-input-number>
</field>
</vn-td-editable>
<vn-td>
<vn-td expand>
<span
class="link"
ng-click="$ctrl.showItemDescriptor($event, request.itemFk)"
@ -101,7 +92,8 @@
ng-if="request.isOk != 0"
icon="thumb_down"
ng-click="$ctrl.showDenyReason($event, request)"
translate-attr="{title: 'Discard'}">
translate-attr="{title: 'Discard'}"
tabindex="-1">
</vn-icon-button>
</vn-td>
</vn-tr>
@ -124,7 +116,7 @@
<tpl-body>
<h5 class="vn-pa-md" translate>Specify the reasons to deny this request</h5>
<vn-horizontal class="vn-pa-md">
<vn-textarea
<vn-textarea vn-focus
ng-model="$ctrl.denyObservation">
</vn-textarea>
</vn-horizontal>

View File

@ -86,6 +86,7 @@ export default class Controller extends Component {
}
onSearch(params) {
console.log(params);
if (params)
this.$.model.applyFilter(null, params);
else
@ -96,7 +97,6 @@ export default class Controller extends Component {
this.selectedRequest = requestId;
this.$.denyReason.parent = event.target;
this.$.denyReason.show();
document.querySelector('vn-item-request vn-textarea textArea').focus();
}
clear() {