Fix #138
This commit is contained in:
@@ -27,6 +27,11 @@ const date = computed({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const selectToday = () => {
|
||||||
|
emit('update:model-value', new Date())
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
const attrs = [{
|
const attrs = [{
|
||||||
key: 'today',
|
key: 'today',
|
||||||
highlight: {
|
highlight: {
|
||||||
@@ -37,18 +42,31 @@ const attrs = [{
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VCalendarDatePicker
|
<div class="space-y-3">
|
||||||
show-weeknumbers
|
<VCalendarDatePicker
|
||||||
v-model="date"
|
show-weeknumbers
|
||||||
:mode="props.mode"
|
v-model="date"
|
||||||
is24hr
|
:mode="props.mode"
|
||||||
transparent
|
is24hr
|
||||||
borderless
|
transparent
|
||||||
color="green"
|
borderless
|
||||||
:attributes="attrs"
|
color="green"
|
||||||
:is-dark="isDark"
|
:attributes="attrs"
|
||||||
title-position="left"
|
:is-dark="isDark"
|
||||||
trim-weeks
|
title-position="left"
|
||||||
:first-day-of-week="2"
|
trim-weeks
|
||||||
/>
|
:first-day-of-week="2"
|
||||||
</template>
|
/>
|
||||||
|
|
||||||
|
<div class="flex justify-end px-2 pb-2">
|
||||||
|
<UButton
|
||||||
|
size="xs"
|
||||||
|
color="gray"
|
||||||
|
variant="soft"
|
||||||
|
icon="i-heroicons-calendar-days"
|
||||||
|
label="Heute"
|
||||||
|
@click="selectToday"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ const currentUnit = computed(() => {
|
|||||||
const selectedService = data.value.services?.find(s => s.id === form.value.service)
|
const selectedService = data.value.services?.find(s => s.id === form.value.service)
|
||||||
return selectedService?.unitSymbol || data.value?.units?.[0]?.symbol || 'h'
|
return selectedService?.unitSymbol || data.value?.units?.[0]?.symbol || 'h'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const setDeliveryDateToToday = () => {
|
||||||
|
form.value.deliveryDate = dayjs().format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -120,12 +124,16 @@ const currentUnit = computed(() => {
|
|||||||
:error="errors.deliveryDate"
|
:error="errors.deliveryDate"
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
<UInput
|
<div class="flex items-center gap-2">
|
||||||
v-model="form.deliveryDate"
|
<UInput
|
||||||
type="date"
|
v-model="form.deliveryDate"
|
||||||
size="lg"
|
type="date"
|
||||||
icon="i-heroicons-calendar-days"
|
size="lg"
|
||||||
/>
|
icon="i-heroicons-calendar-days"
|
||||||
|
class="flex-1"
|
||||||
|
/>
|
||||||
|
<UButton color="gray" variant="soft" size="lg" label="Heute" @click="setDeliveryDateToToday" />
|
||||||
|
</div>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
@@ -226,4 +234,4 @@ const currentUnit = computed(() => {
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</UCard>
|
</UCard>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ const isOpen = computed({
|
|||||||
|
|
||||||
const toDateStr = (dateStr: string) => dateStr ? $dayjs(dateStr).format('YYYY-MM-DD') : ''
|
const toDateStr = (dateStr: string) => dateStr ? $dayjs(dateStr).format('YYYY-MM-DD') : ''
|
||||||
const toTimeStr = (dateStr: string) => dateStr ? $dayjs(dateStr).format('HH:mm') : ''
|
const toTimeStr = (dateStr: string) => dateStr ? $dayjs(dateStr).format('HH:mm') : ''
|
||||||
|
const setDateFieldToToday = (field: 'start_date' | 'end_date') => {
|
||||||
|
state[field] = $dayjs().format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
|
|
||||||
watch(() => props.entry, (newVal) => {
|
watch(() => props.entry, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
@@ -140,7 +143,10 @@ async function onSubmit(event: FormSubmitEvent<any>) {
|
|||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
<div class="grid grid-cols-2 gap-4">
|
||||||
<UFormGroup label="Start Datum" name="start_date">
|
<UFormGroup label="Start Datum" name="start_date">
|
||||||
<UInput type="date" v-model="state.start_date" />
|
<div class="flex items-center gap-2">
|
||||||
|
<UInput type="date" v-model="state.start_date" class="flex-1" />
|
||||||
|
<UButton color="gray" variant="soft" label="Heute" @click="setDateFieldToToday('start_date')" />
|
||||||
|
</div>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
<UFormGroup label="Start Zeit" name="start_time">
|
<UFormGroup label="Start Zeit" name="start_time">
|
||||||
<UInput type="time" v-model="state.start_time" />
|
<UInput type="time" v-model="state.start_time" />
|
||||||
@@ -149,7 +155,10 @@ async function onSubmit(event: FormSubmitEvent<any>) {
|
|||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
<div class="grid grid-cols-2 gap-4">
|
||||||
<UFormGroup label="Ende Datum" name="end_date">
|
<UFormGroup label="Ende Datum" name="end_date">
|
||||||
<UInput type="date" v-model="state.end_date" />
|
<div class="flex items-center gap-2">
|
||||||
|
<UInput type="date" v-model="state.end_date" class="flex-1" />
|
||||||
|
<UButton color="gray" variant="soft" label="Heute" @click="setDateFieldToToday('end_date')" />
|
||||||
|
</div>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
<UFormGroup label="Ende Zeit" name="end_time">
|
<UFormGroup label="Ende Zeit" name="end_time">
|
||||||
<UInput type="time" v-model="state.end_time" />
|
<UInput type="time" v-model="state.end_time" />
|
||||||
@@ -168,4 +177,4 @@ async function onSubmit(event: FormSubmitEvent<any>) {
|
|||||||
</UForm>
|
</UForm>
|
||||||
</UCard>
|
</UCard>
|
||||||
</UModal>
|
</UModal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -152,7 +152,10 @@
|
|||||||
|
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<UFormGroup label="Ausführungsdatum (Belegdatum)" help="Dieses Datum steuert auch den Leistungszeitraum (z.B. Vormonat bei 'Rückwirkend').">
|
<UFormGroup label="Ausführungsdatum (Belegdatum)" help="Dieses Datum steuert auch den Leistungszeitraum (z.B. Vormonat bei 'Rückwirkend').">
|
||||||
<UInput type="date" v-model="executionDate" />
|
<div class="flex items-center gap-2">
|
||||||
|
<UInput type="date" v-model="executionDate" class="flex-1" />
|
||||||
|
<UButton color="gray" variant="soft" label="Heute" @click="setExecutionDateToToday" />
|
||||||
|
</div>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UDivider label="Vorlagen auswählen" />
|
<UDivider label="Vorlagen auswählen" />
|
||||||
@@ -303,6 +306,10 @@ const isExecuting = ref(false)
|
|||||||
const modalSearch = ref("") // NEU: Suchstring für das Modal
|
const modalSearch = ref("") // NEU: Suchstring für das Modal
|
||||||
const selectedExecutionIntervall = ref("all")
|
const selectedExecutionIntervall = ref("all")
|
||||||
|
|
||||||
|
const setExecutionDateToToday = () => {
|
||||||
|
executionDate.value = dayjs().format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
|
|
||||||
// --- SerialExecutions State ---
|
// --- SerialExecutions State ---
|
||||||
const showExecutionsSlideover = ref(false)
|
const showExecutionsSlideover = ref(false)
|
||||||
const executionItems = ref([])
|
const executionItems = ref([])
|
||||||
|
|||||||
@@ -107,6 +107,19 @@ function recalculateWeeklyHours() {
|
|||||||
profile.value.weekly_working_hours = Number(total.toFixed(2))
|
profile.value.weekly_working_hours = Number(total.toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getToday = () => {
|
||||||
|
const now = new Date()
|
||||||
|
const year = now.getFullYear()
|
||||||
|
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(now.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const setProfileDate = (field: 'birthday' | 'entry_date') => {
|
||||||
|
if (!profile.value) return
|
||||||
|
profile.value[field] = getToday()
|
||||||
|
}
|
||||||
|
|
||||||
const checkZip = async () => {
|
const checkZip = async () => {
|
||||||
const zipData = await useFunctions().useZipCheck(profile.value.address_zip)
|
const zipData = await useFunctions().useZipCheck(profile.value.address_zip)
|
||||||
if (zipData) {
|
if (zipData) {
|
||||||
@@ -190,7 +203,10 @@ onMounted(fetchProfile)
|
|||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup label="Geburtstag">
|
<UFormGroup label="Geburtstag">
|
||||||
<UInput type="date" v-model="profile.birthday" />
|
<div class="flex items-center gap-2">
|
||||||
|
<UInput type="date" v-model="profile.birthday" class="flex-1" />
|
||||||
|
<UButton color="gray" variant="soft" label="Heute" @click="setProfileDate('birthday')" />
|
||||||
|
</div>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
</UForm>
|
</UForm>
|
||||||
</UCard>
|
</UCard>
|
||||||
@@ -215,7 +231,10 @@ onMounted(fetchProfile)
|
|||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup label="Eintrittsdatum">
|
<UFormGroup label="Eintrittsdatum">
|
||||||
<UInput type="date" v-model="profile.entry_date" />
|
<div class="flex items-center gap-2">
|
||||||
|
<UInput type="date" v-model="profile.entry_date" class="flex-1" />
|
||||||
|
<UButton color="gray" variant="soft" label="Heute" @click="setProfileDate('entry_date')" />
|
||||||
|
</div>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup label="Wöchentliche Arbeitszeit (Std)">
|
<UFormGroup label="Wöchentliche Arbeitszeit (Std)">
|
||||||
|
|||||||
Reference in New Issue
Block a user