0
0
Fork 0

Compare commits

..

156 Commits

Author SHA1 Message Date
Javier Segarra fea760d2f9 Merge branch 'dev' into 6321_negative_tickets 2024-09-24 22:14:04 +02:00
Javier Segarra 38967931b9 feat: refs #6321 updates 2024-09-24 22:13:00 +02:00
Javier Segarra d7f37eff32 feat: refs #6321 updates 2024-09-24 22:11:41 +02:00
Javier Segarra 7da3f132ea feat: refs #6321 update 2024-09-24 13:54:58 +02:00
Javier Segarra d0eb1d97ac fet: updates 2024-09-18 13:10:11 +02:00
Javier Segarra 53b522c488 Merge branch 'dev' into 6321_negative_tickets 2024-09-18 09:15:36 +02:00
Javier Segarra 1c7bcc8902 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-09-17 16:43:42 +02:00
Javier Segarra 01cc2d4e75 fet: updates 2024-09-17 16:42:22 +02:00
Javier Segarra 71236c0a01 fix: remove slot 2024-09-17 14:29:26 +02:00
Javier Segarra 9379e80df7 fix: routing 2024-09-17 14:20:01 +02:00
Javier Segarra 8c6e399fd2 feat: remove comments 2024-09-17 14:06:14 +02:00
Javier Segarra 26eae51585 Merge branch 'dev' into 6321_negative_tickets 2024-09-17 11:43:47 +02:00
Javier Segarra 2c81ddb4aa feat: updates 2024-09-17 11:41:29 +02:00
Javier Segarra b5db786b06 feat: upodates 2024-09-16 12:15:15 +02:00
Javier Segarra 0a3703532e feat: itemProposalProxy 2024-09-16 10:47:41 +02:00
Javier Segarra 8be1a42c53 Merge branch 'dev' into 6321_negative_tickets 2024-09-16 09:48:22 +02:00
Javier Segarra d16786d3e1 feat: updates TicketTable 2024-09-12 08:40:19 +02:00
Javier Segarra ff918b8a1c feat: updates ItemProposal 2024-09-11 23:29:59 +02:00
Javier Segarra 9ec1c5ff4b feat: updates ItemProposal 2024-09-11 23:17:38 +02:00
Javier Segarra 373ca0b3f1 feat:TicketLackTable updates 2024-09-11 14:25:10 +02:00
Javier Segarra 5e89bbe19e fix: remove unnesed imports 2024-09-11 12:55:14 +02:00
Javier Segarra d6bb39236d feat: implement VnTable 2024-09-11 12:43:24 +02:00
Javier Segarra b0a439c26c fix: ticketLackList 2024-09-11 11:26:25 +02:00
Javier Segarra 78c5836431 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-09-11 08:50:39 +02:00
Javier Segarra 437d70d415 perf: TransferSale and implementations 2024-07-23 12:33:11 +02:00
Javier Segarra a53f4bd957 feat: QPopupProxy updateNegativeOrigin 2024-07-22 20:22:32 +02:00
Javier Segarra 3979a328e9 WIP: 28213bcc minor i18n updates 2024-07-22 17:30:15 +02:00
Javier Segarra 28213bcce6 minor i18n updates 2024-07-20 00:37:13 +02:00
Javier Segarra 7c8ddf9c2b Merge branch 'dev' into 6321_negative_tickets 2024-07-20 00:22:37 +02:00
Javier Segarra c45ff7009c Merge branch 'dev' into 6321_negative_tickets 2024-07-18 22:04:30 +02:00
Javier Segarra a6cd75a210 feat: Julia icon proposal 2024-07-04 17:27:59 +02:00
Javier Segarra 189784872f feat: substitution icons 2024-07-04 09:39:27 +02:00
Javier Segarra 8714be1fa7 feat: define new CustomerDescriptorMenu action. Pending reactivity 2024-07-03 23:07:50 +02:00
Javier Segarra 87928ea7b6 feat: add new icons. Pending to define icon name 2024-07-03 23:07:44 +02:00
Javier Segarra f52ba11f42 Merge remote-tracking branch 'origin/dev' into 6321_negative_tickets 2024-07-03 23:07:25 +02:00
Javier Segarra 9c8094a3d8 Merge branch 'dev' into 6321_negative_tickets 2024-07-02 20:31:44 +02:00
Javier Segarra 32fe76aaab feat: Vndescriptor 2024-07-02 20:28:13 +02:00
Javier Segarra c3d97231d2 Merge branch 'dev' into 6321_negative_tickets 2024-07-02 12:20:58 +02:00
Javier Segarra e76daac3be feat: cherryPick TicketTransfer 2024-06-20 00:06:00 +02:00
Javier Segarra 3ff0d2139a feat: call latestBuysFilter 2024-06-20 00:01:33 +02:00
Javier Segarra bb92d75e00 test: #6321 boilerplate tests 2024-06-20 00:01:12 +02:00
Javier Segarra 1367c372e3 handle replaceItem 2024-06-19 15:25:57 +02:00
Javier Segarra 86cfbace72 feat: #6321 remove row 2024-06-19 13:18:32 +02:00
Javier Segarra 185160aeba feat: use Popover instead dialog 2024-06-18 22:49:55 +02:00
Javier Segarra cd5a64fcc6 fat: #6321 handle events through components 2024-06-17 22:32:39 +02:00
Javier Segarra 20e439f31e feat: ItemProposal difference column 2024-06-17 12:37:52 +02:00
Javier Segarra 6ef53e790a feat: itemProposal and LackDetail 2024-06-17 12:19:57 +02:00
Javier Segarra 7b047e1637 updates 2024-06-14 13:44:33 +02:00
Javier Segarra 679710eb4d updates 2024-06-13 14:55:49 +02:00
Javier Segarra bb58f72e3f updates 2024-06-13 09:37:39 +02:00
Javier Segarra 1641ad396c Merge branch 'dev' into 6321_negative_tickets 2024-06-12 23:07:14 +02:00
Javier Segarra f816cb9240 perf: TicketLackLit 2024-06-12 23:06:56 +02:00
Javier Segarra 4226c52fc5 perf: ItemProposal 2024-06-12 22:23:58 +02:00
Javier Segarra 8d9bfd8f1d Merge branch 'dev' into 6321_negative_tickets 2024-06-11 13:52:48 +02:00
Javier Segarra b370fe673b updates 2024-06-10 17:06:20 +02:00
Javier Segarra fd4ff94f4c feat: #6321 Update handleSplitted form 2024-06-04 14:14:16 +02:00
Javier Segarra 5b1819f7da Merge branch 'dev' into 6321_negative_tickets 2024-06-04 09:27:46 +02:00
Javier Segarra 79548f5041 updates 2024-05-30 06:46:30 +02:00
Javier Segarra d3b93b710d updates 2024-05-28 13:07:22 +02:00
Javier Segarra 577c21e601 Merge branch 'dev' into 6321_negative_tickets 2024-05-28 12:48:00 +02:00
Javier Segarra 36d166ab44 feat: #6321 Split tickets 2024-05-24 13:52:51 +02:00
Javier Segarra 1eedb6f79b perf: #6321 updates 2024-05-24 11:54:31 +02:00
Javier Segarra ceae5eaa9e Merge branch 'dev' into 6321_negative_tickets 2024-05-24 11:21:06 +02:00
Javier Segarra f0333dfd01 feat: Refactor negativeDetail 2024-05-16 12:01:56 +02:00
Javier Segarra 372e797059 feat: recover split 2024-05-15 16:25:25 +02:00
Javier Segarra b03578eb65 feat: header itemProposal dialog 2024-05-15 16:09:26 +02:00
Javier Segarra 1c15a02a5f perf: i18n ItemProposal 2024-05-15 15:45:24 +02:00
Javier Segarra bb6a8c0052 feat: remove alertLevelCode column 2024-05-15 15:45:08 +02:00
Javier Segarra 58597bdddf Merge branch 'dev' into 6321_negative_tickets 2024-05-15 08:55:47 +02:00
Javier Segarra 1ca7420207 feat: replace item 2024-05-15 08:54:22 +02:00
Javier Segarra fffd662cee feat: reload ticket detail when update state/qty 2024-05-15 08:14:50 +02:00
Javier Segarra e07e62abb4 updates 2024-05-14 14:41:34 +02:00
Javier Segarra df911e0210 feat: itemProposal selection 2024-05-14 09:55:36 +02:00
Javier Segarra ad64ee4755 feat: change Qdialog sizing 2024-05-14 08:45:46 +02:00
Javier Segarra 3e39ab7fc2 Merge branch '6321_negative_tickets' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-05-13 13:51:18 +02:00
Javier Segarra e6b360ee4b fix: vnfilterPanel 2024-05-13 13:51:15 +02:00
Jorge Penadés 99ea8e843c Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-05-13 13:22:39 +02:00
Javier Segarra ebdc1e9906 updates 2024-05-13 13:18:22 +02:00
Javier Segarra 0eab0a9a98 feat: #6321 Modals change qty and state 2024-05-08 15:35:04 +02:00
Javier Segarra 881e059121 feat: #6321 Show Free lines 2024-05-08 14:06:23 +02:00
Javier Segarra 0984d05220 Merge branch 'fix_minor_styles' into 6321_negative_tickets 2024-05-08 13:44:40 +02:00
Javier Segarra 61519595a9 Merge branch 'dev' into 6321_negative_tickets 2024-05-08 12:30:01 +02:00
Javier Segarra c03875838f feat: minor updates 2024-05-02 15:18:14 +02:00
Javier Segarra 6323f165a0 perf: updates 2024-05-02 13:53:40 +02:00
Javier Segarra 1907301852 Merge branch 'dev' into 6321_negative_tickets 2024-05-02 12:48:45 +02:00
Javier Segarra 2c59e6acc3 Merge branch 'dev' into 6321_negative_tickets 2024-04-30 15:25:10 +02:00
Javier Segarra 1929545e5b feat: itemProposal table 2024-04-30 15:23:49 +02:00
Javier Segarra 0988936884 feat: frmItemProposal show 2024-04-30 14:51:49 +02:00
Javier Segarra 1d4549439c feat: remove agName 2024-04-29 15:09:10 +02:00
Javier Segarra b7bfb4b056 feat: updates 2024-04-29 15:08:12 +02:00
Javier Segarra 56a6f24071 feat: family filter 2024-04-29 14:21:39 +02:00
Javier Segarra 1ccad36020 feat: remove unnused filters 2024-04-29 13:25:18 +02:00
Javier Segarra df29ad31fd minor changes 2024-04-29 13:22:31 +02:00
Javier Segarra 7108444a44 fix: 1. Warehouse default 2024-04-29 13:22:23 +02:00
Javier Segarra 5425902918 Merge branch 'dev' into 6321_negative_tickets 2024-04-29 11:55:56 +02:00
Javier Segarra 4049fa5c4a feat: #6321 replace dialog into layout 2024-04-23 12:50:34 +02:00
Javier Segarra 46aefa67d1 Merge remote-tracking branch 'origin/dev' into 6321_negative_tickets 2024-04-23 11:45:00 +02:00
Javier Segarra cc241c6a4e feat: #6321 new route 2024-04-22 14:24:23 +02:00
Javier Segarra 5779d37bbd feat: #6321 i18n to yml 2024-04-22 14:08:58 +02:00
Javier Segarra 91c5d7092d Merge remote-tracking branch 'origin/dev' into 6321_negative_tickets 2024-04-22 13:34:00 +02:00
Javier Segarra a5350f686d refs #6321 fix: comments 2024-04-15 12:28:01 +02:00
Javier Segarra cf0454669a refs #6321 fix: split disabled 2024-04-15 12:24:45 +02:00
Javier Segarra 6804196dbb warnings 2024-04-08 09:35:17 +02:00
Javier Segarra 6c2c3b8f60 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-04-08 09:22:52 +02:00
Javier Segarra f6eaa99aeb refs #6321 fix: warnings 2024-04-03 10:04:47 +02:00
Javier Segarra 2951e69a6a refs #6321 feat updateQuantity 2024-04-03 09:58:04 +02:00
Javier Segarra 85fa394be0 refs #6321 perf: i18n 2024-04-03 09:49:09 +02:00
Javier Segarra 5a497289da refs #6321 perf: i18n 2024-04-03 08:41:20 +02:00
Javier Segarra 75e02bf328 change icon 2024-04-03 08:33:14 +02:00
Javier Segarra 370e52f7c4 refs #6321 perf: i18n 2024-04-02 13:25:51 +02:00
Javier Segarra 6b4dea6bf9 refs #6321 fix: filter menu 2024-04-02 13:13:29 +02:00
Javier Segarra 648a98d49d refs #6321 remove bad files 2024-04-02 09:57:59 +02:00
Javier Segarra 207097fa98 refs #6321 remove bad files 2024-04-02 09:56:31 +02:00
Javier Segarra f56934fcc4 refs #6321 perf change response object 2024-04-02 09:44:09 +02:00
Javier Segarra 48f88b5871 refs #6321 remove comments 2024-04-02 08:17:44 +02:00
Javier Segarra 130c98ef17 refs #6321 remove comments 2024-04-02 08:14:11 +02:00
Javier Segarra c16cc78ce6 refs #6321 remove bad files 2024-04-02 08:08:50 +02:00
Javier Segarra 0c88efc291 refs #6321 feat: status response after split 2024-03-29 01:29:45 +01:00
Javier Segarra 967fb4592b Merge branch 'dev' into 6321_negative_tickets 2024-03-29 00:56:23 +01:00
Javier Segarra 697c467006 refs #6321 i18n: buttons tooltip 2024-03-29 00:56:10 +01:00
Javier Segarra 737ab9e99b updates 2024-03-28 11:54:47 +01:00
Javier Segarra 30a32ad17d refs #6321 updates 2024-03-28 07:17:06 +01:00
Javier Segarra 3a024e81b5 refs #6321 updates 2024-03-27 15:20:15 +01:00
Javier Segarra fe12968dd6 refs #6321 fix: rowsSelected 2024-03-27 14:08:25 +01:00
Javier Segarra 81436a1641 refs #6321 feat changeState 2024-03-27 12:02:57 +01:00
Javier Segarra d65caaad07 refs #6321 perf: rename files 2024-03-27 10:19:49 +01:00
Javier Segarra 48aa8dad79 refs #6321 perf: i18n 2024-03-27 10:12:10 +01:00
Javier Segarra 1e09e9e4bb refs #6321 perf: move dialogs to new files 2024-03-27 10:07:27 +01:00
Javier Segarra 6b564bb648 refs #6321 feat: use tokenMultimedia 2024-03-27 10:06:57 +01:00
Javier Segarra 41cf7d242b Merge branch 'dev' into 6321_negative_tickets 2024-03-27 09:53:14 +01:00
Javier Segarra 174d159d04 refs #6321 i18n 2024-03-22 11:46:40 +01:00
Javier Segarra 6e701bd455 refs #6321 updates 2024-03-21 10:14:44 +01:00
Javier Segarra 527c845356 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-03-21 07:48:07 +01:00
Javier Segarra c51feab746 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-03-15 12:22:01 +01:00
Javier Segarra b3cbc64efb refs #6321 perf: i18n 2024-03-15 12:15:03 +01:00
Javier Segarra 92555f8ddb refs #6321 feat: negativeOrigin modal 2024-03-15 11:31:19 +01:00
Javier Segarra 674b8bb1dc refs #6321 perf: updates 2024-03-15 09:36:30 +01:00
Javier Segarra e264a13234 warnings 2024-03-15 09:36:15 +01:00
Javier Segarra 5326d9db88 refs #6321 perf: update 2024-03-14 15:26:07 +01:00
Javier Segarra 79e2bddeea Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-03-14 15:01:58 +01:00
Javier Segarra 2436db1c28 refs #6321 perf: update 2024-03-14 14:21:02 +01:00
Javier Segarra bffc496965 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-03-14 13:04:05 +01:00
Javier Segarra 322c195175 refs #6321 feat: i18n improves 2024-03-13 14:27:21 +01:00
Javier Segarra 80b881edb5 refs #6321 fix: bug when retrieve token 2024-03-07 09:50:19 +01:00
Javier Segarra d10c04d4f2 refs #6321 feat: change dialog header 2024-03-06 20:46:13 +01:00
Javier Segarra 0dd89ec3f0 refs #6321 perf: rename files 2024-03-06 20:45:53 +01:00
Javier Segarra 51b8667938 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-03-06 13:51:59 +01:00
Javier Segarra 7254f91645 refs #6321 feat: updates i18n dialog 2024-03-05 12:59:59 +01:00
Javier Segarra 59e260d448 refs #6321 feat: updates dialog 2024-03-05 12:59:45 +01:00
Javier Segarra 3a7e092efe Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-03-05 08:06:05 +01:00
Javier Segarra 67eb21b707 refs #6321 feat: updates 2024-03-05 08:05:16 +01:00
Javier Segarra f44643fc61 refs #6664 perf: show dialog 2024-01-26 13:22:23 +01:00
Javier Segarra 1c51faaff4 Merge branch '6321_negative_tickets' of https://gitea.verdnatura.es/verdnatura/salix-front into 6321_negative_tickets 2024-01-23 11:14:50 +01:00
Javier Segarra f6f84e191b refs #6321 feat dialog approach 2024-01-23 11:14:46 +01:00
Alex Moreno d78c20d14b Merge branch 'dev' into 6321_negative_tickets 2024-01-22 10:41:04 +00:00
Javier Segarra c95b738e0c refs #6321 feat: create new section for ticket module 2024-01-20 12:23:51 +01:00
258 changed files with 5946 additions and 6948 deletions

4
.gitignore vendored
View File

@ -29,5 +29,5 @@ yarn-error.log*
*.sln *.sln
# Cypress directories and files # Cypress directories and files
/tests/cypress/videos /test/cypress/videos
/tests/cypress/screenshots /test/cypress/screenshots

View File

