mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +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, {
|
launchModalForm(url, {
|
||||||
reload: true,
|
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>
|
||||||
</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 class='table table-striped table-condensed po-table' id='purchase-order-table'>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -78,6 +76,9 @@ $("#purchase-order-table").inventreeTable({
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'status_text',
|
field: 'status_text',
|
||||||
title: 'Status',
|
title: 'Status',
|
||||||
|
formatter: function(value, row, index, field) {
|
||||||
|
return orderStatusLabel(row.status, row.status_text);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user