Добавлены 4 кнопки для каждой формы
This commit is contained in:
@@ -78,3 +78,23 @@ a.link:hover {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
border: 3px solid black;
|
border: 3px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.type_doc_header#tabs {
|
||||||
|
width: 75%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type__doc__list__type__container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
grid-template-rows: repeat(2, 1fr);
|
||||||
|
place-items: center;
|
||||||
|
gap: 15px;
|
||||||
|
a.link {
|
||||||
|
font-size: 1.35rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a.link:has(.active__button) {
|
||||||
|
background-color: gray;
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,18 +6,27 @@ class OrganisationsController < ApplicationController
|
|||||||
hash[org.id] = {
|
hash[org.id] = {
|
||||||
"ИНН" => org.inn,
|
"ИНН" => org.inn,
|
||||||
"Полное наименование юридического лица" => org.full_name,
|
"Полное наименование юридического лица" => org.full_name,
|
||||||
"КПП" => org.kpp,
|
# "КПП" => org.kpp,
|
||||||
"Код по ОКПО" => org.okpo,
|
# "Код по ОКПО" => org.okpo,
|
||||||
"Форма собственности (по ОКФС)" => org.okfs,
|
# "Форма собственности (по ОКФС)" => org.okfs,
|
||||||
"Организационно-правовая форма (по ОКОПФ)" => org.okopf,
|
# "Организационно-правовая форма (по ОКОПФ)" => org.okopf,
|
||||||
"Вид экономической деятельности по ОКВЭД 2" => org.okved2,
|
# "Вид экономической деятельности по ОКВЭД 2" => org.okved2,
|
||||||
"Местонахождение (адрес)" => org.address
|
# "Местонахождение (адрес)" => org.address
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
org = Organization.find(params[:id])
|
org = Organization.find(params[:id])
|
||||||
|
@org_id = org.id
|
||||||
|
|
||||||
|
doc_types = {
|
||||||
|
0 => 'Бухгалтерский баланс',
|
||||||
|
1 => 'Отчёт о финансовых результатах',
|
||||||
|
2 => 'Отчёт об изменении капитала',
|
||||||
|
3 => 'Отчет о движении денежных средств'
|
||||||
|
}
|
||||||
|
@type_doc = params[:type_doc].present? ? params[:type_doc].to_i : 0
|
||||||
|
|
||||||
@info_about_organisation = {
|
@info_about_organisation = {
|
||||||
"Сведения об организации" => {
|
"Сведения об организации" => {
|
||||||
@@ -39,5 +48,7 @@ class OrganisationsController < ApplicationController
|
|||||||
["Себестоимость продаж", -228706983, -178449438]]
|
["Себестоимость продаж", -228706983, -178449438]]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@doc_name = doc_types[@type_doc]
|
||||||
|
@current_doc_info = @info_about_organisation[@doc_name]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -4,4 +4,5 @@ import "controllers"
|
|||||||
import "jquery"
|
import "jquery"
|
||||||
import "jquery_ujs"
|
import "jquery_ujs"
|
||||||
import "toastr"
|
import "toastr"
|
||||||
|
import "tabs_select"
|
||||||
window.toastr = toastr
|
window.toastr = toastr
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
let tabs_select = () => {
|
||||||
|
const tabsContainer = document.getElementById("tabs")
|
||||||
|
if (!tabsContainer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const buttons = tabsContainer.getElementsByClassName("switch__button")
|
||||||
|
for (const button of buttons) {
|
||||||
|
const value = button.getAttribute("data-value");
|
||||||
|
const id = button.getAttribute("id");
|
||||||
|
button.classList.toggle("active__button", value === id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('turbo:load', tabs_select)
|
||||||
|
console.log('Hi')
|
||||||
@@ -6,25 +6,25 @@
|
|||||||
= 'У данной организации пока не загружена отчетность'
|
= 'У данной организации пока не загружена отчетность'
|
||||||
- else
|
- else
|
||||||
.informations-data
|
.informations-data
|
||||||
- @info_about_organisation.each do |organisation_name, params|
|
|
||||||
h2
|
h2
|
||||||
= "#{organisation_name}"
|
= "Сведения об организации"
|
||||||
- if organisation_name == "Сведения об организации"
|
|
||||||
.information-data
|
.information-data
|
||||||
- params.keys.each do |key|
|
- @info_about_organisation["Сведения об организации"].each do |key, value|
|
||||||
.information-elem
|
.information-elem
|
||||||
= "#{key}: #{params[key]}"
|
= "#{key}: #{value}"
|
||||||
- else
|
= render 'organisations/templates/type_doc', target: "type_doc_#{@type_doc}", org_id: "#{@org_id}"
|
||||||
|
h2
|
||||||
|
= "#{@doc_name}"
|
||||||
.information-table
|
.information-table
|
||||||
table
|
table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
- params[0].each do |value|
|
- @current_doc_info[0].each do |value|
|
||||||
th
|
th
|
||||||
= value
|
= value
|
||||||
|
|
||||||
tbody
|
tbody
|
||||||
- params[1..-1].each do |values|
|
- @current_doc_info[1..-1].each do |values|
|
||||||
tr
|
tr
|
||||||
- values.each do |value|
|
- values.each do |value|
|
||||||
td
|
td
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
.main__container
|
||||||
|
.type_doc_header#tabs
|
||||||
|
.type__doc__list__type__container
|
||||||
|
a.link[href="/organisations/#{org_id}?type_doc=0"]
|
||||||
|
.switch__button.text-large#type_doc_0 data-value=target
|
||||||
|
= 'Бухгалтерский баланс'
|
||||||
|
a.link[href="/organisations/#{org_id}?type_doc=1"]
|
||||||
|
.switch__button.text-large#type_doc_1 data-value=target
|
||||||
|
= 'Отчёт о финансовых результатах'
|
||||||
|
/ - if not_simplified
|
||||||
|
a.link[href="/organisations/#{org_id}?type_doc=2"]
|
||||||
|
.switch__button.text-large#type_doc_2 data-value=target
|
||||||
|
= 'Отчёт об изменении капитала'
|
||||||
|
a.link[href="/organisations/#{org_id}?type_doc=3"]
|
||||||
|
.switch__button.text-large#type_doc_3 data-value=target
|
||||||
|
= 'Отчёт о движении денежных средств'
|
||||||
@@ -12,3 +12,4 @@ pin "jquery_ujs", to: "jquery_ujs.js", preload: true
|
|||||||
pin "jquery-ui", to: "jquery-ui.js", preload: true
|
pin "jquery-ui", to: "jquery-ui.js", preload: true
|
||||||
pin "inputmask", to: "jquery.inputmask.bundle.min.js", preload: true
|
pin "inputmask", to: "jquery.inputmask.bundle.min.js", preload: true
|
||||||
pin 'slimselect', to: 'slimselect.min.js', preload: true
|
pin 'slimselect', to: 'slimselect.min.js', preload: true
|
||||||
|
pin "tabs_select", to: 'tabs_select.js', preload: true
|
||||||
Reference in New Issue
Block a user