Début amélioration inventaire

This commit is contained in:
FyloZ 2020-02-21 09:40:38 -05:00
parent 700f8eedfd
commit 7ea34423bc
1 changed files with 15 additions and 4 deletions

View File

@ -97,7 +97,8 @@
</div>
<div>
<table class="mix"
th:id="'mix-' + ${mix.id}">
th:id="'mix-' + ${mix.id}"
th:mixId="${mix.id}">
<tr>
<th th:text="#{keyword.material}"></th>
<th th:text="#{keyword.type}"></th>
@ -264,7 +265,17 @@
$("#useSubmit").on({
click: function () {
let formData = {};
let formData = [];
$(".mix").each(function() {
const mixId = $(this).data("mixid");
const materials = [];
let i = 0;
$(this).find(".quantityCustomizer").each(function() {
materials[i] = $(this).data("materialid")
});
});
$(".quantityCustomizer").each(function () {
const materialId = $(this).data("materialid");
@ -274,8 +285,8 @@
formData[mixId] = {};
}
formData[mixId][materialId] = e.dataset.quantityml;
});
formData[mixId][materialId] = e.dataset.quantityml;
});
clearNotEnoughClasses();
sendPost(formData, "/inventory/use", r => displayNotEnoughReason(r));