-2
I can’t see where the mistake is.
Accuse me of this mistake
$("#btnSalvarArquivo").on('click', function () {
    var EspecieArquivo = document.querySelector('input[name="rdEspecieArquivo"]:checked').value;
    var tipoArquivo = 0;
    var erros = 0;
    $("div").find('*').each(function () {
        var classe = $(this).attr("class");
        if (classe !== undefined) {
            var numItems = $('.has-error').length;
            if (numItems > 0) {
                return false;
            }
            else {
                debugger;
                if (EspecieArquivo === "0") {
                    var TipoArquivo = document.querySelector('input[name="rdTipoArquivo"]:checked').value;
                    console.log(TipoArquivo);
                    $.ajax({
                        type: 'GET',
                        url: 'ProtocoloLatam/Inserir',
                        dataType: 'JSON',
                        data: {
                            EspecieArquivo: EspecieArquivo,
                            TipoArquivo: TipoArquivo,
                            numeroProtocolo: $("#txtNumeroProtocolo").val(),
                            dataProtocolo: $("#txtDataProtocolo").val(),
                            prazoConclusao: $("#txtPrazoConclusao").val(),
                            colaborador: $("#txtNomeColaborador").val(),
                            bp: $("#txtBP").val(),
                            emailColaborador: $("#txtEmailColaborador").val(),
                            tipo: $("#cmbTipo").val(),
                            classificacao: $("#cmbClassificacao").val(),
                            torre: $("#cmbTorre").val(),
                            processo: $("#cmbProcesso").val(),
                            subprocesso: $("#cmbSubprocesso").val(),
                            cidadeOrigem: $("#cmbCidadeOrigem").val(),
                            quantidade: $("#txtQuantidade").val(),
                            ftp: $("#txtFTP").val(),
                            caixaNBox: $("#txtCaixaNBox").val()
                        }, success: function (data) {
                            setTimeout(function () {
                                toastr.success("Cadastrado com sucesso.");
                            }, 2000);
                        }
                    });
                } else if (EspecieArquivo === "1") {
                    var TipoArquivo = document.querySelector('input[name="rdTipoArquivo"]:checked').value;
                    $.ajax({
                        type: 'GET',
                        url: 'ProtocoloLatam/Inserir',
                        dataType: 'JSON',
                        data: {
                            EspecieArquivo: EspecieArquivo,
                            TipoArquivo: TipoArquivo,
                            numeroProtocolo: $("#txtNumeroProtocolo").val(),
                            dataProtocolo: $("#txtDataProtocolo").val(),
                            prazoConclusao: $("#txtPrazoConclusao").val(),
                            colaborador: $("#txtNomeColaborador").val(),
                            bp: $("#txtBP").val(),
                            emailColaborador: $("#txtEmailColaborador").val(),
                            tipo: $("#cmbTipoUnitario").val(),
                            classificacao: $("#cmbClassificacaoUnitario").val(),
                            torre: $("#cmbTorreUnitario").val(),
                            processo: $("#cmbProcessoUnitario").val(),
                            subprocesso: $("#cmbSubprocessoUnitario").val(),
                            cidadeOrigem: $("#cmbCidadeOrigemUnitario").val(),
                            ftp: $("#txtFTP").val(),
                            caixaNBox: $("#txtCaixaNBox").val()
                        }, success: function (data) {
                            $("#minhaModal").modal('hide');
                        }
                    }).done(function () {
                        toastr.success("Cadastrado com sucesso.");
                        setTimeout(4000);
                        window.location.reload();
                    });
                }
                return false;
            }
        }
    });
});
						
Yeah, that’s right, I got this guy out of this place and it’s back up and running, thanks
– gabrielfalieri
Another thing expensive, you are mixing the syntax of jQuery with Vannila, this is not very indicated!
– LeAndrade
after will be standardized rs, I am in the testing phase
– gabrielfalieri