Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into test
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
ce81185089
|
@ -284,7 +284,7 @@ function updateAndEmit(evt, { val, res, old } = { val: null, res: null, old: nul
|
||||||
state.set(modelValue, val);
|
state.set(modelValue, val);
|
||||||
if (!$props.url) arrayData.store.data = val;
|
if (!$props.url) arrayData.store.data = val;
|
||||||
|
|
||||||
emit(evt, state.get(modelValue), res, old);
|
emit(evt, state.get(modelValue), res, old, formData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function trimData(data) {
|
function trimData(data) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, nextTick, onMounted } from 'vue';
|
import { ref, nextTick } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -9,21 +8,23 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
|
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const form = ref();
|
const form = ref();
|
||||||
const educationLevels = ref([]);
|
const educationLevels = ref([]);
|
||||||
const countries = ref([]);
|
const countries = ref([]);
|
||||||
|
const model = 'Worker';
|
||||||
const maritalStatus = [
|
const maritalStatus = [
|
||||||
{ code: 'M', name: t('Married') },
|
{ code: 'M', name: t('Married') },
|
||||||
{ code: 'S', name: t('Single') },
|
{ code: 'S', name: t('Single') },
|
||||||
];
|
];
|
||||||
|
const route = useRoute();
|
||||||
onMounted(async () => {
|
async function addAdvancedData(data) {
|
||||||
const advanced = await useAdvancedSummary('Workers', useRoute().params.id);
|
const advanced = await useAdvancedSummary('Workers', route.params.id);
|
||||||
Object.assign(form.value.formData, advanced);
|
data.value = { ...data.value, ...advanced };
|
||||||
nextTick(() => (form.value.hasChanges = false));
|
nextTick(() => (form.value.hasChanges = false));
|
||||||
});
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -42,7 +43,8 @@ onMounted(async () => {
|
||||||
ref="form"
|
ref="form"
|
||||||
:url-update="`Workers/${$route.params.id}`"
|
:url-update="`Workers/${$route.params.id}`"
|
||||||
auto-load
|
auto-load
|
||||||
model="Worker"
|
:model
|
||||||
|
@on-fetch="(data, res, old, formData) => addAdvancedData(formData)"
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
|
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
|
||||||
import { axiosNoError } from 'src/boot/axios';
|
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
|
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
|
||||||
|
@ -281,11 +280,11 @@ const fetchWeekData = async () => {
|
||||||
week: selectedWeekNumber.value,
|
week: selectedWeekNumber.value,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
const [{ data: mailData }, { data: countData }] = await Promise.allS([
|
||||||
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
axios.get(`Workers/${route.params.id}/mail`, {
|
||||||
params: { filter: { where } },
|
params: { filter: { where } },
|
||||||
}),
|
}),
|
||||||
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
axios.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const mail = mailData[0];
|
const mail = mailData[0];
|
||||||
|
|
Loading…
Reference in New Issue