feat: refs #8316 add entryFilter to VnTableEntryList component

This commit is contained in:
Jose Antonio Tubau 2025-01-10 15:24:09 +01:00
commit c896b66a50
161 changed files with 2508 additions and 1384 deletions

View File

@ -1,3 +1,167 @@
# Version 24.52 - 2024-01-07
### Added 🆕
- chore: refs #8197 remove console log by:alexm
- chore: refs #8197 replace name by:alexm
- chore: refs #8197 unnecessary file by:alexm
- feat: #8110 apply mixin in quasar components by:Javier Segarra
- feat(Account & AccountRole): refs #8197 add VnCardMain by:alexm
- feat: addDptoLink by:Jtubau
- feat: added restore ticket function in ticket descriptor menu by:Jon
- feat: add support service wip by:jorgep
- feat: focus menu searchbar by:jorgep
- feat: make additional data object by:jorgep
- feat: message to grant access by:jorgep
- feat: refs #6583 add default param by:jorgep
- feat: refs #6583 add destination opt filter by:jorgep
- feat: refs #6583 add icon by:jorgep
- feat: refs #6583 add locale by:jorgep
- feat: refs #7072 added test to computed fn total by:Jtubau
- feat: refs #7235 update invoice out global form to fetch config based on serial type by:jgallego
- feat: refs #7301 add exclude inventory supplier from list by:pablone
- feat: refs #7301 enhance VnDateBadge styling and improve ItemLastEntries component by:pablone
- feat: refs #7882 Added distribution point by:guillermo
- feat: refs #7882 Added longitude & latitude by:guillermo
- feat: refs #7936 add autocomplete on tab fn by:jorgep
- feat: refs #7936 add company filter by:jorgep
- feat: refs #7936 add currency check before fetching by:jorgep
- feat: refs #7936 add dueDated field by:jorgep
- feat: refs #7936 add number validation to VnInputNumber & new daysAgo filter in InvoiceInFilter by:jorgep
- feat: refs #7936 add optionCaption by:jorgep
- feat: refs #7936 add row click navigation to InvoiceInSerial by:jorgep
- feat: refs #7936 add unit tests by:jorgep
- feat: refs #7936 add useAccountShortToStandard composable by:jorgep
- feat: refs #7936 calculate exchange & update taxable base by:jorgep
- feat: refs #7936 enhance downloadFile function to support opening in a new tab by:jorgep
- feat: refs #7936 enhance getTotal fn & add unit tests by:jorgep
- feat: refs #7936 enhance vn-select by:jorgep
- feat: refs #7936 improve optionLabel logic in InvoiceInVat component for better handling of numeric values by:jorgep
- feat: refs #7936 limit decimal places by:jorgep
- feat: refs #7936 make fields required by:jorgep
- feat: refs #7936 show country code & isVies fields by:jorgep
- feat: refs #7936 show id & value by:jorgep
- feat: refs #7936 simplify optionLabel wip by:jorgep
- feat: refs #7936 update 'isVies' label to use global translation key by:jorgep
- feat: refs #7936 update option labels in InvoiceIn components for better clarity by:jorgep
- feat: refs #7936 use default invoice data by:jorgep
- feat: refs #8001 change request by:robert
- feat: refs #8001 ticketExpeditionGrafana by:robert
- feat: refs #8194 created VnSelectWorker component and use it in Lilium by:Jon
- feat: refs #8197 better leftMenu and VnCardMain improvements by:alexm
- feat: refs #8197 default leftMenu by:alexm
- feat: refs #8197 default sectionName by:alexm
- feat: refs #8197 keepData in VnSection by:alexm
- feat: refs #8197 vnTableFilter by:alexm
- feat: refs #8197 working rightMenu by:alexm
- feat: remove re-fetch when add element by:Javier Segarra
- feat: remove search after category by:Javier Segarra
- feat: requested changes in item module by:Jon
- feat: update quantity by:Javier Segarra
- feat(VnPaginate): refs #8197 hold data when change to Card by:alexm
### Changed 📦
- perf: #6896 REMOVE COMMENTS by:Javier Segarra
- perf: qFormMixin by:Javier Segarra
- perf: qFormMixin improvement by:Javier Segarra
- perf: refs #8194 select worker component by:Jon
- perf: refs #8197 perf by:alexm
- perf: remove comments by:Javier Segarra
- perf: remove unused variables (origin/warmfix_noUsedVars) by:Javier Segarra
- refactor: added again search emit by:Jon
- refactor: add useCau composable by:jorgep
- refactor: deleted log by:Jon
- refactor: deleted onUnmounted code by:Jon
- refactor: deleted useless hidden tag by:Jon
- refactor: deleted warnings and corrected itemTag by:Jon
- refactor: drop logic by:jorgep
- refactor: ignore params when searching by id on searchbar (origin/VnSearchbar-SearchRemoveParams) by:Jon
- refactor: log error by:Jon
- refactor: refs #7936 locale by:jorgep
- refactor: refs #7936 simplify getTotal fn by:jorgep
- refactor: refs #7936 update label capitalization and replace invoice type options by:jorgep
- refactor: refs #8194 deleted unnecessary label by:Jon
- refactor: refs #8194 modified select worker template by:Jon
- refactor: refs #8194 modified select worker to allow no one filter from monitor ticket by:Jon
- refactor: refs #8194 moved translation to the correct place by:Jon
- refactor: refs #8194 requested changes by:Jon
- refactor: refs #8194 structure changes in component and related files by:Jon
- refactor: refs #8197 adapt AccountAcls to VnCardMain by:alexm
- refactor: refs #8197 adapt AccountAlias by:alexm
- refactor: refs #8197 adapt Ticket to VnCardMain by:alexm
- refactor: refs #8197 backward compatible (8197-VnCardMain_backwardCompatibility) by:alexm
- refactor: refs #8197 rename VnSectionMain to VnModule and VnCardMain to VnSection by:alexm
- refactor: refs #8288 changed invoice out spanish translation by:provira
- refactor: use locale keys by:jorgep
- refactor: use teleport to avoid qdrawer overlapping by:Jon
- refactor: use VnSelectWorker by:Jon
### Fixed 🛠️
- fix: account by:carlossa
- fix: account create by:carlossa
- fix: accountList create by:carlossa
- fix(AccountList): use $refs by:alexm
- fix: add data-key by:alexm
- fix: addLocales by:Jtubau
- fix: dated field by:Jon
- fix: e2e by:jorgep
- fix: fix department filter by:carlossa
- fix: fixed translations by:Javier Segarra
- fix: fixed translations by:provira
- fix: get total from api by:Javier Segarra
- fix: handle non-object options by:jorgep
- fix: monitorPayMethodFilter by:carlossa
- fix: orderBy priority by:Javier Segarra
- fix: prevent null by:jorgep
- fix: redirection vnTable VnTableFilter by:alexm
- fix: refs #6389 fix filter trad by:carlossa
- fix: refs #6389 fix front, filters, itp by:carlossa
- fix: refs #6389 front add packing filter by:carlossa
- fix: refs #6389 front by:carlossa
- fix: refs #6389 front filters by:carlossa
- fix: refs #6389 ipt by:carlossa
- fix: refs #6389 packing by:carlossa
- fix: refs #6583 update checkbox for filtering by destination in TicketAdvanceFilter by:jorgep
- fix: refs #7031 add test e2e by:carlossa
- fix: refs #7031 fix zoneTest by:carlossa
- fix: refs #7301 unnecessary console logs from ItemLastEntries.vue by:pablone
- fix: refs #7936 changes by:jorgep
- fix: refs #7936 decimal places & locale by:jorgep
- fix: refs #7936 descriptor & dueday by:jorgep
- fix: refs #7936 exclude disabled els on tab by:jorgep
- fix: refs #7936 format tax calculation to two decimal places by:jorgep
- fix: refs #7936 improve error handling by:jorgep
- fix: refs #7936 redirection by:jorgep
- fix: refs #7936 rollback by:jorgep
- fix: refs #7936 serial by:jorgep
- fix: refs #7936 tabulation wip by:jorgep
- fix: refs #7936 test by:jorgep
- fix: refs #8114 clean by:carlossa
- fix: refs #8114 fix agencyList by:carlossa
- fix: refs #8114 fix lifeCycle hooks by:carlossa
- fix: refs #8114 fix pr by:carlossa
- fix: refs #8114 fix removeAddress by:carlossa
- fix: refs #8114 orderList by:carlossa
- fix: refs #8114 remove logs by:carlossa
- fix: refs #8197 mapKey (origin/8197-perf_vnTableInside, 8197-perf_vnTableInside) by:alexm
- fix: refs #8197 redirection (8197-perf_redirection) by:alexm
- fix: refs #8197 staticParams and redirect by:alexm
- fix: refs #8197 vnPaginate onFetch emit by:alexm
- fix: refs #8197 vnPaginate when change :id by:alexm
- fix: refs #8197 vnTableFilter in vnTable by:alexm
- fix: refs #8315 ticketBoxing test by:alexm
- fix: remove url by:carlossa
- fix: rollback by:jorgep
- fix: test by:jorgep
- fix(VnDmsList): refs #8197 add mapKey by:alexm
- revert: refs #8197 arrayData changes by:alexm
- test: refs #8197 fix e2e by:alexm
- test: refs #8315 fix claimDevelopment fixtures by:alexm
- test: refs #8315 fix clientList by:alexm
- test: refs #8315 fix VnSelect in e2e by:alexm
# Version 24.50 - 2024-12-10
### Added 🆕

View File

