Merge branch 'dev-denzel' into cja_new

This commit is contained in:
cja committed 2025-06-03 12:40:12 +03:00
commit 45cd0b9ab2
2 files changed
+30 -23

No files matched your search

@@ -92,14 +92,21 @@
Дата окончания: {{ new Date(employee.completion_date).toLocaleDateString('ru-RU') }}
</div>
</div>
<v-btn
icon="mdi-close"
variant="text"
density="compact"
color="red-darken-1"
class="ml-auto"
@click="$emit('unassign', employee)"
/>
<v-tooltip text="Снять назначение" location="top">
<template #activator="{ props }">
<v-btn
v-bind="props"
icon="mdi-close"
variant="text"
density="compact"
color="red-darken-1"
class="ml-auto"
@click="$emit('unassign', employee)"
>
<v-icon icon="mdi-close" />
</v-btn>
</template>
</v-tooltip>
</div>
</template>
</v-list-item>
@@ -163,26 +163,26 @@ export default {
showFinishDialog.value = false;
try {
// [{ question_id, answers_id: [id, ...] }]
let answersToSubmit = [];
answers.value.forEach((answer, questionIndex) => {
data.value.questions.forEach((question, questionIndex) => {
const answer = answers.value[questionIndex];
if (answer === null) return;
const question = data.value.questions[questionIndex];
let selectedIds = [];
if (Array.isArray(answer)) {
answer.forEach((answerText) => {
selectedIds = answer.map((answerText) => {
const selectedAnswer = question.answers.find((a) => a.name === answerText);
if (selectedAnswer) {
answersToSubmit.push({ answer: selectedAnswer.id });
}
});
}
else {
return selectedAnswer ? selectedAnswer.id : null;
}).filter(Boolean);
} else {
const selectedAnswer = question.answers.find((a) => a.name === answer);
if (selectedAnswer) {
answersToSubmit.push({ answer: selectedAnswer.id });
}
if (selectedAnswer) selectedIds = [selectedAnswer.id];
}
if (selectedIds.length > 0) {
answersToSubmit.push({
question_id: question.id,
answers_id: selectedIds,
});
}
});