added category to item search panel

This commit is contained in:
Gerard 2019-02-14 11:24:04 +01:00
parent 2a48e183e9
commit 9c439e9a92
3 changed files with 26 additions and 7 deletions

View File

@ -1,6 +1,6 @@
Item: Artículo
View item: Ver artículo
Category: Categoría
Category: Reino
Description: Descripción
Size: Medida
Type: Tipo

View File

@ -25,17 +25,21 @@
<vn-autocomplete
vn-one
vn-focus
url="/item/api/ItemTypes"
url="/item/api/ItemCategories"
label="Category"
show-field="name"
value-field="id"
field="filter.categoryFk">
</vn-autocomplete>
<vn-autocomplete
vn-one
vn-focus
url="{{$ctrl.itemTypes}}"
label="Type"
show-field="name"
value-field="id"
field="filter.typeFk">
</vn-autocomplete>
<vn-textfield
vn-one
label="Description"
model="filter.description">
</vn-textfield>
</vn-horizontal>
<vn-horizontal ng-repeat="itemTag in filter.tags">
<vn-autocomplete
@ -71,6 +75,13 @@
tabindex="-1">
</vn-icon-button>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Description"
model="filter.description">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-icon-button
vn-bind="+"

View File

@ -11,6 +11,14 @@ class Controller extends SearchPanel {
this.$.filter = value;
}
get itemTypes() {
if (this.$.filter) {
if (!this.$.filter.categoryFk)
return '/item/api/ItemTypes';
return `/item/api/ItemCategories/${this.$.filter.categoryFk}/itemTypes`;
}
}
get filter() {
return this.$.filter;
}