mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Search for company
This commit is contained in:
parent
0e29f9b88c
commit
cc2e3351ff
@ -25,6 +25,8 @@ InvenTree | Search Results
|
||||
|
||||
{% include "InvenTree/search_parts.html" with collapse_id='parts' %}
|
||||
|
||||
{% include "InvenTree/search_company.html" with collapse_id='companies' %}
|
||||
|
||||
{% include "InvenTree/search_supplier_parts.html" with collapse_id='supplier_parts' %}
|
||||
|
||||
{% include "InvenTree/search_stock_location.html" with collapse_id="locations" %}
|
||||
@ -77,6 +79,8 @@ InvenTree | Search Results
|
||||
|
||||
onSearchResults('#part-results-table', '#part-result-count');
|
||||
|
||||
onSearchResults('#company-results-table', '#company-result-count');
|
||||
|
||||
onSearchResults('#supplier-part-results-table', '#supplier-part-result-count');
|
||||
|
||||
$("#category-results-table").bootstrapTable({
|
||||
@ -130,6 +134,29 @@ InvenTree | Search Results
|
||||
}
|
||||
);
|
||||
|
||||
$("#company-results-table").bootstrapTable({
|
||||
url: "{% url 'api-company-list' %}",
|
||||
queryParams: {
|
||||
search: "{{ query }}",
|
||||
},
|
||||
pagination: true,
|
||||
pageSize: 25,
|
||||
search: true,
|
||||
columns: [
|
||||
{
|
||||
field: 'name',
|
||||
title: 'Name',
|
||||
formatter: function(value, row, index, field) {
|
||||
return imageHoverIcon(row.image) + renderLink(value, row.url);
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
title: 'Description',
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
$("#supplier-part-results-table").bootstrapTable({
|
||||
url: "{% url 'api-part-supplier-list' %}",
|
||||
queryParams: {
|
||||
|
14
InvenTree/templates/InvenTree/search_company.html
Normal file
14
InvenTree/templates/InvenTree/search_company.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "collapse.html" %}
|
||||
|
||||
{% block collapse_title %}
|
||||
<h4>Companies</h4>
|
||||
{% endblock %}
|
||||
|
||||
{% block collapse_heading %}
|
||||
<h4><span id='company-result-count'>{% include "InvenTree/searching.html" %}</span></h4>
|
||||
{% endblock %}
|
||||
|
||||
{% block collapse_content %}
|
||||
<table class='table table-striped table-condensed' data-toolbar="#button-toolbar" id='company-results-table'>
|
||||
</table>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user