Merge branch 'dev' into beta
This commit is contained in:
@@ -252,7 +252,7 @@ watch(item.value, async (newItem, oldItem) => {
|
||||
</template>
|
||||
</UInput>
|
||||
<UToggle
|
||||
:color="datapoint.required ? (item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] ? 'primary' : 'rose') : 'white'"
|
||||
:color="datapoint.required ? (item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] ? 'primary' : 'rose') : 'primary'"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'bool'"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -353,7 +353,7 @@ watch(item.value, async (newItem, oldItem) => {
|
||||
</template>
|
||||
</UInput>
|
||||
<UToggle
|
||||
:color="datapoint.required ? (item[datapoint.key] ? 'primary' : 'rose') : 'white'"
|
||||
:color="datapoint.required ? (item[datapoint.key] ? 'primary' : 'rose') : 'primary'"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'bool'"
|
||||
v-model="item[datapoint.key]"
|
||||
@@ -498,7 +498,7 @@ watch(item.value, async (newItem, oldItem) => {
|
||||
</template>
|
||||
</UInput>
|
||||
<UToggle
|
||||
:color="datapoint.required ? (item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] ? 'primary' : 'rose') : 'white'"
|
||||
:color="datapoint.required ? (item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]] ? 'primary' : 'rose') : 'primary'"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'bool'"
|
||||
v-model="item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
|
||||
@@ -599,7 +599,7 @@ watch(item.value, async (newItem, oldItem) => {
|
||||
</template>
|
||||
</UInput>
|
||||
<UToggle
|
||||
:color="datapoint.required ? (item[datapoint.key] ? 'primary' : 'rose') : 'white'"
|
||||
:color="datapoint.required ? (item[datapoint.key] ? 'primary' : 'rose') : 'primary'"
|
||||
@change="datapoint.inputChangeFunction ? datapoint.inputChangeFunction(item,loadedOptions) : null"
|
||||
v-else-if="datapoint.inputType === 'bool'"
|
||||
v-model="item[datapoint.key]"
|
||||
|
||||
15
components/columnRenderings/endDateTime.vue
Normal file
15
components/columnRenderings/endDateTime.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const props = defineProps({
|
||||
row: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-if="props.row.endDate">{{dayjs(props.row.endDate).format("DD.MM.YYYY HH:mm")}}</span>
|
||||
</template>
|
||||
15
components/columnRenderings/startDateTime.vue
Normal file
15
components/columnRenderings/startDateTime.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const props = defineProps({
|
||||
row: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-if="props.row.startDate">{{dayjs(props.row.startDate).format("DD.MM.YYYY HH:mm")}}</span>
|
||||
</template>
|
||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -40,7 +40,7 @@
|
||||
"dayjs": "^1.11.10",
|
||||
"fast-sort": "^3.4.1",
|
||||
"handlebars": "^4.7.8",
|
||||
"jsprintmanager": "^6.0.3",
|
||||
"jsprintmanager": "^7.0.2",
|
||||
"leaflet": "^1.9.4",
|
||||
"maplibre-gl": "^4.7.0",
|
||||
"nuxt-editorjs": "^1.0.4",
|
||||
@@ -10049,9 +10049,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jsprintmanager": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/jsprintmanager/-/jsprintmanager-6.0.3.tgz",
|
||||
"integrity": "sha512-5JQIUtdjad8w5SiG1cws635XW8qgSJEK6E0bTe8ksEf/Z+p8V9O1Ou6IHkU2lMD1Wv0uhOr8/aGNqIH0aSgQ4Q=="
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/jsprintmanager/-/jsprintmanager-7.0.2.tgz",
|
||||
"integrity": "sha512-mripy7zRw0njMoP6aft1qYwiDIUNEoSyNovge2CDxujvZYVs5p29aL9oyQVM0x0hKpVUmuGb8wLLitU+e/+HiA==",
|
||||
"license": "SEE LICENSE IN <https://www.neodynamic.com/eula>"
|
||||
},
|
||||
"node_modules/kdbush": {
|
||||
"version": "4.0.2",
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
"dayjs": "^1.11.10",
|
||||
"fast-sort": "^3.4.1",
|
||||
"handlebars": "^4.7.8",
|
||||
"jsprintmanager": "^6.0.3",
|
||||
"leaflet": "^1.9.4",
|
||||
"maplibre-gl": "^4.7.0",
|
||||
"nuxt-editorjs": "^1.0.4",
|
||||
|
||||
@@ -6,7 +6,6 @@ import timeGridPlugin from "@fullcalendar/timegrid"
|
||||
import resourceTimelinePlugin from "@fullcalendar/resource-timeline";
|
||||
import interactionPlugin from "@fullcalendar/interaction";
|
||||
import dayjs from "dayjs";
|
||||
import profiles from "~/components/columnRenderings/profiles.vue";
|
||||
|
||||
definePageMeta({
|
||||
middleware: "auth"
|
||||
@@ -18,8 +17,6 @@ const router = useRouter()
|
||||
const mode = ref(route.params.mode || "grid")
|
||||
const supabase = useSupabaseClient()
|
||||
const dataStore = useDataStore()
|
||||
//const resources = dataStore.getResources
|
||||
//const eventTypes = dataStore.getEventTypes
|
||||
|
||||
const profileStore = useProfileStore()
|
||||
|
||||
@@ -129,46 +126,12 @@ const calendarOptionsTimeline = ref({
|
||||
|
||||
const loaded = ref(false)
|
||||
const setupPage = async () => {
|
||||
let tempData = await useSupabaseSelect("events", "*, vehicles(*), inventoryitems(*)")
|
||||
let absencerequests = await useSupabaseSelect("absencerequests", "*, profile(*)")
|
||||
let projects = await useSupabaseSelect("projects", "*")
|
||||
let inventoryitems = await useSupabaseSelect("inventoryitems", "*")
|
||||
let profiles = await useSupabaseSelect("profiles", "*")
|
||||
let vehicles = await useSupabaseSelect("vehicles", "*")
|
||||
|
||||
/*events.value = [
|
||||
...tempData.map(event => {
|
||||
let eventColor = profileStore.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.eventtype).color
|
||||
|
||||
let title = ""
|
||||
if (event.name) {
|
||||
title = event.name
|
||||
} else if (event.project) {
|
||||
projects.find(i => i.id === event.project) ? projects.find(i => i.id === event.project).name : ""
|
||||
}
|
||||
|
||||
return {
|
||||
...event,
|
||||
start: event.startDate,
|
||||
end: event.endDate,
|
||||
title: title,
|
||||
borderColor: eventColor,
|
||||
textColor: eventColor,
|
||||
backgroundColor: "black"
|
||||
}
|
||||
}),
|
||||
...absencerequests.map(absence => {
|
||||
return {
|
||||
id: absence.id,
|
||||
resourceId: absence.user,
|
||||
resourceType: "person",
|
||||
title: `Abw.: ${absence.reason}`,
|
||||
start: dayjs(absence.start).toDate(),
|
||||
end: dayjs(absence.end).add(1, 'day').toDate(),
|
||||
allDay: true,
|
||||
}
|
||||
})
|
||||
]*/
|
||||
let tempData = (await useSupabaseSelect("events", "*, vehicles(*), inventoryitems(*)")).filter(i => !i.archived)
|
||||
let absencerequests = (await useSupabaseSelect("absencerequests", "*, profile(*)")).filter(i => !i.archived)
|
||||
let projects = (await useSupabaseSelect("projects", "*")).filter(i => !i.archived)
|
||||
let inventoryitems = (await useSupabaseSelect("inventoryitems", "*")).filter(i => !i.archived)
|
||||
let profiles = (await useSupabaseSelect("profiles", "*")).filter(i => !i.archived)
|
||||
let vehicles = (await useSupabaseSelect("vehicles", "*")).filter(i => !i.archived)
|
||||
|
||||
calendarOptionsGrid.value.initialEvents = [
|
||||
...tempData.map(event => {
|
||||
@@ -178,7 +141,7 @@ const setupPage = async () => {
|
||||
if (event.name) {
|
||||
title = event.name
|
||||
} else if (event.project) {
|
||||
projects.find(i => i.id === event.project) ? projects.find(i => i.id === event.project).name : ""
|
||||
title = projects.find(i => i.id === event.project) ? projects.find(i => i.id === event.project).name : ""
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -231,7 +194,6 @@ const setupPage = async () => {
|
||||
}
|
||||
})
|
||||
]
|
||||
console.log(calendarOptionsTimeline.value.resources)
|
||||
|
||||
/*
|
||||
calendarOptionsTimeline.value.initialEvents = [
|
||||
@@ -266,7 +228,6 @@ const setupPage = async () => {
|
||||
let tempEvents = []
|
||||
|
||||
tempData.forEach(event => {
|
||||
console.log(event)
|
||||
let eventColor = profileStore.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.eventtype).color
|
||||
|
||||
let title = ""
|
||||
@@ -290,21 +251,18 @@ const setupPage = async () => {
|
||||
|
||||
|
||||
if(event.profiles.length > 0) {
|
||||
console.log("Profiles found")
|
||||
event.profiles.forEach(profile => {
|
||||
returnData.resourceIds.push(profile)
|
||||
})
|
||||
}
|
||||
|
||||
if(event.vehicles.length > 0) {
|
||||
console.log("Vehicles found")
|
||||
event.vehicles.forEach(vehicle => {
|
||||
returnData.resourceIds.push(`F-${vehicle.id}`)
|
||||
})
|
||||
}
|
||||
|
||||
if(event.inventoryitems.length > 0) {
|
||||
console.log("Inventoryitems found")
|
||||
event.inventoryitems.forEach(inventoryitem => {
|
||||
returnData.resourceIds.push(`I-${inventoryitem.id}`)
|
||||
})
|
||||
@@ -330,7 +288,6 @@ const setupPage = async () => {
|
||||
})
|
||||
|
||||
calendarOptionsTimeline.value.initialEvents = tempEvents
|
||||
console.log(calendarOptionsTimeline.value)
|
||||
|
||||
loaded.value = true
|
||||
|
||||
|
||||
@@ -744,14 +744,22 @@ const getDocumentData = () => {
|
||||
type: itemInfo.value.type,
|
||||
taxType: itemInfo.value.taxType,
|
||||
adressLine: `${businessInfo.name}, ${businessInfo.street}, ${businessInfo.zip} ${businessInfo.city}`,
|
||||
recipient: {
|
||||
/*recipient: {
|
||||
name: customerData.name,
|
||||
contact: contactData ? `${contactData.firstName} ${contactData.lastName}` : "",
|
||||
street: itemInfo.value.address.street || customerData.infoData.street,
|
||||
special: itemInfo.value.address.special || customerData.infoData.special,
|
||||
city: itemInfo.value.address.city || customerData.infoData.city,
|
||||
zip: itemInfo.value.address.zip || customerData.infoData.zip
|
||||
},
|
||||
},*/
|
||||
recipient: [
|
||||
customerData.name,
|
||||
... contactData ? [`${contactData.firstName} ${contactData.lastName}`] : [],
|
||||
itemInfo.value.address.street,
|
||||
... itemInfo.value.address.special ? [itemInfo.value.address.special] : [],
|
||||
`${itemInfo.value.address.zip} ${itemInfo.value.address.city}`,
|
||||
|
||||
],
|
||||
/*info: {
|
||||
customerNumber: customerData.customerNumber,
|
||||
documentNumber: itemInfo.value.documentNumber,
|
||||
|
||||
@@ -30,6 +30,8 @@ import sellingPriceComposedWorker from "~/components/columnRenderings/sellingPri
|
||||
import sellingPriceComposedTotal from "~/components/columnRenderings/sellingPriceComposedTotal.vue"
|
||||
import startDate from "~/components/columnRenderings/startDate.vue"
|
||||
import endDate from "~/components/columnRenderings/endDate.vue"
|
||||
import startDateTime from "~/components/columnRenderings/startDateTime.vue"
|
||||
import endDateTime from "~/components/columnRenderings/endDateTime.vue"
|
||||
import serviceCategories from "~/components/columnRenderings/serviceCategories.vue"
|
||||
import phase from "~/components/columnRenderings/phase.vue"
|
||||
|
||||
@@ -592,6 +594,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
key: "reason",
|
||||
label: "Grund",
|
||||
inputType: "select",
|
||||
required: true,
|
||||
selectValueAttribute: "label",
|
||||
selectManualOptions: [
|
||||
{label:"Urlaub"},
|
||||
@@ -1550,12 +1553,14 @@ export const useDataStore = defineStore('data', () => {
|
||||
label: "Start",
|
||||
required: true,
|
||||
inputType: "datetime",
|
||||
component: startDateTime
|
||||
},
|
||||
{
|
||||
key: "endDate",
|
||||
label: "Ende",
|
||||
required: true,
|
||||
inputType: "datetime",
|
||||
component: endDateTime
|
||||
},/*{
|
||||
key: "eventtype",
|
||||
label: "Typ",
|
||||
|
||||
Reference in New Issue
Block a user