diff --git a/package.json b/package.json index 7be20a8428..38a1d06a35 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/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index 6344edd010..b2c5226e6b 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -8,12 +8,7 @@ import FetchData from 'components/FetchData.vue'; import VnRow from 'components/ui/VnRow.vue'; import FormModelPopup from './FormModelPopup.vue'; -const props = defineProps({ - showEntityField: { - type: Boolean, - default: true, - }, -}); +defineProps({ showEntityField: { type: Boolean, default: true } }); const emit = defineEmits(['onDataSaved']); const { t } = useI18n(); diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index c5caf9778f..25213a8b7b 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -6,7 +6,7 @@ import FormModel from 'components/FormModel.vue'; const emit = defineEmits(['onDataSaved']); -const $props = defineProps({ +defineProps({ title: { type: String, default: '', diff --git a/src/components/FormPopup.vue b/src/components/FormPopup.vue index e203a7c755..2da9860063 100644 --- a/src/components/FormPopup.vue +++ b/src/components/FormPopup.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n'; const emit = defineEmits(['onSubmit']); -const $props = defineProps({ +defineProps({ title: { type: String, default: '', diff --git a/src/components/common/SendEmailDialog.vue b/src/components/common/SendEmailDialog.vue index 501c48a4d1..d731339218 100644 --- a/src/components/common/SendEmailDialog.vue +++ b/src/components/common/SendEmailDialog.vue @@ -29,10 +29,12 @@ async function confirm() { const response = { address: address.value }; if (props.promise) { isLoading.value = true; - const { address: _address, ...restData } = props.data; try { - Object.assign(response, restData); + const dataCopy = JSON.parse(JSON.stringify({ ...props.data })); + delete dataCopy.address; + + Object.assign(response, dataCopy); await props.promise(response); } finally { isLoading.value = false; diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index e3cb2874ae..769ba99598 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/VnInput.vue b/src/components/common/VnInput.vue index 684770e9c5..8358cd6e67 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -37,14 +37,6 @@ const styleAttrs = computed(() => { : {}; }); -const onEnterPress = () => { - emit('keyup.enter'); -}; - -const handleValue = (val = null) => { - value.value = val; -}; - const focus = () => { vnInputRef.value.focus(); }; @@ -73,7 +65,7 @@ const inputRules = [ v-bind="{ ...$attrs, ...styleAttrs }" :type="$attrs.type" :class="{ required: $attrs.required }" - @keyup.enter="onEnterPress()" + @keyup.enter="emit('keyup.enter')" :clearable="false" :rules="inputRules" :lazy-rules="true" @@ -82,14 +74,14 @@ const inputRules = [ - + diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index e8083dec29..493f094ce7 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/CardSummary.vue b/src/components/ui/CardSummary.vue index e52be753fb..57d1cb19aa 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -142,6 +142,9 @@ const showRedirectToSummaryIcon = computed(() => { box-shadow: none; .vn-label-value { + &.negative > .value span { + color: $alert; + } display: flex; flex-direction: row; margin-top: 2px; diff --git a/src/components/ui/QCalendarMonthWrapper.vue b/src/components/ui/QCalendarMonthWrapper.vue index 24255ea1a2..3ecea89c27 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/components/ui/VnLinkPhone.vue b/src/components/ui/VnLinkPhone.vue index b04ab3e5be..3ce0b7aa6c 100644 --- a/src/components/ui/VnLinkPhone.vue +++ b/src/components/ui/VnLinkPhone.vue @@ -1,21 +1,16 @@ - diff --git a/src/components/ui/VnTree.vue b/src/components/ui/VnTree.vue index 13aa056356..928d045e9f 100644 --- a/src/components/ui/VnTree.vue +++ b/src/components/ui/VnTree.vue @@ -90,7 +90,7 @@ const onNodeCreated = async () => { await fetchNodeLeaves(creationNodeSelectedId.value); }; -onMounted(async (n) => { +onMounted(async () => { const tree = [...state.get('Tree'), 1]; const lastStateTree = state.get('TreeState'); if (tree) { diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 326ddff5d2..e2465f5bae 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/filters/dateRange.js b/src/filters/dateRange.js index 4c0cfe6542..7aa2869e5e 100644 --- a/src/filters/dateRange.js +++ b/src/filters/dateRange.js @@ -1,7 +1,7 @@ export default function dateRange(value) { const minHour = new Date(value); minHour.setHours(0, 0, 0, 0); - const maxHour = new Date(value); + const maxHour = new Date(); maxHour.setHours(23, 59, 59, 59); return [minHour, maxHour]; diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 7dc5777bf6..0e6edeab28 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -32,6 +32,7 @@ globals: confirm: Confirm assign: Assign back: Back + downloadPdf: Download PDF yes: 'Yes' no: 'No' noChanges: No changes to save @@ -271,6 +272,7 @@ customer: tableVisibleColumns: id: Identifier name: Name + socialName: Social name fi: Tax number salesPersonFk: Salesperson credit: Credit @@ -828,6 +830,7 @@ worker: calendar: Calendar timeControl: Time control locker: Locker + list: name: Name email: Email @@ -859,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/i18n/locale/es.yml b/src/i18n/locale/es.yml index ad7c8d4aa6..d78e1762cf 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -59,6 +59,7 @@ globals: amount: Importe packages: Bultos download: Descargar + downloadPdf: Descargar PDF selectRows: 'Seleccionar las { numberRows } filas(s)' allRows: 'Todo { numberRows } filas(s)' markAll: Marcar todo @@ -269,6 +270,7 @@ customer: tableVisibleColumns: id: Identificador name: Nombre + socialName: Razón social fi: NIF / CIF salesPersonFk: Comercial credit: Crédito diff --git a/src/pages/Agency/Card/AgencySummary.vue b/src/pages/Agency/Card/AgencySummary.vue index 1a506b1541..839d882001 100644 --- a/src/pages/Agency/Card/AgencySummary.vue +++ b/src/pages/Agency/Card/AgencySummary.vue @@ -7,20 +7,9 @@ import CardSummary from 'components/ui/CardSummary.vue'; import VnLv from 'components/ui/VnLv.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; -const $props = defineProps({ - id: { - type: Number, - default: 0, - }, -}); -const route = useRoute(); +const $props = defineProps({ id: { type: Number, default: 0 } }); const { t } = useI18n(); -const entityId = computed(() => $props.id || route.params.id); - -const filter = { - fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'], - include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }], -}; +const entityId = computed(() => $props.id || useRoute().params.id);