Added Times Entry for in project Display
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
|
import EntityShowSubTimes from "~/components/EntityShowSubTimes.vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
required: true,
|
required: true,
|
||||||
@@ -251,6 +253,12 @@ const onTabChange = (index) => {
|
|||||||
v-else-if="tab.label === 'Buchungen'"
|
v-else-if="tab.label === 'Buchungen'"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
|
<EntityShowSubTimes
|
||||||
|
:top-level-type="type"
|
||||||
|
:item="props.item"
|
||||||
|
v-else-if="tab.label === 'Zeiten'"
|
||||||
|
:platform="platform"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<EntityShowSub
|
<EntityShowSub
|
||||||
|
|||||||
117
components/EntityShowSubTimes.vue
Normal file
117
components/EntityShowSubTimes.vue
Normal 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>
|
||||||
@@ -978,7 +978,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "project",
|
historyItemHolder: "project",
|
||||||
numberRangeHolder: "projectNumber",
|
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",
|
supabaseSortColumn: "projectNumber",
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
@@ -1086,6 +1086,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
},{
|
},{
|
||||||
key: "files",
|
key: "files",
|
||||||
label: "Dateien"
|
label: "Dateien"
|
||||||
|
},{
|
||||||
|
label: "Zeiten"
|
||||||
},{
|
},{
|
||||||
label: "Ausgangsbelege"
|
label: "Ausgangsbelege"
|
||||||
},{
|
},{
|
||||||
|
|||||||
Reference in New Issue
Block a user