This commit is contained in:
2024-03-01 22:48:03 +01:00
parent 3924fd79d2
commit b4b70d8e7c
10 changed files with 420 additions and 693 deletions

View File

@@ -81,7 +81,7 @@ const addHistoryItem = async () => {
const {data,error} = await supabase
.from("historyitems")
.insert([addHistoryItemData.value])
.insert([{...addHistoryItemData.value, tenant: dataStore.currentTenant}])
.select()
if(error) {

View File

@@ -5,7 +5,6 @@ import TenantDropdown from "~/components/TenantDropdown.vue";
const dataStore = useDataStore()
const colorMode = useColorMode()
const { isHelpSlideoverOpen } = useDashboard()
const userProfile = dataStore.getOwnProfile
const supabase = useSupabaseClient()
const router = useRouter()
const route = useRoute()
@@ -175,142 +174,7 @@ const navLinks = [
},
]
const showUserMenu = ref(false)
const userMenuItems = ref([
/*{
label: "Profil",
badge: dataStore.notifications.filter(item => item.read).length,
icon: "i-heroicons-user-20-solid"
},*/
{
label: "Nummernkreise",
icon: "i-heroicons-cog-8-tooth",
to: "/settings/numberRanges"
},
{
label: "Einstellungen",
icon: "i-heroicons-cog-8-tooth",
to: "/settings"
},
{
label: 'Benutzer',
icon: 'i-heroicons-user-group',
to: "/users"
}
])
const linksold = [[{
label: "Dashboard",
to: "/",
icon: "i-heroicons-home"
}],
[{
label: "Aufgaben",
to: "/tasks",
icon: "i-heroicons-rectangle-stack"
}, {
label: "Plantafel",
to: "/calendar/timeline",
icon: "i-heroicons-calendar-days"
},
{
label: "Kalender",
to: "/calendar/grid",
icon: "i-heroicons-calendar-days"
},
{
label: "Dokumente",
to: "/documents",
icon: "i-heroicons-document"
},
{
label: "E-Mail",
to: "/email",
icon: "i-heroicons-envelope"
}],[{
label: "Kunden",
to: "/customers",
icon: "i-heroicons-user-group"
},
{
label: "Lieferanten",
to: "/vendors",
icon: "i-heroicons-truck"
},
{
label: "Ansprechpartner",
to: "/contacts",
icon: "i-heroicons-user-group"
}], [{
label: "Belege",
to: "/receipts",
icon: "i-heroicons-document-text"
},
/* {
label: "Bank",
to: "/banking",
icon: "i-heroicons-currency-euro"
}*/], [{
label: "Projekte",
to: "/projects",
icon: "i-heroicons-clipboard-document-check"
},
{
label: "Verträge",
to: "/contracts",
icon: "i-heroicons-clipboard-document"
},
{
label: "Objekte",
to: "/plants",
icon: "i-heroicons-clipboard-document"
}],[{
label: "Zeiterfassung",
to: "/employees/timetracking",
icon: "i-heroicons-clock"
},
{
label: "Anwesenheiten",
to: "/workingtimes",
icon: "i-heroicons-clock"
},
{
label: "Abwesenheiten",
to: "/absenceRequests",
icon: "i-heroicons-document-text"
}],[{
label: "Steuerung",
to: "/inventory",
icon: "i-heroicons-square-3-stack-3d"
},
{
label: "Artikelstamm",
to: "/products",
icon: "i-heroicons-puzzle-piece"
},{
label: "Leistungsstamm",
to: "/services",
icon: "i-heroicons-puzzle-piece"
},
{
label: "Lagerplätze",
to: "/spaces",
icon: "i-heroicons-square-3-stack-3d"
},
{
label: "Fahrzeuge",
to: "/vehicles",
icon: "i-heroicons-truck"
}, {
label: "Inventar",
to: "/inventoryitems",
icon: "i-heroicons-puzzle-piece"
},],[{
label: "Einstellungen",
to:"/settings",
icon: "i-heroicons-cog-8-tooth"
}]
]
let links = [
{

File diff suppressed because it is too large Load Diff

View File

@@ -161,7 +161,7 @@ if(dataStore.times.find(time => time.user == user.value.id && !time.end)) {
const createTime = async () => {
const {data,error} = await supabase
.from("times")
.insert([itemInfo.value])
.insert({...itemInfo.value, tenant: dataStore.currentTenant})
.select()
if(error) {

View File

@@ -11,9 +11,9 @@
</UButton>
</UTooltip>
<UDropdown :items="items">
<!-- <UDropdown :items="items">
<UButton icon="i-heroicons-plus" size="md" class="ml-1.5 rounded-full" />
</UDropdown>
</UDropdown>-->
</template>
</UDashboardNavbar>

View File

@@ -84,11 +84,17 @@ const onSubmit = async (data) => {
</div>-->
<UCard class="max-w-sm w-full mx-auto mt-5">
<img
<UColorModeImage
light="/spaces_hell.svg"
dark="/spaces.svg"
/>
<!-- <img
:src="!isLight ? '/spaces.svg' : '/spaces_hell.svg'"
alt="Logo"
class="w-full mx-auto"
/>
/>-->
<UAuthForm
title="Login"

View File

@@ -81,23 +81,7 @@ setupPage()
<div
v-if="item.label === 'Informationen'"
>
<Toolbar>
<UButton
v-if="mode === 'show' && currentItem.id"
@click="editItem"
>
Bearbeiten
</UButton>
</Toolbar><!--
<UBadge
v-for="tag in currentItem.tags"
class="mr-2"
>
{{tag}}
</UBadge>
<UDivider
class="my-2"
/>-->
<span v-if="currentItem.sellingPrice">Verkaufspreis: {{String(Number(currentItem.sellingPrice).toFixed(2)).replace(".",",")}} <br></span>
</div>
@@ -143,6 +127,13 @@ setupPage()
v-model="itemInfo.name"
/>
</UFormGroup>
<UFormGroup
label="Leistungsnummer:"
>
<UInput
v-model="itemInfo.serviceNumber"
/>
</UFormGroup>
<UFormGroup
label="Einheit:"
>
@@ -174,6 +165,7 @@ setupPage()
:options="dataStore.serviceCategories"
option-attribute="name"
value-attribute="id"
v-model="itemInfo.serviceCategorie"
></USelectMenu>
</UFormGroup>
@@ -190,6 +182,14 @@ setupPage()
</template>
</UInput>
</UFormGroup>
<UFormGroup
label="Beschreibung:"
>
<UTextarea
v-model="itemInfo.description"
:rows="6"
/>
</UFormGroup>
</UForm>
</template>

View File

@@ -405,6 +405,7 @@ export const useDataStore = defineStore('data', () => {
if(supabaseError) {
console.log(supabaseError)
toast.add({title: "Es ist ein Fehler bei der Erstellung aufgetreten", color: "rose"})
} else if (supabaseData) {
await eval( dataType + '.value.push(' + JSON.stringify(...supabaseData) + ')')
toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`})
@@ -425,7 +426,7 @@ export const useDataStore = defineStore('data', () => {
} else if(supabaseData) {
await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0]))
toast.add({title: `${dataTypes[dataType].labelSingle} gespeichert`})
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${supabaseData[0].id}`)
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${data.id}`)
return supabaseData
}
}