8144-devToTest_2444 #852

Merged
carlossa merged 86 commits from 8144-devToTest_2444 into test 2024-10-22 08:55:44 +00:00
1 changed files with 16 additions and 1 deletions
Showing only changes of commit 0d31adaa4b - Show all commits

View File

@ -3,9 +3,11 @@ import WorkerEventLabel from 'pages/Worker/Card/WorkerEventLabel.vue';
import FetchData from 'components/FetchData.vue';
import { useI18n } from 'vue-i18n';
import VnSelect from 'components/common/VnSelect.vue';
import useNotify from 'src/composables/useNotify';
import { useRoute } from 'vue-router';
import { computed, ref } from 'vue';
import { computed, onMounted, ref } from 'vue';
import { toDateFormat } from '../../../filters/date';
const { notify } = useNotify();
const { t } = useI18n();
const route = useRoute();
@ -33,6 +35,9 @@ const props = defineProps({
},
});
onMounted(async () => {
await checkHolidays(props.contractHolidays);
});
const emit = defineEmits(['update:businessFk', 'update:year', 'update:absenceType']);
const selectedBusinessFk = computed({
@ -60,6 +65,16 @@ const generateYears = () => {
return Array.from({ length: 5 }, (_, i) => String(maxYear - i)) || [];
};
const checkHolidays = (contractHolidays) => {
console.log('contractHolidays', contractHolidays);
if (
contractHolidays.holidaysEnjoyed > contractHolidays.totalHolidays ||
contractHolidays.hoursEnjoyed > contractHolidays.totalHours
) {
notify(t('Vacation days have been exceeded'), 'negative');
}
};
const absenceTypeList = ref([]);
const contractList = ref([]);
const yearList = ref(generateYears());