Merge branch 'master' into hotfix_customer_minorchanges
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2025-04-10 10:26:06 +00:00
commit 0b6ba8fc5e
7 changed files with 53 additions and 59 deletions

View File

@ -1,6 +1,6 @@
<script setup>
import { watch } from 'vue';
import { toDateString } from 'src/filters';
import { toDateHourMinSec } from 'src/filters';
const props = defineProps({
value: { type: [String, Number, Boolean, Object], default: undefined },
@ -40,7 +40,7 @@ const updateValue = () => {
break;
case 'object':
if (props.value instanceof Date) {
t = toDateString(props.value);
t = toDateHourMinSec(props.value);
} else {
t = props.value.toString();
}

View File

@ -68,7 +68,6 @@ const filter = {
},
},
],
where: { and: [{ originFk: route.params.id }] },
};
const paginate = ref();
@ -267,13 +266,6 @@ onMounted(() => {
onUnmounted(() => {
stateStore.rightDrawer = false;
});
watch(
() => router.currentRoute.value.params.id,
() => {
applyFilter();
},
);
</script>
<template>
<VnPaginate
@ -281,6 +273,7 @@ watch(
:data-key
:url="dataKey + 's'"
:user-filter="filter"
:filter="{ where: { and: [{ originFk: route.params.id }] } }"
:skeleton="false"
auto-load
@on-fetch="setLogTree"

View File

@ -39,7 +39,7 @@ const checkboxOptions = ref([
{ name: 'select', label: 'Accesses', selected: false },
]);
const columns = computed(() => [
{ name: 'changedModelValue' },
{ name: 'changedModelValue', orderBy: 'id' },
{ name: 'changedModel' },
{ name: 'userType', orderBy: false },
{ name: 'userFk' },

View File

@ -65,7 +65,7 @@ describe('VnJsonValue', () => {
const date = new Date('2023-01-01');
const wrapper = buildComponent({ value: date });
const span = wrapper.find('span');
expect(span.text()).toBe('2023-01-01');
expect(span.text()).toBe('01/01/2023, 01:00:00');
expect(span.classes()).toContain('json-object');
});

View File

@ -38,7 +38,9 @@ function handleDelete(row) {
ticketNotesCrudRef.value.remove([row]);
}
async function handleSave() {
async function handleSave(e) {
if (e.shiftKey && e.key === 'Enter') return;
e.preventDefault();
if (!isSaving.value) {
isSaving.value = true;
await ticketNotesCrudRef.value?.saveChanges();
@ -70,7 +72,7 @@ async function handleSave() {
<div
v-for="(row, index) in rows"
:key="index"
class="q-mb-md row items-center q-gutter-x-md"
class="q-mb-md row q-gutter-x-md"
>
<VnSelect
:label="t('ticketNotes.observationType')"
@ -86,7 +88,8 @@ async function handleSave() {
:label="t('basicData.description')"
v-model="row.description"
class="col"
@keyup.enter="handleSave"
@keydown.enter.stop="handleSave"
autogrow
data-cy="ticketNotesDescription"
/>
<QIcon

View File

@ -166,50 +166,44 @@ const yearList = ref(generateYears());
}}
</QCardSection>
</div>
<QList dense class="list q-gutter-y-sm q-my-lg">
<QItem>
<QItemSection>
<VnSelect
:label="t('Year')"
v-model="selectedYear"
:options="yearList"
dense
filled
use-input
:is-clearable="false"
/>
</QItemSection>
<QItemSection>
<VnSelect
:label="t('Contract')"
v-model="selectedBusinessFk"
:options="contractList"
option-value="businessFk"
option-label="businessFk"
dense
filled
use-input
:is-clearable="false"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel># {{ scope.opt?.businessFk }}</QItemLabel>
<QItemLabel caption>
{{ toDateFormat(scope.opt?.started) }} -
{{
scope.opt?.ended
? toDateFormat(scope.opt?.ended)
: 'Indef.'
}}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
</QList>
<div dense class="column q-gutter-y-sm q-px-md">
<VnSelect
:label="t('Year')"
v-model="selectedYear"
:options="yearList"
dense
filled
use-input
:is-clearable="false"
/>
<VnSelect
:label="t('Contract')"
v-model="selectedBusinessFk"
:options="contractList"
option-value="businessFk"
option-label="businessFk"
dense
filled
use-input
:is-clearable="false"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel># {{ scope.opt?.businessFk }}</QItemLabel>
<QItemLabel caption>
{{ toDateFormat(scope.opt?.started) }} -
{{
scope.opt?.ended
? toDateFormat(scope.opt?.ended)
: 'Indef.'
}}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</div>
<QList dense class="list q-gutter-y-xs q-my-md">
<QItem v-for="type in absenceTypeList" :key="type.id">
<WorkerEventLabel

View File

@ -20,6 +20,7 @@ const { notify } = useNotify();
const loadingDocuware = ref(true);
const tableRef = ref();
const dialog = ref();
const getAvailablePdaRef = ref();
const route = useRoute();
const { openConfirmationModal } = useVnConfirm();
const routeId = computed(() => route.params.id);
@ -84,6 +85,7 @@ function reloadData() {
initialData.value.deviceProductionFk = null;
initialData.value.simFk = null;
tableRef.value.reload();
getAvailablePdaRef.value.fetch();
}
async function fetchDocuware() {
@ -135,6 +137,7 @@ async function deallocatePDA(deviceProductionFk) {
);
delete tableRef.value.CrudModelRef.formData[index];
notify(t('PDA deallocated'), 'positive');
await getAvailablePdaRef.value.fetch();
}
function isSigned(row) {
@ -144,6 +147,7 @@ function isSigned(row) {
<template>
<FetchData
ref="getAvailablePdaRef"
url="workers/getAvailablePda"
@on-fetch="(data) => (deviceProductions = data)"
auto-load