diff --git a/package.json b/package.json index 7be20a842..38a1d06a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.22.0", + "version": "24.24.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index e3cb2874a..769ba9959 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -35,7 +35,7 @@ const $props = defineProps({ downloadModel: { type: String, required: false, - default: null, + default: undefined, }, defaultDmsCode: { type: String, diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index e8083dec2..493f094ce 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -22,6 +22,10 @@ const $props = defineProps({ type: String, default: '', }, + optionFilter: { + type: String, + default: null, + }, url: { type: String, default: '', @@ -59,7 +63,7 @@ const $props = defineProps({ const { t } = useI18n(); const requiredFieldRule = (val) => val ?? t('globals.fieldRequired'); -const { optionLabel, optionValue, options, modelValue } = toRefs($props); +const { optionLabel, optionValue, optionFilter, options, modelValue } = toRefs($props); const myOptions = ref([]); const myOptionsOriginal = ref([]); const vnSelectRef = ref(); @@ -109,9 +113,9 @@ async function fetchFilter(val) { const { fields, sortBy, limit } = $props; let key = optionLabel.value; - if (new RegExp(/\d/g).test(val)) key = optionValue.value; + if (new RegExp(/\d/g).test(val)) key = optionFilter.value ?? optionValue.value; - const where = { [key]: { like: `%${val}%` } }; + const where = { ...{ [key]: { like: `%${val}%` } }, ...$props.where }; return dataRef.value.fetch({ fields, where, order: sortBy, limit }); } diff --git a/src/components/ui/QCalendarMonthWrapper.vue b/src/components/ui/QCalendarMonthWrapper.vue index 24255ea1a..3ecea89c2 100644 --- a/src/components/ui/QCalendarMonthWrapper.vue +++ b/src/components/ui/QCalendarMonthWrapper.vue @@ -108,7 +108,7 @@ const containerClasses = computed(() => { font-size: 13px; &:hover { - background-color: var(--vn-accent-color); + background-color: var(--vn-label-color); cursor: pointer; } } diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 326ddff5d..e2465f5ba 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -130,7 +130,8 @@ export function useArrayData(key, userOptions) { store.filter = {}; if (params) store.userParams = Object.assign({}, params); - await fetch({ append: false }); + const response = await fetch({ append: false }); + return response; } async function addFilter({ filter, params }) { diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 7d680c681..0e6edeab2 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -830,6 +830,7 @@ worker: calendar: Calendar timeControl: Time control locker: Locker + list: name: Name email: Email @@ -861,6 +862,15 @@ worker: role: Role sipExtension: Extension locker: Locker + fiDueDate: Fecha de caducidad del DNI + sex: Sexo + seniority: Antigüedad + fi: DNI/NIE/NIF + birth: Cumpleaños + isFreelance: Autónomo + isSsDiscounted: Bonificación SS + hasMachineryAuthorized: Autorizado para llevar maquinaria + isDisable: Trabajador desactivado notificationsManager: activeNotifications: Active notifications availableNotifications: Available notifications diff --git a/src/pages/Department/Card/DepartmentDescriptor.vue b/src/pages/Department/Card/DepartmentDescriptor.vue index e60a8c91b..70c578fc2 100644 --- a/src/pages/Department/Card/DepartmentDescriptor.vue +++ b/src/pages/Department/Card/DepartmentDescriptor.vue @@ -3,7 +3,7 @@ import { computed, ref } from 'vue'; import { useRoute, useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { useQuasar } from 'quasar'; - +import { useVnConfirm } from 'composables/useVnConfirm'; import VnLv from 'src/components/ui/VnLv.vue'; import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; import useCardDescription from 'src/composables/useCardDescription'; @@ -43,30 +43,17 @@ const setData = (entity) => { data.value = useCardDescription(entity.name, entity.id); }; -const removeDepartment = () => { - quasar - .dialog({ - title: 'Are you sure you want to delete it?', - message: 'Delete department', - ok: { - push: true, - color: 'primary', - }, - cancel: true, - }) - .onOk(async () => { - try { - await axios.post( - `/Departments/${entityId.value}/removeChild`, - entityId.value - ); - router.push({ name: 'WorkerDepartment' }); - notify('department.departmentRemoved', 'positive'); - } catch (err) { - console.error('Error removing department'); - } - }); +const removeDepartment = async () => { + try { + await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value); + router.push({ name: 'WorkerDepartment' }); + notify('department.departmentRemoved', 'positive'); + } catch (err) { + console.error('Error removing department'); + } }; + +const { openConfirmationModal } = useVnConfirm();