Kostenstellenhierarchie und Auswertung mit Unterkostenstellen ergänzt
This commit is contained in:
32
frontend/components/columnRenderings/costcentre.vue
Normal file
32
frontend/components/columnRenderings/costcentre.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
row: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: {}
|
||||
},
|
||||
inShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const value = computed(() => {
|
||||
const costcentre = props.row.parentCostcentre || props.row.costcentre || props.row.costCentre || null
|
||||
|
||||
if (!costcentre) {
|
||||
return ""
|
||||
}
|
||||
|
||||
return [costcentre.number, costcentre.name].filter(Boolean).join(" - ")
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="props.row.parentCostcentre">
|
||||
<nuxt-link v-if="props.inShow" :to="`/standardEntity/costcentres/show/${props.row.parentCostcentre.id}`">
|
||||
{{ value }}
|
||||
</nuxt-link>
|
||||
<span v-else>{{ value }}</span>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user