8144-devToTest_2444 #852
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue