Compare commits

...

128 Commits

Author SHA1 Message Date
Pablo Natek d72b507fd4 Merge pull request 'feat: refs #7301 add exclude inventory supplier from list' (!982) from 7301-itemLastEntries into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #982
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-12 13:23:30 +00:00
Pablo Natek 87bdf532a8 Merge branch 'dev' into 7301-itemLastEntries
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 13:11:45 +00:00
Carlos Satorres 59b034d0b4 Merge pull request 'fix: fix department filter' (!1075) from fix-6389departmentFilter into dev
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-dev This commit looks good Details
Reviewed-on: #1075
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-12 10:03:24 +00:00
Carlos Satorres ac3ca3e243 fix: fix department filter
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 10:51:13 +01:00
Carlos Satorres b022ede6a9 Merge pull request 'fix: refs #6389 ipt' (!846) from 6389-changesMonitor into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #846
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-12 09:28:52 +00:00
Carlos Satorres e628a6c445 Merge branch 'dev' into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 08:48:28 +00:00
Pablo Natek c043a7d99a Merge branch 'dev' into 7301-itemLastEntries
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 08:34:39 +00:00
Carlos Satorres 79c1709618 Merge pull request 'fix: refs #7031 add test e2e' (!1049) from 7031-zonePrice into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1049
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
Reviewed-by: Jon Elias <jon@verdnatura.es>
2024-12-12 08:33:55 +00:00
Carlos Satorres 964cf68b9c Merge branch 'dev' into 7031-zonePrice
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 08:32:17 +00:00
Pablo Natek d4bb5a063f Merge branch 'dev' into 7301-itemLastEntries
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 08:31:51 +00:00
Pablo Natek 8bccb959ed fix: refs #7301 unnecessary console logs from ItemLastEntries.vue
gitea/salix-front/pipeline/pr-dev Build queued... Details
2024-12-12 09:31:33 +01:00
Jon Elias cd9b433a45 Merge pull request 'FIX: added restore ticket function in TicketDescriptorMenu' (!1072) from Fix-TicketDescriptorMenuOption into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1072
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-12 08:28:37 +00:00
Pablo Natek 52cacd8c16 Merge branch 'dev' of https: refs #7301//gitea.verdnatura.es/verdnatura/salix-front into 7301-itemLastEntries 2024-12-12 09:03:09 +01:00
Jon Elias ba300ec065 Merge branch 'Fix-TicketDescriptorMenuOption' of https://gitea.verdnatura.es/verdnatura/salix-front into Fix-TicketDescriptorMenuOption
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 08:04:07 +01:00
Jon Elias e01f1fe5d2 refactor: deleted log 2024-12-12 08:04:06 +01:00
Jon Elias d7d1e4d691 Merge branch 'dev' into Fix-TicketDescriptorMenuOption
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 06:52:31 +00:00
Jon Elias 983c86ffa5 feat: added restore ticket function in ticket descriptor menu
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-12 07:35:20 +01:00
Carlos Satorres 3d666338ce fix: refs #6389 front add packing filter
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-11 11:50:37 +01:00
Jorge Penadés 5b5a935021 Merge pull request '#8002 addSupportService' (!894) from xxxx-addSupportService into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #894
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
Reviewed-by: Carlos Satorres <carlossa@verdnatura.es>
2024-12-11 09:49:39 +00:00
Jorge Penadés 273c879879 Merge branch 'dev' into xxxx-addSupportService
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-11 09:39:59 +00:00
Carlos Satorres 0ecc103fc2 fix: refs #6389 front
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-11 09:59:05 +01:00
Carlos Satorres 7697caa85a Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-11 06:49:38 +01:00
Alex Moreno 4fc9ad3f76 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-10 13:40:47 +01:00
Javier Segarra ee445aca83 Merge pull request 'perf: emit options from VnSelectProvince' (!1062) from hotfix_improve_cp into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1062
Reviewed-by: Carlos Satorres <carlossa@verdnatura.es>
2024-12-10 12:24:00 +00:00
Javier Segarra 854e72fe51 perf: emit options from VnSelectProvince
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-12-10 13:17:31 +01:00
Alex Moreno 4a6f859a86 fix(RouteExtendedList): fix cloneRoutes
gitea/salix-front/pipeline/head This commit looks good Details
2024-12-10 13:15:03 +01:00
Alex Moreno b2fe1a6b6a Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2024-12-10 11:29:06 +01:00
Javier Segarra b97ee919a6 Merge pull request 'Hotfix: Bugs detected after 24.50' (!1060) from hotfix_minor_24-50 into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1060
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-10 08:49:07 +00:00
Alex Moreno 629531cce4 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2024-12-09 14:32:42 +01:00
Jorge Penadés 2fb179803c refactor: add useCau composable
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 13:42:00 +01:00
Jon Elias 91afc3ddab Merge pull request '#7283: Fix Item module' (!1042) from Fix-Items-Module into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1042
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-12-09 12:29:54 +00:00
Jon Elias d4682248fd Merge branch 'Fix-Items-Module' of https://gitea.verdnatura.es/verdnatura/salix-front into Fix-Items-Module
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 13:24:36 +01:00
Jon Elias 1de74dec8e fix: fix conflicts 2024-12-09 13:24:34 +01:00
Jon Elias bf68eab480 Merge pull request '#8194 created VnSelectWorker component' (!977) from 8194-VnSelectWorker into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #977
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-12-09 12:04:18 +00:00
Jon Elias 853bb9e5aa Merge branch 'dev' into 8194-VnSelectWorker
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 12:02:16 +00:00
Jon Elias e4837b45be Merge branch 'dev' into Fix-Items-Module
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 12:01:07 +00:00
Jorge Penadés fca380897f Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 12:41:45 +01:00
Jorge Penadés 9342cd0408 Merge pull request 'Mixin performance' (!875) from performance_mixins into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #875
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-09 11:38:51 +00:00
Jorge Penadés 7a9edfd88f Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService 2024-12-09 12:38:38 +01:00
Jorge Penadés f16c45b01a Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 11:37:52 +00:00
Carlos Satorres 5fc7d66425 Merge branch '7031-zonePrice' of https://gitea.verdnatura.es/verdnatura/salix-front into 7031-zonePrice
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 11:43:22 +01:00
Carlos Satorres a20afa5f35 fix: refs #7031 fix zoneTest 2024-12-09 11:43:20 +01:00
Jon Elias 92b05db9d2 refactor: deleted useless hidden tag
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 11:27:30 +01:00
Carlos Satorres d9fe5be6fe Merge branch 'dev' into 7031-zonePrice
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 08:11:53 +00:00
Jon Elias b26d07f605 Merge branch 'Fix-Items-Module' of https://gitea.verdnatura.es/verdnatura/salix-front into Fix-Items-Module
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 08:49:27 +01:00
Jon Elias f5f77a50bc refactor: added again search emit 2024-12-09 08:49:26 +01:00
Jon Elias 338058c1a4 Merge branch 'dev' into Fix-Items-Module
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 07:22:17 +00:00
Jon Elias 0c88db5931 refactor: deleted onUnmounted code
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 08:20:35 +01:00
Carlos Satorres dc4ae1fd92 Merge branch 'dev' of https: refs #6389//gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-09 06:57:47 +01:00
Jon Elias fea161d5c2 perf: refs #8194 select worker component
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 14:19:58 +01:00
Jon Elias 96920dd540 refactor: refs #8194 modified select worker template
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 14:13:31 +01:00
Jon Elias cf522684d6 refactor: refs #8194 deleted unnecessary label
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 14:00:45 +01:00
Jon Elias 6c05347219 refactor: refs #8194 modified select worker to allow no one filter from monitor ticket
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 13:45:18 +01:00
Jon Elias accf61517a refactor: refs #8194 requested changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 13:31:39 +01:00
Jon Elias c7115f4781 refactor: refs #8194 moved translation to the correct place
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 11:14:15 +01:00
Jon Elias 2d2187090c Merge branch 'dev' of https: refs #8194//gitea.verdnatura.es/verdnatura/salix-front into 8194-VnSelectWorker
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 11:04:02 +01:00
Jon Elias 1e1032b3da refactor: refs #8194 structure changes in component and related files
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-12-05 11:00:40 +01:00
Jon Elias 646007ea63 refactor: log error
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 10:30:43 +01:00
Guillermo Bonet dcbaa7529d Merge branch 'test' into dev
gitea/salix-front/pipeline/head This commit looks good Details
2024-12-05 09:24:45 +01:00
Carlos Satorres 47f81f2b2c Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-12-05 09:19:55 +01:00
Carlos Satorres 3d0245553e Merge pull request 'fix-7355AccountCreate' (!1051) from fix-7355AccountCreate into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1051
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-05 08:17:23 +00:00
Carlos Satorres c3c10b2238 fix: account create
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 09:03:13 +01:00
Carlos Satorres 91c9a4a559 Merge branch 'dev' into 7031-zonePrice
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 07:32:10 +00:00
Carlos Satorres cb15652dd6 fix: refs #7031 add test e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 08:28:43 +01:00
Jon Elias 58a18bfb69 refactor: deleted warnings and corrected itemTag
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-05 06:26:02 +01:00
Carlos Satorres 95551d9f99 fix: account 2024-12-05 06:03:10 +01:00
Carlos Satorres f5c6810d9e fix: accountList create 2024-12-04 13:58:59 +01:00
Jorge Penadés e0090c29c9 Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-04 12:22:09 +00:00
Carlos Satorres a6a21f3925 Merge pull request 'remove autocomplete address' (!935) from 8114-removeAutoAddress into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #935
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-12-04 09:43:24 +00:00
Carlos Satorres fc3c80d60d fix: refs #8114 fix lifeCycle hooks
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-04 10:35:33 +01:00
Carlos Satorres e55d116398 fix: refs #8114 fix pr
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-04 10:31:59 +01:00
Carlos Satorres 41292e467b Merge branch '8114-removeAutoAddress' of https://gitea.verdnatura.es/verdnatura/salix-front into 8114-removeAutoAddress
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-04 09:27:24 +01:00
Carlos Satorres 55627a5b47 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8114-removeAutoAddress 2024-12-04 09:24:35 +01:00
Carlos Satorres 29b923130f Merge branch 'dev' into 8114-removeAutoAddress
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-04 08:22:58 +00:00
Jon Elias 4276cefd7a feat: requested changes in item module
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-04 09:14:00 +01:00
Alex Moreno b4a4c4a0a4 build: new version
gitea/salix-front/pipeline/head This commit looks good Details
2024-12-03 14:34:01 +01:00
Carlos Satorres 1f80229bc8 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-03 11:54:58 +01:00
Carlos Satorres ce83879960 Merge branch 'dev' of https: refs #8114//gitea.verdnatura.es/verdnatura/salix-front into 8114-removeAutoAddress
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-03 10:33:48 +01:00
Carlos Satorres 1291dc1723 fix: refs #8114 clean
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-12-02 13:28:13 +01:00
Carlos Satorres 50360523b3 fix: refs #8114 remove logs
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-12-02 13:26:26 +01:00
Carlos Satorres 48482efe3b fix: refs #8114 fix agencyList
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-12-02 13:25:07 +01:00
Jorge Penadés a3f14bc39f refactor: drop logic
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-02 12:12:23 +01:00
Jorge Penadés cfa22bbc85 Merge branch 'performance_mixins' of https://gitea.verdnatura.es/verdnatura/salix-front into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-02 11:58:57 +01:00
Jorge Penadés bfa7300651 Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-12-02 10:58:52 +00:00
Jorge Penadés 1710ae718e Merge branch 'performance_mixins' of https://gitea.verdnatura.es/verdnatura/salix-front into performance_mixins 2024-12-02 11:58:44 +01:00
Jorge Penadés b00a3d7acf Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into performance_mixins 2024-12-02 11:55:54 +01:00
Carlos Satorres aaeabefdfe fix: refs #8114 fix removeAddress
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-11-28 11:11:45 +01:00
Carlos Satorres 2d656faf58 Merge branch '6389-changesMonitor' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-27 11:28:34 +01:00
Carlos Satorres 954a777182 Merge branch 'dev' of https: refs #6389//gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor 2024-11-27 11:28:31 +01:00
Carlos Satorres 59648d14f0 fix: refs #8114 orderList
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-27 06:18:41 +01:00
Pablo Natek 104348b94b Merge branch 'dev' into 7301-itemLastEntries
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-21 09:30:42 +00:00
Pablo Natek c006b4cb37 Merge branch 'dev' into 7301-itemLastEntries
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-21 09:20:54 +00:00
Pablo Natek 46cb18b5ef feat: refs #7301 add exclude inventory supplier from list
gitea/salix-front/pipeline/pr-dev Build queued... Details
2024-11-21 10:19:30 +01:00
Alex Moreno e817e51b28 Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-21 06:57:47 +00:00
Jon Elias 2b235e93e7 feat: refs #8194 created VnSelectWorker component and use it in Lilium
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-20 11:25:17 +01:00
Jorge Penadés 9e0f54ea9b fix: e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 13:49:53 +01:00
Jorge Penadés 26e777cdd5 fix: test
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 13:36:58 +01:00
Jorge Penadés 8f8fcfe440 feat: focus menu searchbar
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 12:38:19 +01:00
Jorge Penadés 93144439d2 Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 11:21:56 +00:00
Carlos Satorres eac476781f Merge branch 'dev' into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 10:42:33 +00:00
Carlos Satorres af7f7aa8f3 fix: refs #6389 fix filter trad
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 10:54:51 +01:00
Carlos Satorres 1844e15239 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-19 08:52:02 +01:00
Jorge Penadés 0fe740e415 fix: e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 13:20:23 +01:00
Jorge Penadés fa43f270ca fix: prevent null
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 12:02:40 +01:00
Jorge Penadés 43af96eb05 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 11:41:05 +01:00
Jorge Penadés f7c64fe6ff Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-14 09:37:24 +01:00
Jorge Penadés 81f1c447ad fix: rollback
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 17:45:02 +01:00
Jorge Penadés a5d032f022 feat: make additional data object
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 17:29:19 +01:00
Jorge Penadés 34df9cf254 fix: rollback
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 15:33:41 +01:00
Jorge Penadés 0c476725ae refactor: use locale keys
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 13:11:02 +01:00
Jorge Penadés 00c712469f Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 12:37:33 +01:00
Javier Segarra 4dc2be291f perf: remove comments
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 12:32:53 +01:00
Javier Segarra a4ccbe66c7 Merge branch 'dev' into performance_mixins
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 12:27:49 +01:00
Javier Segarra c3c51e01d4 perf: qFormMixin 2024-11-13 12:27:33 +01:00
Javier Segarra 9b681d806b perf: qFormMixin improvement
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-13 10:13:00 +01:00
Jorge Penadés 8a4589910c Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-11 13:16:22 +01:00
Javier Segarra d55764d2bc Merge branch 'dev' into performance_mixins 2024-11-11 09:58:50 +01:00
Jorge Penadés f6d200405c feat: message to grant access
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-05 09:33:16 +01:00
Jorge Penadés 3ca26a97dc Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into xxxx-addSupportService 2024-11-05 09:22:46 +01:00
Jorge Penadés 8817fd7c55 feat: add support service wip 2024-10-30 13:55:51 +01:00
Carlos Satorres 8dd2c94b37 fix: refs #6389 packing
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-28 09:01:00 +01:00
Carlos Satorres c0c1d3e3a9 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-28 08:08:19 +01:00
Javier Segarra 4df05b7522 feat: #8110 apply mixin in quasar components
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-25 13:41:06 +02:00
Carlos Satorres fee51db30d Merge branch 'dev' of https: refs #6389//gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-24 08:09:09 +02:00
Carlos Satorres e8fd3c0a8f fix: refs #6389 fix front, filters, itp
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2024-10-23 14:58:03 +02:00
Carlos Satorres daf57c9b2b fix: refs #6389 front filters
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-23 12:20:53 +02:00
Carlos Satorres 861a507e10 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6389-changesMonitor
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-22 14:52:10 +02:00
Carlos Satorres 1bafdf1b85 fix: refs #6389 ipt
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-20 15:01:37 +02:00
75 changed files with 1052 additions and 784 deletions

