<% if can? :read_history, EducodeSales::Idea %> <% end %>
<% EducodeSales::Idea.where(school_id: @idea.school_id).order("id = #{@idea.id} DESC").each do |idea| %>

<%= idea.id == @idea.id ? "方案信息" : "历史合作" %>


<%= idea.school&.name %>
<%= idea.department&.name %>
<%= idea.manager_name %>

<%= idea.manager_phone %>
<%= idea.name %>
<%= idea.staff&.user&.real_name %>

<%= idea.sale_staff&.user&.real_name %>
<%= idea.assist_staffs.map { |d| d&.user&.real_name }.reject(&:blank?).join("、") %>
<%= link_to "/missions/upload_files/download?id=#{idea.attachment_id}", target: '_blank' do %> <%= idea.attachment&.filename.to_s %> <% end %>

<%= idea.level %>
<%= idea.status %>
<%= idea.types %>

<%= idea.model %>
<%= idea.hardware.to_f.round(2) %>
<%= idea.money.to_f.round(2) %>

<%= idea.project.to_i %>
<%= idea.end_time.to_s %>

<%= idea.content.to_s %>
<% idea.attachments.each do |a| %> <%= link_to "/missions/upload_files/download?id=#{a.id}", target: '_blank' do %> <%= a&.filename.to_s %> <% end %> <% end %>


<% end %>