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);
|
||||
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) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, nextTick, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ref, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.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 VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const { t } = useI18n();
|
||||
const form = ref();
|
||||
const educationLevels = ref([]);
|
||||
const countries = ref([]);
|
||||
const model = 'Worker';
|
||||
const maritalStatus = [
|
||||
{ code: 'M', name: t('Married') },
|
||||
{ code: 'S', name: t('Single') },
|
||||
];
|
||||
|
||||
onMounted(async () => {
|
||||
const advanced = await useAdvancedSummary('Workers', useRoute().params.id);
|
||||
Object.assign(form.value.formData, advanced);
|
||||
const route = useRoute();
|
||||
async function addAdvancedData(data) {
|
||||
const advanced = await useAdvancedSummary('Workers', route.params.id);
|
||||
data.value = { ...data.value, ...advanced };
|
||||
nextTick(() => (form.value.hasChanges = false));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -42,7 +43,8 @@ onMounted(async () => {
|
|||
ref="form"
|
||||
:url-update="`Workers/${$route.params.id}`"
|
||||
auto-load
|
||||
model="Worker"
|
||||
:model
|
||||
@on-fetch="(data, res, old, formData) => addAdvancedData(formData)"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
|
||||
import { axiosNoError } from 'src/boot/axios';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
|
||||
|
@ -281,11 +280,11 @@ const fetchWeekData = async () => {
|
|||
week: selectedWeekNumber.value,
|
||||
};
|
||||
try {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.allS([
|
||||
axios.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
}),
|
||||
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
axios.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
]);
|
||||
|
||||
const mail = mailData[0];
|
||||
|
|
Loading…
Reference in New Issue