@ -14,10 +14,9 @@
<th width="6%">序号</th>
<th width="6%">序号</th>
<th width="10%">ID</th>
<th width="10%">ID</th>
<th width="20%" class="edu-txt-left">单位名称</th>
<th width="20%" class="edu-txt-left">单位名称</th>
<th width="24%">时段一<br><%= "( #{params[:begin_date]}至#{params[:end_date]}) " %></th>
<th width="22%">时段一<br><%= "( #{params[:begin_date]}至#{params[:end_date]}) " %></th>
<th width="24%">时段二<br><%= "( #{params[:other_begin_date]}至#{params[:other_end_date]}) " %></th>
<th width="22%">时段二<br><%= "( #{params[:other_begin_date]}至#{params[:other_end_date]}) " %></th>
<th width="16%" colspan="2">
<th width="20%" colspan="2">
<%#= sort_tag('变化情况', name: 'percentage', path: school_data_contrast_managements_path) %>
变化情况
变化情况
<br>( 新 增 数 | 新增百分比)
<br>( 新 增 数 | 新增百分比)
</th>
</th>
@ -31,21 +30,25 @@
<td class="edu-txt-left"><%= report.school_name %></td>
<td class="edu-txt-left"><%= report.school_name %></td>
<td><%= report['total'] %></td>
<td><%= report['total'] %></td>
<td><%= report['other_total'] %></td>
<td><%= report['other_total'] %></td>
<% if report['increase'] > 0 %>
<%
increase = report['other_total'] - report['total']
percentage = report['total'].zero? ? increase.to_f * 100 : (increase / report['total'].to_f) * 100
%>
<% if increase > 0 %>
<td class="edu-txt-right pr20 right-border" style="position: relative; color: red;">
<td class="edu-txt-right pr20 right-border" style="position: relative; color: red;">
+<%= report['increase'] %>
+<%= increase %>
</td>
</td>
<td class="edu-txt-left pl20 c_red" style="color: red;">+<%= report['percentage'] %>%</td>
<td class="edu-txt-left pl20 c_red" style="color: red;">+<%= percentage.round(5) %>%</td>
<% elsif report[' increase'] .zero? %>
<% elsif increase.zero? %>
<td class="edu-txt-right pr20 right-border" style="position: relative;">
<td class="edu-txt-right pr20 right-border" style="position: relative;">
<%= report[' increase'] %>
<%= increase %>
</td>
</td>
<td class="edu-txt-left pl20"><%= report['percentage'] %> </td>
<td class="edu-txt-left pl20"><%= percentage.round(5) %>% </td>
<% else %>
<% else %>
<td class="edu-txt-right pr20 right-border c_green" style="position: relative; color: green;">
<td class="edu-txt-right pr20 right-border c_green" style="position: relative; color: green;">
<%= report[' increase'] %>
<%= increase %>
</td>
</td>
<td class="edu-txt-left pl20" style="color: green;"><%= report['percentage'] %>%</td>
<td class="edu-txt-left pl20" style="color: green;"><%= percentage.round(5) %>%</td>
<% end %>
<% end %>
</tr>
</tr>
<% end %>
<% end %>