/ = javascript_include_tag "licitacao/solucoes_do_etp/atualizar_status_solucao" .widget div style="margin-bottom: 30px" = botao_com_permissao new_licitacao_solucoes_do_etp_path(etp_id: @etp.id), {acao: :create}, { \ texto: ' Criar Solução', class_icone:'icone-cadastrar', class_texto: 'text-primary', } header h5 | Lista de span.fw-semi-bold Soluções .widget-body - if !@etp.solucoes_do_etp.present? h6 Nenhum registro encontrado. - else .table-responsive table.table.table-hover thead tr th Solução th Descrição da Solução th Valor Total - if !@etp.fechado? th Melhor Solução th width="150" th tbody - @etp.solucoes_do_etp.each do |solucao| - quantidade_consolidada = solucao.itens_da_solucao.map{ |item| item.quantidade_por_unidade_orcamentaria.to_d * item.valor_unitario.to_d}.sum tr td = solucao.numero td = solucao.descricao_da_solucao td = quantidade_consolidada.to_d.real_contabil - if @etp.fechado? && solucao.solucao_final == true td.icone-trofeu - if !@etp.fechado? - if solucao.itens_da_solucao.present? td = radio_button_tag 'solucao_final', solucao.id, solucao.solucao_final == true, id: "solucao_#{solucao.id}" - else td = '' td = link_to licitacao_solucoes_do_etp_path(solucao), class: "btn btn-default btn-sm mb-xs", title: "Ver Detalhes" do i.icone-detalhar - if !solucao.etp.fechado? = botao_com_permissao edit_licitacao_solucoes_do_etp_path(solucao, etp_id: @etp.id), {acao: :update}, { \ class_icone: 'icone-editar', params: { class: 'btn btn-default btn-sm mb-xs', title: "Editar" }, } = botao_com_permissao licitacao_solucoes_do_etp_path(solucao, etp_id: @etp.id), { acao: :destroy }, { \ class_icone: 'icone-excluir', params: { \ method: :delete, data: { confirm: 'Tem certeza?' }, class: 'btn btn-default btn-sm mb-xs', title: 'Apagar', }, } - content_for :js do javascript: $(document).on('click', 'input[name="solucao_final"]', function() { var selectedSolucaoId = $('input[name="solucao_final"]:checked').val(); if(selectedSolucaoId) {{ $.ajax({ url: `/licitacao/solucoes_do_etp/${selectedSolucaoId}/atualizar_solucao_final`, type: 'POST', data: { esta_selecionado: selectedSolucaoId ? true : false }, success: function(response) { console.log('AJAX request was successful'); }, error: function(xhr, status, error) { console.error('AJAX request failed'); } }); }} });