diff --git a/components/EntityEdit.vue b/components/EntityEdit.vue
index b8a173d..e69a29c 100644
--- a/components/EntityEdit.vue
+++ b/components/EntityEdit.vue
@@ -79,6 +79,8 @@ const loadOptions = async () => {
for await(const option of optionsToLoad) {
if(option.option === "countrys") {
loadedOptions.value[option.option] = (await supabase.from("countrys").select()).data
+ } else if(option.option === "units") {
+ loadedOptions.value[option.option] = (await supabase.from("units").select()).data
} else {
loadedOptions.value[option.option] = (await useSupabaseSelect(option.option))
@@ -87,6 +89,8 @@ const loadOptions = async () => {
}
}
}
+
+ console.log(loadedOptions.value)
}
loadOptions()
@@ -174,7 +178,11 @@ const contentChanged = (content, datapoint) => {
:searchable="datapoint.selectSearchAttributes"
:search-attributes="datapoint.selectSearchAttributes"
:multiple="datapoint.selectMultiple"
- />
+ >
+
+ Keine Optionen verfügbar
+
+
{
:search-attributes="datapoint.selectSearchAttributes"
:multiple="datapoint.selectMultiple"
searchable-placeholder="Suche..."
- />
+ >
+
+ Keine Optionen verfügbar
+
+
i.name))
const selectedFilters = ref(dataType.filters.filter(i => i.default).map(i => i.name) || [])
-console.log(selectableFilters)
-console.log(selectedFilters)
const filteredRows = computed(() => {
@@ -132,6 +130,7 @@ const filteredRows = computed(() => {
class="hidden lg:block"
by="key"
:color="selectedColumns.length !== dataType.templateColumns.filter(i => !i.disabledInTable).length ? 'primary' : 'white'"
+ :ui-menu="{ width: 'min-w-max' }"
>
Spalten
@@ -144,6 +143,7 @@ const filteredRows = computed(() => {
v-model="selectedFilters"
:options="selectableFilters"
:color="selectedFilters.length > 0 ? 'primary' : 'white'"
+ :ui-menu="{ width: 'min-w-max' }"
>
Filter
@@ -159,6 +159,11 @@ const filteredRows = computed(() => {
@select="(i) => router.push(`/standardEntity/${type}/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
>
+
+ {{column.label}}
+
{
icon: "i-heroicons-rectangle-stack",
defaultOpen: false,
children: [
- {
+ ... role.checkRight("tasks") ? [{
label: "Aufgaben",
- to: "/tasks",
+ to: "/standardEntity/tasks",
icon: "i-heroicons-rectangle-stack"
- },
+ }] : [],
... profileStore.ownTenant.features.planningBoard ? [{
label: "Plantafel",
to: "/calendar/timeline",
@@ -183,22 +183,22 @@ const links = computed(() => {
children: [
... role.checkRight("products") ? [{
label: "Artikel",
- to: "/products",
+ to: "/standardEntity/products",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("productcategories") ? [{
label: "Artikelkategorien",
- to: "/productcategories",
+ to: "/standardEntity/productcategories",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("services") ? [{
label: "Leistungen",
- to: "/services",
+ to: "/standardEntity/services",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("servicecategories") ? [{
label: "Leistungskategorien",
- to: "/servicecategories",
+ to: "/standardEntity/servicecategories",
icon: "i-heroicons-puzzle-piece"
}] : [],
]
diff --git a/components/columnRenderings/created_at.vue b/components/columnRenderings/created_at.vue
new file mode 100644
index 0000000..8edd716
--- /dev/null
+++ b/components/columnRenderings/created_at.vue
@@ -0,0 +1,15 @@
+
+
+
+ {{dayjs(props.row.created_at).format("DD.MM.YYYY HH:mm")}}
+
diff --git a/components/columnRenderings/profile.vue b/components/columnRenderings/profile.vue
new file mode 100644
index 0000000..e9d5dba
--- /dev/null
+++ b/components/columnRenderings/profile.vue
@@ -0,0 +1,15 @@
+
+
+
+ {{props.row.profile ? profileStore.getProfileById(props.row.profile).fullName : ''}}
+
diff --git a/components/columnRenderings/profiles.vue b/components/columnRenderings/profiles.vue
new file mode 100644
index 0000000..617c3a0
--- /dev/null
+++ b/components/columnRenderings/profiles.vue
@@ -0,0 +1,18 @@
+
+
+
+ {{props.row.profiles ? profiles : ''}}
+
diff --git a/components/columnRenderings/project.vue b/components/columnRenderings/project.vue
new file mode 100644
index 0000000..d3cdb50
--- /dev/null
+++ b/components/columnRenderings/project.vue
@@ -0,0 +1,13 @@
+
+
+
+ {{props.row.project ? props.row.project.name : ''}}
+
diff --git a/components/columnRenderings/purchasePrice.vue b/components/columnRenderings/purchasePrice.vue
new file mode 100644
index 0000000..dfb1916
--- /dev/null
+++ b/components/columnRenderings/purchasePrice.vue
@@ -0,0 +1,13 @@
+
+
+
+ {{props.row.purchasePrice ? useCurrency(props.row.purchasePrice) : ''}}
+
diff --git a/composables/useRole.js b/composables/useRole.js
index 9646682..c142882 100644
--- a/composables/useRole.js
+++ b/composables/useRole.js
@@ -172,6 +172,18 @@ export const useRole = () => {
label: "Rollen erstellen",
parent: "roles"
},
+ tasks: {
+ label: "Aufgaben",
+ showToAllUsers: false
+ },
+ "tasks-viewAll": {
+ label: "Alle Aufgaben einsehen",
+ parent: "tasks"
+ },
+ "tasks-create": {
+ label: "Aufgaben erstellen",
+ parent: "tasks"
+ },
"inventory": {
label: "Lager",
},
diff --git a/pages/productcategories/[mode]/[[id]].vue b/pages/deprecated/entitys/productcategories/[mode]/[[id]].vue
similarity index 100%
rename from pages/productcategories/[mode]/[[id]].vue
rename to pages/deprecated/entitys/productcategories/[mode]/[[id]].vue
diff --git a/pages/productcategories/index.vue b/pages/deprecated/entitys/productcategories/index.vue
similarity index 100%
rename from pages/productcategories/index.vue
rename to pages/deprecated/entitys/productcategories/index.vue
diff --git a/pages/products/[mode]/[[id]].vue b/pages/deprecated/entitys/products/[mode]/[[id]].vue
similarity index 100%
rename from pages/products/[mode]/[[id]].vue
rename to pages/deprecated/entitys/products/[mode]/[[id]].vue
diff --git a/pages/products/index.vue b/pages/deprecated/entitys/products/index.vue
similarity index 100%
rename from pages/products/index.vue
rename to pages/deprecated/entitys/products/index.vue
diff --git a/pages/servicecategories/[mode]/[[id]].vue b/pages/deprecated/entitys/servicecategories/[mode]/[[id]].vue
similarity index 100%
rename from pages/servicecategories/[mode]/[[id]].vue
rename to pages/deprecated/entitys/servicecategories/[mode]/[[id]].vue
diff --git a/pages/servicecategories/index.vue b/pages/deprecated/entitys/servicecategories/index.vue
similarity index 100%
rename from pages/servicecategories/index.vue
rename to pages/deprecated/entitys/servicecategories/index.vue
diff --git a/pages/services/[mode]/[[id]].vue b/pages/deprecated/entitys/services/[mode]/[[id]].vue
similarity index 100%
rename from pages/services/[mode]/[[id]].vue
rename to pages/deprecated/entitys/services/[mode]/[[id]].vue
diff --git a/pages/services/index.vue b/pages/deprecated/entitys/services/index.vue
similarity index 100%
rename from pages/services/index.vue
rename to pages/deprecated/entitys/services/index.vue
diff --git a/pages/tasks/[mode]/[[id]].vue b/pages/deprecated/entitys/tasks/[mode]/[[id]].vue
similarity index 100%
rename from pages/tasks/[mode]/[[id]].vue
rename to pages/deprecated/entitys/tasks/[mode]/[[id]].vue
diff --git a/pages/tasks/index.vue b/pages/deprecated/entitys/tasks/index.vue
similarity index 87%
rename from pages/tasks/index.vue
rename to pages/deprecated/entitys/tasks/index.vue
index b353a4c..072bea1 100644
--- a/pages/tasks/index.vue
+++ b/pages/deprecated/entitys/tasks/index.vue
@@ -104,35 +104,7 @@ const templateColumns = [
/*{
key:"finish"
- },*/{
- key: "created_at",
- label: "Erstellt am:",
- sortable: true
- },{
- key: "name",
- label: "Name:",
- sortable: true
- },{
- key: "categorie",
- label: "Kategorie:",
- sortable: true
- },{
- key: "description",
- label: "Beschreibung:",
- sortable: true
- },{
- key: "user",
- label: "Benutzer:",
- sortable: true
- },{
- key: "project",
- label: "Projekt:",
- sortable: true
- },{
- key: "plant",
- label: "Objekt:",
- sortable: true
- }
+ },*/
]
const selectedColumns = ref(templateColumns)
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
diff --git a/stores/data.js b/stores/data.js
index e0b6005..119b731 100644
--- a/stores/data.js
+++ b/stores/data.js
@@ -18,6 +18,11 @@ import address from "~/components/columnRenderings/address.vue"
import sepa from "~/components/columnRenderings/sepa.vue"
import recurring from "~/components/columnRenderings/recurring.vue"
import description from "~/components/columnRenderings/description.vue"
+import purchasePrice from "~/components/columnRenderings/purchasePrice.vue";
+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";
// @ts-ignore
export const useDataStore = defineStore('data', () => {
@@ -32,8 +37,74 @@ export const useDataStore = defineStore('data', () => {
tasks: {
label: "Aufgaben",
labelSingle: "Aufgabe",
+ isStandardEntity: true,
redirect: true,
- historyItemHolder: "task"
+ historyItemHolder: "task",
+ supabaseSelectWithInformation: "*, plant(*), project(*), customer(*)",
+ filters: [
+ {
+ name: "Nur Offene Aufgaben",
+ default: true,
+ "filterFunction": function (row) {
+ if(row.categorie !== "Erledigt") {
+ return true
+ } else {
+ return false
+ }
+ }
+ }
+ ],
+ templateColumns: [
+ {
+ key: "created_at",
+ label: "Erstellt am",
+ component: created_at,
+ },{
+ key: "name",
+ label: "Name",
+ title: true,
+ inputType: "text"
+ },{
+ key: "categorie",
+ label: "Kategorie"
+ },{
+ key: "profile",
+ label: "Benutzer",
+ component: profile,
+ inputType: "select",
+ selectDataType: "profiles",
+ selectOptionAttribute: "fullName",
+ selectSearchAttributes: ['fullName'],
+ },{
+ key: "project",
+ label: "Projekt",
+ component: project,
+ inputType: "select",
+ selectDataType: "projects",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ },{
+ key: "customer",
+ label: "Kunde",
+ component: customer,
+ inputType: "select",
+ selectDataType: "customers",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ },{
+ key: "plant",
+ label: "Objekt",
+ component: plant,
+ inputType: "select",
+ selectDataType: "plants",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ },{
+ key: "description",
+ label: "Beschreibung"
+ },
+ ],
+ showTabs: [{label: 'Informationen'}]
},
customers: {
label: "Kunden",
@@ -140,7 +211,8 @@ export const useDataStore = defineStore('data', () => {
selectDataType: "profiles",
selectOptionAttribute: "fullName",
selectSearchAttributes: ['fullName'],
- selectMultiple: true
+ selectMultiple: true,
+ component: profiles
},
],
showTabs: [{label: 'Informationen'},{label: 'Dokumente'},{label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}]
@@ -343,38 +415,64 @@ export const useDataStore = defineStore('data', () => {
products: {
label: "Artikel",
labelSingle: "Artikel",
+ isStandardEntity: true,
redirect:true,
+ supabaseSelectWithInformation: "*, unit(name)",
filters: [],
templateColumns: [
{
key: "name",
- label:"Name"
- },
- {
- key: "description",
- label: "Beschreibung"
+ label:"Name",
+ title: true,
+ inputType: "text"
},
{
key: "manufacturer",
- label: "Hersteller"
+ label: "Hersteller",
+ inputType: "text"
},
{
key: "unit",
label: "Einheit",
- component: unit
+ component: unit,
+ inputType: "select",
+ selectDataType: "units",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
},
{
+ key: "purchasePrice",
+ label: "Einkaufspreis",
+ component: purchasePrice,
+ inputType: "number"
+ },{
key: "sellingPrice",
label: "Verkaufpreispreis",
- component: sellingPrice
+ component: sellingPrice,
+ inputType: "number"
},
- {
+ /*{
key: "tags",
label: "Tags"
- },
+ },*/
{
key: "productcategories",
- label: "Artikelkategorien"
+ label: "Artikelkategorien",
+ inputType: "select",
+ selectDataType: "productcategories",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ selectMultiple: true
+ },
+ {
+ key: "description",
+ label: "Beschreibung",
+ inputType:"textarea"
+ },
+ ],
+ showTabs: [
+ {
+ label: "Informationen"
}
]
},
@@ -389,7 +487,7 @@ export const useDataStore = defineStore('data', () => {
supabaseSortColumn: "projectNumber",
filters: [
{
- name: "Abgeschlossen",
+ name: "Nur Offene Projekte",
default: true,
"filterFunction": function (row) {
if(row.phases && row.phases.length > 0) {
@@ -453,7 +551,8 @@ export const useDataStore = defineStore('data', () => {
selectDataType: "profiles",
selectOptionAttribute: "fullName",
selectSearchAttributes: ['fullName'],
- selectMultiple: true
+ selectMultiple: true,
+ component: profiles
},],
showTabs: [
{
@@ -551,7 +650,8 @@ export const useDataStore = defineStore('data', () => {
selectDataType: "profiles",
selectOptionAttribute: "fullName",
selectSearchAttributes: ['fullName'],
- selectMultiple: true
+ selectMultiple: true,
+ component: profiles
},
],
showTabs: [
@@ -668,7 +768,8 @@ export const useDataStore = defineStore('data', () => {
selectDataType: "profiles",
selectOptionAttribute: "fullName",
selectSearchAttributes: ['fullName'],
- selectMultiple: true
+ selectMultiple: true,
+ component: profiles
},
],
showTabs: [
@@ -712,22 +813,50 @@ export const useDataStore = defineStore('data', () => {
services: {
label: "Leistungen",
labelSingle: "Leistung",
+ isStandardEntity: true,
redirect: true,
+ supabaseSelectWithInformation: "*, unit(*)",
filters: [],
templateColumns: [
{
key: "name",
- label: "Name"
+ label: "Name",
+ title: true,
+ inputType: "text"
},
{
key: "unit",
label: "Einheit",
- component: unit
+ component: unit,
+ inputType: "select",
+ selectDataType: "units",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
},
{
key: "sellingPrice",
label: "Verkaufspreis",
- component: sellingPrice
+ component: sellingPrice,
+ inputType: "number",
+ },
+ {
+ key: "servicecategories",
+ label: "Leistungskategorien",
+ inputType: "select",
+ selectDataType: "servicecategories",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ selectMultiple: true
+ },
+ {
+ key: "description",
+ label: "Beschreibung",
+ inputType:"textarea"
+ },
+ ],
+ showTabs: [
+ {
+ label: 'Informationen',
}
]
},
@@ -765,32 +894,52 @@ export const useDataStore = defineStore('data', () => {
productcategories: {
label: "Artikelkategorien",
labelSingle: "Artikelkategorie",
+ isStandardEntity: true,
redirect: true,
+ supabaseSelectWithInformation: "*",
filters: [],
templateColumns: [
{
key: "name",
label: "Name",
+ title: true,
+ inputType: "text"
},
{
key: "description",
label: "Beschreibung",
+ inputType: "textarea"
+ }
+ ],
+ showTabs: [
+ {
+ label: 'Informationen',
}
]
},
servicecategories: {
- label: "Leistungskategorie",
- labelSingle: "Leistungskategorien",
+ label: "Leistungskategorien",
+ labelSingle: "Leistungskategorie",
+ isStandardEntity: true,
redirect: true,
+ supabaseSelectWithInformation: "*",
filters: [],
templateColumns: [
{
key: "name",
label: "Name",
+ title: true,
+ inputType: "text"
},
{
key: "description",
label: "Beschreibung",
+ inputType: "textarea"
+ }
+ ],
+ showTabs: [
+ {
+ label: 'Informationen',
}
]
},
@@ -1273,7 +1422,7 @@ export const useDataStore = defineStore('data', () => {
} else {
let historyItem = {
text: `${dataTypes[dataType].labelSingle} erstellt`,
- createdBy: activeProfile.value.id,
+ createdBy: profileStore.activeProfile.id,
tenant: profileStore.currentTenant
}