');
$container.insertAfter('#innerOpcoes');
},
createForm: function () {
self = this;
// $.getScript(
// 'https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.js',
// function(){
if (!self.inputs.length) {
console.error('Nenhum input definido');
} else {
for (var i in self.inputs) {
var $group = self.getGroup(self.inputs[i]);
for (var k in self.inputs[i].inputs) {
var input = self.inputs[i].inputs[k];
$field = self.getInput(input);
$group.find('.inputs-container').append($field);
}
$(self.appendForm).append($group);
}
$button = $('');
$button.css({
'position': 'absolute',
'top': 0,
'left': 0,
'right': 0,
'bottom': 0,
'z-index': 1,
'cursor': 'pointer'
}).click(function (event) {
event.preventDefault();
formCartao.save();
});
$(self.buttonHandler).css({
'position': 'relative'
}).parent().css({
'position': 'relative'
}).append($button)
}
// }
// );
},
getGroup: function (group) {
return $('
' + group.name + '
');
},
getInput: function (input, $group) {
$field = $('');
var $input;
if (input.type == 'select') {
$input = $('');
for (var i in input.value) {
$input.append('');
}
} else {
$input = $('');
}
$input.attr({
'name': input.name,
'id': input.id
}).data({
'match': input.match + '#',
'required': input.required,
})
if (!!localStorage.getItem(input.match + '#')) {
$input.val(localStorage.getItem(input.match + '#'));
}
if (input.maxlength) {
$input.attr({
'maxlength': input.maxlength,
}).data({
'maxlength': input.maxlength
})
}
var $label = $('');
$label.attr({
'for': input.id
}).text(input.label);
var $span;
if (input.maxlength) {
$span = $('' + ($input.val().length) + '/' + input.maxlength + '');
$input.on('input', function () {
max = $(this).data('maxlength');
current = $(this).val().length;
$(this).next('span').text(current + '/' + max);
})
}
if (input.meiomask !== false) {
$input.setMask(input.meiomask);
}
if (input.sptelephone) {
$input.mask(SPMaskBehaviorCardapio, spOptionsCardapio);
}
$field.append($label);
$field.append($input);
$field.append($span);
return $field;
},
};
$(document).ready(function(){
try {
formAirliquide.verify();
if(formAirliquide.is2create){
formAirliquide.createContainer();
formAirliquide.createForm();
}
}catch(e){
console.log("Erro ao aplicar regras para formBluesol", e);
}
setTimeout(function(){
$('#txtRequisicaoCompras').attr('maxlength','6');
}, 3000);
$(document).find('#txtRequisicaoCompras').attr('maxlength','6');
if (document.URL.indexOf('carrinho-compras-finalizar-endereco') > 0) {
$("[for=chk_mesmo_endereco]").hide();
$("#chk_mesmo_endereco").prop('checked', false).hide();
fcnSelecionaEnderecoCobranca();
$('#innerRelacaoEnderecosCobranca .optJSEndereco').prop('checked', false)
$button = $('');
$finalizar = $('#finish-stage-2');
$button.css({
'position':'absolute',
'top':0,
'left':0,
'right':0,
'bottom':0,
'z-index':1,
'cursor':'pointer'
}).click(function(event) {
event.preventDefault();
$campo = $('#txtRequisicaoCompras').val();
if ($campo == ''){
alert("Informe o campo ordem de compra antes de continuar!");
}else if ($campo.length < 6){
alert("O campo ordem de compra precisa ter no minimo 6 dígitos!");
}else{
$finalizar.click();
}
});
$($finalizar).css({
'position':'relative'
}).parent().css({
'position':'relative'
}).append($button)
}
formCartao.verify();
if(formCartao.is2create){
formCartao.createContainer();
formCartao.createForm();
}
if (document.URL.indexOf('carrinho-compras-finalizar-endereco') == 44) {
$.colorbox({ html: '
Atenção, colaborador ALB: para realizar este pedido na Printi, você precisa efetuar uma Requisição de Compra no Delta (menu Solicitações > Requisições). Após concluir a requisição, cole o número do pedido gerado no campo "Ordem de Compra". Ressaltamos que o número do pedido deverá ter 6 dígitos. Caso não efetue este processo, você não está autorizado a dar continuidade neste pedido com a Printi.
Selecione o ENDEREÇO DE COBRANÇA de acordo com o seu CNPJ que é o de emissão da NF. A Printi não se responsabiliza por dados de cobrança e entrega cadastrados errados.
', fixed: true, opacity: 0.3, width: 600, height: 280 });
}
$('a[href="#minhas-personalizacoes"]').remove();
$('#innerItensPgto input[type="radio"]').attr('checked',true);
$('#innerItensPgto').hide();
$('#txtPedidoNota').parent().parent().hide();
// $('.links-list a').not('.links-list a:contains("Contato"),.links-list a:contains("Perguntas"),.links-list a:contains("Termos de Uso"),.links-list a:contains("Como usar a plataforma")').hide();
if (document.URL.indexOf('carrinho-compras-finalizar-endereco') == 44) {
$('#frmCentroCustos > h2').remove();
$('label:contains("Telefone")').closest(".col-1").remove()
$('label:contains("Nome do respons�vel pelo recebimento")').text('Centro de Custo');
$("#txtRequisicaoCompras").attr('maxlength','4');
$("#txtNomeResponsavel").attr('maxlength','9');
$("#txtNomeResponsavel").attr('required', "true");
$("#txtRequisicaoCompras").attr('required', "true");
}
$("label:contains('E-mail (*)')").text("E-mail Air Liquide (*)")
});