@ -1,183 +1,3 @@
# Version 24.40 - 2024-10-02
### Added 🆕
- chore: refs #4074 admit several acls by:jorgep
- chore: refs #4074 drop workerCreate by:jorgep
- chore: refs #4074 fix tests by:jorgep
- chore: refs #4074 wip replace useRole for useAcl by:jorgep
- chore: refs #7155 remove console.log by:alexm
- chore: refs #7155 typo by:alexm
- chore: refs #7663 add test by:jorgep
- chore: refs #7663 create test wip by:jorgep
- chore: refs #7663 drop useless code (origin/7663-setWeight) by:jorgep
- chore: refs #7828 fix e2e by:jorgep
- feat(AccountBasicData): add twoFactorFk by:alexm
- feat: add max rule by:Javier Segarra
- feat: add shortcut add event in some subSections by:Javier Segarra
- feat: add shortcut more buttons (origin/add_shortcut_add_subSections) by:Javier Segarra
- feat: add tooltip CustomerNewCustomAgent by:Javier Segarra
- feat: apply color when today by:Javier Segarra
- feat: change label because its more natural by:Javier Segarra
- feat: change order by:Javier Segarra
- feat: change QBadge color by:Javier Segarra
- feat: change url CustomerList by:Javier Segarra
- feat: copy customer countryFk by:Javier Segarra
- feat: create VnSelectEnum and add in AccountBasicData and ClaimBasicData by:alexm
- feat: CustomerBalance by:Javier Segarra
- feat: CustomerConsumptionFilter by:Javier Segarra
- feat: customer consumption (origin/7830-customerDesplegables, 7830-customerDesplegables) by:alexm
- feat: CustomerCreateTicket by:Javier Segarra
- feat: CustomerCredit section by:Javier Segarra
- feat: CustomerGreuges by:Javier Segarra
- feat: CustomerSample to VnTable by:Javier Segarra
- feat: global handler (origin/fix_global_handler, fix_global_handler) by:alexm
- feat: goToSupplier by:Javier Segarra
- feat: handle newValue by:Javier Segarra
- feat: handle same multiple CP by:Javier Segarra
- feat: hide menus on small view (origin/hideMenu) by:jorgep
- feat: minor changes by:Javier Segarra
- feat: orderCreateDialog by:Javier Segarra
- feat: refs #4074 drop useless code by:jorgep
- feat: refs #4074 useAcl in vnSelectDialog by:jorgep
- feat: refs #6346 new wagon type section by:Jon
- feat: refs #7404 add m3 and fix detail by:pablone
- feat: refs #7404 add some style to the form and reorganize fields by:pablone
- feat: refs #7404 add travel m3 to reserves form by:pablone
- feat: refs #7404 style dynamic text color by:pablone
- feat: refs #7404 travel m3 form by:pablone
- feat: refs #7500 added VnImg to show files by:Jon
- feat: refs #7663 add setWeight menu opt (wip) by:jorgep
- feat: refs #7663 fine tunning by:jorgep
- feat: refs #7828 create axios instance which no manage errors (origin/7828-makeCorrectCalls) by:jorgep
- feat: refs #7828 useAcl & cherry pick mail data worker by:jorgep
- feat: remove cli warnings by:Javier Segarra
- feat: show preparation field by:Javier Segarra
- feat: stateGroupedFilter by:Javier Segarra
- feat: translations fixed by:jgallego
- feat(TravelList): add daysOnward by:alexm
- feat: travel m3 by:pablone
- feat: use disableInifiniteScroll property by:Javier Segarra
- feat: VnImg draggable by:Javier Segarra
- feat: vnLocation changes by:Javier Segarra
- feat: vnSelect exprBuilder by:Javier Segarra
- fix: refs #7404 remove some style by:pablone
- fix: refs #7404 style non center pop up (origin/7404-fixFront) by:pablone
- fix: refs #7404 translates and some minor style fixes by:pablone
- fix: styles by:Javier Segarra
- perf: improve style by:Javier Segarra
### Changed 📦
- perf: CustomerBalance by:Javier Segarra
- perf: CustomerBasicData by:Javier Segarra
- perf: CustomerBasicData.salesPersonFk by:Javier Segarra
- perf: CustomerSummary by:Javier Segarra
- perf: customerSummaryTable by:Javier Segarra
- perf: disable card option by:Javier Segarra
- perf: i18n by:Javier Segarra
- perf: improve by:Javier Segarra
- perf: improve style by:Javier Segarra
- perf: imrpove exprBuilder by:Javier Segarra
- perf: minor comments by:Javier Segarra
- perf: refs #6346 previous changes by:Jon
- perf: sendEmail customerConsumption by:Javier Segarra
- perf: solve reload CardSummary component by:Javier Segarra
- perf: update CustommerDescriptor by:Javier Segarra
- refactor: refs #4074 accept array by:jorgep
- refactor: refs #4074 rollback by:jorgep
- refactor: refs #4074 use acl & drop useless roles by:jorgep
- refactor: refs #4074 useAcl in navigationStore & router by:jorgep
- refactor: refs #4074 use fn (origin/4074-useAcls) by:jorgep
- refactor: refs #4074 use VnTitle by:jorgep
- refactor: refs #6346 deleted front error checking by:Jon
- refactor: refs #6346 requested changes by:Jon
- refactor: refs #6346 wagons to VnTable by:Jon
- refactor: refs #7500 deleted useless code by:Jon
- refactor: refs #7500 refactor vnimg when storage is dms by:Jon
- refactor: refs #7828 wip by:jorgep
### Fixed 🛠️
- chore: refs #4074 fix tests by:jorgep
- chore: refs #7828 fix e2e by:jorgep
- feat: refs #7404 add m3 and fix detail by:pablone
- feat: translations fixed by:jgallego
- fix: #5938 grouped filter by:Javier Segarra
- fix: #6943 fix customerSummaryTable by:Javier Segarra
- fix: #6943 show nickname salesPerson by:Javier Segarra
- fix: address-create i18n by:Javier Segarra
- fix: comments (origin/6943_fix_customer_module, 6943_fix_customer_module) by:Javier Segarra
- fix: CusomerSummary to Address by:Javier Segarra
- fix: CustomerAddress mobile by:Javier Segarra
- fix: CustomerBillingData by:Javier Segarra
- fix: Customerconsumption by:Javier Segarra
- fix: customer credit opinion by:alexm
- fix: CustomerCreditOpinion workerDescriptor by:Javier Segarra
- fix: CustomerDescriptorAccount by:Javier Segarra
- fix: CustomerDescriptor.bussinessTypeFk by:Javier Segarra
- fix: CustomerFilter by:Javier Segarra
- fix: CustomerGreuges by:Javier Segarra
- fix: CustomerMandates by:Javier Segarra
- fix: Customer module find salesPersons out of first get by:Javier Segarra
- fix: CustomerRecovery transalate label by:Javier Segarra
- fix: CustomerSamples by:Javier Segarra
- fix: customerSummaryToTicketList button by:Javier Segarra
- fix: CustomerWebPayment by:Javier Segarra
- fix: CustommerSummaryTable Proxy by:Javier Segarra
- fix: deleted code by:Jon
- fix: duplicate code by:alexm
- fix: emit:updateModelValue by:Javier Segarra
- fix: fixed wagon tests by:Jon
- fix: fix wagon list reload by:Jon
- fix: i18n en preparation label by:Javier Segarra
- fix: infiniteScroll by:Javier Segarra
- fix: isFullMovable checkbox by:Javier Segarra
- fix: merge conflicts by:Javier Segarra
- fix: merge in dev by:alexm
- fix: missing code by:Jon
- fix: Options VnSelect properties by:Javier Segarra
- fix: refs #4074 await to watch by:jorgep
- fix: refs #4074 drop wrong acl by:jorgep
- fix: refs #4074 workerCard data-key by:jorgep
- fix: refs #6346 fix list and create by:pablone
- fix: refs #6943 prevent null (origin/6943-warmfix-preventNull) by:jorgep
- fix: refs #7155 remove userParams in watcher (7155-travel_daysOnward) by:alexm
- fix: refs #7155 use chip-locale (origin/7155-travel_daysOnward_2, 7155-travel_daysOnward_2) by:alexm
- fix: refs #7404 remove console.log by:pablone
- fix: refs #7404 remove from test by:pablone
- fix: refs #7404 remove some style by:pablone
- fix: refs #7404 revert commit prevent production access by:pablone
- fix: refs #7404 style non center pop up (origin/7404-fixFront) by:pablone
- fix: refs #7404 translates and some minor style fixes by:pablone
- fix: refs #7500 fixed e2e test by:Jon
- fix: refs #7500 fixed showing images wrongly by:Jon
- fix: refs #7830 customer credit by:pablone
- fix: refs #7830 remove console.log by:pablone
- fix: remove console.log by:pablone
- fix: remove FetchData by:Javier Segarra
- fix: remove FIXME (origin/6943_fix_customerSummaryTable) by:Javier Segarra
- fix: remove print variable by:Javier Segarra
- fix: remove promise execution by:Javier Segarra
- fix: reset VnTable scroll properties by:Javier Segarra
- fix: rule by:Javier Segarra
- fix: solve conflicts from master to test by:Javier Segarra
- fix: split params (origin/warmfix-addSearchUrl) by:jorgep
- fix: state cell by:Javier Segarra
- fix: stop call back event hasMoreData by:Javier Segarra
- fix: styles by:Javier Segarra
- fix: SupplierFiscalData VnLocation (origin/fix_supplierFD_location) by:Javier Segarra
- fix: VnLocation test by:Javier Segarra
- fix(VnTable): header background-color by:alexm
- fix(VnTable): sanitizer value is defined by:carlossa
- fix: wagon reload (origin/FixWagonRedirect) by:Jon
- fix: workerDms filter workerFk by:alexm
- fix(WorkerList): add type email by:alexm
- Merge remote-tracking branch 'origin/7830-customerDesplegables' into 6943_fix_customerSummaryTable by:Javier Segarra
- refs #7155 scopeDays fix (origin/7155-scopeDays) by:carlossa
- revert: vnUSerLink change by:Javier Segarra
- test: fix test (7677_vnLocation_perf) by:Javier Segarra
# Version 24.38 - 2024-09-17 # Version 24.38 - 2024-09-17
### Added 🆕 ### Added 🆕

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-front", "name": "salix-front",
"version": "24.44.0", "version": "24.42.0",
"description": "Salix frontend", "description": "Salix frontend",
"productName": "Salix", "productName": "Salix",
"author": "Verdnatura", "author": "Verdnatura",

View File

@ -29,8 +29,16 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot) // app boot file (/src/boot)
// --> boot files are part of "main.js" // --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files // https://v2.quasar.dev/quasar-cli/boot-files
boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar', 'quasar.defaults'], boot: [
'i18n',
'axios',
'vnDate',
'validations',
'quasar',
'quasar.defaults',
'global-components',
],
importStrategy: 'auto',
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'], css: ['app.scss'],

View File