@ -11,6 +11,7 @@ module.exports = defineConfig({
screenshotsFolder: 'test/cypress/screenshots',
supportFile: 'test/cypress/support/index.js',
videosFolder: 'test/cypress/videos',
downloadsFolder: 'test/cypress/downloads',
video: false,
specPattern: 'test/cypress/integration/**/*.spec.js',
experimentalRunAllSpecs: true,

View File

@ -1,6 +1,6 @@
{
"name": "salix-front",
"version": "25.02.0",
"version": "25.04.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",
@ -25,6 +25,7 @@
"axios": "^1.4.0",
"chromium": "^3.0.3",
"croppie": "^2.6.5",
"moment": "^2.30.1",
"pinia": "^2.1.3",
"quasar": "^2.14.5",
"validator": "^13.9.0",

View File

@ -20,6 +20,9 @@ dependencies:
croppie:
specifier: ^2.6.5
version: 2.6.5
moment:
specifier: ^2.30.1
version: 2.30.1
pinia:
specifier: ^2.1.3
version: 2.1.7(typescript@5.5.4)(vue@3.4.19)
@ -832,8 +835,8 @@ packages:
vue-i18n:
optional: true
dependencies:
'@intlify/message-compiler': 10.0.0
'@intlify/shared': 10.0.0
'@intlify/message-compiler': 11.0.0-rc.1
'@intlify/shared': 11.0.0-rc.1
jsonc-eslint-parser: 1.4.1
source-map: 0.6.1
vue-i18n: 9.9.1(vue@3.4.19)
@ -847,11 +850,11 @@ packages:
'@intlify/message-compiler': 9.9.1
'@intlify/shared': 9.9.1
/@intlify/message-compiler@10.0.0:
resolution: {integrity: sha512-OcaWc63NC/9p1cMdgoNKBj4d61BH8sUW1Hfs6YijTd9656ZR4rNqXAlRnBrfS5ABq0vjQjpa8VnyvH9hK49yBw==}
/@intlify/message-compiler@11.0.0-rc.1:
resolution: {integrity: sha512-TGw2uBfuTFTegZf/BHtUQBEKxl7Q/dVGLoqRIdw8lFsp9g/53sYn5iD+0HxIzdYjbWL6BTJMXCPUHp9PxDTRPw==}
engines: {node: '>= 16'}
dependencies:
'@intlify/shared': 10.0.0
'@intlify/shared': 11.0.0-rc.1
source-map-js: 1.0.2
dev: true
@ -862,8 +865,8 @@ packages:
'@intlify/shared': 9.9.1
source-map-js: 1.0.2
/@intlify/shared@10.0.0:
resolution: {integrity: sha512-6ngLfI7DOTew2dcF9WMJx+NnMWghMBhIiHbGg+wRvngpzD5KZJZiJVuzMsUQE1a5YebEmtpTEfUrDp/NqVGdiw==}
/@intlify/shared@11.0.0-rc.1:
resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==}
engines: {node: '>= 16'}
dev: true
@ -887,7 +890,7 @@ packages:
optional: true
dependencies:
'@intlify/bundle-utils': 4.0.0(vue-i18n@9.9.1)
'@intlify/shared': 10.0.0
'@intlify/shared': 11.0.0-rc.1
'@rollup/pluginutils': 4.2.1
'@vue/compiler-sfc': 3.4.19
debug: 4.3.4(supports-color@8.1.1)
@ -4960,6 +4963,10 @@ packages:
uuid: 8.3.2
dev: true
/moment@2.30.1:
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
dev: false
/ms@2.0.0:
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}

View File

@ -55,13 +55,6 @@ async function setCountry(countryFk, data) {
}
// Province
async function handleProvinces(data) {
provincesOptions.value = data;
if (postcodeFormData.countryFk) {
await fetchTowns();
}
}
async function setProvince(id, data) {
if (data.provinceFk === id) return;
const newProvince = provincesOptions.value.find((province) => province.id == id);
@ -69,6 +62,7 @@ async function setProvince(id, data) {
postcodeFormData.provinceFk = id;
await fetchTowns();
}
async function onProvinceCreated(data) {
postcodeFormData.provinceFk = data.id;
}

View File

@ -1,7 +1,7 @@
<script setup>
import axios from 'axios';
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
import { onBeforeRouteLeave, useRouter } from 'vue-router';
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import { useState } from 'src/composables/useState';
@ -12,7 +12,6 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
import VnConfirm from './ui/VnConfirm.vue';
import { tMobile } from 'src/composables/tMobile';
import { useArrayData } from 'src/composables/useArrayData';
import { useRoute } from 'vue-router';
const { push } = useRouter();
const quasar = useQuasar();
@ -199,6 +198,7 @@ async function fetch() {
} catch (e) {
state.set(modelValue, {});
originalData.value = {};
throw e;
}
}

View File

@ -55,6 +55,7 @@ const onDataSaved = (data) => {
v-model.number="data.quantity"
type="number"
autofocus
data-cy="regularizeStockInput"
/>
</VnRow>
<VnRow>

View File

@ -59,8 +59,8 @@ const $props = defineProps({
default: true,
},
bottom: {
type: Object,
default: null,
type: Boolean,
default: false,
},
cardClass: {
type: String,
@ -314,7 +314,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
show-if-above
>
<QScrollArea class="fit">
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" />
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" :redirect="redirect" />
</QScrollArea>
</QDrawer>
<CrudModel
@ -478,29 +478,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
/>
</QTd>
</template>
<template #bottom v-if="bottom">
<slot name="bottom-table">
<QBtn
@click="
() =>
createAsDialog
? (showForm = !showForm)
: handleOnDataSaved(create)
"
class="cursor-pointer fill-icon"
color="primary"
icon="add_circle"
size="md"
round
flat
shortcut="+"
:disabled="!disabledAttr"
/>
<QTooltip>
{{ createForm.title }}
</QTooltip>
</slot>
</template>
<template #item="{ row, colsMap }">
<component
:is="$props.redirect ? 'router-link' : 'span'"
@ -625,6 +602,27 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
</QTr>
</template>
</QTable>
<div class="full-width bottomButton" v-if="bottom">
<QBtn
@click="
() =>
createAsDialog
? (showForm = !showForm)
: handleOnDataSaved(create)
"
class="cursor-pointer fill-icon"
color="primary"
icon="add_circle"
size="md"
round
flat
shortcut="+"
:disabled="!disabledAttr"
/>
<QTooltip>
{{ createForm.title }}
</QTooltip>
</div>
</template>
</CrudModel>
<QPageSticky v-if="$props.create" :offset="[20, 20]" style="z-index: 2">

View File

@ -1,6 +1,5 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
import VnFilter from 'components/VnTable/VnFilter.vue';
@ -11,16 +10,11 @@ defineProps({
type: Array,
required: true,
},
chipLocale: {
type: String,
default: null,
},
searchUrl: {
type: [String, Boolean],
default: 'table',
},
});
const { t } = useI18n();
const tableFilterRef = ref([]);
@ -62,9 +56,9 @@ function columnName(col) {
:columns="columns"
/>
</template>
<template #tags="{ tag, formatFn }" v-if="chipLocale">
<template #tags="{ tag, formatFn, getLocale }">
<div class="q-gutter-x-xs">
<strong>{{ t(`${chipLocale}.${tag.label}`) }}: </strong>
<strong>{{ getLocale(`${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>

View File

@ -0,0 +1,56 @@
import { createWrapper, axios } from 'app/test/vitest/helper';
import EditForm from 'components/EditTableCellValueForm.vue';
import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest';
const fieldA = 'fieldA';
const fieldB = 'fieldB';
describe('EditForm', () => {
let vm;
const mockRows = [
{ id: 1, itemFk: 101 },
{ id: 2, itemFk: 102 },
];
const mockFieldsOptions = [
{ label: 'Field A', field: fieldA, component: 'input', attrs: {} },
{ label: 'Field B', field: fieldB, component: 'date', attrs: {} },
];
const editUrl = '/api/edit';
beforeAll(() => {
vi.spyOn(axios, 'post').mockResolvedValue({ status: 200 });
vm = createWrapper(EditForm, {
props: {
rows: mockRows,
fieldsOptions: mockFieldsOptions,
editUrl,
},
}).vm;
});
afterEach(() => {
vi.clearAllMocks();
});
describe('onSubmit()', () => {
it('should call axios.post with the correct parameters in the payload', async () => {
const selectedField = { field: fieldA, component: 'input', attrs: {} };
const newValue = 'Test Value';
vm.selectedField = selectedField;
vm.newValue = newValue;
await vm.onSubmit();
const payload = axios.post.mock.calls[0][1];
expect(axios.post).toHaveBeenCalledWith(editUrl, expect.any(Object));
expect(payload.field).toEqual(fieldA);
expect(payload.newValue).toEqual(newValue);
expect(payload.lines).toEqual(expect.arrayContaining(mockRows));
expect(vm.isLoading).toEqual(false);
});
});
});

View File

@ -14,6 +14,7 @@ defineProps({
hide-dropdown-icon
focus-on-mount
@update:model-value="promise"
data-cy="vnBtnSelect_select"
/>
</QBtnDropdown>
</template>

View File

@ -2,9 +2,9 @@
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnRow from '../ui/VnRow.vue';
import VnInput from './VnInput.vue';
import FetchData from '../FetchData.vue';
import useNotify from 'src/composables/useNotify';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const props = defineProps({
submitFn: { type: Function, default: () => {} },
@ -70,19 +70,19 @@ defineExpose({ show: () => changePassDialog.value.show() });
</QCardSection>
<QForm ref="form">
<QCardSection>
<VnInput
<VnInputPassword
v-if="props.askOldPass"
:label="t('Old password')"
v-model="passwords.oldPassword"
type="password"
:required="true"
:toggle-visibility="true"
autofocus
/>
<VnInput
<VnInputPassword
:label="t('New password')"
v-model="passwords.newPassword"
type="password"
:required="true"
:toggle-visibility="true"
:info="
t('passwordRequirements', {
length: requirements.length,
@ -95,10 +95,10 @@ defineExpose({ show: () => changePassDialog.value.show() });
autofocus
/>
<VnInput
<VnInputPassword
:label="t('Repeat password')"
v-model="passwords.repeatPassword"
type="password"
:toggle-visibility="true"
/>
</QCardSection>
</QForm>

View File

@ -11,9 +11,9 @@ function getBadgeAttrs(date) {
let timeDiff = today - timeTicket;
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
return { color: 'transparent', 'text-color': 'white' };
if (timeDiff == 0) return { color: 'warning', class: 'black-text-color' };
if (timeDiff < 0) return { color: 'success', class: 'black-text-color' };
return { color: 'transparent', class: 'normal-text-color' };
}
function formatShippedDate(date) {
@ -29,3 +29,11 @@ function formatShippedDate(date) {
{{ formatShippedDate(date) }}
</QBadge>
</template>
<style lang="scss">
.black-text-color {
color: var(--vn-black-text-color);
}
.normal-text-color {
color: var(--vn-text-color);
}
</style>

View File

@ -297,7 +297,7 @@ defineExpose({
ref="dmsRef"
:data-key="$props.model"
:url="$props.model"
:filter="dmsFilter"
:user-filter="dmsFilter"
:order="['dmsFk DESC']"
:auto-load="true"
@on-fetch="setData"

View File

@ -45,6 +45,7 @@ const $props = defineProps({
});
const vnInputRef = ref(null);
const showPassword = ref(false);
const value = computed({
get() {
return $props.modelValue;
@ -134,20 +135,23 @@ const handleInsertMode = (e) => {
hide-bottom-space
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
>
<template v-if="$slots.prepend" #prepend>
<template #prepend>
<slot name="prepend" />
</template>
<template #append>
<QIcon
name="close"
size="xs"
v-if="
:style="{
visibility:
hover &&
value &&
!$attrs.disabled &&
!$attrs.readonly &&
$props.clearable
"
? 'visible'
: 'hidden',
}"
@click="
() => {
value = null;
@ -155,7 +159,7 @@ const handleInsertMode = (e) => {
emit('remove');
}
"
></QIcon>
/>
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
<QIcon v-if="info" name="info">
<QTooltip max-width="350px">
@ -166,18 +170,3 @@ const handleInsertMode = (e) => {
</QInput>
</div>
</template>
<i18n>
en:
inputMin: Must be more than {value}
maxLength: The value exceeds {value} characters
inputMax: Must be less than {value}
es:
inputMin: Debe ser mayor a {value}
maxLength: El valor excede los {value} carácteres
inputMax: Debe ser menor a {value}
</i18n>
<style lang="scss">
.q-field__append {
padding-inline: 0;
}
</style>

View File

@ -1,14 +1,12 @@
<script setup>
import { onMounted, watch, computed, ref, useAttrs } from 'vue';
import { date } from 'quasar';
import { useI18n } from 'vue-i18n';
import VnDate from './VnDate.vue';
import { useRequired } from 'src/composables/useRequired';
const $attrs = useAttrs();
const { isRequired, requiredFieldRule } = useRequired($attrs);
const model = defineModel({ type: [String, Date] });
const { t } = useI18n();
const $props = defineProps({
isOutlined: {

View File

@ -0,0 +1,31 @@
<script setup>
import VnInput from 'src/components/common/VnInput.vue';
import { ref } from 'vue';
const model = defineModel({ type: [Number, String] });
const $props = defineProps({
toggleVisibility: {
type: Boolean,
default: false,
},
});
const showPassword = ref(false);
</script>
<template>
<VnInput
v-bind="{ ...$attrs }"
v-model="model"
:type="
$props.toggleVisibility ? (showPassword ? 'text' : 'password') : $attrs.type
"
>
<template #append v-if="toggleVisibility">
<QIcon
:name="showPassword ? 'visibility_off' : 'visibility'"
class="cursor-pointer"
@click="showPassword = !showPassword"
/>
</template>
</VnInput>
</template>

View File

@ -1,13 +1,11 @@
<script setup>
import { computed, ref, useAttrs } from 'vue';
import { useI18n } from 'vue-i18n';
import { date } from 'quasar';
import VnTime from './VnTime.vue';
import { useRequired } from 'src/composables/useRequired';
const $attrs = useAttrs();
const { isRequired, requiredFieldRule } = useRequired($attrs);
const { t } = useI18n();
const model = defineModel({ type: String });
const props = defineProps({
timeOnly: {

View File

@ -20,16 +20,15 @@ const hasContent = ref();
let observer;
onMounted(() => {
if (teleportRef.value) {
if (!teleportRef.value) return;
const checkContent = () => {
hasContent.value = teleportRef.value.innerHTML.trim() !== '';
hasContent.value = teleportRef.value?.innerHTML?.trim() !== '';
};
observer = new MutationObserver(checkContent);
observer.observe(teleportRef.value, { childList: true, subtree: true });
checkContent();
}
});
</script>

View File

@ -4,11 +4,12 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnTableFilter from '../VnTable/VnTableFilter.vue';
import { onBeforeMount, computed } from 'vue';
import { useArrayData } from 'src/composables/useArrayData';
import { useRoute } from 'vue-router';
const $props = defineProps({
section: {
type: String,
required: true,
default: null,
},
dataKey: {
type: String,
@ -38,14 +39,28 @@ const $props = defineProps({
type: Boolean,
default: true,
},
keepData: {
type: Boolean,
default: true,
},
});
const sectionValue = computed(() => $props.section ?? $props.dataKey);
const route = useRoute();
let arrayData;
const sectionValue = computed(() => $props.section ?? $props.dataKey);
const isMainSection = computed(() => {
const isSame = sectionValue.value == route.name;
if (!isSame && arrayData) {
arrayData.reset(['userParams', 'userFilter']);
}
return isSame;
});
onBeforeMount(() => {
if ($props.dataKey)
arrayData = useArrayData($props.dataKey, {
searchUrl: 'table',
keepData: $props.keepData,
...$props.arrayDataProps,
navigate: $props.redirect,
});
@ -74,6 +89,6 @@ onBeforeMount(() => {
</slot>
</template>
</RightMenu>
<slot name="body" v-if="sectionValue == $route.name" />
<slot name="body" v-if="isMainSection" />
<RouterView v-else />
</template>

View File

@ -113,8 +113,15 @@ const $props = defineProps({
});
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
toRefs($props);
const {
optionLabel,
optionValue,
optionCaption,
optionFilter,
optionFilterValue,
options,
modelValue,
} = toRefs($props);
const myOptions = ref([]);
const myOptionsOriginal = ref([]);
const vnSelectRef = ref();
@ -166,7 +173,11 @@ onMounted(() => {
const arrayDataKey =
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
const arrayData = useArrayData(arrayDataKey, { url: $props.url, searchUrl: false });
const arrayData = useArrayData(arrayDataKey, {
url: $props.url,
searchUrl: false,
mapKey: $attrs['map-key'],
});
function findKeyInOptions() {
if (!$props.options) return;
@ -194,10 +205,10 @@ function filter(val, options) {
}
if (!row) return;
const id = row[$props.optionValue];
const id = String(row[$props.optionValue]);
const optionLabel = String(row[$props.optionLabel]).toLowerCase();
return id == search || optionLabel.includes(search);
return id.includes(search) || optionLabel.includes(search);
});
}
@ -317,6 +328,11 @@ function handleKeyDown(event) {
}
}
}
function getCaption(opt) {
if (optionCaption.value === false) return;
return opt[optionCaption.value] || opt[optionValue.value];
}
</script>
<template>
@ -387,8 +403,8 @@ function handleKeyDown(event) {
<QItemLabel>
{{ opt[optionLabel] }}
</QItemLabel>
<QItemLabel caption v-if="optionCaption !== false">
{{ `#${opt[optionCaption] || opt[optionValue]}` }}
<QItemLabel caption v-if="getCaption(opt)">
{{ `#${getCaption(opt)}` }}
</QItemLabel>
</QItemSection>
</QItem>

View File

@ -51,6 +51,7 @@ const url = computed(() => {
option-value="id"
option-label="nickname"
:fields="['id', 'name', 'nickname', 'code']"
:filter-options="['id', 'name', 'nickname', 'code']"
sort-by="nickname ASC"
>
<template #prepend v-if="$props.hasAvatar">
@ -71,7 +72,7 @@ const url = computed(() => {
{{ scope.opt.nickname }}
</QItemLabel>
<QItemLabel caption v-else>
{{ scope.opt.nickname }}, {{ scope.opt.code }}
#{{ scope.opt.id }}, {{ scope.opt.nickname }}, {{ scope.opt.code }}
</QItemLabel>
</QItemSection>
</QItem>

View File

@ -0,0 +1,95 @@
import { describe, it, expect } from 'vitest';
import VnJsonValue from 'src/components/common/VnJsonValue.vue';
import { createWrapper } from 'app/test/vitest/helper';
const buildComponent = (props) => {
return createWrapper(VnJsonValue, {
props,
}).wrapper;
};
describe('VnJsonValue', () => {
it('renders null value correctly', async () => {
const wrapper = buildComponent({ value: null });
const span = wrapper.find('span');
expect(span.text()).toBe('∅');
expect(span.classes()).toContain('json-null');
});
it('renders boolean true correctly', async () => {
const wrapper = buildComponent({ value: true });
const span = wrapper.find('span');
expect(span.text()).toBe('✓');
expect(span.classes()).toContain('json-true');
});
it('renders boolean false correctly', async () => {
const wrapper = buildComponent({ value: false });
const span = wrapper.find('span');
expect(span.text()).toBe('✗');
expect(span.classes()).toContain('json-false');
});
it('renders a short string correctly', async () => {
const wrapper = buildComponent({ value: 'Hello' });
const span = wrapper.find('span');
expect(span.text()).toBe('Hello');
expect(span.classes()).toContain('json-string');
});
it('renders a long string correctly with ellipsis', async () => {
const longString = 'a'.repeat(600);
const wrapper = buildComponent({ value: longString });
const span = wrapper.find('span');
expect(span.text()).toContain('...');
expect(span.text().length).toBeLessThanOrEqual(515);
expect(span.attributes('title')).toBe(longString);
expect(span.classes()).toContain('json-string');
});
it('renders a number correctly', async () => {
const wrapper = buildComponent({ value: 123.4567 });
const span = wrapper.find('span');
expect(span.text()).toBe('123.457');
expect(span.classes()).toContain('json-number');
});
it('renders an integer correctly', async () => {
const wrapper = buildComponent({ value: 42 });
const span = wrapper.find('span');
expect(span.text()).toBe('42');
expect(span.classes()).toContain('json-number');
});
it('renders a date correctly', async () => {
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.classes()).toContain('json-object');
});
it('renders an object correctly', async () => {
const obj = { key: 'value' };
const wrapper = buildComponent({ value: obj });
const span = wrapper.find('span');
expect(span.text()).toBe(obj.toString());
expect(span.classes()).toContain('json-object');
});
it('renders an array correctly', async () => {
const arr = [1, 2, 3];
const wrapper = buildComponent({ value: arr });
const span = wrapper.find('span');
expect(span.text()).toBe(arr.toString());
expect(span.classes()).toContain('json-object');
});
it('updates value when prop changes', async () => {
const wrapper = buildComponent({ value: true });
await wrapper.setProps({ value: 123 });
const span = wrapper.find('span');
expect(span.text()).toBe('123');
expect(span.classes()).toContain('json-number');
});
});

View File

@ -0,0 +1,107 @@
import { describe, it, expect, vi, beforeAll, afterEach, beforeEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import VnNotes from 'src/components/ui/VnNotes.vue';
describe('VnNotes', () => {
let vm;
let wrapper;
let spyFetch;
let postMock;
let expectedBody;
const mockData= {name: 'Tony', lastName: 'Stark', text: 'Test Note', observationTypeFk: 1};
function generateExpectedBody() {
expectedBody = {...vm.$props.body, ...{ text: vm.newNote.text, observationTypeFk: vm.newNote.observationTypeFk }};
}
async function setTestParams(text, observationType, type){
vm.newNote.text = text;
vm.newNote.observationTypeFk = observationType;
wrapper.setProps({ selectType: type });
}
beforeAll(async () => {
vi.spyOn(axios, 'get').mockReturnValue({ data: [] });
wrapper = createWrapper(VnNotes, {
propsData: {
url: '/test',
body: { name: 'Tony', lastName: 'Stark' },
}
});
wrapper = wrapper.wrapper;
vm = wrapper.vm;
});
beforeEach(() => {
postMock = vi.spyOn(axios, 'post').mockResolvedValue(mockData);
spyFetch = vi.spyOn(vm.vnPaginateRef, 'fetch').mockImplementation(() => vi.fn());
});
afterEach(() => {
vi.clearAllMocks();
expectedBody = {};
});
describe('insert', () => {
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is null', async () => {
await setTestParams( null, null, true );
await vm.insert();
expect(postMock).not.toHaveBeenCalled();
expect(spyFetch).not.toHaveBeenCalled();
});
it('should not call axios.post and vnPaginateRef.fetch if newNote.text is empty', async () => {
await setTestParams( "", null, false );
await vm.insert();
expect(postMock).not.toHaveBeenCalled();
expect(spyFetch).not.toHaveBeenCalled();
});
it('should not call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is true', async () => {
await setTestParams( "Test Note", null, true );
await vm.insert();
expect(postMock).not.toHaveBeenCalled();
expect(spyFetch).not.toHaveBeenCalled();
});
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is missing and selectType is false', async () => {
await setTestParams( "Test Note", null, false );
generateExpectedBody();
await vm.insert();
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
expect(spyFetch).toHaveBeenCalled();
});
it('should call axios.post and vnPaginateRef.fetch if observationTypeFk is setted and selectType is false', async () => {
await setTestParams( "Test Note", 1, false );
generateExpectedBody();
await vm.insert();
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
expect(spyFetch).toHaveBeenCalled();
});
it('should call axios.post and vnPaginateRef.fetch when newNote is valid', async () => {
await setTestParams( "Test Note", 1, true );
generateExpectedBody();
await vm.insert();
expect(postMock).toHaveBeenCalledWith(vm.$props.url, expectedBody);
expect(spyFetch).toHaveBeenCalled();
});
});
});

View File

@ -190,7 +190,7 @@ const getLocale = (label) => {
const globalLocale = `globals.params.${param}`;
if (te(globalLocale)) return t(globalLocale);
else if (te(t(`params.${param}`)));
else return t(`${route.meta.moduleName}.params.${param}`);
else return t(`${route.meta.moduleName.toLowerCase()}.params.${param}`);
};
</script>
@ -202,7 +202,11 @@ const getLocale = (label) => {
style="position: fixed; z-index: 1; right: 0; bottom: 0"
icon="search"
@click="search()"
></QBtn>
>
<QTooltip bottom anchor="bottom right">
{{ t('globals.search') }}
</QTooltip>
</QBtn>
<QForm @submit="search" id="filterPanelForm" @keyup.enter="search()">
<QList dense>
<QItem class="q-mt-xs">

View File

@ -110,7 +110,7 @@ onBeforeRouteLeave((to, from, next) => {
:url="$props.url"
order="created DESC"
:limit="0"
:filter="$props.filter"
:user-filter="$props.filter"
auto-load
ref="vnPaginateRef"
class="show"

View File

@ -111,6 +111,7 @@ onMounted(async () => {
});
onBeforeUnmount(() => {
if (!store.keepData) arrayData.reset(['data']);
arrayData.resetPagination();
});

View File

@ -1,14 +1,16 @@
<script setup>
import { onMounted, ref, watch } from 'vue';
import { onMounted, ref, computed, watch } from 'vue';
import { useQuasar } from 'quasar';
import { useArrayData } from 'composables/useArrayData';
import VnInput from 'src/components/common/VnInput.vue';
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'src/stores/useStateStore';
import { useRoute } from 'vue-router';
const quasar = useQuasar();
const { t } = useI18n();
const state = useStateStore();
const route = useRoute();
const props = defineProps({
dataKey: {
@ -83,6 +85,17 @@ if (props.redirect)
};
let arrayData = useArrayData(props.dataKey, arrayDataProps);
let store = arrayData.store;
const to = computed(() => {
const url = { path: route.path, query: { ...(route.query ?? {}) } };
const searchUrl = arrayData.store.searchUrl;
const currentFilter = {
...arrayData.store.currentFilter,
search: searchText.value || undefined,
};
if (searchUrl) url.query[searchUrl] = JSON.stringify(currentFilter);
return url;
});
watch(
() => props.dataKey,
@ -126,28 +139,38 @@ async function search() {
delete filter.params.search;
}
await arrayData.applyFilter(filter);
searchText.value = undefined;
}
</script>
<template>
<Teleport to="#searchbar" v-if="state.isHeaderMounted()">
<QForm @submit="search" id="searchbarForm">
<VnInput
id="searchbar"
v-model.trim="searchText"
:placeholder="t(props.label)"
dense
standout
autofocus
data-cy="vnSearchBar"
<RouterLink
:to="to"
@click="
!$event.shiftKey && !$event.ctrlKey && search();
$refs.input.focus();
"
>
<template #prepend>
<QIcon
v-if="!quasar.platform.is.mobile"
class="cursor-pointer"
name="search"
@click="search"
/>
</template>
size="sm"
>
<QTooltip>{{ t('link') }}</QTooltip>
</QIcon>
</RouterLink>
<VnInput
id="searchbar"
ref="input"
v-model.trim="searchText"
:placeholder="t(props.label)"
dense
autofocus
data-cy="vn-searchbar"
borderless
>
<template #append>
<QIcon
v-if="props.info && $q.screen.gt.xs"
@ -172,20 +195,52 @@ async function search() {
.q-field {
transition: width 0.36s;
}
</style>
<style lang="scss">
:deep(.q-field__native) {
padding-top: 10px;
padding-left: 5px;
}
:deep(.q-field--dark .q-field__native:focus) {
color: black;
}
:deep(.q-field--focused) {
.q-icon {
color: black;
}
}
.cursor-info {
cursor: help;
}
#searchbar {
.q-field--standout.q-field--highlighted .q-field__control {
.q-form {
display: flex;
align-items: center;
border-radius: 4px;
padding: 0 5px;
background-color: var(--vn-search-color);
&:hover {
background-color: var(--vn-search-color-hover);
}
&:focus-within {
background-color: white;
color: black;
.q-field__native,
.q-icon {
color: black !important;
color: black;
}
}
}
.q-icon {
color: var(--vn-label-color);
}
</style>
<i18n>
en:
link: click to search, ctrl + click to open in a new tab, shift + click to open in a new window
es:
link: clic para buscar, ctrl + clic para abrir en una nueva pestaña, shift + clic para abrir en una nueva ventana
</i18n>

View File

@ -54,6 +54,7 @@ function formatNumber(number) {
:offset="100"
:limit="5"
auto-load
map-key="smsFk"
>
<template #body="{ rows }">
<QCard

View File

@ -0,0 +1,81 @@
import { describe, expect, it } from 'vitest';
import { createWrapper } from 'app/test/vitest/helper';
import FetchedTags from 'src/components/ui/FetchedTags.vue';
describe('tags computed property', () => {
it('returns an object with the correct keys and values', () => {
const vm = createWrapper(FetchedTags, {
props: {
item: {
tag1: 'JavaScript',
value1: 'Programming Language',
tag2: 'Vue',
value2: 'Framework',
tag3: 'EmptyTag',
},
tag: 'tag',
value: 'value',
columns: 2,
},
}).vm;
expect(vm.tags).toEqual({
JavaScript: 'Programming Language',
Vue: 'Framework',
EmptyTag: '',
});
});
it('returns an empty object if the item prop is an empty object', () => {
const vm = createWrapper(FetchedTags, {
props: {
item: {},
tag: 'tag',
value: 'value',
},
}).vm;
expect(vm.tags).toEqual({});
});
it('should calculate the correct columnStyle when columns prop is defined', () => {
const vm = createWrapper(FetchedTags, {
props: {
item: {
tag1: 'JavaScript',
value1: 'Programming Language',
tag2: 'Vue',
value2: 'Framework',
tag3: 'EmptyTag',
},
tag: 'tag',
value: 'value',
columns: 2,
},
}).vm;
const expectedStyle = {
'grid-template-columns': 'repeat(2, 1fr)',
'max-width': '8rem',
};
expect(vm.columnStyle).toEqual(expectedStyle);
});
it('should return an empty object for columnStyle when columns prop is not defined', () => {
const vm = createWrapper(FetchedTags, {
props: {
item: {
tag1: 'JavaScript',
value1: 'Programming Language',
tag2: 'Vue',
value2: 'Framework',
tag3: 'EmptyTag',
},
tag: 'tag',
value: 'value',
columns: null,
},
}).vm;
expect(vm.columnStyle).toEqual({});
});
});

View File

@ -53,6 +53,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
'searchUrl',
'navigate',
'mapKey',
'keepData',
];
if (typeof userOptions === 'object') {
for (const option in userOptions) {
@ -75,26 +76,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
cancelRequest();
canceller = new AbortController();
const filter = {
limit: store.limit,
};
let userParams = { ...store.userParams };
Object.assign(filter, store.userFilter);
let where;
if (filter?.where || store.filter?.where)
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
Object.assign(filter, store.filter);
filter.where = where;
const params = { filter };
Object.assign(params, userParams);
if (params.filter) params.filter.skip = store.skip;
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
if (store.order?.length) params.filter.order = [...store.order];
else delete params.filter.order;
const { params, limit } = getCurrentFilter();
store.currentFilter = JSON.parse(JSON.stringify(params));
delete store.currentFilter.filter.include;
@ -120,15 +102,16 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
params,
});
const { limit } = filter;
store.hasMoreData = limit && response.data.length >= limit;
processData(response.data, { map: !!store.mapKey, append });
if (!append && !isDialogOpened()) updateRouter && updateStateParams();
if (!append && !isDialogOpened() && updateRouter) {
if (updateStateParams(response.data)?.redirect) return;
}
store.isLoading = false;
canceller = null;
processData(response.data, { map: !!store.mapKey, append });
return response;
}
@ -258,7 +241,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
if (Object.values(store.userParams).length) await fetch({});
}
function updateStateParams() {
function updateStateParams(data) {
if (!route?.path) return;
const newUrl = { path: route.path, query: { ...(route.query ?? {}) } };
if (store?.searchUrl)
@ -275,21 +258,46 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
const { path } = matches.at(-1);
const to =
store?.data?.length === 1
? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
data?.length === 1
? path.replace(/\/(list|:id)|-list/, `/${data[0].id}`)
: path.replace(/:id.*/, '');
if (route.path != to) {
const pushUrl = { path: to };
if (to.endsWith('/list') || to.endsWith('/'))
pushUrl.query = newUrl.query;
return router.push(pushUrl);
return router.push(pushUrl) && { redirect: true };
}
}
router.replace(newUrl);
}
function getCurrentFilter() {
const filter = {
limit: store.limit,
};
let userParams = { ...store.userParams };
Object.assign(filter, store.userFilter);
let where;
if (filter?.where || store.filter?.where)
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
Object.assign(filter, store.filter);
filter.where = where;
const params = { filter };
Object.assign(params, userParams);
if (params.filter) params.filter.skip = store.skip;
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
if (store.order?.length) params.filter.order = [...store.order];
else delete params.filter.order;
return { filter, params, limit: filter.limit };
}
function processData(data, { map = true, append = true }) {
if (!append) {
store.data = [];
@ -302,7 +310,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
for (const row of data) {
const key = row[store.mapKey];
const val = { ...row, key };
if (store.map.has(key)) {
if (key && store.map.has(key)) {
const { position } = store.map.get(key);
val.position = position;
store.map.set(key, val);
@ -322,6 +330,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
fetch,
applyFilter,
addFilter,
getCurrentFilter,
addFilterWhere,
addOrder,
deleteOrder,

View File

@ -3,20 +3,23 @@
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.sass';
body.body--light {
--font-color: black;
--vn-header-color: #cecece;
--vn-page-color: #ffffff;
--vn-section-color: #e0e0e0;
--vn-section-hover-color: #b9b9b9;
--vn-text-color: var(--font-color);
--vn-text-color: black;
--vn-label-color: #5f5f5f;
--vn-accent-color: #e7e3e3;
--vn-search-color: #d4d4d4;
--vn-search-color-hover: #cfcfcf;
--vn-empty-tag: #acacac;
--vn-black-text-color: black;
--vn-text-color-contrast: white;
background-color: var(--vn-page-color);
.q-header .q-toolbar {
color: var(--font-color);
color: var(--vn-text-color);
}
}
body.body--dark {
@ -27,7 +30,11 @@ body.body--dark {
--vn-text-color: white;
--vn-label-color: #a8a8a8;
--vn-accent-color: #424242;
--vn-search-color: #4b4b4b;
--vn-search-color-hover: #5b5b5b;
--vn-empty-tag: #2d2d2d;
--vn-black-text-color: black;
--vn-text-color-contrast: black;
background-color: var(--vn-page-color);
}
@ -86,6 +93,10 @@ select:-webkit-autofill {
background-color: var(--vn-section-hover-color);
}
.bg-vn-page {
background-color: var(--vn-page-color);
}
.color-vn-label {
color: var(--vn-label-color);
}
@ -151,7 +162,8 @@ select:-webkit-autofill {
.q-card,
.q-table,
.q-table__bottom,
.q-drawer {
.q-drawer,
.bottomButton {
background-color: var(--vn-section-color);
}
@ -188,7 +200,7 @@ select:-webkit-autofill {
.q-tooltip {
background-color: var(--vn-page-color);
color: var(--font-color);
color: var(--vn-text-color);
font-size: medium;
}

View File

@ -1,5 +1,6 @@
export default function toDateHourMin(date) {
const dateHour = new Date(date).toLocaleDateString('es-ES', {
if (!date) return date;
return new Date(date).toLocaleDateString('es-ES', {
timeZone: 'Europe/Madrid',
year: 'numeric',
month: '2-digit',
@ -7,5 +8,4 @@ export default function toDateHourMin(date) {
hour: '2-digit',
minute: '2-digit',
});
return dateHour;
}

View File

@ -1,5 +1,6 @@
export default function toDateHourMinSec(date) {
const dateHour = new Date(date).toLocaleDateString('es-ES', {
if (!date) return date;
return new Date(date).toLocaleDateString('es-ES', {
timeZone: 'Europe/Madrid',
year: 'numeric',
month: '2-digit',
@ -8,5 +9,4 @@ export default function toDateHourMinSec(date) {
minute: '2-digit',
second: '2-digit',
});
return dateHour;
}

View File

@ -455,7 +455,26 @@ entry:
packingOut: Package out
landing: Landing
isExcludedFromAvailable: Es inventory
params:
toShipped: To
fromShipped: From
warehouseiNFk: Warehouse
daysOnward: Days onward
daysAgo: Days ago
warehouseInFk: Warehouse in
ticket:
params:
ticketFk: Ticket ID
weekDay: Weekday
agencyModeFk: Agency
id: Worker
state: State
created: Created
externalId: External ID
counter: Counter
freightItemName: Freight item name
packageItemName: Package item name
longName: Long name
card:
customerId: Customer ID
customerCard: Customer card
@ -506,6 +525,7 @@ invoiceOut:
card:
issued: Issued
customerCard: Customer card
ticketList: Ticket List
summary:
issued: Issued
dued: Due
@ -611,7 +631,7 @@ worker:
fi: DNI/NIE/NIF
birth: Birth
isFreelance: Freelance
isSsDiscounted: Bonificación SS
isSsDiscounted: SS Bonification
hasMachineryAuthorized: Machinery authorized
isDisable: Disable
notificationsManager:
@ -697,6 +717,11 @@ wagon:
minHeightBetweenTrays: 'The minimum height between trays is '
maxWagonHeight: 'The maximum height of the wagon is '
uncompleteTrays: There are incomplete trays
params:
label: Label
plate: Plate
volume: Volume
name: Name
supplier:
list:
@ -857,11 +882,11 @@ components:
value: Value
# ItemFixedPriceFilter
buyerFk: Buyer
warehouseFk: Warehouse
started: From
ended: To
mine: For me
hasMinPrice: Minimum price
warehouseFk: Warehouse
# LatestBuysFilter
salesPersonFk: Buyer
from: From

View File

@ -456,7 +456,25 @@ entry:
packingOut: Embalaje envíos
landing: Llegada
isExcludedFromAvailable: Es inventario
params:
toShipped: Hasta
fromShipped: Desde
warehouseInFk: Alm. entrada
daysOnward: Días adelante
daysAgo: Días atras
ticket:
params:
ticketFk: ID de ticket
weekDay: Salida
agencyModeFk: Agencia
id: Comercial
created: Creado
state: Estado
externalId: ID externo
counter: Contador
freightItemName: Nombre
packageItemName: Embalaje
longName: Descripción
card:
customerId: ID cliente
customerCard: Ficha del cliente
@ -608,6 +626,15 @@ worker:
role: Rol
sipExtension: Extensión
locker: Taquilla
fiDueDate: F. caducidad DNI
sex: Sexo
seniority: Antigüedad
fi: DNI/NIE/NIF
birth: F. nacimiento
isFreelance: Autónomo
isSsDiscounted: Bonificación SS
hasMachineryAuthorized: Autorizado para maquinaria
isDisable: Deshabilitado
notificationsManager:
activeNotifications: Notificaciones activas
availableNotifications: Notificaciones disponibles
@ -691,6 +718,11 @@ wagon:
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
maxWagonHeight: 'La altura máxima del vagón es '
uncompleteTrays: Hay bandejas sin completar
params:
label: Etiqueta
plate: Matrícula
volume: Volumen
name: Nombre
supplier:
list:
payMethod: Método de pago
@ -849,6 +881,7 @@ components:
value: Valor
# ItemFixedPriceFilter
buyerFk: Comprador
warehouseFk: Almacen
started: Desde
ended: Hasta
mine: Para mi

View File

@ -6,6 +6,7 @@ import FormModelPopup from 'components/FormModelPopup.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const { t } = useI18n();
const router = useRouter();
@ -61,10 +62,10 @@ const redirectToAccountBasicData = (_, { id }) => {
hide-selected
:rules="validate('VnUser.roleFk')"
/>
<VnInput
<VnInputPassword
v-model="data.password"
:label="t('ldap.password')"
type="password"
:toggle-visibility="true"
:rules="validate('VnUser.password')"
/>
<QCheckbox

View File

@ -8,6 +8,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useArrayData } from 'src/composables/useArrayData';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const { t } = useI18n();
const { notify } = useNotify();
@ -128,10 +129,9 @@ onMounted(async () => await getInitialLdapConfig());
:required="true"
:rules="validate('LdapConfig.rdn')"
/>
<VnInput
<VnInputPassword
:label="t('ldap.password')"
clearable
type="password"
v-model="data.password"
:required="true"
:rules="validate('LdapConfig.password')"

View File

@ -4,9 +4,9 @@ import { computed, ref } from 'vue';
import VnTable from 'components/VnTable/VnTable.vue';
import AccountSummary from './Card/AccountSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnInput from 'src/components/common/VnInput.vue';
import VnSection from 'src/components/common/VnSection.vue';
import FetchData from 'src/components/FetchData.vue';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
@ -168,10 +168,9 @@ function exprBuilder(param, value) {
>
<template #more-create-dialog="{ data }">
<QCardSection>
<VnInput
<VnInputPassword
:label="t('Password')"
v-model="data.password"
type="password"
:required="true"
autocomplete="new-password"
/>

View File

@ -8,6 +8,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useArrayData } from 'src/composables/useArrayData';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const { t } = useI18n();
const { notify } = useNotify();
@ -143,10 +144,9 @@ onMounted(async () => await getInitialSambaConfig());
v-model="data.adUser"
:rules="validate('SambaConfigs.adUser')"
/>
<VnInput
<VnInputPassword
:label="t('samba.passwordAD')"
clearable
type="password"
v-model="data.adPassword"
/>
<VnInput

View File

@ -9,6 +9,7 @@ import { useArrayData } from 'src/composables/useArrayData';
import VnConfirm from 'src/components/ui/VnConfirm.vue';
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
import { useQuasar } from 'quasar';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const $props = defineProps({
hasAccount: {
@ -97,14 +98,13 @@ async function sync() {
<QTooltip>{{ t('account.card.actions.sync.tooltip') }}</QTooltip>
</QIcon></QCheckbox
>
<QInput
<VnInputPassword
v-if="shouldSyncPassword"
:label="t('login.password')"
v-model="syncPassword"
class="full-width"
clearable
clear-icon="close"
type="password"
/>
</template>
</VnConfirm>

View File

@ -50,7 +50,7 @@ const removeRole = async () => {
>
<template #menu>
<QItem v-ripple clickable @click="removeRole()">
<QItemSection>{{ t('Delete') }}</QItemSection>
<QItemSection>{{ t('globals.delete') }}</QItemSection>
</QItem>
</template>
<template #body="{ entity }">

View File

@ -1,4 +1,18 @@
account:
params:
id: Id
name: Name
roleFk: Role
nickname: Nickname
password: Password
active: Active
search: Id
description: Description
alias: Alias
model: Model
principalId: Role
property: Property
accessType: Access
card:
nickname: User
role: Role

View File

@ -1,4 +1,20 @@
accessType: Acceso
property: Propiedad
account:
params:
id: Id
name: Nombre
roleFk: Rol
nickname: Nickname
password: Contraseña
active: Activo
search: Id
description: Descripción
alias: Alias
model: Modelo
principalId: Rol
property: Propiedad
accessType: Acceso
card:
nickname: Usuario
role: Rol

View File

@ -93,16 +93,7 @@ defineExpose({ states });
outlined
rounded
dense
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
<QItemLabel caption>{{ scope.opt?.name }}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
<VnSelect
:label="t('claim.responsible')"
v-model="params.claimResponsibleFk"

View File

@ -84,6 +84,7 @@ const columns = computed(() => [
label: t('Creation date'),
format: ({ created }) => toDateHourMin(created),
cardVisible: true,
style: 'color: var(--vn-label-color)',
},
{
align: 'left',

View File

@ -2,7 +2,7 @@
import { ref, computed, onBeforeMount } from 'vue';
import axios from 'axios';
import { useI18n } from 'vue-i18n';
import { toDate } from 'src/filters/index';
import { dateRange, toDate } from 'src/filters/index';
import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue';
@ -104,18 +104,12 @@ function getParams() {
};
}
const userParams = computed(() => {
const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0);
minDate.setMonth(minDate.getMonth() - 2);
const maxDate = Date.vnNew();
maxDate.setHours(23, 59, 59, 59);
return {
campaign: campaignList.value[0]?.id,
from: minDate,
to: maxDate,
const campaign = campaignList.value[0]?.id;
const userParams = {
campaign,
...updateDateParams(campaign, { from: Date.vnNew(), to: Date.vnNew() }),
};
return userParams;
});
const openReportPdf = () => {
openReport(`Clients/${route.params.id}/campaign-metrics-pdf`, getParams());
@ -134,6 +128,23 @@ const sendCampaignMetricsEmail = ({ address }) => {
...getParams(),
});
};
const updateDateParams = (value, params) => {
if (!value) {
params.from = null;
params.to = null;
return;
}
const campaign = campaignList.value.find((c) => c.id === value);
if (!campaign) return;
const { dated, previousDays, scopeDays } = campaign;
const _date = new Date(dated);
const [from, to] = dateRange(_date);
params.from = new Date(from.setDate(from.getDate() - previousDays)).toISOString();
params.to = new Date(to.setDate(to.getDate() + scopeDays)).toISOString();
return params;
};
</script>
<template>
@ -144,7 +155,6 @@ const sendCampaignMetricsEmail = ({ address }) => {
:order="['itemTypeFk', 'itemName', 'itemSize', 'description']"
:columns="columns"
search-url="consumption"
:filter="filter"
:user-params="userParams"
:default-remove="false"
:default-reset="false"
@ -201,6 +211,7 @@ const sendCampaignMetricsEmail = ({ address }) => {
class="q-px-sm q-pt-none fit"
dense
option-label="code"
@update:model-value="(data) => updateDateParams(data, params)"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -63,9 +63,10 @@ const columns = computed(() => [
<template>
<QPage class="column items-center q-pa-md">
<VnTable
data-key="Mandates"
url="Mandates"
:filter="filter"
auto-load
url="Mandates"
:columns="columns"
class="full-width q-mt-md"
:right-search="false"

View File

@ -173,6 +173,8 @@ en:
phone: Phone
email: Email
zoneFk: Zone
socialName : Social name
name: Name
postcode: Postcode
es:
params:
@ -184,6 +186,8 @@ es:
phone: Teléfono
email: Email
zoneFk: Zona
socialName : Razón social
name: Nombre
postcode: CP
FI: NIF
Salesperson: Comercial

View File

@ -240,6 +240,7 @@ es:
defaulterSinced: Desde
Client: Cliente
Salesperson: Comercial
Departments: Departamentos
Country: País
P. Method: F. Pago
Balance D.: Saldo V.

View File

@ -94,3 +94,24 @@ customer:
hasToInvoiceByAddress: Invoice by address
isToBeMailed: Mailing
hasSepaVnl: VNL B2B received
params:
id: Id
isWorker: Is Worker
payMethod: Payment Method
workerFk: Author
observation: Last Observation
created: Last Update Date
creditInsurance: Credit Insurance
defaulterSinced: Defaulted Since
hasRecovery: Has Recovery
socialName: Social name
city: City
phone: Phone
postcode: Postcode
campaign: Campaign
grouped: Grouped
search: Contains
itemId: Item Id
ticketFk: Ticket Id
description: Description
quantity: Quantity

View File

@ -96,3 +96,24 @@ customer:
hasToInvoiceByAddress: Factura por consigna
isToBeMailed: Env. emails
hasSepaVnl: Recibido B2B VNL
params:
id: ID
isWorker: Es trabajador
payMethod: F. Pago
workerFk: Autor
observation: Última observación
created: Fecha Ú. O.
creditInsurance: Crédito A.
defaulterSinced: Desde
hasRecovery: Tiene recobro
socialName: Razón social
campaign: Campaña
city: Ciudad
phone: Teléfono
postcode: Código postal
grouped: Agrupado
search: Contiene
itemId: Id Artículo
ticketFk: Id Ticket
description: Descripción
quantity: Cantidad

View File

@ -1,9 +1,9 @@
<script setup>
import VnCard from 'components/common/VnCard.vue';
import VnCardBeta from 'components/common/VnCardBeta.vue';
import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue';
</script>
<template>
<VnCard
<VnCardBeta
class="q-pa-md column items-center"
v-bind="{ ...$attrs }"
data-key="Department"

View File

@ -83,7 +83,11 @@ const { openConfirmationModal } = useVnConfirm();
</template>
<template #body="{ entity }">
<VnLv :label="t('department.chat')" :value="entity.chatName" />
<VnLv :label="t('globals.email')" :value="entity.notificationEmail" copy />
<VnLv
:label="t('globals.params.email')"
:value="entity.notificationEmail"
copy
/>
<VnLv
:label="t('department.selfConsumptionCustomer')"
:value="entity.client?.name"

View File

@ -40,7 +40,7 @@ onMounted(async () => {
<template #body="{ entity: department }">
<QCard class="column">
<VnTitle
:url="`#/department/department/${entityId}/basic-data`"
:url="`#/worker/department/${entityId}/basic-data`"
:text="t('Basic data')"
/>
<div class="full-width row wrap justify-between content-between">
@ -58,7 +58,7 @@ onMounted(async () => {
dash
/>
<VnLv
:label="t('globals.email')"
:label="t('globals.params.email')"
:value="department.notificationEmail"
dash
/>

View File

@ -74,8 +74,8 @@ const showEntryReport = () => {
</template>
<template #body="{ entity }">
<VnLv :label="t('globals.agency')" :value="entity.travel?.agency?.name" />
<VnLv :label="t('shipped')" :value="toDate(entity.travel?.shipped)" />
<VnLv :label="t('landed')" :value="toDate(entity.travel?.landed)" />
<VnLv :label="t('globals.shipped')" :value="toDate(entity.travel?.shipped)" />
<VnLv :label="t('globals.landed')" :value="toDate(entity.travel?.landed)" />
<VnLv
:label="t('globals.warehouseOut')"
:value="entity.travel?.warehouseOut?.name"

View File

@ -12,6 +12,8 @@ import { getUrl } from 'src/composables/getUrl';
import axios from 'axios';
import FetchedTags from 'src/components/ui/FetchedTags.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
import VnRow from 'src/components/ui/VnRow.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const route = useRoute();
const { t } = useI18n();
@ -149,7 +151,6 @@ async function setEntryData(data) {
const fetchEntryBuys = async () => {
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
if (data) entryBuys.value = data;
};
</script>
@ -173,13 +174,10 @@ const fetchEntryBuys = async () => {
</template>
<template #body>
<QCard class="vn-one">
<router-link
:to="{ name: 'EntryBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" />
</router-link>
<VnTitle
:url="`#/entry/${entityId}/basic-data`"
:text="t('globals.summary.basicData')"
/>
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
<VnLv
:label="t('entry.summary.currency')"
@ -193,13 +191,10 @@ const fetchEntryBuys = async () => {
/>
</QCard>
<QCard class="vn-one">
<router-link
:to="{ name: 'EntryBasicData', params: { id: entityId } }"
class="header header-link"
>
{{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" />
</router-link>
<VnTitle
:url="`#/entry/${entityId}/basic-data`"
:text="t('globals.summary.basicData')"
/>
<VnLv :label="t('entry.summary.travelReference')">
<template #value>
<span class="link">
@ -212,61 +207,42 @@ const fetchEntryBuys = async () => {
:label="t('entry.summary.travelAgency')"
:value="entry.travel.agency?.name"
/>
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
<VnLv :label="t('globals.shipped')" :value="toDate(entry.travel.shipped)" />
<VnLv
:label="t('globals.warehouseOut')"
:value="entry.travel.warehouseOut?.name"
/>
<QCheckbox
<VnLv
:label="t('entry.summary.travelDelivered')"
v-model="entry.travel.isDelivered"
:disable="true"
:value="entry.travel.isDelivered"
/>
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
<VnLv :label="t('globals.landed')" :value="toDate(entry.travel.landed)" />
<VnLv
:label="t('globals.warehouseIn')"
:value="entry.travel.warehouseIn?.name"
/>
<QCheckbox
<VnLv
:label="t('entry.summary.travelReceived')"
v-model="entry.travel.isReceived"
:disable="true"
:value="entry.travel.isReceived"
/>
</QCard>
<QCard class="vn-one">
<router-link
:to="{ name: 'TravelSummary', params: { id: entry.travel.id } }"
class="header header-link"
>
{{ t('Travel data') }}
<QIcon name="open_in_new" />
</router-link>
<QCheckbox
:label="t('entry.summary.ordered')"
v-model="entry.isOrdered"
:disable="true"
/>
<QCheckbox
:label="t('globals.confirmed')"
v-model="entry.isConfirmed"
:disable="true"
/>
<QCheckbox
:label="t('entry.summary.booked')"
v-model="entry.isBooked"
:disable="true"
/>
<QCheckbox
<VnTitle :url="`#/travel/${entityId}/summary`" :text="t('Travel data')" />
<VnRow class="block">
<VnLv :label="t('entry.summary.ordered')" :value="entry.isOrdered" />
<VnLv :label="t('globals.confirmed')" :value="entry.isConfirmed" />
<VnLv :label="t('entry.summary.booked')" :value="entry.isBooked" />
<VnLv
:label="t('entry.summary.excludedFromAvailable')"
v-model="entry.isExcludedFromAvailable"
:disable="true"
:value="entry.isExcludedFromAvailable"
/>
</VnRow>
</QCard>
<QCard class="vn-two" style="min-width: 100%">
<a class="header header-link">
{{ t('entry.summary.buys') }}
<QIcon name="open_in_new" />
</a>
<QCard class="vn-max">
<VnTitle
:url="`#/entry/${entityId}/buys`"
:text="t('entry.summary.buys')"
/>
<QTable
:rows="entryBuys"
:columns="entriesTableColumns"

View File

@ -1,24 +1,24 @@
<script setup>
import { computed } from 'vue';
import { computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { QBtn } from 'quasar';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import { usePrintService } from 'composables/usePrintService';
const { openReport } = usePrintService();
const { openReport } = usePrintService();
const buyRows = ref([]);
const route = useRoute();
const { t } = useI18n();
const $props = defineProps({
id: {
type: String,
type: Number,
required: false,
default: null,
},
});
const entityId = computed(() => $props.id || route.params.id);
const entriesTableColumns = computed(() => [
{
align: 'left',
@ -63,34 +63,39 @@ const entriesTableColumns = computed(() => [
field: 'grouping',
},
]);
</script>
function downloadCSV(rows) {
const headers = ['id', 'itemFk', 'name', 'stickers', 'packing', 'comment'];
const csvRows = rows.map((row) => {
const buy = row;
const item = buy.item || {};
return [
buy.id,
buy.itemFk,
item.name || '',
buy.stickers,
buy.packing,
item.comment || '',
].join(',');
});
const csvContent = [headers.join(','), ...csvRows].join('\n');
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `${entityId.value}data.csv`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
</script>
<template>
<QDialog ref="dialogRef">
<QCard style="min-width: 800px">
<QCardSection class="row items-center q-pb-none">
<QAvatar
:icon="icon"
color="primary"
text-color="white"
size="xl"
v-if="icon"
/>
<span class="text-h6 text-grey">{{ title }}</span>
<QSpace />
<QBtn icon="close" :disable="isLoading" flat round dense v-close-popup />
</QCardSection>
<QCardActions align="right">
<QBtn
:label="t('myEntries.printLabels')"
color="primary"
icon="print"
:loading="isLoading"
@click="openReport(`Entries/${entityId}/labelSupplier`)"
unelevated
autofocus
/>
</QCardActions>
<QCardSection class="row items-center">
<VnPaginate
ref="entryBuysPaginateRef"
@ -101,6 +106,7 @@ const entriesTableColumns = computed(() => [
>
<template #body="{ rows }">
<QTable
ref="buyRows"
:rows="rows"
:columns="entriesTableColumns"
row-key="id"
@ -110,6 +116,26 @@ const entriesTableColumns = computed(() => [
:grid="$q.screen.lt.md"
:no-data-label="t('globals.noResults')"
>
<template #top-left>
<QBtn
:label="t('myEntries.downloadCsv')"
color="primary"
icon="csv"
@click="downloadCSV(rows)"
unelevated
/>
</template>
<template #top-right>
<QBtn
class="q-mr-lg"
:label="t('myEntries.printLabels')"
color="primary"
icon="print"
@click="
openReport(`Entries/${entityId}/labelSupplier`)
"
/>
</template>
<template #body="props">
<QTr>
<QTd v-for="col in props.cols" :key="col.name">
@ -118,7 +144,6 @@ const entriesTableColumns = computed(() => [
<QBtn
icon="visibility"
v-if="props.row.stickers > 0"
:loading="isLoading"
@click="
openReport(
`Entries/${props.row.id}/buy-label-supplier`

View File

@ -123,6 +123,7 @@ const companiesOptions = ref([]);
option-value="id"
option-label="name"
:fields="['id', 'name', 'nickname']"
:filter-options="['id', 'name', 'nickname']"
sort-by="nickname"
hide-selected
dense
@ -132,9 +133,12 @@ const companiesOptions = ref([]);
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt?.name + ': ' + scope.opt?.nickname
}}</QItemLabel>
<QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>

View File

@ -58,7 +58,7 @@ const tagValues = ref([]);
<QItem class="q-my-md">
<QItemSection>
<VnSelect
:label="t('components.itemsFilterPanel.supplierFk')"
:label="t('globals.params.supplierFk')"
v-model="params.supplierFk"
:options="suppliersOptions"
option-value="id"
@ -69,12 +69,14 @@ const tagValues = ref([]);
use-input
@update:model-value="searchFn()"
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption>
{{ opt.nickname }}
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection>
</QItem>
@ -85,7 +87,7 @@ const tagValues = ref([]);
<QItem class="q-my-md">
<QItemSection>
<VnInputDate
:label="t('components.itemsFilterPanel.from')"
:label="t('components.itemsFilterPanel.started')"
v-model="params.from"
is-outlined
@update:model-value="searchFn()"
@ -95,7 +97,7 @@ const tagValues = ref([]);
<QItem class="q-my-md">
<QItemSection>
<VnInputDate
:label="t('components.itemsFilterPanel.to')"
:label="t('components.itemsFilterPanel.ended')"
v-model="params.to"
is-outlined
@update:model-value="searchFn()"
@ -113,7 +115,7 @@ const tagValues = ref([]);
</QItemSection>
<QItemSection>
<QCheckbox
:label="t('components.itemsFilterPanel.visible')"
:label="t('globals.visible')"
v-model="params.visible"
toggle-indeterminate
@update:model-value="searchFn()"

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref, computed } from 'vue';
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import EntryFilter from './EntryFilter.vue';
import { useStateStore } from 'stores/useStateStore';
@ -11,7 +11,6 @@ import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorP
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
import VnSection from 'src/components/common/VnSection.vue';
const stateStore = useStateStore();
const { t } = useI18n();
const tableRef = ref();
const dataKey = 'EntryList';

View File

@ -65,6 +65,6 @@ onMounted(async () => {
es:
Date: Fecha
params:
dated: Date
dated: Fecha
workerFk: Trabajador
</i18n>

View File

@ -102,7 +102,7 @@ const columns = computed(() => [
actions: [
{
title: t('myEntries.printLabels'),
icon: 'print',
icon: 'move_item',
isPrimary: true,
action: (row) => printBuys(row.id),
},

View File

@ -20,5 +20,6 @@ myEntries:
warehouseInFk: Warehouse in
daysOnward: Days onward
daysAgo: Days ago
downloadCsv: Download CSV
wasteRecalc:
recalcOk: The wastes were successfully recalculated

View File

@ -20,5 +20,6 @@ myEntries:
warehouseInFk: Alm. entrada
daysOnward: Días adelante
daysAgo: Días atras
downloadCsv: Descargar CSV
wasteRecalc:
recalcOk: Se han recalculado las mermas correctamente

View File

@ -161,7 +161,7 @@ const columns = computed(() => [
<QList>
<QItem>
<VnSelect
:label="t('code')"
:label="t('Code')"
class="full-width"
v-model="props.row['intrastatFk']"
:options="intrastats"

View File

@ -68,13 +68,26 @@ function handleDaysAgo(params, daysAgo) {
<VnSelect
v-model="params.supplierFk"
url="Suppliers"
:fields="['id', 'nickname']"
:fields="['id', 'nickname', 'name']"
:label="getLocale('supplierFk')"
option-label="nickname"
dense
outlined
rounded
/>
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>

View File

@ -165,18 +165,18 @@ const cols = computed(() => [
<VnSelect
v-model="data.supplierFk"
url="Suppliers"
:fields="['id', 'nickname']"
:fields="['id', 'nickname', 'name']"
:label="t('globals.supplier')"
option-value="id"
option-label="nickname"
:filter-options="['id', 'name']"
:filter-options="['id', 'name', 'nickname']"
:required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel>
</QItemSection>
</QItem>
</template>

View File

@ -44,7 +44,10 @@ InvoiceIn:
country: Country
params:
search: Id or supplier name
account: Ledger account
correctingFk: Rectificative
correctedFk: Corrected
isBooked: Is booked
invoicein:
params:
account: Ledger account
correctingFk: Rectificative

View File

@ -42,6 +42,9 @@ InvoiceIn:
country: País
params:
search: Id o nombre proveedor
correctedFk: Rectificada
invoicein:
params:
account: Cuenta contable
correctingFk: Rectificativa
correctedFk: Rectificada

View File

@ -47,6 +47,7 @@ const states = ref();
:label="t('Amount')"
v-model="params.amount"
is-outlined
data-cy="InvoiceOutFilterAmountBtn"
/>
</QItemSection>
</QItem>

View File

@ -101,6 +101,7 @@ onMounted(async () => {
dense
outlined
rounded
data-cy="InvoiceOutGlobalClientSelect"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -125,6 +126,7 @@ onMounted(async () => {
dense
outlined
rounded
data-cy="InvoiceOutGlobalSerialSelect"
/>
<VnInputDate
v-model="formData.invoiceDate"
@ -135,6 +137,7 @@ onMounted(async () => {
v-model="formData.maxShipped"
:label="t('maxShipped')"
is-outlined
data-cy="InvoiceOutGlobalMaxShippedDate"
/>
<VnSelect
:label="t('company')"
@ -144,6 +147,7 @@ onMounted(async () => {
dense
outlined
rounded
data-cy="InvoiceOutGlobalCompanySelect"
/>
<VnSelect
:label="t('printer')"
@ -152,6 +156,7 @@ onMounted(async () => {
dense
outlined
rounded
data-cy="InvoiceOutGlobalPrinterSelect"
/>
</div>
<QBtn

View File

@ -126,6 +126,13 @@ const columns = computed(() => [
columnField: { component: null },
format: (row) => toDate(row.dued),
},
{
align: 'left',
name: 'customsAgentFk',
label: t('invoiceOutList.tableVisibleColumns.customsAgent'),
cardVisible: true,
format: (row, dashIfEmpty) => dashIfEmpty(row.customsAgentName),
},
{
align: 'right',
name: 'tableActions',
@ -190,6 +197,7 @@ watchEffect(selectedRows);
icon-right="cloud_download"
@click="downloadPdf()"
:disable="!hasSelectedCards"
data-cy="InvoiceOutDownloadPdfBtn"
>
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
</QBtn>
@ -238,6 +246,7 @@ watchEffect(selectedRows);
v-model="data.ticketFk"
:label="t('globals.ticket')"
style="flex: 1"
data-cy="InvoiceOutCreateTicketinput"
/>
<div
@ -346,12 +355,13 @@ watchEffect(selectedRows);
<VnSelect
url="InvoiceOutSerials"
v-model="data.serial"
:label="t('invoiceIn.serial')"
:label="t('InvoiceIn.serial')"
:options="invoiceOutSerialsOptions"
option-label="description"
option-value="code"
option-filter
:expr-builder="exprBuilder"
data-cy="InvoiceOutCreateSerialSelect"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -13,6 +13,7 @@ invoiceOutList:
invoiceOutSerial: Serial
ticket: Ticket
taxArea: Tax area
customsAgent: Custom Agent
DownloadPdf: Download PDF
InvoiceOutSummary: Summary
negativeBases:
@ -24,3 +25,15 @@ negativeBases:
hasToInvoice: Has to invoice
verifiedData: Verified data
commercial: Commercial
invoiceout:
params:
company: Company
country: Country
clientId: Client ID
clientSocialName: Client
taxableBase: Base
ticketFk: Ticket
isActive: Active
hasToInvoice: Has to invoice
hasVerifiedData: Verified data
workerName: Worker

View File

@ -15,6 +15,7 @@ invoiceOutList:
invoiceOutSerial: Serial
ticket: Ticket
taxArea: Area
customsAgent: Agente de aduanas
DownloadPdf: Descargar PDF
InvoiceOutSummary: Resumen
negativeBases:
@ -27,3 +28,15 @@ negativeBases:
hasToInvoice: Debe facturar
verifiedData: Datos verificados
commercial: Comercial
invoiceout:
params:
company: Empresa
country: País
clientId: ID del cliente
clientSocialName: Cliente
taxableBase: Base
ticketFk: Ticket
isActive: Activo
hasToInvoice: Debe facturar
hasVerifiedData: Datos verificados
workerName: Comercial

View File

@ -203,6 +203,12 @@ const onIntrastatCreated = (response, formData) => {
v-model="data.hasKgPrice"
:label="t('item.basicData.hasKgPrice')"
/>
<QCheckbox
v-model="data.isCustomInspectionRequired"
:label="t('item.basicData.isCustomInspectionRequired')"
/>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div>
<QCheckbox
v-model="data.isFragile"

View File

@ -52,6 +52,7 @@ const entityId = computed(() => {
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected
data-cy="AddGenusSelectDialog"
>
<template #form>
<CreateGenusForm
@ -68,6 +69,7 @@ const entityId = computed(() => {
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected
data-cy="AddSpeciesSelectDialog"
>
<template #form>
<CreateSpecieForm

View File

@ -233,7 +233,7 @@ async function updateWarehouse(warehouseFk) {
</div>
</template>
</VnSubToolbar>
<QPage class="column items-center q-pa-md">
<QPage class="column items-center">
<QTable
:rows="itemBalances"
:columns="columns"

View File

@ -10,21 +10,12 @@ import { dashIfEmpty } from 'src/filters';
import { toCurrency } from 'filters/index';
import { useArrayData } from 'composables/useArrayData';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import axios from 'axios';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
const { t } = useI18n();
const route = useRoute();
const from = ref();
const to = ref();
const hideInventory = ref(true);
const inventorySupplierFk = ref();
async function getInventorySupplier() {
inventorySupplierFk.value = (
await axios.get(`InventoryConfigs`)
)?.data[0]?.supplierFk;
}
const exprBuilder = (param, value) => {
switch (param) {
@ -49,10 +40,6 @@ const where = {
itemFk: route.params.id,
};
if (hideInventory.value) {
where.supplierFk = { neq: inventorySupplierFk };
}
const arrayData = useArrayData('ItemLastEntries', {
url: 'Items/lastEntriesFilter',
order: ['landed DESC', 'buyFk DESC'],
@ -110,7 +97,7 @@ const columns = computed(() => [
format: (val) => dashIfEmpty(val),
},
{
label: t('shelvings.packing'),
label: 'Packing',
name: 'packing',
field: 'packing',
align: 'center',
@ -182,15 +169,11 @@ const updateFilter = async () => {
const userFilter = arrayData.store.userFilter.where;
userFilter.landed = filter;
if (hideInventory.value) userFilter.supplierFk = { neq: inventorySupplierFk };
else delete userFilter.supplierFk;
await fetchItemLastEntries();
};
onMounted(async () => {
await getInventorySupplier();
const _from = Date.vnNew();
_from.setDate(_from.getDate() - 75);
from.value = getDate(_from, 'from');
@ -200,12 +183,16 @@ onMounted(async () => {
updateFilter();
watch([from, to, hideInventory], ([nFrom, nTo], [oFrom, oTo]) => {
watch([from, to], ([nFrom, nTo], [oFrom, oTo]) => {
if (nFrom && nFrom != oFrom) nFrom = getDate(new Date(nFrom), 'from');
if (nTo && nTo != oTo) nTo = getDate(new Date(nTo), 'to');
updateFilter();
});
});
function getBadgeClass(groupingMode, expectedGrouping) {
return groupingMode === expectedGrouping ? 'accent-badge' : 'simple-badge';
}
</script>
<template>
<VnSubToolbar>
@ -224,13 +211,6 @@ onMounted(async () => {
class="q-mr-lg"
data-cy="to"
/>
<QCheckbox
:label="t('Hide inventory supplier')"
v-model="hideInventory"
dense
class="q-mr-lg"
data-cy="hideInventory"
/>
</template>
</VnSubToolbar>
<QPage class="column items-center q-pa-xd">
@ -249,6 +229,11 @@ onMounted(async () => {
/>
</QTd>
</template>
<template #body-cell-warehouse="{ row }">
<QTd>
<span>{{ row.warehouse }}</span>
</QTd>
</template>
<template #body-cell-date="{ row }">
<QTd class="text-center">
<VnDateBadge :date="row.landed" />
@ -262,32 +247,37 @@ onMounted(async () => {
</div>
</QTd>
</template>
<template #body-cell-pvp="{ value }">
<QTd @click.stop class="text-center">
<span> {{ value }}</span>
<QTooltip> {{ t('lastEntries.grouping') }}/Packing </QTooltip></QTd
>
</template>
<template #body-cell-printedStickers="{ row }">
<QTd @click.stop class="text-center">
<span style="color: var(--vn-label-color)">
{{ row.printedStickers }}</span
>
</QTd>
</template>
<template #body-cell-packing="{ row }">
<QTd @click.stop>
<QBadge
class="center-content"
:class="getBadgeClass(row.groupingMode, 'packing')"
rounded
:color="row.groupingMode == 'packing' ? 'grey-13' : 'black'"
>
{{ dashIfEmpty(row.packing) }}
<QTooltip>{{ t('lastEntries.packing') }}</QTooltip>
<QTooltip>Packing</QTooltip>
</QBadge>
</QTd>
</template>
<template #body-cell-pvp="{ value }">
<QTd @click.stop class="text-center">
<span> {{ value }}</span>
<QTooltip>
{{ t('lastEntries.grouping') }}/{{ t('lastEntries.packing') }}
</QTooltip></QTd
>
</template>
<template #body-cell-grouping="{ row }">
<QTd @click.stop>
<QBadge
class="center-content"
:class="getBadgeClass(row.groupingMode, 'grouping')"
rounded
:color="row.groupingMode == 'grouping' ? 'grey-13' : 'black'"
>
{{ dashIfEmpty(row.grouping) }}
<QTooltip>{{ t('lastEntries.grouping') }}</QTooltip>
@ -315,13 +305,16 @@ onMounted(async () => {
</template>
<template #body-cell-supplier="{ row }">
<QTd @click.stop>
<div class="full-width flex justify-center">
<SupplierDescriptorProxy
:id="row.supplierFk"
class="q-ma-none"
<div class="full-width flex justify-left">
<QBadge
:class="
row.isInventorySupplier ? 'bg-vn-page' : 'transparent'
"
dense
/>
>
<SupplierDescriptorProxy :id="row.supplierFk" />
<span class="link">{{ row.supplier }}</span>
</QBadge>
</div>
</QTd>
</template>
@ -349,4 +342,13 @@ onMounted(async () => {
background-color: red;
}
}
.accent-badge {
background-color: var(--vn-label-color);
color: var(--vn-text-color-contrast);
}
.simple-badge {
background-color: transparent;
color: var(--vn-text-color);
font-size: 14px;
}
</style>

View File

@ -107,7 +107,7 @@ const submitTags = async (data) => {
@on-fetch="onItemTagsFetched"
>
<template #body="{ rows, validate }">
<QCard class="q-px-lg q-pt-md q-pb-sm">
<QCard class="q-px-lg q-pt-md q-pb-sm" data-cy="itemTags">
<VnRow
v-for="(row, index) in rows"
:key="index"
@ -128,7 +128,7 @@ const submitTags = async (data) => {
<VnSelect
v-if="row.tag?.isFree === false"
:key="row.tagFk"
:label="t('Value')"
:label="t('itemTags.value')"
v-model="row.value"
:url="`Tags/${row.tagFk}/filterValue`"
option-label="value"

View File

@ -35,6 +35,7 @@ const editTableCellDialogRef = ref(null);
const user = state.getUser();
const fixedPrices = ref([]);
const warehousesOptions = ref([]);
const hasSelectedRows = computed(() => rowsSelected.value.length > 0);
const rowsSelected = ref([]);
const itemFixedPriceFilterRef = ref();
@ -53,7 +54,6 @@ const columns = computed(() => [
name: 'itemFk',
...defaultColumnAttrs,
isId: true,
cardVisible: true,
columnField: {
component: 'input',
type: 'number',
@ -65,14 +65,12 @@ const columns = computed(() => [
name: 'name',
...defaultColumnAttrs,
create: true,
cardVisible: true,
},
{
label: t('item.fixedPrice.groupingPrice'),
field: 'rate2',
name: 'rate2',
...defaultColumnAttrs,
cardVisible: true,
component: 'input',
type: 'number',
},
@ -81,7 +79,6 @@ const columns = computed(() => [
field: 'rate3',
name: 'rate3',
...defaultColumnAttrs,
cardVisible: true,
component: 'input',
type: 'number',
},
@ -91,7 +88,6 @@ const columns = computed(() => [
field: 'minPrice',
name: 'minPrice',
...defaultColumnAttrs,
cardVisible: true,
component: 'input',
type: 'number',
},
@ -100,7 +96,6 @@ const columns = computed(() => [
field: 'started',
name: 'started',
format: ({ started }) => toDate(started),
cardVisible: true,
...defaultColumnAttrs,
columnField: {
component: 'date',
@ -116,7 +111,6 @@ const columns = computed(() => [
field: 'ended',
name: 'ended',
...defaultColumnAttrs,
cardVisible: true,
columnField: {
component: 'date',
class: 'shrink',
@ -251,11 +245,14 @@ const upsertPrice = async (props, resetMinPrice = false) => {
}
if (!changes.updates && !changes.creates) return;
const data = await upsertFixedPrice(row);
tableRef.value.CrudModelRef.formData[props.rowIndex] = data;
Object.assign(tableRef.value.CrudModelRef.formData[props.rowIndex], data);
notify(t('globals.dataSaved'), 'positive');
tableRef.value.reload();
};
async function upsertFixedPrice(row) {
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
data.hasMinPrice = data.hasMinPrice ? 1 : 0;
return data;
}
@ -372,9 +369,9 @@ function handleOnDataSave({ CrudModelRef }) {
</template>
</RightMenu>
<VnSubToolbar>
<template #st-data>
<template #st-actions>
<QBtn
v-if="rowsSelected.length"
:disable="!hasSelectedRows"
@click="openEditTableCellDialog()"
color="primary"
icon="edit"
@ -384,29 +381,23 @@ function handleOnDataSave({ CrudModelRef }) {
</QTooltip>
</QBtn>
<QBtn
:disable="!hasSelectedRows"
:label="tMobile('globals.remove')"
color="primary"
icon="delete"
flat
@click="(row) => confirmRemove(row, true)"
:title="t('globals.remove')"
v-if="rowsSelected.length"
/>
</template>
</VnSubToolbar>
<VnTable
@on-fetch="
(data) =>
data.forEach((item) => {
item.hasMinPrice = `${item.hasMinPrice !== 0}`;
})
"
:default-remove="false"
:default-reset="false"
:default-save="false"
data-key="ItemFixedPrices"
url="FixedPrices/filter"
:order="['itemFk DESC', 'name DESC']"
:order="['name DESC', 'itemFk DESC']"
save-url="FixedPrices/crud"
ref="tableRef"
dense
@ -498,14 +489,15 @@ function handleOnDataSave({ CrudModelRef }) {
<QCheckbox
:model-value="props.row.hasMinPrice"
@update:model-value="updateMinPrice($event, props)"
:false-value="'false'"
:true-value="'true'"
:false-value="0"
:true-value="1"
:toggle-indeterminate="false"
/>
<VnInput
class="col"
type="currency"
mask="###.##"
:disable="props.row.hasMinPrice === 1"
:disable="props.row.hasMinPrice === 0"
v-model.number="props.row.minPrice"
v-on="getRowUpdateInputEvents(props)"
>

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, onBeforeMount } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnImg from 'src/components/ui/VnImg.vue';
@ -15,6 +15,9 @@ import ItemTypeDescriptorProxy from './ItemType/Card/ItemTypeDescriptorProxy.vue
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
import RightMenu from 'src/components/common/RightMenu.vue';
import ItemListFilter from './ItemListFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import axios from 'axios';
const entityId = computed(() => route.params.id);
const { openCloneDialog } = cloneItem();
@ -22,7 +25,9 @@ const { viewSummary } = useSummaryDialog();
const { t } = useI18n();
const tableRef = ref();
const route = useRoute();
const validPriorities = ref([]);
const defaultTag = ref();
const defaultPriority = ref();
const itemFilter = {
include: [
{
@ -90,7 +95,6 @@ const columns = computed(() => [
label: t('globals.description'),
name: 'description',
align: 'left',
create: true,
columnFilter: {
name: 'search',
},
@ -132,13 +136,23 @@ const columns = computed(() => [
fields: ['id', 'name'],
},
},
create: true,
visible: false,
},
{
label: t('item.list.typeName'),
name: 'typeName',
align: 'left',
component: 'select',
columnFilter: {
name: 'typeFk',
attrs: {
url: 'ItemTypes',
fields: ['id', 'name'],
},
},
columnField: {
component: null,
}
},
{
label: t('item.list.category'),
@ -161,6 +175,11 @@ const columns = computed(() => [
name: 'intrastat',
align: 'left',
component: 'select',
attrs: {
url: 'Intrastats',
optionValue: 'description',
optionLabel: 'description',
},
columnFilter: {
name: 'intrastat',
attrs: {
@ -172,7 +191,6 @@ const columns = computed(() => [
columnField: {
component: null,
},
create: true,
cardVisible: true,
},
{
@ -198,7 +216,6 @@ const columns = computed(() => [
columnField: {
component: null,
},
create: true,
cardVisible: true,
},
{
@ -297,12 +314,21 @@ const columns = computed(() => [
],
},
]);
onBeforeMount(async () => {
const { data } = await axios.get('ItemConfigs');
defaultTag.value = data[0].defaultTag;
defaultPriority.value = data[0].defaultPriority;
data.forEach((priority) => {
validPriorities.value = priority.validPriorities;
});
});
</script>
<template>
<VnSearchbar
data-key="ItemList"
:label="t('item.searchbar.label')"
:info="t('You can search by id')"
:info="t('item.searchbar.info')"
/>
<RightMenu>
<template #right-panel>
@ -310,15 +336,18 @@ const columns = computed(() => [
</template>
</RightMenu>
<VnTable
v-if="defaultTag"
ref="tableRef"
data-key="ItemList"
url="Items/filter"
:create="{
urlCreate: 'Items',
title: t('Create Item'),
onDataSaved: () => tableRef.redirect(),
urlCreate: 'Items/new',
title: t('item.list.newItem'),
onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`),
formInitialData: {
editorFk: entityId,
tag: defaultTag,
priority: defaultPriority,
},
}"
:order="['isActive DESC', 'name', 'id']"
@ -364,6 +393,96 @@ const columns = computed(() => [
</div>
<FetchedTags :item="row" :columns="3" />
</template>
<template #more-create-dialog="{ data }">
<VnInput
v-model="data.provisionalName"
:label="t('globals.description')"
:is-required="true"
/>
<VnSelect
url="Tags"
v-model="data.tag"
:label="t('globals.tag')"
:fields="['id', 'name']"
option-label="name"
option-value="id"
:is-required="true"
:sort-by="['name ASC']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
:options="validPriorities"
v-model="data.priority"
:label="t('item.create.priority')"
:is-required="true"
/>
<VnSelect
url="ItemTypes"
v-model="data.typeFk"
:label="t('item.list.typeName')"
:fields="['id', 'code', 'name']"
option-label="name"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.code }} #{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
url="Intrastats"
v-model="data.intrastatFk"
:label="t('globals.intrastat')"
:fields="['id', 'description']"
option-label="description"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.description }}</QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
url="Origins"
v-model="data.originFk"
:label="t('globals.origin')"
:fields="['id', 'code', 'name']"
option-label="code"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.code }} #{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</template>
</VnTable>
</template>
<style lang="scss" scoped>
@ -376,6 +495,8 @@ const columns = computed(() => [
<i18n>
es:
New item: Nuevo artículo
Create Item: Crear artículo
You can search by id: Puedes buscar por id
Preview: Vista previa
Regularize stock: Regularizar stock
</i18n>

View File

@ -199,17 +199,7 @@ onMounted(async () => {
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
t(`params.${scope.opt?.name}`)
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>
@ -265,6 +255,7 @@ onMounted(async () => {
option-value="id"
option-label="name"
:fields="['id', 'name', 'nickname']"
:filter-options="['id', 'name', 'nickname']"
sort-by="name ASC"
hide-selected
dense
@ -274,9 +265,12 @@ onMounted(async () => {
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt?.name + ': ' + scope.opt?.nickname
}}</QItemLabel>
<QItemLabel>
{{ scope.opt?.name}}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
@ -375,6 +369,7 @@ onMounted(async () => {
:model-value="fieldFilter.selectedField"
:options="moreFields"
option-label="label"
option-value="label"
dense
outlined
rounded

View File

@ -149,7 +149,6 @@ onMounted(async () => {
:label="t('params.requesterFk')"
v-model="params.requesterFk"
@update:model-value="searchFn()"
:fields="['id', 'name']"
:params="{ departmentCodes: ['VT'] }"
hide-selected
dense
@ -201,6 +200,7 @@ en:
to: To
mine: For me
state: State
daysOnward: Days onward
myTeam: My team
dateFiltersTooltip: Cannot choose a range of dates and days onward at the same time
denied: Denied
@ -218,6 +218,7 @@ es:
to: Hasta
mine: Para mi
state: Estado
daysOnward: Días en adelante
myTeam: Mi equipo
dateFiltersTooltip: No se puede seleccionar un rango de fechas y días en adelante a la vez
denied: Denegada

View File

@ -107,6 +107,7 @@ item:
scopeDays: Scope days
searchbar:
label: Search item
info: You can search by id
descriptor:
item: Item
buyer: Buyer
@ -139,6 +140,7 @@ item:
stemMultiplier: Multiplier
producer: Producer
landed: Landed
newItem: New item
basicData:
type: Type
reference: Reference
@ -158,6 +160,7 @@ item:
isFragileTooltip: Is shown at website, app that this item cannot travel (wreath, palms, ...)
isPhotoRequested: Do photo
isPhotoRequestedTooltip: This item does need a photo
isCustomInspectionRequired: Needs physical inspection (PIF)
description: Description
fixedPrice:
itemFk: Item ID

View File

@ -109,6 +109,7 @@ item:
scopeDays: Días en adelante
searchbar:
label: Buscar artículo
info: Puedes buscar por id
descriptor:
item: Artículo
buyer: Comprador
@ -141,6 +142,7 @@ item:
stemMultiplier: Multiplicador
producer: Productor
landed: F. entrega
newItem: Nuevo artículo
basicData:
type: Tipo
reference: Referencia
@ -160,6 +162,7 @@ item:
isFragileTooltip: Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...)
isPhotoRequested: Hacer foto
isPhotoRequestedTooltip: Este artículo necesita una foto
isCustomInspectionRequired: Necesita inspección física (PIF)
description: Descripción
fixedPrice:
itemFk: ID Artículo

View File

@ -3,7 +3,7 @@ import { ref } from 'vue';
import { Notify } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
import { useSession } from 'src/composables/useSession';
import { useLogin } from 'src/composables/useLogin';
@ -63,11 +63,10 @@ async function onSubmit() {
:rules="[(val) => (val && val.length > 0) || t('login.fieldRequired')]"
color="primary"
/>
<VnInput
type="password"
<VnInputPassword
v-model="password"
:label="t('login.password')"
lazy-rules
:toggle-visibility="true"
:rules="[(val) => (val && val.length > 0) || t('login.fieldRequired')]"
class="red"
/>

View File

@ -7,6 +7,7 @@ import axios from 'axios';
import VnInput from 'components/common/VnInput.vue';
import VnOutForm from 'components/ui/VnOutForm.vue';
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
const quasar = useQuasar();
const router = useRouter();
@ -54,8 +55,7 @@ async function onSubmit() {
<template>
<VnOutForm @submit="onSubmit" :title="t('globals.pageTitles.resetPassword')">
<template #default>
<VnInput
type="password"
<VnInputPassword
:label="t('login.password')"
v-model="newPassword"
:info="
@ -72,9 +72,8 @@ async function onSubmit() {
<template #prepend>
<QIcon name="password" />
</template>
</VnInput>
<VnInput
type="password"
</VnInputPassword>
<VnInputPassword
:label="t('resetPassword.repeatPassword')"
v-model="repeatPassword"
required
@ -82,7 +81,7 @@ async function onSubmit() {
<template #prepend>
<QIcon name="password" />
</template>
</VnInput>
</VnInputPassword>
</template>
<template #buttons>
<QBtn

View File

@ -110,15 +110,13 @@ const columns = computed(() => [
name: 'salesPersonFk',
field: 'userName',
align: 'left',
optionFilter: 'firstName',
columnFilter: {
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'],
url: 'Workers/search?departmentCodes=["VT"]',
fields: ['id', 'name', 'nickname', 'code'],
sortBy: 'nickname ASC',
where: { role: 'salesPerson' },
useLike: false,
optionLabel: 'nickname',
},
},
},

View File

@ -1,6 +1,6 @@
<script setup>
import toCurrency from 'src/filters/toCurrency';
import { computed, inject, ref } from 'vue';
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { useRoute } from 'vue-router';

View File

@ -97,6 +97,7 @@ const sourceList = ref([]);
v-model="params.sourceApp"
:options="sourceList"
option-label="value"
option-value="value"
dense
outlined
rounded
@ -128,6 +129,7 @@ en:
from: From
to: To
orderFk: Order
workerFk: Worker
sourceApp: Application
myTeam: My Team
isConfirmed: Is Confirmed
@ -151,6 +153,7 @@ es:
from: Desde
to: Hasta
orderFk: Cesta
workerFk: Trabajador
sourceApp: Aplicación
myTeam: Mi Equipo
isConfirmed: Confirmado

View File

@ -221,7 +221,7 @@ async function handleConfirm() {
</span>
</div>
</div>
<FetchedTags :item="props.row.item" />
<FetchedTags :item="props.row.item" :columns="3" />
</QTd>
<QTd key="quantity" :props="props">
{{ props.row.quantity }}

View File

@ -10,3 +10,4 @@ agency:
searchBar:
info: Puedes buscar por nombre o id
label: Buscar agencia...

View File

@ -225,8 +225,8 @@ es:
params:
agencyModeFk: Agencia ruta
m3:
from: Desde
to: Hasta
From: Desde
To: Hasta
date: Fecha
agencyFk: Agencia Acuerdo
packages: Bultos

View File

@ -161,6 +161,7 @@ en:
warehouseFk: Warehouse
description: Description
m3:
scopeDays: Days Onward
vehicleFk: Vehicle
agencyModeFk: Agency
workerFk: Worker
@ -172,6 +173,7 @@ es:
warehouseFk: Almacén
description: Descripción
m3:
scopeDays: Días en adelante
vehicleFk: Vehículo
agencyModeFk: Agencia
workerFk: Trabajador

View File

@ -271,6 +271,8 @@ es:
Date: Fecha
Agency route: Agencia Ruta
Agency agreement: Agencia Acuerdo
From: Desde
To: Hasta
Packages: Bultos
Price: Precio
Received: Recibida

View File

@ -1,4 +1,18 @@
route:
params:
etd: ETD
tractorPlate: Plate
price: Price
observations: Observations
id: ID
name: Name
cmrFk: CMR id
hasCmrDms: Attached in gestdoc
ticketFk: Ticketd id
routeFk: Route id
shipped: Shipped
agencyAgreement: Agency agreement
agencyModeName: Agency route
Worker: Worker
Agency: Agency
Vehicle: Vehicle

View File

@ -1,4 +1,18 @@
route:
params:
agencyModeName: Agencia Ruta
agencyAgreement: Agencia Acuerdo
id: Id
name: Troncal
etd: ETD
tractorPlate: Matrícula
price: Precio
observations: Observaciones
cmrFk: Id CMR
hasCmrDms: Gestdoc
ticketFk: Id ticket
routeFK: Id ruta
shipped: Fecha preparación
Worker: Trabajador
Agency: Agencia
Vehicle: Vehículo

View File

@ -134,6 +134,7 @@ defineProps({
<i18n>
en:
params:
supplierFk: Supplier
search: General search
itemId: Item id
buyerId: Buyer
@ -143,6 +144,7 @@ en:
to: To
es:
params:
supplierFk: Proveedor
search: Búsqueda general
itemId: Id Artículo
buyerId: Comprador

View File

@ -39,6 +39,7 @@ const getUrl = (section) => `#/supplier/${entityId.value}/${section}`;
:url="`Suppliers/${entityId}/getSummary`"
@on-fetch="(data) => setData(data)"
data-key="SupplierSummary"
module-name="Supplier"
>
<template #header>
<span>{{ supplier.id }} - {{ supplier.name }}</span>
@ -149,7 +150,7 @@ const getUrl = (section) => `#/supplier/${entityId.value}/${section}`;
<VnLv :label="t('supplier.summary.taxNumber')" :value="supplier.nif" />
<VnLv :label="t('globals.street')" :value="supplier.street" />
<VnLv :label="t('supplier.summary.city')" :value="supplier.city" />
<VnLv :label="t('globals.postCode')" :value="supplier.postCode" />
<VnLv :label="t('globals.postcode')" :value="supplier.postCode" />
<VnLv
:label="t('supplier.summary.province')"
:value="supplier.province?.name"

Some files were not shown because too many files have changed in this diff Show More