diff --git a/spaces/app.vue b/spaces/app.vue index 39fe83d..707bcfa 100644 --- a/spaces/app.vue +++ b/spaces/app.vue @@ -41,7 +41,7 @@ const userMenuItems = ref([ { label: 'Benutzer', icon: 'i-heroicons-user-group', - to: "/settings/users" + to: "/users" } ]) diff --git a/spaces/pages/employees/timetracking.vue b/spaces/pages/employees/timetracking.vue index bb5d9f1..fcd16f5 100644 --- a/spaces/pages/employees/timetracking.vue +++ b/spaces/pages/employees/timetracking.vue @@ -49,6 +49,11 @@ const itemInfo = ref({ const columns = [ + { + key:"state", + label: "Status", + sortable:true + }, { key: "user", label: "Benutzer", @@ -180,6 +185,24 @@ const format = (date) => { return `${dateFormat}`; } + +const getDuration = (time) => { + const dez = dayjs(time.end).diff(time.start,'hour',true).toFixed(2) + const hours = Math.floor(dez) + const minutes = Math.floor((dez - hours) * 60) + return { + dezimal: dez, + hours: hours, + minutes: minutes, + composed: `${hours}:${minutes}` + } +} + +const setState = async (newState) => { + itemInfo.value.state = newState + await updateTime() +} + @@ -356,18 +379,26 @@ const format = (date) => { - - Erstellen - - - Speichern - + + + Erstellen + + + Speichern + + + Einreichen + + + @@ -383,6 +414,20 @@ const format = (date) => { itemInfo = row; showConfigTimeModal = true}" > + + {{row.state}} + {{row.state}} + {{row.state}} + {{dataStore.profiles.find(profile => profile.id === row.user) ? dataStore.profiles.find(profile => profile.id === row.user).fullName : row.user }} @@ -394,7 +439,7 @@ const format = (date) => { {{dayjs(row.end).format("DD.MM.YY HH:mm")}} - {{`${String(dayjs(row.end).diff(row.start,'hour',true).toFixed(2)).replace(".",",")} h`}} + {{getDuration(row).composed}} {{dataStore.projects.find(project => project.id === row.projectId) ? dataStore.projects.find(project => project.id === row.projectId).name : ""}} diff --git a/spaces/pages/settings/users/[mode]/[[id]].vue b/spaces/pages/settings/users/[mode]/[[id]].vue deleted file mode 100644 index f28b0f7..0000000 --- a/spaces/pages/settings/users/[mode]/[[id]].vue +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - {{currentItem.state}} - - - {{currentItem.title}} - - - Beschreibung: - {{currentItem.description}} - - - - - - - - Bearbeiten - - - Archivieren - - - - - - - - - - {{itemInfo.title}} - - - - - - - - - - - - - - {{dataStore.customers.find(customer => customer.id === itemInfo.customer) ? dataStore.customers.find(customer => customer.id === itemInfo.customer).name : "Kunde auswählen"}} - - - - - - - - - - - - - Speichern - - - Erstellen - - - Abbrechen - - - - - - - - \ No newline at end of file diff --git a/spaces/pages/users/[mode]/[[id]].vue b/spaces/pages/users/[mode]/[[id]].vue new file mode 100644 index 0000000..db8bda8 --- /dev/null +++ b/spaces/pages/users/[mode]/[[id]].vue @@ -0,0 +1,491 @@ + + + + + + + {{currentItem.fullName}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Speichern + + + + + + + Heute + + + Diese Woche + + + Dieser Monat + + + Dieses Jahr + + + Letztes Jahr + + + + Zur Zeiterfassung + + + + + Summe: {{getSelectionSum.sum}} + Summe Entwurf: {{getSelectionSum.sumEntwurf}} + Summe Eingereicht: {{getSelectionSum.sumEingereicht}} + Summe Bestätigt: {{getSelectionSum.sumBestaetigt}} + + + + + + {{row.state}} + {{row.state}} + {{row.state}} + + + {{dayjs(row.start).format("DD.MM.YY HH:mm")}} + + + {{dayjs(row.end).format("HH:mm")}} + + + {{dataStore.getProfileById(row.user) ? dataStore.getProfileById(row.user).fullName : ""}} + + + {{ getDuration(row).composed}} Std + + + {{dataStore.getProjectById(row.projectId) ? dataStore.getProjectById(row.projectId).name : ""}} + + + + + + + + + + + + + + + + + + + Bearbeiten + + + + + + + + + {{itemInfo.title}} + + + + + + + + + + + + + + {{dataStore.customers.find(customer => customer.id === itemInfo.customer) ? dataStore.customers.find(customer => customer.id === itemInfo.customer).name : "Kunde auswählen"}} + + + + + + + + + + + + + Speichern + + + Erstellen + + + Abbrechen + + + + + + + + \ No newline at end of file diff --git a/spaces/pages/settings/users/index.vue b/spaces/pages/users/index.vue similarity index 89% rename from spaces/pages/settings/users/index.vue rename to spaces/pages/users/index.vue index a5fc2db..504fe70 100644 --- a/spaces/pages/settings/users/index.vue +++ b/spaces/pages/users/index.vue @@ -36,7 +36,7 @@ const columns = [ router.push(`/settings/users/show/${item.id}`)" + @select="(item) => router.push(`/users/show/${item.id}`)" >