Skip to content

Commit

Permalink
provide
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Mar 9, 2025
1 parent 980afa0 commit 89a4d36
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
11 changes: 10 additions & 1 deletion app/views/factory/admin/base/_production_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<div class="tabs is-centered mb-3">
<ul>
<li class="<%= active_helper(productions: ['show', 'edit'], active: 'is-active') %>">
<%= link_to t('.productions.show.title'), { controller: 'factory/admin/productions', action: 'show', product_id: @production.product_id, id: @production.id } %>
<%= link_to({ controller: 'factory/admin/productions', action: 'show', product_id: @production.product_id, id: @production.id }) do %>
<i class="fa-solid fa-info-circle"></i>
<span class="ml-1"><%= t('.productions.show.title') %></span>
<% end %>
</li>
<li class="<%= active_helper(controllers: 'production_parts', active: 'is-active') %>">
<%= link_to({ controller: 'production_parts', production_id: @production.id }) do %>
Expand All @@ -22,6 +25,12 @@
<span class="ml-1"><%= t('.production_items.index.title') %></span>
<% end %>
</li>
<li class="<%= active_helper(controllers: 'production_provides', active: 'is-active') %>">
<%= link_to({ controller: 'production_provides', production_id: @production.id }) do %>
<i class="fa-solid fa-list text-primary"></i>
<span class="ml-1"><%= t('.production_provides.index.title') %></span>
<% end %>
</li>
<li class="<%= active_helper(controllers: 'purchase_items', active: 'is-active') %>">
<%= link_to({ controller: 'purchase_items', production_id: @production.id }) do %>
<i class="fa-solid fa-list text-success"></i>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<th><%= Factory::PartProvider.human_attribute_name(:provider_id) %></th>
<th><%= Factory::ProductionProvide.human_attribute_name(:provider_id) %></th>
<th>
<p><%= Factory::PartProvider.human_attribute_name(:upstream_production_id) %></p>
<p><%= Factory::PartProvider.human_attribute_name(:upstream_product_id) %></p>
<p><%= Factory::ProductionProvide.human_attribute_name(:upstream_production_id) %></p>
<p><%= Factory::ProductionProvide.human_attribute_name(:upstream_product_id) %></p>
</th>
<th><%= Factory::PartProvider.human_attribute_name(:cost_price) %></th>
<th><%= Factory::PartProvider.human_attribute_name(:verified) %></th>
<th><%= Factory::PartProvider.human_attribute_name(:selected) %></th>
<th><%= Factory::PartProvider.human_attribute_name(:created_at) %></th>
<th><%= Factory::ProductionProvide.human_attribute_name(:cost_price) %></th>
<th><%= Factory::ProductionProvide.human_attribute_name(:verified) %></th>
<th><%= Factory::ProductionProvide.human_attribute_name(:selected) %></th>
<th><%= Factory::ProductionProvide.human_attribute_name(:created_at) %></th>
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<li><%= link_to t('.products.index.title'), { controller: 'products' } %></li>
<li><span class="px-3"><%= @production.product.name %></span></li>
<li><%= link_to t('.productions.index.title'), { controller: 'productions', product_id: @production.product_id } %></li>
<li><%= link_to @production.name, { controller: 'productions', action: 'show', product_id: @production.product_id, id: @production.id } %></li>
<li class="is-active"><%= t('.title') %></li>
<%= render 'production_breadcrumb' %>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% @providers.each do |provider| %>
<%= button_to({ action: 'new', organ_id: provider.id, **request.query_parameters.except(:id) }, class: 'button is-link') do %>
<% @provides.each do |provide| %>
<%= button_to({ action: 'new', provide_id: provide.id, **request.query_parameters.except(:id) }, class: 'button is-link') do %>
<i class="fa-solid fa-plus"></i>
<span class="ml-1"><%= provider.name %></span>
<span class="ml-1"><%= provide.name %></span>
<% end %>
<% end %>
9 changes: 9 additions & 0 deletions app/views/factory/admin/production_provides/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%= render 'production_bar' %>
<%= render 'index_bar' %>
<%= render 'index_actions' %>

<%= render layout: 'index_table' do %>
<%= render partial: 'index_tbody', layout: 'index_tr', collection: @production_provides, as: :model %>
<% end %>

<%= paginate @production_provides %>
2 changes: 1 addition & 1 deletion config/locales/zh.controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ zh:
part_plans:
index:
title: 入库计划
part_providers:
production_provides:
index:
title: 供应商管理
productions:
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
end
end
resources :stock_logs
resources :part_providers do
resources :production_provides do
collection do
post :search
end
Expand Down

0 comments on commit 89a4d36

Please sign in to comment.