mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Improved stock movement modal
- Show which parts will be moved (and where they currently are)
This commit is contained in:
parent
8a0db0e6df
commit
a55f6a1c7b
@ -42,21 +42,35 @@ function moveStock(rows, options) {
|
|||||||
// Extact part row info
|
// Extact part row info
|
||||||
var parts = [];
|
var parts = [];
|
||||||
|
|
||||||
for (i = 0; i < rows.length; i++) {
|
var html = "Select new location:<br>\n";
|
||||||
parts.push(rows[i].pk);
|
|
||||||
}
|
|
||||||
|
|
||||||
var form = "<select class='select' id='stock-location'>";
|
html += "<select class='select' id='stock-location'>";
|
||||||
|
|
||||||
for (i = 0; i < response.length; i++) {
|
for (i = 0; i < response.length; i++) {
|
||||||
var loc = response[i];
|
var loc = response[i];
|
||||||
|
|
||||||
form += makeOption(loc.pk, loc.name + ' - <i>' + loc.description + '</i>');
|
html += makeOption(loc.pk, loc.name + ' - <i>' + loc.description + '</i>');
|
||||||
}
|
}
|
||||||
|
|
||||||
form += "</select">
|
html += "</select><br><hr>";
|
||||||
|
|
||||||
modalSetContent(modal, form);
|
html += "The following stock items will be moved:<br><ul class='list-group'>\n";
|
||||||
|
|
||||||
|
for (i = 0; i < rows.length; i++) {
|
||||||
|
parts.push(rows[i].pk);
|
||||||
|
|
||||||
|
html += "<li class='list-group-item'>" + rows[i].quantity + " × " + rows[i].part.name;
|
||||||
|
|
||||||
|
if (rows[i].location) {
|
||||||
|
html += " (" + rows[i].location.name + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
html += "</li>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
html += "</ul>\n";
|
||||||
|
|
||||||
|
modalSetContent(modal, html);
|
||||||
attachSelect(modal);
|
attachSelect(modal);
|
||||||
|
|
||||||
$(modal).on('click', '#modal-form-submit', function() {
|
$(modal).on('click', '#modal-form-submit', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user