Compare commits
247 Commits
fix_js_e2e
...
dev
Author | SHA1 | Date |
---|---|---|
Alex Moreno | 9086b7d48d | |
Carlos Andrés | b20803e6b9 | |
Carlos Satorres | 75986bf7a8 | |
Carlos Satorres | c5f2be688c | |
Carlos Satorres | 4008f50781 | |
Carlos Satorres | 728055352d | |
Carlos Satorres | ad8d5b5e9a | |
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 | 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 | |
William Buezas | 62cd952e84 | |
Javier Segarra | ec96f6bea7 | |
Alex Moreno | ee2450c82f | |
Alex Moreno | 655a76ff62 | |
Alex Moreno | fbd57dc96b | |
Jon Elias | 843c54fcc1 | |
Alex Moreno | 8e7cb9c46e | |
Javier Segarra | a99f64f66a | |
Jon Elias | f3429297cf | |
Javier Segarra | 3e06ba3c18 | |
Javier Segarra | 4bd14927de | |
Javier Segarra | b62935494a | |
Jon Elias | d191d88e81 | |
Javier Segarra | caca9aea71 | |
Jorge Penadés | 6c30ea9e7a | |
Jorge Penadés | e994ae72b6 | |
Jorge Penadés | a1284cefc2 | |
Jon Elias | c558636799 | |
Jorge Penadés | a3f56aaf24 | |
Jon Elias | 1dedf00fef | |
Jon Elias | a1aa9337c8 | |
Javier Segarra | c4f2ea032c | |
Javier Segarra | b8ac82bc75 | |
Alex Moreno | e10e0d01e6 | |
Javier Segarra | feb752f75c | |
Javier Segarra | fb4de9cda9 | |
Javier Segarra | 7f87df1225 | |
Javier Segarra | 2fa8c3f88a | |
Jorge Penadés | 8b52629b0b | |
Jorge Penadés | 3a4c0e729a | |
Jorge Penadés | 9d8698fa2f | |
Jorge Penadés | 661cc0b5ee | |
Alex Moreno | 01ffb663f1 | |
William Buezas | be1cd824d8 | |
Jorge Penadés | 0eeb22d40a | |
Jorge Penadés | 7048f96565 | |
Jorge Penadés | 50fbf64cf9 | |
Jorge Penadés | c72fa52851 | |
Alex Moreno | 6276843613 | |
Alex Moreno | 14d2ddfa83 | |
Alex Moreno | ef426dc579 | |
Alex Moreno | 4913cf2c29 | |
Javier Segarra | 651b67e98f | |
Alex Moreno | 94361f18fa | |
Alex Moreno | 142302193e | |
Alex Moreno | 9d7f2b95e8 | |
Jorge Penadés | 1beeccef7a | |
Jorge Penadés | 3d4f7d8860 | |
Alex Moreno | 2db0369b74 | |
Alex Moreno | 1709795cf9 | |
Alex Moreno | 26c1394321 | |
Alex Moreno | 367f660508 | |
Alex Moreno | 9019d4ff90 | |
Alex Moreno | 522f32aa9a | |
Jorge Penadés | 55f9023201 | |
Jorge Penadés | d1055ad572 | |
Javier Segarra | aae475bf4c | |
Javier Segarra | ce28757a1a | |
Alex Moreno | bf29be1c5f | |
Alex Moreno | 8cbf40f465 | |
Alex Moreno | 3b03f0dfee | |
Carlos Satorres | 095c1f477f | |
Carlos Satorres | 3352cea0e7 | |
William Buezas | 86d19218de | |
Carlos Andrés | 6c866e48a0 | |
Carlos Andrés | e04d77f55e | |
Carlos Andrés | 5268140d8b | |
William Buezas | ec40ef9351 | |
Carlos Andrés | 977512cae0 | |
Carlos Andrés | 242bf6f318 | |
Carlos Satorres | a0f804ab78 | |
Carlos Satorres | 69498cccf9 | |
Carlos Satorres | 518ed40c91 | |
Alex Moreno | fdc71a13ff | |
Alex Moreno | bf0bda0e27 | |
Carlos Satorres | 8a972507a4 | |
Javier Segarra | 3bc5c9bd6a | |
Carlos Satorres | 837f42d21f | |
Jon Elias | 0cefe391cb | |
Jon Elias | 747bc4af76 | |
Jon Elias | 5ff95c2b93 | |
Alex Moreno | 0c3581f3dc | |
Javier Segarra | f36363dbd2 | |
Javier Segarra | e5434e7436 | |
Carlos Satorres | 991ef7b243 | |
Javier Segarra | 0434332ec4 | |
Javier Segarra | 81d7b9f04f | |
Javier Segarra | 6f324b44b8 | |
Jon Elias | e943838dbe | |
Jon Elias | 4d8d56eb6e | |
Alex Moreno | 9e41459da4 | |
Alex Moreno | 44f2ecca28 | |
Alex Moreno | c5acde22a3 | |
William Buezas | 8e411125bf | |
Carlos Andrés | 087ec5f39f | |
Jorge Penadés | 9632fb7c75 | |
Jorge Penadés | 43f94ede64 | |
Javi Gallego | bc173d9f6a | |
Carlos Andrés | c21785b1f6 | |
Carlos Andrés | 16133faca7 | |
Jorge Penadés | ad93e16896 | |
Alex Moreno | 42d24359cd | |
Alex Moreno | abd79283ff | |
Carlos Satorres | 258da0f60b | |
Jorge Penadés | 0274dfcef2 | |
Carlos Andrés | 317e9ad034 | |
Alex Moreno | 32fdc836f9 | |
Jon Elias | 71c26c2fa7 | |
Jon Elias | 26ee54c488 | |
Alex Moreno | eee5873283 | |
Alex Moreno | e032d5988b | |
Alex Moreno | 46430d1b6d | |
Pablo Natek | cbdce8f474 | |
Pablo Natek | 8b5a2cd159 | |
Jorge Penadés | bc73996dfe | |
Jorge Penadés | 9665a3407f | |
Jorge Penadés | 85aeda337f | |
Jorge Penadés | 8e9e8a8c78 | |
Jorge Penadés | 73b7fa7704 | |
Jorge Penadés | e54eb50265 | |
Alex Moreno | a498e1178f | |
Alex Moreno | 7b243a470c | |
Carlos Andrés | 5da6e9b2ca | |
Pablo Natek | fb5e38dc0b | |
Pablo Natek | 479c428edf | |
Pablo Natek | 3824f5d124 | |
Jon Elias | 98017df57d | |
Jon Elias | 7cef1d11be | |
Jon Elias | cf6695f7ff | |
Carlos Andrés | 8c20b8736b | |
Jon Elias | 5acce4d61d | |
Alex Moreno | 19cb781800 | |
Alex Moreno | 88d2384c35 | |
Alex Moreno | a14cc29fc4 | |
Alex Moreno | a43c28cb57 | |
Javi Gallego | 9c271eee08 | |
Pablo Natek | 6ab31fa2d2 | |
Pablo Natek | f999760205 | |
Pablo Natek | e119bf5bfc | |
Javi Gallego | 7d2f4bcf44 | |
Alex Moreno | c2db7be8cd | |
William Buezas | 28bfda869a | |
Javier Segarra | 73072794ee | |
Javier Segarra | 2f06eea8ea | |
Jon Elias | a64575c7cc | |
Jon Elias | 452ba788c9 | |
William Buezas | d8c1bd5b16 | |
Javier Segarra | 4116f681b0 | |
Javier Segarra | 95758e2564 | |
Javier Segarra | 8e37d22164 | |
Javier Segarra | 69e6f0f467 | |
Javier Segarra | e8ad185873 | |
Javier Segarra | 69a2eae542 | |
Javier Segarra | 1a0a2d9442 | |
Javier Segarra | c7c9c13944 | |
Javier Segarra | 703aaa1f38 | |
Javier Segarra | 5af494e13c | |
Javier Segarra | aa05b4b0cb | |
Javier Segarra | d284cec31a | |
Javi Gallego | c0ddc2c5b4 | |
Javi Gallego | 79ce2ad79e | |
Jon Elias | 8cfc2996d4 | |
Jon Elias | 7f4a73fd56 | |
Jon Elias | cc85d4ab4b | |
Jon Elias | 9533c1a97e | |
Alex Moreno | 9ac3316567 | |
Alex Moreno | 6f1e6a3bfa | |
Jorge Penadés | 4572817699 | |
Carlos Andrés | b460a0be2f | |
Carlos Andrés | 18593cc3f9 | |
Carlos Andrés | 4a0c15ed90 | |
Javi Gallego | 8e4931516a | |
Javi Gallego | 76e35cc758 | |
William Buezas | 4bfbd1925e | |
Carlos Andrés | e9fad1a44e | |
Carlos Andrés | fc73149dcf | |
Carlos Satorres | 04f6107909 | |
Carlos Satorres | 780af58747 | |
Javi Gallego | 4e957ed8a7 | |
Carlos Satorres | 8b2fbefc35 | |
Jon Elias | 493e518339 | |
Carlos Satorres | eea6276264 | |
Carlos Satorres | adbf1af453 | |
Jorge Penadés | 53399c8f74 | |
Carlos Satorres | 847cf6a5b4 | |
Jon Elias | e13090bb3b | |
Alex Moreno | 1e04ead780 | |
Alex Moreno | e739f42ddf | |
Alex Moreno | 99549c6787 | |
Javi Gallego | 2a94916bc2 | |
Javi Gallego | 69215851bb | |
Carlos Satorres | 1aefad58e9 | |
Alex Moreno | bfc906a346 | |
Alex Moreno | 8381a25017 | |
Carlos Satorres | 237b3ed4df | |
Jorge Penadés | 4e5a4ae7a3 | |
Jorge Penadés | fb7087d38a | |
Javier Segarra | 2877ef8a33 | |
Javier Segarra | 1aab0abbcd | |
Carlos Satorres | 5d8f9dbd72 | |
Javi Gallego | 6eb0c93802 | |
Javi Gallego | 909244a658 | |
Javi Gallego | 789e70b7a8 | |
Javi Gallego | 6d08875809 | |
Javi Gallego | c5eb3a4b00 | |
Javi Gallego | fc3a025047 | |
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
|
# Version 24.40 - 2024-10-02
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
const { defineConfig } = require('cypress');
|
const { defineConfig } = require('cypress');
|
||||||
|
// https://docs.cypress.io/app/tooling/reporters
|
||||||
|
// https://docs.cypress.io/app/references/configuration
|
||||||
|
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
|
@ -16,6 +19,7 @@ module.exports = defineConfig({
|
||||||
reporterOptions: {
|
reporterOptions: {
|
||||||
charts: true,
|
charts: true,
|
||||||
reportPageTitle: 'Cypress Inline Reporter',
|
reportPageTitle: 'Cypress Inline Reporter',
|
||||||
|
reportFilename: '[status]_[datetime]-report',
|
||||||
embeddedScreenshots: true,
|
embeddedScreenshots: true,
|
||||||
reportDir: 'test/cypress/reports',
|
reportDir: 'test/cypress/reports',
|
||||||
inlineAssets: true,
|
inlineAssets: true,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.48.0",
|
"version": "24.50.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -1,155 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { reactive, ref, computed } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
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';
|
|
||||||
import FormModelPopup from './FormModelPopup.vue';
|
|
||||||
import VnInputDate from './common/VnInputDate.vue';
|
|
||||||
|
|
||||||
const emit = defineEmits(['onDataSaved']);
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const manualInvoiceFormData = reactive({
|
|
||||||
maxShipped: Date.vnNew(),
|
|
||||||
});
|
|
||||||
|
|
||||||
const formModelPopupRef = ref();
|
|
||||||
const invoiceOutSerialsOptions = ref([]);
|
|
||||||
const taxAreasOptions = ref([]);
|
|
||||||
const ticketsOptions = ref([]);
|
|
||||||
const clientsOptions = ref([]);
|
|
||||||
const isLoading = computed(() => formModelPopupRef.value?.isLoading);
|
|
||||||
|
|
||||||
const onDataSaved = async (formData, requestResponse) => {
|
|
||||||
emit('onDataSaved', formData, requestResponse);
|
|
||||||
if (requestResponse && requestResponse.id)
|
|
||||||
router.push({ name: 'InvoiceOutSummary', params: { id: requestResponse.id } });
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<FetchData
|
|
||||||
url="InvoiceOutSerials"
|
|
||||||
:filter="{ where: { code: { neq: 'R' } }, order: ['code'] }"
|
|
||||||
@on-fetch="(data) => (invoiceOutSerialsOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="TaxAreas"
|
|
||||||
:filter="{ order: ['code'] }"
|
|
||||||
@on-fetch="(data) => (taxAreasOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FormModelPopup
|
|
||||||
ref="formModelPopupRef"
|
|
||||||
:title="t('Create manual invoice')"
|
|
||||||
url-create="InvoiceOuts/createManualInvoice"
|
|
||||||
model="invoiceOut"
|
|
||||||
:form-initial-data="manualInvoiceFormData"
|
|
||||||
@on-data-saved="onDataSaved"
|
|
||||||
>
|
|
||||||
<template #form-inputs="{ data }">
|
|
||||||
<span v-if="isLoading" class="text-primary invoicing-text">
|
|
||||||
<QIcon name="warning" class="fill-icon q-mr-sm" size="md" />
|
|
||||||
{{ t('Invoicing in progress...') }}
|
|
||||||
</span>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('Ticket')"
|
|
||||||
:options="ticketsOptions"
|
|
||||||
hide-selected
|
|
||||||
option-label="id"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.ticketFk"
|
|
||||||
@update:model-value="data.clientFk = null"
|
|
||||||
url="Tickets"
|
|
||||||
:where="{ refFk: null }"
|
|
||||||
:fields="['id', 'nickname']"
|
|
||||||
:filter-options="{ order: 'shipped DESC' }"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
|
|
||||||
<QItemLabel caption>{{ scope.opt?.nickname }}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<span class="row items-center" style="max-width: max-content">{{
|
|
||||||
t('Or')
|
|
||||||
}}</span>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('Client')"
|
|
||||||
:options="clientsOptions"
|
|
||||||
hide-selected
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.clientFk"
|
|
||||||
@update:model-value="data.ticketFk = null"
|
|
||||||
url="Clients"
|
|
||||||
:fields="['id', 'name']"
|
|
||||||
:filter-options="{ order: 'name ASC' }"
|
|
||||||
/>
|
|
||||||
<VnInputDate :label="t('Max date')" v-model="data.maxShipped" />
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('Serial')"
|
|
||||||
:options="invoiceOutSerialsOptions"
|
|
||||||
hide-selected
|
|
||||||
option-label="description"
|
|
||||||
option-value="code"
|
|
||||||
v-model="data.serial"
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('Area')"
|
|
||||||
:options="taxAreasOptions"
|
|
||||||
hide-selected
|
|
||||||
option-label="code"
|
|
||||||
option-value="code"
|
|
||||||
v-model="data.taxArea"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
:label="t('Reference')"
|
|
||||||
type="textarea"
|
|
||||||
v-model="data.reference"
|
|
||||||
fill-input
|
|
||||||
autogrow
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
</template>
|
|
||||||
</FormModelPopup>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.invoicing-text {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
color: $primary;
|
|
||||||
font-size: 24px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Create manual invoice: Crear factura manual
|
|
||||||
Ticket: Ticket
|
|
||||||
Client: Cliente
|
|
||||||
Max date: Fecha límite
|
|
||||||
Serial: Serie
|
|
||||||
Area: Area
|
|
||||||
Reference: Referencia
|
|
||||||
Or: O
|
|
||||||
Invoicing in progress...: Facturación en progreso...
|
|
||||||
</i18n>
|
|
|
@ -17,10 +17,6 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
provinces: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -48,7 +44,7 @@ const onDataSaved = (...args) => {
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Names')"
|
:label="t('Name')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:rules="validate('city.name')"
|
:rules="validate('city.name')"
|
||||||
/>
|
/>
|
||||||
|
@ -56,7 +52,6 @@ const onDataSaved = (...args) => {
|
||||||
:province-selected="$props.provinceSelected"
|
:province-selected="$props.provinceSelected"
|
||||||
:country-fk="$props.countryFk"
|
:country-fk="$props.countryFk"
|
||||||
v-model="data.provinceFk"
|
v-model="data.provinceFk"
|
||||||
:provinces="$props.provinces"
|
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -22,12 +22,15 @@ const postcodeFormData = reactive({
|
||||||
townFk: null,
|
townFk: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const townsFetchDataRef = ref(null);
|
const townsFetchDataRef = ref(false);
|
||||||
const provincesFetchDataRef = ref(null);
|
const countriesFetchDataRef = ref(false);
|
||||||
|
const provincesFetchDataRef = ref(false);
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
const provincesOptions = ref([]);
|
const provincesOptions = ref([]);
|
||||||
const townsOptions = ref([]);
|
const townsOptions = ref([]);
|
||||||
const town = ref({});
|
const town = ref({});
|
||||||
|
const townFilter = ref({});
|
||||||
|
const countryFilter = ref({});
|
||||||
|
|
||||||
function onDataSaved(formData) {
|
function onDataSaved(formData) {
|
||||||
const newPostcode = {
|
const newPostcode = {
|
||||||
|
@ -56,10 +59,60 @@ async function onCityCreated(newTown, formData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTown(newTown, data) {
|
function setTown(newTown, data) {
|
||||||
if (!newTown) return;
|
|
||||||
town.value = newTown;
|
town.value = newTown;
|
||||||
data.provinceFk = newTown.provinceFk;
|
data.provinceFk = newTown?.provinceFk ?? newTown;
|
||||||
data.countryFk = newTown.province.countryFk;
|
data.countryFk = newTown?.province?.countryFk ?? newTown;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setCountry(countryFk, data) {
|
||||||
|
data.townFk = null;
|
||||||
|
data.provinceFk = null;
|
||||||
|
data.countryFk = countryFk;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function filterTowns(name) {
|
||||||
|
if (name !== '') {
|
||||||
|
townFilter.value.where = {
|
||||||
|
name: {
|
||||||
|
like: `%${name}%`,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
await townsFetchDataRef.value?.fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function filterCountries(name) {
|
||||||
|
if (name !== '') {
|
||||||
|
countryFilter.value.where = {
|
||||||
|
name: {
|
||||||
|
like: `%${name}%`,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
await countriesFetchDataRef.value?.fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchTowns(countryFk) {
|
||||||
|
if (!countryFk) return;
|
||||||
|
townFilter.value.where = {
|
||||||
|
provinceFk: {
|
||||||
|
inq: provincesOptions.value.map(({ id }) => id),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
await townsFetchDataRef.value?.fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleProvinces(data) {
|
||||||
|
provincesOptions.value = data;
|
||||||
|
if (postcodeFormData.countryFk) {
|
||||||
|
await fetchTowns(postcodeFormData.countryFk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function handleTowns(data) {
|
||||||
|
townsOptions.value = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleCountries(data) {
|
||||||
|
countriesOptions.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setProvince(id, data) {
|
async function setProvince(id, data) {
|
||||||
|
@ -73,60 +126,7 @@ async function onProvinceCreated(data) {
|
||||||
await provincesFetchDataRef.value.fetch({
|
await provincesFetchDataRef.value.fetch({
|
||||||
where: { countryFk: postcodeFormData.countryFk },
|
where: { countryFk: postcodeFormData.countryFk },
|
||||||
});
|
});
|
||||||
postcodeFormData.provinceFk.value = data.id;
|
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 provincesFetchDataRef.value.fetch({
|
|
||||||
where: {
|
|
||||||
countryFk: newCountryFk,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
await townsFetchDataRef.value.fetch({
|
|
||||||
where: {
|
|
||||||
provinceFk: {
|
|
||||||
inq: provincesOptions.value.map(({ id }) => id),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -143,10 +143,20 @@ async function handleCountries(data) {
|
||||||
ref="townsFetchDataRef"
|
ref="townsFetchDataRef"
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
:limit="30"
|
:limit="30"
|
||||||
|
:filter="townFilter"
|
||||||
@on-fetch="handleTowns"
|
@on-fetch="handleTowns"
|
||||||
auto-load
|
auto-load
|
||||||
url="Towns/location"
|
url="Towns/location"
|
||||||
/>
|
/>
|
||||||
|
<FetchData
|
||||||
|
ref="countriesFetchDataRef"
|
||||||
|
:limit="30"
|
||||||
|
:filter="countryFilter"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
|
@on-fetch="handleCountries"
|
||||||
|
auto-load
|
||||||
|
url="Countries"
|
||||||
|
/>
|
||||||
|
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
|
@ -168,6 +178,7 @@ async function handleCountries(data) {
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('City')"
|
:label="t('City')"
|
||||||
@update:model-value="(value) => setTown(value, data)"
|
@update:model-value="(value) => setTown(value, data)"
|
||||||
|
@filter="filterTowns"
|
||||||
:tooltip="t('Create city')"
|
:tooltip="t('Create city')"
|
||||||
v-model="data.townFk"
|
v-model="data.townFk"
|
||||||
:options="townsOptions"
|
:options="townsOptions"
|
||||||
|
@ -193,7 +204,6 @@ async function handleCountries(data) {
|
||||||
<CreateNewCityForm
|
<CreateNewCityForm
|
||||||
:country-fk="data.countryFk"
|
:country-fk="data.countryFk"
|
||||||
:province-selected="data.provinceFk"
|
:province-selected="data.provinceFk"
|
||||||
:provinces="provincesOptions"
|
|
||||||
@on-data-saved="
|
@on-data-saved="
|
||||||
(_, requestResponse) =>
|
(_, requestResponse) =>
|
||||||
onCityCreated(requestResponse, data)
|
onCityCreated(requestResponse, data)
|
||||||
|
@ -208,20 +218,20 @@ async function handleCountries(data) {
|
||||||
:province-selected="data.provinceFk"
|
:province-selected="data.provinceFk"
|
||||||
@update:model-value="(value) => setProvince(value, data)"
|
@update:model-value="(value) => setProvince(value, data)"
|
||||||
v-model="data.provinceFk"
|
v-model="data.provinceFk"
|
||||||
:clearable="true"
|
@on-province-fetched="handleProvinces"
|
||||||
:provinces="provincesOptions"
|
|
||||||
@on-province-created="onProvinceCreated"
|
@on-province-created="onProvinceCreated"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Countries"
|
|
||||||
:sort-by="['name ASC']"
|
|
||||||
:label="t('Country')"
|
:label="t('Country')"
|
||||||
@update:options="handleCountries"
|
@update:options="handleCountries"
|
||||||
|
:options="countriesOptions"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
@filter="filterCountries"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="data.countryFk"
|
v-model="data.countryFk"
|
||||||
:rules="validate('postcode.countryFk')"
|
:rules="validate('postcode.countryFk')"
|
||||||
|
@update:model-value="(value) => setCountry(value, data)"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { computed, reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -34,6 +34,12 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
);
|
);
|
||||||
emit('onDataSaved', dataSaved, requestResponse);
|
emit('onDataSaved', dataSaved, requestResponse);
|
||||||
};
|
};
|
||||||
|
const where = computed(() => {
|
||||||
|
if (!$props.countryFk) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return { countryFk: $props.countryFk };
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -41,9 +47,7 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
@on-fetch="(data) => (autonomiesOptions = data)"
|
@on-fetch="(data) => (autonomiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{
|
:filter="{
|
||||||
where: {
|
where,
|
||||||
countryFk: $props.countryFk,
|
|
||||||
},
|
|
||||||
}"
|
}"
|
||||||
url="Autonomies/location"
|
url="Autonomies/location"
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
|
|
|
@ -94,6 +94,7 @@ defineExpose({
|
||||||
saveChanges,
|
saveChanges,
|
||||||
getChanges,
|
getChanges,
|
||||||
formData,
|
formData,
|
||||||
|
originalData,
|
||||||
vnPaginateRef,
|
vnPaginateRef,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -394,6 +395,7 @@ watch(formUrl, async () => {
|
||||||
@click="onSubmit"
|
@click="onSubmit"
|
||||||
:disable="!hasChanges"
|
:disable="!hasChanges"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
|
data-cy="crudModelDefaultSaveBtn"
|
||||||
/>
|
/>
|
||||||
<slot name="moreAfterActions" />
|
<slot name="moreAfterActions" />
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
|
|
|
@ -156,26 +156,22 @@ const rotateRight = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
try {
|
if (!newPhoto.files && !newPhoto.url) {
|
||||||
if (!newPhoto.files && !newPhoto.url) {
|
notify(t('Select an image'), 'negative');
|
||||||
notify(t('Select an image'), 'negative');
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
type: 'blob',
|
|
||||||
};
|
|
||||||
|
|
||||||
editor.value
|
|
||||||
.result(options)
|
|
||||||
.then((result) => {
|
|
||||||
const file = new File([result], newPhoto.files?.name || '');
|
|
||||||
newPhoto.blob = file;
|
|
||||||
})
|
|
||||||
.then(() => makeRequest());
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error uploading image');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
type: 'blob',
|
||||||
|
};
|
||||||
|
|
||||||
|
editor.value
|
||||||
|
.result(options)
|
||||||
|
.then((result) => {
|
||||||
|
const file = new File([result], newPhoto.files?.name || '');
|
||||||
|
newPhoto.blob = file;
|
||||||
|
})
|
||||||
|
.then(() => makeRequest());
|
||||||
};
|
};
|
||||||
|
|
||||||
const makeRequest = async () => {
|
const makeRequest = async () => {
|
||||||
|
|
|
@ -51,21 +51,17 @@ const onDataSaved = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
isLoading.value = true;
|
||||||
isLoading.value = true;
|
const rowsToEdit = $props.rows.map((row) => ({ id: row.id, itemFk: row.itemFk }));
|
||||||
const rowsToEdit = $props.rows.map((row) => ({ id: row.id, itemFk: row.itemFk }));
|
const payload = {
|
||||||
const payload = {
|
field: selectedField.value.field,
|
||||||
field: selectedField.value.field,
|
newValue: newValue.value,
|
||||||
newValue: newValue.value,
|
lines: rowsToEdit,
|
||||||
lines: rowsToEdit,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
await axios.post($props.editUrl, payload);
|
await axios.post($props.editUrl, payload);
|
||||||
onDataSaved();
|
onDataSaved();
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
} catch (err) {
|
|
||||||
console.error('Error submitting table cell edit');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeForm = () => {
|
const closeForm = () => {
|
||||||
|
|
|
@ -84,34 +84,30 @@ const tableColumns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
let filter = itemFilter;
|
||||||
let filter = itemFilter;
|
const params = itemFilterParams;
|
||||||
const params = itemFilterParams;
|
const where = {};
|
||||||
const where = {};
|
for (let key in params) {
|
||||||
for (let key in params) {
|
const value = params[key];
|
||||||
const value = params[key];
|
if (!value) continue;
|
||||||
if (!value) continue;
|
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'name':
|
case 'name':
|
||||||
where[key] = { like: `%${value}%` };
|
where[key] = { like: `%${value}%` };
|
||||||
break;
|
break;
|
||||||
case 'producerFk':
|
case 'producerFk':
|
||||||
case 'typeFk':
|
case 'typeFk':
|
||||||
case 'size':
|
case 'size':
|
||||||
case 'inkFk':
|
case 'inkFk':
|
||||||
where[key] = value;
|
where[key] = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
filter.where = where;
|
|
||||||
|
|
||||||
const { data } = await axios.get(props.url, {
|
|
||||||
params: { filter: JSON.stringify(filter) },
|
|
||||||
});
|
|
||||||
tableRows.value = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching entries items');
|
|
||||||
}
|
}
|
||||||
|
filter.where = where;
|
||||||
|
|
||||||
|
const { data } = await axios.get(props.url, {
|
||||||
|
params: { filter: JSON.stringify(filter) },
|
||||||
|
});
|
||||||
|
tableRows.value = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeForm = () => {
|
const closeForm = () => {
|
||||||
|
|
|
@ -86,32 +86,28 @@ const tableColumns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
let filter = travelFilter;
|
||||||
let filter = travelFilter;
|
const params = travelFilterParams;
|
||||||
const params = travelFilterParams;
|
const where = {};
|
||||||
const where = {};
|
for (let key in params) {
|
||||||
for (let key in params) {
|
const value = params[key];
|
||||||
const value = params[key];
|
if (!value) continue;
|
||||||
if (!value) continue;
|
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'agencyModeFk':
|
case 'agencyModeFk':
|
||||||
case 'warehouseInFk':
|
case 'warehouseInFk':
|
||||||
case 'warehouseOutFk':
|
case 'warehouseOutFk':
|
||||||
case 'shipped':
|
case 'shipped':
|
||||||
case 'landed':
|
case 'landed':
|
||||||
where[key] = value;
|
where[key] = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
filter.where = where;
|
|
||||||
const { data } = await axios.get('Travels', {
|
|
||||||
params: { filter: JSON.stringify(filter) },
|
|
||||||
});
|
|
||||||
tableRows.value = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching travels');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filter.where = where;
|
||||||
|
const { data } = await axios.get('Travels', {
|
||||||
|
params: { filter: JSON.stringify(filter) },
|
||||||
|
});
|
||||||
|
tableRows.value = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeForm = () => {
|
const closeForm = () => {
|
||||||
|
|
|
@ -91,6 +91,10 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
maxWidth: {
|
||||||
|
type: [String, Boolean],
|
||||||
|
default: '800px',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||||
const modelValue = computed(
|
const modelValue = computed(
|
||||||
|
@ -283,6 +287,7 @@ defineExpose({
|
||||||
@submit="save"
|
@submit="save"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
|
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||||
id="formModel"
|
id="formModel"
|
||||||
>
|
>
|
||||||
<QCard>
|
<QCard>
|
||||||
|
@ -371,7 +376,6 @@ defineExpose({
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
#formModel {
|
#formModel {
|
||||||
max-width: 800px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const emit = defineEmits(['onSubmit']);
|
const emit = defineEmits(['onSubmit']);
|
||||||
|
|
||||||
defineProps({
|
const $props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -25,16 +25,21 @@ defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
submitOnEnter: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
emit('onSubmit');
|
if ($props.submitOnEnter) {
|
||||||
closeForm();
|
emit('onSubmit');
|
||||||
|
closeForm();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeForm = () => {
|
const closeForm = () => {
|
||||||
|
|
|
@ -88,20 +88,16 @@ const applyTags = (params, search) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchItemTypes = async (id) => {
|
const fetchItemTypes = async (id) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
fields: ['id', 'name', 'categoryFk'],
|
||||||
fields: ['id', 'name', 'categoryFk'],
|
where: { categoryFk: id },
|
||||||
where: { categoryFk: id },
|
include: 'category',
|
||||||
include: 'category',
|
order: 'name ASC',
|
||||||
order: 'name ASC',
|
};
|
||||||
};
|
const { data } = await axios.get('ItemTypes', {
|
||||||
const { data } = await axios.get('ItemTypes', {
|
params: { filter: JSON.stringify(filter) },
|
||||||
params: { filter: JSON.stringify(filter) },
|
});
|
||||||
});
|
itemTypesOptions.value = data;
|
||||||
itemTypesOptions.value = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching item types', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCategoryClass = (category, params) => {
|
const getCategoryClass = (category, params) => {
|
||||||
|
@ -111,23 +107,19 @@ const getCategoryClass = (category, params) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSelectedTagValues = async (tag) => {
|
const getSelectedTagValues = async (tag) => {
|
||||||
try {
|
if (!tag?.selectedTag?.id) return;
|
||||||
if (!tag?.selectedTag?.id) return;
|
tag.value = null;
|
||||||
tag.value = null;
|
const filter = {
|
||||||
const filter = {
|
fields: ['value'],
|
||||||
fields: ['value'],
|
order: 'value ASC',
|
||||||
order: 'value ASC',
|
limit: 30,
|
||||||
limit: 30,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(`Tags/${tag.selectedTag.id}/filterValue`, {
|
const { data } = await axios.get(`Tags/${tag.selectedTag.id}/filterValue`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
tag.valueOptions = data;
|
tag.valueOptions = data;
|
||||||
} catch (err) {
|
|
||||||
console.error('Error getting selected tag values');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeTag = (index, params, search) => {
|
const removeTag = (index, params, search) => {
|
||||||
|
|
|
@ -39,14 +39,10 @@ const refund = async () => {
|
||||||
invoiceCorrectionTypeFk: invoiceParams.invoiceCorrectionTypeFk,
|
invoiceCorrectionTypeFk: invoiceParams.invoiceCorrectionTypeFk,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
const { data } = await axios.post('InvoiceOuts/refundAndInvoice', params);
|
||||||
const { data } = await axios.post('InvoiceOuts/refundAndInvoice', params);
|
notify(t('Refunded invoice'), 'positive');
|
||||||
notify(t('Refunded invoice'), 'positive');
|
const [id] = data?.refundId || [];
|
||||||
const [id] = data?.refundId || [];
|
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
||||||
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error refunding invoice', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<script setup>
|
||||||
|
defineProps({ row: { type: Object, required: true } });
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.isTaxDataChecked === 0"
|
||||||
|
name="vn:no036"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.hasTicketRequest" name="vn:buyrequest" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.itemShortage" name="vn:unavailable" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.risk"
|
||||||
|
name="vn:risk"
|
||||||
|
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.hasComponentLack" name="vn:components" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</span>
|
||||||
|
</template>
|
|
@ -49,36 +49,32 @@ const makeInvoice = async () => {
|
||||||
makeInvoice: checked.value,
|
makeInvoice: checked.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
if (checked.value && hasToInvoiceByAddress) {
|
||||||
if (checked.value && hasToInvoiceByAddress) {
|
const response = await new Promise((resolve) => {
|
||||||
const response = await new Promise((resolve) => {
|
quasar
|
||||||
quasar
|
.dialog({
|
||||||
.dialog({
|
component: VnConfirm,
|
||||||
component: VnConfirm,
|
componentProps: {
|
||||||
componentProps: {
|
title: t('Bill destination client'),
|
||||||
title: t('Bill destination client'),
|
message: t('transferInvoiceInfo'),
|
||||||
message: t('transferInvoiceInfo'),
|
},
|
||||||
},
|
})
|
||||||
})
|
.onOk(() => {
|
||||||
.onOk(() => {
|
resolve(true);
|
||||||
resolve(true);
|
})
|
||||||
})
|
.onCancel(() => {
|
||||||
.onCancel(() => {
|
resolve(false);
|
||||||
resolve(false);
|
});
|
||||||
});
|
});
|
||||||
});
|
if (!response) {
|
||||||
if (!response) {
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data } = await axios.post('InvoiceOuts/transfer', params);
|
|
||||||
notify(t('Transferred invoice'), 'positive');
|
|
||||||
const id = data?.[0];
|
|
||||||
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error transfering invoice', err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { data } = await axios.post('InvoiceOuts/transfer', params);
|
||||||
|
notify(t('Transferred invoice'), 'positive');
|
||||||
|
const id = data?.[0];
|
||||||
|
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onProvinceCreated']);
|
const emit = defineEmits(['onProvinceCreated', 'onProvinceFetched']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
countryFk: {
|
countryFk: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -17,20 +17,23 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
provinces: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const provinceFk = defineModel({ type: Number, default: null });
|
const provinceFk = defineModel({ type: Number, default: null });
|
||||||
|
|
||||||
const { validate } = useValidator();
|
const { validate } = useValidator();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const filter = ref({
|
||||||
|
include: { relation: 'country' },
|
||||||
|
where: {
|
||||||
|
countryFk: $props.countryFk,
|
||||||
|
},
|
||||||
|
});
|
||||||
const provincesOptions = ref($props.provinces);
|
const provincesOptions = ref($props.provinces);
|
||||||
provinceFk.value = $props.provinceSelected;
|
|
||||||
const provincesFetchDataRef = ref();
|
const provincesFetchDataRef = ref();
|
||||||
|
provinceFk.value = $props.provinceSelected;
|
||||||
|
if (!$props.countryFk) {
|
||||||
|
filter.value.where = {};
|
||||||
|
}
|
||||||
async function onProvinceCreated(_, data) {
|
async function onProvinceCreated(_, data) {
|
||||||
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } });
|
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } });
|
||||||
provinceFk.value = data.id;
|
provinceFk.value = data.id;
|
||||||
|
@ -39,25 +42,33 @@ async function onProvinceCreated(_, data) {
|
||||||
async function handleProvinces(data) {
|
async function handleProvinces(data) {
|
||||||
provincesOptions.value = data;
|
provincesOptions.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => $props.countryFk,
|
||||||
|
async () => {
|
||||||
|
if ($props.countryFk) {
|
||||||
|
filter.value.where.countryFk = $props.countryFk;
|
||||||
|
} else filter.value.where = {};
|
||||||
|
await provincesFetchDataRef.value.fetch({});
|
||||||
|
emit('onProvinceFetched', provincesOptions.value);
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="provincesFetchDataRef"
|
ref="provincesFetchDataRef"
|
||||||
:filter="{
|
:filter="filter"
|
||||||
include: { relation: 'country' },
|
|
||||||
where: {
|
|
||||||
countryFk: $props.countryFk,
|
|
||||||
},
|
|
||||||
}"
|
|
||||||
@on-fetch="handleProvinces"
|
@on-fetch="handleProvinces"
|
||||||
url="Provinces"
|
url="Provinces"
|
||||||
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('Province')"
|
:label="t('Province')"
|
||||||
:options="$props.provinces"
|
:options="provincesOptions"
|
||||||
:tooltip="t('Create province')"
|
:tooltip="t('Create province')"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
:clearable="true"
|
||||||
v-model="provinceFk"
|
v-model="provinceFk"
|
||||||
:rules="validate && validate('postcode.provinceFk')"
|
:rules="validate && validate('postcode.provinceFk')"
|
||||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||||
|
|
|
@ -143,6 +143,10 @@ function alignRow() {
|
||||||
const showFilter = computed(
|
const showFilter = computed(
|
||||||
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions'
|
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const onTabPressed = async () => {
|
||||||
|
if (model.value) enterEvent['keyup.enter']();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
|
@ -157,6 +161,7 @@ const showFilter = computed(
|
||||||
v-model="model"
|
v-model="model"
|
||||||
:components="components"
|
:components="components"
|
||||||
component-prop="columnFilter"
|
component-prop="columnFilter"
|
||||||
|
@keydown.tab="onTabPressed"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -162,9 +162,7 @@ onMounted(() => {
|
||||||
: $props.defaultMode;
|
: $props.defaultMode;
|
||||||
stateStore.rightDrawer = quasar.screen.gt.xs;
|
stateStore.rightDrawer = quasar.screen.gt.xs;
|
||||||
columnsVisibilitySkipped.value = [
|
columnsVisibilitySkipped.value = [
|
||||||
...splittedColumns.value.columns
|
...splittedColumns.value.columns.filter((c) => !c.visible).map((c) => c.name),
|
||||||
.filter((c) => c.visible == false)
|
|
||||||
.map((c) => c.name),
|
|
||||||
...['tableActions'],
|
...['tableActions'],
|
||||||
];
|
];
|
||||||
createForm.value = $props.create;
|
createForm.value = $props.create;
|
||||||
|
@ -237,7 +235,7 @@ function splitColumns(columns) {
|
||||||
if (col.create) splittedColumns.value.create.push(col);
|
if (col.create) splittedColumns.value.create.push(col);
|
||||||
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
|
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
|
||||||
if ($props.isEditable && col.disable == null) col.disable = false;
|
if ($props.isEditable && col.disable == null) col.disable = false;
|
||||||
if ($props.useModel && col.columnFilter != false)
|
if ($props.useModel && col.columnFilter !== false)
|
||||||
col.columnFilter = { inWhere: true, ...col.columnFilter };
|
col.columnFilter = { inWhere: true, ...col.columnFilter };
|
||||||
splittedColumns.value.columns.push(col);
|
splittedColumns.value.columns.push(col);
|
||||||
}
|
}
|
||||||
|
@ -396,7 +394,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:name="col.orderBy ?? col.name"
|
:name="col.orderBy ?? col.name"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:vertical="true"
|
:vertical="false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<slot
|
<slot
|
||||||
|
@ -739,6 +737,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
fab
|
fab
|
||||||
icon="add"
|
icon="add"
|
||||||
shortcut="+"
|
shortcut="+"
|
||||||
|
data-cy="vnTableCreateBtn"
|
||||||
/>
|
/>
|
||||||
<QTooltip self="top right">
|
<QTooltip self="top right">
|
||||||
{{ createForm?.title }}
|
{{ createForm?.title }}
|
||||||
|
|
|
@ -58,79 +58,71 @@ const getConfig = async (url, filter) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchViewConfigData = async () => {
|
const fetchViewConfigData = async () => {
|
||||||
try {
|
const userConfigFilter = {
|
||||||
const userConfigFilter = {
|
where: { tableCode: $props.tableCode, userFk: user.value.id },
|
||||||
where: { tableCode: $props.tableCode, userFk: user.value.id },
|
};
|
||||||
};
|
const userConfig = await getConfig('UserConfigViews', userConfigFilter);
|
||||||
const userConfig = await getConfig('UserConfigViews', userConfigFilter);
|
|
||||||
|
|
||||||
if (userConfig) {
|
if (userConfig) {
|
||||||
initialUserConfigViewData.value = userConfig;
|
initialUserConfigViewData.value = userConfig;
|
||||||
setUserConfigViewData(userConfig.configuration);
|
setUserConfigViewData(userConfig.configuration);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultConfigFilter = { where: { tableCode: $props.tableCode } };
|
const defaultConfigFilter = { where: { tableCode: $props.tableCode } };
|
||||||
const defaultConfig = await getConfig('DefaultViewConfigs', defaultConfigFilter);
|
const defaultConfig = await getConfig('DefaultViewConfigs', defaultConfigFilter);
|
||||||
|
|
||||||
if (defaultConfig) {
|
if (defaultConfig) {
|
||||||
// Si el backend devuelve una configuración por defecto la usamos
|
// Si el backend devuelve una configuración por defecto la usamos
|
||||||
setUserConfigViewData(defaultConfig.columns);
|
setUserConfigViewData(defaultConfig.columns);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Si no hay configuración por defecto mostramos todas las columnas
|
// Si no hay configuración por defecto mostramos todas las columnas
|
||||||
const defaultColumns = {};
|
const defaultColumns = {};
|
||||||
$props.allColumns.forEach((col) => (defaultColumns[col] = true));
|
$props.allColumns.forEach((col) => (defaultColumns[col] = true));
|
||||||
setUserConfigViewData(defaultColumns);
|
setUserConfigViewData(defaultColumns);
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching config view data', err);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveConfig = async () => {
|
const saveConfig = async () => {
|
||||||
try {
|
const params = {};
|
||||||
const params = {};
|
const configuration = {};
|
||||||
const configuration = {};
|
|
||||||
|
|
||||||
formattedCols.value.forEach((col) => {
|
formattedCols.value.forEach((col) => {
|
||||||
const { name, active } = col;
|
const { name, active } = col;
|
||||||
configuration[name] = active;
|
configuration[name] = active;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Si existe una view config del usuario hacemos un update si no la creamos
|
// Si existe una view config del usuario hacemos un update si no la creamos
|
||||||
if (initialUserConfigViewData.value) {
|
if (initialUserConfigViewData.value) {
|
||||||
params.updates = [
|
params.updates = [
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
configuration: configuration,
|
|
||||||
},
|
|
||||||
where: {
|
|
||||||
id: initialUserConfigViewData.value.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
params.creates = [
|
|
||||||
{
|
|
||||||
userFk: user.value.id,
|
|
||||||
tableCode: $props.tableCode,
|
|
||||||
tableConfig: $props.tableCode,
|
|
||||||
configuration: configuration,
|
configuration: configuration,
|
||||||
},
|
},
|
||||||
];
|
where: {
|
||||||
}
|
id: initialUserConfigViewData.value.id,
|
||||||
|
},
|
||||||
const response = await axios.post('UserConfigViews/crud', params);
|
},
|
||||||
if (response.data && response.data[0]) {
|
];
|
||||||
initialUserConfigViewData.value = response.data[0];
|
} else {
|
||||||
}
|
params.creates = [
|
||||||
emitSavedConfig();
|
{
|
||||||
notify('globals.dataSaved', 'positive');
|
userFk: user.value.id,
|
||||||
popupProxyRef.value.hide();
|
tableCode: $props.tableCode,
|
||||||
} catch (err) {
|
tableConfig: $props.tableCode,
|
||||||
console.error('Error saving user view config', err);
|
configuration: configuration,
|
||||||
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const response = await axios.post('UserConfigViews/crud', params);
|
||||||
|
if (response.data && response.data[0]) {
|
||||||
|
initialUserConfigViewData.value = response.data[0];
|
||||||
|
}
|
||||||
|
emitSavedConfig();
|
||||||
|
notify('globals.dataSaved', 'positive');
|
||||||
|
popupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
const emitSavedConfig = () => {
|
const emitSavedConfig = () => {
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { nextTick, ref, watch } from 'vue';
|
||||||
import { QInput } from 'quasar';
|
import { QInput } from 'quasar';
|
||||||
|
|
||||||
const props = defineProps({
|
const $props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
insertable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
||||||
|
|
||||||
let internalValue = ref(props.modelValue);
|
let internalValue = ref($props.modelValue);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => $props.modelValue,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
internalValue.value = 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() {
|
function accountShortToStandard() {
|
||||||
internalValue.value = internalValue.value.replace(
|
internalValue.value = internalValue.value?.replace(
|
||||||
'.',
|
'.',
|
||||||
'0'.repeat(11 - internalValue.value.length)
|
'0'.repeat(11 - internalValue.value.length)
|
||||||
);
|
);
|
||||||
|
@ -37,5 +79,5 @@ function accountShortToStandard() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-input v-model="internalValue" />
|
<QInput @keydown="handleKeydown" ref="vnInputRef" v-model="internalValue" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, useAttrs } from 'vue';
|
import { computed, ref, useAttrs, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
|
@ -34,6 +34,14 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
insertable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
maxlength: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const vnInputRef = ref(null);
|
const vnInputRef = ref(null);
|
||||||
|
@ -69,6 +77,9 @@ const mixinRules = [
|
||||||
requiredFieldRule,
|
requiredFieldRule,
|
||||||
...($attrs.rules ?? []),
|
...($attrs.rules ?? []),
|
||||||
(val) => {
|
(val) => {
|
||||||
|
const { maxlength } = vnInputRef.value;
|
||||||
|
if (maxlength && +val.length > maxlength)
|
||||||
|
return t(`maxLength`, { value: maxlength });
|
||||||
const { min, max } = vnInputRef.value.$attrs;
|
const { min, max } = vnInputRef.value.$attrs;
|
||||||
if (!min) return null;
|
if (!min) return null;
|
||||||
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -89,10 +127,12 @@ const mixinRules = [
|
||||||
:type="$attrs.type"
|
:type="$attrs.type"
|
||||||
:class="{ required: isRequired }"
|
:class="{ required: isRequired }"
|
||||||
@keyup.enter="emit('keyup.enter')"
|
@keyup.enter="emit('keyup.enter')"
|
||||||
|
@keydown="handleKeydown"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:lazy-rules="true"
|
:lazy-rules="true"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
||||||
>
|
>
|
||||||
<template v-if="$slots.prepend" #prepend>
|
<template v-if="$slots.prepend" #prepend>
|
||||||
<slot name="prepend" />
|
<slot name="prepend" />
|
||||||
|
@ -129,9 +169,11 @@ const mixinRules = [
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
inputMin: Must be more than {value}
|
inputMin: Must be more than {value}
|
||||||
|
maxLength: The value exceeds {value} characters
|
||||||
inputMax: Must be less than {value}
|
inputMax: Must be less than {value}
|
||||||
es:
|
es:
|
||||||
inputMin: Debe ser mayor a {value}
|
inputMin: Debe ser mayor a {value}
|
||||||
|
maxLength: El valor excede los {value} carácteres
|
||||||
inputMax: Debe ser menor a {value}
|
inputMax: Debe ser menor a {value}
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, watch, computed, ref } from 'vue';
|
import { onMounted, watch, computed, ref, useAttrs } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useAttrs } from 'vue';
|
|
||||||
import VnDate from './VnDate.vue';
|
import VnDate from './VnDate.vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,12 @@
|
||||||
const model = defineModel({ type: Boolean, required: true });
|
const model = defineModel({ type: Boolean, required: true });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QRadio v-model="model" v-bind="$attrs" dense :dark="true" class="q-mr-sm" />
|
<QRadio
|
||||||
|
v-model="model"
|
||||||
|
v-bind="$attrs"
|
||||||
|
dense
|
||||||
|
:dark="true"
|
||||||
|
class="q-mr-sm"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -138,8 +138,6 @@ onMounted(() => {
|
||||||
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
|
||||||
|
|
||||||
const arrayDataKey =
|
const arrayDataKey =
|
||||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
||||||
|
|
||||||
|
@ -259,6 +257,30 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({ opts: myOptions });
|
||||||
|
|
||||||
|
function handleKeyDown(event) {
|
||||||
|
if (event.key === 'Tab') {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
const inputValue = vnSelectRef.value?.inputValue;
|
||||||
|
|
||||||
|
if (inputValue) {
|
||||||
|
const matchingOption = myOptions.value.find(
|
||||||
|
(option) =>
|
||||||
|
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (matchingOption) {
|
||||||
|
emit('update:modelValue', matchingOption[optionValue.value]);
|
||||||
|
} else {
|
||||||
|
emit('update:modelValue', inputValue);
|
||||||
|
}
|
||||||
|
vnSelectRef.value?.hidePopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -269,6 +291,7 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
:option-value="optionValue"
|
:option-value="optionValue"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@filter="filterHandler"
|
@filter="filterHandler"
|
||||||
|
@keydown="handleKeyDown"
|
||||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||||
:map-options="nullishToTrue($attrs['map-options'])"
|
:map-options="nullishToTrue($attrs['map-options'])"
|
||||||
:use-input="nullishToTrue($attrs['use-input'])"
|
:use-input="nullishToTrue($attrs['use-input'])"
|
||||||
|
@ -283,6 +306,7 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
:input-debounce="useURL ? '300' : '0'"
|
:input-debounce="useURL ? '300' : '0'"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
@virtual-scroll="onScroll"
|
@virtual-scroll="onScroll"
|
||||||
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||||
>
|
>
|
||||||
<template v-if="isClearable" #append>
|
<template v-if="isClearable" #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -86,7 +86,7 @@ async function send() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QDialog ref="dialogRef">
|
<QDialog ref="dialogRef" data-cy="vnSmsDialog">
|
||||||
<QCard class="q-pa-sm">
|
<QCard class="q-pa-sm">
|
||||||
<QCardSection class="row items-center q-pb-none">
|
<QCardSection class="row items-center q-pb-none">
|
||||||
<span class="text-h6 text-grey">
|
<span class="text-h6 text-grey">
|
||||||
|
@ -161,6 +161,7 @@ async function send() {
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
color="primary"
|
color="primary"
|
||||||
unelevated
|
unelevated
|
||||||
|
data-cy="sendSmsBtn"
|
||||||
/>
|
/>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
|
@ -37,7 +37,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
hiddenTags: {
|
hiddenTags: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ['filter', 'search', 'or', 'and'],
|
default: () => ['filter', 'or', 'and'],
|
||||||
},
|
},
|
||||||
customTags: {
|
customTags: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -61,7 +61,6 @@ const emit = defineEmits([
|
||||||
'update:modelValue',
|
'update:modelValue',
|
||||||
'refresh',
|
'refresh',
|
||||||
'clear',
|
'clear',
|
||||||
'search',
|
|
||||||
'init',
|
'init',
|
||||||
'remove',
|
'remove',
|
||||||
'setUserParams',
|
'setUserParams',
|
||||||
|
@ -75,6 +74,9 @@ const arrayData = useArrayData($props.dataKey, {
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
const userParams = ref({});
|
const userParams = ref({});
|
||||||
|
|
||||||
|
defineExpose({ search, sanitizer, params: userParams });
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
userParams.value = $props.modelValue ?? {};
|
userParams.value = $props.modelValue ?? {};
|
||||||
emit('init', { params: userParams.value });
|
emit('init', { params: userParams.value });
|
||||||
|
@ -198,7 +200,7 @@ const customTags = computed(() =>
|
||||||
|
|
||||||
async function remove(key) {
|
async function remove(key) {
|
||||||
userParams.value[key] = undefined;
|
userParams.value[key] = undefined;
|
||||||
search();
|
await search();
|
||||||
emit('remove', key);
|
emit('remove', key);
|
||||||
emit('update:modelValue', userParams.value);
|
emit('update:modelValue', userParams.value);
|
||||||
}
|
}
|
||||||
|
@ -224,8 +226,6 @@ function sanitizer(params) {
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ search, sanitizer, userParams });
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -132,10 +132,24 @@ const addFilter = async (filter, params) => {
|
||||||
|
|
||||||
async function fetch(params) {
|
async function fetch(params) {
|
||||||
useArrayData(props.dataKey, params);
|
useArrayData(props.dataKey, params);
|
||||||
arrayData.reset(['filter.skip', 'skip']);
|
arrayData.reset(['filter.skip', 'skip', 'page']);
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
if (!store.hasMoreData) isLoading.value = false;
|
return emitStoreData();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function update(params) {
|
||||||
|
useArrayData(props.dataKey, params);
|
||||||
|
const { limit, skip } = store;
|
||||||
|
store.limit = limit + skip;
|
||||||
|
store.skip = 0;
|
||||||
|
await arrayData.fetch({ append: false });
|
||||||
|
store.limit = limit;
|
||||||
|
store.skip = skip;
|
||||||
|
return emitStoreData();
|
||||||
|
}
|
||||||
|
|
||||||
|
function emitStoreData() {
|
||||||
|
if (!store.hasMoreData) isLoading.value = false;
|
||||||
emit('onFetch', store.data);
|
emit('onFetch', store.data);
|
||||||
return store.data;
|
return store.data;
|
||||||
}
|
}
|
||||||
|
@ -181,7 +195,7 @@ async function onLoad(index, done) {
|
||||||
done(isDone);
|
done(isDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ fetch, addFilter, paginate });
|
defineExpose({ fetch, update, addFilter, paginate });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="vn-row q-gutter-md q-mb-md">
|
<div class="vn-row q-gutter-md">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -18,6 +18,9 @@
|
||||||
&:not(.wrap) {
|
&:not(.wrap) {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
&[fixed] {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -130,6 +130,7 @@ async function search() {
|
||||||
dense
|
dense
|
||||||
standout
|
standout
|
||||||
autofocus
|
autofocus
|
||||||
|
data-cy="vnSearchBar"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { defineProps } from 'vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
routeName: {
|
routeName: {
|
||||||
|
|
|
@ -1,11 +1,24 @@
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import { getUrl } from './getUrl';
|
import { getUrl } from './getUrl';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { exportFile } from 'quasar';
|
||||||
|
|
||||||
const { getTokenMultimedia } = useSession();
|
const { getTokenMultimedia } = useSession();
|
||||||
const token = getTokenMultimedia();
|
const token = getTokenMultimedia();
|
||||||
|
|
||||||
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
||||||
let appUrl = await getUrl('', 'lilium');
|
const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
|
||||||
appUrl = appUrl.replace('/#/', '');
|
const response = await axios.get(
|
||||||
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
|
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
|
||||||
|
{ responseType: 'blob' }
|
||||||
|
);
|
||||||
|
|
||||||
|
const contentDisposition = response.headers['content-disposition'];
|
||||||
|
const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(contentDisposition);
|
||||||
|
const filename =
|
||||||
|
matches != null && matches[1]
|
||||||
|
? matches[1].replace(/['"]/g, '')
|
||||||
|
: 'downloaded-file';
|
||||||
|
|
||||||
|
exportFile(filename, response.data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,18 +75,10 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
limit: store.limit,
|
limit: store.limit,
|
||||||
};
|
};
|
||||||
|
|
||||||
let exprFilter;
|
|
||||||
let userParams = { ...store.userParams };
|
let userParams = { ...store.userParams };
|
||||||
if (store?.exprBuilder) {
|
|
||||||
const where = buildFilter(userParams, (param, value) => {
|
|
||||||
const res = store.exprBuilder(param, value);
|
|
||||||
if (res) delete userParams[param];
|
|
||||||
return res;
|
|
||||||
});
|
|
||||||
exprFilter = where ? { where } : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.assign(filter, store.userFilter, exprFilter);
|
Object.assign(filter, store.userFilter);
|
||||||
|
|
||||||
let where;
|
let where;
|
||||||
if (filter?.where || store.filter?.where)
|
if (filter?.where || store.filter?.where)
|
||||||
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
||||||
|
@ -95,12 +87,29 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
const params = { filter };
|
const params = { filter };
|
||||||
|
|
||||||
Object.assign(params, userParams);
|
Object.assign(params, userParams);
|
||||||
params.filter.skip = store.skip;
|
if (params.filter) params.filter.skip = store.skip;
|
||||||
if (store.order && store.order.length) params.filter.order = store.order;
|
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
||||||
|
if (store.order?.length) params.filter.order = [...store.order];
|
||||||
else delete params.filter.order;
|
else delete params.filter.order;
|
||||||
|
|
||||||
|
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||||
|
delete store.currentFilter.filter.include;
|
||||||
|
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
||||||
|
|
||||||
|
let exprFilter;
|
||||||
|
if (store?.exprBuilder) {
|
||||||
|
exprFilter = buildFilter(params, (param, value) => {
|
||||||
|
if (param == 'filter') return;
|
||||||
|
const res = store.exprBuilder(param, value);
|
||||||
|
if (res) delete params[param];
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.filter.where || exprFilter)
|
||||||
|
params.filter.where = { ...params.filter.where, ...exprFilter };
|
||||||
params.filter = JSON.stringify(params.filter);
|
params.filter = JSON.stringify(params.filter);
|
||||||
store.currentFilter = params;
|
|
||||||
store.isLoading = true;
|
store.isLoading = true;
|
||||||
const response = await axios.get(store.url, {
|
const response = await axios.get(store.url, {
|
||||||
signal: canceller.signal,
|
signal: canceller.signal,
|
||||||
|
|
|
@ -241,7 +241,7 @@ input::-webkit-inner-spin-button {
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
padding: 1px 10px 1px 10px;
|
padding: 1px 10px 1px 10px;
|
||||||
max-width: 100px;
|
max-width: 130px;
|
||||||
div span {
|
div span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
@ -60,7 +60,7 @@ globals:
|
||||||
reference: Reference
|
reference: Reference
|
||||||
agency: Agency
|
agency: Agency
|
||||||
warehouseOut: Warehouse Out
|
warehouseOut: Warehouse Out
|
||||||
wareHouseIn: Warehouse In
|
warehouseIn: Warehouse In
|
||||||
landed: Landed
|
landed: Landed
|
||||||
shipped: Shipped
|
shipped: Shipped
|
||||||
totalEntries: Total entries
|
totalEntries: Total entries
|
||||||
|
@ -298,6 +298,7 @@ globals:
|
||||||
clientsActionsMonitor: Clients and actions
|
clientsActionsMonitor: Clients and actions
|
||||||
serial: Serial
|
serial: Serial
|
||||||
medical: Mutual
|
medical: Mutual
|
||||||
|
pit: IRPF
|
||||||
RouteExtendedList: Router
|
RouteExtendedList: Router
|
||||||
wasteRecalc: Waste recaclulate
|
wasteRecalc: Waste recaclulate
|
||||||
operator: Operator
|
operator: Operator
|
||||||
|
@ -506,6 +507,7 @@ invoiceOut:
|
||||||
invoiceWithFutureDate: Exists an invoice with a future date
|
invoiceWithFutureDate: Exists an invoice with a future date
|
||||||
noTicketsToInvoice: There are not tickets to invoice
|
noTicketsToInvoice: There are not tickets to invoice
|
||||||
criticalInvoiceError: 'Critical invoicing error, process stopped'
|
criticalInvoiceError: 'Critical invoicing error, process stopped'
|
||||||
|
invalidSerialTypeForAll: The serial type must be global when invoicing all clients
|
||||||
table:
|
table:
|
||||||
addressId: Address id
|
addressId: Address id
|
||||||
streetAddress: Street
|
streetAddress: Street
|
||||||
|
@ -767,6 +769,7 @@ travel:
|
||||||
hb: HB
|
hb: HB
|
||||||
basicData:
|
basicData:
|
||||||
daysInForward: Days in forward
|
daysInForward: Days in forward
|
||||||
|
isRaid: Raid
|
||||||
thermographs:
|
thermographs:
|
||||||
temperature: Temperature
|
temperature: Temperature
|
||||||
destination: Destination
|
destination: Destination
|
||||||
|
@ -857,6 +860,7 @@ components:
|
||||||
downloadFile: Download file
|
downloadFile: Download file
|
||||||
openCard: View
|
openCard: View
|
||||||
openSummary: Summary
|
openSummary: Summary
|
||||||
|
viewSummary: Summary
|
||||||
cardDescriptor:
|
cardDescriptor:
|
||||||
mainList: Main list
|
mainList: Main list
|
||||||
summary: Summary
|
summary: Summary
|
||||||
|
|
|
@ -303,6 +303,7 @@ globals:
|
||||||
clientsActionsMonitor: Clientes y acciones
|
clientsActionsMonitor: Clientes y acciones
|
||||||
serial: Facturas por serie
|
serial: Facturas por serie
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
|
pit: IRPF
|
||||||
wasteRecalc: Recalcular mermas
|
wasteRecalc: Recalcular mermas
|
||||||
operator: Operario
|
operator: Operario
|
||||||
parking: Parking
|
parking: Parking
|
||||||
|
@ -509,6 +510,7 @@ invoiceOut:
|
||||||
invoiceWithFutureDate: Existe una factura con una fecha futura
|
invoiceWithFutureDate: Existe una factura con una fecha futura
|
||||||
noTicketsToInvoice: No existen tickets para facturar
|
noTicketsToInvoice: No existen tickets para facturar
|
||||||
criticalInvoiceError: Error crítico en la facturación proceso detenido
|
criticalInvoiceError: Error crítico en la facturación proceso detenido
|
||||||
|
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
|
||||||
table:
|
table:
|
||||||
addressId: Id dirección
|
addressId: Id dirección
|
||||||
streetAddress: Dirección fiscal
|
streetAddress: Dirección fiscal
|
||||||
|
@ -761,6 +763,7 @@ travel:
|
||||||
hb: HB
|
hb: HB
|
||||||
basicData:
|
basicData:
|
||||||
daysInForward: Días redada
|
daysInForward: Días redada
|
||||||
|
isRaid: Redada
|
||||||
thermographs:
|
thermographs:
|
||||||
temperature: Temperatura
|
temperature: Temperatura
|
||||||
destination: Destino
|
destination: Destino
|
||||||
|
|
|
@ -11,21 +11,13 @@ const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const onSynchronizeAll = async () => {
|
const onSynchronizeAll = async () => {
|
||||||
try {
|
notify(t('Synchronizing in the background'), 'positive');
|
||||||
notify(t('Synchronizing in the background'), 'positive');
|
await axios.patch(`Accounts/syncAll`);
|
||||||
await axios.patch(`Accounts/syncAll`);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error synchronizing all accounts', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSynchronizeRoles = async () => {
|
const onSynchronizeRoles = async () => {
|
||||||
try {
|
await axios.patch(`RoleInherits/sync`);
|
||||||
await axios.patch(`RoleInherits/sync`);
|
notify(t('Roles synchronized!'), 'positive');
|
||||||
notify(t('Roles synchronized!'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error synchronizing roles', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -111,29 +111,25 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const deleteAcl = async ({ id }) => {
|
const deleteAcl = async ({ id }) => {
|
||||||
try {
|
await new Promise((resolve) => {
|
||||||
await new Promise((resolve) => {
|
quasar
|
||||||
quasar
|
.dialog({
|
||||||
.dialog({
|
component: VnConfirm,
|
||||||
component: VnConfirm,
|
componentProps: {
|
||||||
componentProps: {
|
title: t('Remove ACL'),
|
||||||
title: t('Remove ACL'),
|
message: t('Do you want to remove this ACL?'),
|
||||||
message: t('Do you want to remove this ACL?'),
|
},
|
||||||
},
|
})
|
||||||
})
|
.onOk(() => {
|
||||||
.onOk(() => {
|
resolve(true);
|
||||||
resolve(true);
|
})
|
||||||
})
|
.onCancel(() => {
|
||||||
.onCancel(() => {
|
resolve(false);
|
||||||
resolve(false);
|
});
|
||||||
});
|
});
|
||||||
});
|
await axios.delete(`ACLs/${id}`);
|
||||||
await axios.delete(`ACLs/${id}`);
|
tableRef.value.reload();
|
||||||
tableRef.value.reload();
|
notify('ACL removed', 'positive');
|
||||||
notify('ACL removed', 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error deleting Acl: ', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -34,13 +34,9 @@ const refresh = () => paginateRef.value.fetch();
|
||||||
const navigate = (id) => router.push({ name: 'AccountSummary', params: { id } });
|
const navigate = (id) => router.push({ name: 'AccountSummary', params: { id } });
|
||||||
|
|
||||||
const killSession = async ({ userId, created }) => {
|
const killSession = async ({ userId, created }) => {
|
||||||
try {
|
await axios.post(`${urlPath}/killSession`, { userId, created });
|
||||||
await axios.post(`${urlPath}/killSession`, { userId, created });
|
paginateRef.value.fetch();
|
||||||
paginateRef.value.fetch();
|
notify(t('Session killed'), 'positive');
|
||||||
notify(t('Session killed'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error killing session', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -40,12 +40,8 @@ const formUrlCreate = ref(null);
|
||||||
const formUrlUpdate = ref(null);
|
const formUrlUpdate = ref(null);
|
||||||
const formCustomFn = ref(null);
|
const formCustomFn = ref(null);
|
||||||
const onTestConection = async () => {
|
const onTestConection = async () => {
|
||||||
try {
|
await axios.get(`LdapConfigs/test`);
|
||||||
await axios.get(`LdapConfigs/test`);
|
notify(t('LDAP connection established!'), 'positive');
|
||||||
notify(t('LDAP connection established!'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error testing connection', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const getInitialLdapConfig = async () => {
|
const getInitialLdapConfig = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -72,14 +68,10 @@ const getInitialLdapConfig = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const deleteMailForward = async () => {
|
const deleteMailForward = async () => {
|
||||||
try {
|
await axios.delete(URL_UPDATE);
|
||||||
await axios.delete(URL_UPDATE);
|
initialData.value = { ...DEFAULT_DATA };
|
||||||
initialData.value = { ...DEFAULT_DATA };
|
hasData.value = false;
|
||||||
hasData.value = false;
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting mail forward', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => await getInitialLdapConfig());
|
onMounted(async () => await getInitialLdapConfig());
|
||||||
|
|
|
@ -46,12 +46,8 @@ const formUrlUpdate = ref(null);
|
||||||
const formCustomFn = ref(null);
|
const formCustomFn = ref(null);
|
||||||
|
|
||||||
const onTestConection = async () => {
|
const onTestConection = async () => {
|
||||||
try {
|
await axios.get(`SambaConfigs/test`);
|
||||||
await axios.get(`SambaConfigs/test`);
|
notify(t('Samba connection established!'), 'positive');
|
||||||
notify(t('Samba connection established!'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error testing connection', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getInitialSambaConfig = async () => {
|
const getInitialSambaConfig = async () => {
|
||||||
|
@ -79,14 +75,10 @@ const getInitialSambaConfig = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteMailForward = async () => {
|
const deleteMailForward = async () => {
|
||||||
try {
|
await axios.delete(URL_UPDATE);
|
||||||
await axios.delete(URL_UPDATE);
|
initialData.value = { ...DEFAULT_DATA };
|
||||||
initialData.value = { ...DEFAULT_DATA };
|
hasData.value = false;
|
||||||
hasData.value = false;
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting mail forward', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => await getInitialSambaConfig());
|
onMounted(async () => await getInitialSambaConfig());
|
||||||
|
|
|
@ -44,13 +44,9 @@ const removeAlias = () => {
|
||||||
cancel: true,
|
cancel: true,
|
||||||
})
|
})
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
try {
|
await axios.delete(`MailAliases/${entityId.value}`);
|
||||||
await axios.delete(`MailAliases/${entityId.value}`);
|
notify(t('Alias removed'), 'positive');
|
||||||
notify(t('Alias removed'), 'positive');
|
router.push({ name: 'AccountAlias' });
|
||||||
router.push({ name: 'AccountAlias' });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error removing alias');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -41,35 +41,22 @@ const fetchAccountExistence = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchMailForwards = async () => {
|
const fetchMailForwards = async () => {
|
||||||
try {
|
const response = await axios.get(`MailForwards/${route.params.id}`);
|
||||||
const response = await axios.get(`MailForwards/${route.params.id}`);
|
return response.data;
|
||||||
return response.data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching mail forwards', err);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteMailForward = async () => {
|
const deleteMailForward = async () => {
|
||||||
try {
|
await axios.delete(`MailForwards/${route.params.id}`);
|
||||||
await axios.delete(`MailForwards/${route.params.id}`);
|
formData.value.forwardTo = null;
|
||||||
formData.value.forwardTo = null;
|
initialData.value.forwardTo = null;
|
||||||
initialData.value.forwardTo = null;
|
initialData.value.hasData = hasData.value;
|
||||||
initialData.value.hasData = hasData.value;
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting mail forward', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateMailForward = async () => {
|
const updateMailForward = async () => {
|
||||||
try {
|
await axios.patch('MailForwards', formData.value);
|
||||||
await axios.patch('MailForwards', formData.value);
|
initialData.value = { ...formData.value };
|
||||||
initialData.value = { ...formData.value };
|
initialData.value.hasData = hasData.value;
|
||||||
initialData.value.hasData = hasData.value;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error creating mail forward', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
|
|
|
@ -32,12 +32,8 @@ const filter = {
|
||||||
where: { id: entityId },
|
where: { id: entityId },
|
||||||
};
|
};
|
||||||
const removeRole = async () => {
|
const removeRole = async () => {
|
||||||
try {
|
await axios.delete(`VnRoles/${entityId.value}`);
|
||||||
await axios.delete(`VnRoles/${entityId.value}`);
|
notify(t('Role removed'), 'positive');
|
||||||
notify(t('Role removed'), 'positive');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error deleting role', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ async function remove() {
|
||||||
</QMenu>
|
</QMenu>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<QItem @click="confirmRemove()" v-ripple clickable>
|
<QItem @click="confirmRemove()" v-ripple clickable data-cy="deleteClaim">
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="delete" />
|
<QIcon name="delete" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
|
|
@ -95,6 +95,7 @@ const columns = computed(() => [
|
||||||
optionLabel: 'description',
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
orderBy: 'priority',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
|
|
@ -167,7 +167,7 @@ const toCustomerAddressEdit = (addressId) => {
|
||||||
<div>{{ item.street }}</div>
|
<div>{{ item.street }}</div>
|
||||||
<div>
|
<div>
|
||||||
{{ item.postalCode }} - {{ item.city }},
|
{{ item.postalCode }} - {{ item.city }},
|
||||||
{{ item.province.name }}
|
{{ item.province?.name }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ item.phone }}
|
{{ item.phone }}
|
||||||
|
|
|
@ -320,7 +320,7 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
:value="entity.recommendedCredit"
|
:value="entity.recommendedCredit"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-max">
|
||||||
<VnTitle :text="t('Latest tickets')" />
|
<VnTitle :text="t('Latest tickets')" />
|
||||||
<CustomerSummaryTable />
|
<CustomerSummaryTable />
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
|
@ -106,28 +106,24 @@ const setParams = (params) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPreview = async () => {
|
const getPreview = async () => {
|
||||||
try {
|
const params = {
|
||||||
const params = {
|
recipientId: entityId,
|
||||||
recipientId: entityId,
|
};
|
||||||
};
|
const validationMessage = validateMessage();
|
||||||
const validationMessage = validateMessage();
|
if (validationMessage) return notify(t(validationMessage), 'negative');
|
||||||
if (validationMessage) return notify(t(validationMessage), 'negative');
|
|
||||||
|
|
||||||
setParams(params);
|
setParams(params);
|
||||||
|
|
||||||
const path = `${sampleType.value.model}/${entityId.value}/${sampleType.value.code}-html`;
|
const path = `${sampleType.value.model}/${entityId.value}/${sampleType.value.code}-html`;
|
||||||
const { data } = await axios.get(path, { params });
|
const { data } = await axios.get(path, { params });
|
||||||
|
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: CustomerSamplesPreview,
|
component: CustomerSamplesPreview,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
htmlContent: data,
|
htmlContent: data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (err) {
|
|
||||||
notify('Errors getting preview', 'negative');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
|
|
|
@ -42,13 +42,9 @@ const setData = (entity) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeDepartment = async () => {
|
const removeDepartment = async () => {
|
||||||
try {
|
await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value);
|
||||||
await axios.post(`/Departments/${entityId.value}/removeChild`, entityId.value);
|
router.push({ name: 'WorkerDepartment' });
|
||||||
router.push({ name: 'WorkerDepartment' });
|
notify('department.departmentRemoved', 'positive');
|
||||||
notify('department.departmentRemoved', 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error removing department');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
|
@ -236,13 +236,9 @@ const copyOriginalRowsData = (rows) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveChange = async (field, { rowIndex, row }) => {
|
const saveChange = async (field, { rowIndex, row }) => {
|
||||||
try {
|
if (originalRowDataCopy.value[rowIndex][field] == row[field]) return;
|
||||||
if (originalRowDataCopy.value[rowIndex][field] == row[field]) return;
|
await axios.patch(`Buys/${row.id}`, row);
|
||||||
await axios.patch(`Buys/${row.id}`, row);
|
originalRowDataCopy.value[rowIndex][field] = row[field];
|
||||||
originalRowDataCopy.value[rowIndex][field] = row[field];
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error saving changes', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openRemoveDialog = async () => {
|
const openRemoveDialog = async () => {
|
||||||
|
@ -260,15 +256,11 @@ const openRemoveDialog = async () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
try {
|
await deleteBuys();
|
||||||
await deleteBuys();
|
const notifyMessage = t(
|
||||||
const notifyMessage = t(
|
`Buy${rowsSelected.value.length > 1 ? 's' : ''} deleted`
|
||||||
`Buy${rowsSelected.value.length > 1 ? 's' : ''} deleted`
|
);
|
||||||
);
|
notify(notifyMessage, 'positive');
|
||||||
notify(notifyMessage, 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting buys');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -282,17 +274,13 @@ const importBuys = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleGroupingMode = async (buy, mode) => {
|
const toggleGroupingMode = async (buy, mode) => {
|
||||||
try {
|
const groupingMode = mode === 'grouping' ? mode : 'packing';
|
||||||
const groupingMode = mode === 'grouping' ? mode : 'packing';
|
const newGroupingMode = buy.groupingMode === groupingMode ? null : groupingMode;
|
||||||
const newGroupingMode = buy.groupingMode === groupingMode ? null : groupingMode;
|
const params = {
|
||||||
const params = {
|
groupingMode: newGroupingMode,
|
||||||
groupingMode: newGroupingMode,
|
};
|
||||||
};
|
await axios.patch(`Buys/${buy.id}`, params);
|
||||||
await axios.patch(`Buys/${buy.id}`, params);
|
buy.groupingMode = newGroupingMode;
|
||||||
buy.groupingMode = newGroupingMode;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error toggling grouping mode');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const lockIconType = (groupingMode, mode) => {
|
const lockIconType = (groupingMode, mode) => {
|
||||||
|
|
|
@ -123,36 +123,28 @@ const fillData = async (rawData) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchBuys = async (buys) => {
|
const fetchBuys = async (buys) => {
|
||||||
try {
|
const params = { buys };
|
||||||
const params = { buys };
|
const { data } = await axios.post(
|
||||||
const { data } = await axios.post(
|
`Entries/${route.params.id}/importBuysPreview`,
|
||||||
`Entries/${route.params.id}/importBuysPreview`,
|
params
|
||||||
params
|
);
|
||||||
);
|
importData.value.buys = data;
|
||||||
importData.value.buys = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching buys');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
const params = importData.value;
|
||||||
const params = importData.value;
|
const hasAnyEmptyRow = params.buys.some((buy) => {
|
||||||
const hasAnyEmptyRow = params.buys.some((buy) => {
|
return buy.itemFk === null;
|
||||||
return buy.itemFk === null;
|
});
|
||||||
});
|
|
||||||
|
|
||||||
if (hasAnyEmptyRow) {
|
if (hasAnyEmptyRow) {
|
||||||
notify(t('Some of the imported buys does not have an item'), 'negative');
|
notify(t('Some of the imported buys does not have an item'), 'negative');
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
await axios.post(`Entries/${route.params.id}/importBuys`, params);
|
|
||||||
notify('globals.dataSaved', 'positive');
|
|
||||||
redirectToBuysView();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error importing buys', err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await axios.post(`Entries/${route.params.id}/importBuys`, params);
|
||||||
|
notify('globals.dataSaved', 'positive');
|
||||||
|
redirectToBuysView();
|
||||||
};
|
};
|
||||||
|
|
||||||
const redirectToBuysView = () => {
|
const redirectToBuysView = () => {
|
||||||
|
|
|
@ -147,12 +147,9 @@ async function setEntryData(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchEntryBuys = async () => {
|
const fetchEntryBuys = async () => {
|
||||||
try {
|
|
||||||
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
||||||
if (data) entryBuys.value = data;
|
if (data) entryBuys.value = data;
|
||||||
} catch (err) {
|
|
||||||
console.error('Error fetching entry buys');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -234,7 +235,6 @@ const columns = [
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableRef = ref();
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
|
|
|
@ -221,7 +221,7 @@ onMounted(async () => {
|
||||||
t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
|
t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
|
||||||
}}</QTooltip>
|
}}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="!!row.daysInForward" name="vn:net" color="primary">
|
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{
|
{{
|
||||||
t('globals.raid', { daysInForward: row.daysInForward })
|
t('globals.raid', { daysInForward: row.daysInForward })
|
||||||
|
|
|
@ -30,8 +30,6 @@ const recalc = async () => {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
await axios.post('Applications/waste_addSales/execute-proc', params);
|
await axios.post('Applications/waste_addSales/execute-proc', params);
|
||||||
notify('wasteRecalc.recalcOk', 'positive');
|
notify('wasteRecalc.recalcOk', 'positive');
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,25 +61,18 @@ const showSendInvoiceDialog = (type) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendEmailInvoice = async ({ address }) => {
|
const sendEmailInvoice = async ({ address }) => {
|
||||||
try {
|
if (!address) notify(`The email can't be empty`, 'negative');
|
||||||
if (!address) notify(`The email can't be empty`, 'negative');
|
|
||||||
|
|
||||||
if (invoiceFormType.value === 'pdf') {
|
if (invoiceFormType.value === 'pdf') {
|
||||||
return sendEmail(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-email`, {
|
return sendEmail(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-email`, {
|
||||||
recipientId: $props.invoiceOutData.client.id,
|
recipientId: $props.invoiceOutData.client.id,
|
||||||
recipient: address,
|
recipient: address,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return sendEmail(
|
return sendEmail(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv-email`, {
|
||||||
`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv-email`,
|
recipientId: $props.invoiceOutData.client.id,
|
||||||
{
|
recipient: address,
|
||||||
recipientId: $props.invoiceOutData.client.id,
|
});
|
||||||
recipient: address,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error sending email', err);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,46 +81,30 @@ const redirectToInvoiceOutList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteInvoice = async () => {
|
const deleteInvoice = async () => {
|
||||||
try {
|
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/delete`);
|
||||||
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/delete`);
|
notify(t('InvoiceOut deleted'), 'positive');
|
||||||
notify(t('InvoiceOut deleted'), 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting invoice out', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const bookInvoice = async () => {
|
const bookInvoice = async () => {
|
||||||
try {
|
await axios.post(`InvoiceOuts/${$props.invoiceOutData.ref}/book`);
|
||||||
await axios.post(`InvoiceOuts/${$props.invoiceOutData.ref}/book`);
|
notify(t('InvoiceOut booked'), 'positive');
|
||||||
notify(t('InvoiceOut booked'), 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error booking invoice out', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const generateInvoicePdf = async () => {
|
const generateInvoicePdf = async () => {
|
||||||
try {
|
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/createPdf`);
|
||||||
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/createPdf`);
|
notify(t('The invoice PDF document has been regenerated'), 'positive');
|
||||||
notify(t('The invoice PDF document has been regenerated'), 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error generating invoice out pdf', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const refundInvoice = async (withWarehouse) => {
|
const refundInvoice = async (withWarehouse) => {
|
||||||
try {
|
const params = { ref: $props.invoiceOutData.ref, withWarehouse: withWarehouse };
|
||||||
const params = { ref: $props.invoiceOutData.ref, withWarehouse: withWarehouse };
|
const { data } = await axios.post('InvoiceOuts/refund', params);
|
||||||
const { data } = await axios.post('InvoiceOuts/refund', params);
|
location.href = window.origin + `/#/ticket/${data[0].id}/sale`;
|
||||||
location.href = window.origin + `/#/ticket/${data[0].id}/sale`;
|
notify(
|
||||||
notify(
|
t('refundInvoiceSuccessMessage', {
|
||||||
t('refundInvoiceSuccessMessage', {
|
refundTicket: data[0].id,
|
||||||
refundTicket: data[0].id,
|
}),
|
||||||
}),
|
'positive'
|
||||||
'positive'
|
);
|
||||||
);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error generating invoice out pdf', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const showTransferInvoiceForm = async () => {
|
const showTransferInvoiceForm = async () => {
|
||||||
|
|
|
@ -183,7 +183,7 @@ onMounted(async () => {
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
invoiceDate: Invoice date
|
invoiceDate: Invoice date
|
||||||
maxShipped: Max date
|
maxShipped: Max date ticket
|
||||||
allClients: All clients
|
allClients: All clients
|
||||||
oneClient: One client
|
oneClient: One client
|
||||||
company: Company
|
company: Company
|
||||||
|
@ -195,7 +195,7 @@ en:
|
||||||
|
|
||||||
es:
|
es:
|
||||||
invoiceDate: Fecha de factura
|
invoiceDate: Fecha de factura
|
||||||
maxShipped: Fecha límite
|
maxShipped: Fecha límite ticket
|
||||||
allClients: Todos los clientes
|
allClients: Todos los clientes
|
||||||
oneClient: Un solo cliente
|
oneClient: Un solo cliente
|
||||||
company: Empresa
|
company: Empresa
|
||||||
|
|
|
@ -6,15 +6,19 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'src/composables/usePrintService';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
||||||
import { toCurrency, toDate } from 'src/filters/index';
|
import { toCurrency, toDate } from 'src/filters/index';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { QBtn } from 'quasar';
|
import { QBtn } from 'quasar';
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
import axios from 'axios';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import VnRadio from 'src/components/common/VnRadio.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -26,99 +30,86 @@ const selectedRows = ref([]);
|
||||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||||
const MODEL = 'InvoiceOuts';
|
const MODEL = 'InvoiceOuts';
|
||||||
const { openReport } = usePrintService();
|
const { openReport } = usePrintService();
|
||||||
|
const addressOptions = ref([]);
|
||||||
|
const selectedOption = ref('ticket');
|
||||||
|
async function fetchClientAddress(id) {
|
||||||
|
const { data } = await axios.get(
|
||||||
|
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
||||||
|
);
|
||||||
|
addressOptions.value = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
const exprBuilder = (_, value) => {
|
||||||
|
return {
|
||||||
|
or: [{ code: value }, { description: { like: `%${value}%` } }],
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.id'),
|
label: t('invoiceOutList.tableVisibleColumns.id'),
|
||||||
chip: {
|
chip: { condition: () => true },
|
||||||
condition: () => true,
|
|
||||||
},
|
|
||||||
isId: true,
|
isId: true,
|
||||||
columnFilter: {
|
columnFilter: { name: 'search' },
|
||||||
name: 'search',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'ref',
|
name: 'ref',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.ref'),
|
label: t('globals.reference'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' },
|
||||||
url: MODEL,
|
columnField: { component: null },
|
||||||
optionLabel: 'ref',
|
|
||||||
optionValue: 'id',
|
|
||||||
},
|
|
||||||
columnField: {
|
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'Issued',
|
name: 'issued',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.issued'),
|
label: t('invoiceOut.summary.issued'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
format: (row) => toDate(row.issued),
|
format: (row) => toDate(row.issued),
|
||||||
columnField: {
|
columnField: { component: null },
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'clientFk',
|
name: 'clientFk',
|
||||||
label: t('invoiceOutModule.customer'),
|
label: t('globals.client'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: { url: 'Clients', fields: ['id', 'name'] },
|
||||||
url: 'Clients',
|
columnField: { component: null },
|
||||||
fields: ['id', 'name'],
|
|
||||||
},
|
|
||||||
columnField: {
|
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'companyCode',
|
name: 'companyCode',
|
||||||
label: t('invoiceOutModule.company'),
|
label: t('globals.company'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: { url: 'Companies', optionLabel: 'code', optionValue: 'id' },
|
||||||
url: 'Companies',
|
columnField: { component: null },
|
||||||
optionLabel: 'code',
|
|
||||||
optionValue: 'id',
|
|
||||||
},
|
|
||||||
columnField: {
|
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
label: t('invoiceOutModule.amount'),
|
label: t('globals.amount'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
format: (row) => toCurrency(row.amount),
|
format: (row) => toCurrency(row.amount),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'created',
|
name: 'created',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.created'),
|
label: t('globals.created'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
columnField: {
|
columnField: { component: null },
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
format: (row) => toDate(row.created),
|
format: (row) => toDate(row.created),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'dued',
|
name: 'dued',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.dueDate'),
|
label: t('invoiceOut.summary.dued'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
columnField: {
|
columnField: { component: null },
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
format: (row) => toDate(row.dued),
|
format: (row) => toDate(row.dued),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -128,11 +119,12 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('components.smartCard.viewSummary'),
|
title: t('components.smartCard.viewSummary'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
|
isPrimary: true,
|
||||||
action: (row) => viewSummary(row.id, InvoiceOutSummary),
|
action: (row) => viewSummary(row.id, InvoiceOutSummary),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('DownloadPdf'),
|
title: t('globals.downloadPdf'),
|
||||||
icon: 'vn:ticket',
|
icon: 'cloud_download',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => openPdf(row.id),
|
action: (row) => openPdf(row.id),
|
||||||
},
|
},
|
||||||
|
@ -143,15 +135,10 @@ onMounted(() => (stateStore.rightDrawer = true));
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
function openPdf(id) {
|
function openPdf(id) {
|
||||||
try {
|
openReport(`${MODEL}/${id}/download`);
|
||||||
openReport(`${MODEL}/${id}/download`);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error opening PDF', err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadPdf() {
|
function downloadPdf() {
|
||||||
try {
|
|
||||||
if (selectedRows.value.size === 0) return;
|
if (selectedRows.value.size === 0) return;
|
||||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
const selectedCardsArray = Array.from(selectedRows.value.values());
|
||||||
|
|
||||||
|
@ -170,9 +157,7 @@ function downloadPdf() {
|
||||||
|
|
||||||
openReport(`${MODEL}/downloadZip`, params);
|
openReport(`${MODEL}/downloadZip`, params);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
|
||||||
console.error('Error opening PDF');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watchEffect(selectedRows);
|
watchEffect(selectedRows);
|
||||||
|
@ -181,7 +166,7 @@ watchEffect(selectedRows);
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
:info="t('youCanSearchByInvoiceReference')"
|
:info="t('youCanSearchByInvoiceReference')"
|
||||||
:label="t('searchInvoice')"
|
:label="t('Search invoice')"
|
||||||
data-key="invoiceOutList"
|
data-key="invoiceOutList"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
|
@ -197,7 +182,7 @@ watchEffect(selectedRows);
|
||||||
@click="downloadPdf()"
|
@click="downloadPdf()"
|
||||||
:disable="!hasSelectedCards"
|
:disable="!hasSelectedCards"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('globals.downloadPdf') }}</QTooltip>
|
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
@ -207,11 +192,9 @@ watchEffect(selectedRows);
|
||||||
:url="`${MODEL}/filter`"
|
:url="`${MODEL}/filter`"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'InvoiceOuts/createManualInvoice',
|
urlCreate: 'InvoiceOuts/createManualInvoice',
|
||||||
title: t('Create manual invoice'),
|
title: t('createManualInvoice'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {
|
formInitialData: { active: true },
|
||||||
active: true,
|
|
||||||
},
|
|
||||||
}"
|
}"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
|
@ -231,74 +214,199 @@ watchEffect(selectedRows);
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<div class="flex no-wrap flex-center">
|
<div class="row q-col-gutter-xs">
|
||||||
<VnSelect
|
<div class="col-12">
|
||||||
url="Tickets"
|
<div class="q-col-gutter-xs">
|
||||||
v-model="data.ticketFk"
|
<VnRow fixed>
|
||||||
:label="t('invoiceOutList.tableVisibleColumns.ticket')"
|
<VnRadio
|
||||||
option-label="id"
|
v-model="selectedOption"
|
||||||
option-value="id"
|
val="ticket"
|
||||||
>
|
:label="t('globals.ticket')"
|
||||||
<template #option="scope">
|
class="q-my-none q-mr-md"
|
||||||
<QItem v-bind="scope.itemProps">
|
/>
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
|
<VnInput
|
||||||
<QItemLabel caption>{{ scope.opt?.nickname }}</QItemLabel>
|
v-show="selectedOption === 'ticket'"
|
||||||
</QItemSection>
|
v-model="data.ticketFk"
|
||||||
</QItem>
|
:label="t('globals.ticket')"
|
||||||
</template>
|
style="flex: 1"
|
||||||
</VnSelect>
|
/>
|
||||||
<span class="q-ml-md">O</span>
|
|
||||||
|
<div
|
||||||
|
class="row q-col-gutter-xs q-ml-none"
|
||||||
|
v-show="selectedOption !== 'ticket'"
|
||||||
|
>
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
v-model="data.clientFk"
|
||||||
|
:label="t('globals.client')"
|
||||||
|
url="Clients"
|
||||||
|
:options="customerOptions"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
@update:model-value="fetchClientAddress"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
#{{ scope.opt?.id }} -
|
||||||
|
{{ scope.opt?.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<VnSelect
|
||||||
|
v-model="data.addressFk"
|
||||||
|
:label="t('ticket.summary.consignee')"
|
||||||
|
:options="addressOptions"
|
||||||
|
option-label="nickname"
|
||||||
|
option-value="id"
|
||||||
|
v-if="
|
||||||
|
data.clientFk &&
|
||||||
|
selectedOption === 'consignatario'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel
|
||||||
|
:class="{
|
||||||
|
'color-vn-label':
|
||||||
|
!scope.opt?.isActive,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
`${
|
||||||
|
!scope.opt?.isActive
|
||||||
|
? t('inactive')
|
||||||
|
: ''
|
||||||
|
} `
|
||||||
|
}}
|
||||||
|
<span>{{
|
||||||
|
scope.opt?.nickname
|
||||||
|
}}</span>
|
||||||
|
<span
|
||||||
|
v-if="
|
||||||
|
scope.opt?.province ||
|
||||||
|
scope.opt?.city ||
|
||||||
|
scope.opt?.street
|
||||||
|
"
|
||||||
|
>
|
||||||
|
, {{ scope.opt?.street }},
|
||||||
|
{{ scope.opt?.city }},
|
||||||
|
{{
|
||||||
|
scope.opt?.province?.name
|
||||||
|
}}
|
||||||
|
-
|
||||||
|
{{
|
||||||
|
scope.opt?.agencyMode
|
||||||
|
?.name
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow fixed>
|
||||||
|
<VnRadio
|
||||||
|
v-model="selectedOption"
|
||||||
|
val="cliente"
|
||||||
|
:label="t('globals.client')"
|
||||||
|
class="q-my-none q-mr-md"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow fixed>
|
||||||
|
<VnRadio
|
||||||
|
v-model="selectedOption"
|
||||||
|
val="consignatario"
|
||||||
|
:label="t('ticket.summary.consignee')"
|
||||||
|
class="q-my-none q-mr-md"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="full-width">
|
||||||
|
<VnRow class="row q-col-gutter-xs">
|
||||||
|
<VnSelect
|
||||||
|
url="InvoiceOutSerials"
|
||||||
|
v-model="data.serial"
|
||||||
|
:label="t('invoiceIn.serial')"
|
||||||
|
:options="invoiceOutSerialsOptions"
|
||||||
|
option-label="description"
|
||||||
|
option-value="code"
|
||||||
|
option-filter
|
||||||
|
:expr-builder="exprBuilder"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.code }} -
|
||||||
|
{{ scope.opt?.description }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnInputDate
|
||||||
|
:label="t('invoiceOut.summary.dued')"
|
||||||
|
v-model="data.maxShipped"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow class="row q-col-gutter-xs">
|
||||||
|
<VnSelect
|
||||||
|
url="TaxAreas"
|
||||||
|
v-model="data.taxArea"
|
||||||
|
:label="t('invoiceOutList.tableVisibleColumns.taxArea')"
|
||||||
|
:options="taxAreasOptions"
|
||||||
|
option-label="code"
|
||||||
|
option-value="code"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.reference"
|
||||||
|
:label="t('globals.reference')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<VnSelect
|
|
||||||
url="Clients"
|
|
||||||
v-model="data.clientFk"
|
|
||||||
:label="t('invoiceOutModule.customer')"
|
|
||||||
:options="customerOptions"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
url="InvoiceOutSerials"
|
|
||||||
v-model="data.serial"
|
|
||||||
:label="t('invoiceOutList.tableVisibleColumns.invoiceOutSerial')"
|
|
||||||
:options="invoiceOutSerialsOptions"
|
|
||||||
option-label="description"
|
|
||||||
option-value="code"
|
|
||||||
/>
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('invoiceOutList.tableVisibleColumns.dueDate')"
|
|
||||||
v-model="data.maxShipped"
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
url="TaxAreas"
|
|
||||||
v-model="data.taxArea"
|
|
||||||
:label="t('invoiceOutList.tableVisibleColumns.taxArea')"
|
|
||||||
:options="taxAreasOptions"
|
|
||||||
option-label="code"
|
|
||||||
option-value="code"
|
|
||||||
/>
|
|
||||||
<QInput
|
|
||||||
v-model="data.reference"
|
|
||||||
:label="t('invoiceOutList.tableVisibleColumns.ref')"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
#formModel .vn-row {
|
||||||
|
min-height: 45px;
|
||||||
|
|
||||||
|
.q-radio {
|
||||||
|
align-self: flex-end;
|
||||||
|
flex: 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .q-input,
|
||||||
|
> .q-select {
|
||||||
|
flex: 0.75;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
searchInvoice: Search issued invoice
|
invoiceId: Invoice ID
|
||||||
fileDenied: Browser denied file download...
|
youCanSearchByInvoiceReference: You can search by invoice reference
|
||||||
fileAllowed: Successful download of CSV file
|
createManualInvoice: Create Manual Invoice
|
||||||
youCanSearchByInvoiceReference: You can search by invoice reference
|
inactive: (Inactive)
|
||||||
createInvoice: Make invoice
|
|
||||||
Create manual invoice: Create manual invoice
|
es:
|
||||||
es:
|
invoiceId: ID de factura
|
||||||
searchInvoice: Buscar factura emitida
|
youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
|
||||||
fileDenied: El navegador denegó la descarga de archivos...
|
createManualInvoice: Crear factura manual
|
||||||
fileAllowed: Descarga exitosa de archivo CSV
|
inactive: (Inactivo)
|
||||||
youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
|
|
||||||
createInvoice: Crear factura
|
|
||||||
Create manual invoice: Crear factura manual
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -2,6 +2,7 @@ invoiceOutModule:
|
||||||
customer: Client
|
customer: Client
|
||||||
amount: Amount
|
amount: Amount
|
||||||
company: Company
|
company: Company
|
||||||
|
address: Address
|
||||||
invoiceOutList:
|
invoiceOutList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
id: ID
|
id: ID
|
||||||
|
@ -15,11 +16,11 @@ invoiceOutList:
|
||||||
DownloadPdf: Download PDF
|
DownloadPdf: Download PDF
|
||||||
InvoiceOutSummary: Summary
|
InvoiceOutSummary: Summary
|
||||||
negativeBases:
|
negativeBases:
|
||||||
country: Country
|
country: Country
|
||||||
clientId: Client ID
|
clientId: Client ID
|
||||||
base: Base
|
base: Base
|
||||||
ticketId: Ticket
|
ticketId: Ticket
|
||||||
active: Active
|
active: Active
|
||||||
hasToInvoice: Has to invoice
|
hasToInvoice: Has to invoice
|
||||||
verifiedData: Verified data
|
verifiedData: Verified data
|
||||||
commercial: Commercial
|
commercial: Commercial
|
||||||
|
|
|
@ -4,6 +4,7 @@ invoiceOutModule:
|
||||||
customer: Cliente
|
customer: Cliente
|
||||||
amount: Importe
|
amount: Importe
|
||||||
company: Empresa
|
company: Empresa
|
||||||
|
address: Consignatario
|
||||||
invoiceOutList:
|
invoiceOutList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
id: ID
|
id: ID
|
||||||
|
|
|
@ -170,7 +170,7 @@ onMounted(async () => {
|
||||||
from.value = getDate(_from, 'from');
|
from.value = getDate(_from, 'from');
|
||||||
const _to = Date.vnNew();
|
const _to = Date.vnNew();
|
||||||
_to.setDate(_to.getDate() + 10);
|
_to.setDate(_to.getDate() + 10);
|
||||||
to.value = getDate(Date.vnNew(), 'to');
|
to.value = getDate(_to, 'to');
|
||||||
|
|
||||||
updateFilter();
|
updateFilter();
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,9 @@ const arrayData = useArrayData('ItemShelvings', {
|
||||||
const rows = computed(() => arrayData.store.data || []);
|
const rows = computed(() => arrayData.store.data || []);
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
const applyColumnFilter = async (col) => {
|
||||||
try {
|
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
params[paramKey] = col.columnFilter.filterValue;
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
await arrayData.addFilter({ filter: null, params });
|
||||||
await arrayData.addFilter({ filter: null, params });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error applying column filter', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getInputEvents = (col) => {
|
const getInputEvents = (col) => {
|
||||||
|
@ -173,15 +169,11 @@ const totalLabels = computed(() =>
|
||||||
);
|
);
|
||||||
|
|
||||||
const removeLines = async () => {
|
const removeLines = async () => {
|
||||||
try {
|
const itemShelvingIds = rowsSelected.value.map((row) => row.itemShelvingFk);
|
||||||
const itemShelvingIds = rowsSelected.value.map((row) => row.itemShelvingFk);
|
await axios.post('ItemShelvings/deleteItemShelvings', { itemShelvingIds });
|
||||||
await axios.post('ItemShelvings/deleteItemShelvings', { itemShelvingIds });
|
rowsSelected.value = [];
|
||||||
rowsSelected.value = [];
|
notify('shelvings.shelvingsRemoved', 'positive');
|
||||||
notify('shelvings.shelvingsRemoved', 'positive');
|
await arrayData.fetch({ append: false });
|
||||||
await arrayData.fetch({ append: false });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error removing lines', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
|
|
|
@ -19,22 +19,18 @@ const tagOptions = ref([]);
|
||||||
const valueOptionsMap = ref(new Map());
|
const valueOptionsMap = ref(new Map());
|
||||||
|
|
||||||
const getSelectedTagValues = async (tag) => {
|
const getSelectedTagValues = async (tag) => {
|
||||||
try {
|
if (!tag.tagFk && tag.tag.isFree) return;
|
||||||
if (!tag.tagFk && tag.tag.isFree) return;
|
const filter = {
|
||||||
const filter = {
|
fields: ['value'],
|
||||||
fields: ['value'],
|
order: 'value ASC',
|
||||||
order: 'value ASC',
|
limit: 30,
|
||||||
limit: 30,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(`Tags/${tag.tagFk}/filterValue`, {
|
const { data } = await axios.get(`Tags/${tag.tagFk}/filterValue`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
valueOptionsMap.value.set(tag.tagFk, data);
|
valueOptionsMap.value.set(tag.tagFk, data);
|
||||||
} catch (err) {
|
|
||||||
console.error('Error getting selected tag values');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onItemTagsFetched = async (itemTags) => {
|
const onItemTagsFetched = async (itemTags) => {
|
||||||
|
|
|
@ -32,17 +32,13 @@ const ItemTaxRef = ref(null);
|
||||||
const taxesOptions = ref([]);
|
const taxesOptions = ref([]);
|
||||||
|
|
||||||
const submitTaxes = async (data) => {
|
const submitTaxes = async (data) => {
|
||||||
try {
|
let payload = data.map((tax) => ({
|
||||||
let payload = data.map((tax) => ({
|
id: tax.id,
|
||||||
id: tax.id,
|
taxClassFk: tax.taxClassFk,
|
||||||
taxClassFk: tax.taxClassFk,
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
await axios.post(`Items/updateTaxes`, payload);
|
await axios.post(`Items/updateTaxes`, payload);
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
} catch (err) {
|
|
||||||
console.error('Error saving taxes', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -221,24 +221,16 @@ const updateMinPrice = async (value, props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const upsertPrice = async (props, resetMinPrice = false) => {
|
const upsertPrice = async (props, resetMinPrice = false) => {
|
||||||
try {
|
const { row } = props;
|
||||||
const { row } = props;
|
if (tableRef.value.CrudModelRef.getChanges().updates.length > 0) {
|
||||||
if (tableRef.value.CrudModelRef.getChanges().updates.length > 0) {
|
if (resetMinPrice) row.hasMinPrice = 0;
|
||||||
if (resetMinPrice) row.hasMinPrice = 0;
|
await upsertFixedPrice(row);
|
||||||
await upsertFixedPrice(row);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error editing price', err);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function upsertFixedPrice(row) {
|
async function upsertFixedPrice(row) {
|
||||||
try {
|
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
|
||||||
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
|
return data;
|
||||||
return data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error editing price', err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveOnRowChange(row) {
|
async function saveOnRowChange(row) {
|
||||||
|
@ -321,14 +313,10 @@ const onEditCellDataSaved = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeFuturePrice = async () => {
|
const removeFuturePrice = async () => {
|
||||||
try {
|
rowsSelected.value.forEach(({ id }) => {
|
||||||
rowsSelected.value.forEach(({ id }) => {
|
const rowIndex = fixedPrices.value.findIndex(({ id }) => id === id);
|
||||||
const rowIndex = fixedPrices.value.findIndex(({ id }) => id === id);
|
removePrice(id, rowIndex);
|
||||||
removePrice(id, rowIndex);
|
});
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error removing price', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function confirmRemove(item, isFuture) {
|
function confirmRemove(item, isFuture) {
|
||||||
|
@ -345,13 +333,9 @@ function confirmRemove(item, isFuture) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const removePrice = async (id) => {
|
const removePrice = async (id) => {
|
||||||
try {
|
await axios.delete(`FixedPrices/${id}`);
|
||||||
await axios.delete(`FixedPrices/${id}`);
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
tableRef.value.reload({});
|
||||||
tableRef.value.reload({});
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error removing price', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const dateStyle = (date) =>
|
const dateStyle = (date) =>
|
||||||
date
|
date
|
||||||
|
|
|
@ -55,22 +55,18 @@ const onCategoryChange = async (categoryFk, search) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSelectedTagValues = async (tag) => {
|
const getSelectedTagValues = async (tag) => {
|
||||||
try {
|
if (!tag?.selectedTag?.id) return;
|
||||||
if (!tag?.selectedTag?.id) return;
|
tag.value = null;
|
||||||
tag.value = null;
|
const filter = {
|
||||||
const filter = {
|
fields: ['value'],
|
||||||
fields: ['value'],
|
order: 'value ASC',
|
||||||
order: 'value ASC',
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(`Tags/${tag.selectedTag.id}/filterValue`, {
|
const { data } = await axios.get(`Tags/${tag.selectedTag.id}/filterValue`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
tag.valueOptions = data;
|
tag.valueOptions = data;
|
||||||
} catch (err) {
|
|
||||||
console.error('Error getting selected tag values');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const applyTags = (params, search) => {
|
const applyTags = (params, search) => {
|
||||||
|
|
|
@ -173,40 +173,29 @@ const getBadgeColor = (date) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeQuantity = async (request) => {
|
const changeQuantity = async (request) => {
|
||||||
try {
|
if (request.saleFk) {
|
||||||
if (request.saleFk) {
|
const params = {
|
||||||
const params = {
|
quantity: request.saleQuantity,
|
||||||
quantity: request.saleQuantity,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
await axios.patch(`Sales/${request.saleFk}`, params);
|
await axios.patch(`Sales/${request.saleFk}`, params);
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
confirmRequest(request);
|
confirmRequest(request);
|
||||||
} else confirmRequest(request);
|
} else confirmRequest(request);
|
||||||
} catch (error) {
|
|
||||||
console.error('Error changing quantity:: ', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const confirmRequest = async (request) => {
|
const confirmRequest = async (request) => {
|
||||||
try {
|
if (request.itemFk && request.saleQuantity) {
|
||||||
if (request.itemFk && request.saleQuantity) {
|
const params = {
|
||||||
const params = {
|
itemFk: request.itemFk,
|
||||||
itemFk: request.itemFk,
|
quantity: request.saleQuantity,
|
||||||
quantity: request.saleQuantity,
|
attenderFk: request.attenderFk,
|
||||||
attenderFk: request.attenderFk,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const { data } = await axios.post(
|
const { data } = await axios.post(`TicketRequests/${request.id}/confirm`, params);
|
||||||
`TicketRequests/${request.id}/confirm`,
|
request.itemDescription = data.concept;
|
||||||
params
|
request.isOk = true;
|
||||||
);
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
request.itemDescription = data.concept;
|
|
||||||
request.isOk = true;
|
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error confirming request:: ', error);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -103,15 +103,11 @@ const getBadgeColor = (date) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeOrders = async () => {
|
const removeOrders = async () => {
|
||||||
try {
|
const selectedIds = selectedRows.value.map((row) => row.id);
|
||||||
const selectedIds = selectedRows.value.map((row) => row.id);
|
const params = { deletes: selectedIds };
|
||||||
const params = { deletes: selectedIds };
|
await axios.post('SalesMonitors/deleteOrders', params);
|
||||||
await axios.post('SalesMonitors/deleteOrders', params);
|
selectedRows.value = [];
|
||||||
selectedRows.value = [];
|
await table.value.reload();
|
||||||
await table.value.reload();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting orders', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openTab = (id) =>
|
const openTab = (id) =>
|
||||||
|
|
|
@ -18,7 +18,7 @@ const groupedStates = ref();
|
||||||
const handleScopeDays = (params, days, callback) => {
|
const handleScopeDays = (params, days, callback) => {
|
||||||
const [from, to] = dateRange(Date.vnNew());
|
const [from, to] = dateRange(Date.vnNew());
|
||||||
if (!days) {
|
if (!days) {
|
||||||
Object.assign(params, { from, to, scopeDays: 1 });
|
Object.assign(params, { from, to, scopeDays: 0 });
|
||||||
} else {
|
} else {
|
||||||
params.from = from;
|
params.from = from;
|
||||||
to.setDate(to.getDate() + days);
|
to.setDate(to.getDate() + days);
|
||||||
|
@ -59,7 +59,7 @@ const getLocale = (label) => {
|
||||||
</template>
|
</template>
|
||||||
<template #customTags="{ params, searchFn, formatFn }">
|
<template #customTags="{ params, searchFn, formatFn }">
|
||||||
<VnFilterPanelChip
|
<VnFilterPanelChip
|
||||||
v-if="params.scopeDays"
|
v-if="params.scopeDays !== null"
|
||||||
removable
|
removable
|
||||||
@remove="handleScopeDays(params, null, searchFn)"
|
@remove="handleScopeDays(params, null, searchFn)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { toCurrency, dateRange, dashIfEmpty } from 'src/filters';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
||||||
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
||||||
|
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||||
|
|
||||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -23,13 +24,15 @@ const tableRef = ref(null);
|
||||||
const provinceOpts = ref([]);
|
const provinceOpts = ref([]);
|
||||||
const stateOpts = ref([]);
|
const stateOpts = ref([]);
|
||||||
const zoneOpts = ref([]);
|
const zoneOpts = ref([]);
|
||||||
const visibleColumns = ref([]);
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const from = Date.vnNew();
|
|
||||||
from.setHours(0, 0, 0, 0);
|
const [from, to] = dateRange(Date.vnNew());
|
||||||
const to = new Date(from.getTime());
|
const stateColors = {
|
||||||
to.setDate(to.getDate() + 1);
|
notice: 'info',
|
||||||
to.setHours(23, 59, 59, 999);
|
success: 'positive',
|
||||||
|
warning: 'warning',
|
||||||
|
alert: 'negative',
|
||||||
|
};
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -224,7 +227,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('salesTicketsTable.goToLines'),
|
title: t('salesTicketsTable.goToLines'),
|
||||||
icon: 'vn:lines',
|
icon: 'vn:lines',
|
||||||
color: 'priamry',
|
color: 'primary',
|
||||||
action: (row) => openTab(row.id),
|
action: (row) => openTab(row.id),
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -235,7 +238,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('salesTicketsTable.preview'),
|
title: t('salesTicketsTable.preview'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
color: 'priamry',
|
color: 'primary',
|
||||||
action: (row) => viewSummary(row.id, TicketSummary),
|
action: (row) => viewSummary(row.id, TicketSummary),
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -253,10 +256,10 @@ const getBadgeAttrs = (date) => {
|
||||||
let timeTicket = new Date(date);
|
let timeTicket = new Date(date);
|
||||||
timeTicket.setHours(0, 0, 0, 0);
|
timeTicket.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
let comparation = today - timeTicket;
|
let timeDiff = today - timeTicket;
|
||||||
|
|
||||||
if (comparation == 0) return { color: 'warning', 'text-color': 'black' };
|
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
|
||||||
if (comparation < 0) return { color: 'success', 'text-color': 'black' };
|
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
|
||||||
return { color: 'transparent', 'text-color': 'white' };
|
return { color: 'transparent', 'text-color': 'white' };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -271,13 +274,6 @@ const autoRefreshHandler = (value) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const stateColors = {
|
|
||||||
notice: 'info',
|
|
||||||
success: 'positive',
|
|
||||||
warning: 'warning',
|
|
||||||
alert: 'negative',
|
|
||||||
};
|
|
||||||
|
|
||||||
const totalPriceColor = (ticket) => {
|
const totalPriceColor = (ticket) => {
|
||||||
const total = parseInt(ticket.totalWithVat);
|
const total = parseInt(ticket.totalWithVat);
|
||||||
if (total > 0 && total < 50) return 'warning';
|
if (total > 0 && total < 50) return 'warning';
|
||||||
|
@ -285,10 +281,10 @@ const totalPriceColor = (ticket) => {
|
||||||
|
|
||||||
const formatShippedDate = (date) => {
|
const formatShippedDate = (date) => {
|
||||||
if (!date) return '-';
|
if (!date) return '-';
|
||||||
const split1 = date.split('T');
|
const dateSplit = date.split('T');
|
||||||
const [year, month, day] = split1[0].split('-');
|
const [year, month, day] = dateSplit[0].split('-');
|
||||||
const _date = new Date(year, month - 1, day);
|
const newDate = new Date(year, month - 1, day);
|
||||||
return toDateFormat(_date);
|
return toDateFormat(newDate);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openTab = (id) =>
|
const openTab = (id) =>
|
||||||
|
@ -336,13 +332,12 @@ const openTab = (id) =>
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:offset="50"
|
:offset="50"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:visible-columns="visibleColumns"
|
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
auto-load
|
auto-load
|
||||||
:row-click="({ id }) => openTab(id)"
|
:row-click="({ id }) => openTab(id)"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:user-params="{ from, to, scopeDays: 1 }"
|
:user-params="{ from, to, scopeDays: 0 }"
|
||||||
>
|
>
|
||||||
<template #top-left>
|
<template #top-left>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -352,7 +347,7 @@ const openTab = (id) =>
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
@click="$refs.tableRef.reload()"
|
@click="tableRef.CrudModelRef.vnPaginateRef.update()"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -366,61 +361,7 @@ const openTab = (id) =>
|
||||||
</QCheckbox>
|
</QCheckbox>
|
||||||
</template>
|
</template>
|
||||||
<template #column-totalProblems="{ row }">
|
<template #column-totalProblems="{ row }">
|
||||||
<span>
|
<TicketProblems :row="row" />
|
||||||
<QIcon
|
|
||||||
v-if="row.isTaxDataChecked === 0"
|
|
||||||
name="vn:no036"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasTicketRequest"
|
|
||||||
name="vn:buyrequest"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.itemShortage"
|
|
||||||
name="vn:unavailable"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.risk"
|
|
||||||
name="vn:risk"
|
|
||||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip
|
|
||||||
>{{ $t('salesTicketsTable.risk') }}: {{ row.risk }}</QTooltip
|
|
||||||
>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasComponentLack"
|
|
||||||
name="vn:components"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.isTooLittle"
|
|
||||||
name="vn:isTooLittle"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</span>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-id="{ row }">
|
<template #column-id="{ row }">
|
||||||
<span class="link" @click.stop.prevent>
|
<span class="link" @click.stop.prevent>
|
||||||
|
@ -475,7 +416,7 @@ const openTab = (id) =>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
<template #column-zoneFk="{ row }">
|
<template #column-zoneFk="{ row }">
|
||||||
<div @click.stop.prevent :title="row.zoneName">
|
<div v-if="row.zoneFk" @click.stop.prevent :title="row.zoneName">
|
||||||
<span class="link">{{ row.zoneName }}</span>
|
<span class="link">{{ row.zoneName }}</span>
|
||||||
<ZoneDescriptorProxy :id="row.zoneFk" />
|
<ZoneDescriptorProxy :id="row.zoneFk" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -31,47 +31,25 @@ const applyTags = () => {
|
||||||
emit('applyTags', tagInfo);
|
emit('applyTags', tagInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeTagGroupParam = (valIndex = null) => {
|
|
||||||
if (!valIndex) {
|
|
||||||
tagValues.value = [{}];
|
|
||||||
} else {
|
|
||||||
(tagValues.value || []).splice(valIndex, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getSelectedTagValues = async (tag) => {
|
const getSelectedTagValues = async (tag) => {
|
||||||
try {
|
if (!tag?.id) return;
|
||||||
if (!tag?.id) return;
|
const filter = {
|
||||||
const filter = {
|
fields: ['value'],
|
||||||
fields: ['value'],
|
order: 'value ASC',
|
||||||
order: 'value ASC',
|
};
|
||||||
limit: 30,
|
|
||||||
};
|
|
||||||
|
|
||||||
const url = `Tags/${tag?.id}/filterValue`;
|
const url = `Tags/${tag?.id}/filterValue`;
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(url, {
|
const { data } = await axios.get(url, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
tagOptions.value = data;
|
tagOptions.value = data;
|
||||||
} catch (err) {
|
|
||||||
console.error('Error getting selected tag values');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QForm @submit="applyTags(tagValues)" class="all-pointer-events">
|
<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">
|
||||||
<QBtn
|
|
||||||
round
|
|
||||||
color="primary"
|
|
||||||
style="position: absolute; z-index: 1; right: 0; top: 0"
|
|
||||||
icon="search"
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
</QBtn>
|
|
||||||
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.tag')"
|
:label="t('params.tag')"
|
||||||
v-model="selectedTag"
|
v-model="selectedTag"
|
||||||
|
@ -84,17 +62,7 @@ const getSelectedTagValues = async (tag) => {
|
||||||
rounded
|
rounded
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
use-input
|
use-input
|
||||||
@update:model-value="($event) => getSelectedTagValues($event)"
|
@update:model-value="getSelectedTagValues"
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
icon="add_circle"
|
|
||||||
shortcut="+"
|
|
||||||
flat
|
|
||||||
class="filter-icon q-mb-md"
|
|
||||||
size="md"
|
|
||||||
dense
|
|
||||||
:disabled="!selectedTag || !tagValues[0].value"
|
|
||||||
@click="tagValues.unshift({})"
|
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-for="(value, index) in tagValues"
|
v-for="(value, index) in tagValues"
|
||||||
|
@ -106,7 +74,7 @@ const getSelectedTagValues = async (tag) => {
|
||||||
v-if="!selectedTag?.isFree && tagOptions"
|
v-if="!selectedTag?.isFree && tagOptions"
|
||||||
:label="t('components.itemsFilterPanel.value')"
|
:label="t('components.itemsFilterPanel.value')"
|
||||||
v-model="value.value"
|
v-model="value.value"
|
||||||
:options="tagOptions || []"
|
:options="tagOptions"
|
||||||
option-value="value"
|
option-value="value"
|
||||||
option-label="value"
|
option-label="value"
|
||||||
dense
|
dense
|
||||||
|
@ -124,7 +92,6 @@ const getSelectedTagValues = async (tag) => {
|
||||||
:label="t('components.itemsFilterPanel.value')"
|
:label="t('components.itemsFilterPanel.value')"
|
||||||
:disable="!value"
|
:disable="!value"
|
||||||
is-outlined
|
is-outlined
|
||||||
:is-clearable="false"
|
|
||||||
class="col"
|
class="col"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -135,11 +102,25 @@ const getSelectedTagValues = async (tag) => {
|
||||||
rounded
|
rounded
|
||||||
flat
|
flat
|
||||||
class="filter-icon col-2"
|
class="filter-icon col-2"
|
||||||
:disabled="!value.value"
|
@click="tagValues.splice(index, 1)"
|
||||||
@click="removeTagGroupParam(index)"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<QBtn
|
||||||
|
icon="add_circle"
|
||||||
|
shortcut="+"
|
||||||
|
flat
|
||||||
|
class="filter-icon q-mb-md"
|
||||||
|
size="md"
|
||||||
|
dense
|
||||||
|
@click="tagValues.push({})"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
color="primary"
|
||||||
|
icon="search"
|
||||||
|
type="submit"
|
||||||
|
:label="$t('globals.search')"
|
||||||
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
</QForm>
|
</QForm>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -22,22 +22,17 @@ const agencyList = ref([]);
|
||||||
const addressList = ref([]);
|
const addressList = ref([]);
|
||||||
|
|
||||||
const fetchAddressList = async (addressId) => {
|
const fetchAddressList = async (addressId) => {
|
||||||
try {
|
const { data } = await axios.get('addresses', {
|
||||||
const { data } = await axios.get('addresses', {
|
params: {
|
||||||
params: {
|
filter: JSON.stringify({
|
||||||
filter: JSON.stringify({
|
fields: ['id', 'nickname', 'street', 'city'],
|
||||||
fields: ['id', 'nickname', 'street', 'city'],
|
where: { id: addressId },
|
||||||
where: { id: addressId },
|
}),
|
||||||
}),
|
},
|
||||||
},
|
});
|
||||||
});
|
addressList.value = data;
|
||||||
addressList.value = data;
|
if (addressList.value?.length === 1) {
|
||||||
if (addressList.value?.length === 1) {
|
state.get(ORDER_MODEL).addressFk = addressList.value[0].id;
|
||||||
state.get(ORDER_MODEL).addressFk = addressList.value[0].id;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching addresses`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,18 +40,13 @@ const fetchAgencyList = async (landed, addressFk) => {
|
||||||
if (!landed || !addressFk) {
|
if (!landed || !addressFk) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
params: {
|
||||||
params: {
|
addressFk,
|
||||||
addressFk,
|
landed: new Date(landed).toISOString(),
|
||||||
landed: new Date(landed).toISOString(),
|
},
|
||||||
},
|
});
|
||||||
});
|
agencyList.value = data;
|
||||||
agencyList.value = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching agencies`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchOrderDetails = (order) => {
|
const fetchOrderDetails = (order) => {
|
||||||
|
@ -92,12 +82,8 @@ const orderFilter = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClientChange = async (clientId) => {
|
const onClientChange = async (clientId) => {
|
||||||
try {
|
const { data } = await axios.get(`Clients/${clientId}`);
|
||||||
const { data } = await axios.get(`Clients/${clientId}`);
|
await fetchAddressList(data.defaultAddressFk);
|
||||||
await fetchAddressList(data.defaultAddressFk);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error al cambiar el cliente:', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,22 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { onBeforeMount, onMounted, onUnmounted, ref, computed, watch } from 'vue';
|
import { onMounted, onUnmounted, ref, computed, watch } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||||
import CatalogItem from 'components/ui/CatalogItem.vue';
|
import CatalogItem from 'src/components/ui/CatalogItem.vue';
|
||||||
import OrderCatalogFilter from 'pages/Order/Card/OrderCatalogFilter.vue';
|
import OrderCatalogFilter from 'src/pages/Order/Card/OrderCatalogFilter.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import getParamWhere from 'src/filters/getParamWhere';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const arrayData = useArrayData('OrderCatalogList');
|
const dataKey = 'OrderCatalogList';
|
||||||
|
const arrayData = useArrayData(dataKey);
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
const showFilter = ref(null);
|
|
||||||
const tags = ref([]);
|
const tags = ref([]);
|
||||||
|
|
||||||
let catalogParams = {
|
let catalogParams = {
|
||||||
|
@ -25,27 +24,6 @@ let catalogParams = {
|
||||||
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
||||||
};
|
};
|
||||||
|
|
||||||
onBeforeMount(() => {
|
|
||||||
const whereParams = getParamWhere(route);
|
|
||||||
if (whereParams) {
|
|
||||||
const formattedWhereParams = {};
|
|
||||||
if (whereParams.and) {
|
|
||||||
whereParams.and.forEach((item) => {
|
|
||||||
Object.assign(formattedWhereParams, item);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Object.assign(formattedWhereParams, whereParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
catalogParams = {
|
|
||||||
...catalogParams,
|
|
||||||
...formattedWhereParams,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
showFilter.value = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
checkOrderConfirmation();
|
checkOrderConfirmation();
|
||||||
|
@ -89,7 +67,7 @@ function extractValueTags(items) {
|
||||||
);
|
);
|
||||||
tagValue.value = resultValueTags;
|
tagValue.value = resultValueTags;
|
||||||
}
|
}
|
||||||
const autoLoad = computed(() => !!catalogParams.categoryFk);
|
const autoLoad = computed(() => !!JSON.parse(route?.query.table ?? '{}')?.categoryFk);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => store.data,
|
() => store.data,
|
||||||
|
@ -102,7 +80,7 @@ watch(
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="OrderCatalogList"
|
:data-key="dataKey"
|
||||||
:user-params="catalogParams"
|
:user-params="catalogParams"
|
||||||
:static-params="['orderFk', 'orderBy']"
|
:static-params="['orderFk', 'orderBy']"
|
||||||
:redirect="false"
|
:redirect="false"
|
||||||
|
@ -111,9 +89,9 @@ watch(
|
||||||
:info="t('You can search items by name or id')"
|
:info="t('You can search items by name or id')"
|
||||||
/>
|
/>
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||||
<QScrollArea v-if="showFilter" class="fit text-grey-8">
|
<QScrollArea class="fit text-grey-8">
|
||||||
<OrderCatalogFilter
|
<OrderCatalogFilter
|
||||||
data-key="OrderCatalogList"
|
:data-key="dataKey"
|
||||||
:tag-value="tagValue"
|
:tag-value="tagValue"
|
||||||
:tags="tags"
|
:tags="tags"
|
||||||
:initial-catalog-params="catalogParams"
|
:initial-catalog-params="catalogParams"
|
||||||
|
@ -123,12 +101,10 @@ watch(
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<div class="full-width">
|
<div class="full-width">
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
data-key="OrderCatalogList"
|
:data-key="dataKey"
|
||||||
url="Orders/CatalogFilter"
|
url="Orders/CatalogFilter"
|
||||||
:limit="50"
|
:limit="50"
|
||||||
:user-params="catalogParams"
|
:user-params="catalogParams"
|
||||||
@on-fetch="showFilter = true"
|
|
||||||
:update-router="false"
|
|
||||||
:auto-load="autoLoad"
|
:auto-load="autoLoad"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, onMounted } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -8,7 +8,6 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import getParamWhere from 'src/filters/getParamWhere';
|
|
||||||
import CatalogFilterValueDialog from 'src/pages/Order/Card/CatalogFilterValueDialog.vue';
|
import CatalogFilterValueDialog from 'src/pages/Order/Card/CatalogFilterValueDialog.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
|
||||||
|
@ -33,10 +32,8 @@ const route = useRoute();
|
||||||
const arrayData = useArrayData(props.dataKey);
|
const arrayData = useArrayData(props.dataKey);
|
||||||
|
|
||||||
const categoryList = ref(null);
|
const categoryList = ref(null);
|
||||||
const selectedCategoryFk = ref(null);
|
|
||||||
const typeList = ref([]);
|
const typeList = ref([]);
|
||||||
const selectedTypeFk = ref(null);
|
const searchByTag = ref(null);
|
||||||
const generalSearchParam = ref(null);
|
|
||||||
|
|
||||||
const vnFilterPanelRef = ref();
|
const vnFilterPanelRef = ref();
|
||||||
const orderByList = ref([
|
const orderByList = ref([
|
||||||
|
@ -53,45 +50,31 @@ const orderBySelected = ref('relevancy DESC, name');
|
||||||
const orderWaySelected = ref('ASC');
|
const orderWaySelected = ref('ASC');
|
||||||
|
|
||||||
const resetCategory = (params, search) => {
|
const resetCategory = (params, search) => {
|
||||||
selectedCategoryFk.value = null;
|
|
||||||
typeList.value = null;
|
typeList.value = null;
|
||||||
params.categoryFk = null;
|
params.categoryFk = null;
|
||||||
params.typeFk = null;
|
params.typeFk = null;
|
||||||
arrayData.store.userFilter = null;
|
arrayData.store.userFilter = null;
|
||||||
removeTagGroupParam(params, search);
|
|
||||||
};
|
|
||||||
|
|
||||||
const selectCategory = (params, category, search) => {
|
|
||||||
if (params.categoryFk === category?.id) {
|
|
||||||
resetCategory(params, search);
|
|
||||||
params.categoryFk = null;
|
|
||||||
} else {
|
|
||||||
selectedCategoryFk.value = category?.id;
|
|
||||||
params.categoryFk = category?.id;
|
|
||||||
params.typeFk = null;
|
|
||||||
selectedTypeFk.value = null;
|
|
||||||
loadTypes(category?.id);
|
|
||||||
}
|
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadTypes = async (categoryFk = selectedCategoryFk.value) => {
|
const selectCategory = async (params, category, search) => {
|
||||||
|
if (vnFilterPanelRef.value.params.categoryFk === category?.id) {
|
||||||
|
resetCategory(params, search);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.typeFk = null;
|
||||||
|
params.categoryFk = category.id;
|
||||||
|
await loadTypes(category?.id);
|
||||||
|
await search();
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadTypes = async (id) => {
|
||||||
const { data } = await axios.get(`Orders/${route.params.id}/getItemTypeAvailable`, {
|
const { data } = await axios.get(`Orders/${route.params.id}/getItemTypeAvailable`, {
|
||||||
params: { itemCategoryId: categoryFk },
|
params: { itemCategoryId: id },
|
||||||
});
|
});
|
||||||
typeList.value = data;
|
typeList.value = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectedCategory = computed(() => {
|
|
||||||
return (categoryList.value || []).find(
|
|
||||||
(category) => category?.id === selectedCategoryFk.value
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const selectedType = computed(() => {
|
|
||||||
return (typeList.value || []).find((type) => type?.id === selectedTypeFk.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'categoryFk':
|
case 'categoryFk':
|
||||||
|
@ -115,13 +98,23 @@ const applyTags = (tagInfo, params, search) => {
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeTagGroupParam = (params, search, valIndex = null) => {
|
async function onSearchByTag(value) {
|
||||||
if (!valIndex) {
|
if (!value.target.value) return;
|
||||||
|
if (!vnFilterPanelRef.value.params?.tagGroups) {
|
||||||
|
vnFilterPanelRef.value.params.tagGroups = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
vnFilterPanelRef.value.params.tagGroups.push({
|
||||||
|
values: [{ value: value.target.value }],
|
||||||
|
});
|
||||||
|
searchByTag.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const removeTagGroupParam = (params, search, valIndex) => {
|
||||||
|
if (!valIndex && valIndex !== 0) {
|
||||||
params.tagGroups = null;
|
params.tagGroups = null;
|
||||||
search();
|
|
||||||
} else {
|
} else {
|
||||||
params.tagGroups.splice(valIndex, 1);
|
params.tagGroups.splice(valIndex, 1);
|
||||||
search();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -133,7 +126,8 @@ const setCategoryList = (data) => {
|
||||||
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
selectedCategoryFk.value && loadTypes();
|
vnFilterPanelRef.value.params.categoryFk &&
|
||||||
|
loadTypes(vnFilterPanelRef.value.params.categoryFk);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCategoryClass = (category, params) => {
|
const getCategoryClass = (category, params) => {
|
||||||
|
@ -149,35 +143,29 @@ function addOrder(value, field, params) {
|
||||||
params.orderBy = JSON.stringify(orderBy);
|
params.orderBy = JSON.stringify(orderBy);
|
||||||
vnFilterPanelRef.value.search();
|
vnFilterPanelRef.value.search();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
selectedCategoryFk.value = getParamWhere(route, 'categoryFk');
|
|
||||||
selectedTypeFk.value = getParamWhere(route, 'typeFk');
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
<FetchData url="ItemCategories" auto-load @on-fetch="setCategoryList" />
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
ref="vnFilterPanelRef"
|
ref="vnFilterPanelRef"
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:hidden-tags="['orderFk', 'orderBy']"
|
:hidden-tags="['filter', 'orderFk', 'orderBy']"
|
||||||
:un-removable-params="['orderFk', 'orderBy']"
|
:unremovable-params="['orderFk', 'orderBy']"
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:custom-tags="['tagGroups', 'categoryFk']"
|
:custom-tags="['tagGroups', 'categoryFk']"
|
||||||
:redirect="false"
|
:redirect="false"
|
||||||
search-url="params"
|
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<strong v-if="tag.label === 'typeFk'">
|
<strong v-if="tag.label === 'typeFk' && typeList">
|
||||||
{{ t(selectedType?.name || '') }}
|
{{ t(typeList.find((t) => t.id == tag.value)?.name || '') }}
|
||||||
</strong>
|
</strong>
|
||||||
<div v-else class="q-gutter-x-xs">
|
<div v-else class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #customTags="{ tags: customTags, params, searchFn }">
|
<template #customTags="{ params, tags: customTags, searchFn }">
|
||||||
<template v-for="customTag in customTags" :key="customTag.label">
|
<template v-for="customTag in customTags" :key="customTag.label">
|
||||||
<VnFilterPanelChip
|
<VnFilterPanelChip
|
||||||
v-for="(tag, valIndex) in Array.isArray(customTag.value)
|
v-for="(tag, valIndex) in Array.isArray(customTag.value)
|
||||||
|
@ -191,8 +179,13 @@ onMounted(() => {
|
||||||
: removeTagGroupParam(params, searchFn, valIndex)
|
: removeTagGroupParam(params, searchFn, valIndex)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<strong v-if="customTag.label === 'categoryFk'">
|
<strong v-if="customTag.label === 'categoryFk' && categoryList">
|
||||||
{{ t(selectedCategory?.name || '') }}
|
{{
|
||||||
|
t(
|
||||||
|
categoryList.find((c) => c.id == customTag.value)?.name ||
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}}
|
||||||
</strong>
|
</strong>
|
||||||
<strong v-if="tag?.tagSelection?.name" class="q-mr-xs">
|
<strong v-if="tag?.tagSelection?.name" class="q-mr-xs">
|
||||||
{{ tag.tagSelection.name }}:
|
{{ tag.tagSelection.name }}:
|
||||||
|
@ -239,13 +232,8 @@ onMounted(() => {
|
||||||
emit-value
|
emit-value
|
||||||
use-input
|
use-input
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
:disable="!selectedCategoryFk"
|
:disable="!params.categoryFk"
|
||||||
@update:model-value="
|
@update:model-value="searchFn()"
|
||||||
(value) => {
|
|
||||||
selectedTypeFk = value;
|
|
||||||
searchFn();
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<template #option="{ itemProps, opt }">
|
<template #option="{ itemProps, opt }">
|
||||||
<QItem v-bind="itemProps">
|
<QItem v-bind="itemProps">
|
||||||
|
@ -288,34 +276,27 @@ onMounted(() => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
|
<QItem class="q-mt-lg q-pa-none">
|
||||||
<QItem class="q-mt-lg">
|
<VnInput
|
||||||
<VnSelect
|
|
||||||
:label="t('components.itemsFilterPanel.value')"
|
:label="t('components.itemsFilterPanel.value')"
|
||||||
:options="props.tagValue"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
:is-clearable="false"
|
:is-clearable="false"
|
||||||
v-model="generalSearchParam"
|
v-model="searchByTag"
|
||||||
@update:model-value="
|
@keyup.enter="(val) => onSearchByTag(val, params)"
|
||||||
applyTags(
|
|
||||||
{ values: [{ value: generalSearchParam }] },
|
|
||||||
params,
|
|
||||||
searchFn
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QIcon name="search" />
|
<QIcon name="search" />
|
||||||
</template>
|
</template>
|
||||||
<template #after>
|
<template #append>
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="add_circle"
|
icon="add_circle"
|
||||||
shortcut="+"
|
shortcut="+"
|
||||||
flat
|
flat
|
||||||
color="primary"
|
color="primary"
|
||||||
size="md"
|
size="md"
|
||||||
|
dense
|
||||||
/>
|
/>
|
||||||
<QPopupProxy>
|
<QPopupProxy>
|
||||||
<CatalogFilterValueDialog
|
<CatalogFilterValueDialog
|
||||||
|
@ -327,7 +308,7 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnInput>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { onMounted, ref } from 'vue';
|
import { reactive, onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useState } from 'composables/useState';
|
import { useState } from 'composables/useState';
|
||||||
|
@ -9,7 +9,6 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import { useDialogPluginComponent } from 'quasar';
|
import { useDialogPluginComponent } from 'quasar';
|
||||||
import { reactive } from 'vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -21,22 +20,17 @@ const addressList = ref([]);
|
||||||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||||
|
|
||||||
const fetchAddressList = async (addressId) => {
|
const fetchAddressList = async (addressId) => {
|
||||||
try {
|
const { data } = await axios.get('addresses', {
|
||||||
const { data } = await axios.get('addresses', {
|
params: {
|
||||||
params: {
|
filter: JSON.stringify({
|
||||||
filter: JSON.stringify({
|
fields: ['id', 'nickname', 'street', 'city'],
|
||||||
fields: ['id', 'nickname', 'street', 'city'],
|
where: { id: addressId },
|
||||||
where: { id: addressId },
|
}),
|
||||||
}),
|
},
|
||||||
},
|
});
|
||||||
});
|
addressList.value = data;
|
||||||
addressList.value = data;
|
if (addressList.value?.length === 1) {
|
||||||
if (addressList.value?.length === 1) {
|
state.get(ORDER_MODEL).addressId = addressList.value[0].id;
|
||||||
state.get(ORDER_MODEL).addressId = addressList.value[0].id;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching addresses`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,24 +38,15 @@ const fetchAgencyList = async (landed, addressFk) => {
|
||||||
if (!landed || !addressFk) {
|
if (!landed || !addressFk) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
params: {
|
||||||
params: {
|
addressFk,
|
||||||
addressFk,
|
landed: new Date(landed).toISOString(),
|
||||||
landed: new Date(landed).toISOString(),
|
},
|
||||||
},
|
});
|
||||||
});
|
agencyList.value = data;
|
||||||
agencyList.value = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching agencies`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// const fetchOrderDetails = (order) => {
|
|
||||||
// fetchAddressList(order?.addressFk);
|
|
||||||
// fetchAgencyList(order?.landed, order?.addressFk);
|
|
||||||
// };
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
clientFk: {
|
clientFk: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -73,47 +58,10 @@ const initialFormState = reactive({
|
||||||
addressId: null,
|
addressId: null,
|
||||||
clientFk: $props.clientFk,
|
clientFk: $props.clientFk,
|
||||||
});
|
});
|
||||||
// const orderMapper = (order) => {
|
|
||||||
// return {
|
|
||||||
// addressId: order.addressFk,
|
|
||||||
// agencyModeId: order.agencyModeFk,
|
|
||||||
// landed: new Date(order.landed).toISOString(),
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
// const orderFilter = {
|
|
||||||
// include: [
|
|
||||||
// { relation: 'agencyMode', scope: { fields: ['name'] } },
|
|
||||||
// {
|
|
||||||
// relation: 'address',
|
|
||||||
// scope: { fields: ['nickname'] },
|
|
||||||
// },
|
|
||||||
// { relation: 'rows', scope: { fields: ['id'] } },
|
|
||||||
// {
|
|
||||||
// relation: 'client',
|
|
||||||
// scope: {
|
|
||||||
// fields: [
|
|
||||||
// 'salesPersonFk',
|
|
||||||
// 'name',
|
|
||||||
// 'isActive',
|
|
||||||
// 'isFreezed',
|
|
||||||
// 'isTaxDataChecked',
|
|
||||||
// ],
|
|
||||||
// include: {
|
|
||||||
// relation: 'salesPersonUser',
|
|
||||||
// scope: { fields: ['id', 'name'] },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// };
|
|
||||||
|
|
||||||
const onClientChange = async (clientId = $props.clientFk) => {
|
const onClientChange = async (clientId = $props.clientFk) => {
|
||||||
try {
|
const { data } = await axios.get(`Clients/${clientId}`);
|
||||||
const { data } = await axios.get(`Clients/${clientId}`);
|
await fetchAddressList(data.defaultAddressFk);
|
||||||
await fetchAddressList(data.defaultAddressFk);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error al cambiar el cliente:', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async function onDataSaved(_, id) {
|
async function onDataSaved(_, id) {
|
||||||
|
|
|
@ -47,17 +47,13 @@ const onChangesSaved = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const setWireTransfer = async () => {
|
const setWireTransfer = async () => {
|
||||||
try {
|
const params = {
|
||||||
const params = {
|
id: route.params.id,
|
||||||
id: route.params.id,
|
payMethodFk: wireTransferFk.value,
|
||||||
payMethodFk: wireTransferFk.value,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
await axios.patch(`Suppliers/${route.params.id}`, params);
|
await axios.patch(`Suppliers/${route.params.id}`, params);
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
} catch (err) {
|
|
||||||
console.error('Error setting wire transfer', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
|
import VnAccountNumber from 'src/components/common/VnAccountNumber.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -100,10 +101,13 @@ function handleLocation(data, location) {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnAccountNumber
|
||||||
v-model="data.account"
|
v-model="data.account"
|
||||||
:label="t('supplier.fiscalData.account')"
|
:label="t('supplier.fiscalData.account')"
|
||||||
clearable
|
clearable
|
||||||
|
data-cy="supplierFiscalDataAccount"
|
||||||
|
insertable
|
||||||
|
:maxlength="10"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('supplier.fiscalData.sageTaxTypeFk')"
|
:label="t('supplier.fiscalData.sageTaxTypeFk')"
|
||||||
|
|
|
@ -33,6 +33,7 @@ const canEditZone = useAcl().hasAny([
|
||||||
const agencyFetchRef = ref();
|
const agencyFetchRef = ref();
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
|
const currenciesOptions = ref([]);
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
const zonesOptions = ref([]);
|
const zonesOptions = ref([]);
|
||||||
const addresses = ref([]);
|
const addresses = ref([]);
|
||||||
|
|
|
@ -130,6 +130,7 @@ function ticketFilter(ticket) {
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="entity.ticketState.state.classColor"
|
:color="entity.ticketState.state.classColor"
|
||||||
|
data-cy="ticketDescriptorStateBadge"
|
||||||
>
|
>
|
||||||
{{ entity.ticketState.state.name }}
|
{{ entity.ticketState.state.name }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
|
@ -174,7 +175,7 @@ function ticketFilter(ticket) {
|
||||||
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="entity.problem.includes('hasRisk')"
|
v-if="entity?.problem?.includes('hasRisk')"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -75,6 +75,7 @@ const cancel = () => {
|
||||||
dense
|
dense
|
||||||
style="width: 50%"
|
style="width: 50%"
|
||||||
@click="save()"
|
@click="save()"
|
||||||
|
data-cy="saveManaBtn"
|
||||||
>
|
>
|
||||||
{{ t('globals.save') }}
|
{{ t('globals.save') }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -49,13 +49,7 @@ async function handleSave() {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="
|
@on-fetch="(data) => (observationTypes = data)"
|
||||||
(data) =>
|
|
||||||
(observationTypes = data.map((type) => {
|
|
||||||
type.label = t(`ticketNotes.observationTypes.${type.description}`);
|
|
||||||
return type;
|
|
||||||
}))
|
|
||||||
"
|
|
||||||
auto-load
|
auto-load
|
||||||
url="ObservationTypes"
|
url="ObservationTypes"
|
||||||
/>
|
/>
|
||||||
|
@ -82,16 +76,18 @@ async function handleSave() {
|
||||||
:label="t('ticketNotes.observationType')"
|
:label="t('ticketNotes.observationType')"
|
||||||
:options="observationTypes"
|
:options="observationTypes"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="label"
|
option-label="description"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="row.observationTypeFk"
|
v-model="row.observationTypeFk"
|
||||||
:disable="!!row.id"
|
:disable="!!row.id"
|
||||||
|
data-cy="ticketNotesObservationType"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('basicData.description')"
|
:label="t('basicData.description')"
|
||||||
v-model="row.description"
|
v-model="row.description"
|
||||||
class="col"
|
class="col"
|
||||||
@keyup.enter="handleSave"
|
@keyup.enter="handleSave"
|
||||||
|
data-cy="ticketNotesDescription"
|
||||||
/>
|
/>
|
||||||
<QIcon
|
<QIcon
|
||||||
name="delete"
|
name="delete"
|
||||||
|
@ -99,6 +95,7 @@ async function handleSave() {
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="handleDelete(row)"
|
@click="handleDelete(row)"
|
||||||
|
data-cy="ticketNotesRemoveNoteBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketNotes.removeNote') }}
|
{{ t('ticketNotes.removeNote') }}
|
||||||
|
@ -113,6 +110,7 @@ async function handleSave() {
|
||||||
class="fill-icon-on-hover q-ml-md"
|
class="fill-icon-on-hover q-ml-md"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="ticketNotesCrudRef.insert()"
|
@click="ticketNotesCrudRef.insert()"
|
||||||
|
data-cy="ticketNotesAddNoteBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketNotes.addNote') }}
|
{{ t('ticketNotes.addNote') }}
|
||||||
|
|
|
@ -172,13 +172,9 @@ const getRequestState = (state) => {
|
||||||
const isEditable = (isOk) => isOk !== null;
|
const isEditable = (isOk) => isOk !== null;
|
||||||
|
|
||||||
async function removeLine(id) {
|
async function removeLine(id) {
|
||||||
try {
|
await axios.delete(`TicketRequests/${id}`);
|
||||||
await axios.delete(`TicketRequests/${id}`);
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
location.reload();
|
||||||
location.reload();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error ', err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => (stateStore.rightDrawer = false));
|
onMounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
|
@ -156,15 +156,11 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const getConfig = async () => {
|
const getConfig = async () => {
|
||||||
try {
|
let filter = {
|
||||||
let filter = {
|
fields: ['daysForWarningClaim'],
|
||||||
fields: ['daysForWarningClaim'],
|
};
|
||||||
};
|
const { data } = await axios.get(`TicketConfigs`, { filter });
|
||||||
const { data } = await axios.get(`TicketConfigs`, { filter });
|
ticketConfig.value = data;
|
||||||
ticketConfig.value = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error getting ticket config', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSalesFetched = (salesData) => {
|
const onSalesFetched = (salesData) => {
|
||||||
|
@ -187,41 +183,40 @@ const resetChanges = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
|
const params = { quantity: sale.quantity };
|
||||||
try {
|
try {
|
||||||
const payload = { quantity: sale.quantity };
|
await axios.post(`Sales/${sale.id}/updateQuantity`, params);
|
||||||
await axios.post(`Sales/${sale.id}/updateQuantity`, payload);
|
} catch (e) {
|
||||||
notify('globals.dataSaved', 'positive');
|
sale.quantity = tableRef.value.CrudModelRef.originalData.find(
|
||||||
} catch (err) {
|
(s) => s.id === sale.id
|
||||||
console.error('Error updating quantity', err);
|
).quantity;
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
notify('globals.dataSaved', 'positive');
|
||||||
};
|
};
|
||||||
|
|
||||||
const addSale = async (sale) => {
|
const addSale = async (sale) => {
|
||||||
try {
|
const params = {
|
||||||
const payload = {
|
barcode: sale.itemFk,
|
||||||
barcode: sale.itemFk,
|
quantity: sale.quantity,
|
||||||
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;
|
if (!data) return;
|
||||||
|
|
||||||
const newSale = data;
|
const newSale = data;
|
||||||
sale.id = newSale.id;
|
sale.id = newSale.id;
|
||||||
sale.image = newSale.item.image;
|
sale.image = newSale.item.image;
|
||||||
sale.subName = newSale.item.subName;
|
sale.subName = newSale.item.subName;
|
||||||
sale.concept = newSale.concept;
|
sale.concept = newSale.concept;
|
||||||
sale.quantity = newSale.quantity;
|
sale.quantity = newSale.quantity;
|
||||||
sale.discount = newSale.discount;
|
sale.discount = newSale.discount;
|
||||||
sale.price = newSale.price;
|
sale.price = newSale.price;
|
||||||
sale.item = newSale.item;
|
sale.item = newSale.item;
|
||||||
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} catch (err) {
|
|
||||||
console.error('Error adding sale', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
|
@ -234,19 +229,15 @@ const changeQuantity = async (sale) => {
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
if (!sale.id) return addSale(sale);
|
if (!sale.id) return addSale(sale);
|
||||||
updateQuantity(sale);
|
await updateQuantity(sale);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateConcept = async (sale) => {
|
const updateConcept = async (sale) => {
|
||||||
canProceed.value = await isSalePrepared(sale);
|
canProceed.value = await isSalePrepared(sale);
|
||||||
if (!canProceed.value) return;
|
if (!canProceed.value) return;
|
||||||
try {
|
const data = { newConcept: sale.concept };
|
||||||
const data = { newConcept: sale.concept };
|
await axios.post(`Sales/${sale.id}/updateConcept`, data);
|
||||||
await axios.post(`Sales/${sale.id}/updateConcept`, data);
|
notify('globals.dataSaved', 'positive');
|
||||||
notify('globals.dataSaved', 'positive');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error updating concept', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_EDIT = {
|
const DEFAULT_EDIT = {
|
||||||
|
@ -302,18 +293,15 @@ const onOpenEditDiscountPopover = async (sale) => {
|
||||||
const updatePrice = async (sale) => {
|
const updatePrice = async (sale) => {
|
||||||
canProceed.value = await isSalePrepared(sale);
|
canProceed.value = await isSalePrepared(sale);
|
||||||
if (!canProceed.value) return;
|
if (!canProceed.value) return;
|
||||||
try {
|
const newPrice = edit.value.price;
|
||||||
const newPrice = edit.value.price;
|
if (newPrice != null && newPrice != sale.price) {
|
||||||
if (newPrice != null && newPrice != sale.price) {
|
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
sale.price = newPrice;
|
||||||
sale.price = newPrice;
|
edit.value = { ...DEFAULT_EDIT };
|
||||||
edit.value = { ...DEFAULT_EDIT };
|
notify('globals.dataSaved', 'positive');
|
||||||
notify('globals.dataSaved', 'positive');
|
|
||||||
}
|
|
||||||
await getMana();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error updating price', err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await getMana();
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeDiscount = async (sale) => {
|
const changeDiscount = async (sale) => {
|
||||||
|
@ -360,15 +348,11 @@ const getNewPrice = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const newOrderFromTicket = async () => {
|
const newOrderFromTicket = async () => {
|
||||||
try {
|
const { data } = await axios.post(`Orders/newFromTicket`, {
|
||||||
const { data } = await axios.post(`Orders/newFromTicket`, {
|
ticketFk: Number(route.params.id),
|
||||||
ticketFk: Number(route.params.id),
|
});
|
||||||
});
|
const routeData = router.resolve({ name: 'OrderCatalog', params: { id: data } });
|
||||||
const routeData = router.resolve({ name: 'OrderCatalog', params: { id: data } });
|
window.open(routeData.href, '_blank');
|
||||||
window.open(routeData.href, '_blank');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error creating new order', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const goToLog = (saleId) => {
|
const goToLog = (saleId) => {
|
||||||
|
@ -383,15 +367,11 @@ const goToLog = (saleId) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeTicketState = async (val) => {
|
const changeTicketState = async (val) => {
|
||||||
try {
|
stateBtnDropdownRef.value.hide();
|
||||||
stateBtnDropdownRef.value.hide();
|
const params = { ticketFk: route.params.id, code: val };
|
||||||
const params = { ticketFk: route.params.id, code: val };
|
await axios.post('Tickets/state', params);
|
||||||
await axios.post('Tickets/state', params);
|
notify('globals.dataSaved', 'positive');
|
||||||
notify('globals.dataSaved', 'positive');
|
await resetChanges();
|
||||||
await resetChanges();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error changing ticket state', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeSelectedSales = () => {
|
const removeSelectedSales = () => {
|
||||||
|
@ -402,47 +382,34 @@ const removeSelectedSales = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeSales = async () => {
|
const removeSales = async () => {
|
||||||
try {
|
const params = {
|
||||||
const params = {
|
sales: selectedRows.value.filter((sale) => sale.id),
|
||||||
sales: selectedRows.value.filter((sale) => sale.id),
|
ticketId: store.data.id,
|
||||||
ticketId: store.data.id,
|
};
|
||||||
};
|
selectedRows.value
|
||||||
selectedRows.value
|
.filter((sale) => !sale.id)
|
||||||
.filter((sale) => !sale.id)
|
.forEach((sale) => tableRef.value.CrudModelRef.formData.splice(sale.$index, 1));
|
||||||
.forEach((sale) =>
|
|
||||||
tableRef.value.CrudModelRef.formData.splice(sale.$index, 1)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (params.sales.length == 0) return;
|
if (params.sales.length == 0) return;
|
||||||
await axios.post('Sales/deleteSales', params);
|
await axios.post('Sales/deleteSales', params);
|
||||||
removeSelectedSales();
|
removeSelectedSales();
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting sales', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const setTransferParams = async () => {
|
const setTransferParams = async () => {
|
||||||
try {
|
selectedSales.value = selectedValidSales.value;
|
||||||
selectedSales.value = selectedValidSales.value;
|
const checkedSales = JSON.parse(JSON.stringify(selectedSales.value));
|
||||||
const checkedSales = JSON.parse(JSON.stringify(selectedSales.value));
|
transfer.value = {
|
||||||
transfer.value = {
|
lastActiveTickets: [],
|
||||||
lastActiveTickets: [],
|
sales: checkedSales,
|
||||||
sales: checkedSales,
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const params = { ticketId: store.data.id };
|
const params = { ticketId: store.data.id };
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(`clients/${store.data.clientFk}/lastActiveTickets`, {
|
||||||
`clients/${store.data.clientFk}/lastActiveTickets`,
|
params,
|
||||||
{
|
});
|
||||||
params,
|
transfer.value.lastActiveTickets = data;
|
||||||
}
|
|
||||||
);
|
|
||||||
transfer.value.lastActiveTickets = data;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error setting transfer params', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
@ -584,6 +551,7 @@ watch(
|
||||||
color="primary"
|
color="primary"
|
||||||
:disable="!isTicketEditable || ticketState === 'OK'"
|
:disable="!isTicketEditable || ticketState === 'OK'"
|
||||||
@click="changeTicketState('OK')"
|
@click="changeTicketState('OK')"
|
||||||
|
data-cy="ticketSaleOkStateBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t(`Change ticket state to 'Ok'`) }}</QTooltip>
|
<QTooltip>{{ t(`Change ticket state to 'Ok'`) }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -592,6 +560,7 @@ watch(
|
||||||
color="primary"
|
color="primary"
|
||||||
:label="t('ticketList.state')"
|
:label="t('ticketList.state')"
|
||||||
:disable="!isTicketEditable"
|
:disable="!isTicketEditable"
|
||||||
|
data-cy="ticketSaleStateDropdown"
|
||||||
>
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:options="editableStatesOptions"
|
:options="editableStatesOptions"
|
||||||
|
@ -601,6 +570,7 @@ watch(
|
||||||
hide-dropdown-icon
|
hide-dropdown-icon
|
||||||
focus-on-mount
|
focus-on-mount
|
||||||
@update:model-value="changeTicketState"
|
@update:model-value="changeTicketState"
|
||||||
|
data-cy="ticketSaleStateSelect"
|
||||||
/>
|
/>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
<TicketSaleMoreActions
|
<TicketSaleMoreActions
|
||||||
|
@ -633,6 +603,7 @@ watch(
|
||||||
icon="vn:splitline"
|
icon="vn:splitline"
|
||||||
:disable="!isTicketEditable || !hasSelectedRows"
|
:disable="!isTicketEditable || !hasSelectedRows"
|
||||||
@click="setTransferParams()"
|
@click="setTransferParams()"
|
||||||
|
data-cy="ticketSaleTransferBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Transfer lines') }}</QTooltip>
|
<QTooltip>{{ t('Transfer lines') }}</QTooltip>
|
||||||
<TicketTransfer
|
<TicketTransfer
|
||||||
|
@ -712,7 +683,13 @@ watch(
|
||||||
{{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
|
{{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon v-if="row.reserved" color="primary" name="vn:reserva" size="xs">
|
<QIcon
|
||||||
|
v-if="row.reserved"
|
||||||
|
color="primary"
|
||||||
|
name="vn:reserva"
|
||||||
|
size="xs"
|
||||||
|
data-cy="ticketSaleReservedIcon"
|
||||||
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketSale.reserved') }}
|
{{ t('ticketSale.reserved') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
@ -865,7 +842,14 @@ watch(
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
|
||||||
<QPageSticky :offset="[20, 20]" style="z-index: 2">
|
<QPageSticky :offset="[20, 20]" style="z-index: 2">
|
||||||
<QBtn @click="newOrderFromTicket()" color="primary" fab icon="add" shortcut="+" />
|
<QBtn
|
||||||
|
@click="newOrderFromTicket()"
|
||||||
|
color="primary"
|
||||||
|
fab
|
||||||
|
icon="add"
|
||||||
|
shortcut="+"
|
||||||
|
data-cy="ticketSaleAddToBasketBtn"
|
||||||
|
/>
|
||||||
<QTooltip class="text-no-wrap">
|
<QTooltip class="text-no-wrap">
|
||||||
{{ t('Add item to basket') }}
|
{{ t('Add item to basket') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -140,13 +140,9 @@ const createClaim = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCreateClaimAccepted = async () => {
|
const onCreateClaimAccepted = async () => {
|
||||||
try {
|
const params = { ticketId: ticket.value.id, sales: props.sales };
|
||||||
const params = { ticketId: ticket.value.id, sales: props.sales };
|
const { data } = await axios.post(`Claims/createFromSales`, params);
|
||||||
const { data } = await axios.post(`Claims/createFromSales`, params);
|
push({ name: 'ClaimBasicData', params: { id: data.id } });
|
||||||
push({ name: 'ClaimBasicData', params: { id: data.id } });
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error creating claim: ', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const setReserved = async (reserved) => {
|
const setReserved = async (reserved) => {
|
||||||
|
@ -179,6 +175,7 @@ const createRefund = async (withWarehouse) => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:label="t('ticketSale.more')"
|
:label="t('ticketSale.more')"
|
||||||
:disable="disable"
|
:disable="disable"
|
||||||
|
data-cy="ticketSaleMoreActionsDropdown"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
||||||
|
@ -190,6 +187,7 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="showSmsDialog('productNotAvailable')"
|
@click="showSmsDialog('productNotAvailable')"
|
||||||
|
data-cy="sendShortageSMSItem"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Send shortage SMS') }}</QItemLabel>
|
<QItemLabel>{{ t('Send shortage SMS') }}</QItemLabel>
|
||||||
|
@ -201,12 +199,18 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="calculateSalePrice()"
|
@click="calculateSalePrice()"
|
||||||
|
data-cy="recalculatePriceItem"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Recalculate price') }}</QItemLabel>
|
<QItemLabel>{{ t('Recalculate price') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem clickable v-ripple @click="emit('getMana')">
|
<QItem
|
||||||
|
clickable
|
||||||
|
v-ripple
|
||||||
|
@click="emit('getMana')"
|
||||||
|
data-cy="updateDiscountItem"
|
||||||
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -215,6 +219,7 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-model.number="newDiscount"
|
v-model.number="newDiscount"
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
|
data-cy="ticketSaleDiscountInput"
|
||||||
/>
|
/>
|
||||||
</TicketEditManaProxy>
|
</TicketEditManaProxy>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -224,6 +229,7 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="createClaim()"
|
@click="createClaim()"
|
||||||
|
data-cy="createClaimItem"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
||||||
|
@ -235,6 +241,7 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="setReserved(true)"
|
@click="setReserved(true)"
|
||||||
|
data-cy="markAsReservedItem"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
||||||
|
@ -246,12 +253,13 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="setReserved(false)"
|
@click="setReserved(false)"
|
||||||
|
data-cy="unmarkAsReservedItem"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Unmark as reserved') }}</QItemLabel>
|
<QItemLabel>{{ t('Unmark as reserved') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem clickable v-ripple>
|
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -260,12 +268,22 @@ const createRefund = async (withWarehouse) => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QMenu anchor="top end" self="top start" auto-close bordered>
|
<QMenu anchor="top end" self="top start" auto-close bordered>
|
||||||
<QList>
|
<QList>
|
||||||
<QItem v-ripple clickable @click="createRefund(true)">
|
<QItem
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="createRefund(true)"
|
||||||
|
data-cy="ticketSaleRefundWithWarehouse"
|
||||||
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('with warehouse') }}
|
{{ t('with warehouse') }}
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="createRefund(false)">
|
<QItem
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="createRefund(false)"
|
||||||
|
data-cy="ticketSaleRefundWithoutWarehouse"
|
||||||
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('without warehouse') }}
|
{{ t('without warehouse') }}
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
|
|
@ -69,19 +69,15 @@ function isEditable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeState(value) {
|
async function changeState(value) {
|
||||||
try {
|
stateBtnDropdownRef.value?.hide();
|
||||||
stateBtnDropdownRef.value?.hide();
|
const formData = {
|
||||||
const formData = {
|
ticketFk: entityId.value,
|
||||||
ticketFk: entityId.value,
|
code: value,
|
||||||
code: value,
|
};
|
||||||
};
|
await axios.post(`Tickets/state`, formData);
|
||||||
await axios.post(`Tickets/state`, formData);
|
notify('globals.dataSaved', 'positive');
|
||||||
notify('globals.dataSaved', 'positive');
|
summaryRef.value?.fetch();
|
||||||
summaryRef.value?.fetch();
|
descriptorData.fetch({});
|
||||||
descriptorData.fetch({});
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error changing ticket state', err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toTicketUrl(section) {
|
function toTicketUrl(section) {
|
||||||
|
@ -100,6 +96,7 @@ function toTicketUrl(section) {
|
||||||
ref="summaryRef"
|
ref="summaryRef"
|
||||||
:url="`Tickets/${entityId}/summary`"
|
:url="`Tickets/${entityId}/summary`"
|
||||||
data-key="TicketSummary"
|
data-key="TicketSummary"
|
||||||
|
data-cy="ticketSummary"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<VnToSummary
|
<VnToSummary
|
||||||
|
@ -279,13 +276,8 @@ function toTicketUrl(section) {
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span class="label" style="margin-right: 4px">
|
<span class="label" style="margin-right: 4px">
|
||||||
({{
|
({{ item.observationType.description }}):
|
||||||
t(
|
|
||||||
`ticketNotes.observationTypes.${item.observationType.description}`
|
|
||||||
)
|
|
||||||
}}):
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>{{ item.description }}</span>
|
<span>{{ item.description }}</span>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QVirtualScroll>
|
</QVirtualScroll>
|
||||||
|
|
|
@ -91,7 +91,7 @@ onMounted(() => (_transfer.value = $props.transfer));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy ref="QPopupProxyRef">
|
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketTransferPopup">
|
||||||
<QCard class="q-px-md" style="display: flex; width: 80vw">
|
<QCard class="q-px-md" style="display: flex; width: 80vw">
|
||||||
<QTable
|
<QTable
|
||||||
:rows="transfer.sales"
|
:rows="transfer.sales"
|
||||||
|
|
|
@ -57,6 +57,7 @@ defineExpose({ transferSales });
|
||||||
v-model.number="_transfer.ticketId"
|
v-model.number="_transfer.ticketId"
|
||||||
:label="t('Transfer to ticket')"
|
:label="t('Transfer to ticket')"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
|
data-cy="ticketTransferDestinationTicketInput"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -64,6 +65,7 @@ defineExpose({ transferSales });
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="transferSales(_transfer.ticketId)"
|
@click="transferSales(_transfer.ticketId)"
|
||||||
style="width: 30px"
|
style="width: 30px"
|
||||||
|
data-cy="ticketTransferTransferBtn"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
|
@ -72,6 +74,7 @@ defineExpose({ transferSales });
|
||||||
color="primary"
|
color="primary"
|
||||||
class="full-width q-my-lg"
|
class="full-width q-my-lg"
|
||||||
@click="transferSales()"
|
@click="transferSales()"
|
||||||
|
data-cy="ticketTransferNewTicketBtn"
|
||||||
/>
|
/>
|
||||||
</QForm>
|
</QForm>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -215,7 +215,7 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
||||||
|
|
||||||
if (!newLanded) {
|
if (!newLanded) {
|
||||||
notify(t('advanceTickets.noDeliveryZone'), 'negative');
|
notify(t('advanceTickets.noDeliveryZone'), 'negative');
|
||||||
return;
|
throw new Error(t('advanceTickets.noDeliveryZone'));
|
||||||
}
|
}
|
||||||
|
|
||||||
ticket.landed = newLanded.landed;
|
ticket.landed = newLanded.landed;
|
||||||
|
@ -299,10 +299,10 @@ const splitTickets = async () => {
|
||||||
const { query, params } = await requestComponentUpdate(ticket, true);
|
const { query, params } = await requestComponentUpdate(ticket, true);
|
||||||
await axios.post(query, params);
|
await axios.post(query, params);
|
||||||
progressAdd(ticket.futureId);
|
progressAdd(ticket.futureId);
|
||||||
} catch (error) {
|
} catch (e) {
|
||||||
splitErrors.value.push({
|
splitErrors.value.push({
|
||||||
id: ticket.futureId,
|
id: ticket.futureId,
|
||||||
reason: error.response?.data?.error?.message,
|
reason: e.message || e.response?.data?.error?.message,
|
||||||
});
|
});
|
||||||
progressAdd(ticket.futureId);
|
progressAdd(ticket.futureId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,46 +37,37 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchClient = async (formData) => {
|
const fetchClient = async (formData) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
include: {
|
||||||
include: {
|
relation: 'defaultAddress',
|
||||||
relation: 'defaultAddress',
|
scope: {
|
||||||
scope: {
|
fields: ['id', 'agencyModeFk'],
|
||||||
fields: ['id', 'agencyModeFk'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
where: { id: formData.clientId },
|
},
|
||||||
};
|
where: { id: formData.clientId },
|
||||||
const params = { filter: JSON.stringify(filter) };
|
};
|
||||||
const { data } = await axios.get('Clients', { params });
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const [client] = data;
|
const { data } = await axios.get('Clients', { params });
|
||||||
selectedClient.value = client;
|
const [client] = data;
|
||||||
} catch (err) {
|
selectedClient.value = client;
|
||||||
console.error('Error fetching client');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchAddresses = async (formData) => {
|
const fetchAddresses = async (formData) => {
|
||||||
try {
|
if (!formData.clientId) return;
|
||||||
if (!formData.clientId) return;
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['nickname', 'street', 'city', 'id'],
|
fields: ['nickname', 'street', 'city', 'id'],
|
||||||
where: { isActive: true },
|
where: { isActive: true },
|
||||||
order: 'nickname ASC',
|
order: 'nickname ASC',
|
||||||
};
|
};
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
addressesOptions.value = data;
|
addressesOptions.value = data;
|
||||||
|
|
||||||
const { defaultAddress } = selectedClient.value;
|
const { defaultAddress } = selectedClient.value;
|
||||||
formData.addressId = defaultAddress.id;
|
formData.addressId = defaultAddress.id;
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching addresses`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClientSelected = async (formData) => {
|
const onClientSelected = async (formData) => {
|
||||||
|
|
|
@ -37,46 +37,37 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchClient = async (formData) => {
|
const fetchClient = async (formData) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
include: {
|
||||||
include: {
|
relation: 'defaultAddress',
|
||||||
relation: 'defaultAddress',
|
scope: {
|
||||||
scope: {
|
fields: ['id', 'agencyModeFk'],
|
||||||
fields: ['id', 'agencyModeFk'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
where: { id: formData.clientId },
|
},
|
||||||
};
|
where: { id: formData.clientId },
|
||||||
const params = { filter: JSON.stringify(filter) };
|
};
|
||||||
const { data } = await axios.get('Clients', { params });
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const [client] = data;
|
const { data } = await axios.get('Clients', { params });
|
||||||
selectedClient.value = client;
|
const [client] = data;
|
||||||
} catch (err) {
|
selectedClient.value = client;
|
||||||
console.error('Error fetching client');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchAddresses = async (formData) => {
|
const fetchAddresses = async (formData) => {
|
||||||
try {
|
if (!formData.clientId) return;
|
||||||
if (!formData.clientId) return;
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['nickname', 'street', 'city', 'id'],
|
fields: ['nickname', 'street', 'city', 'id'],
|
||||||
where: { isActive: true },
|
where: { isActive: true },
|
||||||
order: 'nickname ASC',
|
order: 'nickname ASC',
|
||||||
};
|
};
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
addressesOptions.value = data;
|
addressesOptions.value = data;
|
||||||
|
|
||||||
const { defaultAddress } = selectedClient.value;
|
const { defaultAddress } = selectedClient.value;
|
||||||
formData.addressId = defaultAddress.id;
|
formData.addressId = defaultAddress.id;
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching addresses`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClientSelected = async (formData) => {
|
const onClientSelected = async (formData) => {
|
||||||
|
|
|
@ -68,13 +68,9 @@ const params = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
const applyColumnFilter = async (col) => {
|
||||||
try {
|
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
params[paramKey] = col.columnFilter.filterValue;
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
await arrayData.addFilter({ params });
|
||||||
await arrayData.addFilter({ params });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error applying column filter', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getInputEvents = (col) => {
|
const getInputEvents = (col) => {
|
||||||
|
@ -248,23 +244,19 @@ const totalPriceColor = (totalWithVat) =>
|
||||||
isLessThan50(totalWithVat) ? 'warning' : 'transparent';
|
isLessThan50(totalWithVat) ? 'warning' : 'transparent';
|
||||||
|
|
||||||
const moveTicketsFuture = async () => {
|
const moveTicketsFuture = async () => {
|
||||||
try {
|
const ticketsToMove = selectedTickets.value.map((ticket) => ({
|
||||||
const ticketsToMove = selectedTickets.value.map((ticket) => ({
|
originId: ticket.id,
|
||||||
originId: ticket.id,
|
destinationId: ticket.futureId,
|
||||||
destinationId: ticket.futureId,
|
originShipped: ticket.shipped,
|
||||||
originShipped: ticket.shipped,
|
destinationShipped: ticket.futureShipped,
|
||||||
destinationShipped: ticket.futureShipped,
|
workerFk: ticket.workerFk,
|
||||||
workerFk: ticket.workerFk,
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
let params = { tickets: ticketsToMove };
|
let params = { tickets: ticketsToMove };
|
||||||
await axios.post('Tickets/merge', params);
|
await axios.post('Tickets/merge', params);
|
||||||
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
||||||
selectedTickets.value = [];
|
selectedTickets.value = [];
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
} catch (error) {
|
|
||||||
console.error('Error moving tickets to future', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
|
|
|
@ -22,6 +22,7 @@ import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorP
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import { toTimeFormat } from 'src/filters/date';
|
import { toTimeFormat } from 'src/filters/date';
|
||||||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||||
|
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -253,46 +254,40 @@ const fetchAvailableAgencies = async (formData) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchClient = async (formData) => {
|
const fetchClient = async (formData) => {
|
||||||
try {
|
const filter = {
|
||||||
const filter = {
|
include: {
|
||||||
include: {
|
relation: 'defaultAddress',
|
||||||
relation: 'defaultAddress',
|
scope: {
|
||||||
scope: {
|
fields: ['id', 'agencyModeFk'],
|
||||||
fields: ['id', 'agencyModeFk'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
where: { id: formData.clientId },
|
},
|
||||||
};
|
where: { id: formData.clientId },
|
||||||
const params = { filter: JSON.stringify(filter) };
|
};
|
||||||
const { data } = await axios.get('Clients', { params });
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const [client] = data;
|
const { data } = await axios.get('Clients', { params });
|
||||||
selectedClient.value = client;
|
const [client] = data;
|
||||||
} catch (err) {
|
selectedClient.value = client;
|
||||||
console.error('Error fetching client');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchAddresses = async (formData) => {
|
const fetchAddresses = async (formData) => {
|
||||||
try {
|
if (!formData.clientId) return;
|
||||||
if (!formData.clientId) return;
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
|
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
|
||||||
order: 'nickname ASC',
|
order: 'nickname ASC',
|
||||||
};
|
};
|
||||||
const params = { filter: JSON.stringify(filter) };
|
const params = { filter: JSON.stringify(filter) };
|
||||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
addressesOptions.value = data;
|
addressesOptions.value = data;
|
||||||
|
|
||||||
const { defaultAddress } = selectedClient.value;
|
addressesOptions.value = data;
|
||||||
formData.addressId = defaultAddress.id;
|
|
||||||
} catch (err) {
|
const { defaultAddress } = selectedClient.value;
|
||||||
console.error(`Error fetching addresses`, err);
|
formData.addressId = defaultAddress.id;
|
||||||
return err.response;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getColor = (row) => {
|
const getColor = (row) => {
|
||||||
if (row.alertLevelCode === 'OK') return 'bg-success';
|
if (row.alertLevelCode === 'OK') return 'bg-success';
|
||||||
else if (row.alertLevelCode === 'FREE') return 'bg-notice';
|
else if (row.alertLevelCode === 'FREE') return 'bg-notice';
|
||||||
|
@ -461,6 +456,7 @@ function setReference(data) {
|
||||||
data-key="TicketList"
|
data-key="TicketList"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('You can search by ticket id or alias')"
|
:info="t('You can search by ticket id or alias')"
|
||||||
|
data-cy="ticketListSearchBar"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
@ -488,68 +484,10 @@ function setReference(data) {
|
||||||
'row-key': 'id',
|
'row-key': 'id',
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
|
data-cy="ticketListTable"
|
||||||
>
|
>
|
||||||
<template #column-statusIcons="{ row }">
|
<template #column-statusIcons="{ row }">
|
||||||
<div class="q-gutter-x-xs">
|
<TicketProblems :row="row" />
|
||||||
<QIcon
|
|
||||||
v-if="row.isTaxDataChecked === 0"
|
|
||||||
color="primary"
|
|
||||||
name="vn:no036"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('No verified data') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasTicketRequest"
|
|
||||||
color="primary"
|
|
||||||
name="vn:buyrequest"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Purchase request') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.itemShortage"
|
|
||||||
color="primary"
|
|
||||||
name="vn:unavailable"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Not visible') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.isFreezed" color="primary" name="vn:frozen" size="xs">
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Client frozen') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.risk" color="primary" name="vn:risk" size="xs">
|
|
||||||
<QTooltip> {{ t('Risk') }}: {{ row.risk }} </QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasComponentLack"
|
|
||||||
color="primary"
|
|
||||||
name="vn:components"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Component lack') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasRounding"
|
|
||||||
color="primary"
|
|
||||||
name="sync_problem"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Rounding') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-salesPersonFk="{ row }">
|
<template #column-salesPersonFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
|
|
|
@ -153,24 +153,16 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const deleteWeekly = async (ticketFk) => {
|
const deleteWeekly = async (ticketFk) => {
|
||||||
try {
|
await axios.delete(`TicketWeeklies/${ticketFk}`);
|
||||||
await axios.delete(`TicketWeeklies/${ticketFk}`);
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
const ticketIndex = store.data.findIndex((e) => e.ticketFk == ticketFk);
|
||||||
const ticketIndex = store.data.findIndex((e) => e.ticketFk == ticketFk);
|
store.data.splice(ticketIndex, 1);
|
||||||
store.data.splice(ticketIndex, 1);
|
location.reload();
|
||||||
location.reload();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error deleting weekly', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onUpdate = async (ticketFk, field, value) => {
|
const onUpdate = async (ticketFk, field, value) => {
|
||||||
try {
|
const params = { ticketFk, [field]: value };
|
||||||
const params = { ticketFk, [field]: value };
|
await axios.patch('TicketWeeklies', params);
|
||||||
await axios.patch('TicketWeeklies', params);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error updating weekly', err);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
@ -10,16 +10,6 @@ ticketNotes:
|
||||||
observationType: Observation type
|
observationType: Observation type
|
||||||
removeNote: Remove note
|
removeNote: Remove note
|
||||||
addNote: Add note
|
addNote: Add note
|
||||||
observationTypes:
|
|
||||||
ItemPicker: Item picker
|
|
||||||
Packager: Packager
|
|
||||||
Delivery: Delivery
|
|
||||||
SalesPerson: Sales person
|
|
||||||
Administrative: Administrative
|
|
||||||
Weight: Weight
|
|
||||||
InvoiceOut: Invoice Out
|
|
||||||
DropOff: Drop Off
|
|
||||||
Sustitución: Sustitution
|
|
||||||
ticketSale:
|
ticketSale:
|
||||||
visible: Visible
|
visible: Visible
|
||||||
available: Available
|
available: Available
|
||||||
|
|
|
@ -19,18 +19,6 @@ ticketNotes:
|
||||||
observationType: Tipo de observación
|
observationType: Tipo de observación
|
||||||
removeNote: Quitar nota
|
removeNote: Quitar nota
|
||||||
addNote: Añadir nota
|
addNote: Añadir nota
|
||||||
observationTypes:
|
|
||||||
ItemPicker: Sacador
|
|
||||||
Packager: Encajador
|
|
||||||
Delivery: Envío
|
|
||||||
SalesPerson: Comercial
|
|
||||||
Administrative: Administrativa
|
|
||||||
Weight: Peso
|
|
||||||
InvoiceOut: Facturas
|
|
||||||
DropOff: Despacho
|
|
||||||
Sustitución: Sustitución
|
|
||||||
Accepted: Aceptado
|
|
||||||
Denied: Denegado
|
|
||||||
purchaseRequest:
|
purchaseRequest:
|
||||||
requester: Solicitante
|
requester: Solicitante
|
||||||
atender: Comprador
|
atender: Comprador
|
||||||
|
|
|
@ -14,6 +14,8 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
|
const warehousesOptionsOut = ref([]);
|
||||||
|
const warehousesOptionsIn = ref([]);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -21,12 +23,19 @@ const agenciesOptions = ref([]);
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FormModel
|
<FetchData
|
||||||
:url="`Travels/${route.params.id}`"
|
url="Warehouses"
|
||||||
:url-update="`Travels/${route.params.id}`"
|
@on-fetch="(data) => (warehousesOptionsOut = data)"
|
||||||
model="Travel"
|
|
||||||
auto-load
|
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 }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput v-model="data.ref" :label="t('globals.reference')" />
|
<VnInput v-model="data.ref" :label="t('globals.reference')" />
|
||||||
|
@ -44,11 +53,12 @@ const agenciesOptions = ref([]);
|
||||||
<VnInputDate v-model="data.shipped" :label="t('globals.shipped')" />
|
<VnInputDate v-model="data.shipped" :label="t('globals.shipped')" />
|
||||||
<VnInputDate v-model="data.landed" :label="t('globals.landed')" />
|
<VnInputDate v-model="data.landed" :label="t('globals.landed')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.warehouseOut')"
|
:label="t('globals.warehouseOut')"
|
||||||
v-model="data.warehouseOutFk"
|
v-model="data.warehouseOutFk"
|
||||||
:options="agenciesOptions"
|
:options="warehousesOptionsOut"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
map-options
|
map-options
|
||||||
|
@ -57,7 +67,7 @@ const agenciesOptions = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.warehouseIn')"
|
:label="t('globals.warehouseIn')"
|
||||||
v-model="data.warehouseInFk"
|
v-model="data.warehouseInFk"
|
||||||
:options="agenciesOptions"
|
:options="warehousesOptionsIn"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
map-options
|
map-options
|
||||||
|
@ -78,6 +88,7 @@ const agenciesOptions = ref([]);
|
||||||
</VnInput>
|
</VnInput>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
<QCheckbox v-model="data.isRaid" :label="t('travel.basicData.isRaid')" />
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('travel.summary.delivered')"
|
:label="t('travel.summary.delivered')"
|
||||||
v-model="data.isDelivered"
|
v-model="data.isDelivered"
|
||||||
|
@ -93,7 +104,7 @@ const agenciesOptions = ref([]);
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
raidDays: Al rellenarlo, generamos una redada. Indica los días que un travel se moverá automáticamente en el tiempo
|
raidDays: Si se marca "Redada", la fecha de entrega se moverá automáticamente los días indicados.
|
||||||
en:
|
en:
|
||||||
raidDays: When filling, a raid is generated. Enter the number of days the travel will automatically forward in time
|
raidDays: If "Raid" is checked, the landing date will automatically shift by the specified number of days.
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -1,34 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCard from 'components/common/VnCard.vue';
|
||||||
import TravelDescriptor from './TravelDescriptor.vue';
|
import TravelDescriptor from './TravelDescriptor.vue';
|
||||||
|
import filter from './TravelFilter.js';
|
||||||
const filter = {
|
|
||||||
fields: [
|
|
||||||
'id',
|
|
||||||
'ref',
|
|
||||||
'shipped',
|
|
||||||
'landed',
|
|
||||||
'totalEntries',
|
|
||||||
'warehouseInFk',
|
|
||||||
'warehouseOutFk',
|
|
||||||
'cargoSupplierFk',
|
|
||||||
'agencyModeFk',
|
|
||||||
],
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
relation: 'warehouseIn',
|
|
||||||
scope: {
|
|
||||||
fields: ['name'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'warehouseOut',
|
|
||||||
scope: {
|
|
||||||
fields: ['name'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue