From 4a0e0921154956c57b020981df49bcfd8f733ae6 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Wed, 25 Dec 2024 16:21:22 +0100 Subject: [PATCH] Deprecated following as non standardEntity checks, inventoryitems, spaces --- components/EntityEdit.vue | 195 ++++++++++++- components/MainNav.vue | 4 +- components/columnRenderings/profile.vue | 3 +- components/columnRenderings/usePlanning.vue | 13 + components/columnRenderings/vehicle.vue | 13 + components/helpRenderings/quantity.vue | 13 + .../checks/[mode]/[[id]].vue | 0 {pages => deprecated}/checks/index.vue | 0 {pages/deprecated => deprecated}/email.vue | 0 .../entitys/contracts/[mode]/[[id]].vue | 0 .../entitys/contracts/index.vue | 0 .../entitys/customers/[mode]/[[id]].vue | 0 .../entitys/customers/index.vue | 0 .../entitys/plants/[mode]/[[id]].vue | 0 .../entitys/plants/index.vue | 0 .../productcategories/[mode]/[[id]].vue | 0 .../entitys/productcategories/index.vue | 0 .../entitys/products/[mode]/[[id]].vue | 0 .../entitys/products/index.vue | 0 .../entitys/projects/[mode]/[[id]].vue | 0 .../entitys/projects/index.vue | 0 .../servicecategories/[mode]/[[id]].vue | 0 .../entitys/servicecategories/index.vue | 0 .../entitys/services/[mode]/[[id]].vue | 0 .../entitys/services/index.vue | 0 .../entitys/tasks/[mode]/[[id]].vue | 0 .../entitys/tasks/index.vue | 0 .../entitys/vehicles/[mode]/[[id]].vue | 0 .../entitys/vehicles/index.vue | 0 .../entitys/vehicles/show/[id].vue | 0 .../entitys/vendors/[mode]/[[id]].vue | 0 .../entitys/vendors/index.vue | 0 .../inventoryitems/[mode]/[[id]].vue | 0 .../inventoryitems/index.vue | 0 .../spaces/[mode]/[[id]].vue | 0 {pages => deprecated}/spaces/index.vue | 0 .../users/[mode]/[[id]].vue | 0 .../deprecated => deprecated}/users/index.vue | 0 stores/data.js | 270 +++++++++++++++++- 39 files changed, 502 insertions(+), 9 deletions(-) create mode 100644 components/columnRenderings/usePlanning.vue create mode 100644 components/columnRenderings/vehicle.vue create mode 100644 components/helpRenderings/quantity.vue rename {pages => deprecated}/checks/[mode]/[[id]].vue (100%) rename {pages => deprecated}/checks/index.vue (100%) rename {pages/deprecated => deprecated}/email.vue (100%) rename {pages/deprecated => deprecated}/entitys/contracts/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/contracts/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/customers/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/customers/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/plants/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/plants/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/productcategories/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/productcategories/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/products/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/products/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/projects/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/projects/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/servicecategories/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/servicecategories/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/services/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/services/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/tasks/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/tasks/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/vehicles/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/vehicles/index.vue (100%) rename {pages/deprecated => deprecated}/entitys/vehicles/show/[id].vue (100%) rename {pages/deprecated => deprecated}/entitys/vendors/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/entitys/vendors/index.vue (100%) rename {pages => deprecated}/inventoryitems/[mode]/[[id]].vue (100%) rename {pages => deprecated}/inventoryitems/index.vue (100%) rename {pages => deprecated}/spaces/[mode]/[[id]].vue (100%) rename {pages => deprecated}/spaces/index.vue (100%) rename {pages/deprecated => deprecated}/users/[mode]/[[id]].vue (100%) rename {pages/deprecated => deprecated}/users/index.vue (100%) diff --git a/components/EntityEdit.vue b/components/EntityEdit.vue index e69a29c..a528c11 100644 --- a/components/EntityEdit.vue +++ b/components/EntityEdit.vue @@ -76,6 +76,8 @@ const loadOptions = async () => { } }) + console.log(optionsToLoad) + for await(const option of optionsToLoad) { if(option.option === "countrys") { loadedOptions.value[option.option] = (await supabase.from("countrys").select()).data @@ -154,24 +156,196 @@ const contentChanged = (content, datapoint) => { +
+
+ {{columnName}} + + + + + +
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ Eigene Felder + + + + + +
+ +
+
+
+
{ @@ -193,12 +368,18 @@ const contentChanged = (content, datapoint) => { icon="i-heroicons-calendar-days-20-solid" :label="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] ? dayjs(props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]).format('DD.MM.YYYY') : 'Datum auswählen'" variant="outline" + :disabled="datapoint.disabledFunction ? datapoint.disabledFunction(props.item) : false" + /> + { { @@ -241,10 +426,14 @@ const contentChanged = (content, datapoint) => { icon="i-heroicons-calendar-days-20-solid" :label="props.item[datapoint.key] ? dayjs(props.item[datapoint.key]).format('DD.MM.YYYY') : 'Datum auswählen'" variant="outline" + :disabled="datapoint.disabledFunction ? datapoint.disabledFunction(props.item) : false" /> { }] : [], ... role.checkRight("inventoryitems") ? [{ label: "Inventar", - to: "/inventoryitems", + to: "/standardEntity/inventoryitems", icon: "i-heroicons-puzzle-piece" }] : [], ] @@ -205,7 +205,7 @@ const links = computed(() => { }, ... role.checkRight("checks") ? [{ label: "Überprüfungen", - to: "/checks", + to: "/standardEntity/checks", icon: "i-heroicons-magnifying-glass" },] : [], ... role.checkRight("projects") ? [{ diff --git a/components/columnRenderings/profile.vue b/components/columnRenderings/profile.vue index e9d5dba..8ed131b 100644 --- a/components/columnRenderings/profile.vue +++ b/components/columnRenderings/profile.vue @@ -8,8 +8,9 @@ const props = defineProps({ }) const profileStore = useProfileStore() + diff --git a/components/columnRenderings/usePlanning.vue b/components/columnRenderings/usePlanning.vue new file mode 100644 index 0000000..c13ade1 --- /dev/null +++ b/components/columnRenderings/usePlanning.vue @@ -0,0 +1,13 @@ + + + diff --git a/components/columnRenderings/vehicle.vue b/components/columnRenderings/vehicle.vue new file mode 100644 index 0000000..fab74bb --- /dev/null +++ b/components/columnRenderings/vehicle.vue @@ -0,0 +1,13 @@ + + + diff --git a/components/helpRenderings/quantity.vue b/components/helpRenderings/quantity.vue new file mode 100644 index 0000000..09b286b --- /dev/null +++ b/components/helpRenderings/quantity.vue @@ -0,0 +1,13 @@ + + + diff --git a/pages/checks/[mode]/[[id]].vue b/deprecated/checks/[mode]/[[id]].vue similarity index 100% rename from pages/checks/[mode]/[[id]].vue rename to deprecated/checks/[mode]/[[id]].vue diff --git a/pages/checks/index.vue b/deprecated/checks/index.vue similarity index 100% rename from pages/checks/index.vue rename to deprecated/checks/index.vue diff --git a/pages/deprecated/email.vue b/deprecated/email.vue similarity index 100% rename from pages/deprecated/email.vue rename to deprecated/email.vue diff --git a/pages/deprecated/entitys/contracts/[mode]/[[id]].vue b/deprecated/entitys/contracts/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/contracts/[mode]/[[id]].vue rename to deprecated/entitys/contracts/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/contracts/index.vue b/deprecated/entitys/contracts/index.vue similarity index 100% rename from pages/deprecated/entitys/contracts/index.vue rename to deprecated/entitys/contracts/index.vue diff --git a/pages/deprecated/entitys/customers/[mode]/[[id]].vue b/deprecated/entitys/customers/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/customers/[mode]/[[id]].vue rename to deprecated/entitys/customers/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/customers/index.vue b/deprecated/entitys/customers/index.vue similarity index 100% rename from pages/deprecated/entitys/customers/index.vue rename to deprecated/entitys/customers/index.vue diff --git a/pages/deprecated/entitys/plants/[mode]/[[id]].vue b/deprecated/entitys/plants/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/plants/[mode]/[[id]].vue rename to deprecated/entitys/plants/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/plants/index.vue b/deprecated/entitys/plants/index.vue similarity index 100% rename from pages/deprecated/entitys/plants/index.vue rename to deprecated/entitys/plants/index.vue diff --git a/pages/deprecated/entitys/productcategories/[mode]/[[id]].vue b/deprecated/entitys/productcategories/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/productcategories/[mode]/[[id]].vue rename to deprecated/entitys/productcategories/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/productcategories/index.vue b/deprecated/entitys/productcategories/index.vue similarity index 100% rename from pages/deprecated/entitys/productcategories/index.vue rename to deprecated/entitys/productcategories/index.vue diff --git a/pages/deprecated/entitys/products/[mode]/[[id]].vue b/deprecated/entitys/products/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/products/[mode]/[[id]].vue rename to deprecated/entitys/products/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/products/index.vue b/deprecated/entitys/products/index.vue similarity index 100% rename from pages/deprecated/entitys/products/index.vue rename to deprecated/entitys/products/index.vue diff --git a/pages/deprecated/entitys/projects/[mode]/[[id]].vue b/deprecated/entitys/projects/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/projects/[mode]/[[id]].vue rename to deprecated/entitys/projects/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/projects/index.vue b/deprecated/entitys/projects/index.vue similarity index 100% rename from pages/deprecated/entitys/projects/index.vue rename to deprecated/entitys/projects/index.vue diff --git a/pages/deprecated/entitys/servicecategories/[mode]/[[id]].vue b/deprecated/entitys/servicecategories/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/servicecategories/[mode]/[[id]].vue rename to deprecated/entitys/servicecategories/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/servicecategories/index.vue b/deprecated/entitys/servicecategories/index.vue similarity index 100% rename from pages/deprecated/entitys/servicecategories/index.vue rename to deprecated/entitys/servicecategories/index.vue diff --git a/pages/deprecated/entitys/services/[mode]/[[id]].vue b/deprecated/entitys/services/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/services/[mode]/[[id]].vue rename to deprecated/entitys/services/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/services/index.vue b/deprecated/entitys/services/index.vue similarity index 100% rename from pages/deprecated/entitys/services/index.vue rename to deprecated/entitys/services/index.vue diff --git a/pages/deprecated/entitys/tasks/[mode]/[[id]].vue b/deprecated/entitys/tasks/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/tasks/[mode]/[[id]].vue rename to deprecated/entitys/tasks/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/tasks/index.vue b/deprecated/entitys/tasks/index.vue similarity index 100% rename from pages/deprecated/entitys/tasks/index.vue rename to deprecated/entitys/tasks/index.vue diff --git a/pages/deprecated/entitys/vehicles/[mode]/[[id]].vue b/deprecated/entitys/vehicles/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/vehicles/[mode]/[[id]].vue rename to deprecated/entitys/vehicles/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/vehicles/index.vue b/deprecated/entitys/vehicles/index.vue similarity index 100% rename from pages/deprecated/entitys/vehicles/index.vue rename to deprecated/entitys/vehicles/index.vue diff --git a/pages/deprecated/entitys/vehicles/show/[id].vue b/deprecated/entitys/vehicles/show/[id].vue similarity index 100% rename from pages/deprecated/entitys/vehicles/show/[id].vue rename to deprecated/entitys/vehicles/show/[id].vue diff --git a/pages/deprecated/entitys/vendors/[mode]/[[id]].vue b/deprecated/entitys/vendors/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/entitys/vendors/[mode]/[[id]].vue rename to deprecated/entitys/vendors/[mode]/[[id]].vue diff --git a/pages/deprecated/entitys/vendors/index.vue b/deprecated/entitys/vendors/index.vue similarity index 100% rename from pages/deprecated/entitys/vendors/index.vue rename to deprecated/entitys/vendors/index.vue diff --git a/pages/inventoryitems/[mode]/[[id]].vue b/deprecated/inventoryitems/[mode]/[[id]].vue similarity index 100% rename from pages/inventoryitems/[mode]/[[id]].vue rename to deprecated/inventoryitems/[mode]/[[id]].vue diff --git a/pages/inventoryitems/index.vue b/deprecated/inventoryitems/index.vue similarity index 100% rename from pages/inventoryitems/index.vue rename to deprecated/inventoryitems/index.vue diff --git a/pages/spaces/[mode]/[[id]].vue b/deprecated/spaces/[mode]/[[id]].vue similarity index 100% rename from pages/spaces/[mode]/[[id]].vue rename to deprecated/spaces/[mode]/[[id]].vue diff --git a/pages/spaces/index.vue b/deprecated/spaces/index.vue similarity index 100% rename from pages/spaces/index.vue rename to deprecated/spaces/index.vue diff --git a/pages/deprecated/users/[mode]/[[id]].vue b/deprecated/users/[mode]/[[id]].vue similarity index 100% rename from pages/deprecated/users/[mode]/[[id]].vue rename to deprecated/users/[mode]/[[id]].vue diff --git a/pages/deprecated/users/index.vue b/deprecated/users/index.vue similarity index 100% rename from pages/deprecated/users/index.vue rename to deprecated/users/index.vue diff --git a/stores/data.js b/stores/data.js index 119b731..9331a7d 100644 --- a/stores/data.js +++ b/stores/data.js @@ -23,6 +23,10 @@ import project from "~/components/columnRenderings/project.vue"; import created_at from "~/components/columnRenderings/created_at.vue"; import profile from "~/components/columnRenderings/profile.vue"; import profiles from "~/components/columnRenderings/profiles.vue"; +import vehicle from "~/components/columnRenderings/vehicle.vue" +import usePlanning from "~/components/columnRenderings/usePlanning.vue" + +import quantity from "~/components/helpRenderings/quantity.vue" // @ts-ignore export const useDataStore = defineStore('data', () => { @@ -787,9 +791,104 @@ export const useDataStore = defineStore('data', () => { spaces: { label: "Lagerplätze", labelSingle: "Lagerplatz", + isStandardEntity: true, + supabaseSelectWithInformation: "*, documents(*)", + supabaseSortColumn: "spaceNumber", redirect: true, numberRangeHolder: "spaceNumber", - historyItemHolder: "space" + historyItemHolder: "space", + filters:[], + inputColumns: [ + "Allgemeines", + "Ort" + ], + templateColumns: [ + { + key: "name", + label: "Name", + inputType: "text", + title: true, + inputColumn: "Allgemeines" + }, + { + key: 'spaceNumber', + label: "Lagerplatznr.", + inputType: "text", + inputIsNumberRange: true, + inputColumn: "Allgemeines" + }, + { + key: "type", + label: "Typ", + inputType: "select", + selectManualOptions: ["Standort","Regalplatz", "Kiste", "Palettenplatz", "Sonstiges"], + inputColumn: "Allgemeines" + }, + { + key: "parentSpace", + label: "Übergeordneter Lagerplatz", + inputType: "select", + selectDataType: "spaces", + selectOptionAttribute: "spaceNumber", + selectValueAttribute: "id", + inputColumn: "Allgemeines" + }, + { + key: "infoData.streetNumber", + label: "Straße + Hausnummer", + inputType: "text", + disabledInTable: true, + inputColumn: "Ort" + }, + { + key: "infoData.special", + label: "Adresszusatz", + inputType: "text", + disabledInTable: true, + inputColumn: "Ort" + }, + { + key: "infoData.zip", + label: "Postleitzahl", + inputType: "number", + disabledInTable: true, + inputColumn: "Ort" + }, + { + key: "infoData.city", + label: "Stadt", + inputType: "text", + disabledInTable: true, + inputColumn: "Ort" + }, + { + key: "infoData.country", + label: "Land", + inputType: "select", + selectDataType: "countrys", + selectOptionAttribute: "name", + selectValueAttribute: "name", + disabledInTable: true, + inputColumn: "Ort" + }, + { + key: "address", + label: "Adresse", + component: address + }, + { + key: "description", + label: "Beschreibung", + inputType: "textarea", + } + ], + showTabs: [ + { + label: 'Informationen', + }, { + label: 'Dokumente', + },{label: 'Inventarartikel'} + ] }, users: { label: "Benutzer", @@ -807,8 +906,127 @@ export const useDataStore = defineStore('data', () => { inventoryitems: { label: "Inventarartikel", labelSingle: "Inventarartikel", + isStandardEntity: true, + supabaseSelectWithInformation: "*, documents(*), vendor(id,name), currentSpace(id,name)", redirect: true, - numberRangeHolder: "articleNumber" + numberRangeHolder: "articleNumber", + inputColumns: [ + "Allgemeines", + "Anschaffung" + ], + filters:[], + templateColumns: [ + { + key: "name", + label: "Name", + title: true, + inputType: "text", + inputColumn: "Allgemeines" + }, + { + key: "usePlanning", + label: "In Plantafel anzeigen", + inputType: "bool", + inputColumn: "Allgemeines", + component: usePlanning + }, + { + key: "description", + label: "Beschreibung", + inputType: "textarea", + }, + { + key: "currentSpace", + label: "Aktueller Lagerplatz", + inputType: "select", + selectDataType: "spaces", + selectOptionAttribute: "name", + selectSearchAttributes: ['name'], + inputColumn: "Allgemeines" + }, + { + key: "articleNumber", + label: "Artikelnummer", + inputType: "text", + inputIsNumberRange: true, + inputColumn: "Allgemeines" + }, + { + key: "serialNumber", + label: "Seriennummer", + inputType: "text", + inputColumn: "Allgemeines" + }, + { + key: "purchaseDate", + label: "Kaufdatum", + inputType: "date", + inputColumn: "Anschaffung" + }, + { + key: "vendor", + label: "Lieferant", + inputType: "select", + selectDataType: "vendors", + selectOptionAttribute: "name", + selectSearchAttributes: ['name'], + inputColumn: "Anschaffung" + }, + { + key: "quantity", + label: "Menge", + inputType: "number", + inputColumn: "Allgemeines", + disabledFunction: function (item) { + return item.serialNumber + }, + helpComponent: quantity + }, + { + key: "purchasePrice", + label: "Kaufpreis", + inputType: "number", + inputStepSize: "0.01", + inputColumn: "Anschaffung" + }, + { + key: "maunfacturer", + label: "Hersteller", + inputType: "text", + inputColumn: "Anschaffung" + }, + { + key: "manufacturerNumber", + label: "Herstellernummer", + inputType: "text", + inputColumn: "Anschaffung" + }, + { + key: "profiles", + label: "Berechtigte Benutzer", + inputType: "select", + selectDataType: "profiles", + selectOptionAttribute: "fullName", + selectSearchAttributes: ['fullName'], + selectMultiple: true, + component: profiles + }, + { + key: "currentValue", + label: "Aktueller Wert", + inputType: "number", + inputStepSize: "0.01", + inputColumn: "Anschaffung" + }, + + ], + showTabs: [ + { + label: 'Informationen', + }, { + label: 'Dokumente', + } + ] }, services: { label: "Leistungen", @@ -958,8 +1176,54 @@ export const useDataStore = defineStore('data', () => { checks: { label: "Überprüfungen", labelSingle: "Überprüfung", + isStandardEntity: true, + supabaseSelectWithInformation: "*, vehicle(id,licensePlate), profile(id, fullName), inventoryitem(name), documents(*)", redirect: true, - historyItemHolder: "check" + historyItemHolder: "check", + filters: [], + templateColumns: [ + { + key: "name", + label: "Name", + title: true, + inputType: "text" + }, + { + key: "vehicle", + label: "Fahrzeug", + component: vehicle, + inputType: "select", + selectDataType: "vehicles", + selectOptionAttribute: "licensePlate", + selectSearchAttributes: ['licensePlate'], + }, + { + key: "profile", + label: "Person", + component: profile, + inputType: "select", + selectDataType: "profiles", + selectOptionAttribute: "fullName", + selectSearchAttributes: ['fullName'], + }, + { + key: "inventoryitem", + label: "Inventarartikel", + inputType: "select", + selectDataType: "inventoryitems", + selectOptionAttribute: "name", + selectSearchAttributes: ['name'], + }, + { + key: "notes", + label: "Notizen", + inputType: "textarea" + } + ], + showTabs: [ + { + label: 'Informationen', + }, {label: 'Dokumente'}, {label: 'Ausführungen'}] }, roles: { label: "Rollen",