fixed order item category filter #1079
This commit is contained in:
parent
333d853335
commit
d87e2dbbf0
|
@ -26,6 +26,11 @@ class Controller {
|
||||||
return this._order;
|
return this._order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets filter values from state params
|
||||||
|
*
|
||||||
|
* @param {Object} value - Order data
|
||||||
|
*/
|
||||||
set order(value) {
|
set order(value) {
|
||||||
if (!value.id || this._order) return;
|
if (!value.id || this._order) return;
|
||||||
|
|
||||||
|
@ -57,20 +62,18 @@ class Controller {
|
||||||
this.itemTypes = [];
|
this.itemTypes = [];
|
||||||
this.type = null;
|
this.type = null;
|
||||||
|
|
||||||
if (!value || (this.category && this.category.id == value.id)) {
|
if (!value || (this.category && this.category.id == value.id))
|
||||||
this._category = null;
|
this._category = null;
|
||||||
this.updateStateParams();
|
else
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._category = value;
|
this._category = value;
|
||||||
|
|
||||||
this.updateStateParams();
|
this.updateStateParams();
|
||||||
|
|
||||||
const query = `/item/api/ItemCategories/${value.id}/itemTypes`;
|
if (this.tags.length > 0)
|
||||||
this.$http.get(query).then(res => {
|
this.applyFilters();
|
||||||
this.itemTypes = res.data;
|
|
||||||
});
|
if (value)
|
||||||
|
this.updateItemTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
get type() {
|
get type() {
|
||||||
|
@ -91,6 +94,16 @@ class Controller {
|
||||||
this.applyFilters();
|
this.applyFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refreshes item type dropdown data
|
||||||
|
*/
|
||||||
|
updateItemTypes() {
|
||||||
|
const query = `/item/api/ItemCategories/${this.category.id}/itemTypes`;
|
||||||
|
this.$http.get(query).then(res => {
|
||||||
|
this.itemTypes = res.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onSearch(event) {
|
onSearch(event) {
|
||||||
if (event.key !== 'Enter') return;
|
if (event.key !== 'Enter') return;
|
||||||
this.tags.push({
|
this.tags.push({
|
||||||
|
@ -153,6 +166,9 @@ class Controller {
|
||||||
this.$panel = null;
|
this.$panel = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates url state params from filter values
|
||||||
|
*/
|
||||||
updateStateParams() {
|
updateStateParams() {
|
||||||
const params = {};
|
const params = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue