1var RastreamentoDestinatarioModel = /** @class */ (function () { 2 function RastreamentoDestinatarioModel() { 3 } 4 RastreamentoDestinatarioModel.PesquisarPedido = function (_codigo) { 5 var urlparamenter = new RastreamentoDestinatarioController(); 6 var captRandom = Math.random(); 7 //@ts-ignore 8 captRandom = captRandom.toString(); 9 //@ts-ignore 10 var captcha = grecaptcha.getResponse(); 11 var rCpatcha = captcha + '|' + captRandom; 12 var cpfCnpj = $('#cpfCnpj').val().replace(/([^\d])+/gim, ''); 13 var codigoEmpresa = urlparamenter.getUrlParameter('ce'); 14 if (!($.IsBlank(codigoEmpresa))) { 15 codigoEmpresa = decodeURIComponent(codigoEmpresa); 16 } 17 var codigo = _codigo; 18 $.MostrarCarregando(); 19 $.ajax({ 20 url: urlApi + 'gestao/api/PesquisasExternas/PesquisarPedidosCnpjCpf' + "?" + new Date().getTime(), 21 data: { 22 "codigo": codigo, 23 "cpf_cnpj": cpfCnpj, 24 "g-recaptcha-response": rCpatcha, 25 "codigo_empresa": codigoEmpresa, 26 }, 27 type: 'POST', 28 dataType: 'json', 29 success: function (result) { 30 if (result != null) { 31 $('#formRastreio').removeClass('formRastreio'); 32 $('#formRastreio').addClass('d-none'); 33 $('#captcha').hide(); 34 $('#title-rastreamento').hide(); 35 $('#tabelaDadosPedidos').removeClass('d-none'); 36 if (result[0].length > 1) { 37 TabelaDestinatarioView.DadosTable(result); 38 $('#btn-voltar-rastreamento').removeClass('d-none'); 39 } 40 else { 41 $('#tabelaDadosPedidos').hide(); 42 $('#barra-status').removeClass('d-none'); 43 $('#data-prevista').removeClass('d-none'); 44 if (result[0][0].abrir_chamado_rastreamento == true) { 45 $('#btn-reg-reclamacao').removeClass('d-none'); 46 } 47 else { 48 $('#btn-reg-reclamacao').addClass('d-none'); 49 } 50 if (result[0][0].notas != null || result[0][0].notas != undefined) { 51 $('#nfLabel').html("<label class=\"label-card\">Nota fiscal:</label><span class=\"label-rastreamento pl-2\">" + result[0][0].notas + "</span>"); 52 } 53 else { 54 $("#nfLabel").html(' '); 55 } 56 if (result[0][0].destinatario != null || result[0][0].destinatario != undefined) { 57 $("#lblDestinatario").html(result[0][0].destinatario); 58 } 59 else { 60 $("#lblDestinatario").html(' '); 61 } 62 if (result[0][0].numero_pedido != null || result[0][0].numero_pedido != undefined) { 63 $('#pedidoLabel').html("<label class=\"label-card\">N\u00FAmero do pedido:</label><span class=\"label-rastreamento pl-2\">" + result[0][0].numero_pedido + "</span>"); 64 } 65 else { 66 $("#pedidoLabel").html(' '); 67 } 68 if (result[0][0].site_empresa != null || result[0][0].site_empresa != undefined) { 69 result[0][0].site_empresa.match(/http/) ? $('#sitelabel').html("<label class=\"label-card\">Site:</label><span class=\"label-rastreamento pl-2\"><a href=\"" + result[0][0].site_empresa + "\" target=\"_blank\">" + result[0][0].site_empresa + "</a></span>") : $('#sitelabel').html("<label class=\"label-card\">Site:</label><span class=\"label-rastreamento pl-2\"><a href=\"http://" + result[0][0].site_empresa + "\" target=\"_blank\">" + result[0][0].site_empresa + "</a></span>"); 70 } 71 else { 72 $("#sitelabel").html(' '); 73 } 74 if (result[0][0].remetente != null || result[0][0].remetente != undefined) { 75 $('#remetenteLabel').html("<label class=\"label-card\">Remetente:</label><span class=\"label-rastreamento pl-2\">" + result[0][0].remetente + "</span>"); 76 } 77 else { 78 $('#remetenteLabel').html(' '); 79 } 80 if (result[0][0].empresa != null || result[0][0].empresa != undefined) {
81 $("#lblTransportadora").html(result[0][0].empresa); 82 $('#lblTransportadora').attr('href', result[0][0].site_empresa); 83 } 84 else { 85 $("#lblTransportadora").html(' '); 86 } 87 if ($.IsBlank(result[0][0].fornecedor_email)) { 88 $('#emailabel').html(); 89 } 90 else { 91 $('#emailabel').html("<label class=\"label-card\">Email:</label><span class=\"label-rastreamento pl-2\"><a href=\"mailto:" + result[0][0].fornecedor_email + "\">" + result[0][0].fornecedor_email + "<a/></span>"); 92 } 93 if (result[0][0].fornecedor_telefone_1 != null || result[0][0].fornecedor_telefone_1 != undefined) { 94 $('#telelabel').html("<label class=\"label-card\">Telefone:</label><span class=\"label-rastreamento pl-2\">" + result[0][0].fornecedor_telefone_1 + "</span>"); 95 } 96 else { 97 $("#lblTetadora").html(' '); 98 } 99 if (result[0][0].ar_postagem != null || result[0][0].ar_postagem != undefined) { 100 var url = "https://rastreamento.correios.com.br/app/index.php?tracking_field=" + result[0][0].ar_postagem; 101 $('#correiolabel').html("<label class=\"label-card\">N\u00BA correios:</label><a class=\"pl-2\"href=\"" + url + "\" target=\"_blank\">" + result[0][0].ar_postagem + "<a/>"); 102 } 103 else { 104 $("#correiolabel").html(''); 105 } 106 if (result[0][0].url_logo != null) { 107 $('#imgLogo').attr('src', result[0][0].url_logo); 108 } 109 } 110 if (result != null) { 111 $.removeErro(); 112 RastreamentoDestinatarioView.dadosBarraProgresso(result); 113 TimeLineDestinatarioView.DadosTimeLine(result); 114 $('#btn-enviar').on('click', function () { 115 rastreamentoDestinatarioModel.SalvarReclamacao(result[0][0].codigo); 116 }); 117 } 118 else { 119 $.mensagemErro(); 120 } 121 } 122 else { 123 $.mensagemErro(); 124 } 125 }, 126 error: function (result) { 127 $.esconderCarregando(); 128 $.mensagemErro(); 129 $('#footer').addClass('fixed-bottom'); 130 } 131 }).always(function () { 132 $.esconderCarregando(); 133 }); 134 }; 135 RastreamentoDestinatarioModel.esconderComAsteriscos = function (numero) { 136 var divisaoNumero = numero.length / 2; 137 var arrayNumero = numero.split(''); 138 var numeroAsterisco = arrayNumero.slice(0, divisaoNumero); 139 for (var i = 0; i < divisaoNumero; i++) { 140 numeroAsterisco.push('*'); 141 } 142 return numeroAsterisco.join(''); 143 }; 144 RastreamentoDestinatarioModel.prototype.SalvarReclamacao = function (codigo) { 145 var codigoPedido = codigo; 146 //@ts-ignore 147 var codigoSelect = document.querySelector('#selectSolitacao').value; 148 var emailvalidaCao = document.querySelector('#email'); 149 //@ts-ignore 150 var nome = document.querySelector('#nome').value; 151 //@ts-ignore 152 var email = document.querySelector('#email').value; 153 //@ts-ignore 154 var telefoneContato = document.querySelector('#telefone').value; 155 //@ts-ignore 156 var descricao = document.querySelector('#descriacao').value; 157 var tel = telefoneContato.toString(); 158 tel = tel.replace(/([^\d])+/gim, ''); 159 var dados = { 160 "nome": nome, 161 "descricao": descricao, 162 "emails": email, 163 "celulares": tel, 164 "codigo": codigoSelect 165 }; 166 if (nome == '') { 167 $('#erroNome').html('Esse campo é obrigatório'); 168 $('#nome').focus().addClass('input-error'); 169 $('.icon-erro-nome').css('display', 'block'); 170 $('#nome').keydown(function () { 171 $('#erroNome').html(''); 172 $('.icon-erro-nome').css('display', 'none'); 173 $('#nome').removeClass('input-error'); 174 }); 175 } 176 else if (email == '' || ValidateDestinatarioController.ValidationEmail(emailvalidaCao) == false) { 177 $('#erroEmail').html('E-mail inválido'); 178 $('#email').focus().addClass('input-error'); 179 $('.icon-erro-email').css('display', 'block'); 180 $('#email').keydown(function () { 181 $('#erroEmail').html(''); 182 $('.icon-erro-email').css('display', 'none'); 183 $('#email').removeClass('input-error'); 184 }); 185 } 186 else if (tel.length < 10) { 187 $('#erroTelefone').html('Telefone inválido'); 188 $('#telefone').focus().addClass('input-error'); 189 $('.icon-erro-telefone').css('display', 'block'); 190 $('#telefone').keydown(function () { 191 $('#erroTelefone').html(''); 192 $('.icon-erro-telefone').css('display', 'none'); 193 $('#telefone').removeClass('input-error'); 194 }); 195 } 196 else if (descricao == '') { 197 $('#erroDescricao').html('Descreva sua reclamação'); 198 $('#descriacao').focus(); 199 $('#descriacao').addClass('input-error'); 200 $('#descriacao').keydown(function () { 201 $('#erroDescricao').html(''); 202 $('#descriacao').removeClass('input-error'); 203 }); 204 } 205 else { 206 $.MostrarCarregando(); 207 $.ajax({
208 url: urlApi + "api/Reclamacoes/ReclamacaoViaSite?_codigoPedido=" + codigoPedido, 209 data: dados, 210 type: 'POST', 211 dataType: 'json', 212 success: function () { 213 $.esconderCarregando(); 214 $('#modalSucesso').modal('show'); 215 $('#modal-reg-reclamacao').modal('hide'); 216 }, 217 error: function () { 218 $.esconderCarregando(); 219 $('#modalErrorSalvar').modal('show'); 220 } 221 }); 222 } 223 }; 224 return RastreamentoDestinatarioModel; 225}()); 226var rastreamentoDestinatarioModel = new RastreamentoDestinatarioModel();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.