Skip to content

Commit

Permalink
поиск по инн
Browse files Browse the repository at this point in the history
  • Loading branch information
Wellheor1 committed Nov 2, 2024
1 parent 32f1693 commit 8e733ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2963,6 +2963,7 @@ def get_companies(request):
{
"pk": company.pk,
"title": company.title,
"inn": company.inn if isinstance(company, Company) else None
}
for company in companies
]
Expand Down
5 changes: 3 additions & 2 deletions l2-frontend/src/construct/ConstructCompany.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<input
v-model.trim="searchCompany"
class="form-control nbr search"
placeholder="Фильтр по названию..."
placeholder="Фильтр по названию|ИНН"
>
<div class="scroll">
<table class="table table-bordered">
Expand Down Expand Up @@ -420,9 +420,10 @@ export default {
filteredCompany() {
return this.companies.filter(company => {
const companyTitle = company.title.toLowerCase();
const companyInn = company.inn.toLowerCase();
const searchTerm = this.searchCompany.toLowerCase();
return companyTitle.includes(searchTerm);
return companyTitle.includes(searchTerm) || companyInn.includes(searchTerm);
});
},
filteredDepartments() {
Expand Down

0 comments on commit 8e733ab

Please sign in to comment.