att
This commit is contained in:
Binary file not shown.
@@ -97,6 +97,7 @@ function processarArquivoExcel(file) {
|
||||
var codigo = getCellByAliases(item, ["codigoItem", "codigo", "codItem", "sku", "code", "item"]);
|
||||
var quantidade = getCellByAliases(item, ["quantidadeItem", "quantidade", "qtd", "qtde"]);
|
||||
var descricao = getCellByAliases(item, ["descricao", "description", "desc"]);
|
||||
var categoria = getCellByAliases(item, ["categoria", "category"]);
|
||||
|
||||
if (!codigo || !quantidade) {
|
||||
return;
|
||||
@@ -105,7 +106,8 @@ function processarArquivoExcel(file) {
|
||||
linhasValidas.push({
|
||||
codigo: String(codigo).trim(),
|
||||
quantidade: String(quantidade).trim(),
|
||||
descricao: String(descricao || "").trim()
|
||||
descricao: String(descricao || "").trim(),
|
||||
categoria: String(categoria || "").trim()
|
||||
});
|
||||
});
|
||||
|
||||
@@ -141,6 +143,11 @@ function processarArquivoExcel(file) {
|
||||
if (descricaoFinal) {
|
||||
$("#codigoItem___" + idx).val(descricaoFinal);
|
||||
}
|
||||
|
||||
var categoriaFinal = item.categoria || produtoInfo.categoria;
|
||||
if (categoriaFinal) {
|
||||
$("#categoriaItem___" + idx).val(categoriaFinal);
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof processarConferenciaNfe === "function") {
|
||||
@@ -192,16 +199,16 @@ function normalizeHeader(text) {
|
||||
function buscarProdutoPorCodigo(codigo) {
|
||||
try {
|
||||
if (typeof DatasetFactory === "undefined" || typeof ConstraintType === "undefined") {
|
||||
return { descricao: "", id: "" };
|
||||
return { descricao: "", id: "", categoria: "" };
|
||||
}
|
||||
|
||||
var codigoTxt = String(codigo || "").trim();
|
||||
if (!codigoTxt) return { descricao: "", id: "" };
|
||||
if (!codigoTxt) return { descricao: "", id: "", categoria: "" };
|
||||
|
||||
var cCodigo = DatasetFactory.createConstraint("Code", codigoTxt, codigoTxt, ConstraintType.MUST);
|
||||
var ds = DatasetFactory.getDataset("ds_rgb_products", null, [cCodigo], null);
|
||||
var ds = DatasetFactory.getDataset("ds_rgb_products_v2", null, [cCodigo], null);
|
||||
if (!ds || !ds.values || !ds.values.length) {
|
||||
return { descricao: "", id: "" };
|
||||
return { descricao: "", id: "", categoria: "" };
|
||||
}
|
||||
|
||||
for (var i = 0; i < ds.values.length; i++) {
|
||||
@@ -209,7 +216,8 @@ function buscarProdutoPorCodigo(codigo) {
|
||||
if (String(row.Code || "").trim() === codigoTxt) {
|
||||
return {
|
||||
descricao: String(row.descricao || row.Description || "").trim(),
|
||||
id: String(row.id || "").trim()
|
||||
id: String(row.id || "").trim(),
|
||||
categoria: String(row.categoria || row.strategicDescription || "").trim()
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -217,11 +225,12 @@ function buscarProdutoPorCodigo(codigo) {
|
||||
var first = ds.values[0] || {};
|
||||
return {
|
||||
descricao: String(first.descricao || first.Description || "").trim(),
|
||||
id: String(first.id || "").trim()
|
||||
id: String(first.id || "").trim(),
|
||||
categoria: String(first.categoria || first.strategicDescription || "").trim()
|
||||
};
|
||||
} catch (e) {
|
||||
console.error("Erro ao buscar descricao por codigo:", e);
|
||||
return { descricao: "", id: "" };
|
||||
return { descricao: "", id: "", categoria: "" };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+45
-9
@@ -25,13 +25,40 @@
|
||||
}
|
||||
|
||||
.status-pill {
|
||||
background: #e9f4ff;
|
||||
color: #0d5b91;
|
||||
border: 1px solid #c3def6;
|
||||
background: #eef2f6;
|
||||
color: #5f7080;
|
||||
border: 1px solid #d3dde7;
|
||||
padding: 6px 12px;
|
||||
border-radius: 999px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
transition: all .2s ease;
|
||||
}
|
||||
|
||||
.status-pill.is-done {
|
||||
background: #e8f7ed;
|
||||
color: #1f6e3e;
|
||||
border-color: #b8e3c4;
|
||||
}
|
||||
|
||||
.status-pill.is-active {
|
||||
background: #e8f2ff;
|
||||
color: #0e56a2;
|
||||
border-color: #8fb8e8;
|
||||
box-shadow: 0 0 0 2px rgba(31, 110, 169, 0.12);
|
||||
}
|
||||
|
||||
.status-pill.status-pill--problem.is-active {
|
||||
background: #ffecec;
|
||||
color: #a12f2f;
|
||||
border-color: #efb1b1;
|
||||
box-shadow: 0 0 0 2px rgba(199, 58, 58, 0.12);
|
||||
}
|
||||
|
||||
.status-pill.status-pill--problem.is-done {
|
||||
background: #fff4e6;
|
||||
color: #8a5c12;
|
||||
border-color: #f2d3a2;
|
||||
}
|
||||
|
||||
.transfer-main-title {
|
||||
@@ -216,11 +243,15 @@
|
||||
<div class="fluig-style-guide">
|
||||
<form name="form" role="form">
|
||||
<div class="container-fluid transfer-shell">
|
||||
<div class="transfer-status">
|
||||
<span class="status-pill">Solicitação</span>
|
||||
<span class="status-pill">Coleta</span>
|
||||
<span class="status-pill">Entrega</span>
|
||||
<span class="status-pill">Recebimento</span>
|
||||
<div class="transfer-status" id="transferStatus">
|
||||
<span class="status-pill" data-order="1" data-activities="0,1">Solicitação</span>
|
||||
<span class="status-pill" data-order="2" data-activities="4">Aprovação</span>
|
||||
<span class="status-pill" data-order="3" data-activities="6">Emissão NFe</span>
|
||||
<span class="status-pill" data-order="4" data-activities="31">Coleta</span>
|
||||
<span class="status-pill" data-order="5" data-activities="57">Entrega</span>
|
||||
<span class="status-pill" data-order="6" data-activities="18">Recebimento</span>
|
||||
<span class="status-pill status-pill--problem" data-order="7" data-activities="24">Verificar Problema</span>
|
||||
<span class="status-pill" data-order="8" data-activities="101">Finalizada</span>
|
||||
</div>
|
||||
|
||||
<h1 class="transfer-main-title">Formulário de Transferência de Mercadorias</h1>
|
||||
@@ -310,6 +341,7 @@
|
||||
<th style="width:34%;">Código do item</th>
|
||||
<th style="width:18%;">Quantidade</th>
|
||||
<th>Descrição</th>
|
||||
<th style="width:18%;">Categoria</th>
|
||||
<th style="width:70px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -319,11 +351,12 @@
|
||||
<td>
|
||||
<input type="zoom" class="form-control transfer-input" name="descricao" data-zoom="{
|
||||
'displayKey':'Code',
|
||||
'datasetId':'ds_rgb_products',
|
||||
'datasetId':'ds_rgb_products_v2',
|
||||
'maximumSelectionLength':'1',
|
||||
'fields':[
|
||||
{'field':'Code','label':'Codigo'},
|
||||
{'field':'Description','label':'Descricao'},
|
||||
{'field':'categoria','label':'Categoria'},
|
||||
{'field':'descricao','label':'Descricao item'},
|
||||
{'field':'id','label':'ID','visible':'false'}
|
||||
]
|
||||
@@ -337,6 +370,9 @@
|
||||
<input type="hidden" name="productIdItem" />
|
||||
<input type="hidden" name="codigoProdutoItem" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control transfer-input" name="categoriaItem" readonly />
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-default hideButton" onclick="remove_row(this)">
|
||||
<i class="fluigicon fluigicon-trash"></i>
|
||||
|
||||
Reference in New Issue
Block a user