View File

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

View File

@ -0,0 +1,36 @@
import routes from 'src/router/modules';
import { useRouter } from 'vue-router';
let isNotified = false;
export default {
created: function () {
const router = useRouter();
const keyBindingMap = routes
.filter((route) => route.meta.keyBinding)
.reduce((map, route) => {
map['Key' + route.meta.keyBinding.toUpperCase()] = route.path;
return map;
}, {});
const handleKeyDown = (event) => {
const { ctrlKey, altKey, code } = event;
if (ctrlKey && altKey && keyBindingMap[code] && !isNotified) {
event.preventDefault();
router.push(keyBindingMap[code]);
isNotified = true;
}
};
const handleKeyUp = (event) => {
const { ctrlKey, altKey } = event;
if (!ctrlKey || !altKey) {
isNotified = false;
}
};
window.addEventListener('keydown', handleKeyDown);
window.addEventListener('keyup', handleKeyUp);
},
};

View File

@ -1,30 +1,52 @@
import { getCurrentInstance } from 'vue';
function focusFirstInput(input) {
input.focus();
return;
}
export default {
mounted: function () {
const vm = getCurrentInstance();
if (vm.type.name === 'QForm') {
if (!['searchbarForm', 'filterPanelForm'].includes(this.$el?.id)) {
// TODO: AUTOFOCUS IS NOT FOCUSING
const that = this;
this.$el.addEventListener('keyup', function (evt) {
if (evt.key === 'Enter') {
const input = evt.target;
if (input.type == 'textarea' && evt.shiftKey) {
evt.preventDefault();
let { selectionStart, selectionEnd } = input;
input.value =
input.value.substring(0, selectionStart) +
'\n' +
input.value.substring(selectionEnd);
selectionStart = selectionEnd = selectionStart + 1;
return;
}
evt.preventDefault();
that.onSubmit();
}
});
const that = this;
const form = document.querySelector('.q-form#formModel');
if (!form) return;
try {
const inputsFormCard = form.querySelectorAll(
`input:not([disabled]):not([type="checkbox"])`
);
if (inputsFormCard.length) {
focusFirstInput(inputsFormCard[0]);
}
const textareas = document.querySelectorAll(
'textarea:not([disabled]), [contenteditable]:not([disabled])'
);
if (textareas.length) {
focusFirstInput(textareas[textareas.length - 1]);
}
const inputs = document.querySelectorAll(
'form#formModel input:not([disabled]):not([type="checkbox"])'
);
const input = inputs[0];
if (!input) return;
focusFirstInput(input);
} catch (error) {
console.error(error);
}
form.addEventListener('keyup', function (evt) {
if (evt.key === 'Enter') {
const input = evt.target;
if (input.type == 'textarea' && evt.shiftKey) {
evt.preventDefault();
let { selectionStart, selectionEnd } = input;
input.value =
input.value.substring(0, selectionStart) +
'\n' +
input.value.substring(selectionEnd);
selectionStart = selectionEnd = selectionStart + 1;
return;
}
evt.preventDefault();
that.onSubmit();
}
});
},
};

View File

@ -1,15 +1,18 @@
import axios from 'axios';
import { boot } from 'quasar/wrappers';
import qFormMixin from './qformMixin';
import keyShortcut from './keyShortcut';
import useNotify from 'src/composables/useNotify.js';
import { CanceledError } from 'axios';
const { notify } = useNotify();
import { QForm } from 'quasar';
import { QLayout } from 'quasar';
import mainShortcutMixin from './mainShortcutMixin';
import { useCau } from 'src/composables/useCau';
export default boot(({ app }) => {
app.mixin(qFormMixin);
QForm.mixins = [qFormMixin];
QLayout.mixins = [mainShortcutMixin];
app.directive('shortcut', keyShortcut);
app.config.errorHandler = (error) => {
app.config.errorHandler = async (error) => {
let message;
const response = error.response;
const responseData = response?.data;
@ -40,12 +43,12 @@ export default boot(({ app }) => {
}
console.error(error);
if (error instanceof CanceledError) {
if (error instanceof axios.CanceledError) {
const env = process.env.NODE_ENV;
if (env && env !== 'development') return;
message = 'Duplicate request';
}
notify(message ?? 'globals.error', 'negative', 'error');
await useCau(response, message);
};
});

View File

@ -25,7 +25,6 @@ const townsFetchDataRef = ref(false);
const townFilter = ref({});
const countriesRef = ref(false);
const provincesFetchDataRef = ref(false);
const provincesOptions = ref([]);
const townsOptions = ref([]);
const town = ref({});
@ -71,9 +70,6 @@ async function setProvince(id, data) {
await fetchTowns();
}
async function onProvinceCreated(data) {
await provincesFetchDataRef.value.fetch({
where: { countryFk: postcodeFormData.countryFk },
});
postcodeFormData.provinceFk = data.id;
}
function provinceByCountry(countryFk = postcodeFormData.countryFk) {
@ -92,7 +88,6 @@ function setTown(newTown, data) {
data.countryFk = newTown?.province?.countryFk ?? newTown;
}
async function onCityCreated(newTown, formData) {
await provincesFetchDataRef.value.fetch();
newTown.province = provincesOptions.value.find(
(province) => province.id === newTown.provinceFk
);
@ -125,14 +120,6 @@ async function filterTowns(name) {
</script>
<template>
<FetchData
ref="provincesFetchDataRef"
@on-fetch="handleProvinces"
:sort-by="['name ASC']"
:limit="30"
auto-load
url="Provinces/location"
/>
<FetchData
ref="townsFetchDataRef"
:sort-by="['name ASC']"
@ -205,6 +192,11 @@ async function filterTowns(name) {
:country-fk="data.countryFk"
:province-selected="data.provinceFk"
@update:model-value="(value) => setProvince(value, data)"
@update:options="
(data) => {
provincesOptions = data;
}
"
v-model="data.provinceFk"
@on-province-created="onProvinceCreated"
required

View File

@ -177,6 +177,7 @@ function normalize(text) {
class="full-width"
filled
dense
autofocus
/>
</QItem>
<QSeparator />

View File

@ -7,7 +7,7 @@ import VnSelectDialog from 'components/common/VnSelectDialog.vue';
import FetchData from 'components/FetchData.vue';
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
const emit = defineEmits(['onProvinceCreated', 'onProvinceFetched']);
const emit = defineEmits(['onProvinceCreated', 'onProvinceFetched', 'update:options']);
const $props = defineProps({
countryFk: {
type: Number,
@ -41,6 +41,7 @@ async function onProvinceCreated(_, data) {
}
async function handleProvinces(data) {
provincesOptions.value = data;
emit('update:options', data);
}
watch(

View File

@ -610,6 +610,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
$props.rowClick && $props.rowClick(row);
}
"
style="height: 100%"
>
<QCardSection
vertical

View File

@ -0,0 +1,31 @@
<script setup>
import { toDateFormat } from 'src/filters/date.js';
defineProps({ date: { type: [Date, String], required: true } });
function getBadgeAttrs(date) {
let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
let timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0);
let timeDiff = today - timeTicket;
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
return { color: 'transparent', 'text-color': 'white' };
}
function formatShippedDate(date) {
if (!date) return '-';
const dateSplit = date.split('T');
const [year, month, day] = dateSplit[0].split('-');
const newDate = new Date(year, month - 1, day);
return toDateFormat(newDate);
}
</script>
<template>
<QBadge v-bind="getBadgeAttrs(date)" class="q-pa-sm" style="font-size: 14px">
{{ formatShippedDate(date) }}
</QBadge>
</template>

View File

@ -238,6 +238,7 @@ async function openPointRecord(id, modelLog) {
pointRecord.value = parseProps(propNames, locale, data);
}
async function setLogTree(data) {
if (!data) return;
logTree.value = getLogTree(data);
}

View File

@ -0,0 +1,85 @@
<script setup>
import { computed, useAttrs } from 'vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
const emit = defineEmits(['update:modelValue']);
const $props = defineProps({
hasAvatar: {
type: Boolean,
default: false,
},
hasInfo: {
type: Boolean,
default: false,
},
modelValue: {
type: [String, Number, Object],
default: null,
},
});
const $attrs = useAttrs();
const value = computed({
get() {
return $props.modelValue;
},
set(val) {
emit('update:modelValue', val);
},
});
const url = computed(() => {
let url = 'Workers/search';
const { departmentCodes } = $attrs.params ?? {};
if (!departmentCodes) return url;
const params = new URLSearchParams({
departmentCodes: JSON.stringify(departmentCodes),
});
return url.concat(`?${params.toString()}`);
});
</script>
<template>
<VnSelect
:label="$t('globals.worker')"
v-bind="$attrs"
v-model="value"
:url="url"
option-value="id"
option-label="nickname"
:fields="['id', 'name', 'nickname', 'code']"
sort-by="nickname ASC"
>
<template #prepend v-if="$props.hasAvatar">
<VnAvatar :worker-id="value" color="primary" :title="title" />
</template>
<template #append v-if="$props.hasInfo">
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{ $t($props.hasInfo) }}</QTooltip>
</QIcon>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt.name }}
</QItemLabel>
<QItemLabel v-if="!scope.opt.id">
{{ scope.opt.nickname }}
</QItemLabel>
<QItemLabel caption v-else>
{{ scope.opt.nickname }}, {{ scope.opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</template>
<i18n>
es:
Responsible for approving invoices: Responsable de aprobar las facturas
</i18n>

View File

@ -61,6 +61,7 @@ const emit = defineEmits([
'update:modelValue',
'refresh',
'clear',
'search',
'init',
'remove',
'setUserParams',

73
src/composables/useCau.js Normal file
View File

@ -0,0 +1,73 @@
import VnInput from 'src/components/common/VnInput.vue';
import { useVnConfirm } from 'src/composables/useVnConfirm';
import axios from 'axios';
import { ref } from 'vue';
import { i18n } from 'src/boot/i18n';
import useNotify from 'src/composables/useNotify.js';
export async function useCau(res, message) {
const { notify } = useNotify();
const { openConfirmationModal } = useVnConfirm();
const { config, headers, request, status, statusText, data } = res || {};
const { params, url, method, signal, headers: confHeaders } = config || {};
const { message: resMessage, code, name } = data?.error || {};
const additionalData = {
path: location.hash,
message: resMessage,
code,
request: request?.responseURL,
status,
name,
statusText: statusText,
config: {
url,
method,
params,
headers: confHeaders,
aborted: signal?.aborted,
version: headers?.['salix-version'],
},
};
const opts = {
actions: [
{
icon: 'support_agent',
color: 'primary',
dense: true,
flat: false,
round: true,
handler: async () => {
const locale = i18n.global.t;
const reason = ref(
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
);
openConfirmationModal(
locale('cau.title'),
locale('cau.subtitle'),
async () => {
await axios.post('OsTickets/send-to-support', {
reason: reason.value,
additionalData,
});
},
null,
{
component: VnInput,
props: {
modelValue: reason,
'onUpdate:modelValue': (val) => (reason.value = val),
label: locale('cau.inputLabel'),
class: 'full-width',
required: true,
autofocus: true,
},
}
);
},
},
],
};
notify(message ?? 'globals.error', 'negative', 'error', opts);
}

View File

@ -2,7 +2,7 @@ import { Notify } from 'quasar';
import { i18n } from 'src/boot/i18n';
export default function useNotify() {
const notify = (message, type, icon) => {
const notify = (message, type, icon, opts = {}) => {
const defaultIcons = {
warning: 'warning',
negative: 'error',
@ -13,6 +13,7 @@ export default function useNotify() {
message: i18n.global.t(message),
type: type,
icon: icon ? icon : defaultIcons[type],
...opts,
});
};

View File

@ -1,22 +1,29 @@
import { h } from 'vue';
import { Dialog } from 'quasar';
import VnConfirm from 'components/ui/VnConfirm.vue';
import { useQuasar } from 'quasar';
export function useVnConfirm() {
const quasar = useQuasar();
const openConfirmationModal = (title, message, promise, successFn) => {
quasar
.dialog({
component: VnConfirm,
componentProps: {
const openConfirmationModal = (
title,
message,
promise,
successFn,
customHTML = {}
) => {
const { component, props } = customHTML;
Dialog.create({
component: h(
VnConfirm,
{
title: title,
message: message,
promise: promise,
},
})
.onOk(async () => {
if (successFn) successFn();
});
{ customHTML: () => h(component, props) }
),
}).onOk(async () => {
if (successFn) successFn();
});
};
return { openConfirmationModal };

View File

@ -329,6 +329,7 @@ globals:
email: Email
SSN: SSN
fi: FI
packing: ITP
myTeam: My team
departmentFk: Department
countryFk: Country
@ -369,6 +370,11 @@ resetPassword:
repeatPassword: Repeat password
passwordNotMatch: Passwords don't match
passwordChanged: Password changed
cau:
title: Send cau
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
inputLabel: Explain why this error should not appear
askPrivileges: Ask for privileges
entry:
list:
newEntry: New entry
@ -398,8 +404,8 @@ entry:
buys: Buys
stickers: Stickers
package: Package
packing: Packing
grouping: Grouping
packing: Pack.
grouping: Group.
buyingValue: Buying value
import: Import
pvp: PVP

View File

@ -335,6 +335,7 @@ globals:
SSN: NSS
fi: NIF
myTeam: Mi equipo
packing: ITP
countryFk: País
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
@ -371,6 +372,11 @@ resetPassword:
repeatPassword: Repetir contraseña
passwordNotMatch: Las contraseñas no coinciden
passwordChanged: Contraseña cambiada
cau:
title: Enviar cau
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
askPrivileges: Solicitar permisos
entry:
list:
newEntry: Nueva entrada
@ -401,8 +407,8 @@ entry:
buys: Compras
stickers: Etiquetas
package: Embalaje
packing: Packing
grouping: Grouping
packing: Pack.
grouping: Group.
buyingValue: Coste
import: Importe
pvp: PVP

View File

@ -1,50 +1,10 @@
<script setup>
import { useQuasar } from 'quasar';
import Navbar from 'src/components/NavBar.vue';
import { useRouter } from 'vue-router';
import routes from 'src/router/modules';
import { onMounted } from 'vue';
const quasar = useQuasar();
onMounted(() => {
let isNotified = false;
const router = useRouter();
const keyBindingMap = routes
.filter((route) => route.meta.keyBinding)
.reduce((map, route) => {
map['Key' + route.meta.keyBinding.toUpperCase()] = route.path;
return map;
}, {});
const handleKeyDown = (event) => {
const { ctrlKey, altKey, code } = event;
if (ctrlKey && altKey && keyBindingMap[code] && !isNotified) {
event.preventDefault();
router.push(keyBindingMap[code]);
isNotified = true;
}
};
const handleKeyUp = (event) => {
const { ctrlKey, altKey } = event;
if (!ctrlKey || !altKey) {
isNotified = false;
}
};
window.addEventListener('keydown', handleKeyDown);
window.addEventListener('keyup', handleKeyUp);
});
</script>
<template>
<QLayout view="hHh LpR fFf" v-shortcut>
<Navbar />
<RouterView></RouterView>
<QFooter v-if="quasar.platform.is.mobile"></QFooter>
<QFooter v-if="$q.platform.is.mobile"></QFooter>
</QLayout>
</template>

View File

@ -31,7 +31,6 @@ const rolesOptions = ref([]);
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:hidden-tags="['search']"
:redirect="false"
search-url="table"
>

View File

@ -7,6 +7,7 @@ import AccountSummary from './Card/AccountSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import AccountFilter from './AccountFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const tableRef = ref();
@ -22,10 +23,27 @@ const columns = computed(() => [
field: 'id',
cardVisible: true,
},
{
align: 'left',
name: 'name',
label: t('Name'),
component: 'input',
columnField: {
component: null,
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'roleFk',
label: t('role'),
label: t('Role'),
component: 'select',
attrs: {
url: 'VnRoles',
optionValue: 'id',
optionLabel: 'name',
},
columnFilter: {
component: 'select',
name: 'roleFk',
@ -35,7 +53,11 @@ const columns = computed(() => [
optionLabel: 'name',
},
},
columnField: {
component: null,
},
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
create: true,
},
{
align: 'left',
@ -51,20 +73,32 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'name',
label: t('Name'),
name: 'email',
label: t('Email'),
component: 'input',
columnField: {
component: null,
},
cardVisible: true,
create: true,
visible: false,
},
{
align: 'left',
name: 'email',
label: t('email'),
component: 'input',
name: 'password',
label: t('Password'),
columnField: {
component: null,
},
attrs: {},
required: true,
visible: false,
},
{
align: 'left',
name: 'active',
label: t('Active'),
component: 'checkbox',
create: true,
visible: false,
},
@ -101,7 +135,6 @@ const exprBuilder = (param, value) => {
}
};
</script>
<template>
<VnSearchbar
data-key="AccountList"
@ -119,6 +152,12 @@ const exprBuilder = (param, value) => {
ref="tableRef"
data-key="AccountList"
url="VnUsers/preview"
:create="{
urlCreate: 'VnUsers',
title: t('Create user'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
:filter="filter"
order="id DESC"
:columns="columns"
@ -127,7 +166,19 @@ const exprBuilder = (param, value) => {
:use-model="true"
:right-search="false"
auto-load
/>
>
<template #more-create-dialog="{ data }">
<QCardSection>
<VnInput
:label="t('Password')"
v-model="data.password"
type="password"
:required="true"
autocomplete="new-password"
/>
</QCardSection>
</template>
</VnTable>
</template>
<i18n>
@ -135,4 +186,7 @@ const exprBuilder = (param, value) => {
Id: Id
Nickname: Nickname
Name: Nombre
Password: Contraseña
Active: Activo
Role: Rol
</i18n>

View File

@ -37,11 +37,7 @@ onBeforeMount(() => {
@on-fetch="(data) => (rolesOptions = data)"
auto-load
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:hidden-tags="['search']"
>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`acls.aclFilter.${tag.label}`) }}: </strong>

View File

@ -13,12 +13,7 @@ const props = defineProps({
</script>
<template>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:hidden-tags="['search']"
:redirect="false"
>
<VnFilterPanel :data-key="props.dataKey" :search-button="true" :redirect="false">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`role.${tag.label}`) }}: </strong>

View File

@ -8,7 +8,7 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
import { getDifferences, getUpdatedValues } from 'src/filters';
const route = useRoute();
@ -16,7 +16,6 @@ const { t } = useI18n();
const businessTypes = ref([]);
const contactChannels = ref([]);
const title = ref();
const handleSalesModelValue = (val) => ({
or: [
{ id: val },
@ -117,41 +116,17 @@ function onBeforeSave(formData, originalData) {
/>
</VnRow>
<VnRow>
<VnSelect
url="Workers/search"
v-model="data.salesPersonFk"
<VnSelectWorker
:label="t('customer.summary.salesPerson')"
v-model="data.salesPersonFk"
:params="{
departmentCodes: ['VT', 'shopping'],
}"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
option-label="nickname"
option-value="id"
:has-avatar="true"
:rules="validate('client.salesPersonFk')"
:expr-builder="exprBuilder"
emit-value
auto-load
>
<template #prepend>
<VnAvatar
:worker-id="data.salesPersonFk"
color="primary"
:title="title"
/>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt?.nickname }},
{{ scope.opt?.code }}</QItemLabel
>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
<VnSelect
v-model="data.contactChannelFk"
:options="contactChannels"

View File

@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
defineProps({
@ -65,19 +66,14 @@ const exprBuilder = (param, value) => {
</QItem>
<QItem class="q-mb-sm">
<QItemSection>
<VnSelect
url="Workers/search"
<VnSelectWorker
:label="t('Salesperson')"
v-model="params.salesPersonFk"
:params="{
departmentCodes: ['VT'],
}"
auto-load
:label="t('Salesperson')"
:expr-builder="exprBuilder"
v-model="params.salesPersonFk"
@update:model-value="searchFn()"
option-value="id"
option-label="name"
sort-by="nickname ASC"
emit-value
map-options
use-input
@ -86,18 +82,7 @@ const exprBuilder = (param, value) => {
outlined
rounded
:input-debounce="0"
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel caption>
{{ opt.nickname }},{{ opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template></VnSelect
>
/>
</QItemSection>
</QItem>
<QItem class="q-mb-sm">

View File

@ -2,7 +2,6 @@
import { ref, computed, markRaw } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import VnLocation from 'src/components/common/VnLocation.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
@ -12,7 +11,7 @@ import RightMenu from 'src/components/common/RightMenu.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { toDate } from 'src/filters';
import CustomerFilter from './CustomerFilter.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const router = useRouter();
@ -422,40 +421,17 @@ function handleLocation(data, location) {
auto-load
>
<template #more-create-dialog="{ data }">
<VnSelect
url="Workers/search"
v-model="data.salesPersonFk"
<VnSelectWorker
:label="t('customer.summary.salesPerson')"
v-model="data.salesPersonFk"
:params="{
departmentCodes: ['VT', 'shopping'],
}"
:fields="['id', 'nickname', 'code']"
sort-by="nickname ASC"
option-label="nickname"
option-value="id"
:has-avatar="true"
:id-value="data.salesPersonFk"
emit-value
auto-load
>
<template #prepend>
<VnAvatar
:worker-id="data.salesPersonFk"
color="primary"
:title="title"
/>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt?.nickname }},
{{ scope.opt?.code }}</QItemLabel
>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
<VnLocation
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
v-model="data.location"

View File

@ -6,6 +6,7 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const route = useRoute();
const { t } = useI18n();
@ -48,14 +49,9 @@ const { t } = useI18n();
/>
</VnRow>
<VnRow>
<VnSelect
<VnSelectWorker
:label="t('department.bossDepartment')"
v-model="data.workerFk"
url="Workers/search"
option-value="id"
option-label="name"
hide-selected
map-options
:rules="validate('department.workerFk')"
/>
<VnSelect

View File

@ -2,12 +2,15 @@
import { ref, nextTick } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import CrudModel from 'src/components/CrudModel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import useNotify from 'src/composables/useNotify.js';
const route = useRoute();
const { t } = useI18n();
const { notify } = useNotify();
const itemBarcodeRef = ref(null);
@ -23,6 +26,24 @@ const focusLastInput = () => {
if (lastInput) lastInput.focus();
});
};
const removeRow = (row) => {
itemBarcodeRef.value.remove([row]);
};
const submit = async (rows) => {
const params = rows[rows.length - 1];
let { data } = await axios.get('ItemBarcodes');
const code = params.code;
if (data.some((codes) => codes.code === code)) {
notify(t('Codes can not be repeated'), 'negative');
itemBarcodeRef.value.reset();
return;
}
await axios.patch(`ItemBarcodes`, params);
notify(t('globals.dataSaved'), 'positive');
};
</script>
<template>
<div class="full-width flex justify-center">
@ -39,6 +60,7 @@ const focusLastInput = () => {
ref="itemBarcodeRef"
url="ItemBarcodes"
auto-load
:save-fn="submit"
>
<template #body="{ rows }">
<QCard class="q-px-lg q-py-md">
@ -54,7 +76,7 @@ const focusLastInput = () => {
focusable-input
/>
<QIcon
@click="itemBarcodeRef.remove([row])"
@click="removeRow(row)"
class="cursor-pointer q-ml-md"
color="primary"
name="delete"
@ -89,4 +111,5 @@ es:
Code: Código
Remove barcode: Quitar código de barras
Add barcode: Añadir código de barras
Codes can not be repeated: Los códigos no puden ser repetidos
</i18n>

View File

@ -70,6 +70,7 @@ const onIntrastatCreated = (response, formData) => {
option-label="name"
hide-selected
map-options
required
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -16,7 +16,7 @@ import { cloneItem } from 'src/pages/Item/composables/cloneItem';
const $props = defineProps({
id: {
type: Number,
type: [Number, String],
required: false,
default: null,
},
@ -29,7 +29,7 @@ const $props = defineProps({
default: null,
},
saleFk: {
type: Number,
type: [Number, String],
default: null,
},
warehouseFk: {
@ -61,7 +61,7 @@ onMounted(async () => {
const data = ref(useCardDescription());
const setData = async (entity) => {
if (!entity) return;
data.value = useCardDescription(entity.name, entity.id);
data.value = useCardDescription(entity?.name, entity?.id);
await updateStock();
};

View File

@ -16,7 +16,7 @@ const $props = defineProps({
default: null,
},
entityId: {
type: String,
type: [String, Number],
default: null,
},
showEditButton: {
@ -67,7 +67,7 @@ const handlePhotoUpdated = (evt = false) => {
<template>
<div class="relative-position">
<VnImg ref="image" :id="$props.entityId" zoom-resolution="1600x900">
<VnImg ref="image" :id="parseInt($props.entityId)" zoom-resolution="1600x900">
<template #error>
<div class="absolute-full picture text-center q-pa-md flex flex-center">
<div>

View File

@ -1,21 +1,30 @@
<script setup>
import { onMounted, computed, onUnmounted, ref, watch } from 'vue';
import { onMounted, computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { dateRange } from 'src/filters';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDateTimeFormat } from 'src/filters/date.js';
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
import { dashIfEmpty } from 'src/filters';
import { toCurrency } from 'filters/index';
import { useArrayData } from 'composables/useArrayData';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import axios from 'axios';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
const { t } = useI18n();
const route = useRoute();
const stateStore = useStateStore();
const from = ref();
const to = ref();
const hideInventory = ref(true);
const inventorySupplierFk = ref();
async function getInventorySupplier() {
inventorySupplierFk.value = (
await axios.get(`InventoryConfigs`)
)?.data[0]?.supplierFk;
}
const exprBuilder = (param, value) => {
switch (param) {
@ -36,25 +45,27 @@ const exprBuilder = (param, value) => {
}
};
const from = ref();
const to = ref();
const where = {
itemFk: route.params.id,
};
if (hideInventory.value) {
where.supplierFk = { neq: inventorySupplierFk };
}
const arrayData = useArrayData('ItemLastEntries', {
url: 'Items/lastEntriesFilter',
order: ['landed DESC', 'buyFk DESC'],
exprBuilder: exprBuilder,
userFilter: {
where: {
itemFk: route.params.id,
},
where: where,
},
});
const itemLastEntries = ref([]);
const columns = computed(() => [
{
label: t('lastEntries.ig'),
label: 'Nv',
name: 'ig',
align: 'center',
},
@ -62,33 +73,38 @@ const columns = computed(() => [
label: t('itemDiary.warehouse'),
name: 'warehouse',
field: 'warehouse',
align: 'left',
align: 'center',
},
{
label: t('lastEntries.landed'),
name: 'id',
name: 'date',
field: 'landed',
align: 'left',
format: (val) => toDateTimeFormat(val),
align: 'center',
},
{
label: t('lastEntries.entry'),
name: 'entry',
field: 'stateName',
align: 'left',
align: 'center',
format: (val) => dashIfEmpty(val),
},
{
label: t('lastEntries.pvp'),
name: 'pvp',
field: 'reference',
align: 'left',
align: 'center',
format: (_, row) => toCurrency(row.price2) + ' / ' + toCurrency(row.price3),
},
{
label: t('lastEntries.printedStickers'),
name: 'printedStickers',
field: 'printedStickers',
align: 'center',
format: (val) => dashIfEmpty(val),
},
{
label: t('lastEntries.label'),
name: 'label',
name: 'stickers',
field: 'stickers',
align: 'center',
format: (val) => dashIfEmpty(val),
@ -96,11 +112,13 @@ const columns = computed(() => [
{
label: t('shelvings.packing'),
name: 'packing',
field: 'packing',
align: 'center',
},
{
label: t('lastEntries.grouping'),
name: 'grouping',
field: 'grouping',
align: 'center',
},
{
@ -111,18 +129,19 @@ const columns = computed(() => [
},
{
label: t('lastEntries.quantity'),
name: 'stems',
name: 'quantity',
field: 'quantity',
align: 'center',
},
{
label: t('lastEntries.cost'),
name: 'cost',
align: 'left',
field: 'cost',
align: 'center',
},
{
label: t('lastEntries.kg'),
name: 'stems',
label: 'Kg',
name: 'weight',
field: 'weight',
align: 'center',
},
@ -134,9 +153,9 @@ const columns = computed(() => [
},
{
label: t('lastEntries.supplier'),
name: 'stems',
name: 'supplier',
field: 'supplier',
align: 'left',
align: 'center',
},
]);
@ -160,11 +179,18 @@ const updateFilter = async () => {
else if (from.value && !to.value) filter = { gte: from.value };
else if (from.value && to.value) filter = { between: [from.value, to.value] };
arrayData.store.userFilter.where.landed = filter;
const userFilter = arrayData.store.userFilter.where;
userFilter.landed = filter;
if (hideInventory.value) userFilter.supplierFk = { neq: inventorySupplierFk };
else delete userFilter.supplierFk;
await fetchItemLastEntries();
};
onMounted(async () => {
await getInventorySupplier();
const _from = Date.vnNew();
_from.setDate(_from.getDate() - 75);
from.value = getDate(_from, 'from');
@ -174,16 +200,13 @@ onMounted(async () => {
updateFilter();
watch([from, to], ([nFrom, nTo], [oFrom, oTo]) => {
watch([from, to, hideInventory], ([nFrom, nTo], [oFrom, oTo]) => {
if (nFrom && nFrom != oFrom) nFrom = getDate(new Date(nFrom), 'from');
if (nTo && nTo != oTo) nTo = getDate(new Date(nTo), 'to');
updateFilter();
});
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>
<VnSubToolbar>
<template #st-data>
@ -192,27 +215,45 @@ onUnmounted(() => (stateStore.rightDrawer = false));
dense
v-model="from"
class="q-mr-lg"
data-cy="from"
/>
<VnInputDate
:label="t('lastEntries.to')"
v-model="to"
dense
class="q-mr-lg"
data-cy="to"
/>
<QCheckbox
:label="t('Hide inventory supplier')"
v-model="hideInventory"
dense
class="q-mr-lg"
data-cy="hideInventory"
/>
<VnInputDate :label="t('lastEntries.to')" dense v-model="to" />
</template>
</VnSubToolbar>
<QPage class="column items-center q-pa-xd">
<QTable
:rows="itemLastEntries"
:columns="columns"
class="full-width q-mt-md"
class="table full-width q-mt-md"
:no-data-label="t('globals.noResults')"
>
<template #body-cell-ig="{ row }">
<QTd @click.stop>
<QCheckbox
v-model="row.isIgnored"
:disable="true"
:false-value="0"
:true-value="1"
<QTd class="text-center">
<QIcon
:name="row.isIgnored ? 'check_box' : 'check_box_outline_blank'"
style="color: var(--vn-label-color)"
size="sm"
/>
</QTd>
</template>
<template #body-cell-date="{ row }">
<QTd class="text-center">
<VnDateBadge :date="row.landed" />
</QTd>
</template>
<template #body-cell-entry="{ row }">
<QTd @click.stop>
<div class="full-width flex justify-center">
@ -234,8 +275,8 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QTd>
</template>
<template #body-cell-pvp="{ value }">
<QTd @click.stop
><span> {{ value }}</span>
<QTd @click.stop class="text-center">
<span> {{ value }}</span>
<QTooltip>
{{ t('lastEntries.grouping') }}/{{ t('lastEntries.packing') }}
</QTooltip></QTd
@ -254,7 +295,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QTd>
</template>
<template #body-cell-cost="{ row }">
<QTd @click.stop>
<QTd @click.stop class="text-center">
<span>
{{ toCurrency(row.cost, 'EUR', 3) }}
<QTooltip>
@ -272,10 +313,25 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</span>
</QTd>
</template>
<template #body-cell-supplier="{ row }">
<QTd @click.stop>
<div class="full-width flex justify-center">
<SupplierDescriptorProxy
:id="row.supplierFk"
class="q-ma-none"
dense
/>
<span class="link">{{ row.supplier }}</span>
</div>
</QTd>
</template>
</QTable>
</QPage>
</template>
<i18n>
es:
Hide inventory supplier: Ocultar proveedor inventario
</i18n>
<style lang="scss" scoped>
.q-badge--rounded {
border-radius: 50%;
@ -287,4 +343,10 @@ onUnmounted(() => (stateStore.rightDrawer = false));
padding: 0 11px;
height: 28px;
}
.th :first-child {
.td {
text-align: center;
background-color: red;
}
}
</style>

View File

@ -1,19 +1,15 @@
<script setup>
import { onMounted, ref, computed, reactive } from 'vue';
import { onMounted, ref, computed, reactive, watchEffect } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { toDateFormat } from 'src/filters/date.js';
import { dashIfEmpty } from 'src/filters';
import { useArrayData } from 'src/composables/useArrayData';
import useNotify from 'src/composables/useNotify.js';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
import { useStateStore } from 'stores/useStateStore';
import VnTable from 'src/components/VnTable/VnTable.vue';
const stateStore = useStateStore();
@ -21,8 +17,9 @@ const route = useRoute();
const { t } = useI18n();
const { notify } = useNotify();
const { openConfirmationModal } = useVnConfirm();
const rowsSelected = ref([]);
const tableRef = ref();
const selectedRows = ref([]);
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
const exprBuilder = (param, value) => {
switch (param) {
@ -36,6 +33,11 @@ const exprBuilder = (param, value) => {
};
const params = reactive({ itemFk: route.params.id });
const filter = reactive({
where: {
itemFk: route.params.id,
},
});
const arrayData = useArrayData('ItemShelvings', {
url: 'ItemShelvingPlacementSupplyStocks',
@ -44,123 +46,69 @@ const arrayData = useArrayData('ItemShelvings', {
});
const rows = computed(() => arrayData.store.data || []);
const applyColumnFilter = async (col) => {
const paramKey = col.columnFilter?.filterParamKey || col.field;
params[paramKey] = col.columnFilter.filterValue;
await arrayData.addFilter({ filter: null, params });
};
const getInputEvents = (col) => {
return col.columnFilter.type === 'select'
? { 'update:modelValue': () => applyColumnFilter(col) }
: {
'keyup.enter': () => applyColumnFilter(col),
};
};
const columns = computed(() => [
{
label: t('shelvings.created'),
name: 'created',
field: 'created',
align: 'left',
sortable: true,
columnFilter: null,
format: (val) => toDateFormat(val),
columnFilter: false,
format: (row) => toDateFormat(row.created),
},
{
label: t('shelvings.item'),
name: 'item',
field: 'itemFk',
name: 'itemFk',
align: 'left',
sortable: true,
columnFilter: null,
columnFilter: false,
},
{
label: t('shelvings.concept'),
name: 'concept',
name: 'longName',
align: 'left',
sortable: true,
columnFilter: null,
columnFilter: false,
},
{
label: t('shelvings.parking'),
name: 'parking',
field: 'parking',
align: 'left',
sortable: true,
format: (val) => dashIfEmpty(val),
columnFilter: {
component: VnSelect,
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
url: 'parkings',
fields: ['code'],
'sort-by': 'code ASC',
'option-value': 'code',
'option-label': 'code',
dense: true,
},
component: 'select',
attrs: {
url: 'parkings',
fields: ['code'],
'sort-by': 'code ASC',
'option-value': 'code',
'option-label': 'code',
dense: true,
},
columnField: { component: null },
},
{
label: t('shelvings.shelving'),
name: 'shelving',
field: 'shelving',
align: 'left',
sortable: true,
format: (val) => dashIfEmpty(val),
columnFilter: {
component: VnSelect,
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
url: 'shelvings',
fields: ['code'],
'sort-by': 'code ASC',
'option-value': 'code',
'option-label': 'code',
dense: true,
},
component: 'select',
attrs: {
url: 'shelvings',
fields: ['code'],
'sort-by': 'code ASC',
'option-value': 'code',
'option-label': 'code',
dense: true,
},
columnField: { component: null },
},
{
label: t('shelvings.label'),
name: 'label',
align: 'left',
sortable: true,
format: (_, row) => (row.stock / row.packing).toFixed(2),
columnFilter: {
component: VnInput,
type: 'text',
filterParamKey: 'label',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
columnFilter: { inWhere: true },
format: (row) => (row.stock / row.packing).toFixed(2),
},
{
label: t('shelvings.packing'),
field: 'packing',
name: 'packing',
attrs: { inWhere: true },
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
format: (val) => dashIfEmpty(val),
},
]);
@ -169,15 +117,16 @@ const totalLabels = computed(() =>
);
const removeLines = async () => {
const itemShelvingIds = rowsSelected.value.map((row) => row.itemShelvingFk);
const itemShelvingIds = selectedRows.value.map((row) => row.itemShelvingFk);
await axios.post('ItemShelvings/deleteItemShelvings', { itemShelvingIds });
rowsSelected.value = [];
selectedRows.value = [];
notify('shelvings.shelvingsRemoved', 'positive');
await arrayData.fetch({ append: false });
await tableRef.value.reload();
};
onMounted(async () => {
await arrayData.fetch({ append: false });
});
watchEffect(selectedRows);
</script>
<template>
@ -203,7 +152,7 @@ onMounted(async () => {
<QBtn
color="primary"
icon="delete"
:disabled="!rowsSelected.length"
:disabled="!hasSelectedCards"
@click="
openConfirmationModal(
t('shelvings.removeConfirmTitle'),
@ -219,41 +168,27 @@ onMounted(async () => {
</Teleport>
</template>
<QPage class="column items-center q-pa-md">
<QTable
:rows="rows"
<VnTable
ref="tableRef"
data-key="ItemShelving"
:columns="columns"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
selection="multiple"
v-model:selected="rowsSelected"
:no-data-label="t('globals.noResults')"
:url="`ItemShelvingPlacementSupplyStocks`"
:filter="filter"
:expr-builder="exprBuilder"
:right-search="false"
v-model:selected="selectedRows"
:table="{
'row-key': 'itemShelvingFk',
selection: 'multiple',
}"
auto-load
>
<template #top-row="{ cols }">
<QTr>
<QTd />
<QTd
v-for="(col, index) in cols"
:key="index"
style="max-width: 100px"
>
<component
:is="col.columnFilter.component"
v-if="col.columnFilter"
v-model="col.columnFilter.filterValue"
v-bind="col.columnFilter.attrs"
v-on="col.columnFilter.event(col)"
dense
/>
</QTd>
</QTr>
</template>
<template #body-cell-concept="{ row }">
<QTd @click.stop>
<span class="link">{{ row.longName }}</span>
<template #column-longName="{ row }">
<span class="link" @click.stop>
{{ row.longName }}
<ItemDescriptorProxy :id="row.itemFk" />
</QTd>
</span>
</template>
</QTable>
</VnTable>
</QPage>
</template>

View File

@ -46,7 +46,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
<template #body="{ entity: { item, tags, visible, available, botanical } }">
<QCard class="vn-one photo">
<ItemDescriptorImage
:entity-id="entityId"
:entity-id="Number(entityId)"
:visible="visible"
:available="available"
:show-edit-button="false"
@ -89,7 +89,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
<QCard class="vn-one">
<VnTitle
:url="getUrl(entityId, 'basic-data')"
:text="t('item.summary.otherData')"
:text="t('item.summary.basicData')"
/>
<VnLv
:label="t('item.summary.intrastatCode')"

View File

@ -8,7 +8,6 @@ import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import axios from 'axios';
const route = useRoute();
@ -60,6 +59,10 @@ const insertTag = (rows) => {
itemTagsRef.value.formData[itemTagsRef.value.formData.length - 1].priority =
getHighestPriority(rows);
};
const submitTags = async (data) => {
itemTagsRef.value.onSubmit(data);
};
</script>
<template>
@ -77,7 +80,6 @@ const insertTag = (rows) => {
data-key="ItemTags"
model="ItemTags"
url="ItemTags"
update-url="Tags/onSubmit"
:data-required="{
$index: undefined,
itemFk: route.params.id,
@ -147,6 +149,7 @@ const insertTag = (rows) => {
v-model="row.value"
:label="t('itemTags.value')"
:is-clearable="false"
@keyup.enter.stop="submitTags(row)"
/>
<VnInput
:label="t('itemBasicData.relevancy')"
@ -154,6 +157,7 @@ const insertTag = (rows) => {
v-model="row.priority"
:required="true"
:rules="validate('itemTag.priority')"
@keyup.enter.stop="submitTags(row)"
/>
<div class="row justify-center" style="flex: 0">
<QIcon
@ -189,3 +193,8 @@ const insertTag = (rows) => {
</QPage>
</div>
</template>
<i18n>
es:
Tags can not be repeated: Las etiquetas no pueden repetirse
</i18n>

View File

@ -28,7 +28,7 @@ const taxesFilter = {
],
};
const ItemTaxRef = ref(null);
const ItemTaxRef = ref();
const taxesOptions = ref([]);
const submitTaxes = async (data) => {
@ -36,7 +36,10 @@ const submitTaxes = async (data) => {
id: tax.id,
taxClassFk: tax.taxClassFk,
}));
if (payload.some((item) => item.taxClassFk === null)) {
notify(t('Tax class cannot be blank'), 'negative');
return;
}
await axios.post(`Items/updateTaxes`, payload);
notify(t('globals.dataSaved'), 'positive');
};

View File

@ -55,17 +55,6 @@ const columns = computed(() => [
label: '',
name: 'image',
align: 'left',
columnField: {
component: VnImg,
attrs: ({ row }) => {
return {
id: row?.id,
zoomResolution: '1600x900',
zoom: true,
class: 'rounded',
};
},
},
columnFilter: false,
cardVisible: true,
},
@ -184,7 +173,7 @@ const columns = computed(() => [
cardVisible: true,
},
{
label: t('globals.origin'),
label: t('item.list.origin'),
name: 'origin',
align: 'left',
component: 'select',
@ -228,7 +217,8 @@ const columns = computed(() => [
},
},
{
label: t('item.list.weightByPiece'),
label: t('item.list.weight'),
toolTip: t('item.list.weightByPiece'),
name: 'weightByPiece',
align: 'left',
component: 'input',
@ -322,7 +312,6 @@ const columns = computed(() => [
ref="tableRef"
data-key="ItemList"
url="Items/filter"
url-create="Items"
:create="{
urlCreate: 'Items',
title: t('Create Item'),
@ -333,12 +322,19 @@ const columns = computed(() => [
}"
:order="['isActive DESC', 'name', 'id']"
:columns="columns"
auto-load
redirect="Item"
:is-editable="false"
:right-search="false"
:filer="itemFilter"
:filter="itemFilter"
>
<template #column-image="{ row }">
<VnImg
:id="row?.id"
zoom-resolution="1600x900"
:zoom="true"
class="rounded"
/>
</template>
<template #column-id="{ row }">
<span class="link" @click.stop>
{{ row.id }}
@ -348,7 +344,7 @@ const columns = computed(() => [
<template #column-userName="{ row }">
<span class="link" @click.stop>
{{ row.userName }}
<WorkerDescriptorProxy :id="row.workerFk" />
<WorkerDescriptorProxy :id="row.buyerFk" />
</span>
</template>
<template #column-description="{ row }">

View File

@ -199,7 +199,17 @@ onMounted(async () => {
dense
outlined
rounded
/>
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
t(`params.${scope.opt?.name}`)
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
@ -434,6 +444,13 @@ en:
description: Description
name: Name
id: Id
Accessories: Accessories
Artificial: Artificial
Flower: Flower
Fruit: Fruit
Green: Green
Handmade: Handmade
Plant: Plant
es:
More fields: Más campos
params:
@ -450,4 +467,11 @@ es:
description: Descripción
name: Nombre
id: Id
Accessories: Accesorios
Artificial: Artificial
Flower: Flor
Fruit: Fruta
Green: Verde
Handmade: Hecho a mano
Plant: Planta
</i18n>

View File

@ -5,13 +5,16 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'composables/useArrayData';
import { dashIfEmpty, toCurrency } from 'filters/index';
import { toCurrency } from 'filters/index';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
import ItemRequestDenyForm from './ItemRequestDenyForm.vue';
import { toDate } from 'src/filters';
import VnTable from 'components/VnTable/VnTable.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import ItemRequestFilter from './ItemRequestFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
const { t } = useI18n();
const { notify } = useNotify();
const stateStore = useStateStore();
@ -228,6 +231,11 @@ onMounted(async () => {
</script>
<template>
<RightMenu>
<template #right-panel>
<ItemRequestFilter data-key="itemRequest" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="itemRequest"
@ -239,6 +247,7 @@ onMounted(async () => {
auto-load
:disable-option="{ card: true }"
chip-locale="item.params"
:right-search="false"
>
<template #column-ticketFk="{ row }">
<span class="link">
@ -306,30 +315,28 @@ onMounted(async () => {
/>
</template>
<template #column-denyOptions="{ row, rowIndex }">
<QTd class="sticky no-padding">
<QIcon
v-if="row.response?.length"
name="insert_drive_file"
color="primary"
size="sm"
>
<QTooltip>
{{ row.response }}
</QTooltip>
</QIcon>
<QIcon
v-if="row.isOk == null"
name="thumb_down"
color="primary"
size="sm"
class="fill-icon"
@click="showDenyRequestForm(row.id, rowIndex)"
>
<QTooltip>
{{ t('Discard') }}
</QTooltip>
</QIcon>
</QTd>
<QIcon
v-if="row.response?.length"
name="insert_drive_file"
color="primary"
size="sm"
>
<QTooltip>
{{ row.response }}
</QTooltip>
</QIcon>
<QIcon
v-if="row.isOk == null"
name="thumb_down"
color="primary"
size="sm"
class="fill-icon"
@click="showDenyRequestForm(row.id, rowIndex)"
>
<QTooltip>
{{ t('Discard') }}
</QTooltip>
</QIcon>
</template>
</VnTable>
<QDialog ref="denyFormRef" transition-show="scale" transition-hide="scale">

View File

@ -1,5 +1,5 @@
<script setup>
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { dateRange } from 'src/filters';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
@ -7,6 +7,8 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { useArrayData } from 'src/composables/useArrayData';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const props = defineProps({
@ -21,7 +23,8 @@ const stateOptions = [
{ code: 'accepted', name: t('accepted') },
{ code: 'denied', name: t('denied') },
];
const arrayData = useArrayData(props.dataKey);
const fieldFiltersValues = ref([]);
const itemTypesOptions = ref([]);
const warehousesOptions = ref([]);
@ -56,6 +59,19 @@ const decrement = (paramsObj, key) => {
paramsObj[key]--;
};
onMounted(async () => {
if (arrayData.store?.userParams) {
fieldFiltersValues.value = Object.entries(arrayData.store.userParams).map(
([key, value]) => ({
name: key,
value,
selectedField: { name: key, label: t(`params.${key}`) },
})
);
}
exprBuilder('state', arrayData.store?.userParams?.state);
});
</script>
<template>
@ -145,33 +161,17 @@ const decrement = (paramsObj, key) => {
</QItem>
<QItem>
<QItemSection>
<VnSelect
<VnSelectWorker
:label="t('params.requesterFk')"
v-model="params.requesterFk"
@update:model-value="searchFn()"
url="Workers/search"
:fields="['id', 'name']"
order="name ASC"
:params="{ departmentCodes: ['VT'] }"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt?.nickname }},
{{ scope.opt?.code }}</QItemLabel
>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem>

View File

@ -10,7 +10,6 @@ const { t } = useI18n();
url="ItemTypes"
:label="t('Search item type')"
:info="t('Search itemType by id, name or code')"
search-url="table"
/>
</template>
<i18n>

View File

@ -6,6 +6,7 @@ import VnTable from 'components/VnTable/VnTable.vue';
import FetchData from 'components/FetchData.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import ItemTypeFilter from './ItemType/ItemTypeFilter.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
const { t } = useI18n();
const tableRef = ref();
@ -31,13 +32,14 @@ const columns = computed(() => [
{
align: 'left',
name: 'name',
label: t('name'),
label: t('globals.name'),
cardVisible: true,
create: true,
},
{
align: 'left',
label: t('worker'),
name: 'workerFk',
create: true,
component: 'select',
attrs: {
@ -45,20 +47,20 @@ const columns = computed(() => [
optionLabel: 'nickname',
optionValue: 'id',
},
format: (row) => row.worker?.user?.name,
cardVisible: true,
visible: true,
columnField: {
component: 'userLink',
attrs: ({ row }) => {
return {
workerId: row?.worker?.id,
name: row.worker?.user?.name,
defaultName: true,
};
},
},
columnField: { component: null },
columnFilter: {
name: 'workerFk',
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'],
where: { role: 'buyer' },
optionFilter: 'firstName',
optionLabel: 'name',
optionValue: 'id',
useLike: false,
},
inWhere: true,
},
},
{
@ -135,24 +137,27 @@ const columns = computed(() => [
:columns="columns"
auto-load
:right-search="false"
:is-editable="false"
:use-model="true"
redirect="item/item-type"
/>
>
<template #column-workerFk="{ row }">
<span class="link" @click.stop>
{{ row.worker?.user?.name }}
<WorkerDescriptorProxy :id="row.workerFk" />
</span>
</template>
</VnTable>
</template>
<i18n>
es:
id: Id
code: Código
name: Nombre
worker: Trabajador
ItemCategory: Reino
Temperature: Temperatura
Create ItemTypes: Crear familia
en:
code: Code
name: Name
worker: Worker
ItemCategory: ItemCategory
Temperature: Temperature

View File

@ -66,6 +66,7 @@ lastEntries:
package: Package
freight: Freight
comission: Comission
printedStickers: Pri.
itemTags:
removeTag: Remove tag
addTag: Add tag
@ -95,6 +96,15 @@ item:
mine: For me
state: State
myTeam: My team
shipped: Shipped
description: Description
quantity: Quantity
price: Price
item: Item
achieved: Achieved
concept: Concept
denyOptions: Deny
scopeDays: Scope days
searchbar:
label: Search item
descriptor:
@ -112,7 +122,7 @@ item:
title: All its properties will be copied
subTitle: Do you want to clone this item?
list:
id: Identifier
id: Id
grouping: Grouping
packing: Packing
description: Description
@ -122,8 +132,9 @@ item:
intrastat: Intrastat
isActive: Active
size: Size
origin: Origin
origin: Orig.
userName: Buyer
weight: Weight
weightByPiece: Weight/Piece
stemMultiplier: Multiplier
producer: Producer

View File

@ -56,7 +56,7 @@ lastEntries:
landed: F. Entrega
entry: Entrada
pvp: PVP
label: Etiquetas
label: Eti.
grouping: Grouping
quantity: Cantidad
cost: Coste
@ -66,6 +66,7 @@ lastEntries:
package: Embalaje
freight: Porte
comission: Comisión
printedStickers: Imp.
itemTags:
removeTag: Quitar etiqueta
addTag: Añadir etiqueta
@ -97,6 +98,15 @@ item:
mine: Para mi
state: Estado
myTeam: Mi equipo
shipped: Enviado
description: Descripción
quantity: Cantidad
price: Precio
item: Artículo
achieved: Conseguido
concept: Concepto
denyOptions: Denegado
scopeDays: Días en adelante
searchbar:
label: Buscar artículo
descriptor:
@ -114,7 +124,7 @@ item:
title: Todas sus propiedades serán copiadas
subTitle: ¿Desea clonar este artículo?
list:
id: Identificador
id: Id
grouping: Grouping
packing: Packing
description: Descripción
@ -124,7 +134,8 @@ item:
intrastat: Intrastat
isActive: Activo
size: Medida
origin: Origen
origin: Orig.
weight: Peso
weightByPiece: Peso (gramos)/tallo
userName: Comprador
stemMultiplier: Multiplicador

View File

@ -9,6 +9,7 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import FetchData from 'src/components/FetchData.vue';
import { dateRange } from 'src/filters';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
defineProps({ dataKey: { type: String, required: true } });
const { t, te } = useI18n();
@ -112,33 +113,16 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnSelect
<VnSelectWorker
outlined
dense
rounded
:label="t('globals.params.salesPersonFk')"
v-model="params.salesPersonFk"
url="Workers/search"
:params="{ departmentCodes: ['VT'] }"
is-outlined
option-value="id"
option-label="name"
:no-one="true"
>
<template #option="{ opt, itemProps }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel
v-if="opt.code"
class="text-grey text-caption"
>
{{ `${opt.nickname}, ${opt.code}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</VnSelectWorker>
</QItemSection>
</QItem>
<QItem>
@ -150,6 +134,7 @@ const getLocale = (label) => {
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
@ -225,6 +210,34 @@ const getLocale = (label) => {
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
outlined
dense
rounded
:label="t('globals.params.departmentFk')"
v-model="params.department"
option-label="name"
option-value="name"
url="Departments"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
outlined
dense
rounded
:label="t('globals.params.packing')"
v-model="params.packing"
url="ItemPackingTypes"
option-label="code"
option-value="code"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox

View File

@ -10,20 +10,23 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { toDateFormat } from 'src/filters/date.js';
import { toCurrency, dateRange, dashIfEmpty } from 'src/filters';
import RightMenu from 'src/components/common/RightMenu.vue';
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
import MonitorTicketFilter from './MonitorTicketFilter.vue';
import TicketProblems from 'src/components/TicketProblems.vue';
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000;
const { t } = useI18n();
const autoRefresh = ref(false);
const tableRef = ref(null);
const provinceOpts = ref([]);
const stateOpts = ref([]);
const zoneOpts = ref([]);
const DepartmentOpts = ref([]);
const ItemPackingTypeOpts = ref([]);
const visibleColumns = ref([]);
const { viewSummary } = useSummaryDialog();
const [from, to] = dateRange(Date.vnNew());
@ -51,6 +54,8 @@ function exprBuilder(param, value) {
case 'nickname':
return { [`t.nickname`]: { like: `%${value}%` } };
case 'zoneFk':
case 'department':
return { 'd.name': value };
case 'totalWithVat':
return { [`t.${param}`]: value };
}
@ -137,6 +142,7 @@ const columns = computed(() => [
align: 'left',
format: (row) => row.practicalHour,
columnFilter: false,
dense: true,
},
{
label: t('salesTicketsTable.preparation'),
@ -190,6 +196,7 @@ const columns = computed(() => [
'false-value': 0,
'true-value': 1,
},
component: false,
},
{
label: t('salesTicketsTable.zone'),
@ -206,6 +213,12 @@ const columns = computed(() => [
},
},
},
{
label: t('salesTicketsTable.payMethod'),
name: 'payMethod',
align: 'left',
columnFilter: false,
},
{
label: t('salesTicketsTable.total'),
name: 'totalWithVat',
@ -219,6 +232,36 @@ const columns = computed(() => [
},
},
},
{
label: t('salesTicketsTable.department'),
name: 'department',
align: 'left',
columnFilter: {
component: 'select',
url: 'Departments',
attrs: {
options: DepartmentOpts.value,
optionValue: 'name',
optionLabel: 'name',
dense: true,
},
},
},
{
label: t('salesTicketsTable.packing'),
name: 'packing',
align: 'left',
columnFilter: {
component: 'select',
url: 'ItemPackingTypes',
attrs: {
options: ItemPackingTypeOpts.value,
'option-value': 'code',
'option-label': 'code',
dense: true,
},
},
},
{
align: 'right',
name: 'tableActions',
@ -250,19 +293,6 @@ const columns = computed(() => [
},
]);
const getBadgeAttrs = (date) => {
let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
let timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0);
let timeDiff = today - timeTicket;
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
return { color: 'transparent', 'text-color': 'white' };
};
let refreshTimer = null;
const autoRefreshHandler = (value) => {
@ -279,14 +309,6 @@ const totalPriceColor = (ticket) => {
if (total > 0 && total < 50) return 'warning';
};
const formatShippedDate = (date) => {
if (!date) return '-';
const dateSplit = date.split('T');
const [year, month, day] = dateSplit[0].split('-');
const newDate = new Date(year, month - 1, day);
return toDateFormat(newDate);
};
const openTab = (id) =>
window.open(`#/ticket/${id}/sale`, '_blank', 'noopener, noreferrer');
</script>
@ -318,6 +340,24 @@ const openTab = (id) =>
auto-load
@on-fetch="(data) => (zoneOpts = data)"
/>
<FetchData
url="ItemPackingTypes"
:filter="{
fields: ['code'],
order: 'code ASC',
}"
auto-load
@on-fetch="(data) => (ItemPackingTypeOpts = data)"
/>
<FetchData
url="Departments"
:filter="{
fields: ['id', 'name'],
order: 'id ASC',
}"
auto-load
@on-fetch="(data) => (DepartmentOpts = data)"
/>
<MonitorTicketSearchbar />
<RightMenu>
<template #right-panel>
@ -337,7 +377,7 @@ const openTab = (id) =>
auto-load
:row-click="({ id }) => openTab(id)"
:disable-option="{ card: true }"
:user-params="{ from, to, scopeDays: 0 }"
:user-params="{ from, to, scopeDays: 0, packing }"
>
<template #top-left>
<QBtn
@ -382,13 +422,7 @@ const openTab = (id) =>
</div>
</template>
<template #column-shippedDate="{ row }">
<QBadge
v-bind="getBadgeAttrs(row.shippedDate)"
class="q-pa-sm"
style="font-size: 14px"
>
{{ formatShippedDate(row.shippedDate) }}
</QBadge>
<VnDateBadge :date="row.shippedDate" />
</template>
<template #column-provinceFk="{ row }">
<span :title="row.province" v-text="row.province" />

View File

@ -26,8 +26,8 @@ salesTicketsTable:
componentLack: Component lack
tooLittle: Ticket too little
identifier: Identifier
theoretical: Theoretical
practical: Practical
theoretical: H.Theor
practical: H.Prac
province: Province
state: State
isFragile: Is fragile
@ -35,7 +35,10 @@ salesTicketsTable:
goToLines: Go to lines
preview: Preview
total: Total
preparation: Preparation
preparation: H.Prep
payMethod: Pay method
department: Department
packing: ITP
searchBar:
label: Search tickets
info: Search tickets by id or alias

View File

@ -26,8 +26,8 @@ salesTicketsTable:
componentLack: Faltan componentes
tooLittle: Ticket demasiado pequeño
identifier: Identificador
theoretical: Teórica
practical: Práctica
theoretical: H.Teór
practical: H.Prác
province: Provincia
state: Estado
isFragile: Es frágil
@ -35,7 +35,10 @@ salesTicketsTable:
goToLines: Ir a líneas
preview: Vista previa
total: Total
preparation: Preparación
preparation: H.Prep
payMethod: Método de pago
department: Departamento
packing: ITP
searchBar:
label: Buscar tickets
info: Buscar tickets por identificador o alias

View File

@ -1,7 +1,7 @@
<script setup>
import { useStateStore } from 'stores/useStateStore';
import { useRoute, useRouter } from 'vue-router';
import { onMounted, onUnmounted, ref, computed, watch, provide, nextTick } from 'vue';
import { onMounted, ref, computed, watch, provide } from 'vue';
import axios from 'axios';
import { useI18n } from 'vue-i18n';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
@ -30,8 +30,6 @@ onMounted(() => {
checkOrderConfirmation();
});
onUnmounted(() => (stateStore.rightDrawer = false));
async function checkOrderConfirmation() {
const response = await axios.get(`Orders/${route.params.id}`);
if (response.data.isConfirmed === 1) {

View File

@ -1,9 +1,8 @@
<script setup>
import { useRouter } from 'vue-router';
import { reactive, onMounted, ref } from 'vue';
import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { useState } from 'composables/useState';
import FormModelPopup from 'components/FormModelPopup.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelect from 'components/common/VnSelect.vue';
@ -11,29 +10,12 @@ import VnInputDate from 'components/common/VnInputDate.vue';
import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n();
const state = useState();
const ORDER_MODEL = 'order';
const router = useRouter();
const agencyList = ref([]);
const addressList = ref([]);
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
const fetchAddressList = async (addressId) => {
const { data } = await axios.get('addresses', {
params: {
filter: JSON.stringify({
fields: ['id', 'nickname', 'street', 'city'],
where: { id: addressId },
}),
},
});
addressList.value = data;
if (addressList.value?.length === 1) {
state.get(ORDER_MODEL).addressId = addressList.value[0].id;
}
};
const fetchAgencyList = async (landed, addressFk) => {
if (!landed || !addressFk) {
return;
@ -59,17 +41,9 @@ const initialFormState = reactive({
clientFk: $props.clientFk,
});
const onClientChange = async (clientId = $props.clientFk) => {
const { data } = await axios.get(`Clients/${clientId}`);
await fetchAddressList(data.defaultAddressFk);
};
async function onDataSaved(_, id) {
await router.push({ path: `/order/${id}/catalog` });
}
onMounted(async () => {
await onClientChange();
});
</script>
<template>
@ -90,10 +64,9 @@ onMounted(async () => {
option-value="id"
option-label="name"
:filter="{
fields: ['id', 'name', 'defaultAddressFk'],
fields: ['id', 'name'],
}"
hide-selected
@update:model-value="onClientChange"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -110,7 +83,7 @@ onMounted(async () => {
:label="t('order.form.addressFk')"
v-model="data.addressId"
url="addresses"
:fields="['id', 'nickname', 'defaultAddressFk', 'street', 'city']"
:fields="['id', 'nickname', 'street', 'city']"
sort-by="id"
option-value="id"
option-label="street"

View File

@ -6,6 +6,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInput from 'components/common/VnInput.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const props = defineProps({
@ -61,28 +62,16 @@ const sourceList = ref([]);
outlined
rounded
/>
<VnSelect
:label="t('salesPerson')"
<VnSelectWorker
:label="t('globals.salesPerson')"
v-model="params.workerFk"
url="Workers/search"
:filter="{ departmentCodes: ['VT'] }"
sort-by="nickname ASC"
option-label="nickname"
:params="{
departmentCodes: ['VT'],
}"
dense
outlined
rounded
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel caption>
{{ opt.nickname }},{{ opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
<VnInputDate
v-model="params.from"
:label="t('fromLanded')"

View File

@ -1,7 +1,7 @@
<script setup>
import axios from 'axios';
import { useI18n } from 'vue-i18n';
import { computed, onMounted, ref } from 'vue';
import { computed, ref, onMounted } from 'vue';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
@ -15,14 +15,13 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import { toDateTimeFormat } from 'src/filters/date';
import { useRoute } from 'vue-router';
import dataByOrder from 'src/utils/dataByOrder';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const tableRef = ref();
const agencyList = ref([]);
const addressesList = ref([]);
const route = useRoute();
const addressOptions = ref([]);
const columns = computed(() => [
{
align: 'left',
@ -148,16 +147,12 @@ onMounted(() => {
const id = JSON.parse(clientId);
fetchClientAddress(id.clientFk);
});
async function fetchClientAddress(id, formData = {}) {
const { data } = await axios.get(`Clients/${id}`, {
params: {
filter: {
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
include: { relation: 'addresses' },
},
},
});
addressesList.value = data.addresses;
const { data } = await axios.get(
`Clients/${id}/addresses?filter[order]=isActive DESC`
);
addressOptions.value = data;
formData.addressId = data.defaultAddressFk;
fetchAgencies(formData);
}
@ -168,7 +163,7 @@ async function fetchAgencies({ landed, addressId }) {
const { data } = await axios.get('Agencies/landsThatDay', {
params: { addressFk: addressId, landed },
});
agencyList.value = dataByOrder(data, 'agencyMode ASC');
agencyList.value = data;
}
const getDateColor = (date) => {
@ -252,34 +247,29 @@ const getDateColor = (date) => {
</VnSelect>
<VnSelect
v-model="data.addressId"
:options="addressesList"
:options="addressOptions"
:label="t('module.address')"
option-value="id"
option-label="nickname"
@update:model-value="() => fetchAgencies(data)"
>
<template #option="scope">
<QItem
v-bind="scope.itemProps"
:class="{ disabled: !scope.opt.isActive }"
>
<QItemSection style="min-width: min-content" avatar>
<QIcon
v-if="
scope.opt.isActive && data.addressId === scope.opt.id
"
size="sm"
color="grey"
name="star"
class="fill-icon"
/>
</QItemSection>
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt.nickname }}
</QItemLabel>
<QItemLabel caption>
{{ `${scope.opt.street}, ${scope.opt.city}` }}
<QItemLabel
:class="{
'color-vn-label': !scope.opt?.isActive,
}"
>
{{
`${
!scope.opt?.isActive
? t('basicData.inactive')
: ''
} `
}}
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
{{ scope.opt?.city }}
</QItemLabel>
</QItemSection>
</QItem>

View File

@ -4,6 +4,7 @@ import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInput from 'components/common/VnInput.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const props = defineProps({
@ -31,29 +32,13 @@ const emit = defineEmits(['search']);
<template #body="{ params }">
<QItem class="q-my-sm">
<QItemSection>
<VnSelect
:label="t('Worker')"
<VnSelectWorker
v-model="params.workerFk"
url="Workers/search"
sort-by="nickname ASC"
option-value="id"
option-label="nickname"
dense
outlined
rounded
:input-debounce="0"
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel caption>
{{ opt.nickname }},{{ opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
</QItemSection>
</QItem>
<QItem class="q-my-sm">

View File

@ -11,6 +11,7 @@ import VnInputDate from 'components/common/VnInputDate.vue';
import VnInput from 'components/common/VnInput.vue';
import axios from 'axios';
import VnInputTime from 'components/common/VnInputTime.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const route = useRoute();
@ -94,26 +95,7 @@ const onSave = (data, response) => {
>
<template #form="{ data }">
<VnRow>
<VnSelect
:label="t('Worker')"
v-model="data.workerFk"
url="Workers/search"
sort-by="nickname ASC"
option-value="id"
option-label="nickname"
:input-debounce="0"
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel caption>
{{ opt.nickname }}, {{ opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelectWorker v-model="data.workerFk" />
<VnSelect
:label="t('Vehicle')"
v-model="data.vehicleFk"

View File

@ -223,10 +223,10 @@ function navigate(id) {
router.push({ path: `/route/${id}` });
}
const cloneRoutes = () => {
const cloneRoutes = async () => {
if (!selectedRows.value.length || !startingDate.value) return;
axios.post('Routes/clone', {
created: startingDate.value,
await axios.post('Routes/clone', {
dated: startingDate.value,
ids: selectedRows.value.map((row) => row?.id),
});
startingDate.value = null;
@ -274,7 +274,6 @@ const openTicketsDialog = (id) => {
<QCardSection>
<p class="text-h6 q-ma-none">{{ t('route.Select the starting date') }}</p>
</QCardSection>
<QCardSection class="q-pt-none">
<VnInputDate
:label="t('route.Stating date')"

View File

@ -2,7 +2,7 @@
import VnPaginate from 'components/ui/VnPaginate.vue';
import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n';
import { onMounted, onUnmounted } from 'vue';
import { onMounted } from 'vue';
import CardList from 'components/ui/CardList.vue';
import VnLv from 'components/ui/VnLv.vue';
import { useRouter } from 'vue-router';
@ -21,7 +21,6 @@ const filter = {
};
onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false));
function navigate(id) {
router.push({ path: `/shelving/${id}` });

View File

@ -5,6 +5,7 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const route = useRoute();
const { t } = useI18n();
@ -30,31 +31,11 @@ const companySizes = [
:rules="validate('supplier.nickname')"
clearable
/>
<VnSelect
:label="t('supplier.basicData.workerFk')"
<VnSelectWorker
v-model="data.workerFk"
url="Workers/search"
sort-by="nickname ASC"
has-info="Responsible for approving invoices"
:rules="validate('supplier.workerFk')"
>
<template #append>
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{
t('Responsible for approving invoices')
}}</QTooltip>
</QIcon>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.nickname }}, {{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
<VnSelect
:label="t('supplier.basicData.size')"
v-model="data.companySize"
@ -102,6 +83,5 @@ const companySizes = [
<i18n>
es:
Responsible for approving invoices: Responsable de aprobar las facturas
Small(1-5), Medium(6-50), Big(> 50): Pequeño(1-5), Mediano(6-50), Grande(> 50)
</i18n>

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
import { ref, computed, onMounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
@ -134,8 +134,6 @@ onMounted(() => {
loadDefaultTicketAction();
ticketHaveNegatives();
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue';
import { ref, computed, onMounted, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
@ -168,8 +168,6 @@ const getTicketVolume = async () => {
onMounted(() => {
stateStore.rightDrawer = true;
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>

View File

@ -9,6 +9,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
import { useState } from 'src/composables/useState';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const emit = defineEmits(['onRequestCreated']);
@ -46,29 +47,7 @@ const onStateFkChange = (formData) => (formData.userFk = user.value.id);
option-label="name"
option-value="id"
/>
<VnSelect
:label="t('expedition.worker')"
v-model="data.userFk"
url="Workers/search"
fields=" ['id', 'name']"
sort-by="name ASC"
hide-selected
option-label="name"
option-value="id"
>
<template #option="{ opt, itemProps }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>
{{ opt.name }}
</QItemLabel>
<QItemLabel caption>
{{ opt.nickname }}, {{ opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template></VnSelect
>
<VnSelectWorker v-model="data.userFk" :fields="['id', 'name']" />
</VnRow>
</template>
</FormModelPopup>

View File

@ -1,6 +1,6 @@
<script setup>
import axios from 'axios';
import { computed, ref, toRefs } from 'vue';
import { computed, onMounted, ref, toRefs, watch } from 'vue';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
@ -24,6 +24,15 @@ const props = defineProps({
},
});
onMounted(() => {
restoreTicket();
});
watch(
() => props.ticket,
() => restoreTicket
);
const { push, currentRoute } = useRouter();
const { dialog, notify } = useQuasar();
const { t } = useI18n();
@ -42,6 +51,7 @@ const hasPdf = ref();
const weight = ref();
const hasDocuwareFile = ref();
const quasar = useQuasar();
const canRestoreTicket = ref(false);
const actions = {
clone: async () => {
const opts = { message: t('Ticket cloned'), type: 'positive' };
@ -373,6 +383,54 @@ async function uploadDocuware(force) {
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
}
const restoreTicket = async () => {
const filter = {
fields: ['id', 'originFk', 'creationDate', 'newInstance'],
where: {
originFk: ticketId.value,
newInstance: { like: '%"isDeleted":true%' },
},
order: 'creationDate DESC',
limit: 1,
};
const params = { filter: JSON.stringify(filter) };
const { data } = await axios.get(`TicketLogs`, { params });
if (data && data.length) {
const now = Date.vnNew();
const maxDate = new Date(data[0].creationDate);
maxDate.setHours(maxDate.getHours() + 1);
if (now <= maxDate) {
return (canRestoreTicket.value = true);
}
return (canRestoreTicket.value = false);
}
return (canRestoreTicket.value = false);
};
async function openRestoreConfirmation(force) {
if (!force)
return quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t('Are you sure you want to restore the ticket?'),
message: t('You are going to restore this ticket'),
},
})
.onOk(async () => {
ticketToRestore();
});
}
async function ticketToRestore() {
const { data } = await axios.post(`Tickets/${ticketId.value}/restore`);
if (data) {
notify({ message: t('Ticket restored'), type: 'positive' });
}
}
</script>
<template>
<FetchData
@ -560,6 +618,12 @@ async function uploadDocuware(force) {
</QItemSection>
<QItemSection>{{ t('Show Proforma') }}</QItemSection>
</QItem>
<QItem v-if="canRestoreTicket" @click="openRestoreConfirmation()" v-ripple clickable>
<QItemSection avatar>
<QIcon name="restore" />
</QItemSection>
<QItemSection>{{ t('Restore ticket') }}</QItemSection>
</QItem>
<QItem
v-if="isEditable"
@click="showChangeTimeDialog = !showChangeTimeDialog"
@ -746,4 +810,8 @@ es:
You are going to delete this ticket: Vas a eliminar este ticket
as PDF signed: como PDF firmado
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán?
Restore ticket: Restaurar ticket
Are you sure you want to restore the ticket?: ¿Seguro que quieres restaurar el ticket?
You are going to restore this ticket: Vas a restaurar este ticket
Ticket restored: Ticket restaurado
</i18n>

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref, computed, onUnmounted } from 'vue';
import { onMounted, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
@ -197,8 +197,6 @@ onMounted(async () => {
const filteredColumns = columns.value.filter((col) => col.name !== 'history');
allColumnNames.value = filteredColumns.map((col) => col.name);
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref, computed, onUnmounted, watch } from 'vue';
import { onMounted, ref, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter, useRoute } from 'vue-router';
import { useQuasar } from 'quasar';
@ -421,8 +421,6 @@ onMounted(async () => {
getConfig();
});
onUnmounted(() => (stateStore.rightDrawer = false));
const items = ref([]);
const newRow = ref({});

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue';
import { ref, computed, onMounted, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
@ -90,8 +90,6 @@ const applyVolumes = async (salesData) => {
};
onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>

View File

@ -57,7 +57,6 @@ onMounted(async () => await getItemPackingTypes());
search-url="advanceTickets"
:data-key="props.dataKey"
:search-button="true"
:hidden-tags="['search']"
:unremovable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']"
>
<template #tags="{ tag, formatFn }">

View File

@ -59,7 +59,6 @@ onMounted(async () => {
/>
<VnFilterPanel
:data-key="props.dataKey"
:hidden-tags="['search']"
:un-removable-params="['warehouseFk', 'originScopeDays ', 'futureScopeDays']"
>
<template #tags="{ tag, formatFn }">

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref, computed, onUnmounted } from 'vue';
import { onMounted, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectCache from 'src/components/common/VnSelectCache.vue';
@ -170,8 +170,6 @@ onMounted(async () => {
const filteredColumns = columns.value.filter((col) => col.name !== 'actions');
allColumnNames.value = filteredColumns.map((col) => col.name);
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>

View File

@ -133,6 +133,7 @@ function reloadData() {
option-value="id"
id="deviceProductionFk"
hide-selected
data-cy="pda-dialog-select"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -14,6 +14,7 @@ import FormModel from 'components/FormModel.vue';
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
import VnRadio from 'src/components/common/VnRadio.vue';
import { useState } from 'src/composables/useState';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const user = useState().getUser();
@ -149,27 +150,11 @@ async function autofillBic(worker) {
hide-selected
:rules="validate('Worker.company')"
/>
<VnSelect
<VnSelectWorker
:label="t('worker.summary.boss')"
v-model="data.bossFk"
url="Workers/search"
option-value="id"
option-label="name"
hide-selected
:rules="validate('Worker.boss')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt.nickname }},
{{ scope.opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
</VnRow>
<VnRow>
<VnInput

View File

@ -18,6 +18,7 @@ import RightMenu from 'src/components/common/RightMenu.vue';
import WorkerFilter from './WorkerFilter.vue';
import { useState } from 'src/composables/useState';
import axios from 'axios';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const tableRef = ref();
@ -260,26 +261,10 @@ async function autofillBic(worker) {
option-label="code"
hide-selected
/>
<VnSelect
<VnSelectWorker
:label="t('worker.summary.boss')"
v-model="data.bossFk"
url="Workers/search"
option-value="id"
option-label="name"
hide-selected
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt.nickname }},
{{ scope.opt.code }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
/>
</VnRow>
<VnRow>
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
@ -376,6 +361,7 @@ async function autofillBic(worker) {
<i18n>
es:
Create worker: Crear trabajador
Search worker: Buscar trabajador
You can search by worker id or name: Puedes buscar por id o nombre del trabajador
</i18n>

View File

@ -32,7 +32,12 @@ const agencyOptions = ref([]);
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
<template #form="{ data, validate }">
<VnRow>
<VnInput :label="t('Name')" clearable v-model="data.name" />
<VnInput
data-cy="zone-basic-data-name"
:label="t('Name')"
clearable
v-model="data.name"
/>
</VnRow>
<VnRow>

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, onUnmounted } from 'vue';
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import ZoneEventsPanel from './ZoneEventsPanel.vue';
@ -40,8 +40,6 @@ const onZoneEventFormClose = () => {
showZoneEventForm.value = false;
zoneEventsFormProps.value = {};
};
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>

View File

@ -28,11 +28,7 @@ const agencies = ref([]);
@on-fetch="(data) => (agencies = data)"
auto-load
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:hidden-tags="['search']"
>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag }">
<div class="q-gutter-x-xs">
<strong>{{ t(`filterPanel.${tag.label}`) }}: </strong>

View File

@ -0,0 +1,20 @@
describe('ItemLastEntries', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('buyer');
cy.visit('/#/item/1/last-entries');
cy.intercept('GET', /.*lastEntriesFilter/).as('item');
cy.waitForElement('tbody');
});
it('should filter by agency', () => {
cy.get('tbody > tr')
.its('length')
.then((rowCount) => {
cy.get('[data-cy="hideInventory"]').click();
cy.wait('@item');
cy.waitForElement('tbody');
cy.get('tbody > tr').should('have.length.greaterThan', rowCount);
});
});
});

View File

@ -1,6 +1,5 @@
describe('WorkerPda', () => {
const deviceProductionField =
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
const select = '[data-cy="pda-dialog-select"]';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@ -9,7 +8,8 @@ describe('WorkerPda', () => {
it('assign pda', () => {
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get(deviceProductionField).type('{downArrow}{enter}');
cy.get(select).click();
cy.get(select).type('{downArrow}{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
});

View File

@ -1,5 +1,6 @@
describe('ZoneBasicData', () => {
const notification = '.q-notification__message';
const priceBasicData = '[data-cy="Price_input"]';
beforeEach(() => {
cy.viewport(1280, 720);
@ -8,14 +9,20 @@ describe('ZoneBasicData', () => {
});
it('should throw an error if the name is empty', () => {
cy.get('.q-card > :nth-child(1)').clear();
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(notification).should('contains.text', "can't be blank");
});
it('should throw an error if the price is empty', () => {
cy.get(priceBasicData).clear();
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'cannot be blank');
});
it("should edit the basicData's zone", () => {
cy.get('.q-card > :nth-child(1)').type(' modified');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Data saved');
cy.checkNotification('Data saved');
});
});