|
|
@@ -152,18 +152,20 @@
|
|
|
},
|
|
|
filterMaterial(e){
|
|
|
let value = $(e.target).val();
|
|
|
- if(value==='' || value===null)this.filterMaterials = this.materials;
|
|
|
+ let materials = JSON.parse(JSON.stringify(this.materials));
|
|
|
+ if(value==='' || value===null)this.filterMaterials = materials;
|
|
|
else {
|
|
|
- this.filterMaterials = this.materials.filter(function(item){
|
|
|
+ this.filterMaterials = materials.filter(function(item){
|
|
|
return item.code.indexOf(value) !== -1;
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
filterOwner(e){
|
|
|
let value = $(e.target).val();
|
|
|
- if(value==='' || value===null)this.filterMaterials = this.materials;
|
|
|
+ let owners = JSON.parse(JSON.stringify(this.owners));
|
|
|
+ if(value==='' || value===null)this.filterOwners = owners;
|
|
|
else {
|
|
|
- this.filterOwners = this.owners.filter(function(item){
|
|
|
+ this.filterOwners = owners.filter(function(item){
|
|
|
return item.name.indexOf(value) !== -1;
|
|
|
});
|
|
|
}
|