Добавить прикрепленный файл, и пустое значение на случай отстутсвия сопроводительного письма. Данные записываются, обновляются, форма чистится
This commit is contained in:
iriska-gri committed 2024-05-15 16:52:13 +03:00
1 parent 5013b14ed9
commit fdedd6c637
5 files changed
+86 -79

No files matched your search

@@ -1,5 +1,5 @@
<template>
<v-row no-gutters class="h-100 gap" v-if="vacancy.length > 0" >
<v-row no-gutters class="h-100 gap" v-if="vacancy.length > 0">
<v-col lg="4" class="flex-column d-flex">
<v-card class="h-100 pa-1 d-flex flex-column rounded-0">
<v-card-title
@@ -56,7 +56,11 @@
>
Описание
</v-card-title>
<v-row no-gutters class="h-0 gap overflow-auto" id="goto-container-example">
<v-row
no-gutters
class="h-0 gap overflow-auto"
id="goto-container-example"
>
<v-col>
<v-card
class="rounded-0 h-100"
@@ -66,30 +70,27 @@
<span class="text-h4 text-wrap">
{{ vacancyDescription.name }}
</span>
</v-card-title>
<v-card-title class="pt-0">
<span class="text-h5">
{{ vacancyDescription.department.name }}
</span>
</v-card-title>
<v-card-title>
<v-btn
type="submit"
class="text-subtitle-1 font-weight-light"
color="btn_text"
elevation=1
@click="goTo('#response', { container: '#goto-container-example' })"
>
Откликнуться
</v-btn>
type="submit"
class="text-subtitle-1 font-weight-light"
color="btn_text"
elevation="1"
@click="
goTo('#response', { container: '#goto-container-example' })
"
>
Откликнуться
</v-btn>
</v-card-title>
<v-card-title class="pt-6">
<span class="text-h6">
Направление деятельности подразделения
</span>
@@ -106,7 +107,7 @@
</li>
</ul>
</v-card-text>
<v-card-title >
<v-card-title>
<span class="text-h6">
Функционал и должностные обязанности
</span>
@@ -121,9 +122,7 @@
<div class="py-1" v-html="vacancyDescription.functional"></div>
</v-card-text>
<v-divider />
<response-vacancies id="response"/>
<response-vacancies id="response" :idVacations=vacancySelect />
</v-card>
<v-card
@@ -166,7 +165,7 @@
<script>
import { ref } from "vue";
import { useGoTo } from 'vuetify'
import { useGoTo } from "vuetify";
import { clearAxios } from "@/utils/axios-api";
import { baseURL } from "@/utils/axios-api";
import ResponseVacancies from "@/components/about_inspection/open_vacancies/ResponseVacancies.vue";
@@ -174,7 +173,7 @@ import ResponseVacancies from "@/components/about_inspection/open_vacancies/Resp
export default {
components: { ResponseVacancies },
setup() {
const goTo = useGoTo()
const goTo = useGoTo();
let vacancyDescription = ref({ name: "", department: { name: "" } });
let vacancySelect = ref(-1);
@@ -184,7 +183,7 @@ export default {
clearAxios.get(`api/about_inspection/getvacancy/`).then((data) => {
vacancy.value = data.data;
vacancyDescription.value = vacancy.value[0];
// console.log(, 'data')
vacancySelect.value = vacancy.value[0].id
});
};
@@ -213,7 +212,7 @@ export default {
vacancyDescription,
getIndVacation,
vacancySelect,
goTo
goTo,
};
},
};
@@ -1,16 +0,0 @@
<template>
<v-card>
{{}}
</v-card>
</template>
<script>
export default {
}
</script>
<style>
</style>
@@ -35,12 +35,8 @@
no-resize
rows="4"
label="Сопроводительное письмо"
></v-textarea>
<v-file-input
label="Резюме"
hide-details
/>
<v-file-input label="Резюме" hide-details />
<v-btn block type="submit" class="mt-4 text-none" color="btn_text">
Отправить
</v-btn>
@@ -51,43 +47,63 @@
</div>
</template>
<script setup>
<script>
import { ref } from "vue";
import { useField, useForm } from "vee-validate";
import * as yup from "yup";
import { clearAxios } from "@/utils/axios-api";
const { handleSubmit } = useForm({
validationSchema: yup.object({
email: yup
.string()
.email("Введите корректный email")
.required("Поле обязательно для заполнения"),
name: yup
.string()
.matches(/^[а-яА-ЯЁё]+$/, "Имя должно содержать только русские буквы")
.required("Поле обязательно для заполнения"),
phone: yup
.string()
.matches(
/^[[\d-]*\d[\d-]*$/,
"Номер телефона должен содержать только цифры"
)
.required("Поле обязательно для заполнения"),
message: yup.string(),
}),
});
const name = useField("name");
const phone = useField("phone");
const email = useField("email");
const message = useField("message");
const submit = handleSubmit((values) => {
clearAxios
.post(`api/about_inspection/postresponsevacancy/`, { resp: values })
.then((data) => {
console.log("datas");
export default {
props: {
idVacations: {
type: Number,
default: -1
}
},
setup(props) {
const { handleSubmit, handleReset } = useForm({
validationSchema: yup.object({
email: yup
.string()
.email("Введите корректный email")
.required("Поле обязательно для заполнения"),
name: yup
.string()
.matches(/^[а-яА-ЯЁё]+$/, "Имя должно содержать только русские буквы")
.required("Поле обязательно для заполнения"),
phone: yup
.string()
.matches(
/^[[\d-]*\d[\d-]*$/,
"Номер телефона должен содержать только цифры"
)
.required("Поле обязательно для заполнения"),
message: yup.string(),
}),
});
alert(JSON.stringify(values, null, 2));
});
const name = useField("name");
const phone = useField("phone");
const email = useField("email");
const message = useField("message");
const submit = handleSubmit((values) => {
clearAxios
.post(`api/about_inspection/postresponsevacancy/`, { resp: values, id: props.idVacations })
.then((data) => {
});
handleReset()
alert(JSON.stringify(values, null, 2));
});
return {
name,
phone,
email,
message,
submit,
};
},
};
</script>