Compare commits
172 Commits
8061_newCP
...
dev
Author | SHA1 | Date |
---|---|---|
Alex Moreno | 4480b58551 | |
Alex Moreno | 79c86e271c | |
Alex Moreno | 068b2dc9aa | |
Alex Moreno | 89a13e8886 | |
Carlos Andrés | 658551e085 | |
Guillermo Bonet | bf8b9e4283 | |
Guillermo Bonet | 8428c7a205 | |
Alex Moreno | f1fc5edac3 | |
Alex Moreno | d364e30cf0 | |
Robert Ferrús | 4f8bf00786 | |
Robert Ferrús | bedf7d8a3a | |
Alex Moreno | 50796df06a | |
Alex Moreno | 36de1ad400 | |
Robert Ferrús | 650acccbee | |
Carlos Andrés | 67c257ce0e | |
Javier Segarra | 7a3e2c0a9b | |
Javier Segarra | 280a70a145 | |
Jon Elias | ddfcc0aff5 | |
Jon Elias | 4193710123 | |
Jon Elias | 6263481a3e | |
Javier Segarra | d74bad50cb | |
Javier Segarra | 07274002cf | |
Jon Elias | 61d0d71538 | |
Robert Ferrús | 547455d976 | |
Robert Ferrús | 97c12bced3 | |
Javier Segarra | 1bbce5f828 | |
Javier Segarra | 8bc3c1610b | |
Robert Ferrús | 5c79c6bfef | |
Guillermo Bonet | 7315d117c0 | |
Guillermo Bonet | 41fb880c0e | |
Alex Moreno | 1ae53791bf | |
Alex Moreno | a251e348a8 | |
Guillermo Bonet | 4af309ce8d | |
Javier Segarra | 8daa08b99c | |
Alex Moreno | fe34eefc55 | |
Alex Moreno | 118e346a07 | |
Guillermo Bonet | 55b9e3ddcd | |
Jon Elias | aaab41fe97 | |
Jon Elias | b2e99230b3 | |
Jon Elias | 1a0406b5b1 | |
Javier Segarra | c287c04894 | |
Javier Segarra | 89a2486f62 | |
Javier Segarra | 3a695bdfe1 | |
Javier Segarra | 507b78f5e8 | |
Javier Segarra | 827f6032b6 | |
William Buezas | 63f0db459c | |
Javier Segarra | 38d8dbab8e | |
Javier Segarra | e23c6bc144 | |
Javier Segarra | a7f5c13acf | |
Jorge Penadés | 33de645e37 | |
Jon Elias | 5889dbf3de | |
Jon Elias | d2cee10141 | |
Jon Elias | 7d28037c29 | |
Jon Elias | e94c99662d | |
Jon Elias | e764f4066f | |
Javier Segarra | dc156e44b6 | |
Jon Elias | 6b95df0202 | |
Jon Elias | 07ba02aec8 | |
Javier Segarra | bfb0915da0 | |
Javier Segarra | 13ee4625be | |
Javier Segarra | 1f752e19f2 | |
Javier Segarra | abec8035a9 | |
Javier Segarra | fd9dd7ae55 | |
William Buezas | 4a562acd92 | |
Javier Segarra | 72a481ae5b | |
Javier Segarra | b61d6e6cbe | |
Javier Segarra | e3bdea2197 | |
William Buezas | a2d84c48c0 | |
Javier Segarra | ff91ca2dfe | |
Javier Segarra | bc0d7f110d | |
Javier Segarra | 4539a73efc | |
Javier Segarra | cf34204f82 | |
Javier Segarra | 1b3500bbce | |
Javier Segarra | 21eda340a8 | |
Javier Segarra | 511a5bc614 | |
Alex Moreno | 9086b7d48d | |
Javier Segarra | 1af90f695e | |
Carlos Andrés | b20803e6b9 | |
Carlos Satorres | 75986bf7a8 | |
Carlos Satorres | c5f2be688c | |
Carlos Satorres | 4008f50781 | |
Carlos Satorres | 728055352d | |
Carlos Satorres | ad8d5b5e9a | |
Javier Segarra | ac1153b14c | |
Javier Segarra | 0e9fe82d3d | |
Javier Segarra | 63536ea0f5 | |
Jorge Penadés | 9c5125a4d2 | |
Jorge Penadés | 15c1898044 | |
Jorge Penadés | a33f801543 | |
Jorge Penadés | 84adc40c18 | |
Alex Moreno | 7feea110a6 | |
Alex Moreno | 2076072eeb | |
Alex Moreno | 8fbf7fed43 | |
Alex Moreno | 1e4cda6c6a | |
Alex Moreno | 1ce1f1f8e0 | |
Javier Segarra | c3510aea60 | |
Javier Segarra | e28d026ca9 | |
Javier Segarra | 4e5754ccb5 | |
Javier Segarra | 6c6144864f | |
Javier Segarra | c0d427ecb9 | |
Javier Segarra | 1cbe134e27 | |
Javier Segarra | a45c40f796 | |
Javier Segarra | 7650997c24 | |
Javier Segarra | f6e97efe78 | |
Javier Segarra | 7e924bc791 | |
Javier Segarra | 2ead484026 | |
Alex Moreno | 594fc60eec | |
Javier Segarra | 1974fd4663 | |
Javier Segarra | 4735d98afc | |
Jorge Penadés | 8688f2a3aa | |
Jorge Penadés | 5bdf9bc57e | |
Javier Segarra | 28c9aceb80 | |
Alex Moreno | 209266d843 | |
Javier Segarra | 4821c43d0d | |
Carlos Satorres | 2c492e88d5 | |
Javier Segarra | 582a3b333a | |
Carlos Satorres | dfcaf4e692 | |
Carlos Satorres | 2bc2217406 | |
Jorge Penadés | 34062d3fc4 | |
Carlos Satorres | 5dd508c559 | |
Javier Segarra | 60590f6c97 | |
William Buezas | 62cd952e84 | |
William Buezas | 0e55f7abdc | |
Javier Segarra | ec96f6bea7 | |
Javier Segarra | 4bd14927de | |
Javier Segarra | b62935494a | |
Javier Segarra | 424dfc0a5c | |
Javier Segarra | c4f2ea032c | |
Javier Segarra | a45bf4c83b | |
Javier Segarra | 8d59cfa9c3 | |
Javier Segarra | 7f87df1225 | |
Javier Segarra | 2fa8c3f88a | |
Javier Segarra | 4fa5d47481 | |
Javier Segarra | 30a2da027b | |
Javier Segarra | 8a1a748c92 | |
Javier Segarra | 4233385267 | |
Javier Segarra | 276dc233c1 | |
Javier Segarra | 12dcb51fbe | |
Javier Segarra | 148e255665 | |
Javier Segarra | 87d3dd6fa8 | |
William Buezas | be1cd824d8 | |
Jorge Penadés | 1beeccef7a | |
Jorge Penadés | 3d4f7d8860 | |
Javier Segarra | 1c2c2538ed | |
Javier Segarra | 4ea0d04b86 | |
Javier Segarra | 8a4a6061e7 | |
Javier Segarra | c6b547bc55 | |
Javier Segarra | e2f092948e | |
Javier Segarra | aae475bf4c | |
Javier Segarra | ce28757a1a | |
Carlos Satorres | 095c1f477f | |
Carlos Satorres | 3352cea0e7 | |
William Buezas | 86d19218de | |
Javier Segarra | 94514a3254 | |
William Buezas | ec40ef9351 | |
Carlos Satorres | a0f804ab78 | |
Carlos Satorres | 991ef7b243 | |
Carlos Satorres | 258da0f60b | |
Carlos Satorres | 04f6107909 | |
Carlos Satorres | 780af58747 | |
Carlos Satorres | 8b2fbefc35 | |
Carlos Satorres | eea6276264 | |
Carlos Satorres | adbf1af453 | |
Carlos Satorres | 847cf6a5b4 | |
Carlos Satorres | 1aefad58e9 | |
Carlos Satorres | 237b3ed4df | |
Carlos Satorres | 5d8f9dbd72 | |
Carlos Satorres | ee2f80e9bb | |
Carlos Satorres | 87bce8fc21 | |
Carlos Satorres | b2c2f42243 | |
Carlos Satorres | 657dbc6761 | |
Carlos Satorres | 3bfbed9e54 |
186
CHANGELOG.md
186
CHANGELOG.md
|
@ -1,3 +1,189 @@
|
|||
# Version 24.48 - 2024-11-25
|
||||
|
||||
### Added 🆕
|
||||
|
||||
- chore: correct checkNotification (fix_customer_issues) by:alexm
|
||||
- chore: perf (warmFix_order_equalSalix) by:alexm
|
||||
- chore: refs #6818 add spaces by:jorgep
|
||||
- chore: refs #6818 drop useless code & comment by:jorgep
|
||||
- chore: refs #7273 sticky add btn & refactor by:jorgep
|
||||
- chore: refs #7524 fix test by:jorgep
|
||||
- chore: refs #8039 not required by:alexm
|
||||
- chore: refs #8078 fiz tests by:jorgep
|
||||
- chore: refs #8078 rollback ref by:jorgep
|
||||
- chore: remove console.log (warmFix_invoiceOut_Global) by:alexm
|
||||
- chore: typo (fix_itemType-redirection) by:alexm
|
||||
- feat: #6943 use openURL quasar by:Javier Segarra
|
||||
- feat: #7782 add cypress report by:Javier Segarra
|
||||
- feat: #7782 cypress.config watchForFileChanges by:Javier Segarra
|
||||
- feat: #7782 npm run resetDatabase by:Javier Segarra
|
||||
- feat: #7782 waitUntil domContentLoad by:Javier Segarra
|
||||
- feat: added composable to confirm orders by:Jon
|
||||
- feat: add /reports in gitignore (warmFix_reports_in_gitignore) by:alexm
|
||||
- feat: apply changes for customerModule by:Javier Segarra
|
||||
- feat: disabled buttons by:Javier Segarra
|
||||
- feat: move buttons to DescriptorMenu by:Javier Segarra
|
||||
- feat: refs #6818 add icon by:jorgep
|
||||
- feat: refs #6818 fetch url & default channel by:jorgep
|
||||
- feat: refs #6818 saysimple integration by:jorgep
|
||||
- feat: refs #6839 module searching (6839-addSearchMenu) by:jorgep
|
||||
- feat: refs #6839 normalize search by:jorgep
|
||||
- feat: refs #6919 sync entry data by:jorgep
|
||||
- feat: refs #7006 itemType basic data new inputs by:guillermo
|
||||
- feat: refs #7006 itemTypeLog added by:guillermo
|
||||
- feat: refs #7193 modified parking to use the scope and corrected small errors by:Jon
|
||||
- feat: refs #7206 added inactive label and corrected minor errors by:Jon
|
||||
- feat: refs #7308 #7308 remove warnings related to useSession by:Javier Segarra
|
||||
- feat: refs #7349 usa back con permisos by:jgallego
|
||||
- feat: refs #7524 add front test by:jorgep
|
||||
- feat: refs #7874 improve vn-notes ui by:jorgep
|
||||
- feat: refs #7970 notify changes by:Jon
|
||||
- feat(): refs #8039 canceledError not notify by:alexm
|
||||
- feat: refs #8039 notify error unify by:alexm
|
||||
- feat: refs #8039 show duplicate request in local by:alexm
|
||||
- feat: refs #8078 add shortcut multi selection by:jorgep
|
||||
- feat: refs #8078 add tests by:jorgep
|
||||
- feat: refs#8087 Redadas en travel by:Carlos Andrés
|
||||
- feat: refs #8087 Traspasar redadas a travels by:Carlos Andrés
|
||||
- feat: remove comments by:Javier Segarra
|
||||
- feat(Supplier): add companySize by:alexm
|
||||
- feat: use composable to unify logic by:Javier Segarra
|
||||
- feat(VnInput): empty to null by:alexm
|
||||
- feat(VnSelect): order data equal salix by:alexm
|
||||
- feat(VnSelect): refs #7136 add scroll (7136-vnSelect_paginate_simplify_2) by:alexm
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- chore: perf (warmFix_order_equalSalix) by:alexm
|
||||
- chore: refs #7273 sticky add btn & refactor by:jorgep
|
||||
- fix: better performance (warmFix_accountAcls) by:alexm
|
||||
- perf: minor bugs detected by:Javier Segarra
|
||||
- perf: refs #6943 #6943 merge command by:Javier Segarra
|
||||
- perf: refs #7283 #7283 declare composable inst4ead code duplicated by:Javier Segarra
|
||||
- perf: refs #7283 #7283 handle composable i18n by:Javier Segarra
|
||||
- perf: refs #7283 #7283 handle i18n by:Javier Segarra
|
||||
- perf: refs #7283 #7283 i18n params by:Javier Segarra
|
||||
- perf: refs #7308 #7308 remove comments by:Javier Segarra
|
||||
- perf: remove appendParams by:Javier Segarra
|
||||
- perf: use const in VnLocation by:Javier Segarra
|
||||
- perf: use required instead :required="true" by:Javier Segarra
|
||||
- refactor: apply QPopupProxy by:wbuezas
|
||||
- refactor: changed confirmOrder directory by:Jon
|
||||
- refactor: change keyup.enter for update:model-value by:wbuezas
|
||||
- refactor(InvoiceInBasicData): use VnDms by:alexm
|
||||
- refactor: modified composable by:Jon
|
||||
- refactor: refs #6818 change channel source by:jorgep
|
||||
- refactor: refs #6818 channel logic by:jorgep
|
||||
- refactor: refs #6919 export filter by:jorgep
|
||||
- refactor: refs #7132 1st wave of changes in global translations files by:Jon
|
||||
- refactor: refs #7132 account's module translations by:Jon
|
||||
- refactor: refs #7132 customer's module translations by:Jon
|
||||
- refactor: refs #7132 deleted pageTitles repeated by:Jon
|
||||
- refactor: refs #7132 delete duplicate translations' keys by:Jon
|
||||
- refactor: refs #7132 deleted useless code by:Jon
|
||||
- refactor: refs #7132 global translations files changed by:Jon
|
||||
- refactor: refs #7266 Changed method name by:guillermo
|
||||
- refactor: refs #7950 Created cmr model by:guillermo
|
||||
- refactor: refs #7970 added emit by:Jon
|
||||
- refactor: refs #7970 refactored VnConfirm to emit events by:Jon
|
||||
- refactor: refs #8185 modified LeftMenu to avoid duplicates by:Jon
|
||||
- refactor: remove unused variable by:wbuezas
|
||||
- refactor: revert catalog changes by:Jon
|
||||
- refactor: small change by:wbuezas
|
||||
- test: refactor e2e by:alexm
|
||||
- test: refs #8039 add hasNotify and, refactor: agencyWorkCenter test by:alexm
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- chore: refs #7524 fix test by:jorgep
|
||||
- fix: better performance (warmFix_accountAcls) by:alexm
|
||||
- fix: catalog view category and type filter by:wbuezas
|
||||
- fix: category and tags filters by:Jon
|
||||
- fix: changed route.query by:Jon
|
||||
- fix: change type vnput by:Javier Segarra
|
||||
- fix(ClaimList): stateCode orderBy priority by:alexm
|
||||
- fix: entryFilters by:carlossa
|
||||
- fix: filter panel by:Jon
|
||||
- fix(InvoiceOutGlobal): parallelism by:alexm
|
||||
- fix: itemBotanical by:Javier Segarra
|
||||
- fix: itemType redirection and fix filters by:alexm
|
||||
- fix: logout spec (warmFix_logout.spec) by:alexm
|
||||
- fix: merge errors by:alexm
|
||||
- fix: order catalog by:wbuezas
|
||||
- fix: order catalog fixes by:wbuezas
|
||||
- fix: refs #6818 use right icon by:jorgep
|
||||
- fix: refs #6896 fixed module problems by:Jon
|
||||
- fix: refs #7193 fixed e2e test by:Jon
|
||||
- fix: refs #7206 deleted duplicate code by:Jon
|
||||
- fix: refs #7273 use same filter by:jorgep
|
||||
- fix: refs #7283 #7283 bugs by:Javier Segarra
|
||||
- fix: refs #7283 #7283 ItemDiary subToolbar by:Javier Segarra
|
||||
- fix: refs #7283 #7283 ItemSummary bugs by:Javier Segarra
|
||||
- fix: refs #7283 Account image resolution by:guillermo
|
||||
- fix: refs #7283 css by:jorgep
|
||||
- fix: refs #7283 filter by:carlossa
|
||||
- fix: refs #7283 fix image by:carlossa
|
||||
- fix: refs #7283 fix pr by:carlossa
|
||||
- fix: refs #7283 fix preview by:carlossa
|
||||
- fix: refs #7283 fix required by:carlossa
|
||||
- fix: refs #7283 item filters by:carlossa
|
||||
- fix: refs #7283 itemtype fix by:carlossa
|
||||
- fix: refs #7283 order translation by:carlossa
|
||||
- fix: refs #7283 preview by:carlossa
|
||||
- fix: refs #7283 tooltips !Item by:Javier Segarra
|
||||
- fix: refs #7306 clean warning by:carlossa
|
||||
- fix: refs #7310 clean warning by:carlossa
|
||||
- fix: refs #7323 locale #7396 by:jorgep
|
||||
- fix: refs #7323 show advanced fields by:jorgep
|
||||
- fix: refs #7349 dependencia no usada by:jgallego
|
||||
- fix: refs #7524 e2e & worker module by:jorgep
|
||||
- fix: refs #7874 add title by:jorgep
|
||||
- fix: refs #7874 show name by:jorgep
|
||||
- fix: refs #7943 use correct data-key by:jorgep
|
||||
- fix: refs #7943 use summary by:jorgep
|
||||
- fix: refs #8039 bad tests by:alexm
|
||||
- fix: refs #8039 o not handle unnecessary errors by:alexm
|
||||
- fix: refs #8078 e2e #7970 by:jorgep
|
||||
- fix: refs #8078 handleSelection by:jorgep
|
||||
- fix: refs #8078 improve cy command (8078-enableMultiSelection) by:jorgep
|
||||
- fix: refs #8078 improve handleSelection by:jorgep
|
||||
- fix: reset category by:wbuezas
|
||||
- fix: tag chips by:Jon
|
||||
- fix: vnSearchbar spec (warmFix_vnSearchBar.spec) by:alexm
|
||||
- fix(VnSelect): setOptions when applyFilter by:alexm
|
||||
- fix: worker test e2e by:Jon
|
||||
- Merge branch 'dev' into fix_customer_issues by:Javier Segarra
|
||||
- refactor: revert catalog changes by:Jon
|
||||
- refs #7283 fix conflicts by:carlossa
|
||||
- refs #7283 fix descriptorproxy by:carlossa
|
||||
- refs #7283 fixedPrice by:carlossa
|
||||
- refs #7283 fixedPrices by:carlossa
|
||||
- refs #7283 fix itemFixed by:carlossa
|
||||
- refs #7283 fix itemFixedPrice by:carlossa
|
||||
- refs #7283 fix itemMigration by:carlossa
|
||||
- refs #7283 fix itemMigration list filters by:carlossa
|
||||
- refs #7283 fix items by:carlossa
|
||||
- refs #7283 fix items error get images by:carlossa
|
||||
- refs #7283 fix items images by:carlossa
|
||||
- refs #7283 fix request by:carlossa
|
||||
- refs #7283 fix searchbar by:carlossa
|
||||
- refs #7283 fix viewSummary by:carlossa
|
||||
- refs #7283 fix yml list basicData by:carlossa
|
||||
- refs #7283 itemRequest fix by:carlossa
|
||||
- refs #7283 itemRequest fix deny by:carlossa
|
||||
- refs #7283 itemRequest fix reload by:carlossa
|
||||
- refs #72983 fix filters by:carlossa
|
||||
- revert: commit by:Javier Segarra
|
||||
- revert e57a253c6f649382da187d1129449d265fb26d3b by:Javier Segarra
|
||||
- test: #8162 fix clientList spec by:Javier Segarra
|
||||
- test: #8162 fix vnLocation spec by:Javier Segarra
|
||||
- test: fix arrayData by:Javier Segarra
|
||||
- test: fix e2e by:alexm
|
||||
- test: fix e2e by:Javier Segarra
|
||||
- test: refs #8039 fix WorkerNotification e2e by:alexm
|
||||
- test: refs #8039 fix ZoneWarehouse e2e by:alexm
|
||||
- warmfix: ItemLastEntries to date (origin/warmfix_itemLastEntriesFilter) by:Javier Segarra
|
||||
|
||||
# Version 24.40 - 2024-10-02
|
||||
|
||||
### Added 🆕
|
||||
|
|
|
@ -44,14 +44,16 @@ const onDataSaved = (...args) => {
|
|||
<template #form-inputs="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="t('Names')"
|
||||
:label="t('Name')"
|
||||
v-model="data.name"
|
||||
:rules="validate('city.name')"
|
||||
required
|
||||
/>
|
||||
<VnSelectProvince
|
||||
:province-selected="$props.provinceSelected"
|
||||
:country-fk="$props.countryFk"
|
||||
v-model="data.provinceFk"
|
||||
required
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
@ -22,12 +22,14 @@ const postcodeFormData = reactive({
|
|||
townFk: null,
|
||||
});
|
||||
|
||||
const townsFetchDataRef = ref(null);
|
||||
const provincesFetchDataRef = ref(null);
|
||||
const countriesOptions = ref([]);
|
||||
const townsFetchDataRef = ref(false);
|
||||
const countriesRef = ref(false);
|
||||
const townsRef = ref(false);
|
||||
const provincesFetchDataRef = ref(false);
|
||||
const provincesOptions = ref([]);
|
||||
const townsOptions = ref([]);
|
||||
const town = ref({});
|
||||
const townFilter = ref({});
|
||||
const countryFilter = ref({});
|
||||
|
||||
function onDataSaved(formData) {
|
||||
const newPostcode = {
|
||||
|
@ -39,7 +41,7 @@ function onDataSaved(formData) {
|
|||
({ id }) => id === formData.provinceFk
|
||||
);
|
||||
newPostcode.province = provinceObject?.name;
|
||||
const countryObject = countriesOptions.value.find(
|
||||
const countryObject = countriesRef.value.opts.find(
|
||||
({ id }) => id === formData.countryFk
|
||||
);
|
||||
newPostcode.country = countryObject?.name;
|
||||
|
@ -56,10 +58,19 @@ async function onCityCreated(newTown, formData) {
|
|||
}
|
||||
|
||||
function setTown(newTown, data) {
|
||||
data.provinceFk = newTown.provinceFk;
|
||||
data.countryFk = newTown.province.countryFk;
|
||||
if (!newTown) return;
|
||||
town.value = newTown;
|
||||
data.provinceFk = newTown?.provinceFk ?? newTown;
|
||||
data.countryFk = newTown?.province?.countryFk ?? newTown;
|
||||
}
|
||||
|
||||
async function setCountry(countryFk, data) {
|
||||
data.townFk = null;
|
||||
data.provinceFk = null;
|
||||
data.countryFk = countryFk;
|
||||
}
|
||||
|
||||
async function handleProvinces(data) {
|
||||
provincesOptions.value = data;
|
||||
}
|
||||
|
||||
async function setProvince(id, data) {
|
||||
|
@ -76,69 +87,13 @@ async function onProvinceCreated(data) {
|
|||
postcodeFormData.provinceFk = data.id;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [postcodeFormData.countryFk],
|
||||
async (newCountryFk, oldValueFk) => {
|
||||
if (Array.isArray(newCountryFk)) {
|
||||
newCountryFk = newCountryFk[0];
|
||||
}
|
||||
if (Array.isArray(oldValueFk)) {
|
||||
oldValueFk = oldValueFk[0];
|
||||
}
|
||||
if (!!oldValueFk && newCountryFk !== oldValueFk) {
|
||||
postcodeFormData.provinceFk = null;
|
||||
postcodeFormData.townFk = null;
|
||||
}
|
||||
if (oldValueFk !== newCountryFk) {
|
||||
await fetchProvinces(newCountryFk);
|
||||
await fetchTowns(newCountryFk);
|
||||
}
|
||||
}
|
||||
);
|
||||
async function fetchTowns(countryFk) {
|
||||
const townsFilter = countryFk
|
||||
? {
|
||||
where: {
|
||||
provinceFk: {
|
||||
inq: provincesOptions.value.map(({ id }) => id),
|
||||
},
|
||||
},
|
||||
}
|
||||
: {};
|
||||
await townsFetchDataRef.value.fetch(townsFilter);
|
||||
}
|
||||
async function fetchProvinces(countryFk) {
|
||||
const provincesFilter = countryFk
|
||||
? {
|
||||
where: {
|
||||
countryFk: countryFk,
|
||||
},
|
||||
}
|
||||
: {};
|
||||
await provincesFetchDataRef.value.fetch(provincesFilter);
|
||||
}
|
||||
watch(
|
||||
() => postcodeFormData.provinceFk,
|
||||
async (newProvinceFk, oldValueFk) => {
|
||||
if (Array.isArray(newProvinceFk)) {
|
||||
newProvinceFk = newProvinceFk[0];
|
||||
}
|
||||
if (newProvinceFk !== oldValueFk) {
|
||||
await townsFetchDataRef.value.fetch({
|
||||
where: { provinceFk: newProvinceFk },
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
async function handleProvinces(data) {
|
||||
provincesOptions.value = data;
|
||||
}
|
||||
async function handleTowns(data) {
|
||||
townsOptions.value = data;
|
||||
}
|
||||
async function handleCountries(data) {
|
||||
countriesOptions.value = data;
|
||||
}
|
||||
const whereTowns = computed(() => {
|
||||
return {
|
||||
provinceFk: {
|
||||
inq: provincesOptions.value.map(({ id }) => id),
|
||||
},
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -150,21 +105,6 @@ async function handleCountries(data) {
|
|||
auto-load
|
||||
url="Provinces/location"
|
||||
/>
|
||||
<FetchData
|
||||
ref="townsFetchDataRef"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
@on-fetch="handleTowns"
|
||||
auto-load
|
||||
url="Towns/location"
|
||||
/>
|
||||
<FetchData
|
||||
ref="CountriesFetchDataRef"
|
||||
:sort-by="['name ASC']"
|
||||
@on-fetch="handleCountries"
|
||||
auto-load
|
||||
url="Countries"
|
||||
/>
|
||||
|
||||
<FormModelPopup
|
||||
url-create="postcodes"
|
||||
|
@ -182,19 +122,26 @@ async function handleCountries(data) {
|
|||
v-model="data.code"
|
||||
:rules="validate('postcode.code')"
|
||||
clearable
|
||||
required
|
||||
/>
|
||||
<VnSelectDialog
|
||||
ref="townsRef"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
auto-load
|
||||
url="Towns/location"
|
||||
:where="whereTowns"
|
||||
:label="t('City')"
|
||||
@update:model-value="(value) => setTown(value, data)"
|
||||
:tooltip="t('Create city')"
|
||||
v-model="data.townFk"
|
||||
:options="townsOptions"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:rules="validate('postcode.city')"
|
||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||
:emit-value="false"
|
||||
:clearable="true"
|
||||
required
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
@ -225,18 +172,25 @@ async function handleCountries(data) {
|
|||
:province-selected="data.provinceFk"
|
||||
@update:model-value="(value) => setProvince(value, data)"
|
||||
v-model="data.provinceFk"
|
||||
:clearable="true"
|
||||
@on-province-fetched="handleProvinces"
|
||||
@on-province-created="onProvinceCreated"
|
||||
required
|
||||
/>
|
||||
<VnSelect
|
||||
ref="countriesRef"
|
||||
:limit="30"
|
||||
:filter="countryFilter"
|
||||
:sort-by="['name ASC']"
|
||||
auto-load
|
||||
url="Countries"
|
||||
required
|
||||
:label="t('Country')"
|
||||
@update:options="handleCountries"
|
||||
:options="countriesOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="data.countryFk"
|
||||
:rules="validate('postcode.countryFk')"
|
||||
@update:model-value="(value) => setCountry(value, data)"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { computed, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
@ -21,15 +20,11 @@ const $props = defineProps({
|
|||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
provinces: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const autonomiesOptions = ref([]);
|
||||
const autonomiesRef = ref([]);
|
||||
|
||||
const onDataSaved = (dataSaved, requestResponse) => {
|
||||
requestResponse.autonomy = autonomiesOptions.value.find(
|
||||
requestResponse.autonomy = autonomiesRef.value.opts.find(
|
||||
(autonomy) => autonomy.id == requestResponse.autonomyFk
|
||||
);
|
||||
emit('onDataSaved', dataSaved, requestResponse);
|
||||
|
@ -43,16 +38,6 @@ const where = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (autonomiesOptions = data)"
|
||||
auto-load
|
||||
:filter="{
|
||||
where,
|
||||
}"
|
||||
url="Autonomies/location"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
/>
|
||||
<FormModelPopup
|
||||
:title="t('New province')"
|
||||
:subtitle="t('Please, ensure you put the correct data!')"
|
||||
|
@ -67,10 +52,17 @@ const where = computed(() => {
|
|||
:label="t('Name')"
|
||||
v-model="data.name"
|
||||
:rules="validate('province.name')"
|
||||
required
|
||||
/>
|
||||
<VnSelect
|
||||
required
|
||||
ref="autonomiesRef"
|
||||
auto-load
|
||||
:where="where"
|
||||
url="Autonomies/location"
|
||||
:sort-by="['name ASC']"
|
||||
:limit="30"
|
||||
:label="t('Autonomy')"
|
||||
:options="autonomiesOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
|
|
|
@ -10,6 +10,7 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
|
|||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import SkeletonTable from 'components/ui/SkeletonTable.vue';
|
||||
import { tMobile } from 'src/composables/tMobile';
|
||||
import getDifferences from 'src/filters/getDifferences';
|
||||
|
||||
const { push } = useRouter();
|
||||
const quasar = useQuasar();
|
||||
|
@ -94,6 +95,7 @@ defineExpose({
|
|||
saveChanges,
|
||||
getChanges,
|
||||
formData,
|
||||
originalData,
|
||||
vnPaginateRef,
|
||||
});
|
||||
|
||||
|
@ -174,14 +176,13 @@ async function saveChanges(data) {
|
|||
const changes = data || getChanges();
|
||||
try {
|
||||
await axios.post($props.saveUrl || $props.url + '/crud', changes);
|
||||
} catch (e) {
|
||||
return (isLoading.value = false);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
originalData.value = JSON.parse(JSON.stringify(formData.value));
|
||||
if (changes.creates?.length) await vnPaginateRef.value.fetch();
|
||||
|
||||
hasChanges.value = false;
|
||||
isLoading.value = false;
|
||||
emit('saveChanges', data);
|
||||
quasar.notify({
|
||||
type: 'positive',
|
||||
|
@ -267,28 +268,6 @@ function getChanges() {
|
|||
return changes;
|
||||
}
|
||||
|
||||
function getDifferences(obj1, obj2) {
|
||||
let diff = {};
|
||||
delete obj1.$index;
|
||||
delete obj2.$index;
|
||||
|
||||
for (let key in obj1) {
|
||||
if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
for (let key in obj2) {
|
||||
if (
|
||||
obj1[key] === undefined ||
|
||||
JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])
|
||||
) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
function isEmpty(obj) {
|
||||
if (obj == null) return true;
|
||||
if (obj === undefined) return true;
|
||||
|
|
|
@ -91,6 +91,10 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
maxWidth: {
|
||||
type: [String, Boolean],
|
||||
default: '800px',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||
const modelValue = computed(
|
||||
|
@ -106,6 +110,7 @@ const originalData = ref({});
|
|||
const formData = computed(() => state.get(modelValue));
|
||||
const defaultButtons = computed(() => ({
|
||||
save: {
|
||||
dataCy: 'saveDefaultBtn',
|
||||
color: 'primary',
|
||||
icon: 'save',
|
||||
label: 'globals.save',
|
||||
|
@ -113,6 +118,7 @@ const defaultButtons = computed(() => ({
|
|||
type: 'submit',
|
||||
},
|
||||
reset: {
|
||||
dataCy: 'resetDefaultBtn',
|
||||
color: 'primary',
|
||||
icon: 'restart_alt',
|
||||
label: 'globals.reset',
|
||||
|
@ -203,7 +209,9 @@ async function save() {
|
|||
isLoading.value = true;
|
||||
try {
|
||||
formData.value = trimData(formData.value);
|
||||
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
|
||||
const body = $props.mapper
|
||||
? $props.mapper(formData.value, originalData.value)
|
||||
: formData.value;
|
||||
const method = $props.urlCreate ? 'post' : 'patch';
|
||||
const url =
|
||||
$props.urlCreate || $props.urlUpdate || $props.url || arrayData.store.url;
|
||||
|
@ -283,6 +291,7 @@ defineExpose({
|
|||
@submit="save"
|
||||
@reset="reset"
|
||||
class="q-pa-md"
|
||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||
id="formModel"
|
||||
>
|
||||
<QCard>
|
||||
|
@ -317,6 +326,7 @@ defineExpose({
|
|||
:title="t(defaultButtons.reset.label)"
|
||||
/>
|
||||
<QBtnDropdown
|
||||
data-cy="saveAndContinueDefaultBtn"
|
||||
v-if="$props.goTo"
|
||||
@click="saveAndGo"
|
||||
:label="tMobile('globals.saveAndContinue')"
|
||||
|
@ -371,7 +381,6 @@ defineExpose({
|
|||
color: black;
|
||||
}
|
||||
#formModel {
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
||||
|
||||
const emit = defineEmits(['onProvinceCreated']);
|
||||
const emit = defineEmits(['onProvinceCreated', 'onProvinceFetched']);
|
||||
const $props = defineProps({
|
||||
countryFk: {
|
||||
type: Number,
|
||||
|
@ -50,6 +50,7 @@ watch(
|
|||
filter.value.where.countryFk = $props.countryFk;
|
||||
} else filter.value.where = {};
|
||||
await provincesFetchDataRef.value.fetch({});
|
||||
emit('onProvinceFetched', provincesOptions.value);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
@ -67,6 +68,7 @@ watch(
|
|||
:options="provincesOptions"
|
||||
:tooltip="t('Create province')"
|
||||
hide-selected
|
||||
:clearable="true"
|
||||
v-model="provinceFk"
|
||||
:rules="validate && validate('postcode.provinceFk')"
|
||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { QInput } from 'quasar';
|
||||
|
||||
const props = defineProps({
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
insertable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
||||
|
||||
let internalValue = ref(props.modelValue);
|
||||
let internalValue = ref($props.modelValue);
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
() => $props.modelValue,
|
||||
(newVal) => {
|
||||
internalValue.value = newVal;
|
||||
}
|
||||
|
@ -28,8 +32,46 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
const handleKeydown = (e) => {
|
||||
if (e.key === 'Backspace') return;
|
||||
if (e.key === '.') {
|
||||
accountShortToStandard();
|
||||
// TODO: Fix this setTimeout, with nextTick doesn't work
|
||||
setTimeout(() => {
|
||||
setCursorPosition(0, e.target);
|
||||
}, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
||||
handleInsertMode(e);
|
||||
}
|
||||
};
|
||||
function setCursorPosition(pos, el = vnInputRef.value) {
|
||||
el.focus();
|
||||
el.setSelectionRange(pos, pos);
|
||||
}
|
||||
const vnInputRef = ref(false);
|
||||
const handleInsertMode = (e) => {
|
||||
e.preventDefault();
|
||||
const input = e.target;
|
||||
const cursorPos = input.selectionStart;
|
||||
const { maxlength } = vnInputRef.value;
|
||||
let currentValue = internalValue.value;
|
||||
if (!currentValue) currentValue = e.key;
|
||||
const newValue = e.key;
|
||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
||||
internalValue.value =
|
||||
currentValue.substring(0, cursorPos) +
|
||||
newValue +
|
||||
currentValue.substring(cursorPos + 1);
|
||||
}
|
||||
nextTick(() => {
|
||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||
});
|
||||
};
|
||||
function accountShortToStandard() {
|
||||
internalValue.value = internalValue.value.replace(
|
||||
internalValue.value = internalValue.value?.replace(
|
||||
'.',
|
||||
'0'.repeat(11 - internalValue.value.length)
|
||||
);
|
||||
|
@ -37,5 +79,5 @@ function accountShortToStandard() {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<q-input v-model="internalValue" />
|
||||
<QInput @keydown="handleKeydown" ref="vnInputRef" v-model="internalValue" />
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref, useAttrs } from 'vue';
|
||||
import { computed, ref, useAttrs, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRequired } from 'src/composables/useRequired';
|
||||
|
||||
|
@ -34,6 +34,14 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
insertable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxlength: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const vnInputRef = ref(null);
|
||||
|
@ -69,6 +77,9 @@ const mixinRules = [
|
|||
requiredFieldRule,
|
||||
...($attrs.rules ?? []),
|
||||
(val) => {
|
||||
const { maxlength } = vnInputRef.value;
|
||||
if (maxlength && +val.length > maxlength)
|
||||
return t(`maxLength`, { value: maxlength });
|
||||
const { min, max } = vnInputRef.value.$attrs;
|
||||
if (!min) return null;
|
||||
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
||||
|
@ -78,6 +89,33 @@ const mixinRules = [
|
|||
}
|
||||
},
|
||||
];
|
||||
|
||||
const handleKeydown = (e) => {
|
||||
if (e.key === 'Backspace') return;
|
||||
|
||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
||||
handleInsertMode(e);
|
||||
}
|
||||
};
|
||||
|
||||
const handleInsertMode = (e) => {
|
||||
e.preventDefault();
|
||||
const input = e.target;
|
||||
const cursorPos = input.selectionStart;
|
||||
const { maxlength } = vnInputRef.value;
|
||||
let currentValue = value.value;
|
||||
if (!currentValue) currentValue = e.key;
|
||||
const newValue = e.key;
|
||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
||||
value.value =
|
||||
currentValue.substring(0, cursorPos) +
|
||||
newValue +
|
||||
currentValue.substring(cursorPos + 1);
|
||||
}
|
||||
nextTick(() => {
|
||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -89,10 +127,12 @@ const mixinRules = [
|
|||
:type="$attrs.type"
|
||||
:class="{ required: isRequired }"
|
||||
@keyup.enter="emit('keyup.enter')"
|
||||
@keydown="handleKeydown"
|
||||
:clearable="false"
|
||||
:rules="mixinRules"
|
||||
:lazy-rules="true"
|
||||
hide-bottom-space
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
||||
>
|
||||
<template v-if="$slots.prepend" #prepend>
|
||||
<slot name="prepend" />
|
||||
|
@ -129,9 +169,11 @@ const mixinRules = [
|
|||
<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">
|
||||
|
|
|
@ -306,10 +306,11 @@ function handleKeyDown(event) {
|
|||
:input-debounce="useURL ? '300' : '0'"
|
||||
:loading="isLoading"
|
||||
@virtual-scroll="onScroll"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
>
|
||||
<template v-if="isClearable" #append>
|
||||
<template #append>
|
||||
<QIcon
|
||||
v-show="value"
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click.stop="
|
||||
() => {
|
||||
|
@ -322,7 +323,22 @@ function handleKeyDown(event) {
|
|||
/>
|
||||
</template>
|
||||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
<div v-if="slotName == 'append'">
|
||||
<QIcon
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click.stop="
|
||||
() => {
|
||||
value = null;
|
||||
emit('remove');
|
||||
}
|
||||
"
|
||||
class="cursor-pointer"
|
||||
size="xs"
|
||||
/>
|
||||
<slot name="append" v-if="$slots.append" v-bind="slotData ?? {}" />
|
||||
</div>
|
||||
<slot v-else :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
</QSelect>
|
||||
</template>
|
||||
|
|
|
@ -273,6 +273,7 @@ function sanitizer(params) {
|
|||
:key="chip.label"
|
||||
:removable="!unremovableParams?.includes(chip.label)"
|
||||
@remove="remove(chip.label)"
|
||||
data-cy="vnFilterPanelChip"
|
||||
>
|
||||
<slot name="tags" :tag="chip" :format-fn="formatValue">
|
||||
<div class="q-gutter-x-xs">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { reactive, useAttrs, onBeforeMount, capitalize } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { parsePhone } from 'src/filters';
|
||||
const props = defineProps({
|
||||
phoneNumber: { type: [String, Number], default: null },
|
||||
channel: { type: Number, default: null },
|
||||
|
@ -24,9 +25,9 @@ onBeforeMount(async () => {
|
|||
.data;
|
||||
if (!channel) channel = defaultChannel;
|
||||
|
||||
config[
|
||||
type
|
||||
].href = `${url}?customerIdentity=%2B${props.phoneNumber}&channelId=${channel}`;
|
||||
config[type].href = `${url}?customerIdentity=%2B${parsePhone(
|
||||
props.phoneNumber
|
||||
)}&channelId=${channel}`;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -101,6 +101,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
@click="insert"
|
||||
class="q-mb-xs"
|
||||
dense
|
||||
data-cy="saveNote"
|
||||
/>
|
||||
</template>
|
||||
</VnInput>
|
||||
|
|
|
@ -133,7 +133,7 @@ const addFilter = async (filter, params) => {
|
|||
async function fetch(params) {
|
||||
useArrayData(props.dataKey, params);
|
||||
arrayData.reset(['filter.skip', 'skip', 'page']);
|
||||
await arrayData.fetch({ append: false });
|
||||
await arrayData.fetch({ append: false, updateRouter: mounted.value });
|
||||
return emitStoreData();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ const token = getTokenMultimedia();
|
|||
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
||||
const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
|
||||
const response = await axios.get(
|
||||
url ?? `${appUrl}/${model}/${id}${urlPath}?access_token=${token}`,
|
||||
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
|
||||
{ responseType: 'blob' }
|
||||
);
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
export default function getDifferences(obj1, obj2) {
|
||||
let diff = {};
|
||||
delete obj1.$index;
|
||||
delete obj2.$index;
|
||||
|
||||
for (let key in obj1) {
|
||||
if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
for (let key in obj2) {
|
||||
if (
|
||||
obj1[key] === undefined ||
|
||||
JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])
|
||||
) {
|
||||
diff[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
export default function getUpdatedValues(keys, formData) {
|
||||
return keys.reduce((acc, key) => {
|
||||
acc[key] = formData[key];
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
|
@ -11,11 +11,17 @@ import dashIfEmpty from './dashIfEmpty';
|
|||
import dateRange from './dateRange';
|
||||
import toHour from './toHour';
|
||||
import dashOrCurrency from './dashOrCurrency';
|
||||
import getDifferences from './getDifferences';
|
||||
import getUpdatedValues from './getUpdatedValues';
|
||||
import getParamWhere from './getParamWhere';
|
||||
import parsePhone from './parsePhone';
|
||||
import isDialogOpened from './isDialogOpened';
|
||||
|
||||
export {
|
||||
getUpdatedValues,
|
||||
getDifferences,
|
||||
isDialogOpened,
|
||||
parsePhone,
|
||||
toLowerCase,
|
||||
toLowerCamel,
|
||||
toDate,
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
export default function (phone, prefix = 34) {
|
||||
if (phone.startsWith('+')) {
|
||||
return `${phone.slice(1)}`;
|
||||
}
|
||||
if (phone.startsWith('00')) {
|
||||
return `${phone.slice(2)}`;
|
||||
}
|
||||
if (phone.startsWith(prefix) && phone.length === prefix.length + 9) {
|
||||
return `${prefix}${phone.slice(prefix.length)}`;
|
||||
}
|
||||
return `${prefix}${phone}`;
|
||||
}
|
|
@ -60,7 +60,7 @@ globals:
|
|||
reference: Reference
|
||||
agency: Agency
|
||||
warehouseOut: Warehouse Out
|
||||
wareHouseIn: Warehouse In
|
||||
warehouseIn: Warehouse In
|
||||
landed: Landed
|
||||
shipped: Shipped
|
||||
totalEntries: Total entries
|
||||
|
@ -298,6 +298,7 @@ globals:
|
|||
clientsActionsMonitor: Clients and actions
|
||||
serial: Serial
|
||||
medical: Mutual
|
||||
pit: IRPF
|
||||
RouteExtendedList: Router
|
||||
wasteRecalc: Waste recaclulate
|
||||
operator: Operator
|
||||
|
@ -767,7 +768,7 @@ travel:
|
|||
thermographs: Thermographs
|
||||
hb: HB
|
||||
basicData:
|
||||
daysInForward: Days in forward
|
||||
daysInForward: Automatic movement (Raid)
|
||||
isRaid: Raid
|
||||
thermographs:
|
||||
temperature: Temperature
|
||||
|
|
|
@ -303,6 +303,7 @@ globals:
|
|||
clientsActionsMonitor: Clientes y acciones
|
||||
serial: Facturas por serie
|
||||
medical: Mutua
|
||||
pit: IRPF
|
||||
wasteRecalc: Recalcular mermas
|
||||
operator: Operario
|
||||
parking: Parking
|
||||
|
@ -761,7 +762,7 @@ travel:
|
|||
thermographs: Termógrafos
|
||||
hb: HB
|
||||
basicData:
|
||||
daysInForward: Días redada
|
||||
daysInForward: Desplazamiento automatico (redada)
|
||||
isRaid: Redada
|
||||
thermographs:
|
||||
temperature: Temperatura
|
||||
|
|
|
@ -41,8 +41,12 @@ const fetchAccountExistence = async () => {
|
|||
};
|
||||
|
||||
const fetchMailForwards = async () => {
|
||||
const response = await axios.get(`MailForwards/${route.params.id}`);
|
||||
return response.data;
|
||||
try {
|
||||
const response = await axios.get(`MailForwards/${route.params.id}`);
|
||||
return response.data;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const deleteMailForward = async () => {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { onBeforeMount, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
|
@ -52,7 +53,6 @@ const addressFilter = {
|
|||
|
||||
onBeforeMount(() => {
|
||||
const { id } = route.params;
|
||||
getAddressesData(id);
|
||||
getClientData(id);
|
||||
});
|
||||
|
||||
|
@ -60,23 +60,10 @@ watch(
|
|||
() => route.params.id,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getAddressesData(newValue);
|
||||
getClientData(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
const getAddressesData = async (id) => {
|
||||
try {
|
||||
const { data } = await axios.get(`Clients/${id}/addresses`, {
|
||||
params: { filter: JSON.stringify(addressFilter) },
|
||||
});
|
||||
addresses.value = data;
|
||||
sortAddresses();
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
};
|
||||
|
||||
const getClientData = async (id) => {
|
||||
try {
|
||||
const { data } = await axios.get(`Clients/${id}`);
|
||||
|
@ -101,9 +88,9 @@ const setDefault = (address) => {
|
|||
});
|
||||
};
|
||||
|
||||
const sortAddresses = () => {
|
||||
if (!client.value || !addresses.value) return;
|
||||
addresses.value = addresses.value.sort((a, b) => {
|
||||
const sortAddresses = (data) => {
|
||||
if (!client.value || !data) return;
|
||||
addresses.value = data.sort((a, b) => {
|
||||
return isDefaultAddress(b) - isDefaultAddress(a);
|
||||
});
|
||||
};
|
||||
|
@ -124,8 +111,17 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
@on-fetch="sortAddresses"
|
||||
auto-load
|
||||
data-key="CustomerAddresses"
|
||||
order="id DESC"
|
||||
ref="vnPaginateRef"
|
||||
:filter="addressFilter"
|
||||
:url="`Clients/${route.params.id}/addresses`"
|
||||
/>
|
||||
<div class="full-width flex justify-center">
|
||||
<QCard class="card-width q-pa-lg" v-if="addresses.length">
|
||||
<QCard class="card-width q-pa-lg">
|
||||
<QCardSection>
|
||||
<div
|
||||
v-for="(item, index) in addresses"
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -30,6 +31,13 @@ const exprBuilder = (param, value) => {
|
|||
and: [{ active: { neq: false } }, handleSalesModelValue(value)],
|
||||
};
|
||||
};
|
||||
|
||||
function onBeforeSave(formData, originalData) {
|
||||
return getUpdatedValues(
|
||||
Object.keys(getDifferences(formData, originalData)),
|
||||
formData
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -43,7 +51,12 @@ const exprBuilder = (param, value) => {
|
|||
@on-fetch="(data) => (businessTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FormModel :url="`Clients/${route.params.id}`" auto-load model="customer">
|
||||
<FormModel
|
||||
:url="`Clients/${route.params.id}`"
|
||||
auto-load
|
||||
model="customer"
|
||||
:mapper="onBeforeSave"
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
|
@ -94,6 +107,7 @@ const exprBuilder = (param, value) => {
|
|||
:rules="validate('client.phone')"
|
||||
clearable
|
||||
v-model="data.phone"
|
||||
data-cy="customerPhone"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('customer.summary.mobile')"
|
||||
|
|
|
@ -28,12 +28,7 @@ const getBankEntities = (data, formData) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FormModel
|
||||
:url-update="`Clients/${route.params.id}`"
|
||||
:url="`Clients/${route.params.id}/getCard`"
|
||||
auto-load
|
||||
model="customer"
|
||||
>
|
||||
<FormModel :url-update="`Clients/${route.params.id}`" auto-load model="customer">
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
|
|
|
@ -93,22 +93,6 @@ const columns = computed(() => [
|
|||
<WorkerDescriptorProxy :id="row.worker.id" />
|
||||
</template>
|
||||
</VnTable>
|
||||
<!-- <QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:rows="rows"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
v-model:selected="selected"
|
||||
class="card-width q-px-lg"
|
||||
>
|
||||
<template #body-cell-employee="{ row }">
|
||||
<QTd @click.stop>
|
||||
<span class="link">{{ row.worker.user.nickname }}</span>
|
||||
<WorkerDescriptorProxy :id="row.clientFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable> -->
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -36,7 +36,10 @@ const entityId = computed(() => {
|
|||
});
|
||||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => (data.value = useCardDescription(entity?.name, entity?.id));
|
||||
const setData = (entity) => {
|
||||
data.value = useCardDescription(entity?.name, entity?.id);
|
||||
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
|
||||
};
|
||||
const debtWarning = computed(() => {
|
||||
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
|
||||
});
|
||||
|
|
|
@ -34,7 +34,6 @@ function handleLocation(data, location) {
|
|||
/>
|
||||
<FormModel
|
||||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||
:url="`Clients/${route.params.id}/getCard`"
|
||||
auto-load
|
||||
model="customer"
|
||||
>
|
||||
|
|
|
@ -1,164 +1,82 @@
|
|||
<script setup>
|
||||
import { computed, onBeforeMount, ref, watch, nextTick } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
const formModelRef = ref(false);
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const { notify } = useNotify();
|
||||
const stateStore = useStateStore();
|
||||
|
||||
const amountInputRef = ref(null);
|
||||
const initialDated = Date.vnNew();
|
||||
const unpaidClient = ref(false);
|
||||
const isLoading = ref(false);
|
||||
const amount = ref(null);
|
||||
const dated = ref(initialDated);
|
||||
|
||||
const initialData = ref({
|
||||
dated: initialDated,
|
||||
dated: Date.vnNew(),
|
||||
amount: null,
|
||||
});
|
||||
|
||||
const hasChanged = computed(() => {
|
||||
return (
|
||||
initialData.value.dated !== dated.value ||
|
||||
initialData.value.amount !== amount.value
|
||||
);
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
getData(route.params.id);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getData(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
const getData = async (id) => {
|
||||
const filter = { where: { clientFk: id } };
|
||||
try {
|
||||
const { data } = await axios.get('ClientUnpaids', {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
if (data.length) {
|
||||
setValues(data[0]);
|
||||
} else {
|
||||
defaultValues();
|
||||
}
|
||||
} catch (error) {
|
||||
defaultValues();
|
||||
}
|
||||
};
|
||||
|
||||
const setValues = (data) => {
|
||||
unpaidClient.value = true;
|
||||
amount.value = data.amount;
|
||||
dated.value = data.dated;
|
||||
initialData.value = data;
|
||||
};
|
||||
|
||||
const defaultValues = () => {
|
||||
unpaidClient.value = false;
|
||||
initialData.value.amount = null;
|
||||
setInitialData();
|
||||
};
|
||||
|
||||
const setInitialData = () => {
|
||||
amount.value = initialData.value.amount;
|
||||
dated.value = initialData.value.dated;
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
isLoading.value = true;
|
||||
|
||||
const payload = {
|
||||
amount: amount.value,
|
||||
const filterClientFindOne = {
|
||||
fields: ['unpaid', 'dated', 'amount'],
|
||||
where: {
|
||||
clientFk: route.params.id,
|
||||
dated: dated.value,
|
||||
};
|
||||
try {
|
||||
await axios.patch('ClientUnpaids', payload);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
unpaidClient.value = true;
|
||||
} catch (error) {
|
||||
notify('errors.writeRequest', 'negative');
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
watch(
|
||||
() => unpaidClient.value,
|
||||
async (val) => {
|
||||
await nextTick();
|
||||
if (val) amountInputRef.value.focus();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport v-if="stateStore?.isSubToolbarShown()" to="#st-actions">
|
||||
<QBtnGroup push class="q-gutter-x-sm">
|
||||
<QBtn
|
||||
:disabled="!hasChanged"
|
||||
:label="t('globals.reset')"
|
||||
:loading="isLoading"
|
||||
@click="setInitialData"
|
||||
color="primary"
|
||||
flat
|
||||
icon="restart_alt"
|
||||
type="reset"
|
||||
/>
|
||||
<QBtn
|
||||
:disabled="!hasChanged"
|
||||
:label="t('globals.save')"
|
||||
:loading="isLoading"
|
||||
@click="onSubmit"
|
||||
color="primary"
|
||||
icon="save"
|
||||
/>
|
||||
</QBtnGroup>
|
||||
</Teleport>
|
||||
|
||||
<div class="full-width flex justify-center">
|
||||
<QCard class="card-width q-pa-lg">
|
||||
<QForm>
|
||||
<FetchData
|
||||
:filter="filterClientFindOne"
|
||||
auto-load
|
||||
url="ClientUnpaids"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
const unpaid = data.length == 1;
|
||||
initialData = { ...data[0], unpaid };
|
||||
}
|
||||
"
|
||||
/>
|
||||
<QCard>
|
||||
<FormModel
|
||||
v-if="'unpaid' in initialData"
|
||||
:observe-form-changes="false"
|
||||
ref="formModelRef"
|
||||
model="unpaid"
|
||||
url-update="ClientUnpaids"
|
||||
:mapper="(formData) => ({ ...formData, clientFk: route.params.id })"
|
||||
:form-initial-data="initialData"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
<div class="col">
|
||||
<QCheckbox :label="t('Unpaid client')" v-model="unpaidClient" />
|
||||
</div>
|
||||
<QCheckbox :label="t('Unpaid client')" v-model="data.unpaid" />
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md" v-show="unpaidClient">
|
||||
<VnRow class="row q-gutter-md q-mb-md" v-show="data.unpaid">
|
||||
<div class="col">
|
||||
<VnInputDate :label="t('Date')" v-model="dated" />
|
||||
<VnInputDate
|
||||
data-cy="customerUnpaidDate"
|
||||
:label="t('Date')"
|
||||
v-model="data.dated"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<VnInput
|
||||
<VnInputNumber
|
||||
data-cy="customerUnpaidAmount"
|
||||
ref="amountInputRef"
|
||||
:label="t('Amount')"
|
||||
clearable
|
||||
type="number"
|
||||
v-model="amount"
|
||||
v-model="data.amount"
|
||||
autofocus
|
||||
>
|
||||
<template #append>€</template></VnInput
|
||||
<template #append>€</template></VnInputNumber
|
||||
>
|
||||
</div>
|
||||
</VnRow>
|
||||
</QForm>
|
||||
</QCard>
|
||||
</div>
|
||||
</template>
|
||||
</FormModel>
|
||||
</QCard>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -25,10 +25,9 @@ async function hasCustomerRole() {
|
|||
</script>
|
||||
<template>
|
||||
<FormModel
|
||||
url="VnUsers/preview"
|
||||
:url-update="`Clients/${route.params.id}/updateUser`"
|
||||
:filter="filter"
|
||||
model="webAccess"
|
||||
model="customer"
|
||||
:mapper="
|
||||
({ active, name, email }) => {
|
||||
return {
|
||||
|
@ -42,7 +41,7 @@ async function hasCustomerRole() {
|
|||
auto-load
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<QCheckbox :label="t('Enable web access')" v-model="data.active" />
|
||||
<QCheckbox :label="t('Enable web access')" v-model="data.account.active" />
|
||||
<VnInput :label="t('User')" clearable v-model="data.name" />
|
||||
<VnInput
|
||||
:label="t('Recovery email')"
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup>
|
||||
import { computed, onBeforeMount, ref, watch } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import axios from 'axios';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
|
||||
import { toCurrency, toDateHourMin } from 'src/filters';
|
||||
|
||||
|
@ -20,10 +20,11 @@ const filter = {
|
|||
{ relation: 'mandateType', scope: { fields: ['id', 'name'] } },
|
||||
{ relation: 'company', scope: { fields: ['id', 'code'] } },
|
||||
],
|
||||
where: { clientFk: null },
|
||||
where: { clientFk: route.params.id },
|
||||
order: ['created DESC'],
|
||||
limit: 20,
|
||||
};
|
||||
const ClientDmsRef = ref(false);
|
||||
|
||||
const tableColumnComponents = {
|
||||
state: {
|
||||
|
@ -50,7 +51,7 @@ const tableColumnComponents = {
|
|||
component: CustomerCheckIconTooltip,
|
||||
props: ({ row }) => ({
|
||||
transaction: row,
|
||||
promise: refreshData,
|
||||
promise: () => ClientDmsRef.value.fetch(),
|
||||
}),
|
||||
event: () => {},
|
||||
},
|
||||
|
@ -89,72 +90,45 @@ const columns = computed(() => [
|
|||
name: 'validate',
|
||||
},
|
||||
]);
|
||||
|
||||
onBeforeMount(() => {
|
||||
getData(route.params.id);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getData(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
const getData = async (id) => {
|
||||
filter.where.clientFk = id;
|
||||
try {
|
||||
const { data } = await axios.get('clients/transactions', {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
rows.value = data;
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
};
|
||||
|
||||
const refreshData = () => {
|
||||
getData(route.params.id);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="full-width flex justify-center">
|
||||
<QPage class="card-width q-pa-lg">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
v-if="rows?.length"
|
||||
>
|
||||
<template #body-cell="props">
|
||||
<QTd :props="props">
|
||||
<QTr :props="props">
|
||||
<component
|
||||
:is="tableColumnComponents[props.col.name].component"
|
||||
@click="
|
||||
tableColumnComponents[props.col.name].event(props)
|
||||
"
|
||||
class="rounded-borders q-pa-sm"
|
||||
v-bind="
|
||||
tableColumnComponents[props.col.name].props(props)
|
||||
"
|
||||
>
|
||||
{{ props.value }}
|
||||
</component>
|
||||
</QTr>
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
<FetchData
|
||||
ref="ClientDmsRef"
|
||||
:filter="filter"
|
||||
@on-fetch="(data) => (rows = data)"
|
||||
auto-load
|
||||
url="Clients/transactions"
|
||||
/>
|
||||
<QPage class="card-width q-pa-lg">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
v-if="rows?.length"
|
||||
>
|
||||
<template #body-cell="props">
|
||||
<QTd :props="props">
|
||||
<QTr :props="props">
|
||||
<component
|
||||
:is="tableColumnComponents[props.col.name].component"
|
||||
@click="tableColumnComponents[props.col.name].event(props)"
|
||||
class="rounded-borders q-pa-sm"
|
||||
v-bind="tableColumnComponents[props.col.name].props(props)"
|
||||
>
|
||||
{{ props.value }}
|
||||
</component>
|
||||
</QTr>
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
|
||||
<h5 class="flex justify-center color-vn-label" v-else>
|
||||
{{ t('globals.noResults') }}
|
||||
</h5>
|
||||
</QPage>
|
||||
</div>
|
||||
<h5 class="flex justify-center color-vn-label" v-else>
|
||||
{{ t('globals.noResults') }}
|
||||
</h5>
|
||||
</QPage>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -101,8 +101,8 @@ const exprBuilder = (param, value) => {
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection
|
||||
><VnSelect
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
url="Provinces"
|
||||
:label="t('Province')"
|
||||
v-model="params.provinceFk"
|
||||
|
@ -120,32 +120,31 @@ const exprBuilder = (param, value) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-md">
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput :label="t('City')" v-model="params.city" is-outlined />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput :label="t('Phone')" v-model="params.phone" is-outlined>
|
||||
<template #prepend>
|
||||
<QIcon name="phone" size="xs" />
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput :label="t('Email')" v-model="params.email" is-outlined>
|
||||
<template #prepend>
|
||||
<QIcon name="email" size="sm" />
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput :label="t('Phone')" v-model="params.phone" is-outlined>
|
||||
<template #prepend>
|
||||
<QIcon name="phone" size="xs" />
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput :label="t('Email')" v-model="params.email" is-outlined>
|
||||
<template #prepend>
|
||||
<QIcon name="email" size="sm" />
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
url="Zones"
|
||||
:label="t('Zone')"
|
||||
|
@ -160,18 +159,17 @@ const exprBuilder = (param, value) => {
|
|||
outlined
|
||||
rounded
|
||||
auto-load
|
||||
/></QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Postcode')"
|
||||
v-model="params.postcode"
|
||||
is-outlined
|
||||
/>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Postcode')"
|
||||
v-model="params.postcode"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QExpansionItem>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -203,7 +201,6 @@ es:
|
|||
Salesperson: Comercial
|
||||
Province: Provincia
|
||||
City: Ciudad
|
||||
More options: Más opciones
|
||||
Phone: Teléfono
|
||||
Email: Email
|
||||
Zone: Zona
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<script setup>
|
||||
import { onBeforeMount, reactive, ref } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import axios from 'axios';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
|
@ -25,20 +24,6 @@ const agencyModes = ref([]);
|
|||
const incoterms = ref([]);
|
||||
const customsAgents = ref([]);
|
||||
|
||||
onBeforeMount(() => {
|
||||
urlCreate.value = `Clients/${route.params.id}/createAddress`;
|
||||
getCustomsAgents();
|
||||
});
|
||||
|
||||
const getCustomsAgents = async () => {
|
||||
const { data } = await axios.get('CustomsAgents');
|
||||
customsAgents.value = data;
|
||||
};
|
||||
|
||||
const refreshData = () => {
|
||||
getCustomsAgents();
|
||||
};
|
||||
|
||||
const toCustomerAddress = () => {
|
||||
router.push({
|
||||
name: 'CustomerAddress',
|
||||
|
@ -54,6 +39,11 @@ function handleLocation(data, location) {
|
|||
data.provinceFk = provinceFk;
|
||||
data.countryFk = countryFk;
|
||||
}
|
||||
|
||||
function onAgentCreated(requestResponse, data) {
|
||||
customsAgents.value.push(requestResponse);
|
||||
data.customsAgentFk = requestResponse.id;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -139,6 +129,7 @@ function handleLocation(data, location) {
|
|||
/>
|
||||
|
||||
<VnSelectDialog
|
||||
url="CustomsAgents"
|
||||
:label="t('Customs agent')"
|
||||
:options="customsAgents"
|
||||
hide-selected
|
||||
|
@ -148,7 +139,12 @@ function handleLocation(data, location) {
|
|||
:tooltip="t('Create a new expense')"
|
||||
>
|
||||
<template #form>
|
||||
<CustomerNewCustomsAgent @on-data-saved="refreshData()" />
|
||||
<CustomerNewCustomsAgent
|
||||
@on-data-saved="
|
||||
(_, requestResponse) =>
|
||||
onAgentCreated(requestResponse, data)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</VnSelectDialog>
|
||||
</VnRow>
|
||||
|
|
|
@ -144,7 +144,7 @@ function handleLocation(data, location) {
|
|||
:url="`Addresses/${route.params.addressId}`"
|
||||
@on-data-saved="onDataSaved()"
|
||||
auto-load
|
||||
model="client"
|
||||
model="customer"
|
||||
>
|
||||
<template #moreActions>
|
||||
<QBtn
|
||||
|
|
|
@ -82,11 +82,11 @@ const entriesTableColumns = computed(() => [
|
|||
</QCardSection>
|
||||
<QCardActions align="right">
|
||||
<QBtn
|
||||
:label="t('printLabels')"
|
||||
:label="t('myEntries.printLabels')"
|
||||
color="primary"
|
||||
icon="print"
|
||||
:loading="isLoading"
|
||||
@click="openReport(`Entries/${entityId}/print`)"
|
||||
@click="openReport(`Entries/${entityId}/labelSupplier`)"
|
||||
unelevated
|
||||
autofocus
|
||||
/>
|
||||
|
@ -126,7 +126,9 @@ const entriesTableColumns = computed(() => [
|
|||
"
|
||||
unelevated
|
||||
>
|
||||
<QTooltip>{{ t('viewLabel') }}</QTooltip>
|
||||
<QTooltip>{{
|
||||
t('myEntries.viewLabel')
|
||||
}}</QTooltip>
|
||||
</QBtn>
|
||||
</QTr>
|
||||
</template>
|
||||
|
|
|
@ -101,7 +101,7 @@ const columns = computed(() => [
|
|||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('printLabels'),
|
||||
title: t('myEntries.printLabels'),
|
||||
icon: 'print',
|
||||
isPrimary: true,
|
||||
action: (row) => printBuys(row.id),
|
||||
|
|
|
@ -184,5 +184,4 @@ es:
|
|||
Amount: Importe
|
||||
Issued: Fecha factura
|
||||
Id or supplier: Id o proveedor
|
||||
More options: Más opciones
|
||||
</i18n>
|
||||
|
|
|
@ -83,36 +83,29 @@ const states = ref();
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.issued"
|
||||
:label="t('Issued')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.created"
|
||||
:label="t('Created')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.dued"
|
||||
:label="t('Dued')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QExpansionItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.issued"
|
||||
:label="t('Issued')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.created"
|
||||
:label="t('Created')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate v-model="params.dued" :label="t('Dued')" is-outlined />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -149,5 +142,4 @@ es:
|
|||
Issued: Fecha emisión
|
||||
Created: Fecha creación
|
||||
Dued: Fecha vencimiento
|
||||
More options: Más opciones
|
||||
</i18n>
|
||||
|
|
|
@ -60,8 +60,15 @@ const columns = computed(() => [
|
|||
label: t('globals.reference'),
|
||||
isTitle: true,
|
||||
component: 'select',
|
||||
attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' },
|
||||
attrs: {
|
||||
url: MODEL,
|
||||
optionLabel: 'ref',
|
||||
optionValue: 'ref',
|
||||
},
|
||||
columnField: { component: null },
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -139,25 +146,22 @@ function openPdf(id) {
|
|||
}
|
||||
|
||||
function downloadPdf() {
|
||||
if (selectedRows.value.size === 0) return;
|
||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
||||
if (selectedRows.value.size === 0) return;
|
||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
||||
|
||||
if (selectedRows.value.size === 1) {
|
||||
const [invoiceOut] = selectedCardsArray;
|
||||
openPdf(invoiceOut.id);
|
||||
} else {
|
||||
const invoiceOutIdsArray = selectedCardsArray.map(
|
||||
(invoiceOut) => invoiceOut.id
|
||||
);
|
||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||
if (selectedRows.value.size === 1) {
|
||||
const [invoiceOut] = selectedCardsArray;
|
||||
openPdf(invoiceOut.id);
|
||||
} else {
|
||||
const invoiceOutIdsArray = selectedCardsArray.map((invoiceOut) => invoiceOut.id);
|
||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||
|
||||
const params = {
|
||||
ids: invoiceOutIds,
|
||||
};
|
||||
|
||||
openReport(`${MODEL}/downloadZip`, params);
|
||||
}
|
||||
const params = {
|
||||
ids: invoiceOutIds,
|
||||
};
|
||||
|
||||
openReport(`${MODEL}/downloadZip`, params);
|
||||
}
|
||||
}
|
||||
|
||||
watchEffect(selectedRows);
|
||||
|
|
|
@ -66,6 +66,7 @@ const insertTag = (rows) => {
|
|||
<FetchData
|
||||
url="Tags"
|
||||
:filter="{ fields: ['id', 'name', 'isFree', 'sourceTable'] }"
|
||||
sort-by="name"
|
||||
@on-fetch="(data) => (tagOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
|
|
@ -18,7 +18,7 @@ const groupedStates = ref();
|
|||
const handleScopeDays = (params, days, callback) => {
|
||||
const [from, to] = dateRange(Date.vnNew());
|
||||
if (!days) {
|
||||
Object.assign(params, { from, to, scopeDays: 1 });
|
||||
Object.assign(params, { from, to, scopeDays: 0 });
|
||||
} else {
|
||||
params.from = from;
|
||||
to.setDate(to.getDate() + days);
|
||||
|
@ -59,7 +59,7 @@ const getLocale = (label) => {
|
|||
</template>
|
||||
<template #customTags="{ params, searchFn, formatFn }">
|
||||
<VnFilterPanelChip
|
||||
v-if="params.scopeDays"
|
||||
v-if="params.scopeDays !== null"
|
||||
removable
|
||||
@remove="handleScopeDays(params, null, searchFn)"
|
||||
>
|
||||
|
|
|
@ -25,11 +25,8 @@ const provinceOpts = ref([]);
|
|||
const stateOpts = ref([]);
|
||||
const zoneOpts = ref([]);
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const from = Date.vnNew();
|
||||
from.setHours(0, 0, 0, 0);
|
||||
const to = new Date(from.getTime());
|
||||
to.setDate(to.getDate() + 1);
|
||||
to.setHours(23, 59, 59, 999);
|
||||
|
||||
const [from, to] = dateRange(Date.vnNew());
|
||||
const stateColors = {
|
||||
notice: 'info',
|
||||
success: 'positive',
|
||||
|
@ -340,7 +337,7 @@ const openTab = (id) =>
|
|||
auto-load
|
||||
:row-click="({ id }) => openTab(id)"
|
||||
:disable-option="{ card: true }"
|
||||
:user-params="{ from, to, scopeDays: 1 }"
|
||||
:user-params="{ from, to, scopeDays: 0 }"
|
||||
>
|
||||
<template #top-left>
|
||||
<QBtn
|
||||
|
|
|
@ -36,7 +36,6 @@ const getSelectedTagValues = async (tag) => {
|
|||
const filter = {
|
||||
fields: ['value'],
|
||||
order: 'value ASC',
|
||||
limit: 30,
|
||||
};
|
||||
|
||||
const url = `Tags/${tag?.id}/filterValue`;
|
||||
|
@ -50,7 +49,7 @@ const getSelectedTagValues = async (tag) => {
|
|||
|
||||
<template>
|
||||
<QForm @submit="applyTags()" class="all-pointer-events">
|
||||
<QCard class="q-pa-sm column q-pa-lg">
|
||||
<QCard class="q-pa-sm column q-pa-lg" data-cy="catalogFilterValueDialog">
|
||||
<VnSelect
|
||||
:label="t('params.tag')"
|
||||
v-model="selectedTag"
|
||||
|
@ -64,6 +63,7 @@ const getSelectedTagValues = async (tag) => {
|
|||
:emit-value="false"
|
||||
use-input
|
||||
@update:model-value="getSelectedTagValues"
|
||||
data-cy="catalogFilterValueDialogTagSelect"
|
||||
/>
|
||||
<div
|
||||
v-for="(value, index) in tagValues"
|
||||
|
@ -94,6 +94,7 @@ const getSelectedTagValues = async (tag) => {
|
|||
:disable="!value"
|
||||
is-outlined
|
||||
class="col"
|
||||
data-cy="catalogFilterValueDialogValueInput"
|
||||
/>
|
||||
<QBtn
|
||||
icon="delete"
|
||||
|
|
|
@ -98,7 +98,7 @@ watch(
|
|||
/>
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
||||
<div class="full-width">
|
||||
<VnPaginate
|
||||
:data-key="dataKey"
|
||||
|
@ -118,6 +118,7 @@ watch(
|
|||
:item="row"
|
||||
is-catalog
|
||||
class="fill-icon"
|
||||
data-cy="orderCatalogItem"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -178,6 +178,7 @@ function addOrder(value, field, params) {
|
|||
? resetCategory(params, searchFn)
|
||||
: removeTagGroupParam(params, searchFn, valIndex)
|
||||
"
|
||||
data-cy="catalogFilterCustomTag"
|
||||
>
|
||||
<strong v-if="customTag.label === 'categoryFk' && categoryList">
|
||||
{{
|
||||
|
@ -211,6 +212,7 @@ function addOrder(value, field, params) {
|
|||
:name="category.icon"
|
||||
class="category-icon"
|
||||
@click="selectCategory(params, category, searchFn)"
|
||||
data-cy="catalogFilterCategory"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t(category.name) }}
|
||||
|
@ -234,6 +236,7 @@ function addOrder(value, field, params) {
|
|||
sort-by="name ASC"
|
||||
:disable="!params.categoryFk"
|
||||
@update:model-value="searchFn()"
|
||||
data-cy="catalogFilterType"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
@ -285,6 +288,7 @@ function addOrder(value, field, params) {
|
|||
:is-clearable="false"
|
||||
v-model="searchByTag"
|
||||
@keyup.enter="(val) => onSearchByTag(val, params)"
|
||||
data-cy="catalogFilterValueInput"
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="search" />
|
||||
|
@ -297,6 +301,7 @@ function addOrder(value, field, params) {
|
|||
color="primary"
|
||||
size="md"
|
||||
dense
|
||||
data-cy="catalogFilterValueDialogBtn"
|
||||
/>
|
||||
<QPopupProxy>
|
||||
<CatalogFilterValueDialog
|
||||
|
|
|
@ -15,6 +15,7 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
|
|||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import { toDateTimeFormat } from 'src/filters/date';
|
||||
import { useRoute } from 'vue-router';
|
||||
import dataByOrder from 'src/utils/dataByOrder';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -149,7 +150,12 @@ onMounted(() => {
|
|||
});
|
||||
async function fetchClientAddress(id, formData = {}) {
|
||||
const { data } = await axios.get(`Clients/${id}`, {
|
||||
params: { filter: { include: { relation: 'addresses' } } },
|
||||
params: {
|
||||
filter: {
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
include: { relation: 'addresses' },
|
||||
},
|
||||
},
|
||||
});
|
||||
addressesList.value = data.addresses;
|
||||
formData.addressId = data.defaultAddressFk;
|
||||
|
@ -162,7 +168,7 @@ async function fetchAgencies({ landed, addressId }) {
|
|||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: { addressFk: addressId, landed },
|
||||
});
|
||||
agencyList.value = data;
|
||||
agencyList.value = dataByOrder(data, 'agencyMode ASC');
|
||||
}
|
||||
|
||||
const getDateColor = (date) => {
|
||||
|
@ -191,7 +197,7 @@ const getDateColor = (date) => {
|
|||
urlCreate: 'Orders/new',
|
||||
title: t('module.cerateOrder'),
|
||||
onDataSaved: (url) => {
|
||||
tableRef.redirect(`${url}/catalog`);
|
||||
tableRef.redirect(`${url}/catalog`);
|
||||
},
|
||||
formInitialData: {
|
||||
active: true,
|
||||
|
@ -253,22 +259,27 @@ const getDateColor = (date) => {
|
|||
@update:model-value="() => fetchAgencies(data)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
:class="{ disabled: !scope.opt.isActive }"
|
||||
>
|
||||
<QItemSection style="min-width: min-content" avatar>
|
||||
<QIcon
|
||||
v-if="
|
||||
scope.opt.isActive && data.addressId === scope.opt.id
|
||||
"
|
||||
size="sm"
|
||||
color="grey"
|
||||
name="star"
|
||||
class="fill-icon"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
:class="{
|
||||
'color-vn-label': !scope.opt?.isActive,
|
||||
}"
|
||||
>
|
||||
{{
|
||||
`${
|
||||
!scope.opt?.isActive
|
||||
? t('basicData.inactive')
|
||||
: ''
|
||||
} `
|
||||
}}
|
||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }}
|
||||
<QItemLabel>
|
||||
{{ scope.opt.nickname }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `${scope.opt.street}, ${scope.opt.city}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -24,13 +24,14 @@ const supplier = ref(null);
|
|||
const supplierAccountRef = ref(null);
|
||||
const wireTransferFk = ref(null);
|
||||
const bankEntitiesOptions = ref([]);
|
||||
const filteredBankEntitiesOptions = ref([]);
|
||||
|
||||
const onBankEntityCreated = async (dataSaved, rowData) => {
|
||||
await bankEntitiesRef.value.fetch();
|
||||
rowData.bankEntityFk = dataSaved.id;
|
||||
};
|
||||
|
||||
const onChangesSaved = () => {
|
||||
const onChangesSaved = async () => {
|
||||
if (supplier.value.payMethodFk !== wireTransferFk.value)
|
||||
quasar
|
||||
.dialog({
|
||||
|
@ -55,12 +56,35 @@ const setWireTransfer = async () => {
|
|||
await axios.patch(`Suppliers/${route.params.id}`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
};
|
||||
|
||||
function findBankFk(value, row) {
|
||||
row.bankEntityFk = null;
|
||||
if (!value) return;
|
||||
|
||||
const bankEntityFk = bankEntitiesOptions.value.find((b) => b.id == value.slice(4, 8));
|
||||
if (bankEntityFk) row.bankEntityFk = bankEntityFk.id;
|
||||
}
|
||||
|
||||
function bankEntityFilter(val, update) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
filteredBankEntitiesOptions.value = bankEntitiesOptions.value.filter(
|
||||
(bank) =>
|
||||
bank.bic.toLowerCase().startsWith(needle) ||
|
||||
bank.name.toLowerCase().includes(needle)
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
ref="bankEntitiesRef"
|
||||
url="BankEntities"
|
||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
(bankEntitiesOptions = data), (filteredBankEntitiesOptions = data);
|
||||
}
|
||||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
|
@ -98,6 +122,7 @@ const setWireTransfer = async () => {
|
|||
<VnInput
|
||||
:label="t('supplier.accounts.iban')"
|
||||
v-model="row.iban"
|
||||
@update:model-value="(value) => findBankFk(value, row)"
|
||||
:required="true"
|
||||
>
|
||||
<template #append>
|
||||
|
@ -109,7 +134,9 @@ const setWireTransfer = async () => {
|
|||
<VnSelectDialog
|
||||
:label="t('worker.create.bankEntity')"
|
||||
v-model="row.bankEntityFk"
|
||||
:options="bankEntitiesOptions"
|
||||
:options="filteredBankEntitiesOptions"
|
||||
:default-filter="false"
|
||||
@filter="(val, update) => bankEntityFilter(val, update)"
|
||||
option-label="bic"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import VnAccountNumber from 'src/components/common/VnAccountNumber.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -100,10 +101,13 @@ function handleLocation(data, location) {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInput
|
||||
<VnAccountNumber
|
||||
v-model="data.account"
|
||||
:label="t('supplier.fiscalData.account')"
|
||||
clearable
|
||||
data-cy="supplierFiscalDataAccount"
|
||||
insertable
|
||||
:maxlength="10"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('supplier.fiscalData.sageTaxTypeFk')"
|
||||
|
|
|
@ -124,8 +124,7 @@ const columns = computed(() => [
|
|||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
Search suppliers: Search suppliers
|
||||
es:
|
||||
es:
|
||||
Search suppliers: Buscar proveedores
|
||||
Create Supplier: Crear proveedor
|
||||
</i18n>
|
||||
|
|
|
@ -321,10 +321,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
<div class="column">
|
||||
<span v-for="(saleComponent, index) in row.components" :key="index">
|
||||
{{ toCurrency(saleComponent.value * row.quantity, 'EUR', 3) }}
|
||||
<!-- <QTooltip>
|
||||
{{ saleComponent.component?.name }}:
|
||||
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
|
||||
</QTooltip> -->
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -676,7 +676,7 @@ async function uploadDocuware(force) {
|
|||
<VnConfirm
|
||||
ref="weightDialog"
|
||||
:title="t('Set weight')"
|
||||
:message="t('This ticket may be invoiced, do you want to continue?')"
|
||||
:message="false"
|
||||
:promise="actions.setWeight"
|
||||
>
|
||||
<template #customHTML>
|
||||
|
@ -741,7 +741,6 @@ es:
|
|||
Ticket invoiced: Ticket facturado
|
||||
Set weight: Establecer peso
|
||||
Weight set: Peso establecido
|
||||
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
|
||||
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
||||
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
|
||||
You are going to delete this ticket: Vas a eliminar este ticket
|
||||
|
|
|
@ -181,20 +181,44 @@ const resetChanges = async () => {
|
|||
arrayData.fetch({ append: false });
|
||||
tableRef.value.reload();
|
||||
};
|
||||
const rowToUpdate = ref(null);
|
||||
const changeQuantity = async (sale) => {
|
||||
canProceed.value = await isSalePrepared(sale);
|
||||
if (!canProceed.value) return;
|
||||
if (
|
||||
!sale.itemFk ||
|
||||
sale.quantity == null ||
|
||||
edit.value?.oldQuantity === sale.quantity
|
||||
)
|
||||
return;
|
||||
if (!sale.id) return addSale(sale);
|
||||
|
||||
const updateQuantity = async (sale) => {
|
||||
const payload = { quantity: sale.quantity };
|
||||
await axios.post(`Sales/${sale.id}/updateQuantity`, payload);
|
||||
try {
|
||||
if (!rowToUpdate.value) return;
|
||||
rowToUpdate.value = null;
|
||||
await updateQuantity(sale);
|
||||
} catch (e) {
|
||||
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
||||
(s) => s.id === sale.id
|
||||
);
|
||||
sale.quantity = quantity;
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
const updateQuantity = async ({ quantity, id }) => {
|
||||
const params = { quantity: quantity };
|
||||
await axios.post(`Sales/${id}/updateQuantity`, params);
|
||||
notify('globals.dataSaved', 'positive');
|
||||
};
|
||||
|
||||
const addSale = async (sale) => {
|
||||
const payload = {
|
||||
const params = {
|
||||
barcode: sale.itemFk,
|
||||
quantity: sale.quantity,
|
||||
};
|
||||
|
||||
const { data } = await axios.post(`tickets/${route.params.id}/addSale`, payload);
|
||||
const { data } = await axios.post(`tickets/${route.params.id}/addSale`, params);
|
||||
|
||||
if (!data) return;
|
||||
|
||||
|
@ -212,19 +236,6 @@ const addSale = async (sale) => {
|
|||
window.location.reload();
|
||||
};
|
||||
|
||||
const changeQuantity = async (sale) => {
|
||||
canProceed.value = await isSalePrepared(sale);
|
||||
if (!canProceed.value) return;
|
||||
if (
|
||||
!sale.itemFk ||
|
||||
sale.quantity == null ||
|
||||
edit.value?.oldQuantity === sale.quantity
|
||||
)
|
||||
return;
|
||||
if (!sale.id) return addSale(sale);
|
||||
updateQuantity(sale);
|
||||
};
|
||||
|
||||
const updateConcept = async (sale) => {
|
||||
canProceed.value = await isSalePrepared(sale);
|
||||
if (!canProceed.value) return;
|
||||
|
@ -771,16 +782,12 @@ watch(
|
|||
</template>
|
||||
<template #column-quantity="{ row }">
|
||||
<VnInput
|
||||
v-if="row.isNew"
|
||||
v-model.number="row.quantity"
|
||||
v-if="row.isNew || isTicketEditable"
|
||||
type="number"
|
||||
@blur="changeQuantity(row)"
|
||||
@focus="edit.oldQuantity = row.quantity"
|
||||
/>
|
||||
<VnInput
|
||||
v-else-if="isTicketEditable"
|
||||
v-model.number="row.quantity"
|
||||
@blur="changeQuantity(row)"
|
||||
@keyup.enter="changeQuantity(row)"
|
||||
@update:model-value="() => (rowToUpdate = row)"
|
||||
@focus="edit.oldQuantity = row.quantity"
|
||||
/>
|
||||
<span v-else>{{ row.quantity }}</span>
|
||||
|
|
|
@ -471,7 +471,7 @@ const qCheckBoxController = (sale, action) => {
|
|||
url="Shelvings"
|
||||
hide-selected
|
||||
option-label="code"
|
||||
option-value="code"
|
||||
option-value="id"
|
||||
v-model="row.shelvingFk"
|
||||
@update:model-value="updateShelving(row)"
|
||||
style="max-width: 120px"
|
||||
|
|
|
@ -258,7 +258,7 @@ function toTicketUrl(section) {
|
|||
<QCard class="vn-one" v-if="entity.notes.length">
|
||||
<VnTitle
|
||||
:url="toTicketUrl('observation')"
|
||||
:text="t('ticket.pageTitles.notes')"
|
||||
:text="t('globals.pageTitles.notes')"
|
||||
/>
|
||||
<QVirtualScroll
|
||||
:items="entity.notes"
|
||||
|
|
|
@ -212,81 +212,78 @@ const getGroupedStates = (data) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<QItem>
|
||||
<QItemSection v-if="!provinces">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="provinces">
|
||||
<QSelect
|
||||
:label="t('Province')"
|
||||
v-model="params.provinceFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="provinces"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection v-if="!agencies">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="agencies">
|
||||
<QSelect
|
||||
:label="t('Agency')"
|
||||
v-model="params.agencyModeFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="agencies"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection v-if="!warehouses">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="warehouses">
|
||||
<QSelect
|
||||
:label="t('Warehouse')"
|
||||
v-model="params.warehouseFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="warehouses"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.collectionFk"
|
||||
:label="t('Collection')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QExpansionItem>
|
||||
<QItem>
|
||||
<QItemSection v-if="!provinces">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="provinces">
|
||||
<QSelect
|
||||
:label="t('Province')"
|
||||
v-model="params.provinceFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="provinces"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection v-if="!agencies">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="agencies">
|
||||
<QSelect
|
||||
:label="t('Agency')"
|
||||
v-model="params.agencyModeFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="agencies"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection v-if="!warehouses">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="warehouses">
|
||||
<QSelect
|
||||
:label="t('Warehouse')"
|
||||
v-model="params.warehouseFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="warehouses"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.collectionFk"
|
||||
:label="t('Collection')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -340,7 +337,6 @@ es:
|
|||
With problems: Con problemas
|
||||
Invoiced: Facturado
|
||||
Routed: Enrutado
|
||||
More options: Más opciones
|
||||
Province: Provincia
|
||||
Agency: Agencia
|
||||
Warehouse: Almacén
|
||||
|
|
|
@ -274,7 +274,7 @@ const fetchAddresses = async (formData) => {
|
|||
|
||||
const filter = {
|
||||
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
|
||||
order: 'nickname ASC',
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||
|
@ -590,7 +590,22 @@ function setReference(data) {
|
|||
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
:class="{ disabled: !scope.opt.isActive }"
|
||||
>
|
||||
<QItemSection style="min-width: min-content" avatar>
|
||||
<QIcon
|
||||
v-if="
|
||||
scope.opt.isActive &&
|
||||
selectedClient?.defaultAddressFk === scope.opt.id
|
||||
"
|
||||
size="sm"
|
||||
color="grey"
|
||||
name="star"
|
||||
class="fill-icon"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
:class="{
|
||||
|
|
|
@ -14,6 +14,8 @@ const route = useRoute();
|
|||
const { t } = useI18n();
|
||||
|
||||
const agenciesOptions = ref([]);
|
||||
const warehousesOptionsOut = ref([]);
|
||||
const warehousesOptionsIn = ref([]);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -21,6 +23,18 @@ const agenciesOptions = ref([]);
|
|||
@on-fetch="(data) => (agenciesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
@on-fetch="(data) => (warehousesOptionsOut = data)"
|
||||
auto-load
|
||||
:filter="{ where: { isOrigin: TRUE } }"
|
||||
/>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
@on-fetch="(data) => (warehousesOptionsIn = data)"
|
||||
auto-load
|
||||
:filter="{ where: { isDestiny: TRUE } }"
|
||||
/>
|
||||
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel" auto-load>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
|
@ -39,11 +53,12 @@ const agenciesOptions = ref([]);
|
|||
<VnInputDate v-model="data.shipped" :label="t('globals.shipped')" />
|
||||
<VnInputDate v-model="data.landed" :label="t('globals.landed')" />
|
||||
</VnRow>
|
||||
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('globals.warehouseOut')"
|
||||
v-model="data.warehouseOutFk"
|
||||
:options="agenciesOptions"
|
||||
:options="warehousesOptionsOut"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
map-options
|
||||
|
@ -52,7 +67,7 @@ const agenciesOptions = ref([]);
|
|||
<VnSelect
|
||||
:label="t('globals.warehouseIn')"
|
||||
v-model="data.warehouseInFk"
|
||||
:options="agenciesOptions"
|
||||
:options="warehousesOptionsIn"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
map-options
|
||||
|
@ -89,7 +104,7 @@ const agenciesOptions = ref([]);
|
|||
|
||||
<i18n>
|
||||
es:
|
||||
raidDays: Si se marca "Redada", la fecha de entrega se moverá automáticamente los días indicados (incluido 0). Si se deja vacio, la fecha no cambiará
|
||||
raidDays: El travel se desplaza automáticamente cada día para estar desde hoy al número de días indicado. Si se deja vacio no se moverá
|
||||
en:
|
||||
raidDays: If "Raid" is checked, the landing date will automatically shift by the specified number of days (including 0). If left empty, the date will stay the same.
|
||||
raidDays: The travel adjusts itself daily to match the number of days set, starting from today. If left blank, it won’t move
|
||||
</i18n>
|
||||
|
|
|
@ -44,8 +44,8 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
|||
<TravelDescriptorMenuItems :travel="entity" />
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('globals.warehouseIn')" :value="entity.warehouseIn.name" />
|
||||
<VnLv :label="t('globals.warehouseOut')" :value="entity.warehouseOut.name" />
|
||||
<VnLv :label="t('globals.warehouseIn')" :value="entity.warehouseIn?.name" />
|
||||
<VnLv :label="t('globals.warehouseOut')" :value="entity.warehouseOut?.name" />
|
||||
<VnLv :label="t('globals.shipped')" :value="toDate(entity.shipped)" />
|
||||
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" />
|
||||
<VnLv :label="t('globals.totalEntries')" :value="entity.totalEntries" />
|
||||
|
|
|
@ -0,0 +1,263 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import axios from 'axios';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'src/components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import CrudModel from 'components/CrudModel.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
const { notify } = useNotify();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const disabilityGradesOptions = ref();
|
||||
const workerPitCrudRef = ref({});
|
||||
const insertTag = () => {
|
||||
workerPitCrudRef.value.insert();
|
||||
};
|
||||
const quasar = useQuasar();
|
||||
const deleteRelative = async (id) => {
|
||||
await new Promise((resolve) => {
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('Remove Relative'),
|
||||
message: t('Do you want to remove this relative?'),
|
||||
},
|
||||
})
|
||||
.onOk(() => {
|
||||
resolve(true);
|
||||
})
|
||||
.onCancel(() => {
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
await axios.delete(`WorkerRelatives/${id}`);
|
||||
workerPitCrudRef.value.reload();
|
||||
notify('Relative removed', 'positive');
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="DisabilityGrades"
|
||||
@on-fetch="(data) => (disabilityGradesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
||||
<FormModel
|
||||
url="WorkerIrpfs"
|
||||
:filter="{ where: { workerFk: route.params.id } }"
|
||||
auto-load
|
||||
data-key="workerIrpfs"
|
||||
:max-width="false"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<QCard class="q-px-lg q-py-lg">
|
||||
<VnTitle :text="t('IRPF')" />
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="t('familySituation')"
|
||||
clearable
|
||||
v-model="data.familySituation"
|
||||
/>
|
||||
<VnInput :label="t('spouseNif')" clearable v-model="data.spouseNif" />
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('disabilityGrades')"
|
||||
:options="disabilityGradesOptions"
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="data.disabilityGradeFk"
|
||||
id="disabilityGrades"
|
||||
data-cy="disabilityGrades"
|
||||
hide-selected
|
||||
/>
|
||||
|
||||
<VnInputDate
|
||||
:label="t('geographicMobilityDate')"
|
||||
v-model="data.geographicMobilityDate"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInput
|
||||
clearable
|
||||
v-model="data.childPension"
|
||||
:label="t(`childPension`)"
|
||||
/>
|
||||
<VnInput
|
||||
clearable
|
||||
v-model="data.spousePension"
|
||||
:label="t(`spousePension`)"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QCheckbox v-model="data.isDependend" :label="t(`isDependend`)" />
|
||||
<QCheckbox
|
||||
v-model="data.hasHousingPaymentBefore"
|
||||
:label="t(`hasHousingPaymentBefore`)"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QCheckbox
|
||||
v-model="data.hasHousingPaymentAfter"
|
||||
:label="t(`hasHousingPaymentAfter`)"
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="data.hasExtendedWorking"
|
||||
:label="t(`hasExtendedWorking`)"
|
||||
/>
|
||||
</VnRow>
|
||||
</QCard>
|
||||
|
||||
<CrudModel
|
||||
ref="workerPitCrudRef"
|
||||
data-key="workerPit"
|
||||
url="WorkerRelatives"
|
||||
auto-load
|
||||
:filter="{
|
||||
where: { workerFk: route.params.id },
|
||||
}"
|
||||
:data-required="{ workerFk: route.params.id }"
|
||||
:has-sub-toolbar="false"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QCard class="q-px-lg q-py-lg" flat>
|
||||
<div class="row no-wrap justify-between q-pb-md">
|
||||
<VnTitle :text="t('Relatives')" />
|
||||
<QBtnGroup push style="column-gap: 10px">
|
||||
<QBtn
|
||||
color="primary"
|
||||
icon="restart_alt"
|
||||
flat
|
||||
@click="workerPitCrudRef.reset"
|
||||
:disable="!workerPitCrudRef.hasChanges"
|
||||
:title="t('globals.reset')"
|
||||
/>
|
||||
<QBtn
|
||||
ref="saveButtonRef"
|
||||
color="primary"
|
||||
icon="save"
|
||||
@click="workerPitCrudRef.onSubmit"
|
||||
:disable="!workerPitCrudRef.hasChanges"
|
||||
:title="t('globals.save')"
|
||||
data-cy="workerPitRelativeSaveBtn"
|
||||
/>
|
||||
</QBtnGroup>
|
||||
</div>
|
||||
<div
|
||||
v-for="(row, index) in rows"
|
||||
:key="index"
|
||||
class="row no-wrap q-mb-lg q-gutter-lg"
|
||||
padding="none"
|
||||
>
|
||||
<VnSelect
|
||||
:options="[
|
||||
{ id: 0, name: 'Ascendiente' },
|
||||
{ id: 1, name: 'Descendiente' },
|
||||
]"
|
||||
:label="t('isDescendant')"
|
||||
v-model="row.isDescendant"
|
||||
class="q-gutter-xs q-mb-xs"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('disabilityGrades')"
|
||||
:options="disabilityGradesOptions"
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="row.disabilityGradeFk"
|
||||
class="q-gutter-xs q-mb-xs"
|
||||
/>
|
||||
<VnInput
|
||||
type="number"
|
||||
v-model="row.birthed"
|
||||
:label="t(`birthed`)"
|
||||
/>
|
||||
|
||||
<VnInput
|
||||
type="number"
|
||||
v-model="row.adoptionYear"
|
||||
:label="t(`adoptionYear`)"
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="row.isDependend"
|
||||
:label="t(`isDependend`)"
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="row.isJointCustody"
|
||||
:label="t(`isJointCustody`)"
|
||||
size="xs"
|
||||
/>
|
||||
<QBtn
|
||||
@click="deleteRelative(rows[0].id)"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
flat
|
||||
icon="delete"
|
||||
style="flex: 0"
|
||||
/>
|
||||
</div>
|
||||
<VnRow class="justify-left items-center">
|
||||
<QBtn
|
||||
@click="insertTag(rows)"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
style="flex: 0"
|
||||
data-cy="addRelative"
|
||||
/>
|
||||
</VnRow>
|
||||
</QCard>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</template>
|
||||
</FormModel>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
familySituation: Situación familiar
|
||||
disabilityGrades: Discapacidad
|
||||
geographicMobilityDate: Movilidad geografica
|
||||
childPension: Pensión hijos
|
||||
spousePension: Pensión cónyuge
|
||||
isDependend: Ayuda / Movilidad reducida
|
||||
spouseNif: NIF cónyuge
|
||||
hasHousingPaymentBefore: Pagos vivienda anterior 2011
|
||||
hasHousingPaymentAfter: Pagos vivienda posterior 2011
|
||||
hasExtendedWorking: Prolongación actividad laboral
|
||||
isDescendant: Descen/Ascen
|
||||
disabilityGradeFk: Discapacidad
|
||||
birthed: Año nacimiento
|
||||
adoptionYear: Año adopción
|
||||
isJointCustody: Computo por entero
|
||||
Relatives: Relacionados
|
||||
en:
|
||||
familySituation: Family Situation
|
||||
disabilityGrades: Disability Grades
|
||||
geographicMobilityDate: Geographic Mobility Date
|
||||
childPension: Child Pension
|
||||
spousePension: Spouse Pension
|
||||
isDependend: Dependent Suport / Reduced Mobility
|
||||
spouseNif: Spouse NIF (Tax ID)
|
||||
hasHousingPaymentBefore: Housing Payments Before 2011
|
||||
hasHousingPaymentAfter: Housing Payments After 2011
|
||||
hasExtendedWorking: Extended Work Activity
|
||||
isDescendant: Descendant/Ascendant
|
||||
disabilityGradeFk: Disability Grade
|
||||
birthed: Birth Year
|
||||
adoptionYear: Adoption Year
|
||||
isJointCustody: Joint custody
|
||||
Relatives: Relatives
|
||||
</i18n>
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed, onMounted, reactive } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
@ -43,7 +43,7 @@ const { t } = useI18n();
|
|||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const isNew = computed(() => props.isNewMode);
|
||||
const dated = ref(props.date);
|
||||
const dated = reactive(props.date);
|
||||
const tickedNodes = ref();
|
||||
|
||||
const _excludeType = ref('all');
|
||||
|
@ -67,12 +67,12 @@ const exclusionGeoCreate = async () => {
|
|||
};
|
||||
|
||||
const exclusionCreate = async () => {
|
||||
if (isNew.value)
|
||||
await axios.post(`Zones/${route.params.id}/exclusions`, [{ dated: dated.value }]);
|
||||
else
|
||||
await axios.post(`Zones/${route.params.id}/exclusions`, {
|
||||
dated: dated.value,
|
||||
});
|
||||
const url = `Zones/${route.params.id}/exclusions`;
|
||||
const body = {
|
||||
dated,
|
||||
};
|
||||
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
|
||||
else await axios.put(`${url}/${props.event?.id}`, body);
|
||||
await refetchEvents();
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,8 @@ const onSubmit = async () => {
|
|||
|
||||
const deleteEvent = async () => {
|
||||
if (!props.event) return;
|
||||
await axios.delete(`Zones/${route.params.id}/exclusions`);
|
||||
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
|
||||
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
|
||||
await refetchEvents();
|
||||
};
|
||||
|
||||
|
@ -118,11 +119,7 @@ onMounted(() => {
|
|||
>
|
||||
<template #form-inputs>
|
||||
<VnRow class="row q-gutter-md q-mb-lg">
|
||||
<VnInputDate
|
||||
:label="t('eventsInclusionForm.day')"
|
||||
v-model="dated"
|
||||
:required="true"
|
||||
/>
|
||||
<VnInputDate :label="t('eventsInclusionForm.day')" v-model="dated" />
|
||||
</VnRow>
|
||||
<div class="column q-gutter-y-sm q-mb-md">
|
||||
<QRadio
|
||||
|
@ -172,8 +169,8 @@ onMounted(() => {
|
|||
class="q-mr-sm"
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('zone.deleteTitle'),
|
||||
t('zone.deleteSubtitle'),
|
||||
t('eventsPanel.deleteTitle'),
|
||||
t('eventsPanel.deleteSubtitle'),
|
||||
() => deleteEvent()
|
||||
)
|
||||
"
|
||||
|
|
|
@ -24,13 +24,14 @@ const zoneEventsFormProps = reactive({
|
|||
date: null,
|
||||
});
|
||||
|
||||
const openForm = (data) => {
|
||||
const openForm = (data, isBtnAdd) => {
|
||||
const { date = null, isNewMode, event, eventType, geoIds = [] } = data;
|
||||
zoneEventsFormProps.date = date;
|
||||
zoneEventsFormProps.isNewMode = isNewMode;
|
||||
zoneEventsFormProps.event = event;
|
||||
zoneEventsFormProps.eventType = eventType;
|
||||
if (geoIds.length) zoneEventsFormProps.geoIds = geoIds;
|
||||
if (isBtnAdd) formModeName.value = 'include';
|
||||
|
||||
showZoneEventForm.value = true;
|
||||
};
|
||||
|
@ -51,7 +52,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
:last-day="lastDay"
|
||||
:events="events"
|
||||
v-model:formModeName="formModeName"
|
||||
@open-zone-form="openForm"
|
||||
/>
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
|
@ -65,7 +65,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
/>
|
||||
<QDialog v-model="showZoneEventForm" @hide="onZoneEventFormClose()">
|
||||
<ZoneEventInclusionForm
|
||||
v-if="formModeName === 'include'"
|
||||
v-if="!formModeName || formModeName === 'include'"
|
||||
v-bind="zoneEventsFormProps"
|
||||
@close-form="onZoneEventFormClose()"
|
||||
/>
|
||||
|
@ -78,9 +78,12 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
<QPageSticky :offset="[20, 20]">
|
||||
<QBtn
|
||||
@click="
|
||||
openForm({
|
||||
isNewMode: true,
|
||||
})
|
||||
openForm(
|
||||
{
|
||||
isNewMode: true,
|
||||
},
|
||||
true
|
||||
)
|
||||
"
|
||||
color="primary"
|
||||
fab
|
||||
|
|
|
@ -11,6 +11,10 @@ import { dashIfEmpty } from 'src/filters';
|
|||
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
|
||||
const formModeName = defineModel('formModeName', {
|
||||
type: String,
|
||||
required: true,
|
||||
});
|
||||
const props = defineProps({
|
||||
firstDay: {
|
||||
type: Date,
|
||||
|
@ -27,25 +31,13 @@ const props = defineProps({
|
|||
required: true,
|
||||
default: () => [],
|
||||
},
|
||||
formModeName: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: 'include',
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['openZoneForm', 'update:formModeName']);
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const weekdayStore = useWeekdayStore();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const formName = computed({
|
||||
get: () => props.formModeName,
|
||||
set: (value) => emit('update:formModeName', value),
|
||||
});
|
||||
|
||||
const params = computed(() => ({
|
||||
zoneFk: route.params.id,
|
||||
started: props.firstDay,
|
||||
|
@ -88,16 +80,6 @@ const deleteEvent = async (id) => {
|
|||
await fetchData();
|
||||
};
|
||||
|
||||
const openInclusionForm = (event) => {
|
||||
formName.value = 'include';
|
||||
emit('openZoneForm', {
|
||||
date: event.dated,
|
||||
event,
|
||||
isNewMode: false,
|
||||
eventType: 'event',
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
weekdayStore.initStore();
|
||||
});
|
||||
|
@ -110,13 +92,13 @@ onMounted(async () => {
|
|||
t('eventsPanel.editMode')
|
||||
}}</span>
|
||||
<QRadio
|
||||
v-model="formName"
|
||||
v-model="formModeName"
|
||||
dense
|
||||
val="include"
|
||||
:label="t('eventsPanel.include')"
|
||||
/>
|
||||
<QRadio
|
||||
v-model="formName"
|
||||
v-model="formModeName"
|
||||
dense
|
||||
val="exclude"
|
||||
:label="t('eventsPanel.exclude')"
|
||||
|
|
|
@ -61,6 +61,8 @@ eventsPanel:
|
|||
events: Events
|
||||
everyday: Everyday
|
||||
delete: Delete
|
||||
deleteTitle: This item will be deleted
|
||||
deleteSubtitle: Are you sure you want to continue?
|
||||
eventsExclusionForm:
|
||||
addExclusion: Add exclusion
|
||||
editExclusion: Edit exclusion
|
||||
|
@ -76,6 +78,7 @@ eventsInclusionForm:
|
|||
rangeOfDates: Range of dates
|
||||
from: From
|
||||
to: To
|
||||
day: Day
|
||||
upcomingDeliveries:
|
||||
province: Province
|
||||
closing: Closing
|
||||
|
|
|
@ -61,6 +61,8 @@ eventsPanel:
|
|||
events: Eventos
|
||||
everyday: Todos los días
|
||||
delete: Eliminar
|
||||
deleteTitle: Eliminar evento
|
||||
deleteSubtitle: ¿Seguro que quieres eliminar este evento?
|
||||
eventsExclusionForm:
|
||||
addExclusion: Añadir exclusión
|
||||
editExclusion: Editar exclusión
|
||||
|
@ -76,5 +78,6 @@ eventsInclusionForm:
|
|||
rangeOfDates: Rango de fechas
|
||||
from: Desde
|
||||
to: Hasta
|
||||
day: Día
|
||||
upcomingDeliveries:
|
||||
province: Provincia
|
||||
|
|
|
@ -24,6 +24,7 @@ export default {
|
|||
'WorkerDms',
|
||||
'WorkerTimeControl',
|
||||
'WorkerLocker',
|
||||
'WorkerPit',
|
||||
'WorkerBalance',
|
||||
'WorkerFormation',
|
||||
'WorkerMedical',
|
||||
|
@ -216,6 +217,15 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
||||
},
|
||||
{
|
||||
name: 'WorkerPit',
|
||||
path: 'pit',
|
||||
meta: {
|
||||
title: 'pit',
|
||||
icon: 'lock',
|
||||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
|
||||
},
|
||||
{
|
||||
name: 'WorkerOperator',
|
||||
path: 'operator',
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('OrderCatalog', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 720);
|
||||
cy.visit('/#/order/8/catalog');
|
||||
});
|
||||
|
||||
const checkCustomFilterTag = (filterName = 'Plant') => {
|
||||
cy.dataCy('catalogFilterCustomTag').should('exist');
|
||||
cy.dataCy('catalogFilterCustomTag').contains(filterName);
|
||||
};
|
||||
|
||||
const checkFilterTag = (filterName = 'Plant') => {
|
||||
cy.dataCy('vnFilterPanelChip').should('exist');
|
||||
cy.dataCy('vnFilterPanelChip').contains(filterName);
|
||||
};
|
||||
|
||||
const selectCategory = (categoryIndex = 1, categoryName = 'Plant') => {
|
||||
cy.get(
|
||||
`div.q-page-container div:nth-of-type(${categoryIndex}) > [data-cy='catalogFilterCategory']`
|
||||
).should('exist');
|
||||
cy.get(
|
||||
`div.q-page-container div:nth-of-type(${categoryIndex}) > [data-cy='catalogFilterCategory']`
|
||||
).click();
|
||||
checkCustomFilterTag(categoryName);
|
||||
};
|
||||
|
||||
const searchByCustomTagInput = (option) => {
|
||||
cy.dataCy('catalogFilterValueInput').find('input').last().focus();
|
||||
cy.dataCy('catalogFilterValueInput').find('input').last().type(option);
|
||||
cy.dataCy('catalogFilterValueInput').find('input').last().type('{enter}');
|
||||
checkCustomFilterTag(option);
|
||||
};
|
||||
|
||||
const selectTypeFilter = (option) => {
|
||||
cy.selectOption(
|
||||
'div.q-page-container div.list > div:nth-of-type(2) div:nth-of-type(3)',
|
||||
option
|
||||
);
|
||||
checkFilterTag(option);
|
||||
};
|
||||
|
||||
it('Shows empty state', () => {
|
||||
cy.dataCy('orderCatalogPage').should('exist');
|
||||
cy.dataCy('orderCatalogPage').contains('No data to display');
|
||||
});
|
||||
|
||||
it('filter by category', () => {
|
||||
selectCategory();
|
||||
cy.dataCy('orderCatalogItem').should('exist');
|
||||
});
|
||||
|
||||
it('filters by type', () => {
|
||||
selectCategory();
|
||||
selectTypeFilter('Anthurium');
|
||||
});
|
||||
|
||||
it('filters by custom value select', () => {
|
||||
selectCategory();
|
||||
searchByCustomTagInput('Silver');
|
||||
});
|
||||
|
||||
it('filters by custom value dialog', () => {
|
||||
Cypress.on('uncaught:exception', (err) => {
|
||||
if (err.message.includes('canceled')) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
selectCategory();
|
||||
cy.dataCy('catalogFilterValueDialogBtn').should('exist');
|
||||
cy.dataCy('catalogFilterValueDialogBtn').last().click();
|
||||
cy.dataCy('catalogFilterValueDialogTagSelect').should('exist');
|
||||
cy.selectOption("[data-cy='catalogFilterValueDialogTagSelect']", 'Tallos');
|
||||
cy.dataCy('catalogFilterValueDialogValueInput').find('input').focus();
|
||||
cy.dataCy('catalogFilterValueDialogValueInput').find('input').type('2');
|
||||
cy.dataCy('catalogFilterValueDialogValueInput').find('input').type('{enter}');
|
||||
checkCustomFilterTag('2');
|
||||
});
|
||||
|
||||
it('removes a secondary tag', () => {
|
||||
selectCategory();
|
||||
selectTypeFilter('Anthurium');
|
||||
cy.dataCy('vnFilterPanelChip').should('exist');
|
||||
cy.get(
|
||||
"div.q-page-container [data-cy='vnFilterPanelChip'] > i.q-chip__icon--remove"
|
||||
)
|
||||
.contains('cancel')
|
||||
.should('exist');
|
||||
cy.get(
|
||||
"div.q-page-container [data-cy='vnFilterPanelChip'] > i.q-chip__icon--remove"
|
||||
)
|
||||
.contains('cancel')
|
||||
.click();
|
||||
cy.dataCy('vnFilterPanelChip').should('not.exist');
|
||||
});
|
||||
|
||||
it('Removes category tag', () => {
|
||||
selectCategory();
|
||||
cy.get(
|
||||
"div.q-page-container [data-cy='catalogFilterCustomTag'] > i.q-chip__icon--remove"
|
||||
)
|
||||
.contains('cancel')
|
||||
.should('exist');
|
||||
cy.get(
|
||||
"div.q-page-container [data-cy='catalogFilterCustomTag'] > i.q-chip__icon--remove"
|
||||
)
|
||||
.contains('cancel')
|
||||
.click();
|
||||
cy.dataCy('catalogFilterCustomTag').should('not.exist');
|
||||
});
|
||||
});
|
|
@ -3,11 +3,17 @@ describe('Client basic data', () => {
|
|||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('#/customer/1110/basic-data', {
|
||||
timeout: 5000,
|
||||
});
|
||||
cy.visit('#/customer/1102/basic-data');
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
cy.get('.q-card').should('be.visible');
|
||||
cy.dataCy('customerPhone').filter('input').should('be.visible');
|
||||
cy.dataCy('customerPhone').filter('input').type('123456789');
|
||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
|
||||
const { body } = req;
|
||||
cy.wrap(body).should('have.property', 'phone', '123456789');
|
||||
});
|
||||
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,6 +8,6 @@ describe('Client billing data', () => {
|
|||
});
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
cy.get('.q-card').should('be.visible');
|
||||
cy.get('.q-page').should('be.visible');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -17,12 +17,14 @@ describe('Client list', () => {
|
|||
|
||||
it('Client list create new client', () => {
|
||||
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||
const randomInt = Math.floor(Math.random() * 90) + 10;
|
||||
|
||||
const data = {
|
||||
Name: { val: 'Name 1' },
|
||||
'Social name': { val: 'TEST 1' },
|
||||
'Tax number': { val: '20852113Z' },
|
||||
'Web user': { val: 'user_test_1' },
|
||||
Street: { val: 'C/ STREET 1' },
|
||||
Name: { val: `Name ${randomInt}` },
|
||||
'Social name': { val: `TEST ${randomInt}` },
|
||||
'Tax number': { val: `20852${randomInt.length}3Z` },
|
||||
'Web user': { val: `user_test_${randomInt}` },
|
||||
Street: { val: `C/ STREET ${randomInt}` },
|
||||
Email: { val: 'user.test@1.com' },
|
||||
'Sales person': { val: 'employee', type: 'select' },
|
||||
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
||||
|
@ -32,7 +34,7 @@ describe('Client list', () => {
|
|||
|
||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||
|
||||
cy.checkNotification('created');
|
||||
cy.checkNotification('Data saved');
|
||||
cy.url().should('include', '/summary');
|
||||
});
|
||||
it('Client list search client', () => {
|
||||
|
@ -54,8 +56,8 @@ describe('Client list', () => {
|
|||
cy.openActionDescriptor('Create ticket');
|
||||
cy.waitForElement('#formModel');
|
||||
cy.waitForElement('.q-form');
|
||||
cy.checkValueSelectForm(1, search);
|
||||
cy.checkValueSelectForm(2, search);
|
||||
cy.checkValueForm(1, search);
|
||||
cy.checkValueForm(2, search);
|
||||
});
|
||||
it('Client founded create order', () => {
|
||||
const search = 'Jessica Jones';
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Client notes', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('#/customer/1101/sms');
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
cy.get('.q-page').should('be.visible');
|
||||
cy.get('.q-page > :nth-child(2) > :nth-child(1)').should('be.visible');
|
||||
});
|
||||
});
|
|
@ -3,11 +3,26 @@ describe('Client web-access', () => {
|
|||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('#/customer/1110/web-access', {
|
||||
timeout: 5000,
|
||||
});
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
it('Should test buttons ', () => {
|
||||
cy.visit('#/customer/1101/web-access');
|
||||
cy.get('.q-page').should('be.visible');
|
||||
cy.get('#formModel').should('be.visible');
|
||||
cy.get('.q-card').should('be.visible');
|
||||
cy.get('.q-btn-group > :nth-child(1)').should('not.be.disabled');
|
||||
cy.get('.q-checkbox__inner').click();
|
||||
cy.get('.q-btn-group > .q-btn--standard.q-btn--actionable').should(
|
||||
'not.be.disabled'
|
||||
);
|
||||
cy.get('.q-btn-group > .q-btn--flat').should('not.be.disabled');
|
||||
cy.get('.q-btn-group > :nth-child(1)').click();
|
||||
cy.get('.q-dialog__inner > .q-card > :nth-child(1)')
|
||||
.should('be.visible')
|
||||
.find('.text-h6')
|
||||
.should('have.text', 'Change password');
|
||||
});
|
||||
it('Should disabled buttons', () => {
|
||||
cy.visit('#/customer/1110/web-access');
|
||||
cy.get('.q-btn-group > :nth-child(1)').should('be.disabled');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Client credit opinion', () => {
|
||||
describe('Client credit contracts', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
|
@ -8,6 +8,6 @@ describe('Client credit opinion', () => {
|
|||
});
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
cy.get('.q-card').should('be.visible');
|
||||
cy.get('.q-page').should('be.visible');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,11 +3,17 @@ describe('Client unpaid', () => {
|
|||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('#/customer/1110/others/unpaid', {
|
||||
timeout: 5000,
|
||||
});
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
it('Should add unpaid', () => {
|
||||
cy.visit('#/customer/1102/others/unpaid');
|
||||
cy.get('.q-card').should('be.visible');
|
||||
cy.get('.q-checkbox__inner').click();
|
||||
cy.dataCy('customerUnpaidAmount').find('input').type('100');
|
||||
cy.dataCy('customerUnpaidDate').find('input').type('01/01/2001');
|
||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||
cy.reload();
|
||||
cy.get('.q-checkbox__inner')
|
||||
.should('be.visible')
|
||||
.and('not.have.class', 'q-checkbox__inner--active');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
describe('VnInput Component', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/supplier/1/fiscal-data');
|
||||
cy.domContentLoad();
|
||||
});
|
||||
|
||||
it('should replace character at cursor position in insert mode', () => {
|
||||
// Simula escribir en el input
|
||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
||||
cy.dataCy('supplierFiscalDataAccount').type('4100000001');
|
||||
// Coloca el cursor en la posición 0
|
||||
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
|
||||
// Escribe un número y verifica que se reemplace correctamente
|
||||
cy.dataCy('supplierFiscalDataAccount').type('999');
|
||||
cy.dataCy('supplierFiscalDataAccount')
|
||||
.should('have.value', '9990000001');
|
||||
});
|
||||
|
||||
it('should replace character at cursor position in insert mode', () => {
|
||||
// Simula escribir en el input
|
||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
||||
cy.dataCy('supplierFiscalDataAccount').type('4100000001');
|
||||
// Coloca el cursor en la posición 0
|
||||
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
|
||||
// Escribe un número y verifica que se reemplace correctamente en la posicion incial
|
||||
cy.dataCy('supplierFiscalDataAccount').type('999');
|
||||
cy.dataCy('supplierFiscalDataAccount')
|
||||
.should('have.value', '9990000001');
|
||||
});
|
||||
|
||||
it('should respect maxlength prop', () => {
|
||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
||||
cy.dataCy('supplierFiscalDataAccount').type('123456789012345');
|
||||
cy.dataCy('supplierFiscalDataAccount')
|
||||
.should('have.value', '1234567890'); // asumiendo que maxlength es 10
|
||||
});
|
||||
});
|
|
@ -3,6 +3,7 @@ describe('VnBreadcrumbs', () => {
|
|||
const firstCard = '.q-infinite-scroll > :nth-child(1)';
|
||||
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit('/');
|
||||
});
|
|
@ -1,3 +1,5 @@
|
|||
const { randomNumber, randomString } = require('../../support');
|
||||
|
||||
describe('VnLocation', () => {
|
||||
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
|
||||
const dialogInputs = '.q-dialog label input';
|
||||
|
@ -103,12 +105,12 @@ describe('VnLocation', () => {
|
|||
const province = 'Valencia';
|
||||
cy.get(createLocationButton).click();
|
||||
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||||
cy.get(dialogInputs).eq(0).clear();
|
||||
cy.get(dialogInputs).eq(0).type(postCode);
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||
province
|
||||
);
|
||||
cy.get(dialogInputs).eq(0).clear();
|
||||
cy.get(dialogInputs).eq(0).type(postCode);
|
||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||
cy.waitForElement('.q-form');
|
||||
|
@ -117,14 +119,19 @@ describe('VnLocation', () => {
|
|||
});
|
||||
|
||||
it('Create city without country', () => {
|
||||
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||
const postCode = randomNumber();
|
||||
const province = randomString({ length: 4 });
|
||||
cy.get(createLocationButton).click();
|
||||
cy.get(dialogInputs).eq(0).type(postCode);
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
|
||||
).click();
|
||||
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
|
||||
cy.get('#q-portal--dialog--3 .q-input').type(cityName);
|
||||
cy.get('#q-portal--dialog--3 .q-input').type(province);
|
||||
cy.get('#q-portal--dialog--3 .q-btn--standard').click();
|
||||
cy.get('#q-portal--dialog--1 .q-btn--standard').click();
|
||||
cy.waitForElement('.q-form');
|
||||
checkVnLocation(postCode, province);
|
||||
});
|
||||
|
||||
it('Create province without country', () => {
|
|
@ -0,0 +1,40 @@
|
|||
describe('WorkerPit', () => {
|
||||
const familySituationInput = '[data-cy="Family Situation_input"]';
|
||||
const familySituation = '1';
|
||||
const childPensionInput = '[data-cy="Child Pension_input"]';
|
||||
const childPension = '120';
|
||||
const spouseNifInput = '[data-cy="Spouse Pension_input"]';
|
||||
const spouseNif = '65117125P';
|
||||
const spousePensionInput = '[data-cy="Spouse Pension_input"]';
|
||||
const spousePension = '120';
|
||||
const addRelative = '[data-cy="addRelative"]';
|
||||
const isDescendantSelect = '[data-cy="Descendant/Ascendant_select"]';
|
||||
const birthedInput = '[data-cy="Birth Year_input"]';
|
||||
const birthed = '2002';
|
||||
const adoptionYearInput = '[data-cy="Adoption Year_input"]';
|
||||
const adoptionYear = '2004';
|
||||
const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]';
|
||||
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/worker/1107/pit`);
|
||||
});
|
||||
|
||||
it('complete PIT', () => {
|
||||
cy.get(familySituationInput).type(familySituation);
|
||||
cy.get(childPensionInput).type(childPension);
|
||||
cy.get(spouseNifInput).type(spouseNif);
|
||||
cy.get(spousePensionInput).type(spousePension);
|
||||
cy.get(savePIT).click();
|
||||
});
|
||||
|
||||
it('complete relative', () => {
|
||||
cy.get(addRelative).click();
|
||||
cy.get(isDescendantSelect).type('{downArrow}{downArrow}{enter}');
|
||||
cy.get(birthedInput).type(birthed);
|
||||
cy.get(adoptionYearInput).type(adoptionYear);
|
||||
cy.get(saveRelative).click();
|
||||
});
|
||||
});
|
|
@ -86,9 +86,10 @@ Cypress.Commands.add('getValue', (selector) => {
|
|||
});
|
||||
|
||||
// Fill Inputs
|
||||
Cypress.Commands.add('selectOption', (selector, option) => {
|
||||
Cypress.Commands.add('selectOption', (selector, option, timeout) => {
|
||||
cy.waitForElement(selector);
|
||||
cy.get(selector).click();
|
||||
cy.wait(timeout || 1000);
|
||||
cy.get('.q-menu .q-item').contains(option).click();
|
||||
});
|
||||
Cypress.Commands.add('countSelectOptions', (selector, option) => {
|
||||
|
@ -259,6 +260,7 @@ Cypress.Commands.add('writeSearchbar', (value) => {
|
|||
value
|
||||
);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
||||
cy.get(selector).should('have.text', expectedValue);
|
||||
});
|
||||
|
@ -280,16 +282,38 @@ Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
|||
.click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||
cy.openActionsDescriptor();
|
||||
const listItem = '[role="menu"] .q-list .q-item';
|
||||
cy.contains(listItem, opt).click();
|
||||
1;
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
||||
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||
.invoke('removeAttr', 'target')
|
||||
.click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||
cy.openActionsDescriptor();
|
||||
const listItem = '[role="menu"] .q-list .q-item';
|
||||
cy.contains(listItem, opt).click();
|
||||
1;
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
||||
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||
.invoke('removeAttr', 'target')
|
||||
.click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openUserPanel', () => {
|
||||
cy.get(
|
||||
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
|
||||
).click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActions', (row) => {
|
||||
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('checkNotification', (text) => {
|
||||
cy.get('.q-notification')
|
||||
.should('be.visible')
|
||||
|
@ -300,10 +324,14 @@ Cypress.Commands.add('checkNotification', (text) => {
|
|||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActions', (row) => {
|
||||
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('checkValueForm', (id, search) => {
|
||||
cy.get(
|
||||
`.grid-create > :nth-child(${id}) > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
|
||||
).should('have.value', search);
|
||||
cy.get(`.grid-create > :nth-child(${id}) `)
|
||||
.find('input')
|
||||
.should('have.value', search);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
||||
|
@ -316,6 +344,6 @@ Cypress.Commands.add('searchByLabel', (label, value) => {
|
|||
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-cy') => {
|
||||
return cy.get(`[${attr}="${dataTestId}"]`);
|
||||
Cypress.Commands.add('dataCy', (tag, attr = 'data-cy') => {
|
||||
return cy.get(`[${attr}="${tag}"]`);
|
||||
});
|
||||
|
|
|
@ -15,3 +15,19 @@
|
|||
|
||||
import './commands';
|
||||
|
||||
function randomString(options = { length: 10 }) {
|
||||
let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
return randomizeValue(possible, options);
|
||||
}
|
||||
|
||||
function randomNumber(options = { length: 10 }) {
|
||||
let possible = '0123456789';
|
||||
return randomizeValue(possible, options);
|
||||
}
|
||||
|
||||
function randomizeValue(characterSet, options) {
|
||||
return Array.from({ length: options.length }, () =>
|
||||
characterSet.charAt(Math.floor(Math.random() * characterSet.length))
|
||||
).join('');
|
||||
}
|
||||
export { randomString, randomNumber, randomizeValue };
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import parsePhone from 'src/filters/parsePhone';
|
||||
|
||||
describe('parsePhone filter', () => {
|
||||
it("adds prefix +34 if it doesn't have one", () => {
|
||||
const resultado = parsePhone('123456789', '34');
|
||||
expect(resultado).toBe('34123456789');
|
||||
});
|
||||
|
||||
it('maintains prefix +34 if it is already correct', () => {
|
||||
const resultado = parsePhone('+34123456789', '34');
|
||||
expect(resultado).toBe('34123456789');
|
||||
});
|
||||
|
||||
it('converts prefix 0034 to +34', () => {
|
||||
const resultado = parsePhone('0034123456789', '34');
|
||||
expect(resultado).toBe('34123456789');
|
||||
});
|
||||
|
||||
it('converts prefix 34 without symbol to +34', () => {
|
||||
const resultado = parsePhone('34123456789', '34');
|
||||
expect(resultado).toBe('34123456789');
|
||||
});
|
||||
|
||||
it('replaces incorrect prefix with the correct one', () => {
|
||||
const resultado = parsePhone('+44123456789', '34');
|
||||
expect(resultado).toBe('44123456789');
|
||||
});
|
||||
});
|
|
@ -29,7 +29,7 @@ describe('downloadFile', () => {
|
|||
await downloadFile(1);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith(
|
||||
`${baseUrl}/dms/1/downloadFile?access_token=${token}`,
|
||||
`${baseUrl}/api/dms/1/downloadFile?access_token=${token}`,
|
||||
{ responseType: 'blob' }
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue