This commit is contained in:
2026-04-02 16:53:53 +03:00
parent 9775a12d4a
commit 53c223ea5f
9 changed files with 77 additions and 102 deletions
+7 -46
View File
@@ -342,51 +342,12 @@ $(document).ready(function () {
// ===================
function loadParts(iddatadb, idquotations, callback = null) {
if (iddatadb) {
if (matrici.length === 0) {
$.ajax({
url: "get_matrici.php",
method: "GET",
dataType: "json",
success: function (data) {
matrici = data.value || [];
loadMacroMatrici();
initializeGlobalSelect2();
loadPartsExtraField(iddatadb, function () {
loadPhoto(iddatadb, idquotations);
loadExistingParts(iddatadb, idquotations, callback);
});
},
error: function (xhr, status, error) {
matrici = [];
loadMacroMatrici();
initializeGlobalSelect2();
loadPartsExtraField(iddatadb, function () {
loadPhoto(iddatadb, idquotations);
loadExistingParts(iddatadb, idquotations, callback);
});
const errorMsg = $(
'<div class="alert alert-danger temp-alert" role="alert">Errore nel caricamento delle matrici: ' +
error +
" (" +
xhr.status +
")</div>",
);
$("#partsModal .modal-body").prepend(errorMsg);
setTimeout(function () {
errorMsg.fadeOut(500, function () {
$(this).remove();
});
}, 5000);
},
});
} else {
loadMacroMatrici();
initializeGlobalSelect2();
loadPartsExtraField(iddatadb, function () {
loadPhoto(iddatadb, idquotations);
loadExistingParts(iddatadb, idquotations, callback);
});
}
loadMacroMatrici();
initializeGlobalSelect2();
loadPartsExtraField(iddatadb, function () {
loadPhoto(iddatadb, idquotations);
loadExistingParts(iddatadb, idquotations, callback);
});
} else {
loadPartsExtraField(iddatadb, function () {
loadPhoto(iddatadb, idquotations);
@@ -1518,7 +1479,7 @@ $(document).ready(function () {
function loadMacroMatrici() {
$.ajax({
url: "get_macro_matrici.php",
url: "search_matrici.php?macro_list=1",
method: "GET",
dataType: "json",
success: function (data) {