Added Times Entry for in project Display

This commit is contained in:
2025-06-01 18:23:34 +02:00
parent 4346fbffe5
commit 08f104d4c9
3 changed files with 128 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
<script setup>
import EntityShowSubTimes from "~/components/EntityShowSubTimes.vue";
const props = defineProps({
type: {
required: true,
@@ -251,6 +253,12 @@ const onTabChange = (index) => {
v-else-if="tab.label === 'Buchungen'"
:platform="platform"
/>
<EntityShowSubTimes
:top-level-type="type"
:item="props.item"
v-else-if="tab.label === 'Zeiten'"
:platform="platform"
/>
<EntityShowSub

View File

@@ -0,0 +1,117 @@
<script setup>
import dayjs from "dayjs";
const supabase = useSupabaseClient()
const route = useRoute()
const router = useRouter()
const profileStore = useProfileStore()
const props = defineProps({
queryStringData: {
type: String
},
item: {
type: Object,
required: true
},
topLevelType: {
type: String,
required: true
},
platform: {
type: String,
required: true
}
})
const setup = async () => {
}
setup()
const columns = [
{
key:"state",
label: "Status",
},
{
key: "user",
label: "Benutzer",
},
{
key:"startDate",
label:"Start",
},
{
key: "endDate",
label: "Ende",
},
{
key: "duration",
label: "Dauer",
},
{
key:"type",
label:"Typ",
},
{
key: "project",
label: "Projekt",
},
{
key: "notes",
label: "Notizen",
}
]
</script>
<template>
<UCard class="mt-5">
<UTable
class="mt-3"
:columns="columns"
:rows="props.item.times"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
<template #state-data="{row}">
<span
v-if="row.state === 'Entwurf'"
class="text-rose-500"
>{{row.state}}</span>
<span
v-if="row.state === 'Eingereicht'"
class="text-cyan-500"
>{{row.state}}</span>
<span
v-if="row.state === 'Bestätigt'"
class="text-primary-500"
>{{row.state}}</span>
</template>
<template #user-data="{row}">
{{row.profile ? row.profile.fullName : "" }}
</template>
<template #startDate-data="{row}">
{{dayjs(row.startDate).format("DD.MM.YY HH:mm")}}
</template>
<template #endDate-data="{row}">
{{dayjs(row.endDate).format("DD.MM.YY HH:mm")}}
</template>
<template #duration-data="{row}">
{{Math.floor(dayjs(row.endDate).diff(row.startDate, "minutes")/60)}}:{{String(dayjs(row.endDate).diff(row.startDate, "minutes") % 60).padStart(2,"0")}} h
</template>
<template #project-data="{row}">
{{row.project ? row.project.name : "" }}
</template>
</UTable>
</UCard>
</template>
<style scoped>
</style>

View File

@@ -978,7 +978,7 @@ export const useDataStore = defineStore('data', () => {
redirect:true,
historyItemHolder: "project",
numberRangeHolder: "projectNumber",
supabaseSelectWithInformation: "*, customer(id,name), plant(id,name), projecttype(name, id), tasks(*, project(id,name), customer(id,name), plant(id,name)), files(*), createddocuments(*, statementallocations(*)), events(*)",
supabaseSelectWithInformation: "*, customer(id,name), plant(id,name), projecttype(name, id), tasks(*, project(id,name), customer(id,name), plant(id,name)), files(*), createddocuments(*, statementallocations(*)), events(*), times(*, profile(id, fullName))",
supabaseSortColumn: "projectNumber",
filters: [
{
@@ -1086,6 +1086,8 @@ export const useDataStore = defineStore('data', () => {
},{
key: "files",
label: "Dateien"
},{
label: "Zeiten"
},{
label: "Ausgangsbelege"
},{