mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Use client-side rendering for list of purchase orders
This commit is contained in:
parent
25e5a64cee
commit
a257f94ac0
@ -98,4 +98,39 @@ function removePurchaseOrderLineItem(e) {
|
||||
launchModalForm(url, {
|
||||
reload: true,
|
||||
});
|
||||
}
|
||||
|
||||
function orderStatusLabel(code, label) {
|
||||
/* Render a purchase-order status label. */
|
||||
|
||||
var html = "<span class='label";
|
||||
|
||||
switch (code) {
|
||||
case 10: // pending
|
||||
html += " label-info";
|
||||
break;
|
||||
case 20: // placed
|
||||
html += " label-primary";
|
||||
break;
|
||||
case 30: // complete
|
||||
html += " label-success";
|
||||
break;
|
||||
case 40: // cancelled
|
||||
case 50: // lost
|
||||
html += " label-warning";
|
||||
break;
|
||||
case 60: // returned
|
||||
html += " label-danger";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
html += "'>";
|
||||
html += label;
|
||||
html += "</span>";
|
||||
|
||||
console.log(html);
|
||||
|
||||
return html;
|
||||
}
|
@ -18,8 +18,6 @@ InvenTree | Purchase Orders
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include "order/po_table.html" with toolbar='#table-buttons' %}
|
||||
|
||||
<table class='table table-striped table-condensed po-table' id='purchase-order-table'>
|
||||
</table>
|
||||
|
||||
@ -78,6 +76,9 @@ $("#purchase-order-table").inventreeTable({
|
||||
sortable: true,
|
||||
field: 'status_text',
|
||||
title: 'Status',
|
||||
formatter: function(value, row, index, field) {
|
||||
return orderStatusLabel(row.status, row.status_text);
|
||||
}
|
||||
},
|
||||
{
|
||||
sortable: true,
|
||||
|
Loading…
Reference in New Issue
Block a user