mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
BOM table now displays which lines have been marked as valid
This commit is contained in:
parent
1ea7bdf843
commit
81f5714cb1
@ -81,6 +81,15 @@
|
|||||||
max-width: 250px;
|
max-width: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bomrowvalid {
|
||||||
|
color: #050;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bomrowinvalid {
|
||||||
|
color: #A00;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
/* Part image icons with full-display on mouse hover */
|
/* Part image icons with full-display on mouse hover */
|
||||||
|
|
||||||
.hover-img-thumb {
|
.hover-img-thumb {
|
||||||
|
@ -113,14 +113,19 @@ function loadBomTable(table, options) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (options.editable) {
|
if (options.editable) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
// TODO - Enable multi-select functionality
|
||||||
cols.push({
|
cols.push({
|
||||||
checkbox: true,
|
checkbox: true,
|
||||||
title: 'Select',
|
title: 'Select',
|
||||||
searchable: false,
|
searchable: false,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Part column
|
// Part column
|
||||||
cols.push(
|
cols.push(
|
||||||
{
|
{
|
||||||
@ -230,10 +235,27 @@ function loadBomTable(table, options) {
|
|||||||
if (options.editable) {
|
if (options.editable) {
|
||||||
cols.push({
|
cols.push({
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
|
var bValidate = "<button title='Validate BOM Item' class='bom-validate-button btn btn-default btn-glyph' type='button' pk='" + row.pk + "'><span class='glyphicon glyphicon-check'/></button>";
|
||||||
|
var bValid = "<span class='glyphicon glyphicon-ok'/>";
|
||||||
|
|
||||||
var bEdit = "<button title='Edit BOM Item' class='bom-edit-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/edit'><span class='glyphicon glyphicon-edit'/></button>";
|
var bEdit = "<button title='Edit BOM Item' class='bom-edit-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/edit'><span class='glyphicon glyphicon-edit'/></button>";
|
||||||
var bDelt = "<button title='Delete BOM Item' class='bom-delete-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/delete'><span class='glyphicon glyphicon-trash'/></button>";
|
var bDelt = "<button title='Delete BOM Item' class='bom-delete-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/delete'><span class='glyphicon glyphicon-trash'/></button>";
|
||||||
|
|
||||||
return "<div class='btn-group' role='group'>" + bEdit + bDelt + "</div>";
|
var html = "<div class='btn-group' role='group'>";
|
||||||
|
|
||||||
|
html += bEdit;
|
||||||
|
html += bDelt;
|
||||||
|
|
||||||
|
if (!row.validated) {
|
||||||
|
html += bValidate;
|
||||||
|
} else {
|
||||||
|
html += bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
return html;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -256,6 +278,13 @@ function loadBomTable(table, options) {
|
|||||||
table.bootstrapTable({
|
table.bootstrapTable({
|
||||||
sortable: true,
|
sortable: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
rowStyle: function(row, index) {
|
||||||
|
if (row.validated) {
|
||||||
|
return {classes: 'bomrowvalid'};
|
||||||
|
} else {
|
||||||
|
return {classes: 'bomrowinvalid'};
|
||||||
|
}
|
||||||
|
},
|
||||||
formatNoMatches: function() { return "No BOM items found"; },
|
formatNoMatches: function() { return "No BOM items found"; },
|
||||||
clickToSelect: true,
|
clickToSelect: true,
|
||||||
showFooter: true,
|
showFooter: true,
|
||||||
|
1
Makefile
1
Makefile
@ -18,6 +18,7 @@ migrate:
|
|||||||
python3 InvenTree/manage.py migrate
|
python3 InvenTree/manage.py migrate
|
||||||
python3 InvenTree/manage.py migrate --run-syncdb
|
python3 InvenTree/manage.py migrate --run-syncdb
|
||||||
python3 InvenTree/manage.py check
|
python3 InvenTree/manage.py check
|
||||||
|
python3 InvenTree/manage.py collectstatic
|
||||||
|
|
||||||
# Install all required packages
|
# Install all required packages
|
||||||
install:
|
install:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user