mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Print multiple build reports
This commit is contained in:
parent
b222119653
commit
247c4bdb4b
@ -22,11 +22,24 @@ InvenTree | {% trans "Build Orders" %}
|
|||||||
|
|
||||||
<div id='button-toolbar'>
|
<div id='button-toolbar'>
|
||||||
<div class='button-toolbar container-fluid' style='float: right;'>
|
<div class='button-toolbar container-fluid' style='float: right;'>
|
||||||
|
<div class='btn-group'>
|
||||||
{% if roles.build.add %}
|
{% if roles.build.add %}
|
||||||
<button type='button' class="btn btn-success" id='new-build'>
|
<button type='button' class="btn btn-success" id='new-build'>
|
||||||
<span class='fas fa-tools'></span> {% trans "New Build Order" %}
|
<span class='fas fa-tools'></span> {% trans "New Build Order" %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class='btn-group'>
|
||||||
|
<!-- Print actions -->
|
||||||
|
<button id='build-print-options' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||||
|
<span class='fas fa-print'></span> <span class='caret'></span>
|
||||||
|
</button>
|
||||||
|
<ul class='dropdown-menu'>
|
||||||
|
<li><a href='#' id='multi-build-print' title='{% trans "Print Build Orders" %}'>
|
||||||
|
<span class='fas fa-file-pdf'></span> {% trans "Print Build Orders" %}
|
||||||
|
</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- Buttons to switch between list and calendar views -->
|
||||||
<button class='btn btn-default' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
|
<button class='btn btn-default' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
|
||||||
<span class='fas fa-calendar-alt'></span>
|
<span class='fas fa-calendar-alt'></span>
|
||||||
</button>
|
</button>
|
||||||
@ -38,6 +51,7 @@ InvenTree | {% trans "Build Orders" %}
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class='table table-striped table-condensed' id='build-table' data-toolbar='#button-toolbar'>
|
<table class='table table-striped table-condensed' id='build-table' data-toolbar='#button-toolbar'>
|
||||||
@ -157,17 +171,29 @@ $("#view-list").click(function() {
|
|||||||
$("#view-calendar").show();
|
$("#view-calendar").show();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#collapse-item-active").collapse().show();
|
$("#collapse-item-active").collapse().show();
|
||||||
|
|
||||||
$("#new-build").click(function() {
|
$("#new-build").click(function() {
|
||||||
newBuildOrder();
|
newBuildOrder();
|
||||||
});
|
});
|
||||||
|
|
||||||
loadBuildTable($("#build-table"), {
|
loadBuildTable($("#build-table"), {
|
||||||
url: "{% url 'api-build-list' %}",
|
url: "{% url 'api-build-list' %}",
|
||||||
params: {
|
params: {
|
||||||
part_detail: "true",
|
part_detail: "true",
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#multi-build-print').click(function() {
|
||||||
|
var rows = $("#build-table").bootstrapTable('getSelections');
|
||||||
|
|
||||||
|
var build_ids = [];
|
||||||
|
|
||||||
|
rows.forEach(function(row) {
|
||||||
|
build_ids.push(row.pk);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
printBuildReports(build_ids);
|
||||||
|
});
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -637,6 +637,12 @@ function loadBuildTable(table, options) {
|
|||||||
visible: false,
|
visible: false,
|
||||||
switchable: false,
|
switchable: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
checkbox: true,
|
||||||
|
title: '{% trans "Select" %}',
|
||||||
|
searchable: false,
|
||||||
|
switchable: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'reference',
|
field: 'reference',
|
||||||
title: '{% trans "Build" %}',
|
title: '{% trans "Build" %}',
|
||||||
@ -717,6 +723,13 @@ function loadBuildTable(table, options) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
linkButtonsToSelection(
|
||||||
|
table,
|
||||||
|
[
|
||||||
|
'#build-print-options',
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user