mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Added part API
- Build allocation table now makes use of this API - Further steps towards allocation table
This commit is contained in:
parent
1b9c98ae3e
commit
ceea053368
@ -14,6 +14,12 @@
|
|||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js_load %}
|
||||||
|
{{ block.super }}
|
||||||
|
<script src="{% static 'script/inventree/api.js' %}"></script>
|
||||||
|
<script src="{% static 'script/inventree/part.js' %}"></script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
@ -21,15 +27,21 @@
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
|
field: 'sub_part.name',
|
||||||
title: 'Part',
|
title: 'Part',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Source',
|
title: 'Source',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
field: 'quantity',
|
||||||
title: 'Quantity',
|
title: 'Quantity',
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
getBomList({part: {{ build.part.id }}}).then(function(response) {
|
||||||
|
$("#build-table").bootstrapTable('load', response);
|
||||||
});
|
});
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
19
InvenTree/static/script/inventree/part.js
Normal file
19
InvenTree/static/script/inventree/part.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/* Part API functions
|
||||||
|
* Requires api.js to be loaded first
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getPartCategoryList(filters={}, options={}) {
|
||||||
|
return inventreeGet('/api/part/category/', filters, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSupplierPartList(filters={}, options={}) {
|
||||||
|
return inventreeGet('/api/part/supplier/', filters, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPartList(filters={}, options={}) {
|
||||||
|
return inventreeGet('/api/part/', filters, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBomList(filters={}, options={}) {
|
||||||
|
return inventreeGet('/api/part/bom/', filters, options);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user