1buscarConfigsHTML(); 2 3var funcoes_config = { 4 validaContratosRecorrentes(id_contrato) { 5 var contratos = router.history.current.matched[0].instances.default.contratos_marcados; 6 7 if (contratos.length === 0) { 8 contratos.push({id: id_contrato}); 9 } else { 10 var existe = false; 11 var index = 0; 12 for (var x = 0; x < contratos.length; x++) { 13 if (contratos[x].id === id_contrato) { 14 existe = true; 15 index = x; 16 } 17 } 18 19 if (!existe) { 20 contratos.push({id: id_contrato}); 21 } else { 22 contratos.splice(index, 1); 23 } 24 } 25 26 router.history.current.matched[0].instances.default.contratos_marcados = contratos; 27 28 if (contratos.length > 0) { 29 router.history.current.matched[0].instances.default.cancelar_recorrencia = true; 30 } else { 31 router.history.current.matched[0].instances.default.cancelar_recorrencia = false; 32 } 33 }, 34 cancelarRecorrencias() { 35 let hs_web = new HotsiteWeb(); 36 let contratos = router.history.current.matched[0].instances.default.contratos_marcados; 37 38 if (contratos.length > 0) { 39 let counter = 0; 40 41 contratos.map(contrato => { 42 counter += contrato.id.split(',').length; 43 }) 44 45 if (! confirm(`Ao continuar, você cancelará o pagamento recorrente de ${counter} contrato(s), sendo necessário o pagamento manual das próximas faturas. Tem certeza que deseja continuar?`)) { 46 router.history.current.matched[0].instances.default.contratos_marcados = []; 47 return; 48 } 49 50 app.loading = true; 51 return hs_web.setCancelarRecorrencias(contratos); 52 } 53 54 return hs_web.criarToast(3000, 'Erro', 'Por favor, marque os contratos que devem ter a cobrança recorrente cancelada!', 'fas fa-exclamation-circle', 'red', 'id_erro'); 55 }, 56 resetarRecorrencias(){ 57 var hs_web = new HotsiteWeb(); 58 router.history.current.matched[0].instances.default.contratos_recorrentes={}; 59 return hs_web.getContratosRecorrentes() 60 }, 61 changeSelectionInChildContracts(key) { 62 this.contratos_recorrentes[key].contratos.map(contrato => { 63 contrato.checked = !contrato.checked; 64 return contrato; 65 }); 66 }, 67}; 68 69function buscarConfigsHTML() { 70 try { 71 $.ajax({ 72 url: __SERVER__ + "/view/configuracoes/config.vue", 73 type: "GET", 74 data: "", 75 dataType: 'html' 76 }).done(function (resposta) { 77 __ROTAS__.push({ 78 path: '/central_assinante_web/configuracoes', 79 name: 'configuracoes', 80 component: { 81 template: resposta, 82 data() { 83 return { 84 loading: true, 85 cancelar_recorrencia: false, 86 contratos_recorrentes: {}, 87 contratos_marcados: [] 88 }; 89 }, 90 methods: funcoes_config 91 } 92 }); 93 PAGE_CONFIG = true; 94 verificaPages(); 95 }); 96 } catch (e) { 97 console.log("Error Message -> " + e); 98 } 99}
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.