Визуальные правки плана
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {NFlex, NTag, NTooltip} from 'naive-ui'
|
import {NFlex, NSpace, NTag, NTooltip} from 'naive-ui'
|
||||||
import {percentType, typePlan} from "../../../Utils/numbers.js";
|
import {percentType} from "../../../Utils/numbers.js";
|
||||||
|
import {computed} from "vue";
|
||||||
|
import {format, toDate} from "date-fns";
|
||||||
|
import {ru} from "date-fns/locale";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isTotalRow: {
|
isTotalRow: {
|
||||||
@@ -23,8 +26,23 @@ const props = defineProps({
|
|||||||
total_debt: 0,
|
total_debt: 0,
|
||||||
year_plan: 0,
|
year_plan: 0,
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
endDate: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const formatedMonth = computed(() => {
|
||||||
|
const date = toDate(props.endDate)
|
||||||
|
return date.toLocaleString('ru', { month: 'long' })
|
||||||
|
})
|
||||||
|
|
||||||
|
const typePlan = computed(() => {
|
||||||
|
if (props.plan.debt_from_year > 20) return 'error'
|
||||||
|
if (props.plan.debt_from_year > 10) return 'warning'
|
||||||
|
return 'success'
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -62,14 +80,17 @@ const props = defineProps({
|
|||||||
{{ plan.cumulative_percent }}%
|
{{ plan.cumulative_percent }}%
|
||||||
</NTag>
|
</NTag>
|
||||||
</template>
|
</template>
|
||||||
<NFlex align="center" justify="start" :wrap="false" size="small">
|
<NSpace vertical>
|
||||||
<NTag size="small" round type="info" :bordered="false">План на месяц: {{ plan.month_plan }}</NTag>
|
<NFlex align="center" justify="start" :wrap="false" size="small">
|
||||||
</NFlex>
|
<NTag type="info">План на {{formatedMonth}}: {{ plan.month_plan }} / {{ plan.current_mouth_dept }}</NTag>
|
||||||
Сначала года + текущий месяц:
|
</NFlex>
|
||||||
<br>План:
|
<NTag :type="typePlan">Долг с начала года: {{ plan.debt_from_year }}</NTag>
|
||||||
<span class="font-medium">{{ plan.cumulative_plan }}</span>, долг:
|
<!-- Долг с начала года: {{ plan.debt_from_year }}-->
|
||||||
<span class="font-medium">{{ plan.debt_from_year }}</span> +
|
</NSpace>
|
||||||
<span class="font-medium">{{ plan.current_mouth_dept }}</span>
|
<!-- <br>План:-->
|
||||||
|
<!-- <span class="font-medium">{{ plan.cumulative_plan }}</span>, долг:-->
|
||||||
|
<!-- <span class="font-medium">{{ plan.debt_from_year }}</span> +-->
|
||||||
|
<!-- <span class="font-medium">{{ plan.current_mouth_dept }}</span>-->
|
||||||
</NTooltip>
|
</NTooltip>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ const columns = ref([
|
|||||||
isTotalRow: row.isTotalRow,
|
isTotalRow: row.isTotalRow,
|
||||||
value: row.outcome,
|
value: row.outcome,
|
||||||
plan: row.plan,
|
plan: row.plan,
|
||||||
|
endDate: props.date[1]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user