Training-Report #27
@@ -9,7 +9,6 @@ import { getMembers, Member } from '@/api/member'
|
||||
import FieldGroup from '../ui/field/FieldGroup.vue'
|
||||
import Field from '../ui/field/Field.vue'
|
||||
import FieldLabel from '../ui/field/FieldLabel.vue'
|
||||
import Input from '../ui/input/Input.vue'
|
||||
import FieldError from '../ui/field/FieldError.vue'
|
||||
import Button from '../ui/button/Button.vue'
|
||||
import Textarea from '../ui/textarea/Textarea.vue'
|
||||
@@ -18,9 +17,6 @@ import FieldSet from '../ui/field/FieldSet.vue'
|
||||
import FieldLegend from '../ui/field/FieldLegend.vue'
|
||||
import FieldDescription from '../ui/field/FieldDescription.vue'
|
||||
import Checkbox from '../ui/checkbox/Checkbox.vue'
|
||||
import Select from '../ui/select/Select.vue'
|
||||
import { SelectContent, SelectItem, SelectTrigger, SelectValue } from 'reka-ui'
|
||||
import FieldContent from '../ui/field/FieldContent.vue'
|
||||
|
||||
const { handleSubmit, resetForm, errors, values } = useForm({
|
||||
validationSchema: toTypedSchema(trainingReportSchema),
|
||||
@@ -32,6 +28,14 @@ const { handleSubmit, resetForm, errors, values } = useForm({
|
||||
}
|
||||
})
|
||||
|
||||
watch(errors, (newErrors) => {
|
||||
console.log(newErrors)
|
||||
}, { deep: true })
|
||||
|
||||
watch(values, (newErrors) => {
|
||||
console.log(newErrors.attendees)
|
||||
}, { deep: true })
|
||||
|
||||
const submitForm = handleSubmit(onSubmit);
|
||||
|
||||
function toMySQLDateTime(date: Date): string {
|
||||
@@ -48,9 +52,10 @@ function onSubmit(vals) {
|
||||
...vals,
|
||||
event_date: toMySQLDateTime(new Date(vals.event_date)),
|
||||
}
|
||||
postTrainingReport(clean).then((newID) => {
|
||||
emit("submit", newID);
|
||||
});
|
||||
console.log(clean);
|
||||
// postTrainingReport(clean).then((newID) => {
|
||||
// emit("submit", newID);
|
||||
// });
|
||||
} catch (err) {
|
||||
console.log("There was an error submitting the training report", err);
|
||||
}
|
||||
@@ -167,14 +172,14 @@ onMounted(async () => {
|
||||
</div>
|
||||
</VeeField>
|
||||
|
||||
<!-- Passed Checkbox -->
|
||||
<!-- Bookwork Checkbox -->
|
||||
<VeeField v-slot="{ field }" :name="`attendees[${index}].passed_bookwork`" type="checkbox"
|
||||
:value="true" :unchecked-value="false">
|
||||
:value="false" :unchecked-value="true">
|
||||
<div class="flex flex-col items-center">
|
||||
<div class="relative inline-flex items-center group">
|
||||
|
||||
<Checkbox :disabled="!selectedCourse?.hasBookwork"
|
||||
:name="`attendees[${index}].passed_bookwork`" v-bind="field" :value="true">
|
||||
:name="`attendees[${index}].passed_bookwork`" v-bind="field">
|
||||
</Checkbox>
|
||||
<!-- Tooltip bubble -->
|
||||
<div v-if="!selectedCourse?.hasBookwork" class="pointer-events-none absolute -top-9 left-1/2 -translate-x-1/2
|
||||
@@ -191,9 +196,9 @@ onMounted(async () => {
|
||||
</div>
|
||||
</VeeField>
|
||||
|
||||
<!-- Passed Checkbox -->
|
||||
<!-- Qual Checkbox -->
|
||||
<VeeField v-slot="{ field }" :name="`attendees[${index}].passed_qual`" type="checkbox"
|
||||
:value="true" :unchecked-value="false">
|
||||
:value="false" :unchecked-value="true">
|
||||
<div class="flex flex-col items-center">
|
||||
<div class="relative inline-flex items-center group">
|
||||
<Checkbox :disabled="!selectedCourse?.hasQual"
|
||||
|
||||
Reference in New Issue
Block a user