Skip to content

Commit

Permalink
without edit note
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Jan 5, 2025
1 parent 1d3b9a4 commit 087b1ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/controllers/trade/in/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def order_params
:note,
:generate_mode,
:current_cart_id,
items_attributes: [:good_name, :source_id, :number, :single_price],
items_attributes: [:good_name, :source_id, :number, :single_price, :note],
item_promotes_attributes: {}
)
_p.fetch(:items_attributes, {}).each do |_, v|
Expand Down
6 changes: 3 additions & 3 deletions app/views/trade/in/orders/_cart/_index_tfoot.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<tfoot>
<tr>
<td colspan="4"></td>
<td>
<%= form_with theme: 'inline', model: @order, url: { action: 'create' }, id: 'new_order' do |f| %>
<td colspan="4" class="text-centered">
<%= form_with theme: 'inline', model: @order, url: { action: 'create' }, class: 'display-inline-flex' do |f| %>
<%= f.hidden_field :current_cart_id %>
<%= f.text_area :note, placeholder: true, class: 'input' %>
<%= f.submit '确认订单', class: 'button is-success' %>
<% end %>
</td>
Expand Down
8 changes: 0 additions & 8 deletions app/views/trade/in/orders/_cart/_item_tbody.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<td><%= model.good_name %></td>
<td><%= model.uuid %></td>
<td><%= model.number %></td>
<td>
<%= form_with theme: 'inline', model: model, url: { controller: 'items', action: 'update', id: model.id }, method: :patch do |f| %>
<%= f.hidden_field :current_cart_id, value: params[:current_cart_id] %>
<%= f.text_field :note, placeholder: true, class: 'input' %>
<%= f.submit %>
<% end %>
</td>
<td><%= model.amount.to_money.format.html_safe %></td>

0 comments on commit 087b1ab

Please sign in to comment.