Skip to content
Snippets Groups Projects
Commit 54e5afd3 authored by permcu's avatar permcu
Browse files

Pass state to absence-creation-form

parent 52995a32
No related branches found
No related tags found
1 merge request!356Add dialog for creation of long-term absences
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
</template> </template>
<template #content> <template #content>
<absence-creation-form v-if="form" <absence-creation-form v-if="form"
:persons="persons"
:start-date="startDate"
:end-date="endDate"
:comment="comment"
:absence-reason="absenceReason"
@persons="persons = $event" @persons="persons = $event"
@start-date="startDate = $event" @start-date="startDate = $event"
@end-date="endDate = $event" @end-date="endDate = $event"
...@@ -85,7 +90,7 @@ export default { ...@@ -85,7 +90,7 @@ export default {
startDate: "", startDate: "",
endDate: "", endDate: "",
comment: "", comment: "",
absenceReason: null, absenceReason: "",
}; };
}, },
methods: { methods: {
...@@ -95,6 +100,7 @@ export default { ...@@ -95,6 +100,7 @@ export default {
}, },
confirm() { confirm() {
// TODO: Send mutation (shown in absence-creation-summary) // TODO: Send mutation (shown in absence-creation-summary)
// Clear form fields
popup = false; popup = false;
}, },
}, },
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
item-text="fullName" item-text="fullName"
return-object return-object
multiple multiple
:value="persons"
@input="$emit('persons', $event)" @input="$emit('persons', $event)"
/> />
</v-row> </v-row>
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
<date-field <date-field
:label="$t('forms.labels.start')" :label="$t('forms.labels.start')"
:max="endDate" :max="endDate"
:value="startDate"
@input="$emit('start-date', $event)" @input="$emit('start-date', $event)"
/> />
</v-col> </v-col>
...@@ -29,6 +31,7 @@ ...@@ -29,6 +31,7 @@
<date-field <date-field
:label="$t('forms.labels.end')" :label="$t('forms.labels.end')"
:min="startDate" :min="startDate"
:value="endDate"
@input="$emit('end-date', $event)" @input="$emit('end-date', $event)"
/> />
</v-col> </v-col>
...@@ -36,11 +39,13 @@ ...@@ -36,11 +39,13 @@
<v-row> <v-row>
<v-text-field <v-text-field
:label="$t('forms.labels.comment')" :label="$t('forms.labels.comment')"
:value="comment"
@input="$emit('comment', $event)" @input="$emit('comment', $event)"
/> />
</v-row> </v-row>
<v-row> <v-row>
<absence-reason-group-select <absence-reason-group-select
:value="absenceReason"
@input="$emit('absence-reason', $event)" @input="$emit('absence-reason', $event)"
/> />
</v-row> </v-row>
...@@ -65,5 +70,27 @@ export default { ...@@ -65,5 +70,27 @@ export default {
// KolegoAbsences for! // KolegoAbsences for!
allPersons: persons, allPersons: persons,
}, },
props: {
persons: {
type: Array,
required: true,
},
startDate: {
type: String,
required: true,
},
endDate: {
type: String,
required: true,
},
comment: {
type: String,
required: true,
},
absenceReason: {
type: String,
required: true,
},
},
}; };
</script> </script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment