This commit is contained in:
Andrey Cunha
2026-03-16 18:24:24 -03:00
parent e712c300c6
commit b8a84962ce
28 changed files with 1278 additions and 1196 deletions
@@ -141,11 +141,32 @@ $(document).ready(function () {
//formatarMoedasTabela("precoIndica___");
formatarMoedasTabela("ValorTotal");
displayBtnFiles();
invisibleBtnUpload("fnAnexo_Nfe");
invisibleBtnUpload("fdAnexo_Coleta");
invisibleBtnUpload("fdAnexo_Entrega");
invisibleBtnUpload("fdAnexo_recebimento");
// gerarTabelaCotacaoIndica("tabelaCotacaoIndica", "tabelaItens");
});
function resolveFormModeFallback() {
var mode = ($("#formMode").val() || "").toUpperCase();
if (mode) return mode;
try {
if (window.parent && window.parent.WCMAPI && typeof window.parent.WCMAPI.getFormMode === "function") {
return String(window.parent.WCMAPI.getFormMode() || "").toUpperCase();
}
} catch (e) {}
return "ADD";
}
if (typeof window.getFormMode !== "function") {
window.getFormMode = resolveFormModeFallback;
}
function formatarMoedasTabela(ids) {
$(document).on('input', `[id^="${ids}"]`, function() {
let valor = $(this).val();
@@ -353,7 +374,8 @@ function setSelectedZoomItem(selectedItem) {
}
if (name_item == "descricao") {
$("#codigoItem" + "___" + indice).val(selectedItem["descricao"]);
var itemDescricao = selectedItem["descricao"] || selectedItem["Description"] || "";
$("#codigoItem" + "___" + indice).val(itemDescricao);
}
}
@@ -747,14 +769,13 @@ function displayBtnFiles(){
try{
$('.componentAnexo').each(function(i, element) {
let inputFile = $(element).find(".inputAnexo")
let inputFileVew = $(element).find(".componentAnexo")
let btnUpFile = $(element).find(".btnUpFile");
let btnViewerFile = $(element).find(".btnViewerFile");
let btnDownloadFile = $(element).find(".btnDownloadFile");
if(getFormMode() == "VIEW"){
btnUpFile.remove();
if(inputFileVew.val() != ""){
if(inputFile.val() != ""){
btnViewerFile.prop("disabled", false);
btnViewerFile.show()
}