-
{{profiles.find(profile => profile.id === item.user) ? profiles.find(profile => profile.id === item.user).fullName : ""}}
+
{{dataStore.profiles.find(profile => profile.id === item.user) ? dataStore.profiles.find(profile => profile.id === item.user).fullName : ""}}
Spaces Bot
{{dayjs(item.created_at).format("DD:MM:YY HH:mm")}}
diff --git a/spaces/components/Placeholder.vue b/spaces/components/Placeholder.vue
new file mode 100644
index 0000000..35c3338
--- /dev/null
+++ b/spaces/components/Placeholder.vue
@@ -0,0 +1,21 @@
+
+
+
\ No newline at end of file
diff --git a/spaces/package.json b/spaces/package.json
index 31ff846..bd1e35e 100644
--- a/spaces/package.json
+++ b/spaces/package.json
@@ -27,7 +27,7 @@
"@fullcalendar/resource-timeline": "^6.1.10",
"@fullcalendar/vue3": "^6.1.10",
"@nuxt/content": "^2.9.0",
- "@nuxt/ui-pro": "^0.5.0",
+ "@nuxt/ui-pro": "^0.6.1",
"@nuxtjs/fontaine": "^0.4.1",
"@nuxtjs/google-fonts": "^3.1.0",
"@nuxtjs/strapi": "^1.9.3",
@@ -38,6 +38,7 @@
"@zip.js/zip.js": "^2.7.32",
"axios": "^1.6.2",
"buffer": "^6.0.3",
+ "client-oauth2": "^4.3.3",
"dayjs": "^1.11.10",
"jsprintmanager": "^6.0.3",
"nuxt-editorjs": "^1.0.4",
diff --git a/spaces/pages/contacts/[mode]/[[id]].vue b/spaces/pages/contacts/[mode]/[[id]].vue
index 77c0221..10a2de8 100644
--- a/spaces/pages/contacts/[mode]/[[id]].vue
+++ b/spaces/pages/contacts/[mode]/[[id]].vue
@@ -70,17 +70,17 @@ const cancelEditorCreate = () => {
}
}
-const updateCustomer = async () => {
+const updateItem = async () => {
const {error} = await supabase
.from("contacts")
.update(itemInfo.value)
.eq('id',itemInfo.value.id)
- console.log(error)
- mode.value = "show"
- itemInfo.value = {
- id: 0,
- name: "",
+
+ if(error) {
+ console.log(error)
}
+
+ router.push(`/contacts/show/${currentContact.id}`)
toast.add({title: "Kontakt erfolgreich gespeichert"})
dataStore.fetchContacts()
}
@@ -261,7 +261,7 @@ setupPage()
Speichern
diff --git a/spaces/pages/contracts/[mode]/[[id]].vue b/spaces/pages/contracts/[mode]/[[id]].vue
index a0813bf..56ae7fe 100644
--- a/spaces/pages/contracts/[mode]/[[id]].vue
+++ b/spaces/pages/contracts/[mode]/[[id]].vue
@@ -71,17 +71,16 @@ const cancelEditorCreate = () => {
}
}
-const updateCustomer = async () => {
+const updateItem = async () => {
const {error} = await supabase
.from("contracts")
.update(itemInfo.value)
.eq('id',itemInfo.value.id)
- console.log(error)
- mode.value = "show"
- itemInfo.value = {
- id: 0,
- name: "",
+ if(error) {
+ console.log(error)
}
+
+ router.push(`/contracts/show/${currentContract.id}`)
toast.add({title: "Vertrag erfolgreich gespeichert"})
dataStore.fetchContracts()
}
@@ -192,7 +191,7 @@ setupPage()
Speichern
diff --git a/spaces/pages/customers/[mode]/[[id]].vue b/spaces/pages/customers/[mode]/[[id]].vue
index ba1c1f4..ab9b755 100644
--- a/spaces/pages/customers/[mode]/[[id]].vue
+++ b/spaces/pages/customers/[mode]/[[id]].vue
@@ -81,14 +81,12 @@ const updateCustomer = async () => {
.from("customers")
.update(customerInfo.value)
.eq('id',customerInfo.value.id)
- console.log(error)
- mode.value = "show"
- customerInfo.value = {
- id: 0,
- name: "",
- infoData: {}
+
+ if(error) {
+ console.log(error)
}
toast.add({title: "Kunde erfolgreich gespeichert"})
+ router.push(`/customers/show/${currentCustomer.id}`)
dataStore.fetchCustomers()
}
@@ -121,7 +119,14 @@ setupPage()
/>
Informationen:
- {{currentCustomer.infoData}}
+
+ Straße + Hausnummer: {{currentCustomer.infoData.street}}
+ PLZ + Ort: {{currentCustomer.infoData.zip}} {{currentCustomer.infoData.city}}
+ Telefon: {{currentCustomer.infoData.tel}}
+ E-Mail: {{currentCustomer.infoData.email}}
+ Web: {{currentCustomer.infoData.web}}
+ USt-Id: {{currentCustomer.infoData.ustid}}
+
-import { BlobReader, BlobWriter, ZipWriter } from "@zip.js/zip.js";
-
-const downloadFolder = async (folder) => {
- const supabaseClient = useSupabaseClient();
-
- const bucket = "documents";
-
-// Get a list of all the files in the path /my-bucket/images
- /*const { data: files, error } = await supabaseClient.storage
- .from(bucket)
- .list(folder);
-
- if (error) {
- throw error;
- }*/
-
- let files = [
- "1/Eingang/Rechnung_VRB170A0249604_2023-12-06.pdf"
- ]
-
- console.log(files)
-
-// If there are no files in the folder, throw an error
- if (!files || !files.length) {
- throw new Error("No files to download");
- }
-
- const promises = [];
-
-// Download each file in the folder
- files.forEach((file) => {
- promises.push(
- supabaseClient.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],
- 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", "documents.zip");
-
- document.body.appendChild(link);
-
- link.click();
-}
-
-
-
-
-
-
-
-
- Download
-
-
-
-
-
\ No newline at end of file
diff --git a/spaces/pages/employees/absenceRequests/[mode]/[[id]].vue b/spaces/pages/employees/absenceRequests/[mode]/[[id]].vue
new file mode 100644
index 0000000..3442cb5
--- /dev/null
+++ b/spaces/pages/employees/absenceRequests/[mode]/[[id]].vue
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+ {{currentItem.approved}}
+ {{currentItem.approved}}
+ {{currentItem.approved}}
+
+
+
+ {{currentItem.reason}}
+
+
+ Mitarbeiter: {{dataStore.profiles.find(item => item.id === currentItem.user) ? dataStore.profiles.find(item => item.id === currentItem.user).fullName : ""}}
+ Start: {{dayjs(currentItem.start).format("DD.MM.YYYY")}}
+ Ende: {{dayjs(currentItem.end).format("DD.MM.YYYY")}}
+
+ Notizen:
+ {{currentItem.note}}
+
+
+
+
+
+
+
+ Bearbeiten
+
+
+ Archivieren
+
+
+
+
+
+
+
+
+
+ {{itemInfo.reason}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{dataStore.profiles.find(item => item.id === itemInfo.user) ? dataStore.profiles.find(item => item.id === itemInfo.user).fullName : "Mitarbeiter auswählen"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Speichern
+
+
+ Erstellen
+
+
+ Abbrechen
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spaces/pages/employees/absenceRequests/index.vue b/spaces/pages/employees/absenceRequests/index.vue
new file mode 100644
index 0000000..55bbdfd
--- /dev/null
+++ b/spaces/pages/employees/absenceRequests/index.vue
@@ -0,0 +1,84 @@
+
+
+
+ + Abwesenheit
+
+
+
+
+ Genehmigung offen
+
+
+ Genemigt
+
+
+ Abgelehnt
+
+
+
+ {{dataStore.profiles.find(profile => profile.id === row.user) ? dataStore.profiles.find(profile => profile.id === row.user).fullName : ""}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spaces/pages/timetracking.vue b/spaces/pages/employees/timetracking.vue
similarity index 100%
rename from spaces/pages/timetracking.vue
rename to spaces/pages/employees/timetracking.vue
diff --git a/spaces/pages/inventory/index.vue b/spaces/pages/inventory/index.vue
index 2ea6d80..35ac65c 100644
--- a/spaces/pages/inventory/index.vue
+++ b/spaces/pages/inventory/index.vue
@@ -3,60 +3,71 @@ definePageMeta({
middleware: "auth"
})
-
+const dataStore = useDataStore()
const supabase = useSupabaseClient()
-
-const {spaces, movements, products} = storeToRefs(useDataStore())
-
-
-const searchinput = ref("")
-const mode = ref("")
-
+const router = useRouter()
+const mode = ref("incoming")
const toast = useToast()
-const showReader = ref(false)
const inventoryChangeData = ref({
productId: "",
spaceId: "",
- quantity: 0
+ quantity: 1
})
const createMovement = async () => {
- if(mode.value === 'incoming'){
- //await create('movements', inventoryChangeData.value)
- const {data,error} = await supabase
- .from("movements")
- .insert([inventoryChangeData.value])
- .select()
+ if(mode.value === '' || !checkSpaceId(inventoryChangeData.value.spaceId) || !checkArticle(inventoryChangeData.value.productId)){
- console.log(error)
+ } else {
+ if(mode.value === 'incoming'){
+
+ const {error} = await supabase
+ .from("movements")
+ .insert([inventoryChangeData.value])
+ .select()
+ if(error) console.log(error)
- } else if (mode.value === 'outgoing'){
- inventoryChangeData.value.quantity *= -1
- //await create('movements', inventoryChangeData.value)
+ } else if (mode.value === 'outgoing'){
+ inventoryChangeData.value.quantity *= -1
- const {data,error} = await supabase
- .from("movements")
- .insert([inventoryChangeData.value])
- .select()
+ const {error} = await supabase
+ .from("movements")
+ .insert([inventoryChangeData.value])
+ .select()
+ if(error) console.log(error)
+ } else if (mode.value === 'change'){}
- console.log(error)
- } else if (mode.value === 'change'){}
- inventoryChangeData.value = {
- productId: 0,
- spaceId: 0,
- quantity: 0
+ inventoryChangeData.value = {
+ productId: "",
+ spaceId: "",
+ quantity: 1
+ }
+
+
+ dataStore.fetchMovements()
}
+
+
}
+defineShortcuts({
+ meta_enter: {
+ usingInput: true,
+ handler: () => {
+ createMovement()
+ }
+ }
+})
+
+
function checkArticle(productId) {
- return products.value.filter(product =>product.ean === productId).length > 0;
+ return dataStore.products.filter(product =>product.id === productId).length > 0;
}
function checkSpaceId(spaceId) {
- return spaces.value.filter(space => Number(space.spaceNumber) === Number(spaceId)).length > 0;
+ return dataStore.spaces.filter(space => space.id === spaceId).length > 0;
}
function changeFocusToSpaceId() {
@@ -73,42 +84,66 @@ function changeFocusToQuantity() {
- Wareneingang
- Warenausgang
- Umlagern
+ Wareneingang
+ Warenausgang
+
+
+
+
-
+ v-on:select="changeFocusToSpaceId"
+ >
+
+ {{dataStore.products.find(product => product.id === inventoryChangeData.productId) ? dataStore.products.find(product => product.id === inventoryChangeData.productId).name : "Bitte Artikel auswählen"}}
+
+
-
-
+ >
+
+ {{dataStore.spaces.find(space => space.id === inventoryChangeData.spaceId) ? dataStore.spaces.find(space => space.id === inventoryChangeData.spaceId).description : "Kein Lagerplatz ausgewählt"}}
+
+
{
console.log("Called Setup")
if(mode.value === "show" || mode.value === "edit"){
- currentItem.value = await getSpaceById(Number(useRoute().params.id))
+ currentItem.value = await dataStore.getSpaceById(Number(useRoute().params.id))
- spaceMovements.value = await movementsBySpace(currentItem.value.id)
+ spaceMovements.value = await dataStore.getMovementsBySpace(currentItem.value.id)
spaceProducts.value = []
spaceMovements.value.forEach(movement => {
- if(spaceProducts.value.filter(product => product.id === movement.productId).length === 0) spaceProducts.value.push(getProductById(movement.productId))
+ if(spaceProducts.value.filter(product => product.id === movement.productId).length === 0) spaceProducts.value.push(dataStore.getProductById(movement.productId))
})
}
@@ -63,7 +60,7 @@ const createItem = async () => {
console.log(data[0])
mode.value = "show"
toast.add({title: "Lagerplatz erfolgreich erstellt"})
- await fetchSpaces()
+ await dataStore.fetchSpaces()
router.push(`/inventory/spaces/show/${data[0].id}`)
@@ -93,7 +90,7 @@ const updateItem = async () => {
mode.value = "show"
itemInfo.value = {}
toast.add({title: "Lagerplatz erfolgreich gespeichert"})
- fetchSpaces()
+ dataStore.fetchSpaces()
}
}
@@ -111,7 +108,7 @@ const printSpaceLabel = async () => {
axios
- .post(`http://${ownTenant.value.labelPrinterIp}/pstprnt`, `^XA^FO10,20^BCN,100^FD${currentItem.value.spaceNumber}^XZ` )
+ .post(`http://${dataStore.ownTenant.value.labelPrinterIp}/pstprnt`, `^XA^FO10,20^BCN,100^FD${currentItem.value.spaceNumber}^XZ` )
.then(console.log)
.catch(console.log)
}
@@ -149,7 +146,7 @@ setupPage()
| {{product.name}} |
{{getSpaceProductCount(product.id)}} |
- {{units.find(unit => unit.id === product.unit).name}} |
+ {{dataStore.units.find(unit => unit.id === product.unit).name}} |
diff --git a/spaces/pages/jobs/[mode]/[[id]].vue b/spaces/pages/jobs/[mode]/[[id]].vue
index e9259be..ee03024 100644
--- a/spaces/pages/jobs/[mode]/[[id]].vue
+++ b/spaces/pages/jobs/[mode]/[[id]].vue
@@ -72,12 +72,13 @@ const updateItem = async () => {
.from("jobs")
.update(itemInfo.value)
.eq('id',itemInfo.value.id)
- console.log(error)
- mode.value = "show"
- itemInfo.value = {
- id: 0,
- title: ""
+
+ if(error) {
+ console.log(error)
}
+
+
+ router.push(`/jobs/show/${currentItem.id}`)
toast.add({title: "Job erfolgreich gespeichert"})
dataStore.fetchJobs()
}
diff --git a/spaces/pages/jobs/index.vue b/spaces/pages/jobs/index.vue
index 0a08ee0..ab45c1a 100644
--- a/spaces/pages/jobs/index.vue
+++ b/spaces/pages/jobs/index.vue
@@ -8,7 +8,11 @@
:columns="columns"
@select="selectJob"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
- />
+ >
+
+ {{dataStore.customers.find(customer => customer.id === row.customer) ? dataStore.customers.find(customer => customer.id === row.customer).name : "" }}
+
+
diff --git a/spaces/pages/planningBoard.vue b/spaces/pages/planningBoard.vue
index 181e9e2..40872df 100644
--- a/spaces/pages/planningBoard.vue
+++ b/spaces/pages/planningBoard.vue
@@ -4,6 +4,7 @@ import resourceTimelinePlugin from '@fullcalendar/resource-timeline'
import deLocale from '@fullcalendar/core/locales/de'
import interactionPlugin from '@fullcalendar/interaction'
import listPlugin from '@fullcalendar/list';
+import dayjs from "dayjs";
const viewport = useViewport()
@@ -19,6 +20,7 @@ const eventTypes = dataStore.getEventTypes
const events = dataStore.getEvents
const openNewEventModal = ref(false)
+const showEventModal = ref(false)
const newEventData = ref({
resourceId: "",
resourceType: "",
@@ -27,6 +29,9 @@ const newEventData = ref({
start: "",
end: null
})
+
+const selectedEvent = ref({})
+
const createEvent = async () => {
const {data,error} = await supabase
.from("events")
@@ -76,6 +81,9 @@ const calendarOptionsTimeline = reactive({
openNewEventModal.value = true
},
eventClick: function (info){
+ selectedEvent.value = info.event
+ showEventModal.value = true
+
console.log(info)
},
resourceGroupField: "type",
@@ -153,7 +161,28 @@ const calendarOptionsTimeline = reactive({
+
+
+
+ {{selectedEvent.title}}
+
+ Start: {{dayjs(selectedEvent.startStr).format("DD.MM.YYYY HH:mm")}}
+ Ende: {{dayjs(selectedEvent.endStr).format("DD.MM.YYYY HH:mm")}}
+
+
+
+ {{selectedEvent}}
+
+
+
+
+
+
+
+
+
+
-
+ Einkaufspreis: {{Number(currentProduct.purchasePrice).toFixed(2)}} €
Bestand: {{dataStore.getStockByProductId(currentProduct.id)}} {{dataStore.units.find(unit => unit.id === currentProduct.unit) ? dataStore.units.find(unit => unit.id === currentProduct.unit).name : ""}}
@@ -193,6 +195,26 @@ setupPage()
v-model="itemInfo.ean"
/>
+
+
+
+
+
+
+ EUR
+
+
+
diff --git a/spaces/pages/products/index.vue b/spaces/pages/products/index.vue
index e401fc4..18a0a70 100644
--- a/spaces/pages/products/index.vue
+++ b/spaces/pages/products/index.vue
@@ -18,6 +18,12 @@
@select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
+
+ {{`${dataStore.getStockByProductId(row.id)} ${(dataStore.units.find(unit => unit.id === row.unit) ? dataStore.units.find(unit => unit.id === row.unit).name : "")}`}}
+
+
+ {{row.purchasePrice ? Number(row.purchasePrice).toFixed(2) + " €" : ""}}
+
-->
+
+