Many Changes

This commit is contained in:
2024-02-01 22:17:56 +01:00
parent 34d1eb9c71
commit bd09d07698
12 changed files with 91 additions and 29 deletions

View File

@@ -160,7 +160,7 @@ setupPage()
v-model="itemInfo.customer"
option-attribute="name"
value-attribute="id"
:options="customers"
:options="dataStore.customers"
searchable
:search-attributes="['name']"
>
@@ -176,7 +176,7 @@ setupPage()
v-model="itemInfo.vendor"
option-attribute="name"
value-attribute="id"
:options="vendors"
:options="dataStore.vendors"
searchable
:search-attributes="['name']"
>
@@ -227,13 +227,13 @@ setupPage()
<template #footer>
<UButton
v-if="mode == 'edit'"
@click="dataStore.updateItem('contacts',itemInfo)"
@click="dataStore.updateItem('contacts',{...itemInfo, fullName: `${itemInfo.firstName} ${itemInfo.lastName}`})"
>
Speichern
</UButton>
<UButton
v-else-if="mode == 'create'"
@click="dataStore.createNewItem('contacts',itemInfo)"
@click="dataStore.createNewItem('contacts',{...itemInfo, fullName: `${itemInfo.firstName} ${itemInfo.lastName}`})"
>
Erstellen
</UButton>

View File

@@ -80,6 +80,17 @@ setupPage()
Beschreibung:<br>
{{currentContract.description}}<br>
<InputGroup>
<DocumentUpload
type="contract"
:element-id="currentContract.id"
/>
</InputGroup>
<DocumentList
:documents="dataStore.getDocumentsByContractId(currentContract.id)"
/>
<DevOnly>
{{currentContract}}
</DevOnly>
@@ -92,14 +103,6 @@ setupPage()
>
Bearbeiten
</UButton>
<UButton
color="red"
class="ml-2"
disabled
>
Archivieren
</UButton>
<!-- TODO: Vertrag archivieren -->
</template>

View File

@@ -239,13 +239,13 @@ const setPosNumbers = () => {
const saveDocument = async () => {
let createData = {
type: itemInfo.value.type,
state: itemInfo.value.state || "Entwurf",
customer: itemInfo.value.customer,
contact: itemInfo.value.contact,
address: itemInfo.value.address,
project: itemInfo.value.project,
documentNumber: itemInfo.value.documentNumber,
documentDate: itemInfo.value.documentDate,
state: "Entwurf",
info: {
},
@@ -277,6 +277,8 @@ const saveDocument = async () => {
const closeDocument = async () => {
itemInfo.value.state = "Gebucht"
await saveDocument()
await generateDocument()
@@ -308,6 +310,9 @@ const closeDocument = async () => {
await dataStore.uploadFiles(fileData, [file], true)
await router.push(`/createDocument/show/${itemInfo.value.id}`)
//console.log(uri)
}

View File

@@ -2,6 +2,7 @@
const dataStore = useDataStore()
const route = useRoute()
const router = useRouter()
const itemInfo = ref({})
@@ -16,8 +17,21 @@ setupPage()
<template>
<InputGroup>
<UButton
@click="router.push(`/createDocument/edit/${itemInfo.id}`)"
>
Bearbeiten
</UButton>
</InputGroup>
{{itemInfo}}
<DocumentDisplay
:document-data="dataStore.documents.find(i => i.createdDocument === itemInfo.id)"
/>
</template>
<style scoped>

View File

@@ -1,7 +1,6 @@
<template>
<div>
Offene Aufgaben: {{openTasks}}<br>
Laufende Projekte:
</div>
</template>

View File

@@ -45,7 +45,7 @@ const resources = {
const updateNumberRange = async (range) => {
const {data,error} = await supabase
.from("numberRanges")
.from("numberranges")
.update(range)
.eq('id',range.id)

View File

@@ -21,6 +21,13 @@
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
<template #finish-data="{row}">
<UButton
icon="i-heroicons-check"
variant="ghost"
@click="markAsFinished(row)"
/>
</template>
<template #created_at-data="{row}">
{{row.created_at ? dayjs(row.created_at).format("DD.MM.YY HH:mm") : ''}}
</template>
@@ -33,6 +40,9 @@
<template #customer-data="{row}">
{{dataStore.customers.find(customer => customer.id === row.customer) ? dataStore.customers.find(customer => customer.id === row.customer).name : "" }}
</template>
<template #plant-data="{row}">
{{dataStore.getPlantById(row.plant) ? dataStore.getPlantById(row.plant).name : "" }}
</template>
</UTable>
</div>
@@ -50,7 +60,10 @@ const router = useRouter()
const mode = ref("show")
const columns = [
{
key:"finish"
},{
key: "created_at",
label: "Erstellt am:",
sortable: true
@@ -106,6 +119,10 @@ const filteredRows = computed(() => {
const selectItem = (item) => {
router.push(`/tasks/show/${item.id} `)
}
const markAsFinished = (item) => {
dataStore.updateItem("tasks", {...item, categorie: "Erledigt"})
}
</script>
<style scoped>

View File

@@ -27,8 +27,10 @@ const itemInfo = ref({
const tabItems = [{
label: 'Informationen',
}, {
},/* {
label: 'Eingangsrechnungen',
},*/ {
label: 'Dokumente',
}]
const incomingInvoicesColumns = [
@@ -154,6 +156,18 @@ setupPage()
</UTable>
</div>
<div v-else-if="item.label === 'Dokumente'">
<InputGroup>
<DocumentUpload
type="vehicle"
:element-id="currentItem.id"
/>
</InputGroup>
<DocumentList
:documents="dataStore.getDocumentsByContractId(currentItem.id)"
/>
</div>
</template>
</UTabs>