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 Item: Artículo
View item: Ver artículo View item: Ver artículo
Category: Categoría Category: Reino
Description: Descripción Description: Descripción
Size: Medida Size: Medida
Type: Tipo Type: Tipo

View File

@ -25,17 +25,21 @@
<vn-autocomplete <vn-autocomplete
vn-one vn-one
vn-focus 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" label="Type"
show-field="name" show-field="name"
value-field="id" value-field="id"
field="filter.typeFk"> field="filter.typeFk">
</vn-autocomplete> </vn-autocomplete>
<vn-textfield
vn-one
label="Description"
model="filter.description">
</vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal ng-repeat="itemTag in filter.tags"> <vn-horizontal ng-repeat="itemTag in filter.tags">
<vn-autocomplete <vn-autocomplete
@ -71,6 +75,13 @@
tabindex="-1"> tabindex="-1">
</vn-icon-button> </vn-icon-button>
</vn-horizontal> </vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Description"
model="filter.description">
</vn-textfield>
</vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-icon-button <vn-icon-button
vn-bind="+" vn-bind="+"

View File

@ -11,6 +11,14 @@ class Controller extends SearchPanel {
this.$.filter = value; 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() { get filter() {
return this.$.filter; return this.$.filter;
} }