<% if @user %>

Name: <%= @user.name %> <%= link_to 'carts', user_id: @user.id %>

Email: <%= @user.email %>

<% end %> <% if @buyer %>

Company Name: <% @buyer.name %>(<%= @buyer.id %>) <%= link_to 'carts', buyer_id: @buyer.id %>

<%= select_tag :user_id, options_from_collection_for_select(@buyer.users, :id, :name, @user&.id), include_blank: true, class: 'ui dropdown' %>

<% end %>
<% if @user %> <%= link_to '生成订单', new_admin_order_path(user_id: @user.id), class: 'ui red button', id: 'new_order_top' %> <%= link_to '生成文档', doc_admin_cart_items_path(user_id: @user.id), class: 'ui orange button', id: 'cart_items_doc' %> <% end %>
<% @cart_items.each do |cart_item| %> <% end %> <%= render 'additions' %>
<%= check_box_tag :all %> Name 报价 数量 原价 最终价格 预成单报价 Actions
<%= check_box_tag(:cart_item_id, cart_item.id, cart_item.checked) %> <%= cart_item.good&.name %> <%= link_to only_admin_cart_items_path(good_type: cart_item.good_type, good_id: cart_item.good_id) do %> <% end %> <% cache [cart_item, 'good_price'] do %> <%= render partial: 'good_price', locals: { cart_item: cart_item } %> <% end %>
<%= text_field_tag :quantity, cart_item.quantity, id: "quantity_#{cart_item.id}", onkeyup: "update_quantity(#{cart_item.id})", disabled: true %>
<% cache [cart_item, 'retail_price'] do %> <%= render partial: 'retail_price', locals: { cart_item: cart_item } %> <% end %> <% cache [cart_item, 'single_price'] do %> <%= render partial: 'single_price', locals: { cart_item: cart_item } %> <% end %> <% cache [cart_item, 'order_price'] do %> <%= render partial: 'order_price', locals: { cart_item: cart_item } %> <% end %> <%= link_to 'delete', admin_cart_item_path(cart_item), method: :delete, remote: true, class: 'ui mini label' %>
<%= render 'total_price' %>
<% if @user %> <%= link_to '生成订单', new_admin_order_path(user_id: @user.id), class: 'ui red button', id: 'new_order_bottom' %> <% end %>
<%= paginate @cart_items %>