From e122ae4d006514aecaf82de2ebaae90fcf43550e Mon Sep 17 00:00:00 2001 From: qinmingyuan <279378275@qq.com> Date: Sun, 8 Sep 2024 14:48:45 +0800 Subject: [PATCH] button --- .../_base/_component_part_number.html.erb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/factory/productions/_base/_component_part_number.html.erb b/app/views/factory/productions/_base/_component_part_number.html.erb index 25168143..e3207f81 100644 --- a/app/views/factory/productions/_base/_component_part_number.html.erb +++ b/app/views/factory/productions/_base/_component_part_number.html.erb @@ -1,4 +1,4 @@ -
+
<%= component_part.part.name %> <% if component_part.part.price.to_d > 0 %> @@ -12,14 +12,18 @@ <%= check_box_tag 'production_parts_attributes[][part_id]', component_part.part_id, @production.part_ids.include?(component_part.part_id), disabled: component.disabled?(@production.part_ids, component_part.part_id), data: { action: 'custom#toggle', part_taxon_id: component.part_taxon_id }, class: 'weui-check display-none', id: "part_#{component_part.part_id}", form: 'edit_custom' %>
- <% if @production.part_ids.include?(component_part.part_id) %> - - <%= number_field_tag 'production_parts_attributes[][number]', component_part.min, form: 'edit_custom', class: 'text-centered', style: 'width: 3rem' %> - <% end %> + <% if @production.part_ids.include?(component_part.part_id) %> + + <%= number_field_tag 'production_parts_attributes[][number]', component_part.min, data: { action: 'change->input#form focus->input#blank', modify_target: 'input' }, form: 'edit_custom', class: 'text-centered', style: 'width: 3rem' %> + + <% else %> + <% end %>