@ -2,11 +2,9 @@ import axios from 'axios';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { Router } from 'src/router'; import { Router } from 'src/router';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
const session = useSession(); const session = useSession();
const { notify } = useNotify(); const { notify } = useNotify();
const stateQuery = useStateQueryStore();
const baseUrl = '/api/'; const baseUrl = '/api/';
axios.defaults.baseURL = baseUrl; axios.defaults.baseURL = baseUrl;
@ -17,7 +15,7 @@ const onRequest = (config) => {
if (token.length && !config.headers.Authorization) { if (token.length && !config.headers.Authorization) {
config.headers.Authorization = token; config.headers.Authorization = token;
} }
stateQuery.add(config);
return config; return config;
}; };
@ -26,10 +24,10 @@ const onRequestError = (error) => {
}; };
const onResponse = (response) => { const onResponse = (response) => {
const config = response.config; const { method } = response.config;
stateQuery.remove(config);
if (config.method === 'patch') { const isSaveRequest = method === 'patch';
if (isSaveRequest) {
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');
} }
@ -37,9 +35,37 @@ const onResponse = (response) => {
}; };
const onResponseError = (error) => { const onResponseError = (error) => {
stateQuery.remove(error.config); let message = '';
if (session.isLoggedIn() && error.response?.status === 401) { const response = error.response;
const responseData = response && response.data;
const responseError = responseData && response.data.error;
if (responseError) {
message = responseError.message;
}
switch (response?.status) {
case 422:
if (error.name == 'ValidationError')
message +=
' "' +
responseError.details.context +
'.' +
Object.keys(responseError.details.codes).join(',') +
'"';
break;
case 500:
message = 'errors.statusInternalServerError';
break;
case 502:
message = 'errors.statusBadGateway';
break;
case 504:
message = 'errors.statusGatewayTimeout';
break;
}
if (session.isLoggedIn() && response?.status === 401) {
session.destroy(false); session.destroy(false);
const hash = window.location.hash; const hash = window.location.hash;
const url = hash.slice(1); const url = hash.slice(1);
@ -48,6 +74,8 @@ const onResponseError = (error) => {
return Promise.reject(error); return Promise.reject(error);
} }
notify(message, 'negative');
return Promise.reject(error); return Promise.reject(error);
}; };

View File

@ -1,4 +0,0 @@
import { QInput } from 'quasar';
import setDefault from './setDefault';
setDefault(QInput, 'dense', true);

View File

@ -1,4 +0,0 @@
import { QSelect } from 'quasar';
import setDefault from './setDefault';
setDefault(QSelect, 'dense', true);

View File

@ -0,0 +1,13 @@
// src/boot/global-components.js
import { defineAsyncComponent } from 'vue';
const components = import.meta.glob('src/components/**/*.vue');
export default ({ app }) => {
for (const path in components) {
const componentName = path
.split('/')
.pop()
.replace(/\.\w+$/, '');
app.component(componentName, defineAsyncComponent(components[path]));
}
};

View File

@ -1,3 +1 @@
export * from './defaults/qTable'; export * from './defaults/qTable';
export * from './defaults/qInput';
export * from './defaults/qSelect';

View File

@ -3,51 +3,14 @@ import qFormMixin from './qformMixin';
import mainShortcutMixin from './mainShortcutMixin'; import mainShortcutMixin from './mainShortcutMixin';
import keyShortcut from './keyShortcut'; import keyShortcut from './keyShortcut';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import { CanceledError } from 'axios';
const { notify } = useNotify(); const { notify } = useNotify();
export default boot(({ app }) => { export default boot(({ app }) => {
app.mixin(qFormMixin); app.mixin(qFormMixin);
app.mixin(mainShortcutMixin); app.mixin(mainShortcutMixin);
app.directive('shortcut', keyShortcut); app.directive('shortcut', keyShortcut);
app.config.errorHandler = (error) => { app.config.errorHandler = function (err) {
let message; console.error(err);
const response = error.response; notify('globals.error', 'negative', 'error');
const responseData = response?.data;
const responseError = responseData && response.data.error;
if (responseError) {
message = responseError.message;
}
switch (response?.status) {
case 422:
if (error.name == 'ValidationError')
message +=
' "' +
responseError.details.context +
'.' +
Object.keys(responseError.details.codes).join(',') +
'"';
break;
case 500:
message = 'errors.statusInternalServerError';
break;
case 502:
message = 'errors.statusBadGateway';
break;
case 504:
message = 'errors.statusGatewayTimeout';
break;
}
console.error(error);
if (error instanceof CanceledError) {
const env = process.env.NODE_ENV;
if (env && env !== 'development') return;
message = 'Duplicate request';
}
notify(message ?? 'globals.error', 'negative', 'error');
}; };
}); });

View File

@ -21,7 +21,7 @@ const customer = computed(() => state.get('customer'));
const bankEntityFormData = reactive({ const bankEntityFormData = reactive({
name: null, name: null,
bic: null, bic: null,
countryFk: customer.value?.countryFk, countryFk: customer.value.countryFk,
id: null, id: null,
}); });
@ -31,8 +31,8 @@ const countriesFilter = {
const countriesOptions = ref([]); const countriesOptions = ref([]);
const onDataSaved = (...args) => { const onDataSaved = (formData, requestResponse) => {
emit('onDataSaved', ...args); emit('onDataSaved', formData, requestResponse);
}; };
onMounted(async () => { onMounted(async () => {

View File

@ -1,42 +1,35 @@
<script setup> <script setup>
import { onMounted, ref } from 'vue'; import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnSelectProvince from 'components/VnSelectProvince.vue'; import VnSelectProvince from 'components/VnSelectProvince.vue';
import VnInput from 'components/common/VnInput.vue'; import VnInput from 'components/common/VnInput.vue';
import FormModelPopup from './FormModelPopup.vue'; import FormModelPopup from './FormModelPopup.vue';
const emit = defineEmits(['onDataSaved']); const emit = defineEmits(['onDataSaved']);
const $props = defineProps({
countryFk: {
type: Number,
default: null,
},
provinceSelected: {
type: Number,
default: null,
},
provinces: {
type: Array,
default: () => [],
},
});
const { t } = useI18n(); const { t } = useI18n();
const cityFormData = ref({ const cityFormData = reactive({
name: null, name: null,
provinceFk: null, provinceFk: null,
}); });
onMounted(() => {
cityFormData.value.provinceFk = $props.provinceSelected; const provincesOptions = ref([]);
});
const onDataSaved = (...args) => { const onDataSaved = (...args) => {
emit('onDataSaved', ...args); emit('onDataSaved', ...args);
}; };
</script> </script>
<template> <template>
<FetchData
@on-fetch="(data) => (provincesOptions = data)"
auto-load
url="Provinces"
/>
<FormModelPopup <FormModelPopup
:title="t('New city')" :title="t('New city')"
:subtitle="t('Please, ensure you put the correct data!')" :subtitle="t('Please, ensure you put the correct data!')"
@ -48,16 +41,11 @@ 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')"
/> />
<VnSelectProvince <VnSelectProvince v-model="data.provinceFk" />
:province-selected="$props.provinceSelected"
:country-fk="$props.countryFk"
v-model="data.provinceFk"
:provinces="$props.provinces"
/>
</VnRow> </VnRow>
</template> </template>
</FormModelPopup> </FormModelPopup>

View File

@ -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,11 +22,9 @@ const postcodeFormData = reactive({
townFk: null, townFk: null,
}); });
const townsFetchDataRef = ref(null);
const provincesFetchDataRef = ref(null); const provincesFetchDataRef = ref(null);
const countriesOptions = ref([]); const countriesOptions = ref([]);
const provincesOptions = ref([]); const provincesOptions = ref([]);
const townsOptions = ref([]);
const town = ref({}); const town = ref({});
function onDataSaved(formData) { function onDataSaved(formData) {
@ -63,94 +61,23 @@ function setTown(newTown, data) {
} }
async function setProvince(id, data) { async function setProvince(id, data) {
await provincesFetchDataRef.value.fetch();
const newProvince = provincesOptions.value.find((province) => province.id == id); const newProvince = provincesOptions.value.find((province) => province.id == id);
if (!newProvince) return; if (!newProvince) return;
data.countryFk = newProvince.countryFk; data.countryFk = newProvince.countryFk;
} }
async function onProvinceCreated(data) {
await provincesFetchDataRef.value.fetch({
where: { countryFk: postcodeFormData.countryFk },
});
postcodeFormData.provinceFk.value = 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) => {
if (Array.isArray(newProvinceFk)) {
newProvinceFk = newProvinceFk[0];
}
if (newProvinceFk !== postcodeFormData.provinceFk) {
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>
<template> <template>
<FetchData <FetchData
ref="provincesFetchDataRef" ref="provincesFetchDataRef"
@on-fetch="handleProvinces" @on-fetch="(data) => (provincesOptions = data)"
:sort-by="['name ASC']"
:limit="30"
auto-load auto-load
url="Provinces/location" url="Provinces/location"
/> />
<FetchData <FetchData
ref="townsFetchDataRef" @on-fetch="(data) => (countriesOptions = data)"
:sort-by="['name ASC']"
:limit="30"
@on-fetch="handleTowns"
auto-load
url="Towns/location"
/>
<FetchData
@on-fetch="handleCountries"
:sort-by="['name ASC']"
:limit="30"
auto-load auto-load
url="Countries" url="Countries"
/> />
@ -169,20 +96,18 @@ async function handleCountries(data) {
:label="t('Postcode')" :label="t('Postcode')"
v-model="data.code" v-model="data.code"
:rules="validate('postcode.code')" :rules="validate('postcode.code')"
clearable
/> />
<VnSelectDialog <VnSelectDialog
:label="t('City')" :label="t('City')"
url="Towns/location"
@update:model-value="(value) => setTown(value, data)" @update:model-value="(value) => setTown(value, data)"
:tooltip="t('Create city')"
v-model="data.townFk" v-model="data.townFk"
:options="townsOptions"
option-label="name" option-label="name"
option-value="id" option-value="id"
:rules="validate('postcode.city')" :rules="validate('postcode.city')"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]" :acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:emit-value="false" :emit-value="false"
:clearable="true" clearable
> >
<template #option="{ itemProps, opt }"> <template #option="{ itemProps, opt }">
<QItem v-bind="itemProps"> <QItem v-bind="itemProps">
@ -197,9 +122,6 @@ async function handleCountries(data) {
</template> </template>
<template #form> <template #form>
<CreateNewCityForm <CreateNewCityForm
:country-fk="data.countryFk"
:province-selected="data.provinceFk"
:provinces="provincesOptions"
@on-data-saved=" @on-data-saved="
(_, requestResponse) => (_, requestResponse) =>
onCityCreated(requestResponse, data) onCityCreated(requestResponse, data)
@ -210,13 +132,8 @@ async function handleCountries(data) {
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelectProvince <VnSelectProvince
:country-fk="data.countryFk"
: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"
:provinces="provincesOptions"
@on-province-created="onProvinceCreated"
/> />
<VnSelect <VnSelect
:label="t('Country')" :label="t('Country')"
@ -235,7 +152,6 @@ async function handleCountries(data) {
<i18n> <i18n>
es: es:
New postcode: Nuevo código postal New postcode: Nuevo código postal
Create city: Crear población
Please, ensure you put the correct data!: ¡Por favor, asegúrese de poner los datos correctos! Please, ensure you put the correct data!: ¡Por favor, asegúrese de poner los datos correctos!
City: Población City: Población
Province: Provincia Province: Provincia

View File

@ -16,16 +16,7 @@ const provinceFormData = reactive({
name: null, name: null,
autonomyFk: null, autonomyFk: null,
}); });
const $props = defineProps({
countryFk: {
type: Number,
default: null,
},
provinces: {
type: Array,
default: () => [],
},
});
const autonomiesOptions = ref([]); const autonomiesOptions = ref([]);
const onDataSaved = (dataSaved, requestResponse) => { const onDataSaved = (dataSaved, requestResponse) => {
@ -40,14 +31,7 @@ const onDataSaved = (dataSaved, requestResponse) => {
<FetchData <FetchData
@on-fetch="(data) => (autonomiesOptions = data)" @on-fetch="(data) => (autonomiesOptions = data)"
auto-load auto-load
:filter="{
where: {
countryFk: $props.countryFk,
},
}"
url="Autonomies/location" url="Autonomies/location"
:sort-by="['name ASC']"
:limit="30"
/> />
<FormModelPopup <FormModelPopup
:title="t('New province')" :title="t('New province')"

View File

@ -50,7 +50,7 @@ const onDataSaved = (dataSaved) => {
model="thermograph" model="thermograph"
:title="t('New thermograph')" :title="t('New thermograph')"
:form-initial-data="thermographFormData" :form-initial-data="thermographFormData"
@on-data-saved="(_, response) => onDataSaved(response)" @on-data-saved="onDataSaved($event)"
> >
<template #form-inputs="{ data, validate }"> <template #form-inputs="{ data, validate }">
<VnRow> <VnRow>

View File

@ -234,8 +234,6 @@ async function remove(data) {
newData = newData.filter((form) => !ids.some((id) => id == form[pk])); newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
fetch(newData); fetch(newData);
}); });
} else {
reset();
} }
emit('update:selected', []); emit('update:selected', []);
} }

View File

@ -25,7 +25,7 @@ const $props = defineProps({
}, },
limit: { limit: {
type: [String, Number], type: [String, Number],
default: '', default: '30',
}, },
params: { params: {
type: Object, type: Object,

View File

@ -217,6 +217,9 @@ async function save() {
updateAndEmit('onDataSaved', formData.value, response?.data); updateAndEmit('onDataSaved', formData.value, response?.data);
if ($props.reload) await arrayData.fetch({}); if ($props.reload) await arrayData.fetch({});
hasChanges.value = false; hasChanges.value = false;
} catch (err) {
console.error(err);
notify('errors.writeRequest', 'negative');
} finally { } finally {
isLoading.value = false; isLoading.value = false;
} }

View File

@ -61,7 +61,6 @@ defineExpose({
:loading="isLoading" :loading="isLoading"
@click="emit('onDataCanceled')" @click="emit('onDataCanceled')"
v-close-popup v-close-popup
data-cy="FormModelPopup_cancel"
/> />
<QBtn <QBtn
:label="t('globals.save')" :label="t('globals.save')"
@ -71,7 +70,6 @@ defineExpose({
class="q-ml-sm" class="q-ml-sm"
:disabled="isLoading" :disabled="isLoading"
:loading="isLoading" :loading="isLoading"
data-cy="FormModelPopup_save"
/> />
</div> </div>
</template> </template>

View File

@ -44,6 +44,7 @@ const itemComputed = computed(() => {
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.q-item { .q-item {
min-height: 5vh; min-height: 5vh;

View File

@ -3,7 +3,6 @@ import { onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import PinnedModules from './PinnedModules.vue'; import PinnedModules from './PinnedModules.vue';
import UserPanel from 'components/UserPanel.vue'; import UserPanel from 'components/UserPanel.vue';
@ -13,7 +12,6 @@ import VnAvatar from './ui/VnAvatar.vue';
const { t } = useI18n(); const { t } = useI18n();
const stateStore = useStateStore(); const stateStore = useStateStore();
const quasar = useQuasar(); const quasar = useQuasar();
const stateQuery = useStateQueryStore();
const state = useState(); const state = useState();
const user = state.getUser(); const user = state.getUser();
const appName = 'Lilium'; const appName = 'Lilium';
@ -52,14 +50,6 @@ const pinnedModulesRef = ref();
</QBtn> </QBtn>
</RouterLink> </RouterLink>
<VnBreadcrumbs v-if="$q.screen.gt.sm" /> <VnBreadcrumbs v-if="$q.screen.gt.sm" />
<QSpinner
color="primary"
class="q-ml-md"
:class="{
'no-visible': !stateQuery.isLoading().value,
}"
size="xs"
/>
<QSpace /> <QSpace />
<div id="searchbar" class="searchbar"></div> <div id="searchbar" class="searchbar"></div>
<QSpace /> <QSpace />

View File

@ -24,9 +24,9 @@ const { notify } = useNotify();
const rectificativeTypeOptions = ref([]); const rectificativeTypeOptions = ref([]);
const siiTypeInvoiceOutsOptions = ref([]); const siiTypeInvoiceOutsOptions = ref([]);
const inheritWarehouse = ref(true);
const invoiceParams = reactive({ const invoiceParams = reactive({
id: $props.invoiceOutData?.id, id: $props.invoiceOutData?.id,
inheritWarehouse: true,
}); });
const invoiceCorrectionTypesOptions = ref([]); const invoiceCorrectionTypesOptions = ref([]);
@ -138,7 +138,7 @@ const refund = async () => {
<div> <div>
<QCheckbox <QCheckbox
:label="t('Inherit warehouse')" :label="t('Inherit warehouse')"
v-model="invoiceParams.inheritWarehouse" v-model="inheritWarehouse"
/> />
<QIcon name="info" class="cursor-info q-ml-sm" size="sm"> <QIcon name="info" class="cursor-info q-ml-sm" size="sm">
<QTooltip>{{ t('Inherit warehouse tooltip') }}</QTooltip> <QTooltip>{{ t('Inherit warehouse tooltip') }}</QTooltip>

View File

@ -13,14 +13,12 @@ import FetchData from 'components/FetchData.vue';
import { useClipboard } from 'src/composables/useClipboard'; import { useClipboard } from 'src/composables/useClipboard';
import { useRole } from 'src/composables/useRole'; import { useRole } from 'src/composables/useRole';
import VnAvatar from './ui/VnAvatar.vue'; import VnAvatar from './ui/VnAvatar.vue';
import useNotify from 'src/composables/useNotify';
const state = useState(); const state = useState();
const session = useSession(); const session = useSession();
const router = useRouter(); const router = useRouter();
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const { copyText } = useClipboard(); const { copyText } = useClipboard();
const { notify } = useNotify();
const userLocale = computed({ const userLocale = computed({
get() { get() {
@ -55,7 +53,6 @@ const user = state.getUser();
const warehousesData = ref(); const warehousesData = ref();
const companiesData = ref(); const companiesData = ref();
const accountBankData = ref(); const accountBankData = ref();
const isEmployee = computed(() => useRole().isEmployee());
onMounted(async () => { onMounted(async () => {
updatePreferences(); updatePreferences();
@ -73,28 +70,18 @@ function updatePreferences() {
async function saveDarkMode(value) { async function saveDarkMode(value) {
const query = `/UserConfigs/${user.value.id}`; const query = `/UserConfigs/${user.value.id}`;
try {
await axios.patch(query, { await axios.patch(query, {
darkMode: value, darkMode: value,
}); });
user.value.darkMode = value; user.value.darkMode = value;
onDataSaved();
} catch (error) {
onDataError();
}
} }
async function saveLanguage(value) { async function saveLanguage(value) {
const query = `/VnUsers/${user.value.id}`; const query = `/VnUsers/${user.value.id}`;
try {
await axios.patch(query, { await axios.patch(query, {
lang: value, lang: value,
}); });
user.value.lang = value; user.value.lang = value;
onDataSaved();
} catch (error) {
onDataError();
}
} }
function logout() { function logout() {
@ -110,23 +97,11 @@ function localUserData() {
state.setUser(user.value); state.setUser(user.value);
} }
async function saveUserData(param, value) { function saveUserData(param, value) {
try { axios.post('UserConfigs/setUserConfig', { [param]: value });
await axios.post('UserConfigs/setUserConfig', { [param]: value });
localUserData(); localUserData();
onDataSaved();
} catch (error) {
onDataError();
} }
} const isEmployee = computed(() => useRole().isEmployee());
const onDataSaved = () => {
notify('globals.dataSaved', 'positive');
};
const onDataError = () => {
notify('errors.updateUserConfig', 'negative');
};
</script> </script>
<template> <template>

View File

@ -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';
@ -8,55 +8,33 @@ import FetchData from 'components/FetchData.vue';
import CreateNewProvinceForm from './CreateNewProvinceForm.vue'; import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
const emit = defineEmits(['onProvinceCreated']); const emit = defineEmits(['onProvinceCreated']);
const $props = defineProps({ const provinceFk = defineModel({ type: Number });
countryFk: { watch(provinceFk, async () => await provincesFetchDataRef.value.fetch());
type: Number,
default: null,
},
provinceSelected: {
type: Number,
default: null,
},
provinces: {
type: Array,
default: () => [],
},
});
const provinceFk = defineModel({ type: Number, default: null });
const { validate } = useValidator(); const { validate } = useValidator();
const { t } = useI18n(); const { t } = useI18n();
const provincesOptions = ref($props.provinces); const provincesOptions = ref();
provinceFk.value = $props.provinceSelected;
const provincesFetchDataRef = ref(); const provincesFetchDataRef = ref();
async function onProvinceCreated(_, data) { async function onProvinceCreated(_, data) {
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } }); await provincesFetchDataRef.value.fetch();
provinceFk.value = data.id; provinceFk.value = data.id;
emit('onProvinceCreated', data); emit('onProvinceCreated', data);
} }
async function handleProvinces(data) {
provincesOptions.value = data;
}
</script> </script>
<template> <template>
<FetchData <FetchData
ref="provincesFetchDataRef" ref="provincesFetchDataRef"
:filter="{ :filter="{ include: { relation: 'country' } }"
include: { relation: 'country' }, @on-fetch="(data) => (provincesOptions = data)"
where: { auto-load
countryFk: $props.countryFk,
},
}"
@on-fetch="handleProvinces"
url="Provinces" url="Provinces"
/> />
<VnSelectDialog <VnSelectDialog
:label="t('Province')" :label="t('Province')"
:options="$props.provinces" :options="provincesOptions"
:tooltip="t('Create province')"
hide-selected hide-selected
v-model="provinceFk" v-model="provinceFk"
:rules="validate && validate('postcode.provinceFk')" :rules="validate && validate('postcode.provinceFk')"
@ -71,15 +49,11 @@ async function handleProvinces(data) {
</QItem> </QItem>
</template> </template>
<template #form> <template #form>
<CreateNewProvinceForm <CreateNewProvinceForm @on-data-saved="onProvinceCreated" />
:country-fk="$props.countryFk"
@on-data-saved="onProvinceCreated"
/>
</template> </template>
</VnSelectDialog> </VnSelectDialog>
</template> </template>
<i18n> <i18n>
es: es:
Province: Provincia Province: Provincia
Create province: Crear provincia
</i18n> </i18n>

View File

@ -11,6 +11,8 @@ import VnInputNumber from 'components/common/VnInputNumber.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'components/common/VnInputTime.vue'; import VnInputTime from 'components/common/VnInputTime.vue';
import VnComponent from 'components/common/VnComponent.vue'; import VnComponent from 'components/common/VnComponent.vue';
import VnDescriptor from 'components/VnTable/VnDescriptor.vue';
import { QBtn } from 'quasar';
import VnUserLink from 'components/ui/VnUserLink.vue'; import VnUserLink from 'components/ui/VnUserLink.vue';
const model = defineModel(undefined, { required: true }); const model = defineModel(undefined, { required: true });
@ -128,6 +130,17 @@ const defaultComponents = {
icon: { icon: {
component: markRaw(QIcon), component: markRaw(QIcon),
}, },
descriptor: {
component: markRaw(VnDescriptor),
attrs: {
class: 'link',
flat: true,
dense: true,
},
forceAttrs: {
row: $props.row,
},
},
userLink: { userLink: {
component: markRaw(VnUserLink), component: markRaw(VnUserLink),
}, },

View File

@ -0,0 +1,49 @@
<script setup>
import { useQuasar } from 'quasar';
const quasar = useQuasar();
import VnComponent from 'components/common/VnComponent.vue';
import { onMounted, ref } from 'vue';
import ItemDescriptor from 'src/pages/Item/Card/ItemDescriptor.vue';
const $props = defineProps({
label: {
type: Function,
required: true,
},
row: {
type: Object,
default: null,
},
proxy: {
type: Object,
default: null,
},
});
const btnRow = ref(null);
const popupVisible = ref(true);
const handleClick = (event) => {
event.preventDefault();
event.stopPropagation();
console.log(event);
popupVisible.value = true;
// quasar.dialog({
// component: $props.proxy.component,
// componentProps: {
// id: $props.row[$props.proxy.key],
// },
// });
};
onMounted(() => {
// btnRow.value = btnRow.value.$el;
});
</script>
<template>
<QBtn class="link" flat dense ref="btnRow" @click="handleClick"
>{{ $props.label($props.row) }}
</QBtn>
<!-- <VnComponent :id="row.itemFk" /> -->
<QPopupProxy :target="btnRow"> <ItemDescriptor :id="1" /></QPopupProxy>
</template>
<style lang="scss"></style>

View File

@ -10,6 +10,8 @@ import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'components/common/VnInputTime.vue'; import VnInputTime from 'components/common/VnInputTime.vue';
import VnTableColumn from 'components/VnTable/VnColumn.vue'; import VnTableColumn from 'components/VnTable/VnColumn.vue';
defineExpose({ addFilter });
const $props = defineProps({ const $props = defineProps({
column: { column: {
type: Object, type: Object,
@ -28,9 +30,6 @@ const $props = defineProps({
default: 'params', default: 'params',
}, },
}); });
defineExpose({ addFilter, props: $props });
const model = defineModel(undefined, { required: true }); const model = defineModel(undefined, { required: true });
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl }); const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
const columnFilter = computed(() => $props.column?.columnFilter); const columnFilter = computed(() => $props.column?.columnFilter);
@ -116,11 +115,11 @@ const components = {
rawSelect: selectComponent, rawSelect: selectComponent,
}; };
async function addFilter(value, name) { async function addFilter(value) {
value ??= undefined; value ??= undefined;
if (value && typeof value === 'object') value = model.value; if (value && typeof value === 'object') value = model.value;
value = value === '' ? undefined : value; value = value === '' ? undefined : value;
let field = columnFilter.value?.name ?? $props.column.name ?? name; let field = columnFilter.value?.name ?? $props.column.name;
if (columnFilter.value?.inWhere) { if (columnFilter.value?.inWhere) {
if (columnFilter.value.alias) field = columnFilter.value.alias + '.' + field; if (columnFilter.value.alias) field = columnFilter.value.alias + '.' + field;

View File

@ -10,7 +10,7 @@ import FormModelPopup from 'components/FormModelPopup.vue';
import VnFilterPanel from 'components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
import VnTableColumn from 'components/VnTable/VnColumn.vue'; import VnTableColumn from 'components/VnTable/VnColumn.vue';
import VnFilter from 'components/VnTable/VnFilter.vue'; import VnTableFilter from 'components/VnTable/VnFilter.vue';
import VnTableChip from 'components/VnTable/VnChip.vue'; import VnTableChip from 'components/VnTable/VnChip.vue';
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue'; import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
@ -53,10 +53,6 @@ const $props = defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
bottom: {
type: Object,
default: null,
},
cardClass: { cardClass: {
type: String, type: String,
default: 'flex-one', default: 'flex-one',
@ -73,6 +69,7 @@ const $props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
hasSubToolbar: { hasSubToolbar: {
type: Boolean, type: Boolean,
default: null, default: null,
@ -101,18 +98,10 @@ const $props = defineProps({
type: String, type: String,
default: '90vh', default: '90vh',
}, },
chipLocale: {
type: String,
default: null,
},
footer: { footer: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
disabledAttr: {
type: Boolean,
default: false,
},
}); });
const { t } = useI18n(); const { t } = useI18n();
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -133,8 +122,6 @@ const showForm = ref(false);
const splittedColumns = ref({ columns: [] }); const splittedColumns = ref({ columns: [] });
const columnsVisibilitySkipped = ref(); const columnsVisibilitySkipped = ref();
const createForm = ref(); const createForm = ref();
const tableFilterRef = ref([]);
const tableRef = ref();
const tableModes = [ const tableModes = [
{ {
@ -237,7 +224,7 @@ function splitColumns(columns) {
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 = { ...col.columnFilter, inWhere: true };
splittedColumns.value.columns.push(col); splittedColumns.value.columns.push(col);
} }
// Status column // Status column
@ -316,20 +303,12 @@ defineExpose({
selected, selected,
CrudModelRef, CrudModelRef,
params, params,
tableRef,
}); });
function handleOnDataSaved(_) { function handleOnDataSaved(_) {
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value }); if (_.onDataSaved) _.onDataSaved(this);
else $props.create.onDataSaved(_); else $props.create.onDataSaved(_);
} }
function handleScroll() {
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
}
</script> </script>
<template> <template>
<QDrawer <QDrawer
@ -347,13 +326,6 @@ function handleScroll() {
:search-url="searchUrl" :search-url="searchUrl"
:redirect="!!redirect" :redirect="!!redirect"
@set-user-params="setUserParams" @set-user-params="setUserParams"
:disable-submit-event="true"
@remove="
(key) =>
tableFilterRef
.find((f) => f.props?.column.name == key)
?.addFilter()
"
> >
<template #body> <template #body>
<div <div
@ -363,8 +335,7 @@ function handleScroll() {
)" )"
:key="col.id" :key="col.id"
> >
<VnFilter <VnTableFilter
ref="tableFilterRef"
:column="col" :column="col"
:data-key="$attrs['data-key']" :data-key="$attrs['data-key']"
v-model="params[columnName(col)]" v-model="params[columnName(col)]"
@ -388,15 +359,10 @@ function handleScroll() {
:columns="splittedColumns.columns" :columns="splittedColumns.columns"
/> />
</template> </template>
<template #tags="{ tag, formatFn }" v-if="chipLocale">
<div class="q-gutter-x-xs">
<strong>{{ t(`${chipLocale}.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
</VnFilterPanel> </VnFilterPanel>
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<!-- class in div to fix warn-->
<CrudModel <CrudModel
v-bind="$attrs" v-bind="$attrs"
:class="$attrs['class'] ?? 'q-px-md'" :class="$attrs['class'] ?? 'q-px-md'"
@ -414,10 +380,8 @@ function handleScroll() {
</template> </template>
<template #body="{ rows }"> <template #body="{ rows }">
<QTable <QTable
ref="tableRef"
v-bind="table" v-bind="table"
class="vnTable" class="vnTable"
:class="{ 'last-row-sticky': $props.footer }"
:columns="splittedColumns.columns" :columns="splittedColumns.columns"
:rows="rows" :rows="rows"
v-model:selected="selected" v-model:selected="selected"
@ -426,14 +390,25 @@ function handleScroll() {
card-container-class="grid-three" card-container-class="grid-three"
flat flat
:style="isTableMode && `max-height: ${tableHeight}`" :style="isTableMode && `max-height: ${tableHeight}`"
:virtual-scroll="isTableMode" :virtual-scroll="!isTableMode"
@virtual-scroll="handleScroll" @virtual-scroll="
(event) =>
event.index > rows.length - 2 &&
($props.crudModel?.paginate ?? true) &&
CrudModelRef.vnPaginateRef.paginate()
"
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)" @row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
@update:selected="emit('update:selected', $event)" @update:selected="emit('update:selected', $event)"
> >
<template #top-left v-if="!$props.withoutHeader"> <template #top-left v-if="!$props.withoutHeader">
<slot name="top-left"></slot> <slot name="top-left"></slot>
</template> </template>
<template #body-selection="props">
<slot name="body-selection" v-bind="props">
<QCheckbox class="q-ma-xs" v-model="props.selected"></QCheckbox>
</slot>
</template>
<template #top-right v-if="!$props.withoutHeader"> <template #top-right v-if="!$props.withoutHeader">
<VnVisibleColumn <VnVisibleColumn
v-if="isTableMode" v-if="isTableMode"
@ -457,11 +432,7 @@ function handleScroll() {
/> />
</template> </template>
<template #header-cell="{ col }"> <template #header-cell="{ col }">
<QTh <QTh v-if="col.visible ?? true">
v-if="col.visible ?? true"
:style="col.headerStyle"
:class="col.headerClass"
>
<div <div
class="column self-start q-ml-xs ellipsis" class="column self-start q-ml-xs ellipsis"
:class="`text-${col?.align ?? 'left'}`" :class="`text-${col?.align ?? 'left'}`"
@ -477,7 +448,7 @@ function handleScroll() {
:search-url="searchUrl" :search-url="searchUrl"
/> />
</div> </div>
<VnFilter <VnTableFilter
v-if="$props.columnSearch" v-if="$props.columnSearch"
:column="col" :column="col"
:show-title="true" :show-title="true"
@ -507,7 +478,6 @@ function handleScroll() {
auto-width auto-width
class="no-margin q-px-xs" class="no-margin q-px-xs"
:class="[getColAlign(col), col.columnClass]" :class="[getColAlign(col), col.columnClass]"
:style="col.style"
v-if="col.visible ?? true" v-if="col.visible ?? true"
@click.ctrl=" @click.ctrl="
($event) => ($event) =>
@ -536,7 +506,6 @@ function handleScroll() {
:class="getColAlign(col)" :class="getColAlign(col)"
class="sticky no-padding" class="sticky no-padding"
@click="stopEventPropagation($event)" @click="stopEventPropagation($event)"
:style="col.style"
> >
<QBtn <QBtn
v-for="(btn, index) of col.actions" v-for="(btn, index) of col.actions"
@ -557,29 +526,6 @@ function handleScroll() {
/> />
</QTd> </QTd>
</template> </template>
<template #bottom v-if="bottom">
<slot name="bottom-table">
<QBtn
@click="
() =>
createAsDialog
? (showForm = !showForm)
: handleOnDataSaved(create)
"
class="cursor-pointer fill-icon"
color="primary"
icon="add_circle"
size="md"
round
flat
shortcut="+"
:disabled="!disabledAttr"
/>
<QTooltip>
{{ createForm.title }}
</QTooltip>
</slot>
</template>
<template #item="{ row, colsMap }"> <template #item="{ row, colsMap }">
<component <component
:is="$props.redirect ? 'router-link' : 'span'" :is="$props.redirect ? 'router-link' : 'span'"
@ -696,15 +642,17 @@ function handleScroll() {
</QCard> </QCard>
</component> </component>
</template> </template>
<template #bottom-row="{ cols }" v-if="$props.footer"> <template #bottom-row="{ cols }" v-if="footer">
<QTr v-if="rows.length" style="height: 30px"> <QTr v-if="rows.length" class="bg-header" style="height: 30px">
<QTh <QTh
v-for="col of cols.filter((cols) => cols.visible ?? true)" v-for="col of cols.filter((cols) => cols.visible ?? true)"
:key="col?.id" :key="col?.id"
class="text-center" class="text-center"
:class="getColAlign(col)"
> >
<slot :name="`column-footer-${col.name}`" /> <slot
:name="`column-footer-${col.name}`"
:class="getColAlign(col)"
/>
</QTh> </QTh>
</QTr> </QTr>
</template> </template>
@ -722,7 +670,7 @@ function handleScroll() {
icon="add" icon="add"
shortcut="+" shortcut="+"
/> />
<QTooltip self="top right"> <QTooltip>
{{ createForm?.title }} {{ createForm?.title }}
</QTooltip> </QTooltip>
</QPageSticky> </QPageSticky>
@ -783,6 +731,16 @@ es:
color: var(--vn-text-color); color: var(--vn-text-color);
} }
.q-table--dark .q-table__bottom,
.q-table--dark thead,
.q-table--dark tr {
border-color: var(--vn-section-color);
}
.q-table__container > div:first-child {
background-color: var(--vn-page-color);
}
.grid-three { .grid-three {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, max-content)); grid-template-columns: repeat(auto-fit, minmax(400px, max-content));
@ -821,7 +779,6 @@ es:
top: 0; top: 0;
} }
} }
.vnTable { .vnTable {
thead tr th { thead tr th {
position: sticky; position: sticky;
@ -857,18 +814,6 @@ es:
background-color: var(--vn-section-color); background-color: var(--vn-section-color);
z-index: 1; z-index: 1;
} }
table tbody th {
position: relative;
}
}
.last-row-sticky {
tbody:nth-last-child(1) {
@extend .bg-header;
position: sticky;
z-index: 2;
bottom: 0;
}
} }
.vn-label-value { .vn-label-value {
@ -914,12 +859,4 @@ es:
cursor: text; cursor: text;
user-select: all; user-select: all;
} }
.q-table__container {
background-color: transparent;
}
.q-table__middle.q-virtual-scroll.q-virtual-scroll--vertical.scroll {
background-color: var(--vn-section-color);
}
</style> </style>

View File

@ -1,19 +0,0 @@
<script setup>
import VnSelect from './VnSelect.vue';
defineProps({
selectProps: { type: Object, required: true },
promise: { type: Function, default: () => {} },
});
</script>
<template>
<QBtnDropdown v-bind="$attrs" color="primary">
<VnSelect
v-bind="selectProps"
hide-selected
hide-dropdown-icon
focus-on-mount
@update:model-value="promise"
/>
</QBtnDropdown>
</template>

View File

@ -1,136 +0,0 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnRow from '../ui/VnRow.vue';
import VnInput from './VnInput.vue';
import FetchData from '../FetchData.vue';
import useNotify from 'src/composables/useNotify';
const props = defineProps({
submitFn: { type: Function, default: () => {} },
askOldPass: { type: Boolean, default: false },
});
const emit = defineEmits(['onSubmit']);
const { t } = useI18n();
const { notify } = useNotify();
const form = ref();
const changePassDialog = ref();
const passwords = ref({ newPassword: null, repeatPassword: null });
const requirements = ref([]);
const isLoading = ref(false);
const validate = async () => {
const { newPassword, repeatPassword, oldPassword } = passwords.value;
if (!newPassword) {
notify(t('You must enter a new password'), 'negative');
return;
}
if (newPassword !== repeatPassword) {
notify(t("Passwords don't match"), 'negative');
return;
}
try {
isLoading.value = true;
await props.submitFn(newPassword, oldPassword);
emit('onSubmit');
} catch (e) {
notify('errors.writeRequest', 'negative');
} finally {
changePassDialog.value.hide();
isLoading.value = false;
}
};
defineExpose({ show: () => changePassDialog.value.show() });
</script>
<template>
<FetchData
url="UserPasswords/findOne"
auto-load
@on-fetch="(data) => (requirements = data)"
/>
<QDialog ref="changePassDialog">
<QCard style="width: 350px">
<QCardSection>
<slot name="header">
<VnRow class="items-center" style="flex-direction: row">
<span class="text-h6" v-text="t('globals.changePass')" />
<QIcon
class="cursor-pointer"
name="close"
size="xs"
style="flex: 0"
v-close-popup
/>
</VnRow>
</slot>
</QCardSection>
<QForm ref="form">
<QCardSection>
<VnInput
v-if="props.askOldPass"
:label="t('Old password')"
v-model="passwords.oldPassword"
type="password"
:required="true"
autofocus
/>
<VnInput
:label="t('New password')"
v-model="passwords.newPassword"
type="password"
:required="true"
:info="
t('passwordRequirements', {
length: requirements.length,
nAlpha: requirements.nAlpha,
nUpper: requirements.nUpper,
nDigits: requirements.nDigits,
nPunct: requirements.nPunct,
})
"
autofocus
/>
<VnInput
:label="t('Repeat password')"
v-model="passwords.repeatPassword"
type="password"
/>
</QCardSection>
</QForm>
<QCardActions>
<slot name="actions">
<QBtn
:disabled="isLoading"
:loading="isLoading"
:label="t('globals.cancel')"
class="q-ml-sm"
color="primary"
flat
type="reset"
v-close-popup
/>
<QBtn
:disabled="isLoading"
:loading="isLoading"
:label="t('globals.confirm')"
color="primary"
@click="validate"
/>
</slot>
</QCardActions>
</QCard>
</QDialog>
</template>
<i18n>
es:
New password: Nueva contraseña
Repeat password: Repetir contraseña
You must enter a new password: Debes introducir la nueva contraseña
Passwords don't match: Las contraseñas no coinciden
</i18n>

View File

@ -1,29 +0,0 @@
<script setup>
const model = defineModel({ type: [String, Number], required: true });
</script>
<template>
<QDate v-model="model" :today-btn="true" :options="$attrs.options" />
</template>
<style lang="scss" scoped>
.q-date {
width: 245px;
min-width: unset;
:deep(.q-date__calendar) {
padding-bottom: 0;
}
:deep(.q-date__view) {
min-height: 245px;
padding: 8px;
}
:deep(.q-date__calendar-days-container) {
min-height: 160px;
height: unset;
}
:deep(.q-date__header) {
padding: 2px 2px 5px 12px;
height: 60px;
}
}
</style>

View File

@ -103,7 +103,6 @@ const mixinRules = [
@click=" @click="
() => { () => {
value = null; value = null;
vnInputRef.focus();
emit('remove'); emit('remove');
} }
" "

View File

@ -3,7 +3,6 @@ import { onMounted, watch, computed, ref } 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 { useAttrs } from 'vue';
import VnDate from './VnDate.vue';
const model = defineModel({ type: [String, Date] }); const model = defineModel({ type: [String, Date] });
const $props = defineProps({ const $props = defineProps({
@ -21,7 +20,6 @@ const { validations } = useValidator();
const { t } = useI18n(); const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val); const requiredFieldRule = (val) => validations().required($attrs.required, val);
const vnInputDateRef = ref(null);
const dateFormat = 'DD/MM/YYYY'; const dateFormat = 'DD/MM/YYYY';
const isPopupOpen = ref(); const isPopupOpen = ref();
@ -86,19 +84,17 @@ const styleAttrs = computed(() => {
outlined: true, outlined: true,
rounded: true, rounded: true,
} }
: {}; : { eventColor: handleEventColor };
}); });
const handleEventColor = (date) => {
const manageDate = (date) => { console.error(date);
formattedDate.value = date; return date === Date.now() ? null : 'orange';
isPopupOpen.value = false;
}; };
</script> </script>
<template> <template>
<div @mouseover="hover = true" @mouseleave="hover = false"> <div @mouseover="hover = true" @mouseleave="hover = false">
<QInput <QInput
ref="vnInputDateRef"
v-model="formattedDate" v-model="formattedDate"
class="vn-input-date" class="vn-input-date"
:mask="mask" :mask="mask"
@ -121,7 +117,6 @@ const manageDate = (date) => {
!$attrs.disable !$attrs.disable
" "
@click=" @click="
vnInputDateRef.focus();
model = null; model = null;
isPopupOpen = false; isPopupOpen = false;
" "
@ -135,7 +130,6 @@ const manageDate = (date) => {
/> />
</template> </template>
<QMenu <QMenu
v-if="$q.screen.gt.xs"
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
v-model="isPopupOpen" v-model="isPopupOpen"
@ -144,11 +138,23 @@ const manageDate = (date) => {
:no-focus="true" :no-focus="true"
:no-parent-event="true" :no-parent-event="true"
> >
<VnDate v-model="popupDate" @update:model-value="manageDate" /> <QDate
v-model="popupDate"
:landscape="true"
:today-btn="true"
:options="$attrs.options"
color="orange"
text-color="black"
dark
bordered
@update:model-value="
(date) => {
formattedDate = date;
isPopupOpen = false;
}
"
/>
</QMenu> </QMenu>
<QDialog v-else v-model="isPopupOpen">
<VnDate v-model="popupDate" @update:model-value="manageDate" />
</QDialog>
</QInput> </QInput>
</div> </div>
</template> </template>
@ -160,6 +166,12 @@ const manageDate = (date) => {
.vn-input-date.q-field--outlined.q-field--readonly .q-field__control:before { .vn-input-date.q-field--outlined.q-field--readonly .q-field__control:before {
border-style: solid; border-style: solid;
} }
.calendar-event {
background-color: red;
&.--today {
border: 2px solid $info;
}
}
</style> </style>
<i18n> <i18n>
es: es:

View File

@ -3,8 +3,6 @@ import { computed, ref, useAttrs } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { date } from 'quasar'; import { date } from 'quasar';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
import VnTime from './VnTime.vue';
const { validations } = useValidator(); const { validations } = useValidator();
const $attrs = useAttrs(); const $attrs = useAttrs();
const model = defineModel({ type: String }); const model = defineModel({ type: String });
@ -18,7 +16,6 @@ const props = defineProps({
default: false, default: false,
}, },
}); });
const vnInputTimeRef = ref(null);
const initialDate = ref(model.value ?? Date.vnNew()); const initialDate = ref(model.value ?? Date.vnNew());
const { t } = useI18n(); const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val); const requiredFieldRule = (val) => validations().required($attrs.required, val);
@ -72,7 +69,6 @@ function dateToTime(newDate) {
<template> <template>
<div @mouseover="hover = true" @mouseleave="hover = false"> <div @mouseover="hover = true" @mouseleave="hover = false">
<QInput <QInput
ref="vnInputTimeRef"
class="vn-input-time" class="vn-input-time"
mask="##:##" mask="##:##"
placeholder="--:--" placeholder="--:--"
@ -96,7 +92,6 @@ function dateToTime(newDate) {
!$attrs.disable !$attrs.disable
" "
@click=" @click="
vnInputTimeRef.focus();
model = null; model = null;
isPopupOpen = false; isPopupOpen = false;
" "
@ -109,7 +104,6 @@ function dateToTime(newDate) {
/> />
</template> </template>
<QMenu <QMenu
v-if="$q.screen.gt.xs"
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
v-model="isPopupOpen" v-model="isPopupOpen"
@ -118,11 +112,8 @@ function dateToTime(newDate) {
:no-focus="true" :no-focus="true"
:no-parent-event="true" :no-parent-event="true"
> >
<VnTime v-model="formattedTime" /> <QTime v-model="formattedTime" mask="HH:mm" landscape now-btn />
</QMenu> </QMenu>
<QDialog v-else v-model="isPopupOpen">
<VnTime v-model="formattedTime" />
</QDialog>
</QInput> </QInput>
</div> </div>
</template> </template>

View File

@ -12,46 +12,14 @@ const props = defineProps({
default: null, default: null,
}, },
}); });
const locationProperties = [
'postcode',
(obj) =>
obj.city
? `${obj.city}${obj.province?.name ? `(${obj.province.name})` : ''}`
: null,
(obj) => obj.country?.name,
];
const formatLocation = (obj, properties) => {
const parts = properties.map((prop) => {
if (typeof prop === 'string') {
return obj[prop];
} else if (typeof prop === 'function') {
return prop(obj);
}
return null;
});
const filteredParts = parts.filter(
(part) => part !== null && part !== undefined && part !== ''
);
return filteredParts.join(', ');
};
const modelValue = ref( const modelValue = ref(
props.location ? formatLocation(props.location, locationProperties) : null props.location
? `${props.location?.postcode}, ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
: null
); );
function showLabel(data) { function showLabel(data) {
const dataProperties = [ return `${data.code}, ${data.town}(${data.province}), ${data.country}`;
'code',
(obj) => (obj.town ? `${obj.town}(${obj.province})` : null),
'country',
];
return formatLocation(data, dataProperties);
} }
const handleModelValue = (data) => { const handleModelValue = (data) => {
emit('update:model-value', data); emit('update:model-value', data);
}; };
@ -73,7 +41,6 @@ const handleModelValue = (data) => {
v-bind="$attrs" v-bind="$attrs"
clearable clearable
:emit-value="false" :emit-value="false"
:tooltip="t('Create new location')"
> >
<template #form> <template #form>
<CreateNewPostcode <CreateNewPostcode
@ -106,9 +73,7 @@ const handleModelValue = (data) => {
<i18n> <i18n>
en: en:
search_by_postalcode: Search by postalcode, town, province or country search_by_postalcode: Search by postalcode, town, province or country
Create new location: Create new location
es: es:
Location: Ubicación Location: Ubicación
Create new location: Crear nueva ubicación
search_by_postalcode: Buscar por código postal, ciudad o país search_by_postalcode: Buscar por código postal, ciudad o país
</i18n> </i18n>

View File

@ -406,7 +406,6 @@ watch(
:skeleton="false" :skeleton="false"
auto-load auto-load
@on-fetch="setLogTree" @on-fetch="setLogTree"
search-url="logs"
> >
<template #body> <template #body>
<div <div

View File

@ -9,6 +9,10 @@ const $props = defineProps({
type: Number, //Progress value (1.0 > x > 0.0) type: Number, //Progress value (1.0 > x > 0.0)
required: true, required: true,
}, },
showDialog: {
type: Boolean,
required: true,
},
cancelled: { cancelled: {
type: Boolean, type: Boolean,
required: false, required: false,
@ -20,22 +24,30 @@ const emit = defineEmits(['cancel', 'close']);
const dialogRef = ref(null); const dialogRef = ref(null);
const showDialog = defineModel('showDialog', { const _showDialog = computed({
type: Boolean, get: () => $props.showDialog,
default: false, set: (value) => {
if (value) dialogRef.value.show();
},
}); });
const _progress = computed(() => $props.progress); const _progress = computed(() => $props.progress);
const progressLabel = computed(() => `${Math.round($props.progress * 100)}%`); const progressLabel = computed(() => `${Math.round($props.progress * 100)}%`);
const cancel = () => {
dialogRef.value.hide();
emit('cancel');
};
</script> </script>
<template> <template>
<QDialog ref="dialogRef" v-model="showDialog" @hide="emit('close')"> <QDialog ref="dialogRef" v-model="_showDialog" @hide="onDialogHide">
<QCard class="full-width dialog"> <QCard class="full-width dialog">
<QCardSection class="row"> <QCardSection class="row">
<span class="text-h6">{{ t('Progress') }}</span> <span class="text-h6">{{ t('Progress') }}</span>
<QSpace /> <QSpace />
<QBtn icon="close" flat round dense v-close-popup /> <QBtn icon="close" flat round dense @click="emit('close')" />
</QCardSection> </QCardSection>
<QCardSection> <QCardSection>
<div class="column"> <div class="column">
@ -68,7 +80,7 @@ const progressLabel = computed(() => `${Math.round($props.progress * 100)}%`);
type="button" type="button"
flat flat
class="text-primary" class="text-primary"
v-close-popup @click="cancel()"
> >
{{ t('globals.cancel') }} {{ t('globals.cancel') }}
</QBtn> </QBtn>

View File

@ -66,6 +66,10 @@ const $props = defineProps({
type: String, type: String,
default: null, default: null,
}, },
orderBy: {
type: String,
default: null,
},
limit: { limit: {
type: [Number, String], type: [Number, String],
default: '30', default: '30',
@ -141,7 +145,6 @@ function findKeyInOptions() {
function setOptions(data) { function setOptions(data) {
myOptions.value = JSON.parse(JSON.stringify(data)); myOptions.value = JSON.parse(JSON.stringify(data));
myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
emit('update:options', data);
} }
function filter(val, options) { function filter(val, options) {
@ -228,8 +231,6 @@ function nullishToTrue(value) {
} }
const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val); const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
defineExpose({ opts: myOptions });
</script> </script>
<template> <template>

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { computed } from 'vue'; import { ref, computed } from 'vue';
import { useRole } from 'src/composables/useRole'; import { useRole } from 'src/composables/useRole';
import { useAcl } from 'src/composables/useAcl'; import { useAcl } from 'src/composables/useAcl';

View File

@ -1,16 +0,0 @@
<script setup>
const model = defineModel({ type: [String, Number], required: true });
</script>
<template>
<QTime v-model="model" now-btn mask="HH:mm" />
</template>
<style lang="scss" scoped>
.q-time {
width: 230px;
min-width: unset;
:deep(.q-time__header) {
min-height: unset;
height: 50px;
}
}
</style>

View File

@ -47,7 +47,6 @@ let store;
let entity; let entity;
const isLoading = ref(false); const isLoading = ref(false);
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName); const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
const menuRef = ref();
defineExpose({ getData }); defineExpose({ getData });
onBeforeMount(async () => { onBeforeMount(async () => {
@ -171,7 +170,7 @@ const toModule = computed(() =>
<QTooltip> <QTooltip>
{{ t('components.cardDescriptor.moreOptions') }} {{ t('components.cardDescriptor.moreOptions') }}
</QTooltip> </QTooltip>
<QMenu :ref="menuRef"> <QMenu ref="menuRef">
<QList> <QList>
<slot name="menu" :entity="entity" :menu-ref="menuRef" /> <slot name="menu" :entity="entity" :menu-ref="menuRef" />
</QList> </QList>

View File

@ -31,7 +31,7 @@ const dialog = ref(null);
<div class="container order-catalog-item overflow-hidden"> <div class="container order-catalog-item overflow-hidden">
<QCard class="card shadow-6"> <QCard class="card shadow-6">
<div class="img-wrapper"> <div class="img-wrapper">
<VnImg :id="item.id" class="image" zoom-resolution="1600x900" /> <VnImg :id="item.id" class="image" />
<div v-if="item.hex && isCatalog" class="item-color-container"> <div v-if="item.hex && isCatalog" class="item-color-container">
<div <div
class="item-color" class="item-color"

View File

@ -55,7 +55,7 @@ async function confirm() {
} }
</script> </script>
<template> <template>
<QDialog ref="dialogRef"> <QDialog ref="dialogRef" persistent>
<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">
<QAvatar <QAvatar
@ -70,7 +70,7 @@ async function confirm() {
<QBtn icon="close" :disable="isLoading" flat round dense v-close-popup /> <QBtn icon="close" :disable="isLoading" flat round dense v-close-popup />
</QCardSection> </QCardSection>
<QCardSection class="q-pb-none"> <QCardSection class="q-pb-none">
<span v-if="message !== false" v-html="message" /> <span id="spanHTML" v-if="message !== false" v-html="message" />
</QCardSection> </QCardSection>
<QCardSection class="row items-center q-pt-none"> <QCardSection class="row items-center q-pt-none">
<slot name="customHTML"></slot> <slot name="customHTML"></slot>

View File

@ -3,6 +3,7 @@ import { onMounted, ref, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { date } from 'quasar';
import toDate from 'filters/toDate'; import toDate from 'filters/toDate';
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue'; import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
@ -58,6 +59,7 @@ const $props = defineProps({
}); });
defineExpose({ search, sanitizer }); defineExpose({ search, sanitizer });
const emit = defineEmits([ const emit = defineEmits([
'update:modelValue', 'update:modelValue',
'refresh', 'refresh',
@ -185,6 +187,7 @@ async function remove(key) {
} }
function formatValue(value) { function formatValue(value) {
if (value instanceof Date) return date.formatDate(value, 'DD/MM/YYYY');
if (typeof value === 'boolean') return value ? t('Yes') : t('No'); if (typeof value === 'boolean') return value ? t('Yes') : t('No');
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value); if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
@ -211,7 +214,7 @@ function sanitizer(params) {
icon="search" icon="search"
@click="search()" @click="search()"
></QBtn> ></QBtn>
<QForm @submit="search" id="filterPanelForm" @keyup.enter="search()"> <QForm @submit="search" id="filterPanelForm">
<QList dense> <QList dense>
<QItem class="q-mt-xs"> <QItem class="q-mt-xs">
<QItemSection top> <QItemSection top>

View File

@ -58,7 +58,7 @@ defineExpose({
:class="{ zoomIn: zoom }" :class="{ zoomIn: zoom }"
:src="getUrl()" :src="getUrl()"
v-bind="$attrs" v-bind="$attrs"
@click.stop="show = $props.zoom" @click.stop="show = $props.zoom ? true : false"
spinner-color="primary" spinner-color="primary"
/> />
<QDialog v-if="$props.zoom" v-model="show"> <QDialog v-if="$props.zoom" v-model="show">
@ -85,4 +85,8 @@ defineExpose({
.img_zoom { .img_zoom {
border-radius: 0%; border-radius: 0%;
} }
.image-wrapper {
height: 50px;
width: 50px;
}
</style> </style>

View File

@ -88,4 +88,15 @@ const val = computed(() => $props.value);
:deep(.q-checkbox.disabled) { :deep(.q-checkbox.disabled) {
opacity: 1 !important; opacity: 1 !important;
} }
.image {
display: flex;
flex-direction: row;
align-content: center;
align-items: center;
justify-content: flex-start;
& > .q-btn .value {
text-transform: uppercase;
}
}
</style> </style>

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { ref, reactive } from 'vue'; import { ref } from 'vue';
import { onBeforeRouteLeave } from 'vue-router'; import { onBeforeRouteLeave } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -12,40 +12,36 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
import VnUserLink from 'components/ui/VnUserLink.vue'; import VnUserLink from 'components/ui/VnUserLink.vue';
import VnConfirm from 'components/ui/VnConfirm.vue'; import VnConfirm from 'components/ui/VnConfirm.vue';
import VnAvatar from 'components/ui/VnAvatar.vue'; import VnAvatar from 'components/ui/VnAvatar.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelect from 'components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
import VnInput from 'components/common/VnInput.vue';
const $props = defineProps({ const $props = defineProps({
url: { type: String, default: null }, url: { type: String, default: null },
filter: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} },
body: { type: Object, default: () => {} }, body: { type: Object, default: () => {} },
addNote: { type: Boolean, default: false }, addNote: { type: Boolean, default: false },
selectType: { type: Boolean, default: false },
}); });
const { t } = useI18n(); const { t } = useI18n();
const state = useState(); const state = useState();
const quasar = useQuasar(); const quasar = useQuasar();
const currentUser = ref(state.getUser()); const currentUser = ref(state.getUser());
const newNote = reactive({ text: null, observationTypeFk: null }); const newNote = ref('');
const observationTypes = ref([]);
const vnPaginateRef = ref(); const vnPaginateRef = ref();
function handleKeyUp(event) {
if (event.key === 'Enter') {
event.preventDefault();
if (!event.shiftKey) insert();
}
}
async function insert() { async function insert() {
if (!newNote.text || ($props.selectType && !newNote.observationTypeFk)) return;
const body = $props.body; const body = $props.body;
const newBody = { const newBody = { ...body, ...{ text: newNote.value } };
...body,
...{ text: newNote.text, observationTypeFk: newNote.observationTypeFk },
};
await axios.post($props.url, newBody); await axios.post($props.url, newBody);
await vnPaginateRef.value.fetch(); await vnPaginateRef.value.fetch();
newNote.value = '';
} }
onBeforeRouteLeave((to, from, next) => { onBeforeRouteLeave((to, from, next) => {
if (newNote.text) if (newNote.value)
quasar.dialog({ quasar.dialog({
component: VnConfirm, component: VnConfirm,
componentProps: { componentProps: {
@ -58,13 +54,6 @@ onBeforeRouteLeave((to, from, next) => {
}); });
</script> </script>
<template> <template>
<FetchData
v-if="selectType"
url="ObservationTypes"
:filter="{ fields: ['id', 'description'] }"
auto-load
@on-fetch="(data) => (observationTypes = data)"
/>
<QCard class="q-pa-xs q-mb-xl full-width" v-if="$props.addNote"> <QCard class="q-pa-xs q-mb-xl full-width" v-if="$props.addNote">
<QCardSection horizontal> <QCardSection horizontal>
<VnAvatar :worker-id="currentUser.id" size="md" /> <VnAvatar :worker-id="currentUser.id" size="md" />
@ -73,28 +62,18 @@ onBeforeRouteLeave((to, from, next) => {
{{ t('globals.now') }} {{ t('globals.now') }}
</div> </div>
</QCardSection> </QCardSection>
<QCardSection class="q-px-xs q-my-none q-py-none"> <QCardSection class="q-pa-xs q-my-none q-py-none" horizontal>
<VnRow class="full-width"> <QInput
<VnSelect v-model="newNote"
:label="t('Observation type')" class="full-width"
v-if="selectType"
url="ObservationTypes"
v-model="newNote.observationTypeFk"
option-label="description"
style="flex: 0.15"
:required="true"
@keyup.enter.stop="insert"
/>
<VnInput
v-model.trim="newNote.text"
type="textarea" type="textarea"
:label="t('Add note here...')" :label="t('Add note here...')"
filled filled
size="lg" size="lg"
autogrow autogrow
@keyup.enter.stop="insert" autofocus
@keyup="handleKeyUp"
clearable clearable
:required="true"
> >
<template #append> <template #append>
<QBtn <QBtn
@ -103,12 +82,9 @@ onBeforeRouteLeave((to, from, next) => {
color="primary" color="primary"
flat flat
@click="insert" @click="insert"
class="q-mb-xs"
dense
/> />
</template> </template>
</VnInput> </QInput>
</VnRow>
</QCardSection> </QCardSection>
</QCard> </QCard>
<VnPaginate <VnPaginate
@ -122,10 +98,6 @@ onBeforeRouteLeave((to, from, next) => {
class="show" class="show"
v-bind="$attrs" v-bind="$attrs"
search-url="notes" search-url="notes"
@on-fetch="
newNote.text = '';
newNote.observationTypeFk = null;
"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<TransitionGroup name="list" tag="div" class="column items-center full-width"> <TransitionGroup name="list" tag="div" class="column items-center full-width">
@ -139,28 +111,13 @@ onBeforeRouteLeave((to, from, next) => {
:descriptor="false" :descriptor="false"
:worker-id="note.workerFk" :worker-id="note.workerFk"
size="md" size="md"
:title="note.worker?.user.nickname"
/> />
<div class="full-width row justify-between q-pa-xs"> <div class="full-width row justify-between q-pa-xs">
<div>
<VnUserLink <VnUserLink
:name="`${note.worker.user.nickname}`" :name="`${note.worker.user.nickname}`"
:worker-id="note.worker.id" :worker-id="note.worker.id"
/> />
<QBadge {{ toDateHourMin(note.created) }}
class="q-ml-xs"
outline
color="grey"
v-if="selectType && note.observationTypeFk"
>
{{
observationTypes.find(
(ot) => ot.id === note.observationTypeFk
)?.description
}}
</QBadge>
</div>
<span v-text="toDateHourMin(note.created)" />
</div> </div>
</QCardSection> </QCardSection>
<QCardSection class="q-pa-xs q-my-none q-py-none"> <QCardSection class="q-pa-xs q-my-none q-py-none">
@ -174,6 +131,12 @@ onBeforeRouteLeave((to, from, next) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.q-card { .q-card {
width: 90%; width: 90%;
@media (max-width: $breakpoint-sm) {
width: 100%;
}
&__section {
word-wrap: break-word;
}
} }
.q-dialog .q-card { .q-dialog .q-card {
width: 400px; width: 400px;
@ -187,28 +150,11 @@ onBeforeRouteLeave((to, from, next) => {
opacity: 0; opacity: 0;
background-color: $primary; background-color: $primary;
} }
.vn-row > :nth-child(2) {
margin-left: 0;
}
@media (max-width: $breakpoint-xs) {
.vn-row > :deep(*) {
margin-left: 0;
}
.q-card {
width: 100%;
&__section {
padding: 0;
}
}
}
</style> </style>
<i18n> <i18n>
es: es:
Add note here...: Añadir nota aquí... Add note here...: Añadir nota aquí...
New note: Nueva nota New note: Nueva nota
Save (Enter): Guardar (Intro) Save (Enter): Guardar (Intro)
Observation type: Tipo de observación
</i18n> </i18n>

View File

@ -6,6 +6,10 @@ import { useArrayData } from 'composables/useArrayData';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
append: {
type: Boolean,
default: true,
},
dataKey: { dataKey: {
type: String, type: String,
required: true, required: true,
@ -56,7 +60,7 @@ const props = defineProps({
}, },
offset: { offset: {
type: Number, type: Number,
default: undefined, default: 0,
}, },
skeleton: { skeleton: {
type: Boolean, type: Boolean,
@ -119,9 +123,10 @@ watch(
); );
watch( watch(
() => [props.url, props.filter], () => [props.url, props.filter, props.userParams],
([url, filter]) => mounted.value && fetch({ url, filter }) ([url, filter, userParams]) => mounted.value && fetch({ url, filter, userParams })
); );
const addFilter = async (filter, params) => { const addFilter = async (filter, params) => {
await arrayData.addFilter({ filter, params }); await arrayData.addFilter({ filter, params });
}; };
@ -181,7 +186,7 @@ defineExpose({ fetch, addFilter, paginate });
</script> </script>
<template> <template>
<div class="full-width"> <div v-if="append" class="full-width">
<div <div
v-if="!props.autoLoad && !store.data && !isLoading" v-if="!props.autoLoad && !store.data && !isLoading"
class="info-row q-pa-md text-center" class="info-row q-pa-md text-center"

View File

@ -108,7 +108,6 @@ async function search() {
...Object.fromEntries(staticParams), ...Object.fromEntries(staticParams),
search: searchText.value, search: searchText.value,
}, },
...{ filter: props.filter },
}; };
if (props.whereFilter) { if (props.whereFilter) {

View File

@ -0,0 +1,42 @@
<!-- src/components/StockValueDisplay.vue -->
<template>
<span :class="valueClass">
<QIcon :name="iconName" size="sm" class="value-icon" />
{{ formattedValue }}
</span>
</template>
<script setup>
import { computed } from 'vue';
import { useQuasar } from 'quasar';
const props = defineProps({
value: {
type: Number,
required: true,
},
});
const valueClass = computed(() =>
props.value === 0 ? 'neutral' : props.value > 0 ? 'positive' : 'negative'
);
const iconName = computed(() =>
props.value === 0 ? 'equal' : props.value > 0 ? 'arrow_upward' : 'arrow_downward'
);
const formattedValue = computed(() => props.value);
</script>
<style scoped>
.positive {
color: green;
}
.negative {
color: red;
}
.neutral {
color: orange;
}
.value-icon {
margin-right: 4px;
}
</style>

View File

@ -1,33 +0,0 @@
<script setup>
import { useRoute } from 'vue-router';
import { defineProps } from 'vue';
const props = defineProps({
routeName: {
type: String,
required: true,
},
entityId: {
type: [String, Number],
required: true,
},
url: {
type: String,
default: null,
},
});
const route = useRoute();
const id = props.entityId;
</script>
<template>
<router-link
v-if="route?.name !== routeName"
:to="{ name: routeName, params: { id: id } }"
class="header link"
:href="url"
>
<QIcon name="open_in_new" color="white" size="sm" />
</router-link>
</template>

View File

@ -1,55 +0,0 @@
<script setup>
import { defineProps, ref } from 'vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps({
usesMana: {
type: Boolean,
required: true,
},
manaCode: {
type: String,
required: true,
},
manaVal: {
type: String,
default: 'mana',
},
manaLabel: {
type: String,
default: 'Promotion mana',
},
manaClaimVal: {
type: String,
default: 'manaClaim',
},
claimLabel: {
type: String,
default: 'Claim mana',
},
});
const manaCode = ref(props.manaCode);
</script>
<template>
<div class="column q-gutter-y-sm q-mt-sm">
<QRadio
v-model="manaCode"
dense
:val="manaVal"
:label="t(manaLabel)"
:dark="true"
class="q-mb-sm"
/>
<QRadio
v-model="manaCode"
dense
:val="manaClaimVal"
:label="t(claimLabel)"
:dark="true"
class="q-mb-sm"
/>
</div>
</template>

View File

@ -26,8 +26,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
const params = JSON.parse(query[searchUrl]); const params = JSON.parse(query[searchUrl]);
const filter = params?.filter && JSON.parse(params?.filter ?? '{}'); const filter = params?.filter && JSON.parse(params?.filter ?? '{}');
delete params.filter; delete params.filter;
store.userParams = { ...params, ...store.userParams };
store.userParams = { ...store.userParams, ...params };
store.userFilter = { ...filter, ...store.userFilter }; store.userFilter = { ...filter, ...store.userFilter };
if (filter?.order) store.order = filter.order; if (filter?.order) store.order = filter.order;
} }
@ -114,7 +113,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
for (const row of response.data) store.data.push(row); for (const row of response.data) store.data.push(row);
} else { } else {
store.data = response.data; store.data = response.data;
if (!document.querySelectorAll('[role="dialog"][aria-modal="true"]').length) if (!document.querySelectorAll('[role="dialog"]').length)
updateRouter && updateStateParams(); updateRouter && updateStateParams();
} }

View File

@ -27,6 +27,15 @@ export function useRole() {
return false; return false;
} }
function likeAny(roles) {
const roleStore = state.getRoles();
for (const role of roles) {
if (!roleStore.value.findIndex((rs) => rs.startsWith(role)) !== -1)
return true;
}
return false;
}
function isEmployee() { function isEmployee() {
return hasAny(['employee']); return hasAny(['employee']);
} }
@ -35,6 +44,7 @@ export function useRole() {
isEmployee, isEmployee,
fetch, fetch,
hasAny, hasAny,
likeAny,
state, state,
}; };
} }

View File

@ -212,6 +212,16 @@ input::-webkit-inner-spin-button {
max-width: 100%; max-width: 100%;
} }
.remove-bg {
filter: brightness(1.1);
mix-blend-mode: multiply;
}
.remove-bg {
filter: brightness(1.1);
mix-blend-mode: multiply;
}
.q-table__container { .q-table__container {
/* ===== Scrollbar CSS ===== / /* ===== Scrollbar CSS ===== /
/ Firefox */ / Firefox */
@ -288,7 +298,3 @@ input::-webkit-inner-spin-button {
color: $info; color: $info;
} }
} }
.no-visible {
visibility: hidden;
}

View File

@ -13,7 +13,7 @@
// Tip: Use the "Theme Builder" on Quasar's documentation website. // Tip: Use the "Theme Builder" on Quasar's documentation website.
// Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors // Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors
$primary: #ec8916; $primary: #ec8916;
$secondary: $primary; $secondary: #89be34;
$positive: #c8e484; $positive: #c8e484;
$negative: #fb5252; $negative: #fb5252;
$info: #84d0e2; $info: #84d0e2;

View File

View File

@ -4,7 +4,7 @@ export default function toHour(date) {
if (!isValidDate(date)) { if (!isValidDate(date)) {
return '--:--'; return '--:--';
} }
return new Date(date || '').toLocaleTimeString([], { return (new Date(date || '')).toLocaleTimeString([], {
hour: '2-digit', hour: '2-digit',
minute: '2-digit', minute: '2-digit',
}); });

View File

@ -7,6 +7,7 @@ globals:
entity: Entity entity: Entity
user: User user: User
details: Details details: Details
Preview: Preview
collapseMenu: Collapse left menu collapseMenu: Collapse left menu
backToDashboard: Return to dashboard backToDashboard: Return to dashboard
notifications: Notifications notifications: Notifications
@ -22,6 +23,7 @@ globals:
search: Search search: Search
changes: Changes changes: Changes
dataCreated: Data created dataCreated: Data created
split: Split
add: Add add: Add
create: Create create: Create
edit: Edit edit: Edit
@ -34,6 +36,7 @@ globals:
clone: Clone clone: Clone
confirm: Confirm confirm: Confirm
assign: Assign assign: Assign
replace: Replace
back: Back back: Back
downloadPdf: Download PDF downloadPdf: Download PDF
yes: 'Yes' yes: 'Yes'
@ -50,7 +53,6 @@ globals:
summary: summary:
basicData: Basic data basicData: Basic data
daysOnward: Days onward daysOnward: Days onward
daysAgo: Days ago
today: Today today: Today
yesterday: Yesterday yesterday: Yesterday
dateFormat: en-GB dateFormat: en-GB
@ -65,6 +67,7 @@ globals:
shipped: Shipped shipped: Shipped
totalEntries: Total entries totalEntries: Total entries
amount: Amount amount: Amount
removeSelection: Clear selection
packages: Packages packages: Packages
download: Download download: Download
selectRows: 'Select all { numberRows } row(s)' selectRows: 'Select all { numberRows } row(s)'
@ -76,6 +79,7 @@ globals:
type: Type type: Type
reason: reason reason: reason
noResults: No results noResults: No results
results: results
system: System system: System
notificationSent: Notification sent notificationSent: Notification sent
warehouse: Warehouse warehouse: Warehouse
@ -105,7 +109,6 @@ globals:
campaign: Campaign campaign: Campaign
weight: Weight weight: Weight
error: Ups! Something went wrong error: Ups! Something went wrong
recalc: Recalculate
pageTitles: pageTitles:
logIn: Login logIn: Login
addressEdit: Update address addressEdit: Update address
@ -113,10 +116,11 @@ globals:
basicData: Basic data basicData: Basic data
log: Logs log: Logs
parkingList: Parkings list parkingList: Parkings list
agencyList: Agencies agencyList: Agencies list
agency: Agency agency: Agency
workCenters: Work centers workCenters: Work centers
modes: Modes modes: Modes
negative: Tickets negative
zones: Zones zones: Zones
zonesList: Zones zonesList: Zones
deliveryDays: Delivery days deliveryDays: Delivery days
@ -137,7 +141,7 @@ globals:
fiscalData: Fiscal data fiscalData: Fiscal data
billingData: Billing data billingData: Billing data
consignees: Consignees consignees: Consignees
address-create: New address 'address-create': New address
notes: Notes notes: Notes
credits: Credits credits: Credits
greuges: Greuges greuges: Greuges
@ -209,7 +213,7 @@ globals:
roadmap: Roadmap roadmap: Roadmap
stops: Stops stops: Stops
routes: Routes routes: Routes
cmrsList: CMRs cmrsList: CMRs list
RouteList: List RouteList: List
routeCreate: New route routeCreate: New route
RouteRoadmap: Roadmaps RouteRoadmap: Roadmaps
@ -223,7 +227,6 @@ globals:
pictures: Pictures pictures: Pictures
packages: Packages packages: Packages
tracking: Tracking tracking: Tracking
labeler: Labeler
supplierCreate: New supplier supplierCreate: New supplier
accounts: Accounts accounts: Accounts
addresses: Addresses addresses: Addresses
@ -275,9 +278,6 @@ globals:
clientsActionsMonitor: Clients and actions clientsActionsMonitor: Clients and actions
serial: Serial serial: Serial
medical: Mutual medical: Mutual
RouteExtendedList: Router
wasteRecalc: Waste recaclulate
operator: Operator
supplier: Supplier supplier: Supplier
created: Created created: Created
worker: Worker worker: Worker
@ -293,10 +293,7 @@ globals:
createInvoiceIn: Create invoice in createInvoiceIn: Create invoice in
myAccount: My account myAccount: My account
noOne: No one noOne: No one
maxTemperature: Max
minTemperature: Min
params: params:
id: ID
clientFk: Client id clientFk: Client id
salesPersonFk: Sales person salesPersonFk: Sales person
warehouseFk: Warehouse warehouseFk: Warehouse
@ -304,21 +301,12 @@ globals:
from: From from: From
To: To To: To
stateFk: State stateFk: State
email: Email
SSN: SSN
fi: FI
myTeam: My team
departmentFk: Department
changePass: Change password
deleteConfirmTitle: Delete selected elements
changeState: Change state
errors: errors:
statusUnauthorized: Access denied statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred statusInternalServerError: An internal server error has ocurred
statusBadGateway: It seems that the server has fall down statusBadGateway: It seems that the server has fall down
statusGatewayTimeout: Could not contact the server statusGatewayTimeout: Could not contact the server
userConfig: Error fetching user config userConfig: Error fetching user config
updateUserConfig: Error updating user config
tokenConfig: Error fetching token config tokenConfig: Error fetching token config
writeRequest: The requested operation could not be completed writeRequest: The requested operation could not be completed
login: login:
@ -489,6 +477,7 @@ ticket:
notes: Notes notes: Notes
sale: Sale sale: Sale
dms: File management dms: File management
negative: Tickets negative
volume: Volume volume: Volume
observation: Notes observation: Notes
ticketAdvance: Advance tickets ticketAdvance: Advance tickets
@ -512,8 +501,6 @@ ticket:
warehouse: Warehouse warehouse: Warehouse
customerCard: Customer card customerCard: Customer card
alias: Alias alias: Alias
ticketList: Ticket List
newOrder: New Order
boxing: boxing:
expedition: Expedition expedition: Expedition
item: Item item: Item
@ -535,7 +522,6 @@ ticket:
landed: Landed landed: Landed
consigneePhone: Consignee phone consigneePhone: Consignee phone
consigneeMobile: Consignee mobile consigneeMobile: Consignee mobile
consigneeAddress: Consignee address
clientPhone: Client phone clientPhone: Client phone
clientMobile: Client mobile clientMobile: Client mobile
consignee: Consignee consignee: Consignee
@ -558,17 +544,13 @@ ticket:
package: Package package: Package
taxClass: Tax class taxClass: Tax class
services: Services services: Services
changeState: Change state
requester: Requester requester: Requester
atender: Atender atender: Atender
request: Request request: Request
weight: Weight weight: Weight
goTo: Go to goTo: Go to
summaryAmount: Summary summaryAmount: Summary
purchaseRequest: Purchase request
service: Service
description: Description
attender: Attender
ok: Ok
create: create:
client: Client client: Client
address: Address address: Address
@ -592,6 +574,7 @@ invoiceOut:
client: Client client: Client
company: Company company: Company
customerCard: Customer card customerCard: Customer card
ticketList: Ticket List
summary: summary:
issued: Issued issued: Issued
created: Created created: Created
@ -745,7 +728,6 @@ worker:
locker: Locker locker: Locker
balance: Balance balance: Balance
medical: Medical medical: Medical
operator: Operator
list: list:
name: Name name: Name
email: Email email: Email
@ -818,14 +800,14 @@ worker:
bankEntity: Swift / BIC bankEntity: Swift / BIC
formation: formation:
tableVisibleColumns: tableVisibleColumns:
course: Course course: Curso
startDate: Start date startDate: Fecha Inicio
endDate: End date endDate: Fecha Fin
center: Training center center: Centro Formación
invoice: Invoice invoice: Factura
amount: Amount amount: Importe
remark: Remark remark: Bonficado
hasDiploma: Has diploma hasDiploma: Diploma
medical: medical:
tableVisibleColumns: tableVisibleColumns:
date: Date date: Date
@ -843,18 +825,6 @@ worker:
debit: Debt debit: Debt
credit: Have credit: Have
concept: Concept concept: Concept
operator:
numberOfWagons: Number of wagons
train: Train
itemPackingType: Item packing type
warehouse: Warehouse
sector: Sector
labeler: Printer
linesLimit: Lines limit
volumeLimit: Volume limit
sizeLimit: Size limit
isOnReservationMode: Reservation mode
machine: Machine
wagon: wagon:
pageTitles: pageTitles:
wagons: Wagons wagons: Wagons
@ -894,7 +864,34 @@ wagon:
minHeightBetweenTrays: 'The minimum height between trays is ' minHeightBetweenTrays: 'The minimum height between trays is '
maxWagonHeight: 'The maximum height of the wagon is ' maxWagonHeight: 'The maximum height of the wagon is '
uncompleteTrays: There are incomplete trays uncompleteTrays: There are incomplete trays
route:
pageTitles:
agency: Agency List
routes: Routes
cmrsList: CMRs list
RouteList: List
routeCreate: New route
basicData: Basic Data
summary: Summary
RouteRoadmap: Roadmaps
RouteRoadmapCreate: Create roadmap
tickets: Tickets
log: Log
autonomous: Autonomous
cmr:
list:
results: results
cmrFk: CMR id
hasCmrDms: Attached in gestdoc
'true': 'Yes'
'false': 'No'
ticketFk: Ticketd id
routeFk: Route id
country: Country
clientFk: Client id
shipped: Preparation date
viewCmr: View CMR
downloadCmrs: Download CMRs
supplier: supplier:
list: list:
payMethod: Pay method payMethod: Pay method
@ -1009,7 +1006,6 @@ travel:
warehouseOut: Warehouse out warehouseOut: Warehouse out
totalEntries: Total entries totalEntries: Total entries
totalEntriesTooltip: Total entries totalEntriesTooltip: Total entries
daysOnward: Landed days onwards
summary: summary:
confirmed: Confirmed confirmed: Confirmed
entryId: Entry Id entryId: Entry Id

View File

@ -7,6 +7,7 @@ globals:
entity: Entidad entity: Entidad
user: Usuario user: Usuario
details: Detalles details: Detalles
preview: Vista previa
collapseMenu: Contraer menú lateral collapseMenu: Contraer menú lateral
backToDashboard: Volver al tablón backToDashboard: Volver al tablón
notifications: Notificaciones notifications: Notificaciones
@ -29,11 +30,13 @@ globals:
saveAndContinue: Guardar y continuar saveAndContinue: Guardar y continuar
remove: Eliminar remove: Eliminar
reset: Restaurar reset: Restaurar
refresh: Actualizar
close: Cerrar close: Cerrar
cancel: Cancelar cancel: Cancelar
clone: Clonar clone: Clonar
confirm: Confirmar confirm: Confirmar
assign: Asignar assign: Asignar
replace: Sustituir
back: Volver back: Volver
yes: Si yes: Si
no: No no: No
@ -46,10 +49,10 @@ globals:
rowRemoved: Fila eliminada rowRemoved: Fila eliminada
pleaseWait: Por favor espera... pleaseWait: Por favor espera...
noPinnedModules: No has fijado ningún módulo noPinnedModules: No has fijado ningún módulo
split: Split
summary: summary:
basicData: Datos básicos basicData: Datos básicos
daysOnward: Días adelante daysOnward: Días adelante
daysAgo: Días atras
today: Hoy today: Hoy
yesterday: Ayer yesterday: Ayer
dateFormat: es-ES dateFormat: es-ES
@ -64,7 +67,7 @@ globals:
shipped: F. envío shipped: F. envío
totalEntries: Ent. totales totalEntries: Ent. totales
amount: Importe amount: Importe
packages: Embalajes packages: Bultos
download: Descargar download: Descargar
downloadPdf: Descargar PDF downloadPdf: Descargar PDF
selectRows: 'Seleccionar las { numberRows } filas(s)' selectRows: 'Seleccionar las { numberRows } filas(s)'
@ -73,8 +76,10 @@ globals:
requiredField: Campo obligatorio requiredField: Campo obligatorio
class: clase class: clase
type: Tipo type: Tipo
reason: motivo reason: Motivo
removeSelection: Eliminar selección
noResults: Sin resultados noResults: Sin resultados
results: resultados
system: Sistema system: Sistema
notificationSent: Notificación enviada notificationSent: Notificación enviada
warehouse: Almacén warehouse: Almacén
@ -101,13 +106,11 @@ globals:
from: Desde from: Desde
to: Hasta to: Hasta
notes: Notas notes: Notas
refresh: Actualizar
item: Artículo item: Artículo
ticket: Ticket ticket: Ticket
campaign: Campaña campaign: Campaña
weight: Peso weight: Peso
error: ¡Ups! Algo salió mal error: ¡Ups! Algo salió mal
recalc: Recalcular
pageTitles: pageTitles:
logIn: Inicio de sesión logIn: Inicio de sesión
addressEdit: Modificar consignatario addressEdit: Modificar consignatario
@ -115,10 +118,11 @@ globals:
basicData: Datos básicos basicData: Datos básicos
log: Historial log: Historial
parkingList: Listado de parkings parkingList: Listado de parkings
agencyList: Agencias agencyList: Listado de agencias
agency: Agencia agency: Agencia
workCenters: Centros de trabajo workCenters: Centros de trabajo
modes: Modos modes: Modos
negative: Tickets negativos
zones: Zonas zones: Zonas
zonesList: Zonas zonesList: Zonas
deliveryDays: Días de entrega deliveryDays: Días de entrega
@ -190,7 +194,6 @@ globals:
invoiceIns: Fact. recibidas invoiceIns: Fact. recibidas
invoiceInCreate: Crear fact. recibida invoiceInCreate: Crear fact. recibida
vat: IVA vat: IVA
labeler: Etiquetas
dueDay: Vencimiento dueDay: Vencimiento
intrastat: Intrastat intrastat: Intrastat
corrective: Rectificativa corrective: Rectificativa
@ -213,13 +216,12 @@ globals:
roadmap: Troncales roadmap: Troncales
stops: Paradas stops: Paradas
routes: Rutas routes: Rutas
cmrsList: CMRs cmrsList: Listado de CMRs
RouteList: Listado RouteList: Listado
routeCreate: Nueva ruta routeCreate: Nueva ruta
RouteRoadmap: Troncales RouteRoadmap: Troncales
RouteRoadmapCreate: Crear troncal RouteRoadmapCreate: Crear troncal
autonomous: Autónomos autonomous: Autónomos
RouteExtendedList: Enrutador
suppliers: Proveedores suppliers: Proveedores
supplier: Proveedor supplier: Proveedor
supplierCreate: Nuevo proveedor supplierCreate: Nuevo proveedor
@ -270,7 +272,7 @@ globals:
tracking: Estados tracking: Estados
components: Componentes components: Componentes
pictures: Fotos pictures: Fotos
packages: Embalajes packages: Bultos
ldap: LDAP ldap: LDAP
samba: Samba samba: Samba
twoFactor: Doble factor twoFactor: Doble factor
@ -280,8 +282,6 @@ globals:
clientsActionsMonitor: Clientes y acciones clientsActionsMonitor: Clientes y acciones
serial: Facturas por serie serial: Facturas por serie
medical: Mutua medical: Mutua
wasteRecalc: Recalcular mermas
operator: Operario
supplier: Proveedor supplier: Proveedor
created: Fecha creación created: Fecha creación
worker: Trabajador worker: Trabajador
@ -297,10 +297,7 @@ globals:
createInvoiceIn: Crear factura recibida createInvoiceIn: Crear factura recibida
myAccount: Mi cuenta myAccount: Mi cuenta
noOne: Nadie noOne: Nadie
maxTemperature: Máx
minTemperature: Mín
params: params:
id: Id
clientFk: Id cliente clientFk: Id cliente
salesPersonFk: Comercial salesPersonFk: Comercial
warehouseFk: Almacén warehouseFk: Almacén
@ -308,21 +305,12 @@ globals:
from: Desde from: Desde
To: Hasta To: Hasta
stateFk: Estado stateFk: Estado
departmentFk: Departamento
email: Correo
SSN: NSS
fi: NIF
myTeam: Mi equipo
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado
errors: errors:
statusUnauthorized: Acceso denegado statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor statusInternalServerError: Ha ocurrido un error interno del servidor
statusBadGateway: Parece ser que el servidor ha caído statusBadGateway: Parece ser que el servidor ha caído
statusGatewayTimeout: No se ha podido contactar con el servidor statusGatewayTimeout: No se ha podido contactar con el servidor
userConfig: Error al obtener configuración de usuario userConfig: Error al obtener configuración de usuario
updateUserConfig: Error al actualizar la configuración de usuario
tokenConfig: Error al obtener configuración de token tokenConfig: Error al obtener configuración de token
writeRequest: No se pudo completar la operación solicitada writeRequest: No se pudo completar la operación solicitada
login: login:
@ -491,6 +479,7 @@ ticket:
notes: Notas notes: Notas
sale: Lineas del pedido sale: Lineas del pedido
dms: Gestión documental dms: Gestión documental
negative: Tickets negativos
volume: Volumen volume: Volumen
observation: Notas observation: Notas
ticketAdvance: Adelantar tickets ticketAdvance: Adelantar tickets
@ -503,7 +492,7 @@ ticket:
tracking: Estados tracking: Estados
components: Componentes components: Componentes
pictures: Fotos pictures: Fotos
packages: Embalajes packages: Bultos
list: list:
nickname: Alias nickname: Alias
state: Estado state: Estado
@ -521,8 +510,6 @@ ticket:
warehouse: Almacén warehouse: Almacén
customerCard: Ficha del cliente customerCard: Ficha del cliente
alias: Alias alias: Alias
ticketList: Listado de tickets
newOrder: Nuevo pedido
boxing: boxing:
expedition: Expedición expedition: Expedición
item: Artículo item: Artículo
@ -544,7 +531,6 @@ ticket:
landed: Entregado landed: Entregado
consigneePhone: Tel. consignatario consigneePhone: Tel. consignatario
consigneeMobile: Móv. consignatario consigneeMobile: Móv. consignatario
consigneeAddress: Dir. consignatario
clientPhone: Tel. cliente clientPhone: Tel. cliente
clientMobile: Móv. cliente clientMobile: Móv. cliente
consignee: Consignatario consignee: Consignatario
@ -567,16 +553,13 @@ ticket:
package: Embalaje package: Embalaje
taxClass: Tipo IVA taxClass: Tipo IVA
services: Servicios services: Servicios
changeState: Cambiar estado
requester: Solicitante requester: Solicitante
atender: Comprador atender: Comprador
request: Petición de compra request: Petición de compra
weight: Peso weight: Peso
goTo: Ir a goTo: Ir a
summaryAmount: Resumen summaryAmount: Resumen
purchaseRequest: Petición de compra
service: Servicio
description: Descripción
attender: Consignatario
create: create:
client: Cliente client: Cliente
address: Dirección address: Dirección
@ -752,7 +735,6 @@ worker:
balance: Balance balance: Balance
formation: Formación formation: Formación
medical: Mutua medical: Mutua
operator: Operario
list: list:
name: Nombre name: Nombre
email: Email email: Email
@ -841,19 +823,6 @@ worker:
debit: Debe debit: Debe
credit: Haber credit: Haber
concept: Concepto concept: Concepto
operator:
numberOfWagons: Número de vagones
train: tren
itemPackingType: Tipo de embalaje
warehouse: Almacén
sector: Sector
labeler: Impresora
linesLimit: Líneas límite
volumeLimit: Volumen límite
sizeLimit: Tamaño límite
isOnReservationMode: Modo de reserva
machine: Máquina
wagon: wagon:
pageTitles: pageTitles:
wagons: Vagones wagons: Vagones
@ -893,6 +862,21 @@ wagon:
minHeightBetweenTrays: 'La distancia mínima entre bandejas es ' minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
maxWagonHeight: 'La altura máxima del vagón es ' maxWagonHeight: 'La altura máxima del vagón es '
uncompleteTrays: Hay bandejas sin completar uncompleteTrays: Hay bandejas sin completar
route:
cmr:
list:
results: resultados
cmrFk: Id CMR
hasCmrDms: Gestdoc
'true':
'false': 'No'
ticketFk: Id ticket
routeFk: Id ruta
country: País
clientFk: Id cliente
shipped: Fecha preparación
viewCmr: Ver CMR
downloadCmrs: Descargar CMRs
supplier: supplier:
list: list:
payMethod: Método de pago payMethod: Método de pago
@ -1007,7 +991,6 @@ travel:
warehouseOut: Alm.entrada warehouseOut: Alm.entrada
totalEntries: totalEntries:
totalEntriesTooltip: Entradas totales totalEntriesTooltip: Entradas totales
daysOnward: Días de llegada en adelante
summary: summary:
confirmed: Confirmado confirmed: Confirmado
entryId: Id entrada entryId: Id entrada

View File

@ -5,14 +5,11 @@ import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import AccountSummary from './Card/AccountSummary.vue'; import AccountSummary from './Card/AccountSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import AccountFilter from './AccountFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const tableRef = ref(); const tableRef = ref();
const filter = {
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
};
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -21,31 +18,27 @@ const columns = computed(() => [
isId: true, isId: true,
field: 'id', field: 'id',
cardVisible: true, cardVisible: true,
},
{
align: 'left',
name: 'roleFk',
label: t('role'),
columnFilter: { columnFilter: {
component: 'select', component: 'select',
name: 'roleFk', name: 'search',
attrs: { attrs: {
url: 'VnRoles', url: 'VnUsers/preview',
optionValue: 'id', fields: ['id', 'name'],
optionLabel: 'name',
}, },
}, },
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
}, },
{ {
align: 'left', align: 'left',
name: 'nickname', name: 'username',
label: t('Nickname'), label: t('Nickname'),
isTitle: true, isTitle: true,
component: 'input', component: 'input',
columnField: { columnField: {
component: null, component: null,
}, },
columnFilter: {
inWhere: true,
},
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
@ -57,6 +50,9 @@ const columns = computed(() => [
columnField: { columnField: {
component: null, component: null,
}, },
columnFilter: {
inWhere: true,
},
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
@ -108,25 +104,17 @@ const exprBuilder = (param, value) => {
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:label="t('account.search')" :label="t('account.search')"
:info="t('account.searchInfo')" :info="t('account.searchInfo')"
:filter="filter"
/> />
<RightMenu>
<template #right-panel>
<AccountFilter data-key="AccountUsers" />
</template>
</RightMenu>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="AccountUsers" data-key="AccountUsers"
url="VnUsers/preview" url="VnUsers/preview"
:filter="filter"
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"
redirect="account" redirect="account"
:use-model="true" :use-model="true"
:right-search="false"
auto-load
/> />
</template> </template>

View File

@ -46,9 +46,13 @@ const columns = computed(() => [
]); ]);
const deleteAlias = async (row) => { const deleteAlias = async (row) => {
try {
await axios.delete(`${urlPath.value}/${row.id}`); await axios.delete(`${urlPath.value}/${row.id}`);
notify(t('User removed'), 'positive'); notify(t('User removed'), 'positive');
fetchAliases(); fetchAliases();
} catch (error) {
console.error(error);
}
}; };
watch( watch(

View File

@ -10,7 +10,7 @@ const { t } = useI18n();
<VnCard <VnCard
data-key="Account" data-key="Account"
:descriptor="AccountDescriptor" :descriptor="AccountDescriptor"
search-data-key="AccountList" search-data-key="AccountUsers"
:searchbar-props="{ :searchbar-props="{
url: 'VnUsers/preview', url: 'VnUsers/preview',
label: t('account.search'), label: t('account.search'),

View File

@ -4,12 +4,9 @@ import { computed, ref, toRefs } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useVnConfirm } from 'composables/useVnConfirm'; import { useVnConfirm } from 'composables/useVnConfirm';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useAcl } from 'src/composables/useAcl';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import VnConfirm from 'src/components/ui/VnConfirm.vue'; import VnConfirm from 'src/components/ui/VnConfirm.vue';
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
const $props = defineProps({ const $props = defineProps({
hasAccount: { hasAccount: {
type: Boolean, type: Boolean,
@ -65,19 +62,6 @@ async function sync() {
} }
</script> </script>
<template> <template>
<VnChangePassword
ref="changePassRef"
:ask-old-pass="true"
:submit-fn="
async (newPassword, oldPassword) => {
await axios.patch(`Accounts/change-password`, {
userId: entityId,
newPassword,
oldPassword,
});
}
"
/>
<VnConfirm <VnConfirm
v-model="showSyncDialog" v-model="showSyncDialog"
:message="t('account.card.actions.sync.message')" :message="t('account.card.actions.sync.message')"
@ -108,17 +92,6 @@ async function sync() {
/> />
</template> </template>
</VnConfirm> </VnConfirm>
<QItem
v-if="
entityId == account.id &&
useAcl().hasAny([{ model: 'Account', props: '*', accessType: 'WRITE' }])
"
v-ripple
clickable
@click="$refs.changePassRef.show()"
>
<QItemSection>{{ t('globals.changePass') }}</QItemSection>
</QItem>
<QItem <QItem
v-if="account.hasAccount" v-if="account.hasAccount"
v-ripple v-ripple
@ -165,5 +138,6 @@ async function sync() {
<QItem v-ripple clickable @click="showSyncDialog = true"> <QItem v-ripple clickable @click="showSyncDialog = true">
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection> <QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
</QItem> </QItem>
<QSeparator /> <QSeparator />
</template> </template>

View File

@ -61,15 +61,23 @@ const fetchAccountExistence = async () => {
}; };
const deleteMailAlias = async (row) => { const deleteMailAlias = async (row) => {
try {
await axios.delete(`${urlPath}/${row.id}`); await axios.delete(`${urlPath}/${row.id}`);
fetchMailAliases(); fetchMailAliases();
notify(t('Unsubscribed from alias!'), 'positive'); notify(t('Unsubscribed from alias!'), 'positive');
} catch (error) {
console.error(error);
}
}; };
const createMailAlias = async (mailAliasFormData) => { const createMailAlias = async (mailAliasFormData) => {
try {
await axios.post(urlPath, mailAliasFormData); await axios.post(urlPath, mailAliasFormData);
notify(t('Subscribed to alias!'), 'positive'); notify(t('Subscribed to alias!'), 'positive');
fetchMailAliases(); fetchMailAliases();
} catch (error) {
console.error(error);
}
}; };
const fetchMailAliases = async () => { const fetchMailAliases = async () => {

View File

@ -46,15 +46,29 @@ const columns = computed(() => [
]); ]);
const deleteSubRole = async (row) => { const deleteSubRole = async (row) => {
try {
await axios.delete(`${urlPath.value}/${row.id}`); await axios.delete(`${urlPath.value}/${row.id}`);
fetchSubRoles(); fetchSubRoles();
notify(t('Role removed. Changes will take a while to fully propagate.'), 'positive'); notify(
t('Role removed. Changes will take a while to fully propagate.'),
'positive'
);
} catch (error) {
console.error(error);
}
}; };
const createSubRole = async (subRoleFormData) => { const createSubRole = async (subRoleFormData) => {
try {
await axios.post(urlPath.value, subRoleFormData); await axios.post(urlPath.value, subRoleFormData);
notify(t('Role added! Changes will take a while to fully propagate.'), 'positive'); notify(
t('Role added! Changes will take a while to fully propagate.'),
'positive'
);
fetchSubRoles(); fetchSubRoles();
} catch (error) {
console.error(error);
}
}; };
watch( watch(

View File

@ -204,7 +204,7 @@ function claimUrl(section) {
top top
color="black" color="black"
text-color="white" text-color="white"
:label="t('globals.changeState')" :label="t('ticket.summary.changeState')"
> >
<QList> <QList>
<QVirtualScroll <QVirtualScroll

View File

@ -18,7 +18,6 @@ const contactChannels = ref([]);
const title = ref(); const title = ref();
const handleSalesModelValue = (val) => ({ const handleSalesModelValue = (val) => ({
or: [ or: [
{ id: val },
{ name: val }, { name: val },
{ nickname: { like: '%' + val + '%' } }, { nickname: { like: '%' + val + '%' } },
{ code: { like: `${val}%` } }, { code: { like: `${val}%` } },

View File

@ -1,177 +0,0 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import { QItem } from 'quasar';
import VnSelect from 'src/components/common/VnSelect.vue';
import { QItemSection } from 'quasar';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { toDate } from 'src/filters';
const { t } = useI18n();
defineProps({ dataKey: { type: String, required: true } });
</script>
<template>
<VnFilterPanel :data-key="dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params }">
<QItem>
<QItemSection>
<VnInput
:label="t('params.item')"
v-model="params.itemId"
is-outlined
lazy-rules
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.buyerId"
url="TicketRequests/getItemTypeWorker"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
:label="t('params.buyer')"
option-value="id"
option-label="nickname"
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.typeId"
url="ItemTypes"
:include="['category']"
:fields="['id', 'name', 'categoryFk']"
sort-by="name ASC"
:label="t('params.typeId')"
option-label="name"
option-value="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>{{
scope.opt?.category?.name
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.categoryId"
url="ItemCategories"
:fields="['id', 'name']"
sort-by="name ASC"
:label="t('params.categoryId')"
option-label="name"
option-value="id"
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.campaignId"
url="Campaigns/latest"
sort-by="dated DESC"
:label="t('params.campaignId')"
option-label="code"
option-value="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
t(`params.${scope.opt?.code}`)
}}</QItemLabel>
<QItemLabel caption>{{
toDate(scope.opt.dated)
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.from')"
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.to')"
v-model="params.to"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
item: Item id
buyer: Buyer
type: Type
category: Category
itemId: Item id
buyerId: Buyer
typeId: Type
categoryId: Category
from: From
to: To
campaignId: Campaña
valentinesDay: Valentine's Day
mothersDay: Mother's Day
allSaints: All Saints' Day
es:
params:
item: Id artículo
buyer: Comprador
type: Tipo
category: Categoría
itemId: Id Artículo
buyerId: Comprador
typeId: Tipo
categoryId: Reino
from: Desde
to: Hasta
campaignId: Campaña
valentinesDay: Día de San Valentín
mothersDay: Día de la Madre
allSaints: Día de Todos los Santos
</i18n>

View File

@ -91,6 +91,22 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
> >
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip> <QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
</QIcon> </QIcon>
<QIcon
v-if="!entity?.substitutionAllowed"
name="help"
size="xs"
color="primary"
>
<QTooltip>{{ t('Disabled substitution') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity?.substitutionAllowed"
name="help"
size="xs"
color="primary"
>
<QTooltip>{{ t('Allowed substitution') }}</QTooltip>
</QIcon>
<QIcon <QIcon
v-if="customer.isFreezed" v-if="customer.isFreezed"
name="vn:frozen" name="vn:frozen"

View File

@ -52,6 +52,16 @@ const orderCreateFormDialog = ref(null);
const openOrderCreateForm = () => { const openOrderCreateForm = () => {
orderCreateFormDialog.value.show(); orderCreateFormDialog.value.show();
}; };
const updateSubstitutionAllowed = async () => {
try {
await axios.patch(`Clients/${route.params.id}`, {
substitutionAllowed: !$props.customer.substitutionAllowed,
});
notify('globals.notificationSent', 'positive');
} catch (error) {
notify(error.message, 'positive');
}
};
</script> </script>
<template> <template>
@ -71,6 +81,13 @@ const openOrderCreateForm = () => {
</QDialog> </QDialog>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable>
<QItemSection @click="updateSubstitutionAllowed()">{{
$props.customer.substitutionAllowed
? t('Disable substitution')
: t('Allow substitution')
}}</QItemSection>
</QItem>
<QItem v-ripple clickable> <QItem v-ripple clickable>
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection> <QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
</QItem> </QItem>

View File

@ -93,7 +93,6 @@ function handleLocation(data, location) {
<VnRow> <VnRow>
<VnLocation <VnLocation
:rules="validate('Worker.postcode')" :rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]" :acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:location="data" :location="data"
@update:model-value="(location) => handleLocation(data, location)" @update:model-value="(location) => handleLocation(data, location)"

View File

@ -22,6 +22,5 @@ const noteFilter = computed(() => {
:filter="noteFilter" :filter="noteFilter"
:body="{ clientFk: route.params.id }" :body="{ clientFk: route.params.id }"
style="overflow-y: auto" style="overflow-y: auto"
:select-type="true"
/> />
</template> </template>

View File

@ -13,7 +13,6 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import VnRow from 'src/components/ui/VnRow.vue'; import VnRow from 'src/components/ui/VnRow.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const grafanaUrl = 'https://grafana.verdnatura.es';
const $props = defineProps({ const $props = defineProps({
id: { id: {

View File

@ -92,7 +92,7 @@ const onSubmit = async () => {
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');
unpaidClient.value = true; unpaidClient.value = true;
} catch (error) { } catch (error) {
notify('errors.writeRequest', 'negative'); notify('errors.create', 'negative');
} finally { } finally {
isLoading.value = false; isLoading.value = false;
} }

View File

@ -3,11 +3,14 @@ import { computed, 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';
import { useQuasar } from 'quasar';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar();
const route = useRoute(); const route = useRoute();
const canChangePassword = ref(0); const canChangePassword = ref(0);
@ -18,11 +21,21 @@ const filter = computed(() => {
}; };
}); });
const showChangePasswordDialog = () => {
quasar.dialog({
component: CustomerChangePassword,
componentProps: {
id: route.params.id,
},
});
};
async function hasCustomerRole() { async function hasCustomerRole() {
const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`); const { data } = await axios(`Clients/${route.params.id}/hasCustomerRole`);
canChangePassword.value = data; canChangePassword.value = data;
} }
</script> </script>
<template> <template>
<FormModel <FormModel
url="VnUsers/preview" url="VnUsers/preview"
@ -56,29 +69,21 @@ async function hasCustomerRole() {
</template> </template>
<template #moreActions> <template #moreActions>
<QBtn <QBtn
:label="t('globals.changePass')" :label="t('Change password')"
color="primary" color="primary"
icon="edit" icon="edit"
:disable="!canChangePassword" :disable="!canChangePassword"
@click="$refs.changePassRef.show" @click="showChangePasswordDialog()"
/> />
</template> </template>
</FormModel> </FormModel>
<VnChangePassword
ref="changePassRef"
:submit-fn="
async (newPass) => {
await axios.patch(`Clients/${$route.params.id}/setPassword`, {
newPassword: newPass,
});
}
"
/>
</template> </template>
<i18n> <i18n>
es: es:
Enable web access: Habilitar acceso web Enable web access: Habilitar acceso web
User: Usuario User: Usuario
Recovery email: Correo de recuperacion Recovery email: Correo de recuperacion
This email is used for user to regain access their account: Este correo electrónico se usa para que el usuario recupere el acceso a su cuenta This email is used for user to regain access their account: Este correo electrónico se usa para que el usuario recupere el acceso a su cuenta
Change password: Cambiar contraseña
</i18n> </i18n>

View File

@ -429,9 +429,10 @@ function handleLocation(data, location) {
:params="{ :params="{
departmentCodes: ['VT', 'shopping'], departmentCodes: ['VT', 'shopping'],
}" }"
option-label="nickname"
option-value="id"
:fields="['id', 'nickname']" :fields="['id', 'nickname']"
sort-by="nickname ASC" sort-by="nickname ASC"
:use-like="false"
emit-value emit-value
auto-load auto-load
> >

View File

@ -3,6 +3,7 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { toCurrency, toDate, dateRange } from 'filters/index'; import { toCurrency, toDate, dateRange } from 'filters/index';
import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue'; import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
@ -10,6 +11,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue'; import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -190,6 +192,11 @@ function exprBuilder(param, value) {
</script> </script>
<template> <template>
<RightMenu>
<template #right-panel>
<CustomerNotificationsFilter data-key="CustomerDefaulter" />
</template>
</RightMenu>
<VnSubToolbar> <VnSubToolbar>
<template #st-data> <template #st-data>
<CustomerBalanceDueTotal :amount="balanceDueTotal" /> <CustomerBalanceDueTotal :amount="balanceDueTotal" />

View File

@ -25,31 +25,19 @@ const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const newObservation = ref(null); const newObservation = ref(null);
const obsId = ref(null);
const onSubmit = async () => { const onSubmit = async () => {
try { try {
if (!obsId.value) const data = $props.clients.map((item) => {
obsId.value = ( return { clientFk: item.clientFk, text: newObservation.value };
await axios.get('ObservationTypes/findOne', {
params: { filter: { where: { description: 'Finance' } } },
})
).data?.id;
const bodyObs = $props.clients.map((item) => {
return {
clientFk: item.clientFk,
text: newObservation.value,
observationTypeFk: obsId.value,
};
}); });
await axios.post('ClientObservations', bodyObs); await axios.post('ClientObservations', data);
const bodyObsMail = { const payload = {
defaulters: $props.clients, defaulters: $props.clients,
observation: newObservation.value, observation: newObservation.value,
}; };
await axios.post('Defaulters/observationEmail', bodyObsMail); await axios.post('Defaulters/observationEmail', payload);
await $props.promise(); await $props.promise();

View File

@ -240,6 +240,7 @@ function handleLocation(data, location) {
class="row q-gutter-md q-mb-md" class="row q-gutter-md q-mb-md"
v-for="(note, index) in notes" v-for="(note, index) in notes"
> >
<div class="col">
<VnSelect <VnSelect
:label="t('Observation type')" :label="t('Observation type')"
:options="observationTypes" :options="observationTypes"
@ -248,14 +249,17 @@ function handleLocation(data, location) {
option-value="id" option-value="id"
v-model="note.observationTypeFk" v-model="note.observationTypeFk"
/> />
</div>
<div class="col">
<VnInput <VnInput
:label="t('Description')" :label="t('Description')"
:rules="validate('route.description')" :rules="validate('route.description')"
clearable clearable
v-model="note.description" v-model="note.description"
/> />
</div>
<div class="flex items-center">
<QIcon <QIcon
:style="{ flex: 0, 'align-self': $q.screen.gt.xs ? 'end' : 'center' }"
@click.stop="deleteNote(note.id, index)" @click.stop="deleteNote(note.id, index)"
class="cursor-pointer" class="cursor-pointer"
color="primary" color="primary"
@ -266,7 +270,9 @@ function handleLocation(data, location) {
{{ t('Remove note') }} {{ t('Remove note') }}
</QTooltip> </QTooltip>
</QIcon> </QIcon>
</div>
</VnRow> </VnRow>
<QBtn <QBtn
@click.stop="addNote()" @click.stop="addNote()"
class="cursor-pointer add-icon q-mt-md" class="cursor-pointer add-icon q-mt-md"

View File

@ -0,0 +1,138 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { useDialogPluginComponent } from 'quasar';
import useNotify from 'src/composables/useNotify';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'src/components/FetchData.vue';
const { dialogRef } = useDialogPluginComponent();
const { notify } = useNotify();
const { t } = useI18n();
const $props = defineProps({
id: {
type: String,
required: true,
},
promise: {
type: Function,
required: true,
},
});
const userPasswords = ref({});
const closeButton = ref(null);
const isLoading = ref(false);
const newPassword = ref('');
const requestPassword = ref('');
const onSubmit = async () => {
isLoading.value = true;
if (newPassword.value !== requestPassword.value) {
notify(t("Passwords don't match"), 'negative');
isLoading.value = false;
return;
}
const payload = {
newPassword: newPassword.value,
};
try {
await axios.patch(`Clients/${$props.id}/setPassword`, payload);
} catch (error) {
notify('errors.create', 'negative');
} finally {
isLoading.value = false;
if (closeButton.value) closeButton.value.click();
}
};
</script>
<template>
<QDialog ref="dialogRef">
<FetchData
@on-fetch="(data) => (userPasswords = data[0])"
auto-load
url="UserPasswords"
/>
<QCard class="q-pa-lg">
<QCardSection>
<QForm @submit.prevent="onSubmit">
<span
ref="closeButton"
class="row justify-end close-icon"
v-close-popup
>
<QIcon name="close" size="sm" />
</span>
<VnRow class="row q-gutter-md q-mb-md" style="flex-direction: column">
<div class="col">
<VnInput
:label="t('New password')"
clearable
v-model="newPassword"
type="password"
>
<template #append>
<QIcon name="info" class="cursor-info">
<QTooltip>
{{
t('customer.card.passwordRequirements', {
...userPasswords,
})
}}
</QTooltip>
</QIcon>
</template>
</VnInput>
</div>
<div class="col">
<VnInput
:label="t('Request password')"
clearable
v-model="requestPassword"
type="password"
/>
</div>
</VnRow>
<div class="q-mt-lg row justify-end">
<QBtn
:disabled="isLoading"
:label="t('globals.cancel')"
:loading="isLoading"
class="q-ml-sm"
color="primary"
flat
type="reset"
v-close-popup
/>
<QBtn
:disabled="isLoading"
:label="t('Change password')"
:loading="isLoading"
color="primary"
type="submit"
/>
</div>
</QForm>
</QCardSection>
</QCard>
</QDialog>
</template>
<i18n>
es:
New password: Nueva contraseña
Request password: Repetir contraseña
Change password: Cambiar contraseña
Passwords don't match: Las contraseñas no coinciden
</i18n>

View File

@ -138,7 +138,7 @@ const onSubmit = async () => {
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');
onDataSaved(data); onDataSaved(data);
} catch (error) { } catch (error) {
notify('errors.writeRequest', 'negative'); notify('errors.create', 'negative');
} finally { } finally {
isLoading.value = false; isLoading.value = false;
} }

View File

@ -6,7 +6,7 @@ import { useRoute, useRouter } from 'vue-router';
import { date } from 'quasar'; import { date } from 'quasar';
import { toDateFormat } from 'src/filters/date.js'; import { toDateFormat } from 'src/filters/date.js';
import { dashIfEmpty, toCurrency } from 'src/filters'; import { toCurrency } from 'src/filters';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue'; import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
@ -32,16 +32,6 @@ const filter = {
}, },
{ relation: 'invoiceOut', scope: { fields: ['id'] } }, { relation: 'invoiceOut', scope: { fields: ['id'] } },
{ relation: 'agencyMode', scope: { fields: ['name'] } }, { relation: 'agencyMode', scope: { fields: ['name'] } },
{
relation: 'ticketSales',
scope: {
fields: ['id', 'concept', 'itemFk'],
include: { relation: 'item' },
scope: {
fields: ['id', 'name', 'itemPackingTypeFk'],
},
},
},
], ],
where: { clientFk: route.params.id }, where: { clientFk: route.params.id },
order: ['shipped DESC', 'id'], order: ['shipped DESC', 'id'],
@ -97,12 +87,7 @@ const columns = computed(() => [
label: t('Total'), label: t('Total'),
name: 'total', name: 'total',
}, },
{
align: 'left',
name: 'itemPackingTypeFk',
label: t('ticketSale.packaging'),
format: (row) => getItemPackagingType(row),
},
{ {
align: 'right', align: 'right',
label: '', label: '',
@ -150,15 +135,6 @@ const setShippedColor = (date) => {
if (difference == 0) return 'warning'; if (difference == 0) return 'warning';
if (difference < 0) return 'success'; if (difference < 0) return 'success';
}; };
const getItemPackagingType = (row) => {
const packagingType = row?.ticketSales
.map((sale) => sale.item?.itemPackingTypeFk || '-')
.filter((value) => value !== '-')
.join(', ');
return dashIfEmpty(packagingType);
};
</script> </script>
<template> <template>

View File

@ -1,7 +1,9 @@
<script setup> <script setup>
import { ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
@ -9,8 +11,17 @@ import VnSelect from 'src/components/common/VnSelect.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const workersOptions = ref([]);
const clientsOptions = ref([]);
</script> </script>
<template> <template>
<FetchData
url="Workers/search"
@on-fetch="(data) => (workersOptions = data)"
auto-load
/>
<FetchData url="Clients" @on-fetch="(data) => (clientsOptions = data)" auto-load />
<FormModel <FormModel
:url="`Departments/${route.params.id}`" :url="`Departments/${route.params.id}`"
model="department" model="department"
@ -51,7 +62,7 @@ const { t } = useI18n();
<VnSelect <VnSelect
:label="t('department.bossDepartment')" :label="t('department.bossDepartment')"
v-model="data.workerFk" v-model="data.workerFk"
url="Workers/search" :options="workersOptions"
option-value="id" option-value="id"
option-label="name" option-label="name"
hide-selected hide-selected
@ -61,7 +72,7 @@ const { t } = useI18n();
<VnSelect <VnSelect
:label="t('department.selfConsumptionCustomer')" :label="t('department.selfConsumptionCustomer')"
v-model="data.clientFk" v-model="data.clientFk"
url="Clients" :options="clientsOptions"
option-value="id" option-value="id"
option-label="name" option-label="name"
hide-selected hide-selected

View File

@ -11,7 +11,6 @@ import { toDate, toCurrency } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import axios from 'axios'; import axios from 'axios';
import FetchedTags from 'src/components/ui/FetchedTags.vue'; import FetchedTags from 'src/components/ui/FetchedTags.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -164,12 +163,14 @@ const fetchEntryBuys = async () => {
data-key="EntrySummary" data-key="EntrySummary"
> >
<template #header-left> <template #header-left>
<VnToSummary <router-link
v-if="route?.name !== 'EntrySummary'" v-if="route?.name !== 'EntrySummary'"
:route-name="'EntrySummary'" :to="{ name: 'EntrySummary', params: { id: entityId } }"
:entity-id="entityId" class="header link"
:url="entryUrl" :href="entryUrl"
/> >
<QIcon name="open_in_new" color="white" size="sm" />
</router-link>
</template> </template>
<template #header> <template #header>
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span> <span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>

View File

@ -45,10 +45,9 @@ const columns = [
optionValue: 'id', optionValue: 'id',
useLike: false, useLike: false,
}, },
columnFilter: false,
}, },
{ {
align: 'center', align: 'left',
label: t('Reserve'), label: t('Reserve'),
name: 'reserve', name: 'reserve',
columnFilter: false, columnFilter: false,
@ -77,7 +76,7 @@ const columns = [
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{ {
title: t('View more details'), title: t('More'),
icon: 'search', icon: 'search',
isPrimary: true, isPrimary: true,
action: (row) => { action: (row) => {
@ -142,10 +141,6 @@ function setFooter(data) {
}); });
tableRef.value.footer = footer; tableRef.value.footer = footer;
} }
function round(value) {
return Math.round(value * 100) / 100;
}
</script> </script>
<template> <template>
<VnSubToolbar> <VnSubToolbar>
@ -157,16 +152,14 @@ function round(value) {
:filter="filter" :filter="filter"
@on-fetch=" @on-fetch="
(data) => { (data) => {
travel = data.find( travel = data.find((data) => data.warehouseIn.code === 'VNH');
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh'
);
} }
" "
/> />
<VnRow class="travel"> <VnRow class="travel">
<div v-if="travel"> <div v-if="travel">
<span style="color: var(--vn-label-color)"> <span style="color: var(--vn-label-color)">
{{ t('Purchase Spaces') }}: {{ t('Booked trucks') }}:
</span> </span>
<span> <span>
{{ travel?.m3 }} {{ travel?.m3 }}
@ -213,7 +206,7 @@ function round(value) {
</template> </template>
</RightMenu> </RightMenu>
<div class="table-container"> <div class="table-container">
<div class="column items-center"> <QPage class="column items-center q-pa-md">
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="StockBoughts" data-key="StockBoughts"
@ -235,9 +228,7 @@ function round(value) {
:columns="columns" :columns="columns"
:user-params="userParams" :user-params="userParams"
:footer="true" :footer="true"
table-height="80vh"
auto-load auto-load
:column-search="false"
> >
<template #column-workerFk="{ row }"> <template #column-workerFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
@ -252,7 +243,7 @@ function round(value) {
</template> </template>
<template #column-footer-reserve> <template #column-footer-reserve>
<span> <span>
{{ round(tableRef.footer.reserve) }} {{ tableRef.footer.reserve }}
</span> </span>
</template> </template>
<template #column-footer-bought> <template #column-footer-bought>
@ -262,11 +253,11 @@ function round(value) {
tableRef.footer.reserve < tableRef.footer.bought, tableRef.footer.reserve < tableRef.footer.bought,
}" }"
> >
{{ round(tableRef.footer.bought) }} {{ tableRef.footer.bought }}
</span> </span>
</template> </template>
</VnTable> </VnTable>
</div> </QPage>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -281,6 +272,7 @@ function round(value) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
width: 40%;
} }
.text-negative { .text-negative {
color: $negative !important; color: $negative !important;
@ -290,12 +282,12 @@ function round(value) {
es: es:
Edit travel: Editar envío Edit travel: Editar envío
Travel: Envíos Travel: Envíos
Purchase Spaces: Espacios de compra Booked trucks: Camiones reservados
Buyer: Comprador Buyer: Comprador
Reserve: Reservado Reserve: Reservado
Bought: Comprado Bought: Comprado
More: Más
Date: Fecha Date: Fecha
View more details: Ver más detalles
Reserve some space: Reservar espacio Reserve some space: Reservar espacio
This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha
</i18n> </i18n>

View File

@ -77,10 +77,18 @@ const columns = [
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:disable-infinite-scroll="true" :disable-infinite-scroll="true"
:disable-option="{ card: true }"
:limit="0" :limit="0"
auto-load auto-load
> >
<template #top-left>
<QBtn
flat
icon="Close"
color="primary"
class="bg-vn-section-color q-pa-xs"
v-close-popup
/>
</template>
<template #column-entryFk="{ row }"> <template #column-entryFk="{ row }">
<span class="link"> <span class="link">
{{ row?.entryFk }} {{ row?.entryFk }}
@ -104,11 +112,6 @@ const columns = [
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: auto; margin: auto;
background-color: var(--vn-section-color);
padding: 4px;
}
.container > div > div > .q-table__top.relative-position.row.items-center {
background-color: red !important;
} }
</style> </style>
<i18n> <i18n>

View File

@ -1,72 +0,0 @@
<script setup>
import { ref, computed, watch } from 'vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
const isLoading = ref(false);
const dateFrom = ref();
const dateTo = ref();
const optionsTo = computed(() => (date) => {
if (!dateFrom.value) return true;
return new Date(date) >= new Date(dateFrom.value);
});
watch(dateFrom, (newDateFrom) => {
if (dateTo.value && new Date(dateTo.value) < new Date(newDateFrom))
dateTo.value = newDateFrom;
});
const recalc = async () => {
const { notify } = useNotify();
const params = {
schema: 'bs',
params: [new Date(dateFrom.value), new Date(dateTo.value)],
};
try {
isLoading.value = true;
await axios.post('Applications/waste_addSales/execute-proc', params);
notify('wasteRecalc.recalcOk', 'positive');
} catch (err) {
console.error(err);
} finally {
isLoading.value = false;
}
};
</script>
<template>
<div class="q-pa-lg row justify-center">
<QCard class="bg-light" style="width: 300px">
<QCardSection>
<VnInputDate
class="q-mb-lg"
v-model="dateFrom"
:label="$t('globals.from')"
rounded
dense
/>
<VnInputDate
class="q-mb-lg"
v-model="dateTo"
:options="optionsTo"
:label="$t('globals.to')"
:disable="!dateFrom"
rounded
dense
/>
<QBtn
color="primary"
text-color="white"
:label="$t('globals.recalc')"
:loading="isLoading"
:disable="isLoading || !(dateFrom && dateTo)"
@click="recalc()"
/>
</QCardSection>
</QCard>
</div>
</template>

View File

@ -9,27 +9,22 @@ import VnTable from 'components/VnTable/VnTable.vue';
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar(); const quasar = useQuasar();
const params = {
daysOnward: 7,
daysAgo: 3,
};
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
name: 'id', name: 'id',
label: t('myEntries.id'), label: t('customer.extendedList.tableVisibleColumns.id'),
columnFilter: false, columnFilter: false,
isTitle: true, isTitle: true,
}, },
{ {
visible: false, visible: false,
align: 'right', align: 'right',
label: t('myEntries.shipped'), label: t('shipped'),
name: 'shipped', name: 'shipped',
columnFilter: { columnFilter: {
name: 'fromShipped', name: 'fromShipped',
label: t('myEntries.fromShipped'), label: t('fromShipped'),
component: 'date', component: 'date',
}, },
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
@ -37,11 +32,11 @@ const columns = computed(() => [
{ {
visible: false, visible: false,
align: 'left', align: 'left',
label: t('myEntries.shipped'), label: t('shipped'),
name: 'shipped', name: 'shipped',
columnFilter: { columnFilter: {
name: 'toShipped', name: 'toShipped',
label: t('myEntries.toShipped'), label: t('toShipped'),
component: 'date', component: 'date',
}, },
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
@ -49,14 +44,14 @@ const columns = computed(() => [
}, },
{ {
align: 'right', align: 'right',
label: t('myEntries.shipped'), label: t('shipped'),
name: 'shipped', name: 'shipped',
columnFilter: false, columnFilter: false,
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
}, },
{ {
align: 'right', align: 'right',
label: t('myEntries.landed'), label: t('landed'),
name: 'landed', name: 'landed',
columnFilter: false, columnFilter: false,
format: ({ landed }) => toDate(landed), format: ({ landed }) => toDate(landed),
@ -64,36 +59,26 @@ const columns = computed(() => [
{ {
align: 'right', align: 'right',
label: t('myEntries.wareHouseIn'), label: t('globals.wareHouseIn'),
name: 'warehouseInFk', name: 'warehouseInFk',
format: (row) => { format: (row) => row.warehouseInName,
row.warehouseInName;
},
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
name: 'warehouseInFk',
label: t('myEntries.warehouseInFk'),
component: 'select', component: 'select',
attrs: { attrs: {
url: 'warehouses', url: 'warehouses',
fields: ['id', 'name'], fields: ['id', 'name'],
optionLabel: 'name', optionLabel: 'name',
optionValue: 'id', optionValue: 'id',
alias: 't',
}, },
alias: 't',
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('myEntries.daysOnward'), label: t('globals.daysOnward'),
name: 'daysOnward', name: 'days',
visible: false,
},
{
align: 'left',
label: t('myEntries.daysAgo'),
name: 'daysAgo',
visible: false, visible: false,
}, },
{ {
@ -103,7 +88,6 @@ const columns = computed(() => [
{ {
title: t('printLabels'), title: t('printLabels'),
icon: 'print', icon: 'print',
isPrimary: true,
action: (row) => printBuys(row.id), action: (row) => printBuys(row.id),
}, },
], ],
@ -130,11 +114,9 @@ const printBuys = (rowId) => {
data-key="myEntriesList" data-key="myEntriesList"
url="Entries/filter" url="Entries/filter"
:columns="columns" :columns="columns"
:user-params="params"
default-mode="card" default-mode="card"
order="shipped DESC" order="shipped DESC"
auto-load auto-load
chip-locale="myEntries"
/> />
</template> </template>

View File

@ -6,17 +6,9 @@ entryFilter:
filter: filter:
search: General search search: General search
reference: Reference reference: Reference
myEntries:
id: ID
landed: Landed landed: Landed
shipped: Shipped shipped: Shipped
fromShipped: Shipped(from) fromShipped: Shipped(from)
toShipped: Shipped(to) toShipped: Shipped(to)
printLabels: Print stickers printLabels: Print stickers
viewLabel: View sticker viewLabel: View sticker
wareHouseIn: Warehouse in
warehouseInFk: Warehouse in
daysOnward: Days onward
daysAgo: Days ago
wasteRecalc:
recalcOk: The wastes were successfully recalculated

View File

@ -9,17 +9,10 @@ entryFilter:
filter: filter:
search: Búsqueda general search: Búsqueda general
reference: Referencia reference: Referencia
myEntries:
id: ID
landed: F. llegada landed: F. llegada
shipped: F. salida shipped: F. salida
fromShipped: F. salida(desde) fromShipped: F. salida(desde)
toShipped: F. salida(hasta) toShipped: F. salida(hasta)
printLabels: Imprimir etiquetas printLabels: Imprimir etiquetas
viewLabel: Ver etiqueta viewLabel: Ver etiqueta
wareHouseIn: Alm. entrada
warehouseInFk: Alm. entrada
daysOnward: Días adelante
daysAgo: Días atras
wasteRecalc:
recalcOk: Se han recalculado las mermas correctamente

View File

@ -74,6 +74,9 @@ const formatOpt = (row, { model, options }, prop) => {
const option = options.find(({ id }) => id == obj); const option = options.find(({ id }) => id == obj);
return option ? `${obj}:${option[prop]}` : ''; return option ? `${obj}:${option[prop]}` : '';
}; };
const getTotal = (data, key) =>
data.reduce((acc, cur) => acc + +String(cur[key]).replace(',', '.'), 0);
</script> </script>
<template> <template>
<FetchData <FetchData

View File

@ -274,7 +274,10 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
:label="t('invoiceIn.summary.company')" :label="t('invoiceIn.summary.company')"
:value="entity.company?.code" :value="entity.company?.code"
/> />
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" /> <VnLv
:label="t('invoiceIn.summary.booked')"
:value="invoiceIn?.isBooked"
/>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">

View File

@ -116,7 +116,7 @@ const activities = ref([]);
<QItem> <QItem>
<QItemSection> <QItemSection>
<QCheckbox <QCheckbox
:label="t('invoiceIn.isBooked')" :label="t('params.isBooked')"
v-model="params.isBooked" v-model="params.isBooked"
@update:model-value="searchFn()" @update:model-value="searchFn()"
toggle-indeterminate toggle-indeterminate
@ -170,7 +170,7 @@ es:
awb: AWB awb: AWB
amount: Importe amount: Importe
issued: Emitida issued: Emitida
isBooked: Contabilizada isBooked: Conciliada
account: Cuenta contable account: Cuenta contable
created: Creada created: Creada
dued: Vencida dued: Vencida

View File

@ -65,7 +65,7 @@ const cols = computed(() => [
{ {
align: 'left', align: 'left',
name: 'isBooked', name: 'isBooked',
label: t('invoiceIn.isBooked'), label: t('invoiceIn.list.isBooked'),
columnFilter: false, columnFilter: false,
}, },
{ {

View File

@ -1,6 +1,5 @@
invoiceIn: invoiceIn:
serial: Serial serial: Serial
isBooked: Is booked
list: list:
ref: Reference ref: Reference
supplier: Supplier supplier: Supplier
@ -8,6 +7,7 @@ invoiceIn:
serial: Serial serial: Serial
file: File file: File
issued: Issued issued: Issued
isBooked: Is booked
awb: AWB awb: AWB
amount: Amount amount: Amount
card: card:
@ -31,6 +31,7 @@ invoiceIn:
sage: Sage withholding sage: Sage withholding
vat: Undeductible VAT vat: Undeductible VAT
company: Company company: Company
booked: Booked
expense: Expense expense: Expense
taxableBase: Taxable base taxableBase: Taxable base
rate: Rate rate: Rate

View File

@ -1,6 +1,5 @@
invoiceIn: invoiceIn:
serial: Serie serial: Serie
isBooked: Contabilizada
list: list:
ref: Referencia ref: Referencia
supplier: Proveedor supplier: Proveedor
@ -8,6 +7,7 @@ invoiceIn:
shortIssued: F. emisión shortIssued: F. emisión
file: Fichero file: Fichero
issued: Fecha emisión issued: Fecha emisión
isBooked: Conciliada
awb: AWB awb: AWB
amount: Importe amount: Importe
card: card:
@ -31,6 +31,7 @@ invoiceIn:
sage: Retención sage sage: Retención sage
vat: Iva no deducible vat: Iva no deducible
company: Empresa company: Empresa
booked: Contabilizada
expense: Gasto expense: Gasto
taxableBase: Base imp. taxableBase: Base imp.
rate: Tasa rate: Tasa

View File

@ -9,6 +9,7 @@ import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue';
import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import SendEmailDialog from 'components/common/SendEmailDialog.vue';
import useNotify from 'src/composables/useNotify'; import useNotify from 'src/composables/useNotify';
import { useSession } from 'src/composables/useSession';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
import { useVnConfirm } from 'composables/useVnConfirm'; import { useVnConfirm } from 'composables/useVnConfirm';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
@ -29,6 +30,8 @@ const $props = defineProps({
const { notify } = useNotify(); const { notify } = useNotify();
const router = useRouter(); const router = useRouter();
const session = useSession();
const token = session.getToken();
const { t } = useI18n(); const { t } = useI18n();
const { openReport, sendEmail } = usePrintService(); const { openReport, sendEmail } = usePrintService();
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();

View File

@ -1,6 +1,5 @@
<script setup> <script setup>
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue'; import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
import InvoiceOutSummary from './InvoiceOutSummary.vue';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -11,10 +10,6 @@ const $props = defineProps({
</script> </script>
<template> <template>
<QPopupProxy> <QPopupProxy>
<InvoiceOutDescriptor <InvoiceOutDescriptor v-if="$props.id" :id="$props.id" />
v-if="$props.id"
:id="$props.id"
:summary="InvoiceOutSummary"
/>
</QPopupProxy> </QPopupProxy>
</template> </template>

View File

@ -78,7 +78,7 @@ const ticketsColumns = ref([
align: 'left', align: 'left',
}, },
{ {
name: 'nickname', name: 'quantity',
label: t('invoiceOut.summary.nickname'), label: t('invoiceOut.summary.nickname'),
field: (row) => row.nickname, field: (row) => row.nickname,
sortable: true, sortable: true,
@ -172,11 +172,11 @@ const ticketsColumns = ref([
</QBtn> </QBtn>
</QTd> </QTd>
</template> </template>
<template #body-cell-nickname="{ value, row }"> <template #body-cell-quantity="{ value, row }">
<QTd> <QTd>
<QBtn class="no-uppercase link" flat dense> <QBtn class="no-uppercase link" flat dense>
{{ value }} {{ value }}
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.id" />
</QBtn> </QBtn>
</QTd> </QTd>
</template> </template>

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