This commit is contained in:
2024-04-10 10:09:56 +02:00
parent 9fa1059301
commit bf04b9c563
12 changed files with 230 additions and 241 deletions

View File

@@ -116,7 +116,7 @@ setupPage()
<UTabs
v-if="currentItem && mode == 'show'"
:items="[{label: 'Informationen'}, /*{label: 'Logbuch'},*/ {label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}, {label: 'Ansprechpartner'}]"
:items="[{label: 'Informationen'},{label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}]"
class="p-5"
>
<template #item="{item}">
@@ -223,7 +223,7 @@ setupPage()
<UButton
@click="router.push(`/contracts/create?customer=${currentItem.id}`)"
>
+ Objekt
+ Vertrag
</UButton>
</Toolbar>
<UTable

View File

@@ -206,7 +206,7 @@ setupPage()
></USelectMenu>
<UButton
@click="itemInfo.resources.push(dataStore.getResourcesList.find(i => i.id === resourceToAdd))"
:disabled="itemInfo.resources.find(i => i.id === resourceToAdd)"
:disabled="itemInfo.resources.find(i => i.id === resourceToAdd)"
>
+ Hinzufügen
</UButton>

View File

@@ -134,7 +134,7 @@ function changeFocusToQuantity() {
<USelectMenu
:options="dataStore.spaces"
searchable
option-attribute="description"
option-attribute="spaceNumber"
:color="checkSpaceId(inventoryChangeData.spaceId) ? 'primary' : 'rose'"
v-model="inventoryChangeData.spaceId"
v-on:select="changeFocusToQuantity"

View File

@@ -9,6 +9,7 @@ const user = useSupabaseUser()
const router = useRouter()
const colorMode = useColorMode()
const dataStore = useDataStore()
const toast = useToast()
const isLight = computed({
get () {
@@ -43,9 +44,12 @@ const onSubmit = async (data) => {
password: data.password
})
if(error) {
console.log(error.toString())
if(error.toString().toLowerCase().includes("invalid")){
toast.add({title:"Zugangsdaten falsch",color:"rose"})
}
} else {
console.log("Login Successful")
//console.log("Login Successful")
dataStore.initializeData(user.id)
router.push("/")

View File

@@ -13,7 +13,9 @@ let currentItem = ref(null)
//Working
const mode = ref(route.params.mode || "show")
const itemInfo = ref({})
const itemInfo = ref({
profile: dataStore.activeProfile.id
})
const oldItemInfo = ref({})
const categories = ["Offen", "In Bearbeitung", "Dringed", "Erledigt"]

View File

@@ -65,7 +65,7 @@ const setupPage = () => {
}
if(mode.value === "edit") itemInfo.value = currentItem.value
if(currentItem.value.id) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value))
if(currentItem.value) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value))
}
const cancelEditorCreate = () => {

View File

@@ -55,6 +55,7 @@ setupPage()
</UButton>
<UButton
v-else-if="mode === 'edit' && !itemInfo.id"
@click="dataStore.createNewItem('workingtimes',itemInfo)"
>
Erstellen
</UButton>