P-47 весь объект события до отправки в new FormData()
This commit is contained in:
1 parent
d2b6e65d7f
commit
11f45daf67
3 files changed
+119
-72
No files matched your search
@@ -4,7 +4,7 @@
|
||||
<span class="text-h4">Откликнуться на вакансию</span>
|
||||
</v-card-text>
|
||||
<v-card-text class="d-flex flex-column pt-0">
|
||||
<v-form ref="form_vacancies" @submit.prevent="submit">
|
||||
<v-form ref="form_vacancies" @submit.prevent="submit">
|
||||
<v-row no-gutters class="justify-center">
|
||||
<v-col lg="8">
|
||||
<v-text-field
|
||||
@@ -72,12 +72,12 @@ export default {
|
||||
fio: [
|
||||
(val) => req(val),
|
||||
(val) =>
|
||||
val.match(/^[а-яА-ЯЁё ]+$/) !== null || "хочу имя русскими буквами",
|
||||
val.match(/^[а-яА-ЯЁё ]+$/) !== null || "Имя должно содержать русские буквы",
|
||||
],
|
||||
email: [(val) => req(val)],
|
||||
tel: [
|
||||
(val) => req(val),
|
||||
(val) => val.match(/^[[\d-]*\d[\d-]*$/) !== null || "хочу цифрами",
|
||||
(val) => val.match(/^[[\d-]*\d[\d-]*$/) !== null || "Номер должен содержать цифры",
|
||||
],
|
||||
text: "",
|
||||
};
|
||||
@@ -86,6 +86,7 @@ export default {
|
||||
const form_vacancies = ref(null)
|
||||
|
||||
const submit = () => {
|
||||
|
||||
if(form_vacancies.value.isValid) {
|
||||
|
||||
|
||||
@@ -95,10 +96,11 @@ export default {
|
||||
JSON.stringify({ ...form.value, vacancy_id: props.idVacations })
|
||||
);
|
||||
if (file.value !== null) {
|
||||
console.log(file.value, 'file.valuefile.valuefile.value')
|
||||
postFile.append("file", file.value[0]);
|
||||
}
|
||||
|
||||
// Отправляет сообщение об отправлении при отсутсвии валидации!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
clearAxios
|
||||
.post(`api/about_inspection/postresponsevacancy/`, postFile)
|
||||
.then((data) => {
|
||||
@@ -115,6 +117,7 @@ export default {
|
||||
file,
|
||||
rules,
|
||||
submit,
|
||||
form_vacancies
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,44 +1,7 @@
|
||||
<template>
|
||||
<v-row no-gutters class="gap">
|
||||
<v-col lg="2">
|
||||
<v-textarea
|
||||
density="compact"
|
||||
no-resize
|
||||
row-height="25"
|
||||
rows="1"
|
||||
readonly
|
||||
variant="outlined"
|
||||
v-model="timeEvent"
|
||||
:active="menutime"
|
||||
:focus="menutime"
|
||||
|
||||
>
|
||||
|
||||
</v-textarea>
|
||||
<v-menu
|
||||
v-model="menutime"
|
||||
:close-on-content-click="false"
|
||||
activator="parent"
|
||||
transition="scale-transition"
|
||||
>
|
||||
|
||||
<v-time-picker
|
||||
v-if="menutime"
|
||||
v-model="timeEvent"
|
||||
full-width
|
||||
format="24hr"
|
||||
></v-time-picker>
|
||||
</v-menu>
|
||||
<!-- <v-textarea
|
||||
density="compact"
|
||||
no-resize
|
||||
row-height="25"
|
||||
rows="1"
|
||||
variant="outlined"
|
||||
v-model="timeEvent"
|
||||
></v-textarea> -->
|
||||
</v-col>
|
||||
<v-col lg="3">
|
||||
|
||||
|
||||
<v-col lg=3 :class="`order-${order[0]}`" >
|
||||
<v-menu
|
||||
v-model="menudate"
|
||||
:close-on-content-click="false"
|
||||
@@ -75,11 +38,42 @@
|
||||
hide-header
|
||||
border
|
||||
no-time
|
||||
:max="new Date(max_date)"
|
||||
:min="new Date(min_date)"
|
||||
></v-date-picker>
|
||||
</v-locale-provider>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-col class="flex-grow-0 " :class="`order-${order[1]}`">
|
||||
<v-textarea
|
||||
density="compact"
|
||||
no-resize
|
||||
row-height="25"
|
||||
width="75"
|
||||
rows="1"
|
||||
readonly
|
||||
variant="outlined"
|
||||
v-model="timeEvent"
|
||||
:active="menutime"
|
||||
:focus="menutime"
|
||||
>
|
||||
</v-textarea>
|
||||
<v-menu
|
||||
v-model="menutime"
|
||||
:close-on-content-click="false"
|
||||
activator="parent"
|
||||
transition="scale-transition"
|
||||
>
|
||||
|
||||
<v-time-picker
|
||||
v-if="menutime"
|
||||
v-model="timeEvent"
|
||||
full-width
|
||||
format="24hr"
|
||||
></v-time-picker>
|
||||
</v-menu>
|
||||
|
||||
</v-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -91,6 +85,19 @@ export default {
|
||||
type: String,
|
||||
default: "2024-07-01",
|
||||
},
|
||||
max_date: {
|
||||
type: Date,
|
||||
default: new Date('2555-07-01')
|
||||
},
|
||||
min_date: {
|
||||
type: Date,
|
||||
default: new Date("1970-01-01")
|
||||
},
|
||||
|
||||
order: {
|
||||
type: Array,
|
||||
default: [0, 0]
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
@@ -85,18 +85,29 @@
|
||||
Дата и время
|
||||
</v-col>
|
||||
<v-col class="d-flex flex-column">
|
||||
|
||||
<time-select
|
||||
:date="propsEvent.event.date_start"
|
||||
@update:date ="propsEvent.event.date_start = $event"
|
||||
/>
|
||||
|
||||
<time-select
|
||||
:date="propsEvent.event.date_end"
|
||||
@update:date ="propsEvent.event.date_end = $event"
|
||||
/>
|
||||
|
||||
<v-row no-gutters class="gap">
|
||||
|
||||
<time-select
|
||||
:date="propsEvent.event.date_start"
|
||||
:max_date ="new Date(propsEvent.event.date_end)"
|
||||
@update:date="propsEvent.event.date_start = $event"
|
||||
:order="[2,1]"
|
||||
/>
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<v-col class="order-3 flex-grow-0">
|
||||
<v-icon icon="mdi-minus pt-4" color="grey-darken-1" />
|
||||
</v-col>
|
||||
|
||||
<time-select
|
||||
:date="propsEvent.event.date_end"
|
||||
:order="[4,5]"
|
||||
:min_date ="new Date(propsEvent.event.date_start).setDate(new Date(propsEvent.event.date_start).getDate()-1)"
|
||||
@update:date="propsEvent.event.date_end = $event"
|
||||
/>
|
||||
|
||||
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
<v-col>
|
||||
<v-textarea
|
||||
@@ -111,7 +122,19 @@
|
||||
</v-row> </v-col
|
||||
></v-row>
|
||||
</v-col>
|
||||
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col class="text-body-2 text-text_grey pb-5" lg="2">
|
||||
Файлы
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-file-input
|
||||
label="File input w/ chips"
|
||||
chips
|
||||
multiple
|
||||
v-model="eventFiles"
|
||||
></v-file-input>
|
||||
</v-col
|
||||
></v-row>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col>
|
||||
<v-textarea
|
||||
@@ -134,7 +157,7 @@ import { axiosApiInstance } from "@/utils/axios-api";
|
||||
import DialogCreate from "@/components/calendar_of_events/UI_calendar/dialogCreate.vue";
|
||||
import calendarCreateSelect from "@/components/calendar_of_events/calendar-create-select.vue";
|
||||
import { formatComa } from "@/utils/universal_functions";
|
||||
import TimeSelect from '@/components/calendar_of_events/UI_calendar/timeSelect.vue';
|
||||
import TimeSelect from "@/components/calendar_of_events/UI_calendar/timeSelect.vue";
|
||||
|
||||
export default {
|
||||
components: { calendarCreateSelect, DialogCreate, TimeSelect },
|
||||
@@ -182,11 +205,30 @@ export default {
|
||||
},
|
||||
});
|
||||
|
||||
// const getTime = computed({
|
||||
// get() {
|
||||
const eventFiles = computed({
|
||||
get() {
|
||||
console.log(propsEvent.value.event.files)
|
||||
return propsEvent.value.event.files
|
||||
|
||||
// }
|
||||
// })
|
||||
}
|
||||
,
|
||||
set(newValue) {
|
||||
// propsEvent.value.event.files.push(newValue)
|
||||
newValue.forEach((e) => {
|
||||
let ind = propsEvent.value.event.files.findIndex(f => f.name == e.name)
|
||||
console.log(ind, 'ind')
|
||||
if(ind==-1) {
|
||||
propsEvent.value.event.files.push(e)
|
||||
}
|
||||
else {
|
||||
propsEvent.value.event.files.slice(ind, 0)
|
||||
}
|
||||
|
||||
})
|
||||
console.log(newValue)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
const calendar = computed({
|
||||
get() {
|
||||
@@ -241,24 +283,19 @@ export default {
|
||||
console.log(idPart, "idPart");
|
||||
};
|
||||
|
||||
|
||||
|
||||
const dateEvent = computed({
|
||||
get() {
|
||||
|
||||
return formatComa(new Date(propsEvent.value.event.date_start))
|
||||
return formatComa(new Date(propsEvent.value.event.date_start));
|
||||
},
|
||||
|
||||
set(newValue) {
|
||||
|
||||
let dateParts = newValue.split(".");
|
||||
console.log(dateParts, timeEvent.value, '1111111111111111111111111111')
|
||||
console.log(dateParts, timeEvent.value, "1111111111111111111111111111");
|
||||
// let d = new Date(propsEvent.value.event.date_start).setFullYear(parseInt(dateParts[2], 10), parseInt(dateParts[1], 10), parseInt(dateParts[0], 10))
|
||||
// let d = new Date(propsEvent.value.event.date_start).setDate(new Date(2024,01,01))
|
||||
// propsEvent.value.event.date_start = new Date(2024,01,01);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
|
||||
const menudate = ref(false);
|
||||
|
||||
@@ -272,7 +309,7 @@ export default {
|
||||
staff,
|
||||
newStaff,
|
||||
returnIdParticant,
|
||||
|
||||
eventFiles
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user