diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue
index 0de3834ea..e9660e4c2 100644
--- a/src/components/VnTable/VnFilter.vue
+++ b/src/components/VnTable/VnFilter.vue
@@ -91,7 +91,6 @@ const components = {
event: updateEvent,
attrs: {
...defaultAttrs,
- style: 'min-width: 150px',
},
forceAttrs,
},
diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue
index d67d157c2..721927018 100644
--- a/src/components/VnTable/VnTable.vue
+++ b/src/components/VnTable/VnTable.vue
@@ -31,6 +31,8 @@ import VnLv from 'components/ui/VnLv.vue';
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
import VnTableFilter from './VnTableFilter.vue';
import { getColAlign } from 'src/composables/getColAlign';
+import RightMenu from '../common/RightMenu.vue';
+import { QItemSection } from 'quasar';
const arrayData = useArrayData(useAttrs()['data-key']);
const $props = defineProps({
@@ -414,20 +416,13 @@ async function renderInput(rowId, field, clickedElement) {
eventHandlers: {
'update:modelValue': async (value) => {
if (isSelect && value) {
- row[column.name] = value[column.attrs?.optionValue ?? 'id'];
- row[column?.name + 'TextValue'] =
- value[column.attrs?.optionLabel ?? 'name'];
- await column?.cellEvent?.['update:modelValue']?.(
- value,
- oldValue,
- row,
- );
+ await updateSelectValue(value, column, row, oldValue);
} else row[column.name] = value;
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
},
keyup: async (event) => {
if (event.key === 'Enter')
- await destroyInput(rowIndex, field, clickedElement);
+ await destroyInput(rowId, field, clickedElement);
},
keydown: async (event) => {
switch (event.key) {
@@ -458,6 +453,17 @@ async function renderInput(rowId, field, clickedElement) {
node.el?.querySelector('span > div > div').focus();
}
+async function updateSelectValue(value, column, row, oldValue) {
+ row[column.name] = value[column.attrs?.optionValue ?? 'id'];
+
+ row[column?.name + 'VnTableTextValue'] = value[column.attrs?.optionLabel ?? 'name'];
+
+ if (column?.attrs?.find?.label)
+ row[column?.attrs?.find?.label] = value[column.attrs?.optionLabel ?? 'name'];
+
+ await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
+}
+
async function destroyInput(rowIndex, field, clickedElement) {
if (!clickedElement)
clickedElement = document.querySelector(
@@ -520,9 +526,9 @@ function getToggleIcon(value) {
}
function formatColumnValue(col, row, dashIfEmpty) {
- if (col?.format || row[col?.name + 'TextValue']) {
- if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
- return dashIfEmpty(row[col?.name + 'TextValue']);
+ if (col?.format || row[col?.name + 'VnTableTextValue']) {
+ if (selectRegex.test(col?.component) && row[col?.name + 'VnTableTextValue']) {
+ return dashIfEmpty(row[col?.name + 'VnTableTextValue']);
} else {
return col.format(row, dashIfEmpty);
}
@@ -555,19 +561,33 @@ function formatColumnValue(col, row, dashIfEmpty) {
}
return dashIfEmpty(row[col?.name]);
}
+
function cardClick(_, row) {
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
}
+
+function removeTextValue(data, getChanges) {
+ let changes = data.updates;
+ if (!changes) return data;
+
+ for (const change of changes) {
+ for (const key in change.data) {
+ if (key.endsWith('VnTableTextValue')) {
+ delete change.data[key];
+ }
+ }
+ }
+
+ data.updates = changes.filter((change) => Object.keys(change.data).length > 0);
+
+ if ($attrs?.beforeSaveFn) data = $attrs.beforeSaveFn(data, getChanges);
+
+ return data;
+}
-
-
+
+
-
-
+
+
emit('onFetch', ...args)"
:search-url="searchUrl"
:disable-infinite-scroll="isTableMode"
+ :before-save-fn="removeTextValue"
@save-changes="reload"
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
:auto-load="hasParams || $attrs['auto-load']"
@@ -635,6 +656,7 @@ function cardClick(_, row) {
:skip="columnsVisibilitySkipped"
/>
{
);
});
+const routeName = computed(() => {
+ const DESCRIPTOR_PROXY = 'DescriptorProxy';
+
+ let name = $props.dataKey;
+ if ($props.dataKey.includes(DESCRIPTOR_PROXY)) {
+ name = name.split(DESCRIPTOR_PROXY)[0];
+ }
+ return `${name}Summary`;
+});
async function getData() {
store.url = $props.url;
store.filter = $props.filter ?? {};
@@ -154,9 +163,7 @@ const toModule = computed(() =>
{{ t('components.smartCard.openSummary') }}
-
+
useArrayData('Account').store.data[0]);
+const account = computed(() => arrayData.store.data);
account.value.hasAccount = hasAccount.value;
const entityId = computed(() => +route.params.id);
const hasitManagementAccess = ref();
@@ -39,7 +40,7 @@ const isHimself = computed(() => user.value.id === account.value.id);
const url = computed(() =>
isHimself.value
? 'Accounts/change-password'
- : `Accounts/${entityId.value}/setPassword`
+ : `Accounts/${entityId.value}/setPassword`,
);
async function updateStatusAccount(active) {
@@ -153,6 +154,7 @@ onMounted(() => {
t('account.card.actions.disableAccount.title'),
t('account.card.actions.disableAccount.subtitle'),
() => deleteAccount(),
+ () => deleteAccount(),
)
"
>
@@ -172,6 +174,7 @@ onMounted(() => {
t('account.card.actions.enableAccount.title'),
t('account.card.actions.enableAccount.subtitle'),
() => updateStatusAccount(true),
+ () => updateStatusAccount(true),
)
"
>
@@ -186,6 +189,7 @@ onMounted(() => {
t('account.card.actions.disableAccount.title'),
t('account.card.actions.disableAccount.subtitle'),
() => updateStatusAccount(false),
+ () => updateStatusAccount(false),
)
"
>
@@ -201,6 +205,7 @@ onMounted(() => {
t('account.card.actions.activateUser.title'),
t('account.card.actions.activateUser.title'),
() => updateStatusUser(true),
+ () => updateStatusUser(true),
)
"
>
@@ -215,6 +220,7 @@ onMounted(() => {
t('account.card.actions.deactivateUser.title'),
t('account.card.actions.deactivateUser.title'),
() => updateStatusUser(false),
+ () => updateStatusUser(false),
)
"
>
diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue
index 81578c609..67333b5bd 100644
--- a/src/pages/Entry/Card/EntryBuys.vue
+++ b/src/pages/Entry/Card/EntryBuys.vue
@@ -639,7 +639,7 @@ onMounted(() => {
'flex-wrap': 'wrap',
gap: '16px',
position: 'relative',
- height: '450px',
+ height: '500px',
},
columnGridStyle: {
'max-width': '50%',
@@ -650,7 +650,7 @@ onMounted(() => {
:is-editable="editableMode"
:without-header="!editableMode"
:with-filters="editableMode"
- :right-search="true"
+ :right-search="editableMode"
:right-search-icon="true"
:row-click="false"
:columns="columns"
diff --git a/src/pages/Entry/EntryList.vue b/src/pages/Entry/EntryList.vue
index 3c96a2302..a9cf2a5e2 100644
--- a/src/pages/Entry/EntryList.vue
+++ b/src/pages/Entry/EntryList.vue
@@ -274,7 +274,7 @@ onBeforeMount(async () => {
:array-data-props="{
url: 'Entries/filter',
order: 'landed DESC',
- userFilter: EntryFilter,
+ userFilter: entryQueryFilter,
}"
>
diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue
index f32dcd0d9..a7e192765 100644
--- a/src/pages/Route/RouteExtendedList.vue
+++ b/src/pages/Route/RouteExtendedList.vue
@@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useQuasar } from 'quasar';
-import { dashIfEmpty, toDate, toHour } from 'src/filters';
+import { toDate, toHour } from 'src/filters';
import { useRouter } from 'vue-router';
import { usePrintService } from 'src/composables/usePrintService';
diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue
index fcf0f0369..cf43412af 100644
--- a/src/pages/Worker/Card/WorkerBasicData.vue
+++ b/src/pages/Worker/Card/WorkerBasicData.vue
@@ -17,6 +17,12 @@ const maritalStatus = [
{ code: 'M', name: t('Married') },
{ code: 'S', name: t('Single') },
];
+async function setAdvancedSummary(data) {
+ const advanced = (await useAdvancedSummary('Workers', data.id)) ?? {};
+ Object.assign(form.value.formData, advanced);
+ await nextTick();
+ if (form.value) form.value.hasChanges = false;
+}
{
- Object.assign(data, (await useAdvancedSummary('Workers', data.id)) ?? {});
- await $nextTick();
- if (form) form.hasChanges = false;
- }
- "
+ @on-fetch="setAdvancedSummary"
>
diff --git a/src/pages/Worker/Card/WorkerDescriptorProxy.vue b/src/pages/Worker/Card/WorkerDescriptorProxy.vue
index a142570f9..5f71abbea 100644
--- a/src/pages/Worker/Card/WorkerDescriptorProxy.vue
+++ b/src/pages/Worker/Card/WorkerDescriptorProxy.vue
@@ -12,6 +12,11 @@ const $props = defineProps({
-
+
diff --git a/test/cypress/integration/account/accountDescriptorMenu.spec.js b/test/cypress/integration/account/accountDescriptorMenu.spec.js
new file mode 100644
index 000000000..67a7d8ef6
--- /dev/null
+++ b/test/cypress/integration/account/accountDescriptorMenu.spec.js
@@ -0,0 +1,24 @@
+describe('ClaimNotes', () => {
+ const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
+ const url = '/#/account/1/summary';
+
+ it('should see all the account options', () => {
+ cy.login('itManagement');
+ cy.visit(url);
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get(descriptorOptions)
+ .find('.q-item')
+ .its('length')
+ .then((count) => {
+ cy.log('Número de opciones:', count);
+ expect(count).to.equal(5);
+ });
+ });
+
+ it('should not see any option', () => {
+ cy.login('salesPerson');
+ cy.visit(url);
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get(descriptorOptions).should('not.be.visible');
+ });
+});