75 lines
3.3 KiB
Plaintext
75 lines
3.3 KiB
Plaintext
<%# app/views/consolidacao_entregas/revisar.html.erb — PASSO 3: Revisar %>
|
|
<% content_for :title, "Revisar — #{@motorista}" %>
|
|
|
|
<div class="max-w-3xl mx-auto">
|
|
|
|
<div class="mb-6">
|
|
<%= link_to '← Voltar (Passo 2)',
|
|
validar_consolidacao_consolidacao_entregas_path(@consolidacao, motorista: @motorista),
|
|
class: 'text-gray-500 hover:text-orange-500 text-sm' %>
|
|
<h1 class="text-2xl font-bold text-white mt-2">📋 Revisão — <%= @motorista %></h1>
|
|
<p class="text-gray-400 text-sm"><%= @consolidacao.nome %></p>
|
|
</div>
|
|
|
|
<%# Resumo por tipo %>
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-3 mb-6">
|
|
<% [
|
|
['entrega_normal', 'Normal', 'bg-orange-500 text-black'],
|
|
['retirada', 'Retirada', 'bg-orange-800 text-white'],
|
|
['bonus', 'Bônus', 'bg-white text-black'],
|
|
['desconto', 'Desconto', 'bg-black text-white border border-gray-700']
|
|
].each do |tipo, label, cores| %>
|
|
<div class="<%= cores %> rounded-xl p-4 text-center">
|
|
<p class="font-black text-3xl"><%= @resumo[tipo] || 0 %></p>
|
|
<p class="text-sm font-semibold"><%= label %></p>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%# Total %>
|
|
<div class="bg-[#1a1a1a] border border-orange-500 rounded-xl p-6 mb-6 text-center">
|
|
<p class="text-gray-400 text-sm mb-1">Total a pagar — <%= @motorista %></p>
|
|
<p class="text-orange-500 font-black text-4xl"><%= moeda(@total) %></p>
|
|
<p class="text-gray-500 text-xs mt-1"><%= @classificacoes.size %> entregas classificadas</p>
|
|
</div>
|
|
|
|
<%# Detalhe das classificações %>
|
|
<div class="bg-[#1a1a1a] border border-[#2a2a2a] rounded-xl overflow-hidden mb-6">
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-[#0a0a0a] text-gray-400">
|
|
<tr>
|
|
<th class="text-left px-4 py-3">Tracking / NF</th>
|
|
<th class="text-left px-4 py-3">Tipo</th>
|
|
<th class="text-right px-4 py-3">Valor</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-[#2a2a2a]">
|
|
<% @classificacoes.each do |c| %>
|
|
<tr>
|
|
<td class="px-4 py-3 text-white font-mono text-xs"><%= c.tracking_id %></td>
|
|
<td class="px-4 py-3">
|
|
<span class="<%= c.tipo_cor[:bg] %> <%= c.tipo_cor[:text] %> px-2 py-1 rounded text-xs font-bold">
|
|
<%= c.tipo_cor[:label] %>
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-3 text-right font-bold <%= c.desconto? ? 'text-red-400' : 'text-white' %>">
|
|
<%= c.desconto? ? '-' : '' %><%= moeda(c.valor_aplicado) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<%# Ações finais %>
|
|
<div class="flex flex-col md:flex-row gap-3">
|
|
<% if @proximo %>
|
|
<%= link_to "Próximo motorista: #{@proximo} →",
|
|
validar_consolidacao_consolidacao_entregas_path(@consolidacao, motorista: @proximo),
|
|
class: 'flex-1 bg-orange-500 hover:bg-orange-600 text-black font-bold py-3.5 rounded-lg min-h-[48px] flex items-center justify-center text-center' %>
|
|
<% end %>
|
|
<%= link_to '💾 Salvar rascunho e voltar', wizard_consolidacao_path(@consolidacao),
|
|
class: 'flex-1 bg-[#1a1a1a] hover:bg-[#2a2a2a] text-white border border-[#2a2a2a] font-bold py-3.5 rounded-lg min-h-[48px] flex items-center justify-center' %>
|
|
</div>
|
|
</div>
|