att
This commit is contained in:
@@ -49,13 +49,15 @@ $(document).ready(function () {
|
||||
processarConferenciaNfe();
|
||||
});
|
||||
|
||||
var activity = String($("#activity").val() || "");
|
||||
applyTransferStatus(activity);
|
||||
|
||||
if ($("#formMode").val() == "VIEW") {
|
||||
showAndBlock(["all"]);
|
||||
$("#btnConsultarChaveNfe").prop("disabled", true).hide();
|
||||
updateConferenciaNfeVisibility($("#activity").val());
|
||||
updateConferenciaNfeVisibility(activity);
|
||||
} else {
|
||||
//show the right fields
|
||||
var activity = $("#activity").val();
|
||||
var requestDate = getCurrentDate();
|
||||
|
||||
if (String(activity) !== "6") {
|
||||
@@ -209,6 +211,40 @@ $(document).ready(function () {
|
||||
|
||||
});
|
||||
|
||||
function applyTransferStatus(activity) {
|
||||
var current = String(activity || "");
|
||||
var pills = $("#transferStatus .status-pill");
|
||||
if (!pills.length) return;
|
||||
|
||||
pills.removeClass("is-active is-done");
|
||||
|
||||
var activeOrder = -1;
|
||||
pills.each(function () {
|
||||
var pill = $(this);
|
||||
var activities = String(pill.attr("data-activities") || "").split(",");
|
||||
for (var i = 0; i < activities.length; i++) {
|
||||
if ($.trim(activities[i]) === current) {
|
||||
pill.addClass("is-active");
|
||||
var order = parseInt(pill.attr("data-order"), 10);
|
||||
if (!isNaN(order)) {
|
||||
activeOrder = order;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (activeOrder < 0) return;
|
||||
|
||||
pills.each(function () {
|
||||
var pill = $(this);
|
||||
var order = parseInt(pill.attr("data-order"), 10);
|
||||
if (!isNaN(order) && order < activeOrder) {
|
||||
pill.addClass("is-done");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resolveFormModeFallback() {
|
||||
var mode = ($("#formMode").val() || "").toUpperCase();
|
||||
if (mode) return mode;
|
||||
@@ -1312,9 +1348,11 @@ function setSelectedZoomItem(selectedItem) {
|
||||
var itemDescricao = selectedItem["descricao"] || selectedItem["Description"] || "";
|
||||
var itemCode = selectedItem["Code"] || selectedItem["sku"] || "";
|
||||
var itemProductId = selectedItem["id"] || selectedItem["productId"] || "";
|
||||
var itemCategoria = selectedItem["categoria"] || selectedItem["strategicDescription"] || "";
|
||||
$("#codigoItem" + "___" + indice).val(itemDescricao);
|
||||
$("#codigoProdutoItem" + "___" + indice).val(itemCode);
|
||||
$("#productIdItem" + "___" + indice).val(itemProductId);
|
||||
$("#categoriaItem" + "___" + indice).val(itemCategoria);
|
||||
processarConferenciaNfe();
|
||||
}
|
||||
|
||||
@@ -1355,6 +1393,7 @@ function removedZoomItem(removedItem) {
|
||||
$("#codigoItem___" + linha[1]).val("");
|
||||
$("#codigoProdutoItem___" + linha[1]).val("");
|
||||
$("#productIdItem___" + linha[1]).val("");
|
||||
$("#categoriaItem___" + linha[1]).val("");
|
||||
$("#quantidadeItem___" + linha[1]).val("");
|
||||
processarConferenciaNfe();
|
||||
}
|
||||
@@ -1364,6 +1403,7 @@ function removedZoomItem(removedItem) {
|
||||
$("#codigoItem" + "___" + indice).val("");
|
||||
$("#codigoProdutoItem" + "___" + indice).val("");
|
||||
$("#productIdItem" + "___" + indice).val("");
|
||||
$("#categoriaItem" + "___" + indice).val("");
|
||||
processarConferenciaNfe();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user