New Backend changes
This commit is contained in:
@@ -66,18 +66,18 @@ const showFile = (file) => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.documentListItem {
|
.documentListItem {
|
||||||
display:block;
|
display: block;
|
||||||
width: 15vw;
|
width: 15vw;
|
||||||
aspect-ratio: 1 / 1.414;
|
aspect-ratio: 1 / 1.414;
|
||||||
padding:1em;
|
padding: 1em;
|
||||||
margin: 0.7em;
|
margin: 0.7em;
|
||||||
border: 1px solid lightgrey;
|
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
transition: box-shadow 0.2s ease; /* für smooth hover */
|
||||||
}
|
}
|
||||||
|
|
||||||
.documentListItem:hover {
|
.documentListItem:hover {
|
||||||
border: 1px solid #69c350;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* sanfter Shadow beim Hover */
|
||||||
}
|
}
|
||||||
|
|
||||||
.previewEmbed {
|
.previewEmbed {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const modal = useModal()
|
const modal = useModal()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -27,7 +26,7 @@ const filetypes = ref([])
|
|||||||
const documentboxes = ref([])
|
const documentboxes = ref([])
|
||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
const {data} = await supabase.from("folders").select().eq("tenant",useProfileStore().currentTenant)
|
const data = await useEntities("folders").select()
|
||||||
|
|
||||||
data.forEach(folder => {
|
data.forEach(folder => {
|
||||||
let name = folder.name
|
let name = folder.name
|
||||||
@@ -55,20 +54,12 @@ const setup = async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
filetypes.value = await useSupabaseSelect("filetags")
|
filetypes.value = await useEntities("filetags").select()
|
||||||
documentboxes.value = await useSupabaseSelect("documentboxes")
|
documentboxes.value = await useEntities("documentboxes").select()
|
||||||
}
|
}
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
|
|
||||||
//Functions
|
|
||||||
const openDocument = async () => {
|
|
||||||
//selectedDocument.value = doc
|
|
||||||
openShowModal.value = true
|
|
||||||
console.log("open")
|
|
||||||
}
|
|
||||||
|
|
||||||
const updateDocument = async () => {
|
const updateDocument = async () => {
|
||||||
const {url, ...objData} = props.documentData
|
const {url, ...objData} = props.documentData
|
||||||
delete objData.url
|
delete objData.url
|
||||||
@@ -91,12 +82,7 @@ const updateDocument = async () => {
|
|||||||
|
|
||||||
console.log(objData)
|
console.log(objData)
|
||||||
|
|
||||||
|
const {data,error} = await useEntities("files").update(objData.id, objData)
|
||||||
const {data,error} = await supabase
|
|
||||||
.from("files")
|
|
||||||
.update(objData)
|
|
||||||
.eq('id',objData.id)
|
|
||||||
.select()
|
|
||||||
|
|
||||||
if(error) {
|
if(error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -114,13 +100,6 @@ const archiveDocument = async () => {
|
|||||||
props.documentData.archived = true
|
props.documentData.archived = true
|
||||||
await updateDocument()
|
await updateDocument()
|
||||||
|
|
||||||
const {data,error} = await supabase.from("historyitems").insert({
|
|
||||||
createdBy: useProfileStore().activeProfile.id,
|
|
||||||
tenant: useProfileStore().currentTenant,
|
|
||||||
text: "Datei archiviert",
|
|
||||||
file: props.documentData.id
|
|
||||||
})
|
|
||||||
|
|
||||||
modal.close()
|
modal.close()
|
||||||
emit("update")
|
emit("update")
|
||||||
}
|
}
|
||||||
@@ -139,19 +118,19 @@ const itemOptions = ref([])
|
|||||||
const idToAssign = ref(null)
|
const idToAssign = ref(null)
|
||||||
const getItemsBySelectedResource = async () => {
|
const getItemsBySelectedResource = async () => {
|
||||||
if(resourceToAssign.value === "project") {
|
if(resourceToAssign.value === "project") {
|
||||||
itemOptions.value = await useSupabaseSelect("projects")
|
itemOptions.value = await useEntities("projects").select()
|
||||||
} else if(resourceToAssign.value === "customer") {
|
} else if(resourceToAssign.value === "customer") {
|
||||||
itemOptions.value = await useSupabaseSelect("customers")
|
itemOptions.value = await useEntities("customers").select()
|
||||||
} else if(resourceToAssign.value === "vendor") {
|
} else if(resourceToAssign.value === "vendor") {
|
||||||
itemOptions.value = await useSupabaseSelect("vendors")
|
itemOptions.value = await useEntities("vendors").select()
|
||||||
} else if(resourceToAssign.value === "vehicle") {
|
} else if(resourceToAssign.value === "vehicle") {
|
||||||
itemOptions.value = await useSupabaseSelect("vehicles")
|
itemOptions.value = await useEntities("vehicles").select()
|
||||||
} else if(resourceToAssign.value === "product") {
|
} else if(resourceToAssign.value === "product") {
|
||||||
itemOptions.value = await useSupabaseSelect("products")
|
itemOptions.value = await useEntities("products").select()
|
||||||
} else if(resourceToAssign.value === "plant") {
|
} else if(resourceToAssign.value === "plant") {
|
||||||
itemOptions.value = await useSupabaseSelect("plants")
|
itemOptions.value = await useEntities("plants").select()
|
||||||
} else if(resourceToAssign.value === "contract") {
|
} else if(resourceToAssign.value === "contract") {
|
||||||
itemOptions.value = await useSupabaseSelect("contracts")
|
itemOptions.value = await useEntities("contracts").select()
|
||||||
} else {
|
} else {
|
||||||
itemOptions.value = []
|
itemOptions.value = []
|
||||||
}
|
}
|
||||||
@@ -165,20 +144,9 @@ const updateDocumentAssignment = async () => {
|
|||||||
|
|
||||||
const folderToMoveTo = ref(null)
|
const folderToMoveTo = ref(null)
|
||||||
const moveFile = async () => {
|
const moveFile = async () => {
|
||||||
console.log(folderToMoveTo.value)
|
|
||||||
const {data,error} = await supabase
|
|
||||||
.from("files")
|
|
||||||
.update({folder: folderToMoveTo.value})
|
|
||||||
.eq("id",props.documentData.id)
|
|
||||||
.select()
|
|
||||||
|
|
||||||
if(error) {
|
const res = await useEntities("files").update(props.documentData.id, {folder: folderToMoveTo.value})
|
||||||
console.log(error)
|
|
||||||
toast.add({title: "Fehler beim verschieben", color:"rose"})
|
|
||||||
} else {
|
|
||||||
toast.add({title: "Datei verschoben"})
|
|
||||||
console.log(data)
|
|
||||||
}
|
|
||||||
modal.close()
|
modal.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const uploadInProgress = ref(false)
|
|||||||
const availableFiletypes = ref([])
|
const availableFiletypes = ref([])
|
||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
availableFiletypes.value = await useSupabaseSelect("filetags")
|
availableFiletypes.value = await useEntities("filetags").select()
|
||||||
}
|
}
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
|
|||||||
@@ -18,9 +18,17 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
platform: {
|
platform: {
|
||||||
required: true,
|
required: true,
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
required: true,
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(["sort"]);
|
||||||
|
|
||||||
|
|
||||||
const {type} = props
|
const {type} = props
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
@@ -176,9 +184,11 @@ const filteredRows = computed(() => {
|
|||||||
/>
|
/>
|
||||||
<EntityTable
|
<EntityTable
|
||||||
v-else
|
v-else
|
||||||
|
@sort="(i) => emit('sort',i)"
|
||||||
:type="props.type"
|
:type="props.type"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="filteredRows"
|
:rows="filteredRows"
|
||||||
|
:loading="props.loading"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -158,22 +158,6 @@ const onTabChange = (index) => {
|
|||||||
v-else-if="!props.inModal && platform === 'mobile'"
|
v-else-if="!props.inModal && platform === 'mobile'"
|
||||||
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
>
|
>
|
||||||
<!-- <template #left>
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-chevron-left"
|
|
||||||
variant="outline"
|
|
||||||
@click="router.back()/*router.push(`/standardEntity/${type}`)*/"
|
|
||||||
>
|
|
||||||
Zurück
|
|
||||||
</UButton>
|
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-chevron-left"
|
|
||||||
variant="outline"
|
|
||||||
@click="router.push(`/standardEntity/${type}`)"
|
|
||||||
>
|
|
||||||
Übersicht
|
|
||||||
</UButton>
|
|
||||||
</template>-->
|
|
||||||
<template #toggle>
|
<template #toggle>
|
||||||
<div></div>
|
<div></div>
|
||||||
</template>
|
</template>
|
||||||
@@ -217,7 +201,7 @@ const onTabChange = (index) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--<EntityShowSubFiles
|
<EntityShowSubFiles
|
||||||
:item="props.item"
|
:item="props.item"
|
||||||
:query-string-data="getAvailableQueryStringData()"
|
:query-string-data="getAvailableQueryStringData()"
|
||||||
v-else-if="tab.label === 'Dateien'"
|
v-else-if="tab.label === 'Dateien'"
|
||||||
@@ -226,6 +210,7 @@ const onTabChange = (index) => {
|
|||||||
@updateNeeded="emit('updateNeeded')"
|
@updateNeeded="emit('updateNeeded')"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
|
<!-- TODO Change Active Phase -->
|
||||||
<EntityShowSubPhases
|
<EntityShowSubPhases
|
||||||
:item="props.item"
|
:item="props.item"
|
||||||
:top-level-type="type"
|
:top-level-type="type"
|
||||||
@@ -234,14 +219,14 @@ const onTabChange = (index) => {
|
|||||||
@updateNeeded="emit('updateNeeded')"
|
@updateNeeded="emit('updateNeeded')"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
<EntityShowSubCreatedDocuments
|
<EntityShowSubCreatedDocuments
|
||||||
:item="props.item"
|
:item="props.item"
|
||||||
:top-level-type="type"
|
:top-level-type="type"
|
||||||
v-else-if="tab.label === 'Ausgangsbelege'"
|
v-else-if="tab.label === 'Ausgangsbelege'"
|
||||||
:query-string-data="getAvailableQueryStringData()"
|
:query-string-data="getAvailableQueryStringData()"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
<EntityShowSubCostCentreReport
|
<EntityShowSubCostCentreReport
|
||||||
:top-level-type="type"
|
:top-level-type="type"
|
||||||
:item="props.item"
|
:item="props.item"
|
||||||
v-else-if="tab.label === 'Auswertung Kostenstelle'"
|
v-else-if="tab.label === 'Auswertung Kostenstelle'"
|
||||||
@@ -259,16 +244,15 @@ const onTabChange = (index) => {
|
|||||||
v-else-if="tab.label === 'Zeiten'"
|
v-else-if="tab.label === 'Zeiten'"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
<EntityShowSub
|
<EntityShowSub
|
||||||
:item="props.item"
|
:item="props.item"
|
||||||
:query-string-data="getAvailableQueryStringData()"
|
:query-string-data="getAvailableQueryStringData()"
|
||||||
:tab-label="tab.label"
|
:tab-label="tab.label"
|
||||||
:top-level-type="type"
|
:top-level-type="type"
|
||||||
|
:type="tab.key"
|
||||||
v-else
|
v-else
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>-->
|
/>
|
||||||
</template>
|
</template>
|
||||||
</UTabs>
|
</UTabs>
|
||||||
<UDashboardPanelContent v-else style="overflow-x: hidden;">
|
<UDashboardPanelContent v-else style="overflow-x: hidden;">
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ const props = defineProps({
|
|||||||
|
|
||||||
let type = ref("")
|
let type = ref("")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const tempStore = useTempStore()
|
const tempStore = useTempStore()
|
||||||
|
|
||||||
@@ -42,6 +40,7 @@ const columns = computed(() => dataType.templateColumns.filter((column) => !colu
|
|||||||
const loaded = ref(false)
|
const loaded = ref(false)
|
||||||
|
|
||||||
const setup = () => {
|
const setup = () => {
|
||||||
|
|
||||||
if(!props.type && props.tabLabel ) {
|
if(!props.type && props.tabLabel ) {
|
||||||
if(props.tabLabel === "Aufgaben") {
|
if(props.tabLabel === "Aufgaben") {
|
||||||
type.value = "tasks"
|
type.value = "tasks"
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ const router = useRouter()
|
|||||||
const createddocuments = ref([])
|
const createddocuments = ref([])
|
||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
createddocuments.value = (await useSupabaseSelect("createddocuments")).filter(i => !i.archived)
|
//createddocuments.value = (await useSupabaseSelect("createddocuments")).filter(i => !i.archived)
|
||||||
|
createddocuments.value = (await useEntities("createddocuments").select()).filter(i => !i.archived)
|
||||||
}
|
}
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
@@ -150,6 +151,7 @@ const selectItem = (item) => {
|
|||||||
<span>Ausgangsbelege</span>
|
<span>Ausgangsbelege</span>
|
||||||
</template>
|
</template>
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
|
<!-- TODO Rendering when Screen is too small -->
|
||||||
<UButton
|
<UButton
|
||||||
@click="invoiceDeliveryNotes"
|
@click="invoiceDeliveryNotes"
|
||||||
v-if="props.topLevelType === 'projects'"
|
v-if="props.topLevelType === 'projects'"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const availableFiles = ref([])
|
|||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
if(props.item.files) {
|
if(props.item.files) {
|
||||||
availableFiles.value = await files.selectSomeDocuments(props.item.files.map(i => i.id)) || []
|
availableFiles.value = (await files.selectSomeDocuments(props.item.files.map(i => i.id))) || []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,12 +51,12 @@ setup()
|
|||||||
@uploadFinished="emit('updateNeeded')"
|
@uploadFinished="emit('updateNeeded')"
|
||||||
/>
|
/>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
|
||||||
<DocumentList
|
<DocumentList
|
||||||
:key="props.item.files.length"
|
:key="props.item.files.length"
|
||||||
:documents="availableFiles"
|
:documents="availableFiles"
|
||||||
v-if="availableFiles.length > 0"
|
v-if="availableFiles.length > 0"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<UAlert
|
<UAlert
|
||||||
v-else
|
v-else
|
||||||
icon="i-heroicons-x-mark"
|
icon="i-heroicons-x-mark"
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
rows: {
|
rows: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@@ -40,9 +39,16 @@
|
|||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(["sort"]);
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -50,12 +56,20 @@
|
|||||||
const dataType = dataStore.dataTypes[props.type]
|
const dataType = dataStore.dataTypes[props.type]
|
||||||
|
|
||||||
const selectedItem = ref(0)
|
const selectedItem = ref(0)
|
||||||
|
const sort = ref({
|
||||||
|
column: dataType.supabaseSortColumn || "date",
|
||||||
|
direction: 'desc'
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UTable
|
<UTable
|
||||||
|
:loading="props.loading"
|
||||||
|
:loading-state="{ icon: 'i-heroicons-arrow-path-20-solid', label: 'Loading...' }"
|
||||||
|
sort-mode="manual"
|
||||||
|
v-model:sort="sort"
|
||||||
|
@update:sort="emit('sort',{sort_column: sort.column, sort_direction: sort.direction})"
|
||||||
v-if="dataType && columns"
|
v-if="dataType && columns"
|
||||||
:rows="props.rows"
|
:rows="props.rows"
|
||||||
:columns="props.columns"
|
:columns="props.columns"
|
||||||
@@ -64,11 +78,11 @@
|
|||||||
@select="(i) => router.push(`/standardEntity/${type}/show/${i.id}`) "
|
@select="(i) => router.push(`/standardEntity/${type}/show/${i.id}`) "
|
||||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
|
||||||
>
|
>
|
||||||
<template
|
<!-- <template
|
||||||
v-for="column in dataType.templateColumns.filter(i => !i.disabledInTable)"
|
v-for="column in dataType.templateColumns.filter(i => !i.disabledInTable)"
|
||||||
v-slot:[`${column.key}-header`]="{row}">
|
v-slot:[`${column.key}-header`]="{row}">
|
||||||
<span class="text-nowrap">{{column.label}}</span>
|
<span class="text-nowrap">{{column.label}}</span>
|
||||||
</template>
|
</template>-->
|
||||||
<template #name-data="{row}">
|
<template #name-data="{row}">
|
||||||
<span
|
<span
|
||||||
v-if="row.id === props.rows[selectedItem].id"
|
v-if="row.id === props.rows[selectedItem].id"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const {has} = usePermission()
|
|||||||
|
|
||||||
const links = computed(() => {
|
const links = computed(() => {
|
||||||
return [
|
return [
|
||||||
...auth.profile.pinned_on_navigation.map(pin => {
|
...(auth.profile?.pinned_on_navigation || []).map(pin => {
|
||||||
if(pin.type === "external") {
|
if(pin.type === "external") {
|
||||||
return {
|
return {
|
||||||
label: pin.label,
|
label: pin.label,
|
||||||
@@ -92,7 +92,7 @@ const links = computed(() => {
|
|||||||
label: "E-Mail",
|
label: "E-Mail",
|
||||||
to: "/email/new",
|
to: "/email/new",
|
||||||
icon: "i-heroicons-envelope"
|
icon: "i-heroicons-envelope"
|
||||||
}, {
|
}/*, {
|
||||||
label: "Logbücher",
|
label: "Logbücher",
|
||||||
to: "/communication/historyItems",
|
to: "/communication/historyItems",
|
||||||
icon: "i-heroicons-book-open"
|
icon: "i-heroicons-book-open"
|
||||||
@@ -100,7 +100,7 @@ const links = computed(() => {
|
|||||||
label: "Chats",
|
label: "Chats",
|
||||||
to: "/chats",
|
to: "/chats",
|
||||||
icon: "i-heroicons-chat-bubble-left"
|
icon: "i-heroicons-chat-bubble-left"
|
||||||
}
|
}*/
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
... (has("customers") || has("vendors") || has("contacts")) ? [{
|
... (has("customers") || has("vendors") || has("contacts")) ? [{
|
||||||
@@ -152,7 +152,7 @@ const links = computed(() => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
... true ? [{
|
... [{
|
||||||
label: "Buchhaltung",
|
label: "Buchhaltung",
|
||||||
defaultOpen: false,
|
defaultOpen: false,
|
||||||
icon: "i-heroicons-chart-bar-square",
|
icon: "i-heroicons-chart-bar-square",
|
||||||
@@ -188,7 +188,7 @@ const links = computed(() => {
|
|||||||
icon: "i-heroicons-document-text"
|
icon: "i-heroicons-document-text"
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},] : [],
|
}],
|
||||||
... has("inventory") ? [{
|
... has("inventory") ? [{
|
||||||
label: "Lager",
|
label: "Lager",
|
||||||
icon: "i-heroicons-puzzle-piece",
|
icon: "i-heroicons-puzzle-piece",
|
||||||
@@ -345,11 +345,14 @@ const links = computed(() => {
|
|||||||
<UButton
|
<UButton
|
||||||
:variant="item.pinned ? 'ghost' : 'ghost'"
|
:variant="item.pinned ? 'ghost' : 'ghost'"
|
||||||
:color="(item.to && route.path === item.to) || (item.children?.some(c => route.path.includes(c.to))) ? 'primary' : (item.pinned ? 'amber' : 'gray')"
|
:color="(item.to && route.path === item.to) || (item.children?.some(c => route.path.includes(c.to))) ? 'primary' : (item.pinned ? 'amber' : 'gray')"
|
||||||
:icon="item.icon"
|
:icon="item.pinned ? 'i-heroicons-star' : item.icon"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:to="item.to"
|
:to="item.to"
|
||||||
:target="item.target"
|
:target="item.target"
|
||||||
>
|
>
|
||||||
|
<UIcon
|
||||||
|
v-if="item.pinned"
|
||||||
|
:name="item.icon" class="w-5 h-5 me-2" />
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
|
|
||||||
<template v-if="item.children" #trailing>
|
<template v-if="item.children" #trailing>
|
||||||
@@ -363,7 +366,7 @@ const links = computed(() => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #item="{ item }">
|
<template #item="{ item }">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col" v-if="item.children?.length > 0">
|
||||||
<UButton
|
<UButton
|
||||||
v-for="child in item.children"
|
v-for="child in item.children"
|
||||||
:key="child.label"
|
:key="child.label"
|
||||||
@@ -379,55 +382,5 @@ const links = computed(() => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</UAccordion>
|
</UAccordion>
|
||||||
<!-- <div
|
|
||||||
v-for="item in links"
|
|
||||||
>
|
|
||||||
<UAccordion
|
|
||||||
v-if="item.children"
|
|
||||||
:items="[item]"
|
|
||||||
>
|
|
||||||
<template #default="{item,index,open}">
|
|
||||||
<UButton
|
|
||||||
variant="ghost"
|
|
||||||
:color="item.children.find(i => route.path.includes(i.to)) ? 'primary' : 'gray'"
|
|
||||||
:icon="item.icon"
|
|
||||||
>
|
|
||||||
{{item.label}}
|
|
||||||
|
|
||||||
<template #trailing>
|
|
||||||
<UIcon
|
|
||||||
name="i-heroicons-chevron-right-20-solid"
|
|
||||||
class="w-5 h-5 ms-auto transform transition-transform duration-200"
|
|
||||||
:class="[open && 'rotate-90']"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</UButton>
|
|
||||||
</template>
|
|
||||||
<template #item="{item, open}">
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<UButton
|
|
||||||
variant="ghost"
|
|
||||||
:color="child.to === route.path ? 'primary' : 'gray'"
|
|
||||||
:icon="child.icon"
|
|
||||||
v-for="child in item.children"
|
|
||||||
class="ml-4"
|
|
||||||
:to="child.to"
|
|
||||||
:target="child.target"
|
|
||||||
>
|
|
||||||
{{child.label}}
|
|
||||||
</UButton>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</UAccordion>
|
|
||||||
<UButton
|
|
||||||
v-else
|
|
||||||
variant="ghost"
|
|
||||||
:color="item.to === route.path ? 'primary' : 'gray'"
|
|
||||||
class="w-full"
|
|
||||||
:icon="item.icon"
|
|
||||||
:to="item.to"
|
|
||||||
>
|
|
||||||
{{item.label}}
|
|
||||||
</UButton>
|
|
||||||
</div>-->
|
|
||||||
</template>
|
</template>
|
||||||
@@ -13,7 +13,7 @@ const props = defineProps({
|
|||||||
const incomingInvoices = ref({})
|
const incomingInvoices = ref({})
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
incomingInvoices.value = (await supabase.from("incominginvoices").select().eq("tenant", profileStore.currentTenant)).data.filter(i => i.accounts.find(x => x.costCentre === props.item.id))
|
incomingInvoices.value = (await useEntities("incominginvoices").select()).filter(i => i.accounts.find(x => x.costCentre === props.item.id))
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ let unallocatedStatements = ref(0)
|
|||||||
let bankaccounts = ref([])
|
let bankaccounts = ref([])
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
let bankstatements = (await useSupabaseSelect("bankstatements","*, statementallocations(*)","date",true)).filter(i => !i.archived)
|
let bankstatements = (await useEntities("bankstatements").select("*, statementallocations(*)","date",true)).filter(i => !i.archived)
|
||||||
unallocatedStatements.value = bankstatements.filter(i => Number(calculateOpenSum(i)) !== 0).length
|
unallocatedStatements.value = bankstatements.filter(i => Number(calculateOpenSum(i)) !== 0).length
|
||||||
bankaccounts.value = await useSupabaseSelect("bankaccounts")
|
bankaccounts.value = await useEntities("bankaccounts").select()
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
|
|||||||
@@ -4,21 +4,20 @@ import dayjs from "dayjs";
|
|||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
|
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
const dataStore = useDataStore()
|
|
||||||
const profileStore = useProfileStore()
|
|
||||||
|
|
||||||
let incomeData = ref({})
|
let incomeData = ref({})
|
||||||
let expenseData = ref({})
|
let expenseData = ref({})
|
||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
let incomeRawData = (await supabase.from("createddocuments").select().eq("tenant",profileStore.currentTenant).eq("state","Gebucht").in('type',['invoices','advanceInvoices','cancellationInvoices'])).data
|
//let incomeRawData = (await supabase.from("createddocuments").select().eq("tenant",profileStore.currentTenant).eq("state","Gebucht").in('type',['invoices','advanceInvoices','cancellationInvoices'])).data
|
||||||
|
let incomeRawData = (await useEntities("createddocuments").select()).filter(i => i.state === "Gebucht" && ['invoices','advanceInvoices','cancellationInvoices'].includes(i.type))
|
||||||
console.log(incomeRawData)
|
console.log(incomeRawData)
|
||||||
let incomeRawFilteredData = incomeRawData.filter(x => x.state === 'Gebucht' && incomeRawData.find(i => i.linkedDocument && i.linkedDocument.id === x.id && i.type === 'cancellationInvoices') && ['invoices','advanceInvoices'].includes(row.type))
|
let incomeRawFilteredData = incomeRawData.filter(x => x.state === 'Gebucht' && incomeRawData.find(i => i.linkedDocument && i.linkedDocument.id === x.id && i.type === 'cancellationInvoices') && ['invoices','advanceInvoices'].includes(row.type))
|
||||||
|
|
||||||
|
|
||||||
let expenseRawData =(await supabase.from("incominginvoices").select().eq("tenant",profileStore.currentTenant)).data
|
//let expenseRawData =(await supabase.from("incominginvoices").select().eq("tenant",profileStore.currentTenant)).data
|
||||||
let withoutInvoiceRawData = (await supabase.from("statementallocations").select().eq("tenant",profileStore.currentTenant).not("account","is",null)).data
|
let expenseRawData =(await useEntities("incominginvoices").select())
|
||||||
|
//let withoutInvoiceRawData = (await supabase.from("statementallocations").select().eq("tenant",profileStore.currentTenant).not("account","is",null)).data
|
||||||
|
let withoutInvoiceRawData = (await useEntities("statementallocations").select()).filter(i => i.account)
|
||||||
|
|
||||||
let withoutInvoiceRawDataExpenses = []
|
let withoutInvoiceRawDataExpenses = []
|
||||||
let withoutInvoiceRawDataIncomes = []
|
let withoutInvoiceRawDataIncomes = []
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const profileStore = useProfileStore();
|
const profileStore = useProfileStore();
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
|
|
||||||
let unpaidInvoicesSum = ref(0)
|
let unpaidInvoicesSum = ref(0)
|
||||||
let unpaidInvoicesCount = ref(0)
|
let unpaidInvoicesCount = ref(0)
|
||||||
@@ -15,7 +14,7 @@ let draftInvoicesCount = ref(0)
|
|||||||
let countPreparedOpenIncomingInvoices = ref(0)
|
let countPreparedOpenIncomingInvoices = ref(0)
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
let items = (await useSupabaseSelect("createddocuments","*, statementallocations(*), customer(id,name), linkedDocument(*)")).filter(i => !i.archived)
|
let items = (await useEntities("createddocuments").select("*, statementallocations(*), customer(id,name), linkedDocument(*)")).filter(i => !i.archived)
|
||||||
let documents = items.filter(i => i.type === "invoices" ||i.type === "advanceInvoices")
|
let documents = items.filter(i => i.type === "invoices" ||i.type === "advanceInvoices")
|
||||||
|
|
||||||
let draftDocuments = documents.filter(i => i.state === "Entwurf")
|
let draftDocuments = documents.filter(i => i.state === "Entwurf")
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
const openTasks = ref([])
|
const openTasks = ref([])
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const auth = useAuthStore()
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
openTasks.value = (await supabase.from("tasks").select().eq("tenant",useProfileStore().currentTenant).not("archived","is",true).neq("categorie","Abgeschlossen").eq("profile", useProfileStore().activeProfile.id)).data
|
//TODO: BACKEND CHANGE Migrate to auth_users for profile
|
||||||
|
openTasks.value = (await useEntities("tasks").select().filter(i => !i.archived && i.user_id === auth.user.id))
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
const phasesCounter = ref({})
|
const phasesCounter = ref({})
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
const projects = (await useSupabaseSelect("projects")).filter(i => !i.archived)
|
const projects = (await useEntities("projects").select()).filter(i => !i.archived)
|
||||||
|
|
||||||
projects.forEach(project => {
|
projects.forEach(project => {
|
||||||
if(project.phases && project.phases.length > 0){
|
if(project.phases && project.phases.length > 0){
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const useEntities = (
|
|||||||
const select = async (
|
const select = async (
|
||||||
select: string = "*",
|
select: string = "*",
|
||||||
sortColumn: string | null = null,
|
sortColumn: string | null = null,
|
||||||
ascending: boolean = true,
|
ascending: boolean = false,
|
||||||
noArchivedFiltering: boolean = false
|
noArchivedFiltering: boolean = false
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ export const useEntities = (
|
|||||||
params: {
|
params: {
|
||||||
select,
|
select,
|
||||||
sort: sortColumn || undefined,
|
sort: sortColumn || undefined,
|
||||||
asc: ascending ? "true" : "false"
|
asc: ascending
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ export const useEntities = (
|
|||||||
) => {
|
) => {
|
||||||
if (!idToEq) return null
|
if (!idToEq) return null
|
||||||
|
|
||||||
const res = await useNuxtApp().$api(`/api/resource/${relation}/${idToEq}/${withInformation}`, {
|
const res = await useNuxtApp().$api(withInformation ? `/api/resource/${relation}/${idToEq}/${withInformation}` : `/api/resource/${relation}/${idToEq}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
params: { select }
|
params: { select }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,211 +0,0 @@
|
|||||||
|
|
||||||
export const useFiles = () => {
|
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
const toast = useToast()
|
|
||||||
|
|
||||||
let bucket = "filesdev"
|
|
||||||
|
|
||||||
const profileStore = useProfileStore()
|
|
||||||
|
|
||||||
const uploadFiles = async (formData, files,tags, upsert) => {
|
|
||||||
const uploadSingleFile = async (file) => {
|
|
||||||
//Create File Entry to Get ID for Folder
|
|
||||||
const {data:createdFileData,error:createdFileError} = await supabase
|
|
||||||
.from("files")
|
|
||||||
.insert({
|
|
||||||
tenant: profileStore.currentTenant,
|
|
||||||
})
|
|
||||||
.select()
|
|
||||||
.single()
|
|
||||||
|
|
||||||
if(createdFileError){
|
|
||||||
console.log(createdFileError)
|
|
||||||
toast.add({title: "Hochladen fehlgeschlagen", icon: "i-heroicons-x-circle", color: "rose", timeout: 10000})
|
|
||||||
} else if(createdFileData) {
|
|
||||||
//Upload File to ID Folder
|
|
||||||
const {data:uploadData, error: uploadError} = await supabase
|
|
||||||
.storage
|
|
||||||
.from(bucket)
|
|
||||||
.upload(`${profileStore.currentTenant}/filesbyid/${createdFileData.id}/${file.name}`, file, {upsert: upsert})
|
|
||||||
|
|
||||||
if(uploadError) {
|
|
||||||
console.log(uploadError)
|
|
||||||
console.log(uploadError.statusCode)
|
|
||||||
|
|
||||||
if(uploadError.statusCode === '400') {
|
|
||||||
console.log("is 400")
|
|
||||||
toast.add({title: "Hochladen fehlgeschlagen", description: "Die Datei enthält ungültige Zeichen", icon: "i-heroicons-x-circle", color: "rose", timeout: 10000})
|
|
||||||
} else if(uploadError.statusCode === '409') {
|
|
||||||
console.log("is 409")
|
|
||||||
toast.add({title: "Hochladen fehlgeschlagen", description: "Es existiert bereits eine Datei mit diesem Namen", icon: "i-heroicons-x-circle", color: "rose", timeout: 10000})
|
|
||||||
} else {
|
|
||||||
toast.add({title: "Hochladen fehlgeschlagen", icon: "i-heroicons-x-circle", color: "rose", timeout: 10000})
|
|
||||||
|
|
||||||
}
|
|
||||||
} else if(uploadData) {
|
|
||||||
//Update File with Corresponding Path
|
|
||||||
const {data:updateFileData, error:updateFileError} = await supabase
|
|
||||||
.from("files")
|
|
||||||
.update({
|
|
||||||
...formData,
|
|
||||||
path: uploadData.path,
|
|
||||||
})
|
|
||||||
.eq("id", createdFileData.id)
|
|
||||||
|
|
||||||
if(updateFileError) {
|
|
||||||
console.log(updateFileError)
|
|
||||||
toast.add({title: "Hochladen fehlgeschlagen", icon: "i-heroicons-x-circle", color: "rose", timeout: 10000})
|
|
||||||
} else {
|
|
||||||
const {data:tagData, error:tagError} = await supabase
|
|
||||||
.from("filetagmembers")
|
|
||||||
.insert(tags.map(tag => {
|
|
||||||
return {
|
|
||||||
file_id: createdFileData.id,
|
|
||||||
tag_id: tag
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
toast.add({title: "Hochladen erfolgreich"})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(files.length === 1) {
|
|
||||||
await uploadSingleFile(files[0])
|
|
||||||
} else if( files.length > 1) {
|
|
||||||
|
|
||||||
for(let i = 0; i < files.length; i++){
|
|
||||||
await uploadSingleFile(files[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectDocuments = async (sortColumn = null, folder = null) => {
|
|
||||||
let data = []
|
|
||||||
|
|
||||||
if(sortColumn !== null ) {
|
|
||||||
data = (await supabase
|
|
||||||
.from("files")
|
|
||||||
.select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)')
|
|
||||||
.eq("tenant", profileStore.currentTenant)
|
|
||||||
.not("path","is",null)
|
|
||||||
.not("archived","is",true)
|
|
||||||
.order(sortColumn, {ascending: true})).data
|
|
||||||
} else {
|
|
||||||
data = (await supabase
|
|
||||||
.from("files")
|
|
||||||
.select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)')
|
|
||||||
.eq("tenant", profileStore.currentTenant)
|
|
||||||
.not("path","is",null)
|
|
||||||
.not("archived","is",true)).data
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(data.length > 0){
|
|
||||||
let paths = []
|
|
||||||
data.forEach(doc => {
|
|
||||||
paths.push(doc.path)
|
|
||||||
})
|
|
||||||
|
|
||||||
const {data: supabaseData,error} = await supabase.storage.from(bucket).createSignedUrls(paths,3600)
|
|
||||||
|
|
||||||
data = data.map((doc,index) => {
|
|
||||||
|
|
||||||
return {
|
|
||||||
...doc,
|
|
||||||
url: supabaseData[index].signedUrl
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectSomeDocuments = async (documentIds, sortColumn = null, folder = null) => {
|
|
||||||
let data = null
|
|
||||||
|
|
||||||
if(sortColumn !== null ) {
|
|
||||||
data = (await supabase
|
|
||||||
.from("files")
|
|
||||||
.select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)')
|
|
||||||
.in("id",documentIds)
|
|
||||||
.eq("tenant", profileStore.currentTenant)
|
|
||||||
.not("path","is",null)
|
|
||||||
.not("archived","is",true)
|
|
||||||
.order(sortColumn, {ascending: true})).data
|
|
||||||
} else {
|
|
||||||
data = (await supabase
|
|
||||||
.from("files")
|
|
||||||
.select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*, customer(*), contact(*)), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)')
|
|
||||||
.in("id",documentIds)
|
|
||||||
.not("path","is",null)
|
|
||||||
.not("archived","is",true)
|
|
||||||
.eq("tenant", profileStore.currentTenant)).data
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(data.length > 0){
|
|
||||||
let paths = []
|
|
||||||
data.forEach(doc => {
|
|
||||||
paths.push(doc.path)
|
|
||||||
})
|
|
||||||
|
|
||||||
const {data: supabaseData,error} = await supabase.storage.from(bucket).createSignedUrls(paths,3600)
|
|
||||||
|
|
||||||
data = data.map((doc,index) => {
|
|
||||||
|
|
||||||
return {
|
|
||||||
...doc,
|
|
||||||
url: supabaseData[index].signedUrl
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log(data)
|
|
||||||
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectDocument = async (id) => {
|
|
||||||
const {data,error} = await supabase
|
|
||||||
.from("files")
|
|
||||||
.select('*')
|
|
||||||
.eq("id",id)
|
|
||||||
.single()
|
|
||||||
|
|
||||||
const {data: supabaseData,error:supabaseError} = await supabase.storage.from(bucket).createSignedUrl(data.path,3600)
|
|
||||||
|
|
||||||
return {
|
|
||||||
...data,
|
|
||||||
url: supabaseData.signedUrl
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if(data.length > 0){
|
|
||||||
let paths = []
|
|
||||||
data.forEach(doc => {
|
|
||||||
paths.push(doc.path)
|
|
||||||
})
|
|
||||||
|
|
||||||
const {data: supabaseData,error} = await supabase.storage.from(bucket).createSignedUrls(paths,3600)
|
|
||||||
|
|
||||||
data = data.map((doc,index) => {
|
|
||||||
|
|
||||||
return {
|
|
||||||
...doc,
|
|
||||||
url: supabaseData[index].signedUrl
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log(data)
|
|
||||||
|
|
||||||
return data[0]*/
|
|
||||||
}
|
|
||||||
|
|
||||||
return {uploadFiles, selectDocuments, selectSomeDocuments, selectDocument}
|
|
||||||
}
|
|
||||||
142
composables/useFiles.ts
Normal file
142
composables/useFiles.ts
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
|
||||||
|
export const useFiles = () => {
|
||||||
|
const supabase = useSupabaseClient()
|
||||||
|
const toast = useToast()
|
||||||
|
|
||||||
|
const auth = useAuthStore()
|
||||||
|
|
||||||
|
let bucket = "filesdev"
|
||||||
|
|
||||||
|
const uploadFiles = async (fileData, files,tags, upsert) => {
|
||||||
|
const uploadSingleFile = async (file) => {
|
||||||
|
//Create File Entry to Get ID for Folder
|
||||||
|
|
||||||
|
const formData = new FormData()
|
||||||
|
|
||||||
|
formData.append("file", file)
|
||||||
|
formData.append("meta", JSON.stringify(fileData))
|
||||||
|
|
||||||
|
const {fileReturn} = await useNuxtApp().$api("/api/files/upload",{
|
||||||
|
method: "POST",
|
||||||
|
body: formData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if(files.length === 1) {
|
||||||
|
await uploadSingleFile(files[0])
|
||||||
|
} else if( files.length > 1) {
|
||||||
|
|
||||||
|
for(let i = 0; i < files.length; i++){
|
||||||
|
await uploadSingleFile(files[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectDocuments = async (sortColumn = null, folder = null) => {
|
||||||
|
let data = []
|
||||||
|
data = await useEntities("files").select("*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const res = await useNuxtApp().$api("/api/files/presigned",{
|
||||||
|
method: "POST",
|
||||||
|
body: {
|
||||||
|
ids: data.map(i => i.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
return res.files
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectSomeDocuments = async (documentIds, sortColumn = null, folder = null) => {
|
||||||
|
|
||||||
|
if(documentIds.length === 0) return []
|
||||||
|
const res = await useNuxtApp().$api("/api/files/presigned",{
|
||||||
|
method: "POST",
|
||||||
|
body: {
|
||||||
|
ids: documentIds
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
return res.files
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectDocument = async (id) => {
|
||||||
|
const {data,error} = await supabase
|
||||||
|
.from("files")
|
||||||
|
.select('*')
|
||||||
|
.eq("id",id)
|
||||||
|
.single()
|
||||||
|
|
||||||
|
const {data: supabaseData,error:supabaseError} = await supabase.storage.from(bucket).createSignedUrl(data.path,3600)
|
||||||
|
|
||||||
|
return {
|
||||||
|
...data,
|
||||||
|
url: supabaseData.signedUrl
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if(data.length > 0){
|
||||||
|
let paths = []
|
||||||
|
data.forEach(doc => {
|
||||||
|
paths.push(doc.path)
|
||||||
|
})
|
||||||
|
|
||||||
|
const {data: supabaseData,error} = await supabase.storage.from(bucket).createSignedUrls(paths,3600)
|
||||||
|
|
||||||
|
data = data.map((doc,index) => {
|
||||||
|
|
||||||
|
return {
|
||||||
|
...doc,
|
||||||
|
url: supabaseData[index].signedUrl
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(data)
|
||||||
|
|
||||||
|
return data[0]*/
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadFile = async (id?: string, ids?: string[]) => {
|
||||||
|
const url = id ? `/api/files/download/${id}` : `/api/files/download`
|
||||||
|
const body = ids ? { ids } : undefined
|
||||||
|
|
||||||
|
const res:any = await useNuxtApp().$api.raw(url, {
|
||||||
|
method: "POST",
|
||||||
|
body,
|
||||||
|
responseType: "blob", // wichtig!
|
||||||
|
})
|
||||||
|
|
||||||
|
// Dateiname bestimmen
|
||||||
|
let filename = "download"
|
||||||
|
|
||||||
|
if (id) {
|
||||||
|
// Einzeldatei → nimm den letzten Teil des Pfads aus Content-Disposition
|
||||||
|
const contentDisposition = res.headers?.get("content-disposition")
|
||||||
|
if (contentDisposition) {
|
||||||
|
const match = contentDisposition.match(/filename="?([^"]+)"?/)
|
||||||
|
if (match) filename = match[1]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filename = "dateien.zip"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Direkt speichern
|
||||||
|
const blob = res._data as Blob
|
||||||
|
const link = document.createElement("a")
|
||||||
|
link.href = URL.createObjectURL(blob)
|
||||||
|
link.download = filename
|
||||||
|
link.click()
|
||||||
|
URL.revokeObjectURL(link.href)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return {uploadFiles, selectDocuments, selectSomeDocuments, selectDocument, downloadFile}
|
||||||
|
}
|
||||||
@@ -3,10 +3,6 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
//console.log(searchinput)
|
//console.log(searchinput)
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
//console.log(searchinput)
|
//console.log(searchinput)
|
||||||
|
|||||||
@@ -3,9 +3,7 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {filter} from "vuedraggable/dist/vuedraggable.common.js";
|
import {filter} from "vuedraggable/dist/vuedraggable.common.js";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
|
|||||||
@@ -7,15 +7,12 @@ import resourceTimelinePlugin from "@fullcalendar/resource-timeline";
|
|||||||
import interactionPlugin from "@fullcalendar/interaction";
|
import interactionPlugin from "@fullcalendar/interaction";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
definePageMeta({
|
//TODO BACKEND CHANGE COLOR IN TENANT FOR RENDERING
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
//Config
|
//Config
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const mode = ref(route.params.mode || "grid")
|
const mode = ref(route.params.mode || "grid")
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
|
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
@@ -130,13 +127,13 @@ const calendarOptionsTimeline = ref({
|
|||||||
|
|
||||||
const loaded = ref(false)
|
const loaded = ref(false)
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
let tempData = (await useSupabaseSelect("events", "*")).filter(i => !i.archived)
|
let tempData = (await useEntities("events").select()).filter(i => !i.archived)
|
||||||
let absencerequests = (await useSupabaseSelect("absencerequests", "*, profile(*)")).filter(i => !i.archived)
|
let absencerequests = (await useEntities("absencerequests").select("*, profile(*)")).filter(i => !i.archived)
|
||||||
let projects = (await useSupabaseSelect("projects", "*")).filter(i => !i.archived)
|
let projects = (await useEntities("projects").select( "*")).filter(i => !i.archived)
|
||||||
let inventoryitems = (await useSupabaseSelect("inventoryitems", "*")).filter(i => !i.archived)
|
let inventoryitems = (await useEntities("inventoryitems").select()).filter(i => !i.archived)
|
||||||
let inventoryitemgroups = (await useSupabaseSelect("inventoryitemgroups", "*")).filter(i => !i.archived)
|
let inventoryitemgroups = (await useEntities("inventoryitemgroups").select()).filter(i => !i.archived)
|
||||||
let profiles = (await useSupabaseSelect("profiles", "*")).filter(i => !i.archived)
|
let profiles = (await useEntities("profiles").select()).filter(i => !i.archived)
|
||||||
let vehicles = (await useSupabaseSelect("vehicles", "*")).filter(i => !i.archived)
|
let vehicles = (await useEntities("vehicles").select()).filter(i => !i.archived)
|
||||||
|
|
||||||
calendarOptionsGrid.value.initialEvents = [
|
calendarOptionsGrid.value.initialEvents = [
|
||||||
...tempData.map(event => {
|
...tempData.map(event => {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
import { format, isToday } from 'date-fns'
|
import { format, isToday } from 'date-fns'
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
' ': () => {
|
' ': () => {
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import EntityList from "~/components/EntityList.vue";
|
import EntityList from "~/components/EntityList.vue";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const items = ref([])
|
const items = ref([])
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ const supabase = useSupabaseClient()
|
|||||||
const modal = useModal()
|
const modal = useModal()
|
||||||
|
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const itemInfo = ref({
|
const itemInfo = ref({
|
||||||
@@ -84,23 +82,23 @@ const loaded = ref(false)
|
|||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
|
|
||||||
|
|
||||||
letterheads.value = (await useSupabaseSelect("letterheads","*")).filter(i => i.documentTypes.length === 0 || i.documentTypes.includes(itemInfo.value.type))
|
letterheads.value = (await useEntities("letterheads").select("*")).filter(i => i.documentTypes.length === 0 || i.documentTypes.includes(itemInfo.value.type))
|
||||||
createddocuments.value = (await useSupabaseSelect("createddocuments","*"))
|
createddocuments.value = await useEntities("createddocuments").select("*")
|
||||||
projects.value = (await useSupabaseSelect("projects","*"))
|
projects.value = await useEntities("projects").select("*")
|
||||||
plants.value = (await useSupabaseSelect("plants","*"))
|
plants.value = await useEntities("plants").select("*")
|
||||||
services.value = (await useSupabaseSelect("services","*"))
|
services.value = await useEntities("services").select("*")
|
||||||
servicecategories.value = (await useSupabaseSelect("servicecategories","*"))
|
servicecategories.value = await useEntities("servicecategories").select("*")
|
||||||
products.value = (await useSupabaseSelect("products","*"))
|
products.value = await useEntities("products").select("*")
|
||||||
productcategories.value = (await useSupabaseSelect("productcategories","*"))
|
productcategories.value = await useEntities("productcategories").select("*")
|
||||||
customers.value = (await useSupabaseSelect("customers","*","customerNumber"))
|
customers.value = await useEntities("customers").select("*","customerNumber")
|
||||||
contacts.value = (await useSupabaseSelect("contacts","*"))
|
contacts.value = await useEntities("contacts").select("*")
|
||||||
texttemplates.value = (await useSupabaseSelect("texttemplates","*"))
|
texttemplates.value = await useEntities("texttemplactes").select("*")
|
||||||
if(productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
|
if(productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
|
||||||
if(servicecategories.value.length > 0) selectedServicecategorie.value = servicecategories.value[0].id
|
if(servicecategories.value.length > 0) selectedServicecategorie.value = servicecategories.value[0].id
|
||||||
|
|
||||||
if(route.params) {
|
if(route.params) {
|
||||||
if(route.params.id) {
|
if(route.params.id) {
|
||||||
itemInfo.value = await useSupabaseSelectSingle("createddocuments", route.params.id)
|
itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id)
|
||||||
checkCompatibilityWithInputPrice()
|
checkCompatibilityWithInputPrice()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +211,7 @@ const setupPage = async () => {
|
|||||||
setCustomerData()
|
setCustomerData()
|
||||||
|
|
||||||
for await (const doc of linkedDocuments.filter(i => i.type === "confirmationOrders")) {
|
for await (const doc of linkedDocuments.filter(i => i.type === "confirmationOrders")) {
|
||||||
let linkedDocument = await useSupabaseSelectSingle("createddocuments",doc.id)
|
let linkedDocument = await useEntities("createddocuments").selectSingle(doc.id)
|
||||||
|
|
||||||
itemInfo.value.rows.push({
|
itemInfo.value.rows.push({
|
||||||
mode: "title",
|
mode: "title",
|
||||||
@@ -224,7 +222,7 @@ const setupPage = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for await (const doc of linkedDocuments.filter(i => i.type === "quotes")) {
|
for await (const doc of linkedDocuments.filter(i => i.type === "quotes")) {
|
||||||
let linkedDocument = await useSupabaseSelectSingle("createddocuments",doc.id)
|
let linkedDocument = await useEntities("createddocuments").selectSingle(doc.id)
|
||||||
|
|
||||||
itemInfo.value.rows.push({
|
itemInfo.value.rows.push({
|
||||||
mode: "title",
|
mode: "title",
|
||||||
@@ -277,8 +275,7 @@ const setupPage = async () => {
|
|||||||
|
|
||||||
if(route.query.linkedDocument) {
|
if(route.query.linkedDocument) {
|
||||||
itemInfo.value.linkedDocument = route.query.linkedDocument
|
itemInfo.value.linkedDocument = route.query.linkedDocument
|
||||||
let linkedDocument = await useSupabaseSelectSingle("createddocuments",itemInfo.value.linkedDocument)
|
let linkedDocument = await useEntities("createddocuments").selectSingle(itemInfo.value.linkedDocument)
|
||||||
|
|
||||||
|
|
||||||
if(route.query.optionsToImport) {
|
if(route.query.optionsToImport) {
|
||||||
//Import only true
|
//Import only true
|
||||||
@@ -361,7 +358,7 @@ const setupPage = async () => {
|
|||||||
if(route.query.project) {
|
if(route.query.project) {
|
||||||
itemInfo.value.project = Number(route.query.project)
|
itemInfo.value.project = Number(route.query.project)
|
||||||
|
|
||||||
let project = await useSupabaseSelectSingle("projects",itemInfo.value.project)
|
let project = await useEntities("projects").selectSingle(itemInfo.value.project)
|
||||||
|
|
||||||
if(!itemInfo.value.description){
|
if(!itemInfo.value.description){
|
||||||
itemInfo.value.description = project.customerRef
|
itemInfo.value.description = project.customerRef
|
||||||
@@ -389,21 +386,6 @@ const setupPage = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
const openAdvanceInvoices = ref([])
|
|
||||||
const checkForOpenAdvanceInvoices = async () => {
|
|
||||||
console.log("Check for Open Advance Invoices")
|
|
||||||
const {data} = await supabase.from("createddocuments").select().eq("project", itemInfo.value.project).eq("advanceInvoiceResolved", false).eq("type","advanceInvoices")
|
|
||||||
const {data: usedAdvanceInvoices} = await supabase.from("createddocuments").select().in("id", itemInfo.value.usedAdvanceInvoices)
|
|
||||||
|
|
||||||
console.log(data)
|
|
||||||
|
|
||||||
openAdvanceInvoices.value = [...data, ...usedAdvanceInvoices.filter(i => !data.find(x => x.id === i.id))]
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const addAdvanceInvoiceToInvoice = (advanceInvoice) => {
|
|
||||||
itemInfo.value.usedAdvanceInvoices.push(advanceInvoice)
|
|
||||||
}
|
|
||||||
|
|
||||||
const setDocumentTypeConfig = (withTexts = false) => {
|
const setDocumentTypeConfig = (withTexts = false) => {
|
||||||
if(itemInfo.value.type === "invoices" ||itemInfo.value.type === "advanceInvoices" || itemInfo.value.type === "serialInvoices"|| itemInfo.value.type === "cancellationInvoices") {
|
if(itemInfo.value.type === "invoices" ||itemInfo.value.type === "advanceInvoices" || itemInfo.value.type === "serialInvoices"|| itemInfo.value.type === "cancellationInvoices") {
|
||||||
@@ -467,7 +449,7 @@ const setCustomerData = async (customerId, loadOnlyAdress = false) => {
|
|||||||
itemInfo.value.customer = customerId
|
itemInfo.value.customer = customerId
|
||||||
}
|
}
|
||||||
|
|
||||||
customers.value = await useSupabaseSelect("customers")
|
customers.value = await useEntities("customers").select()
|
||||||
|
|
||||||
|
|
||||||
let customer = customers.value.find(i => i.id === itemInfo.value.customer)
|
let customer = customers.value.find(i => i.id === itemInfo.value.customer)
|
||||||
@@ -496,7 +478,7 @@ const setCustomerData = async (customerId, loadOnlyAdress = false) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setContactPersonData = async () => {
|
const setContactPersonData = async () => {
|
||||||
//console.log(itemInfo.value.contactPerson)
|
//console.log(itemInfo.value.contactPerson) //TODO Set Profile
|
||||||
let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*')
|
let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*')
|
||||||
|
|
||||||
itemInfo.value.contactPersonName = profile.fullName
|
itemInfo.value.contactPersonName = profile.fullName
|
||||||
@@ -1187,32 +1169,9 @@ const uri = ref("")
|
|||||||
const generateDocument = async () => {
|
const generateDocument = async () => {
|
||||||
const path = letterheads.value.find(i => i.id === itemInfo.value.letterhead).path
|
const path = letterheads.value.find(i => i.id === itemInfo.value.letterhead).path
|
||||||
|
|
||||||
/*const {data,error} = await supabase.functions.invoke('create_pdf',{
|
|
||||||
body: {
|
|
||||||
invoiceData: getDocumentData(),
|
|
||||||
backgroundPath: path,
|
|
||||||
returnMode: "base64"
|
|
||||||
}
|
|
||||||
})*/
|
|
||||||
|
|
||||||
uri.value = await useFunctions().useCreatePDF(getDocumentData(), path)
|
uri.value = await useFunctions().useCreatePDF(getDocumentData(), path)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//const {data,error} = await supabase.storage.from("files").download(path)
|
|
||||||
|
|
||||||
//console.log(data)
|
|
||||||
//console.log(error)
|
|
||||||
|
|
||||||
//console.log(JSON.stringify(getDocumentData()))
|
|
||||||
|
|
||||||
//uri.value = `data:${data.mimeType};base64,${data.base64}`
|
|
||||||
|
|
||||||
//uri.value = await useCreatePdf(getDocumentData(), await data.arrayBuffer())
|
|
||||||
//alert(uri.value)
|
|
||||||
showDocument.value = true
|
showDocument.value = true
|
||||||
//console.log(uri.value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onChangeTab = (index) => {
|
const onChangeTab = (index) => {
|
||||||
@@ -1454,12 +1413,12 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
|||||||
console.log("Set Row Data")
|
console.log("Set Row Data")
|
||||||
if(service && service.id) {
|
if(service && service.id) {
|
||||||
row.service = service.id
|
row.service = service.id
|
||||||
services.value = await useSupabaseSelect("services","*")
|
services.value = await useEntities("services").select("*")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(product && product.id) {
|
if(product && product.id) {
|
||||||
row.product = product.id
|
row.product = product.id
|
||||||
product.value = await useSupabaseSelect("products","*")
|
product.value = await useEntities("products").select("*")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(row.service) {
|
if(row.service) {
|
||||||
|
|||||||
@@ -165,10 +165,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
//console.log(searchinput)
|
//console.log(searchinput)
|
||||||
@@ -208,7 +204,8 @@ const items = ref([])
|
|||||||
const selectedItem = ref(0)
|
const selectedItem = ref(0)
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
items.value = (await useSupabaseSelect("createddocuments","*, customer(id,name), statementallocations(id,amount),linkedDocument(*)","documentNumber")).filter(i => !i.archived)
|
//items.value = (await useSupabaseSelect("createddocuments","*, customer(id,name), statementallocations(id,amount),linkedDocument(*)","documentNumber")).filter(i => !i.archived)
|
||||||
|
items.value = (await useEntities("createddocuments").select("*, customer(id,name), statementallocations(id,amount),linkedDocument(*)","documentNumber")).filter(i => !i.archived)
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
|
|||||||
@@ -126,7 +126,8 @@ const items = ref([])
|
|||||||
const selectedItem = ref(0)
|
const selectedItem = ref(0)
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
items.value = await useSupabaseSelect("createddocuments","*, customer(id,name)","documentDate")
|
//items.value = await useSupabaseSelect("createddocuments","*, customer(id,name)","documentDate")
|
||||||
|
items.value = await useEntities("createddocuments").select("*, customer(id,name)","documentDate")
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchString = ref("")
|
const searchString = ref("")
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import CopyCreatedDocumentModal from "~/components/copyCreatedDocumentModal.vue";
|
import CopyCreatedDocumentModal from "~/components/copyCreatedDocumentModal.vue";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
|
|||||||
@@ -2,23 +2,14 @@
|
|||||||
|
|
||||||
|
|
||||||
import {BlobReader, BlobWriter, ZipWriter} from "@zip.js/zip.js";
|
import {BlobReader, BlobWriter, ZipWriter} from "@zip.js/zip.js";
|
||||||
import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
|
||||||
import DocumentDisplayModal from "~/components/DocumentDisplayModal.vue";
|
import DocumentDisplayModal from "~/components/DocumentDisplayModal.vue";
|
||||||
import DocumentUploadModal from "~/components/DocumentUploadModal.vue";
|
import DocumentUploadModal from "~/components/DocumentUploadModal.vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import arraySort from "array-sort";
|
import arraySort from "array-sort";
|
||||||
import {useTempStore} from "~/stores/temp.js";
|
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
/*'/': () => {
|
|
||||||
//console.log(searchinput)
|
|
||||||
//searchinput.value.focus()
|
|
||||||
document.getElementById("searchinput").focus()
|
|
||||||
},*/
|
|
||||||
'+': () => {
|
'+': () => {
|
||||||
//Hochladen
|
//Hochladen
|
||||||
uploadModalOpen.value = true
|
uploadModalOpen.value = true
|
||||||
@@ -30,9 +21,10 @@ defineShortcuts({
|
|||||||
|
|
||||||
if(entry.type === "file") {
|
if(entry.type === "file") {
|
||||||
showFile(entry.id)
|
showFile(entry.id)
|
||||||
console.log(entry)
|
} else if(createFolderModalOpen.value === false && entry.type === "folder") {
|
||||||
} else {
|
|
||||||
changeFolder(currentFolders.value.find(i => i.id === entry.id))
|
changeFolder(currentFolders.value.find(i => i.id === entry.id))
|
||||||
|
} else if(createFolderModalOpen.value === true) {
|
||||||
|
createFolder()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -55,13 +47,11 @@ defineShortcuts({
|
|||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const tempStore = useTempStore()
|
const tempStore = useTempStore()
|
||||||
const profileStore = useProfileStore()
|
|
||||||
const supabase = useSupabaseClient()
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const modal = useModal()
|
const modal = useModal()
|
||||||
|
|
||||||
dataStore.fetchDocuments()
|
const auth = useAuthStore()
|
||||||
|
|
||||||
const uploadModalOpen = ref(false)
|
const uploadModalOpen = ref(false)
|
||||||
const createFolderModalOpen = ref(false)
|
const createFolderModalOpen = ref(false)
|
||||||
@@ -69,7 +59,7 @@ const uploadInProgress = ref(false)
|
|||||||
const fileUploadFormData = ref({
|
const fileUploadFormData = ref({
|
||||||
tags: ["Eingang"],
|
tags: ["Eingang"],
|
||||||
path: "",
|
path: "",
|
||||||
tenant: profileStore.currentTenant,
|
tenant: auth.activeTenant,
|
||||||
folder: null
|
folder: null
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -92,15 +82,16 @@ const isDragTarget = ref(false)
|
|||||||
const loaded = ref(false)
|
const loaded = ref(false)
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
folders.value = await useSupabaseSelect("folders")
|
folders.value = await useEntities("folders").select()
|
||||||
|
|
||||||
documents.value = await files.selectDocuments()
|
documents.value = await files.selectDocuments()
|
||||||
|
|
||||||
filetags.value = await useSupabaseSelect("filetags")
|
filetags.value = await useEntities("filetags").select()
|
||||||
|
|
||||||
if(route.query) {
|
if(route.query) {
|
||||||
if(route.query.folder) {
|
if(route.query.folder) {
|
||||||
currentFolder.value = await useSupabaseSelectSingle("folders", route.query.folder)
|
currentFolder.value = await useEntities("folders").selectSingle(route.query.folder)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +109,6 @@ const setupPage = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dropZone.ondrop = async function (event) {
|
dropZone.ondrop = async function (event) {
|
||||||
console.log("files dropped")
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -213,14 +203,10 @@ const changeFolder = async (newFolder) => {
|
|||||||
|
|
||||||
const createFolderData = ref({})
|
const createFolderData = ref({})
|
||||||
const createFolder = async () => {
|
const createFolder = async () => {
|
||||||
const {data,error} = await supabase
|
const res = await useEntities("folders").create({
|
||||||
.from("folders")
|
parent: currentFolder.value ? currentFolder.value.id : undefined,
|
||||||
.insert({
|
name: createFolderData.value.name,
|
||||||
tenant: profileStore.currentTenant,
|
})
|
||||||
parent: currentFolder.value ? currentFolder.value.id : undefined,
|
|
||||||
name: createFolderData.value.name,
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
createFolderModalOpen.value = false
|
createFolderModalOpen.value = false
|
||||||
|
|
||||||
@@ -229,61 +215,14 @@ const createFolder = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const downloadSelected = async () => {
|
const downloadSelected = async () => {
|
||||||
const bucket = "filesdev";
|
|
||||||
|
|
||||||
let files = []
|
let files = []
|
||||||
|
|
||||||
files = filteredDocuments.value.filter(i => selectedFiles.value[i.id] === true).map(i => i.path)
|
files = filteredDocuments.value.filter(i => selectedFiles.value[i.id] === true).map(i => i.path)
|
||||||
|
|
||||||
// If there are no files in the folder, throw an error
|
|
||||||
if (!files || !files.length) {
|
|
||||||
throw new Error("No files to download");
|
|
||||||
}
|
|
||||||
|
|
||||||
const promises = [];
|
await useFiles().downloadFile(undefined,Object.keys(selectedFiles.value))
|
||||||
|
|
||||||
// Download each file in the folder
|
|
||||||
files.forEach((file) => {
|
|
||||||
promises.push(
|
|
||||||
supabase.storage.from(bucket).download(`${file}`)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Wait for all the files to download
|
|
||||||
const response = await Promise.allSettled(promises);
|
|
||||||
|
|
||||||
// Map the response to an array of objects containing the file name and blob
|
|
||||||
const downloadedFiles = response.map((result, index) => {
|
|
||||||
if (result.status === "fulfilled") {
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: files[index].split("/")[files[index].split("/").length -1],
|
|
||||||
blob: result.value.data,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a new zip file
|
|
||||||
const zipFileWriter = new BlobWriter("application/zip");
|
|
||||||
const zipWriter = new ZipWriter(zipFileWriter, { bufferedWrite: true });
|
|
||||||
|
|
||||||
// Add each file to the zip file
|
|
||||||
downloadedFiles.forEach((downloadedFile) => {
|
|
||||||
if (downloadedFile) {
|
|
||||||
zipWriter.add(downloadedFile.name, new BlobReader(downloadedFile.blob));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Download the zip file
|
|
||||||
const url = URL.createObjectURL(await zipWriter.close());
|
|
||||||
const link = document.createElement("a");
|
|
||||||
|
|
||||||
link.href = url;
|
|
||||||
link.setAttribute("download", "dateien.zip");
|
|
||||||
|
|
||||||
document.body.appendChild(link);
|
|
||||||
|
|
||||||
link.click();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchString = ref(tempStore.searchStrings["files"] ||'')
|
const searchString = ref(tempStore.searchStrings["files"] ||'')
|
||||||
@@ -295,7 +234,6 @@ const renderedFileList = computed(() => {
|
|||||||
type: "file"
|
type: "file"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(currentFolders.value)
|
|
||||||
|
|
||||||
arraySort(files, (a,b) => {
|
arraySort(files, (a,b) => {
|
||||||
let aVal = a.path ? a.path.split("/")[a.path.split("/").length -1] : null
|
let aVal = a.path ? a.path.split("/")[a.path.split("/").length -1] : null
|
||||||
@@ -338,7 +276,6 @@ const renderedFileList = computed(() => {
|
|||||||
const selectedFileIndex = ref(0)
|
const selectedFileIndex = ref(0)
|
||||||
|
|
||||||
const showFile = (fileId) => {
|
const showFile = (fileId) => {
|
||||||
console.log(fileId)
|
|
||||||
modal.open(DocumentDisplayModal,{
|
modal.open(DocumentDisplayModal,{
|
||||||
documentData: documents.value.find(i => i.id === fileId),
|
documentData: documents.value.find(i => i.id === fileId),
|
||||||
onUpdatedNeeded: setupPage()
|
onUpdatedNeeded: setupPage()
|
||||||
@@ -413,7 +350,10 @@ const clearSearchString = () => {
|
|||||||
</USelectMenu>
|
</USelectMenu>
|
||||||
|
|
||||||
|
|
||||||
<UButton @click="modal.open(DocumentUploadModal,{fileData: {folder: currentFolder.id, type: currentFolder.standardFiletype, typeEnabled: currentFolder.standardFiletypeIsOptional}, onUploadFinished: () => {setupPage()}})">+ Datei</UButton>
|
<UButton
|
||||||
|
:disabled="!currentFolder"
|
||||||
|
@click="modal.open(DocumentUploadModal,{fileData: {folder: currentFolder.id, type: currentFolder.standardFiletype, typeEnabled: currentFolder.standardFiletypeIsOptional}, onUploadFinished: () => {setupPage()}})"
|
||||||
|
>+ Datei</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="createFolderModalOpen = true"
|
@click="createFolderModalOpen = true"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import dayjs from "dayjs";
|
|||||||
import HistoryDisplay from "~/components/HistoryDisplay.vue";
|
import HistoryDisplay from "~/components/HistoryDisplay.vue";
|
||||||
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import dayjs from "dayjs";
|
|||||||
import HistoryDisplay from "~/components/HistoryDisplay.vue";
|
import HistoryDisplay from "~/components/HistoryDisplay.vue";
|
||||||
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import {useSum} from "~/composables/useSum.js";
|
import {useSum} from "~/composables/useSum.js";
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
@@ -44,9 +42,14 @@ const sum = useSum()
|
|||||||
|
|
||||||
const items = ref([])
|
const items = ref([])
|
||||||
const selectedItem = ref(0)
|
const selectedItem = ref(0)
|
||||||
|
const sort = ref({
|
||||||
|
column: 'date',
|
||||||
|
direction: 'desc'
|
||||||
|
})
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
items.value = await useSupabaseSelect("incominginvoices","*, vendor(id,name), statementallocations(id,amount)","created_at",false)
|
//items.value = await useSupabaseSelect("incominginvoices","*, vendor(id,name), statementallocations(id,amount)","created_at",false)
|
||||||
|
items.value = await useEntities("incominginvoices").select("*, vendor(id,name), statementallocations(id,amount)",sort.value.column,sort.value.direction === "asc")
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
@@ -54,26 +57,29 @@ setupPage()
|
|||||||
const templateColumns = [
|
const templateColumns = [
|
||||||
{
|
{
|
||||||
key: 'reference',
|
key: 'reference',
|
||||||
label: "Referenz:"
|
label: "Referenz:",
|
||||||
|
sortable: true,
|
||||||
}, {
|
}, {
|
||||||
key: 'state',
|
key: 'state',
|
||||||
label: "Status:"
|
label: "Status:"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "date",
|
key: "date",
|
||||||
label: "Datum"
|
label: "Datum",
|
||||||
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "vendor",
|
key: "vendor",
|
||||||
label: "Lieferant"
|
label: "Lieferant",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "amount",
|
key: "amount",
|
||||||
label: "Betrag"
|
label: "Betrag",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "dueDate",
|
key: "dueDate",
|
||||||
label: "Fälligkeitsdatum"
|
label: "Fälligkeitsdatum",
|
||||||
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "paid",
|
key: "paid",
|
||||||
@@ -81,7 +87,8 @@ const templateColumns = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "paymentType",
|
key: "paymentType",
|
||||||
label: "Zahlart"
|
label: "Zahlart",
|
||||||
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
@@ -92,6 +99,7 @@ const selectedColumns = ref(templateColumns)
|
|||||||
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const searchString = ref(tempStore.searchStrings['incominginvoices'] ||'')
|
const searchString = ref(tempStore.searchStrings['incominginvoices'] ||'')
|
||||||
|
|
||||||
const clearSearchString = () => {
|
const clearSearchString = () => {
|
||||||
@@ -185,6 +193,9 @@ const selectIncomingInvoice = (invoice) => {
|
|||||||
|
|
||||||
<UDashboardPanelContent>
|
<UDashboardPanelContent>
|
||||||
<UTable
|
<UTable
|
||||||
|
v-model:sort="sort"
|
||||||
|
sort-mode="manual"
|
||||||
|
@update:sort="setupPage"
|
||||||
:rows="filteredRows"
|
:rows="filteredRows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- <UDashboardNavbar title="Home">
|
<UDashboardNavbar title="Home">
|
||||||
<template #right>
|
<template #right>
|
||||||
<UTooltip text="Notifications" :shortcuts="['N']">
|
<!-- <UTooltip text="Notifications" :shortcuts="['N']">
|
||||||
<UButton color="gray" variant="ghost" square @click="isNotificationsSlideoverOpen = true">
|
<UButton color="gray" variant="ghost" square @click="isNotificationsSlideoverOpen = true">
|
||||||
<UChip :show="unreadMessages" color="primary" inset>
|
<UChip :show="unreadMessages" color="primary" inset>
|
||||||
<UIcon name="i-heroicons-bell" class="w-5 h-5" />
|
<UIcon name="i-heroicons-bell" class="w-5 h-5" />
|
||||||
</UChip>
|
</UChip>
|
||||||
</UButton>
|
</UButton>
|
||||||
</UTooltip>
|
</UTooltip>-->
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
@@ -23,13 +23,11 @@
|
|||||||
<UPageGrid>
|
<UPageGrid>
|
||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
title="Buchhaltung"
|
title="Buchhaltung"
|
||||||
v-if="profileStore.ownTenant.features.accounting"
|
|
||||||
>
|
>
|
||||||
<display-open-balances/>
|
<display-open-balances/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
title="Bank"
|
title="Bank"
|
||||||
v-if="profileStore.ownTenant.features.accounting"
|
|
||||||
>
|
>
|
||||||
<display-bankaccounts/>
|
<display-bankaccounts/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
@@ -38,7 +36,7 @@
|
|||||||
>
|
>
|
||||||
<display-projects-in-phases/>
|
<display-projects-in-phases/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
<UDashboardCard
|
<!--<UDashboardCard
|
||||||
title="Anwesende"
|
title="Anwesende"
|
||||||
>
|
>
|
||||||
<display-present-profiles/>
|
<display-present-profiles/>
|
||||||
@@ -52,14 +50,14 @@
|
|||||||
title="Anwesenheiten"
|
title="Anwesenheiten"
|
||||||
>
|
>
|
||||||
<display-running-working-time/>
|
<display-running-working-time/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>-->
|
||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
title="Aufgaben"
|
title="Aufgaben"
|
||||||
>
|
>
|
||||||
<display-open-tasks/>
|
<display-open-tasks/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
</UPageGrid>
|
</UPageGrid>
|
||||||
</UDashboardPanelContent>-->
|
</UDashboardPanelContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
|||||||
@@ -63,9 +63,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import DocumentList from "~/components/DocumentList.vue";
|
|||||||
import DocumentUpload from "~/components/DocumentUpload.vue";
|
import DocumentUpload from "~/components/DocumentUpload.vue";
|
||||||
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const items = ref([])
|
const items = ref([])
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
|
|||||||
@@ -48,9 +48,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ const mode = ref("list")
|
|||||||
const items = ref([])
|
const items = ref([])
|
||||||
const item = ref({})
|
const item = ref({})
|
||||||
|
|
||||||
const setupPage = async () => {
|
|
||||||
|
|
||||||
|
const setupPage = async (sort_column = null,sort_direction = null) => {
|
||||||
|
loaded.value = false
|
||||||
|
|
||||||
if(await useCapacitor().getIsPhone()) {
|
if(await useCapacitor().getIsPhone()) {
|
||||||
setPageLayout("mobile")
|
setPageLayout("mobile")
|
||||||
@@ -32,23 +35,18 @@ const setupPage = async () => {
|
|||||||
|
|
||||||
if(mode.value === "show") {
|
if(mode.value === "show") {
|
||||||
//Load Data for Show
|
//Load Data for Show
|
||||||
//item.value = await useSupabaseSelectSingle(type, route.params.id, dataType.supabaseSelectWithInformation || "*")
|
|
||||||
item.value = await useEntities(type).selectSingle(route.params.id,"*",true)
|
item.value = await useEntities(type).selectSingle(route.params.id,"*",true)
|
||||||
} else if(mode.value === "edit") {
|
} else if(mode.value === "edit") {
|
||||||
//Load Data for Edit
|
//Load Data for Edit
|
||||||
//const data = JSON.stringify((await supabase.from(type).select().eq("id", route.params.id).single()).data)
|
|
||||||
//await useSupabaseSelectSingle(type, route.params.id)
|
|
||||||
item.value = JSON.stringify(await useEntities(type).selectSingle(route.params.id))
|
item.value = JSON.stringify(await useEntities(type).selectSingle(route.params.id))
|
||||||
//item.value = data
|
|
||||||
|
|
||||||
} else if(mode.value === "create") {
|
} else if(mode.value === "create") {
|
||||||
//Load Data for Create
|
//Load Data for Create
|
||||||
item.value = JSON.stringify({})
|
item.value = JSON.stringify({})
|
||||||
|
|
||||||
console.log(item.value)
|
console.log(item.value)
|
||||||
} else if(mode.value === "list") {
|
} else if(mode.value === "list") {
|
||||||
//Load Data for List
|
//Load Data for List
|
||||||
items.value = await useEntities(type).select()
|
items.value = await useEntities(type).select(dataType.supabaseSelectWithInformation, sort_column || dataType.supabaseSortColumn , sort_direction === "asc")
|
||||||
}
|
}
|
||||||
|
|
||||||
loaded.value = true
|
loaded.value = true
|
||||||
@@ -68,17 +66,19 @@ setupPage()
|
|||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
<EntityEdit
|
<EntityEdit
|
||||||
v-else-if="loaded && (mode === 'edit' || mode === 'create')"
|
v-else-if="(mode === 'edit' || mode === 'create')"
|
||||||
:type="route.params.type"
|
:type="route.params.type"
|
||||||
:item="item"
|
:item="item"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
<EntityList
|
<EntityList
|
||||||
v-else-if="loaded && mode === 'list'"
|
:loading="!loaded"
|
||||||
|
v-else-if="mode === 'list'"
|
||||||
:type="type"
|
:type="type"
|
||||||
:items="items"
|
:items="items"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
|
@sort="(i) => setupPage(i.sort_column, i.sort_direction)"
|
||||||
/>
|
/>
|
||||||
<UProgress
|
<UProgress
|
||||||
v-else
|
v-else
|
||||||
|
|||||||
15
pages/test.vue
Normal file
15
pages/test.vue
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
async function handleSingle() {
|
||||||
|
await useFiles().downloadFile("f60e8466-7136-4492-ad94-a60603bc3c38") // Einzel-Download
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleMulti() {
|
||||||
|
await useFiles().downloadFile(undefined, ["f60e8466-7136-4492-ad94-a60603bc3c38", "f60e8466-7136-4492-ad94-a60603bc3c38"]) // Multi-Download ZIP
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<button @click="handleSingle">Einzeldatei</button>
|
||||||
|
<button @click="handleMulti">Mehrere als ZIP</button>
|
||||||
|
</template>
|
||||||
@@ -5,9 +5,7 @@ import '@vuepic/vue-datepicker/dist/main.css'
|
|||||||
import {setPageLayout} from "#app";
|
import {setPageLayout} from "#app";
|
||||||
|
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
|
|||||||
@@ -67,9 +67,7 @@
|
|||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'/': () => {
|
'/': () => {
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import FloatingActionButton from "~/components/mobile/FloatingActionButton.vue";
|
|||||||
|
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
middleware: "auth"
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
|||||||
186
stores/data.js
186
stores/data.js
@@ -92,14 +92,16 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "created_at",
|
key: "created_at",
|
||||||
label: "Erstellt am",
|
label: "Erstellt am",
|
||||||
component: created_at,
|
component: created_at,
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name",
|
label: "Name",
|
||||||
title: true,
|
title: true,
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "categorie",
|
key: "categorie",
|
||||||
label: "Kategorie",
|
label: "Kategorie",
|
||||||
@@ -111,7 +113,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{label:"In Bearbeitung"},
|
{label:"In Bearbeitung"},
|
||||||
{label:"Abgeschlossen"}
|
{label:"Abgeschlossen"}
|
||||||
],
|
],
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "profile",
|
key: "profile",
|
||||||
label: "Mitarbeiter",
|
label: "Mitarbeiter",
|
||||||
@@ -191,7 +194,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Kundennummer",
|
label: "Kundennummer",
|
||||||
inputIsNumberRange: true,
|
inputIsNumberRange: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "isCompany",
|
key: "isCompany",
|
||||||
label: "Firmenkunde",
|
label: "Firmenkunde",
|
||||||
@@ -210,7 +214,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
showFunction: function (item) {
|
showFunction: function (item) {
|
||||||
return item.isCompany
|
return item.isCompany
|
||||||
},
|
},
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "nameAddition",
|
key: "nameAddition",
|
||||||
label: "Firmenname Zusatz",
|
label: "Firmenname Zusatz",
|
||||||
@@ -247,7 +252,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
showFunction: function (item) {
|
showFunction: function (item) {
|
||||||
return !item.isCompany
|
return !item.isCompany
|
||||||
},
|
},
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "title",
|
key: "title",
|
||||||
label: "Titel",
|
label: "Titel",
|
||||||
@@ -333,17 +339,20 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Aktiv",
|
label: "Aktiv",
|
||||||
component: active,
|
component: active,
|
||||||
inputType: "bool",
|
inputType: "bool",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "customPaymentDays",
|
key: "customPaymentDays",
|
||||||
label: "Zahlungsziel in Tagen",
|
label: "Zahlungsziel in Tagen",
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "customSurchargePercentage",
|
key: "customSurchargePercentage",
|
||||||
label: "Individueller Aufschlag",
|
label: "Individueller Aufschlag",
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "infoData.street",
|
key: "infoData.street",
|
||||||
label: "Straße + Hausnummer",
|
label: "Straße + Hausnummer",
|
||||||
@@ -368,14 +377,16 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
disabledInTable: true,
|
disabledInTable: true,
|
||||||
inputColumn: "Kontaktdaten"
|
inputColumn: "Kontaktdaten",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "infoData.city",
|
key: "infoData.city",
|
||||||
label: "Stadt",
|
label: "Stadt",
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
disabledInTable: true,
|
disabledInTable: true,
|
||||||
inputColumn: "Kontaktdaten"
|
inputColumn: "Kontaktdaten",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "infoData.country",
|
key: "infoData.country",
|
||||||
@@ -385,7 +396,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
selectOptionAttribute: "name",
|
selectOptionAttribute: "name",
|
||||||
selectValueAttribute: "name",
|
selectValueAttribute: "name",
|
||||||
disabledInTable: true,
|
disabledInTable: true,
|
||||||
inputColumn: "Kontaktdaten"
|
inputColumn: "Kontaktdaten",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "address",
|
key: "address",
|
||||||
@@ -467,13 +479,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "fullName",
|
key: "fullName",
|
||||||
label: "Name",
|
label: "Name",
|
||||||
title: true,
|
title: true,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "salutation",
|
key: "salutation",
|
||||||
label: "Anrede",
|
label: "Anrede",
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputChangeFunction: function (row) {
|
inputChangeFunction: function (row) {
|
||||||
row.fullName = `${row.firstName} ${row.lastName}`
|
row.fullName = `${row.firstName} ${row.lastName}`
|
||||||
}
|
},
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "title",
|
key: "title",
|
||||||
label: "Titel",
|
label: "Titel",
|
||||||
@@ -501,7 +515,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "active",
|
key: "active",
|
||||||
label: "Aktiv",
|
label: "Aktiv",
|
||||||
component: active,
|
component: active,
|
||||||
inputType: "bool"
|
inputType: "bool",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "customer",
|
key: "customer",
|
||||||
@@ -549,6 +564,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "birthday",
|
key: "birthday",
|
||||||
label: "Geburtstag",
|
label: "Geburtstag",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
@@ -591,7 +607,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Vertragsnummer",
|
label: "Vertragsnummer",
|
||||||
inputIsNumberRange: true,
|
inputIsNumberRange: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
@@ -599,19 +616,22 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "active",
|
key: "active",
|
||||||
label: "Aktiv",
|
label: "Aktiv",
|
||||||
component: active,
|
component: active,
|
||||||
inputType: "bool",
|
inputType: "bool",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "recurring",
|
key: "recurring",
|
||||||
label: "Wiederkehrend",
|
label: "Wiederkehrend",
|
||||||
component: recurring,
|
component: recurring,
|
||||||
inputType: "bool",
|
inputType: "bool",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'customer',
|
key: 'customer',
|
||||||
label: "Kunde",
|
label: "Kunde",
|
||||||
@@ -645,7 +665,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{label:'36 Monate'},
|
{label:'36 Monate'},
|
||||||
{label:'48 Monate'},
|
{label:'48 Monate'},
|
||||||
],
|
],
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'invoiceDispatch',
|
key: 'invoiceDispatch',
|
||||||
label: "Rechnungsversand",
|
label: "Rechnungsversand",
|
||||||
@@ -655,7 +676,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{label:'E-Mail'},
|
{label:'E-Mail'},
|
||||||
{label:'Post'}
|
{label:'Post'}
|
||||||
],
|
],
|
||||||
inputColumn: "Abrechnung"
|
inputColumn: "Abrechnung",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'paymentType',
|
key: 'paymentType',
|
||||||
label: "Zahlungsart",
|
label: "Zahlungsart",
|
||||||
@@ -671,19 +693,22 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Vertragsstart",
|
label: "Vertragsstart",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
inputColumn: "Allgemeines",
|
inputColumn: "Allgemeines",
|
||||||
component: startDate
|
component: startDate,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'endDate',
|
key: 'endDate',
|
||||||
label: "Vertragsende",
|
label: "Vertragsende",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
inputColumn: "Allgemeines",
|
inputColumn: "Allgemeines",
|
||||||
component: endDate
|
component: endDate,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'signDate',
|
key: 'signDate',
|
||||||
label: "Unterschrieben am",
|
label: "Unterschrieben am",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
inputColumn: "Allgemeines",
|
inputColumn: "Allgemeines",
|
||||||
component: signDate
|
component: signDate,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'sepaDate',
|
key: 'sepaDate',
|
||||||
label: "SEPA Datum",
|
label: "SEPA Datum",
|
||||||
@@ -798,13 +823,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
required: true,
|
required: true,
|
||||||
label: "Start",
|
label: "Start",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
component: startDate
|
component: startDate,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "endDate",
|
key: "endDate",
|
||||||
required: true,
|
required: true,
|
||||||
label: "Ende",
|
label: "Ende",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
component: endDate
|
component: endDate,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "note",
|
key: "note",
|
||||||
label: "Notizen",
|
label: "Notizen",
|
||||||
@@ -820,6 +847,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
isStandardEntity: true,
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "plant",
|
historyItemHolder: "plant",
|
||||||
|
supabaseSortColumn:"name",
|
||||||
supabaseSelectWithInformation: "*, customer(id,name)",
|
supabaseSelectWithInformation: "*, customer(id,name)",
|
||||||
filters: [{
|
filters: [{
|
||||||
name: "Archivierte ausblenden",
|
name: "Archivierte ausblenden",
|
||||||
@@ -838,7 +866,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
title: true
|
title: true,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "customer",
|
key: "customer",
|
||||||
@@ -1027,7 +1056,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
templateColumns: [
|
templateColumns: [
|
||||||
{
|
{
|
||||||
key: "projectNumber",
|
key: "projectNumber",
|
||||||
label: "Projektnummer"
|
label: "Projektnummer",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "projecttype",
|
key: "projecttype",
|
||||||
@@ -1040,7 +1070,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
selectSearchAttributes: ['name'],
|
selectSearchAttributes: ['name'],
|
||||||
inputChangeFunction: function (item,loadedOptions = {}) {
|
inputChangeFunction: function (item,loadedOptions = {}) {
|
||||||
item.phases = loadedOptions.projecttypes.find(i => i.id === item.projecttype).initialPhases
|
item.phases = loadedOptions.projecttypes.find(i => i.id === item.projecttype).initialPhases
|
||||||
}
|
},
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: "phase",
|
key: "phase",
|
||||||
label: "Phase",
|
label: "Phase",
|
||||||
@@ -1050,7 +1081,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "customer",
|
key: "customer",
|
||||||
@@ -1129,6 +1161,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
isStandardEntity: true,
|
isStandardEntity: true,
|
||||||
redirect:true,
|
redirect:true,
|
||||||
historyItemHolder: "vehicle",
|
historyItemHolder: "vehicle",
|
||||||
|
supabaseSortColumn:"licensePlate",
|
||||||
supabaseSelectWithInformation: "*, checks(*), files(*)",
|
supabaseSelectWithInformation: "*, checks(*), files(*)",
|
||||||
filters:[{
|
filters:[{
|
||||||
name: "Archivierte ausblenden",
|
name: "Archivierte ausblenden",
|
||||||
@@ -1146,13 +1179,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: 'active',
|
key: 'active',
|
||||||
label: "Aktiv",
|
label: "Aktiv",
|
||||||
component: active,
|
component: active,
|
||||||
inputType: "bool"
|
inputType: "bool",
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'licensePlate',
|
key: 'licensePlate',
|
||||||
label: "Kennzeichen",
|
label: "Kennzeichen",
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
title: true
|
title: true,
|
||||||
|
sortable: true
|
||||||
},{
|
},{
|
||||||
key: 'vin',
|
key: 'vin',
|
||||||
label: "Identifikationnummer",
|
label: "Identifikationnummer",
|
||||||
@@ -1186,7 +1221,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "towingCapacity",
|
key: "towingCapacity",
|
||||||
label: "Anhängelast",
|
label: "Anhängelast",
|
||||||
unit: "Kg",
|
unit: "Kg",
|
||||||
inputType: "number"
|
inputType: "number",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "color",
|
key: "color",
|
||||||
@@ -1197,7 +1233,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "powerInKW",
|
key: "powerInKW",
|
||||||
label: "Leistung",
|
label: "Leistung",
|
||||||
unit: "kW",
|
unit: "kW",
|
||||||
inputType: "number"
|
inputType: "number",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
/*{
|
/*{
|
||||||
key: "profiles",
|
key: "profiles",
|
||||||
@@ -1252,14 +1289,16 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: 'vendorNumber',
|
key: 'vendorNumber',
|
||||||
label: "Lieferantennummer",
|
label: "Lieferantennummer",
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputIsNumberRange: true
|
inputIsNumberRange: true,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
required: true,
|
required: true,
|
||||||
label: "Name",
|
label: "Name",
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "infoData.streetNumber",
|
key: "infoData.streetNumber",
|
||||||
@@ -1404,14 +1443,16 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
inputType: "text",
|
inputType: "text",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'spaceNumber',
|
key: 'spaceNumber',
|
||||||
label: "Lagerplatznr.",
|
label: "Lagerplatznr.",
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputIsNumberRange: true,
|
inputIsNumberRange: true,
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "type",
|
key: "type",
|
||||||
@@ -1426,7 +1467,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{label:"Palettenplatz"},
|
{label:"Palettenplatz"},
|
||||||
{label:"Sonstiges"}
|
{label:"Sonstiges"}
|
||||||
],
|
],
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "parentSpace",
|
key: "parentSpace",
|
||||||
@@ -1509,6 +1551,18 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
labelSingle: "Dokument",
|
labelSingle: "Dokument",
|
||||||
supabaseSelectWithInformation: "*, files(*), statementallocations(*)",
|
supabaseSelectWithInformation: "*, files(*), statementallocations(*)",
|
||||||
},
|
},
|
||||||
|
files: {
|
||||||
|
isArchivable: true,
|
||||||
|
label: "Dateien",
|
||||||
|
labelSingle: "Datei",
|
||||||
|
supabaseSelectWithInformation: "*",
|
||||||
|
},
|
||||||
|
folders: {
|
||||||
|
isArchivable: true,
|
||||||
|
label: "Ordner",
|
||||||
|
labelSingle: "Ordner",
|
||||||
|
supabaseSelectWithInformation: "*",
|
||||||
|
},
|
||||||
incominginvoices: {
|
incominginvoices: {
|
||||||
label: "Eingangsrechnungen",
|
label: "Eingangsrechnungen",
|
||||||
labelSingle: "Eingangsrechnung",
|
labelSingle: "Eingangsrechnung",
|
||||||
@@ -1545,19 +1599,22 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
title: true,
|
title: true,
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "usePlanning",
|
key: "usePlanning",
|
||||||
label: "In Plantafel anzeigen",
|
label: "In Plantafel anzeigen",
|
||||||
inputType: "bool",
|
inputType: "bool",
|
||||||
inputColumn: "Allgemeines",
|
inputColumn: "Allgemeines",
|
||||||
component: usePlanning
|
component: usePlanning,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
label: "Beschreibung",
|
label: "Beschreibung",
|
||||||
inputType: "textarea",
|
inputType: "textarea",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "currentSpace",
|
key: "currentSpace",
|
||||||
@@ -1574,7 +1631,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Artikelnummer",
|
label: "Artikelnummer",
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
inputIsNumberRange: true,
|
inputIsNumberRange: true,
|
||||||
inputColumn: "Allgemeines"
|
inputColumn: "Allgemeines",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "serialNumber",
|
key: "serialNumber",
|
||||||
@@ -1586,7 +1644,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: "purchaseDate",
|
key: "purchaseDate",
|
||||||
label: "Kaufdatum",
|
label: "Kaufdatum",
|
||||||
inputType: "date",
|
inputType: "date",
|
||||||
inputColumn: "Anschaffung"
|
inputColumn: "Anschaffung",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "vendor",
|
key: "vendor",
|
||||||
@@ -1606,14 +1665,16 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
disabledFunction: function (item) {
|
disabledFunction: function (item) {
|
||||||
return item.serialNumber
|
return item.serialNumber
|
||||||
},
|
},
|
||||||
helpComponent: quantity
|
helpComponent: quantity,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "purchasePrice",
|
key: "purchasePrice",
|
||||||
label: "Kaufpreis",
|
label: "Kaufpreis",
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
inputStepSize: "0.01",
|
inputStepSize: "0.01",
|
||||||
inputColumn: "Anschaffung"
|
inputColumn: "Anschaffung",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "manufacturer",
|
key: "manufacturer",
|
||||||
@@ -1643,7 +1704,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Aktueller Wert",
|
label: "Aktueller Wert",
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
inputStepSize: "0.01",
|
inputStepSize: "0.01",
|
||||||
inputColumn: "Anschaffung"
|
inputColumn: "Anschaffung",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
@@ -1681,6 +1743,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
title: true,
|
title: true,
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
@@ -1810,7 +1873,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "unit",
|
key: "unit",
|
||||||
@@ -1943,19 +2007,22 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "purchasePrice",
|
key: "purchasePrice",
|
||||||
label: "Einkauspreis",
|
label: "Einkauspreis",
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
component: purchasePrice,
|
component: purchasePrice,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "sellingPrice",
|
key: "sellingPrice",
|
||||||
label: "Verkaufspreis",
|
label: "Verkaufspreis",
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
component: sellingPrice,
|
component: sellingPrice,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
showTabs: [
|
showTabs: [
|
||||||
@@ -1989,21 +2056,24 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "startDate",
|
key: "startDate",
|
||||||
label: "Start",
|
label: "Start",
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "datetime",
|
inputType: "datetime",
|
||||||
component: startDateTime
|
component: startDateTime,
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "endDate",
|
key: "endDate",
|
||||||
label: "Ende",
|
label: "Ende",
|
||||||
required: true,
|
required: true,
|
||||||
inputType: "datetime",
|
inputType: "datetime",
|
||||||
component: endDateTime
|
component: endDateTime,
|
||||||
|
sortable: true
|
||||||
},/*{
|
},/*{
|
||||||
key: "eventtype",
|
key: "eventtype",
|
||||||
label: "Typ",
|
label: "Typ",
|
||||||
@@ -2118,6 +2188,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
labelSingle: "Artikelkategorie",
|
labelSingle: "Artikelkategorie",
|
||||||
isStandardEntity: true,
|
isStandardEntity: true,
|
||||||
redirect: true,
|
redirect: true,
|
||||||
|
supabaseSortColumn: "name",
|
||||||
supabaseSelectWithInformation: "*",
|
supabaseSelectWithInformation: "*",
|
||||||
filters: [{
|
filters: [{
|
||||||
name: "Archivierte ausblenden",
|
name: "Archivierte ausblenden",
|
||||||
@@ -2136,7 +2207,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
@@ -2156,6 +2228,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
labelSingle: "Leistungskategorie",
|
labelSingle: "Leistungskategorie",
|
||||||
isStandardEntity: true,
|
isStandardEntity: true,
|
||||||
redirect: true,
|
redirect: true,
|
||||||
|
supabaseSortColumn: "name",
|
||||||
supabaseSelectWithInformation: "*",
|
supabaseSelectWithInformation: "*",
|
||||||
filters: [{
|
filters: [{
|
||||||
name: "Archivierte ausblenden",
|
name: "Archivierte ausblenden",
|
||||||
@@ -2174,7 +2247,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
@@ -2307,13 +2381,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
key: 'number',
|
key: 'number',
|
||||||
label: "Nummer",
|
label: "Nummer",
|
||||||
inputIsNumberRange: true,
|
inputIsNumberRange: true,
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
@@ -2384,13 +2460,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{
|
{
|
||||||
key: 'number',
|
key: 'number',
|
||||||
label: "Nummer",
|
label: "Nummer",
|
||||||
inputType: "text"
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
}, {
|
}, {
|
||||||
key: "name",
|
key: "name",
|
||||||
label: "Name",
|
label: "Name",
|
||||||
required: true,
|
required: true,
|
||||||
title: true,
|
title: true,
|
||||||
inputType: "text",
|
inputType: "text",
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "description",
|
key: "description",
|
||||||
|
|||||||
Reference in New Issue
Block a user