Подсчет долга теперь только при начальной дате периода = началу года
This commit is contained in:
@@ -23,18 +23,23 @@ const props = defineProps({
|
||||
debt_from_year: 0,
|
||||
actual_year_to_date: 0,
|
||||
cumulative_percent: 0,
|
||||
is_calculate_debt: false,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// План за период + непогашенный долг, накопленный до начала периода
|
||||
const planWithDebt = computed(() => {
|
||||
return Number(props.plan?.period_plan ?? 0) + Number(props.plan?.debt_at_period_start ?? 0)
|
||||
const periodPlan = Number(props.plan?.period_plan ?? 0)
|
||||
const periodDebt = Number(props.plan?.debt_from_year ?? 0)
|
||||
|
||||
return props.plan?.is_calculate_debt ? periodPlan + periodDebt : periodPlan
|
||||
})
|
||||
|
||||
// % выполнения плана за период с учётом долга (иначе долг никак не влияет на оценку)
|
||||
// % выполнения плана за период с учётом долга
|
||||
const periodPercent = computed(() => {
|
||||
if (!planWithDebt.value) return 0
|
||||
|
||||
return Math.round((Number(props.value) * 100) / planWithDebt.value)
|
||||
})
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ export const percentColor = (number) => {
|
||||
}
|
||||
|
||||
export const percentType = (number) => {
|
||||
if (!Number(number)) return
|
||||
if (number >= 90) return 'success' // Хорошо
|
||||
if (number >= 80) return 'warning' // Плохо
|
||||
return 'error' // Ужасно
|
||||
|
||||
Reference in New Issue
Block a user