PageSourceSearch

https://leiloesjudiciaisbahia.com.br/v3/js/vue/leilao.js

js leiloesjudiciaisbahia.com.br collected 2026-09-27 05:29:48 UTC 8,621 bytes, 321 lines download raw bytes

1var atualiza_botoes_atalho = true;
2var atualiza_valor_text = true;
3
4
5function obtemPalavraChave() {
6	if (buscar_empty) {
7		return '';
8	} else {
9		return palavra_chave_value;
10	}
11}
12
13function acrescenta_valor_lance(leilao_id, lote_id, valor, prefixo)
14{
15	if(!prefixo) {
16		prefixo = '';
17	}
18	field = prefixo + "vl_" + leilao_id + "_" + lote_id;
19	var valor_atual = parseInt($("#" + field).val());
20
21	if (isNaN(valor_atual)) {
22		valor_atual = 0;
23	}
24
25	if (isNaN(valor)) {
26		valor = 0;
27	}
28
29	$("#" + field).val(valor_atual + valor);
30}
31
32
33function envialance(leilao_id, lote_id, vl_lance, nu_lote, prefixo)
34{
35	if(!usuario_logado) {
36		jAlert("Você precisa esta logado para enviar lance", "Envio de Lance");
37		return;
38	}
39
40	jConfirm("Deseja enviar o lance no valor de R$ " + vl_lance  + " no lote " + nu_lote + "?", "Envio de Lance", function(r) {
41		if (r) {
42			envialanceajax(leilao_id, lote_id, vl_lance, 0, nu_lote, prefixo, 1);
43		} else {
44			jAlert("Envio de lance cancelado", "Envio de Lance");
45		}
46	});
47}
48
49function envialanceajax(leilao_id, lote_id, vl_lance, is_telao, nu_lote, prefixo, lance_confirmado){
50
51	if (is_telao == 0){
52		//From atalho
53		if (lance_confirmado != 1){
54			jConfirm("Deseja enviar o lance no valor de R$ " + vl_lance  + " no lote " + nu_lote + "?", "Envio de Lance", function(r) {
55				if (r) {
56					envialanceajax(leilao_id, lote_id, vl_lance, 0, 0, prefixo, 1);
57				} else {
58					jAlert("Envio de lance cancelado", "Envio de Lance");
59				}
60			});
61			return false;
62		}
63	}
64
65
66	vl_lance = vl_lance.replace('.', '').replace(',', '.');
67	loadAjax();
68
69	$.ajax ({
70		type: "GET",
71		url: urllance,
72		data: "leilao_id=" + leilao_id + "&lote_id=" + lote_id + "&vl_lance=" + vl_lance,
73		success: function(msg){
74
75			try {
76				var dados = eval ('(' + msg + ')');
77			} catch(err) {
78				alertaErroInterno();
79				return;
80			}
81
82			if(dados['erro']) {
83				jAlert(dados['msg_erro'], "Envio de Lance");
84			} else {
85				atualizaLote(dados);
86			}
87		}
88	});
89}
90
91function unloadAjax(){
92	$("#status_conexao").html("");
93}
94
95function loadAjax(){
96	$("#status_conexao").html("<img src='/image/pestana/loading.gif'>");
97}
98
99/*
100 * Retorno do processo de atualiza��o por ajax
101 * Recebe as informa��es da:
102 * - Lista de lotes
103 * - Dados Lote
104 */
105function atualizaLote(dados)
106{//console.log(dados['dados_lote']);
107	//Dados de html da listagem do leilão
108	if (dados['listagem'] != null){
109		$("#listagem_tab_container").html(dados['listagem']);
110	}
111
112	//Historico
113	if (dados['historico'] != null){
114		$("#historico_lances").html(dados['historico']);
115	}
116
117	//Meus lotes
118	if (dados['html_meus_lotes'] != null){
119		$("#tab-meus-lotes").html(dados['html_meus_lotes']);
120	}
121
122	if(dados['lote_id_pregao'] != 0){
123		$("#container_sincronizar").show();
124	}else{
125		$("#container_sincronizar").hide();
126	}
127
128	//Dados do lote
129	if (dados['dados_lote'] != null && atualiza_pregao == true){
130		setDadosLote(dados['dados_lote'],dados['usuario_id']);
131
132	}else if(dados['dados_lote'] != null){
133
134		if(dados['dados_lote']['lote_id'] != lote_empregao){
135			jAlert('Lote em pregão alterado','Lote em pregao');
136			atualiza_pregao = true;
137			lote_empregao = dados['lote_id_pregao'];
138		}
139
140		setDadosLote(dados['dados_lote'],dados['usuario_id']);
141	}
142
143	if(dados['sincronizar'] == 'checked' && dados['dados_lote'] != null && atualiza_pregao == true){
144
145		lote_id = dados['lote_id_pregao'];
146		$("#tab-pregao").html(dados['html_lote']);
147
148		if(lote_empregao != 0){
149			$("#container_sincronizar").show();
150		}
151
152		$("#chk_sincronizar").attr('checked',true);
153
154		hideLoading();
155
156		//Global scripts/leilao/index.phtml
157		atualiza_pregao = false;
158	}
159
160	if(dados['lotes_repasse'] != null){
161		$("#lotes_repasse").html(dados['lotes_repasse']);
162	}
163
164	if(dados['dados_lote']){
165		status_lote_cronometro = dados['dados_lote']['statuslote_id'];
166		var status_lote_id = dados['dados_lote']['statuslote_id'];
167		if((status_lote_id == 2) || (status_lote_id == 3) || (status_lote_id == 6) || (status_lote_id == 11) || (status_lote_id == 12)){
168			$("#btn_enviamensagemchat").show();
169		}else{
170			$("#btn_enviamensagemchat").hide();
171		}
172		fechamento_lote = dados['dados_lote']['dt_fechamento'];
173		$("#status_lote").css('color',dados['dados_lote']['statusLoteBg']);
174		$("#tempo_restante").css('color',dados['dados_lote']['statusLoteBg']);
175		var versao_ie = msieversion();
176		if (versao_ie > 9) {
177			var href = '/leilao/index/leilao_id/' + dados['dados_lote']['leilao_id'] + '/lote_id/' + dados['dados_lote']['lote_id'] + '/lote_nu/' + dados['dados_lote']['nu'];
178			history.pushState('', 'Novo titulo', href);
179		}
180	}
181
182}
183
184function msieversion() {
185	var ua = window.navigator.userAgent
186	var msie = ua.indexOf("MSIE ")
187
188	if (msie > 0)      // If Internet Explorer, return version number
189		return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)))
190	else                 // If another browser, return 0
191		return 11
192
193}
194/*
195 * Processa as informa��es da ficha seja ela da "preview", "em preg�o" ou "aba"
196 */
197function setDadosLote(lote,usuario_logado){
198
199	//Tratamento para exibir a mensagem para o arrematante do lote.
200	eval("vencedor_" + lote['lote_id'] + "= false");
201	if(lote['statuslote'] != "Vendido"){
202		eval("vencedor_" + lote['lote_id'] + "= true");
203	}
204
205	if(lote['statuslote'] == "Vendido" && eval("vencedor_" + lote['lote_id']) == true && $("#lote_id_atual").val() == lote['lote_id'] && usuario_logado == lote['usuario_id'])
206	{
207		jAlert('Parabéns '+lote['nm_usuario']+', você venceu o lote '+lote['nu']+', '+lote['nm_titulo'],'Parabéns');
208		eval("vencedor_" + lote['lote_id'] + "= false");
209	}
210
211
212
213	//Atualizacao bloco de titulo lote
214	$("#lote_nu").html("Lote "+lote['nu']+" - ");
215	$("#lote_titulo").html(lote['nm_titulo']);
216
217	//Atualizacao Status
218
219	/*if(lote['statuslote'] == "Aberto para Lances")
220	{
221		if(lote['dt_fechamento_formatado'] == null){
222			$("#status_lote").html(lote['statuslote']);
223		}else {
224			$("#status_lote").html("Previsão " + lote['dt_fechamento_formatado']);
225		}
226	}else{
227		$("#status_lote").html(lote['statuslote']);
228	}*/
229	$("#status_lote").html(lote['statuslote']);
230	$("#status_lote").css('color',lote['statusLoteBg']);
231
232	//Atualizacao do lance atual / lance inicia
233	$("#titulo_lance").html(lote['titulo_lance']);
234	$("#valor_lance").html(lote['vl_lance']);
235
236
237	if ($("#lance_sugerido").is(":focus") || $("#lance_manual").is(":focus")) {
238		atualiza_input = false;
239	}else{
240		atualiza_input = true;
241	}
242
243	//Atualização botão de envio de lance
244	if(atualiza_input)
245	{
246		$("#lance_sugerido").val("R$ "+lote['vl_lance_sugerido']);
247	}
248
249	if(atualiza_input){
250		$("#lance_manual").val(lote['vl_lance_sugerido']);
251	}
252
253	//Mensagens
254	var mensagem_leiloeiro = '';
255	for (var x in lote['mensagens_lote']) {
256		var apelido = lote['mensagens_lote'][x]['nm_apelido'];
257		if(lote['mensagens_lote'][x]['statusmensagemtipoorigem_id'] == 2){
258			apelido = 'Leiloeiro';
259		}
260
261		mensagem_leiloeiro += '<div class="data_hora" style="color: ' + lote['mensagens_lote'][x]['nm_corstatus'] + ';">';
262		mensagem_leiloeiro += '<span style="font-size: 10px;">' + lote['mensagens_lote'][x]['data'] + ' ' + apelido + ': </span>';
263		mensagem_leiloeiro += lote['mensagens_lote'][x]['nm_mensagem'];
264		mensagem_leiloeiro += '</div>';
265	}
266
267	$("#mensagens_leiloeiro").html(mensagem_leiloeiro);
268
269}
270
271function atualizaLanceAutomatico(){
272	$("#limite_atual").html('Não Cadastrado');
273	$("#lote_usuariolanceautomatico_botao_excluir").hide();
274}
275
276function atualizaLoteLimiteLance(dados,prefixo,lote_id){
277
278	$("#limite_atual").html(dados['lotes'][lote_id]['vl_lanceautomatico']);
279	$("#vl_limite_lance").val('');
280	$("#lote_usuariolanceautomatico_botao_excluir").show();
281}
282
283function text_format(str) {
284	if (str == null || str.length == 0 || str == "" || str == " ") {
285		return "-";
286	} else {
287		return str;
288	}
289}
290
291function desabilitaElementos(content) {
292	toggleDisabled(content);
293}
294
295
296function toggleDisabled(el) {
297	try {
298		el.disabled = el.disabled ? false : true;
299	}
300	catch(E){
301	}
302	if (el.childNodes && el.childNodes.length > 0) {
303		for (var x = 0; x < el.childNodes.length; x++) {
304			toggleDisabled(el.childNodes[x]);
305		}
306	}
307}
308
309
310
311function abreMinhaContaDocumento(){
312	window.location.href = "/usuario/minha-conta/tab_ativa/tab_documentos";
313}
314
315function setTabSelected(selected_li_class) {
316	$("ul.tabs li." + selected_li_class).parent().parent().find("ul.tabs li").removeClass("activeTab");
317	$("ul.tabs li." + selected_li_class).addClass("activeTab");
318	$("div.tab_container").parent().parent().find(".tab_content").hide(); //Hide all tab content
319	var activeTab = $("ul.tabs li." + selected_li_class).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
320	$(activeTab).show(); //Fade in the active content
321}

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.