8627-devToTest #1421

Merged
alexm merged 768 commits from 8627-devToTest into test 2025-02-18 12:37:37 +00:00
1 changed files with 6 additions and 8 deletions
Showing only changes of commit 39f0873fb8 - Show all commits

View File

@ -1,6 +1,5 @@
<script setup>
import { ref, onBeforeMount } from 'vue';
import { useRoute } from 'vue-router';
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import FetchData from 'components/FetchData.vue';
@ -11,17 +10,13 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
const { t } = useI18n();
const form = ref();
const educationLevels = ref([]);
const countries = ref([]);
const maritalStatus = [
{ code: 'M', name: t('Married') },
{ code: 'S', name: t('Single') },
];
const advancedSummary = ref({});
const route = useRoute();
onBeforeMount(async () => {
advancedSummary.value = (await useAdvancedSummary('Workers', route.params.id)) ?? {};
});
</script>
<template>
<FetchData
@ -37,12 +32,15 @@ onBeforeMount(async () => {
auto-load
/>
<FormModel
ref="form"
:url-update="`Workers/${$route.params.id}`"
auto-load
model="Worker"
@on-fetch="
async (data) => {
Object.assign(data, advancedSummary);
Object.assign(data, (await useAdvancedSummary('Workers', data.id)) ?? {});
await $nextTick();
if (form) form.hasChanges = false;
}
"
>