From cf8908772ec8b972694d2a284fc01b3d77e2f282 Mon Sep 17 00:00:00 2001
From: Kseninia Mikhaylova
Date: Tue, 18 Jun 2024 16:26:21 +0300
Subject: [PATCH] total
---
components/calcValues.vue | 10 ++++++----
components/modal.vue | 9 ++++++---
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/components/calcValues.vue b/components/calcValues.vue
index 6a83be1..2cbcf5c 100644
--- a/components/calcValues.vue
+++ b/components/calcValues.vue
@@ -50,7 +50,7 @@ const form_refs = {
}
const changeParametres = () => {
- if(form_state.total_length * 1000 < parametric.length.min) {
+ if (form_state.total_length * 1000 < parametric.length.min) {
return
}
const lamelles = Math.floor(form_state.height / parametric.height.step)
@@ -196,7 +196,8 @@ const plurals = {
Забор общей длиной {{ form_state.total_length }}{{ '\xa0' }}м,
{{ section_count }}
по
- {{ parseInt(form_state.length).toFixed(2) }}{{ '\xa0' }}мм
+ {{ parseInt(form_state.length).toFixed(2) }}{{ '\xa0' }}мм
и 1 дополнительная секция длиной {{ form_state.extra_section.toFixed(2) }}{{ '\xa0'
}}мм.
@@ -207,8 +208,9 @@ const plurals = {
{{ section_count * lamelles_count }}
- {{ `длиной ${parseInt(form_state.length).toFixed(2)}\xa0мм` }}и
- {{ ~~(!!form_state.extra_section.toFixed(2)) * lamelles_count }}
+ {{ `длиной ${parseInt(form_state.length).toFixed(2)}\xa0мм` }}
+ {{ `и ${~~(!!form_state.extra_section.toFixed(2)) * lamelles_count}` }}
{{ `длиной ${form_state.extra_section}\xa0мм` }}
.
diff --git a/components/modal.vue b/components/modal.vue
index 994aa1e..6158811 100644
--- a/components/modal.vue
+++ b/components/modal.vue
@@ -104,13 +104,16 @@ const total = computed(() => {
const top_count = section_count.value
const top = top_count * lamella
- const guides_count = section_count.value
- const guides = guides_count * parseFloat(guide) * lam_count * 115
+ const guides_count = section_count.value * 2
+ const guides = guides_count * parseFloat(guide) * lam_count * 0.115
+
+ const total = (!remove_pillar.value ? pil : 0) + lam + guides + top
return [
!remove_pillar.value && `Столб, ${pillar_count}: (${parseFloat(mortgage)} + ${parseFloat(pillar)}) x ${pillar_count} = ${roubleSign.format(pil)}`,
`Ламели, ${lam_count}: (${lam_count} x ${length} x ${lamella}) + ${rivets} = ${roubleSign.format(lam)}`,
- `Направляющая, ${guides_count}: ${guides_count} x ${guide} x ${lam_count} x 115 = ${roubleSign.format(guides)}`,
+ `Направляющая, ${guides_count}: ${guides_count} x ${guide} x ${lam_count} x 0.115 = ${roubleSign.format(guides)}`,
`Верхняя планка, ${top_count}: ${top_count} x ${length} x ${bar} = ${roubleSign.format(top)}`,
+ `Итого ${roubleSign.format(total)}`
].filter(Boolean)
})