ol.breadcrumb li = link_to "Intermódulos Entradas", intermodulos_entradas_path, class: "link_breadcrumb" li.active Listar == render 'filtros_entradas' .widget header> h5 ' Lista de span.fw-semi-bold Materiais Recebidos - Entradas na Gestão de Estoque .widget-body - if @recebimento_de_materiais.empty? h6 Nenhum registro encontrado. - else .table-responsive table.table.table-hover style="font-size: 95%;" thead tr th Data th Nº Ordem th Fornecedor th.text-center width="100" U. O. th.text-center Almoxarifado th.text-center Nota Fiscal th.text-center Classificação th.text-center Tipo de Material th.text-center Status th.text-right width="150" tbody - @recebimento_de_materiais.each do |recebimento_de_material| tr td = recebimento_de_material.try(:data_do_recebimento) td = recebimento_de_material.try(:ordem_de_compra).try(:numero) td = recebimento_de_material.try(:ordem_de_compra).try(:empenho).try(:pessoa).try(:nome_e_cpf_ou_cnpj) td.text-center = recebimento_de_material.retorna_unidade_orcamentaria.try(:sigla) td = recebimento_de_material.retorna_almoxarifado.try(:nome) td.text-center = recebimento_de_material.try(:numero_da_nota) td.text-center = recebimento_de_material.localizar(:classificacao) if recebimento_de_material.classificacao.present? td.text-center = recebimento_de_material.localizar(:tipo_de_material) td.text-center span.label.label-info ==< (recebimento_de_material.localizar :status).try(:upcase) if recebimento_de_material.recebido_parcialmente? span.label.label-success ==< (recebimento_de_material.localizar :status).try(:upcase) if recebimento_de_material.recebido? td.text-center .btn.btn-default.btn-sm.mb-xs.marcador_de_recebimento id="marcador_#{recebimento_de_material.id}" i.fa.fa-square-o id="caixa_#{recebimento_de_material.id}" - unless @recebimento_de_materiais.empty? = form_with(model: @modelo_recebimento_de_material, url: gestao_de_estoque_confirmar_multiplos_recebimentos_entradas_path, method: "post") do |f| - @recebimento_de_materiais.each do |recebimento| = f.hidden_field recebimento.id, value: 0, id: "recebimento_#{recebimento.id}" .btn.btn-primary.btn-sm#selecionar_todos | Selecionar Todos =< submit_tag "Confirmar selecionados", class: "btn btn-success btn-sm", id: "confirmar_selecionados" br = will_paginate @recebimento_de_materiais, previous_label: "<", next_label: ">" javascript: $(function() { selecionador = 0; $(".marcador_de_recebimento" ).each(function() { $( this ).on("click", function() { var id = $( this ).attr('id').split("marcador_"); id = id[1]; if( $("#recebimento_"+id).val().localeCompare("1") == 0 ){ $("#recebimento_"+id).val("0"); $("#caixa_"+id).removeClass("fa-check-square-o"); $("#caixa_"+id).addClass("fa-square-o"); } else { $("#recebimento_"+id).val("1"); $("#caixa_"+id).removeClass("fa-square-o"); $("#caixa_"+id).addClass("fa-check-square-o"); } }); }); $("#selecionar_todos").on("click", function(){ if(selecionador == 0){ selecionador = 1; } else { selecionador = 0; } $( ".marcador_de_recebimento" ).each(function() { var id = $( this ).attr('id').split("marcador_"); id = id[1]; if( $("#caixa_"+id).hasClass("fa-square-o") == true && selecionador == 1){ $("#caixa_"+id).removeClass("fa-square-o"); $("#caixa_"+id).addClass("fa-check-square-o"); $("#recebimento_"+id).val("1"); } else if($("#caixa_"+id).hasClass("fa-check-square-o") == true && selecionador == 0){ $("#caixa_"+id).removeClass("fa-check-square-o"); $("#caixa_"+id).addClass("fa-square-o"); $("#recebimento_"+id).val("0"); } }); }); });