0
0
Fork 0

Compare commits

..

22 Commits

Author SHA1 Message Date
Alex Moreno 68729d2e77 refactor: order functions 2024-09-11 11:10:38 +02:00
Alex Moreno e83715ecbf Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 5926_pda_worker_docuware 2024-09-11 08:48:52 +02:00
Javier Segarra 893217cdd2 Merge branch 'dev' into 5926_pda_worker_docuware 2024-07-23 21:09:12 +00:00
Javier Segarra 4faf1335ee Merge branch 'dev' into 5926_pda_worker_docuware 2024-07-12 23:02:30 +02:00
Javier Segarra ef1316d5b0 Merge branch 'dev' into 5926_pda_worker_docuware 2024-07-08 12:12:01 +00:00
Javier Segarra 67cd4f9212 feat: #5926 resolve comments 2024-07-08 12:23:52 +02:00
Javier Segarra 8c1048b5af feat: remove quasar.config event 2024-07-08 12:22:02 +02:00
Javier Segarra 55eaf3bd3e Merge branch 'dev' into 5926_pda_worker_docuware 2024-07-08 11:16:33 +02:00
Javier Segarra e224d172bb Merge branch 'dev' into 5926_pda_worker_docuware 2024-06-17 10:08:23 +02:00
Javier Segarra ea0398df61 fix: #5926 fix downdload function 2024-06-17 10:08:08 +02:00
Javier Segarra c626a10a98 updates 2024-06-07 01:59:10 +02:00
Javier Segarra 3eaefe8701 test: 5926: imrpove 2024-06-03 14:13:02 +02:00
Javier Segarra c3d08c94d1 feat: 5926: Refresh button 2024-06-03 12:24:06 +02:00
Javier Segarra 6c91fee139 test: #5926 Mock API REquest 2024-06-03 12:18:42 +02:00
Javier Segarra 035a3cd0ae feat: updates 2024-05-31 09:27:50 +02:00
Javier Segarra f3237adbb9 Merge branch 'dev' into 5926_pda_worker_docuware 2024-05-30 07:55:19 +02:00
Javier Segarra 6ff5c73a78 downloadFile 2024-05-22 15:42:14 +02:00
Javier Segarra 81e5bfd93c update 2024-05-22 12:33:28 +02:00
Javier Segarra c1fd150204 update 2024-05-22 09:07:39 +02:00
Javier Segarra 67db3bc5bb updates 2024-05-21 21:07:27 +02:00
Javier Segarra 2c2f2b3b0d Merge branch 'dev' into 5926_pda_worker_docuware 2024-05-21 11:15:39 +02:00
Javier Segarra 2e19e9baa9 refs #5926: Add QIcon 2024-05-20 22:39:05 +02:00
318 changed files with 6384 additions and 10916 deletions

View File

@ -58,7 +58,7 @@ module.exports = {
rules: {
'prefer-promise-reject-errors': 'off',
'no-unused-vars': 'warn',
"vue/no-multiple-template-root": "off" ,
'vue/no-multiple-template-root': 'off',
// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},

View File

@ -1,364 +1,3 @@
# Version 24.40 - 2024-10-02
### Added 🆕
- chore: refs #4074 admit several acls by:jorgep
- chore: refs #4074 drop workerCreate by:jorgep
- chore: refs #4074 fix tests by:jorgep
- chore: refs #4074 wip replace useRole for useAcl by:jorgep
- chore: refs #7155 remove console.log by:alexm
- chore: refs #7155 typo by:alexm
- chore: refs #7663 add test by:jorgep
- chore: refs #7663 create test wip by:jorgep
- chore: refs #7663 drop useless code (origin/7663-setWeight) by:jorgep
- chore: refs #7828 fix e2e by:jorgep
- feat(AccountBasicData): add twoFactorFk by:alexm
- feat: add max rule by:Javier Segarra
- feat: add shortcut add event in some subSections by:Javier Segarra
- feat: add shortcut more buttons (origin/add_shortcut_add_subSections) by:Javier Segarra
- feat: add tooltip CustomerNewCustomAgent by:Javier Segarra
- feat: apply color when today by:Javier Segarra
- feat: change label because its more natural by:Javier Segarra
- feat: change order by:Javier Segarra
- feat: change QBadge color by:Javier Segarra
- feat: change url CustomerList by:Javier Segarra
- feat: copy customer countryFk by:Javier Segarra
- feat: create VnSelectEnum and add in AccountBasicData and ClaimBasicData by:alexm
- feat: CustomerBalance by:Javier Segarra
- feat: CustomerConsumptionFilter by:Javier Segarra
- feat: customer consumption (origin/7830-customerDesplegables, 7830-customerDesplegables) by:alexm
- feat: CustomerCreateTicket by:Javier Segarra
- feat: CustomerCredit section by:Javier Segarra
- feat: CustomerGreuges by:Javier Segarra
- feat: CustomerSample to VnTable by:Javier Segarra
- feat: global handler (origin/fix_global_handler, fix_global_handler) by:alexm
- feat: goToSupplier by:Javier Segarra
- feat: handle newValue by:Javier Segarra
- feat: handle same multiple CP by:Javier Segarra
- feat: hide menus on small view (origin/hideMenu) by:jorgep
- feat: minor changes by:Javier Segarra
- feat: orderCreateDialog by:Javier Segarra
- feat: refs #4074 drop useless code by:jorgep
- feat: refs #4074 useAcl in vnSelectDialog by:jorgep
- feat: refs #6346 new wagon type section by:Jon
- feat: refs #7404 add m3 and fix detail by:pablone
- feat: refs #7404 add some style to the form and reorganize fields by:pablone
- feat: refs #7404 add travel m3 to reserves form by:pablone
- feat: refs #7404 style dynamic text color by:pablone
- feat: refs #7404 travel m3 form by:pablone
- feat: refs #7500 added VnImg to show files by:Jon
- feat: refs #7663 add setWeight menu opt (wip) by:jorgep
- feat: refs #7663 fine tunning by:jorgep
- feat: refs #7828 create axios instance which no manage errors (origin/7828-makeCorrectCalls) by:jorgep
- feat: refs #7828 useAcl & cherry pick mail data worker by:jorgep
- feat: remove cli warnings by:Javier Segarra
- feat: show preparation field by:Javier Segarra
- feat: stateGroupedFilter by:Javier Segarra
- feat: translations fixed by:jgallego
- feat(TravelList): add daysOnward by:alexm
- feat: travel m3 by:pablone
- feat: use disableInifiniteScroll property by:Javier Segarra
- feat: VnImg draggable by:Javier Segarra
- feat: vnLocation changes by:Javier Segarra
- feat: vnSelect exprBuilder by:Javier Segarra
- fix: refs #7404 remove some style by:pablone
- fix: refs #7404 style non center pop up (origin/7404-fixFront) by:pablone
- fix: refs #7404 translates and some minor style fixes by:pablone
- fix: styles by:Javier Segarra
- perf: improve style by:Javier Segarra
### Changed 📦
- perf: CustomerBalance by:Javier Segarra
- perf: CustomerBasicData by:Javier Segarra
- perf: CustomerBasicData.salesPersonFk by:Javier Segarra
- perf: CustomerSummary by:Javier Segarra
- perf: customerSummaryTable by:Javier Segarra
- perf: disable card option by:Javier Segarra
- perf: i18n by:Javier Segarra
- perf: improve by:Javier Segarra
- perf: improve style by:Javier Segarra
- perf: imrpove exprBuilder by:Javier Segarra
- perf: minor comments by:Javier Segarra
- perf: refs #6346 previous changes by:Jon
- perf: sendEmail customerConsumption by:Javier Segarra
- perf: solve reload CardSummary component by:Javier Segarra
- perf: update CustommerDescriptor by:Javier Segarra
- refactor: refs #4074 accept array by:jorgep
- refactor: refs #4074 rollback by:jorgep
- refactor: refs #4074 use acl & drop useless roles by:jorgep
- refactor: refs #4074 useAcl in navigationStore & router by:jorgep
- refactor: refs #4074 use fn (origin/4074-useAcls) by:jorgep
- refactor: refs #4074 use VnTitle by:jorgep
- refactor: refs #6346 deleted front error checking by:Jon
- refactor: refs #6346 requested changes by:Jon
- refactor: refs #6346 wagons to VnTable by:Jon
- refactor: refs #7500 deleted useless code by:Jon
- refactor: refs #7500 refactor vnimg when storage is dms by:Jon
- refactor: refs #7828 wip by:jorgep
### Fixed 🛠️
- chore: refs #4074 fix tests by:jorgep
- chore: refs #7828 fix e2e by:jorgep
- feat: refs #7404 add m3 and fix detail by:pablone
- feat: translations fixed by:jgallego
- fix: #5938 grouped filter by:Javier Segarra
- fix: #6943 fix customerSummaryTable by:Javier Segarra
- fix: #6943 show nickname salesPerson by:Javier Segarra
- fix: address-create i18n by:Javier Segarra
- fix: comments (origin/6943_fix_customer_module, 6943_fix_customer_module) by:Javier Segarra
- fix: CusomerSummary to Address by:Javier Segarra
- fix: CustomerAddress mobile by:Javier Segarra
- fix: CustomerBillingData by:Javier Segarra
- fix: Customerconsumption by:Javier Segarra
- fix: customer credit opinion by:alexm
- fix: CustomerCreditOpinion workerDescriptor by:Javier Segarra
- fix: CustomerDescriptorAccount by:Javier Segarra
- fix: CustomerDescriptor.bussinessTypeFk by:Javier Segarra
- fix: CustomerFilter by:Javier Segarra
- fix: CustomerGreuges by:Javier Segarra
- fix: CustomerMandates by:Javier Segarra
- fix: Customer module find salesPersons out of first get by:Javier Segarra
- fix: CustomerRecovery transalate label by:Javier Segarra
- fix: CustomerSamples by:Javier Segarra
- fix: customerSummaryToTicketList button by:Javier Segarra
- fix: CustomerWebPayment by:Javier Segarra
- fix: CustommerSummaryTable Proxy by:Javier Segarra
- fix: deleted code by:Jon
- fix: duplicate code by:alexm
- fix: emit:updateModelValue by:Javier Segarra
- fix: fixed wagon tests by:Jon
- fix: fix wagon list reload by:Jon
- fix: i18n en preparation label by:Javier Segarra
- fix: infiniteScroll by:Javier Segarra
- fix: isFullMovable checkbox by:Javier Segarra
- fix: merge conflicts by:Javier Segarra
- fix: merge in dev by:alexm
- fix: missing code by:Jon
- fix: Options VnSelect properties by:Javier Segarra
- fix: refs #4074 await to watch by:jorgep
- fix: refs #4074 drop wrong acl by:jorgep
- fix: refs #4074 workerCard data-key by:jorgep
- fix: refs #6346 fix list and create by:pablone
- fix: refs #6943 prevent null (origin/6943-warmfix-preventNull) by:jorgep
- fix: refs #7155 remove userParams in watcher (7155-travel_daysOnward) by:alexm
- fix: refs #7155 use chip-locale (origin/7155-travel_daysOnward_2, 7155-travel_daysOnward_2) by:alexm
- fix: refs #7404 remove console.log by:pablone
- fix: refs #7404 remove from test by:pablone
- fix: refs #7404 remove some style by:pablone
- fix: refs #7404 revert commit prevent production access by:pablone
- fix: refs #7404 style non center pop up (origin/7404-fixFront) by:pablone
- fix: refs #7404 translates and some minor style fixes by:pablone
- fix: refs #7500 fixed e2e test by:Jon
- fix: refs #7500 fixed showing images wrongly by:Jon
- fix: refs #7830 customer credit by:pablone
- fix: refs #7830 remove console.log by:pablone
- fix: remove console.log by:pablone
- fix: remove FetchData by:Javier Segarra
- fix: remove FIXME (origin/6943_fix_customerSummaryTable) by:Javier Segarra
- fix: remove print variable by:Javier Segarra
- fix: remove promise execution by:Javier Segarra
- fix: reset VnTable scroll properties by:Javier Segarra
- fix: rule by:Javier Segarra
- fix: solve conflicts from master to test by:Javier Segarra
- fix: split params (origin/warmfix-addSearchUrl) by:jorgep
- fix: state cell by:Javier Segarra
- fix: stop call back event hasMoreData by:Javier Segarra
- fix: styles by:Javier Segarra
- fix: SupplierFiscalData VnLocation (origin/fix_supplierFD_location) by:Javier Segarra
- fix: VnLocation test by:Javier Segarra
- fix(VnTable): header background-color by:alexm
- fix(VnTable): sanitizer value is defined by:carlossa
- fix: wagon reload (origin/FixWagonRedirect) by:Jon
- fix: workerDms filter workerFk by:alexm
- fix(WorkerList): add type email by:alexm
- Merge remote-tracking branch 'origin/7830-customerDesplegables' into 6943_fix_customerSummaryTable by:Javier Segarra
- refs #7155 scopeDays fix (origin/7155-scopeDays) by:carlossa
- revert: vnUSerLink change by:Javier Segarra
- test: fix test (7677_vnLocation_perf) by:Javier Segarra
# Version 24.38 - 2024-09-17
### Added 🆕
- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep
- chore: refs #7323 worker changes by:jorgep
- chore: refs #7353 fix warnings by:jorgep
- chore: refs #7353 use Vue component nomenclature by:jorgep
- chore: refs #7356 fix type by:jorgep
- feat(AccountConnections): use VnToken by:alexm
- feat: add key to routerView by:Javier Segarra
- feat: add plus shortcut in VnTable by:Javier Segarra
- feat: add row by:Javier Segarra
- feat: addRow withour dialog by:Javier Segarra
- feat: apply mixin by:Javier Segarra
- feat by:Javier Segarra
- feat: change navBar buttons by:Javier Segarra
- feat: dense rows by:Javier Segarra
- feat: fields with wrong name by:jgallego
- feat: fix bugs and filters by:Javier Segarra
- feat: fix refund parameters by:jgallego
- feat: handle create row by:Javier Segarra
- feat: handle dates by:Javier Segarra
- feat: handle qCheckbox 3rd state by:Javier Segarra
- feat: imrpove VnInputTime to set cursor at start by:Javier Segarra
- feat: keyShortcut directive by:Javier Segarra
- feat: minor fixes by:jgallego
- feat: only filter by isDestiny by:Javier Segarra
- feat: refs #211153 businessDataLinkGrafana by:robert
- feat: refs #7129 add km start and end on create form by:pablone
- feat: refs #7353 add filter & fix customTags by:jorgep
- feat: refs #7353 add locale by:jorgep
- feat: refs #7353 add no one opt by:jorgep
- feat: refs #7353 add right icons by:jorgep
- feat: refs #7353 imporve toDateFormat by:jorgep
- feat: refs #7353 salesPerson nickname & id by:jorgep
- feat: refs #7353 split sections by:jorgep
- feat: refs #7847 remove reload btn by:jorgep
- feat: refs #7847 remove reload fn by:jorgep
- feat: refs #7889 added shortcuts to modules by:Jon
- feat: refs #7911 added shortcut to modules by:Jon
- feat: refuncInvoiceForm component by:jgallego
- feat: remove duplicity by:Javier Segarra
- feat: remove future itemFixedPrices by:Javier Segarra
- feat: replace stickyButtons by subtoolbar by:Javier Segarra
- feat: required validation by:Javier Segarra
- feat: show bad dates by:Javier Segarra
- feat: showdate icons by:Javier Segarra
- feat: solve ItemFixedFilterPanel by:Javier Segarra
- feat: transfer an invoice by:jgallego
- feat: try to fix ItemFixedFilterPanel by:Javier Segarra
- feat: unnecessary changes by:Javier Segarra
- feat: update changelog (origin/7896_down_devToTest_2436) by:Javier Segarra
- feat: updates by:Javier Segarra
- feat: update version and changelog by:Javier Segarra
- feat: vnInput\* by:Javier Segarra
- feat: with VnTable by:Javier Segarra
- refs #6772 feat: fix approach by:Javier Segarra
- refs #6772 feat: refresh shelving.basic-data by:Javier Segarra
- style: show subName value by:Javier Segarra
### Changed 📦
- perf: add v-shortcut in VnCard by:Javier Segarra
- perf: approach by:Javier Segarra
- perf: change directive location by:Javier Segarra
- perf: change slots order by:Javier Segarra
- perf: examples by:Javier Segarra
- perf: hide icon for VnInputDate by:Javier Segarra
- perf: improve ItemFixedPricefilterPanel by:Javier Segarra
- perf: improve mainShrotcutMixin by:Javier Segarra
- perf: minor clean code by:Javier Segarra
- perf: onRowchange by:Javier Segarra
- perf: order by by:Javier Segarra
- perf: order components by:Javier Segarra
- perf: refs #7889 perf shortcut test by:Jon
- perf: remove console.log by:Javier Segarra
- perf: remove icons in header slot by:Javier Segarra
- perf: remove print variables by:Javier Segarra
- perf: restore CustomerBasicData by:Javier Segarra
- refactor: deleted useless prop by:Jon
- refactor: deleted useless prop in FetchedTags by:Jon
- refactor: refs #7323 drop useless code by:jorgep
- refactor: refs #7353 clients correction by:jorgep
- refactor: refs #7353 clients correction wip by:jorgep
- refactor: refs #7353 ease logic by:jorgep
- refactor: refs #7353 order correction by:jorgep
- refactor: refs #7353 simplify code by:jorgep
- refactor: refs #7353 tickets correction by:jorgep
- refactor: refs #7353 use global locales by:jorgep
- refactor: refs #7354 changed descriptor menu options by:Jon
- refactor: refs #7354 changed icon color in table and notification when deleting a zone by:Jon
- refactor: refs #7354 fix tableFilters by:Jon
- refactor: refs #7354 modified VnInputTime by:Jon
- refactor: refs #7354 refactor deliveryPanel by:Jon
- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon
- refactor: refs #7354 requested changes by:Jon
- refactor: refs #7354 reverse deliveryPanel changes by:Jon
- refactor: refs #7354 Zone migration changes by:Jon
- refactor: refs #7889 deleted subtitle attr and use keyBinding instead by:Jon
- refactor: refs #7889 modified shortcut and dashboard, and added tootlip in LeftMenu by:Jon
- refs #6722 perf: not fetch when id not exists by:Javier Segarra
- refs #6772 perf: change variable name by:JAVIER SEGARRA MARTINEZ
- refs #6772 perf: use ArrayData (6772_reload_sections) by:Javier Segarra
- refs #7283 refactor fix ItemDescriptor by:carlossa
- refs #7283 refactor ItexDescriptor by:carlossa
### Fixed 🛠️
- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep
- chore: refs #7353 fix warnings by:jorgep
- chore: refs #7356 fix type by:jorgep
- feat: fix bugs and filters by:Javier Segarra
- feat: fix refund parameters by:jgallego
- feat: minor fixes by:jgallego
- feat: refs #7353 add filter & fix customTags by:jorgep
- feat: try to fix ItemFixedFilterPanel by:Javier Segarra
- fix: add border-top by:Javier Segarra
- fix: added missing descriptors and small details by:Jon
- fix branch by:carlossa
- fix: call upsert when crudModel haschanges by:Javier Segarra
- fix(ClaimList): fix summary by:alexm
- fix: cli warnings by:Javier Segarra
- fix: editTableOptions by:Javier Segarra
- fix events and descriptor menu by:Jon
- fix: InvoiceIn sections (origin/6772_reload_sections) by:Javier Segarra
- fix: minor changes by:Javier Segarra
- fix: minor error whit dates by:Javier Segarra
- fix: module icon by:Javier Segarra
- fix: options QDate by:Javier Segarra
- fix: refs #6900 e2e error by:jorgep
- fix: refs #6900 rollback by:jorgep
- fix: refs #7353 css by:jorgep
- fix: refs #7353 hide search param (origin/7353-warmfix-fixSearchbar) by:jorgep
- fix: refs #7353 iron out filter by:jorgep
- fix: refs #7353 iron out ticket table by:jorgep
- fix: refs #7353 padding by:jorgep
- fix: refs #7353 salesClientTable by:jorgep
- fix: refs #7353 salesorderTable by:jorgep
- fix: refs #7353 saleTicketMonitors by:jorgep
- fix: refs #7353 use same datakey by:jorgep
- fix: refs #7353 vnTable colors by:jorgep
- fix: refs #7354 e2e tests by:Jon
- fix: refs #7354 fix delivery days by:Jon
- fix: refs #7354 fix list searchbar and filters by:Jon
- fix: refs #7354 fix VnSearchbar search for zone section & finished basic tests by:Jon
- fix: refs #7354 fix VnTable filters and agency field by:Jon
- fix: refs #7354 fix zoneSearchbar by:Jon
- fix: refs #7354 requested changes by:Jon
- fix: refs #7356 colors by:jorgep
- fix: refs #7356 create claim dialog by:jorgep
- fix: refs #7889 fixed shortcut test by:Jon
- fix: refs #7903 fixed ticket's search bar and keybinding tooltip by:Jon
- fix: refs #7911 fixed shortcut and related files by:Jon
- fix: remove condition duplicated by:Javier Segarra
- fix: remove property by:Javier Segarra
- fix tootltip by:carlossa
- fix traduction by:carlossa
- fix(VnSectionMain): add QPage by:alexm
- fix(zone): zoneLocation and the others searchbar by:alexm
- refactor: refs #7354 fix tableFilters by:Jon
- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon
- refs #6772 feat: fix approach by:Javier Segarra
- refs #6772 fix: claimPhoto reload by:Javier Segarra
- refs #6896 fix searchbar by:carlossa
- refs #6897 fix entry by:carlossa
- refs #6899 fix invoiceFix by:carlossa
- refs #6899 fix order by:carlossa
- refs #7283 fix by:carlossa
- refs #7283 fix ItemDescriptor warehouse by:carlossa
- refs #7283 refactor fix ItemDescriptor by:carlossa
- refs #7355 #7366 fix account, summary, list, travelList, tooltip by:carlossa
- refs #7355 fix accountPrivileges by:carlossa
- refs #7355 fix accounts, vnTable by:carlossa
- refs #7355 fix privileges by:carlossa
- refs #7355 fix roles filters by:carlossa
- refs #7355 fix total by:carlossa
- refs #7355 fix views summarys, entryList, travelList refact by:carlossa
- refs #7366 fix travel hours by:carlossa
- test: fix e2e by:Javier Segarra
# Version 24.36 - 2024-08-27
### Added 🆕

View File

@ -1,6 +1,6 @@
{
"name": "salix-front",
"version": "24.44.0",
"version": "24.40.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",
@ -62,4 +62,4 @@
"vite": "^5.1.4",
"vitest": "^0.31.1"
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<script setup>
import { reactive, ref, onMounted, nextTick, computed } from 'vue';
import { reactive, ref, onMounted, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import VnInput from 'src/components/common/VnInput.vue';
@ -7,21 +7,16 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import FormModelPopup from './FormModelPopup.vue';
import { useState } from 'src/composables/useState';
defineProps({ showEntityField: { type: Boolean, default: true } });
const emit = defineEmits(['onDataSaved']);
const { t } = useI18n();
const bicInputRef = ref(null);
const state = useState();
const customer = computed(() => state.get('customer'));
const bankEntityFormData = reactive({
name: null,
bic: null,
countryFk: customer.value?.countryFk,
countryFk: null,
id: null,
});
@ -31,8 +26,8 @@ const countriesFilter = {
const countriesOptions = ref([]);
const onDataSaved = (...args) => {
emit('onDataSaved', ...args);
const onDataSaved = (formData, requestResponse) => {
emit('onDataSaved', formData, requestResponse);
};
onMounted(async () => {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -44,7 +44,7 @@ onMounted(async () => {
async function fetch(fetchFilter = {}) {
try {
const filter = { ...fetchFilter, ...$props.filter }; // eslint-disable-line vue/no-dupe-keys
const filter = Object.assign(fetchFilter, $props.filter); // eslint-disable-line vue/no-dupe-keys
if ($props.where && !fetchFilter.where) filter.where = $props.where;
if ($props.sortBy) filter.order = $props.sortBy;
if ($props.limit) filter.limit = $props.limit;

View File

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

View File

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

View File

@ -297,12 +297,11 @@ const removeTag = (index, params, search) => {
/>
</QItem>
<QItem class="q-mt-lg">
<QBtn
icon="add_circle"
shortcut="+"
flat
<QIcon
name="add_circle"
class="fill-icon-on-hover q-px-xs"
color="primary"
size="sm"
@click="tagValues.push({})"
/>
</QItem>

View File

@ -35,7 +35,7 @@ const itemComputed = computed(() => {
</QItemSection>
<QItemSection>
{{ t(itemComputed.title) }}
<QTooltip v-if="item.keyBinding">
<QTooltip>
{{ 'Ctrl + Alt + ' + item?.keyBinding?.toUpperCase() }}
</QTooltip>
</QItemSection>
@ -44,6 +44,7 @@ const itemComputed = computed(() => {
</QItemSection>
</QItem>
</template>
<style lang="scss" scoped>
.q-item {
min-height: 5vh;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@ import { useArrayData } from 'composables/useArrayData';
const model = defineModel({ type: Object });
const $props = defineProps({
name: {
type: [String, Boolean],
type: String,
default: '',
},
label: {

View File

@ -10,7 +10,7 @@ import FormModelPopup from 'components/FormModelPopup.vue';
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
import VnTableColumn from 'components/VnTable/VnColumn.vue';
import VnFilter from 'components/VnTable/VnFilter.vue';
import VnTableFilter from 'components/VnTable/VnFilter.vue';
import VnTableChip from 'components/VnTable/VnChip.vue';
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
import VnLv from 'components/ui/VnLv.vue';
@ -53,10 +53,6 @@ const $props = defineProps({
type: Boolean,
default: true,
},
bottom: {
type: Object,
default: null,
},
cardClass: {
type: String,
default: 'flex-one',
@ -75,7 +71,7 @@ const $props = defineProps({
},
hasSubToolbar: {
type: Boolean,
default: null,
default: true,
},
disableOption: {
type: Object,
@ -101,18 +97,6 @@ const $props = defineProps({
type: String,
default: '90vh',
},
chipLocale: {
type: String,
default: null,
},
footer: {
type: Boolean,
default: false,
},
disabledAttr: {
type: Boolean,
default: false,
},
});
const { t } = useI18n();
const stateStore = useStateStore();
@ -133,8 +117,6 @@ const showForm = ref(false);
const splittedColumns = ref({ columns: [] });
const columnsVisibilitySkipped = ref();
const createForm = ref();
const tableFilterRef = ref([]);
const tableRef = ref();
const tableModes = [
{
@ -160,7 +142,7 @@ onMounted(() => {
quasar.platform.is.mobile && !$props.disableOption?.card
? CARD_MODE
: $props.defaultMode;
stateStore.rightDrawer = quasar.screen.gt.xs;
stateStore.rightDrawer = true;
columnsVisibilitySkipped.value = [
...splittedColumns.value.columns
.filter((c) => c.visible == false)
@ -210,7 +192,7 @@ function setUserParams(watchedParams, watchedOrder) {
function sanitizer(params) {
for (const [key, value] of Object.entries(params)) {
if (value && typeof value == 'object') {
if (typeof value == 'object') {
const param = Object.values(value)[0];
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
}
@ -237,7 +219,7 @@ function splitColumns(columns) {
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
if ($props.isEditable && col.disable == null) col.disable = false;
if ($props.useModel && col.columnFilter != false)
col.columnFilter = { inWhere: true, ...col.columnFilter };
col.columnFilter = { ...col.columnFilter, inWhere: true };
splittedColumns.value.columns.push(col);
}
// Status column
@ -315,21 +297,12 @@ defineExpose({
redirect: redirectFn,
selected,
CrudModelRef,
params,
tableRef,
});
function handleOnDataSaved(_) {
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
function handleOnDataSaved(_, res) {
if (_.onDataSaved) _.onDataSaved(this);
else $props.create.onDataSaved(_);
}
function handleScroll() {
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
}
</script>
<template>
<QDrawer
@ -347,13 +320,6 @@ function handleScroll() {
:search-url="searchUrl"
:redirect="!!redirect"
@set-user-params="setUserParams"
:disable-submit-event="true"
@remove="
(key) =>
tableFilterRef
.find((f) => f.props?.column.name == key)
?.addFilter()
"
>
<template #body>
<div
@ -363,8 +329,7 @@ function handleScroll() {
)"
:key="col.id"
>
<VnFilter
ref="tableFilterRef"
<VnTableFilter
:column="col"
:data-key="$attrs['data-key']"
v-model="params[columnName(col)]"
@ -388,25 +353,21 @@ function handleScroll() {
:columns="splittedColumns.columns"
/>
</template>
<template #tags="{ tag, formatFn }" v-if="chipLocale">
<div class="q-gutter-x-xs">
<strong>{{ t(`${chipLocale}.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
</VnFilterPanel>
</QScrollArea>
</QDrawer>
<!-- class in div to fix warn-->
<CrudModel
v-bind="$attrs"
:class="$attrs['class'] ?? 'q-px-md'"
:limit="$attrs['limit'] ?? 20"
:limit="20"
ref="CrudModelRef"
@on-fetch="(...args) => emit('onFetch', ...args)"
:search-url="searchUrl"
:disable-infinite-scroll="isTableMode"
@save-changes="reload"
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
:auto-load="hasParams || $attrs['auto-load']"
>
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
@ -414,10 +375,8 @@ function handleScroll() {
</template>
<template #body="{ rows }">
<QTable
ref="tableRef"
v-bind="table"
class="vnTable"
:class="{ 'last-row-sticky': $props.footer }"
:columns="splittedColumns.columns"
:rows="rows"
v-model:selected="selected"
@ -426,8 +385,13 @@ function handleScroll() {
card-container-class="grid-three"
flat
:style="isTableMode && `max-height: ${tableHeight}`"
:virtual-scroll="isTableMode"
@virtual-scroll="handleScroll"
virtual-scroll
@virtual-scroll="
(event) =>
event.index > rows.length - 2 &&
($props.crudModel?.paginate ?? true) &&
CrudModelRef.vnPaginateRef.paginate()
"
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
@update:selected="emit('update:selected', $event)"
>
@ -451,17 +415,13 @@ function handleScroll() {
<QBtn
v-if="$props.rightSearch"
icon="filter_alt"
class="bg-vn-section-color q-ml-sm"
class="bg-vn-section-color q-ml-md"
dense
@click="stateStore.toggleRightDrawer()"
/>
</template>
<template #header-cell="{ col }">
<QTh
v-if="col.visible ?? true"
:style="col.headerStyle"
:class="col.headerClass"
>
<QTh v-if="col.visible ?? true">
<div
class="column self-start q-ml-xs ellipsis"
:class="`text-${col?.align ?? 'left'}`"
@ -477,7 +437,7 @@ function handleScroll() {
:search-url="searchUrl"
/>
</div>
<VnFilter
<VnTableFilter
v-if="$props.columnSearch"
:column="col"
:show-title="true"
@ -507,7 +467,6 @@ function handleScroll() {
auto-width
class="no-margin q-px-xs"
:class="[getColAlign(col), col.columnClass]"
:style="col.style"
v-if="col.visible ?? true"
@click.ctrl="
($event) =>
@ -536,7 +495,6 @@ function handleScroll() {
:class="getColAlign(col)"
class="sticky no-padding"
@click="stopEventPropagation($event)"
:style="col.style"
>
<QBtn
v-for="(btn, index) of col.actions"
@ -544,9 +502,8 @@ function handleScroll() {
:key="index"
:title="btn.title"
:icon="btn.icon"
class="q-pa-xs"
class="q-px-sm"
flat
dense
:class="
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
"
@ -557,29 +514,6 @@ function handleScroll() {
/>
</QTd>
</template>
<template #bottom v-if="bottom">
<slot name="bottom-table">
<QBtn
@click="
() =>
createAsDialog
? (showForm = !showForm)
: handleOnDataSaved(create)
"
class="cursor-pointer fill-icon"
color="primary"
icon="add_circle"
size="md"
round
flat
shortcut="+"
:disabled="!disabledAttr"
/>
<QTooltip>
{{ createForm.title }}
</QTooltip>
</slot>
</template>
<template #item="{ row, colsMap }">
<component
:is="$props.redirect ? 'router-link' : 'span'"
@ -696,22 +630,10 @@ function handleScroll() {
</QCard>
</component>
</template>
<template #bottom-row="{ cols }" v-if="$props.footer">
<QTr v-if="rows.length" style="height: 30px">
<QTh
v-for="col of cols.filter((cols) => cols.visible ?? true)"
:key="col?.id"
class="text-center"
:class="getColAlign(col)"
>
<slot :name="`column-footer-${col.name}`" />
</QTh>
</QTr>
</template>
</QTable>
</template>
</CrudModel>
<QPageSticky v-if="$props.create" :offset="[20, 20]" style="z-index: 2">
<QPageSticky :offset="[20, 20]" style="z-index: 2">
<QBtn
@click="
() =>
@ -722,8 +644,8 @@ function handleScroll() {
icon="add"
shortcut="+"
/>
<QTooltip self="top right">
{{ createForm?.title }}
<QTooltip>
{{ createForm.title }}
</QTooltip>
</QPageSticky>
<QDialog v-model="showForm" transition-show="scale" transition-hide="scale">
@ -775,7 +697,7 @@ es:
}
.bg-header {
background-color: var(--vn-accent-color);
background-color: var(--vn-header-color);
color: var(--vn-text-color);
}
@ -783,6 +705,18 @@ es:
color: var(--vn-text-color);
}
.q-table--dark .q-table__bottom,
.q-table--dark thead,
.q-table--dark tr,
.q-table--dark th,
.q-table--dark td {
border-color: var(--vn-section-color);
}
.q-table__container > div:first-child {
background-color: var(--vn-page-color);
}
.grid-three {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, max-content));
@ -811,15 +745,8 @@ es:
}
}
.q-table {
th {
padding: 0;
}
&__top {
padding: 12px 0px;
top: 0;
}
.q-table th {
padding: 0;
}
.vnTable {
@ -832,7 +759,6 @@ es:
}
.q-table__top {
top: 0;
padding: 12px 0;
}
tbody {
.q-checkbox {
@ -857,18 +783,6 @@ es:
background-color: var(--vn-section-color);
z-index: 1;
}
table tbody th {
position: relative;
}
}
.last-row-sticky {
tbody:nth-last-child(1) {
@extend .bg-header;
position: sticky;
z-index: 2;
bottom: 0;
}
}
.vn-label-value {
@ -914,12 +828,4 @@ es:
cursor: text;
user-select: all;
}
.q-table__container {
background-color: transparent;
}
.q-table__middle.q-virtual-scroll.q-virtual-scroll--vertical.scroll {
background-color: var(--vn-section-color);
}
</style>

View File

@ -135,7 +135,7 @@ onMounted(async () => {
});
</script>
<template>
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-sm q-px-sm" dense>
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-md q-px-sm" dense>
<QPopupProxy ref="popupProxyRef">
<QCard class="column q-pa-md">
<QIcon name="info" size="sm" class="info-icon">

View File

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

View File

@ -24,9 +24,7 @@ const stateStore = useStateStore();
const route = useRoute();
const router = useRouter();
const url = computed(() => {
if (props.baseUrl) {
return `${props.baseUrl}/${route.params.id}`;
}
if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`;
return props.customUrl;
});
const searchRightDataKey = computed(() => {
@ -42,10 +40,8 @@ onBeforeMount(async () => {
try {
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
await arrayData.fetch({ append: false, updateRouter: false });
} catch {
const { matched: matches } = router.currentRoute.value;
const { path } = matches.at(-1);
router.push({ path: path.replace(/:id.*/, '') });
} catch (e) {
router.push({ name: 'WorkerList' });
}
});
@ -83,7 +79,7 @@ if (props.baseUrl) {
<QPage>
<VnSubToolbar />
<div :class="[useCardSize(), $attrs.class]">
<RouterView :key="route.path" />
<RouterView :key="route.fullPath" />
</div>
</QPage>
</QPageContainer>

View File

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

View File

@ -17,15 +17,17 @@ const $props = defineProps({
},
});
let mixed;
const componentArray = computed(() => {
if (typeof $props.prop === 'object') return [$props.prop];
return $props.prop;
});
function mix(toComponent) {
if (mixed) return mixed;
const { component, attrs, event } = toComponent;
const customComponent = $props.components[component];
return {
mixed = {
component: customComponent?.component ?? component,
attrs: {
...toValueAttrs(attrs),
@ -35,6 +37,7 @@ function mix(toComponent) {
},
event: { ...customComponent?.event, ...event },
};
return mixed;
}
function toValueAttrs(attrs) {

View File

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

View File

@ -5,14 +5,12 @@ import { useRoute } from 'vue-router';
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
import axios from 'axios';
import VnUserLink from '../ui/VnUserLink.vue';
import { downloadFile } from 'src/composables/downloadFile';
import VnImg from 'components/ui/VnImg.vue';
import VnPaginate from 'components/ui/VnPaginate.vue';
import VnDms from 'src/components/common/VnDms.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import { useSession } from 'src/composables/useSession';
import VnUserLink from '../ui/VnUserLink.vue';
import { downloadFile } from 'src/composables/downloadFile';
const route = useRoute();
const quasar = useQuasar();
@ -20,7 +18,6 @@ const { t } = useI18n();
const rows = ref();
const dmsRef = ref();
const formDialog = ref({});
const token = useSession().getTokenMultimedia();
const $props = defineProps({
model: {
@ -92,23 +89,6 @@ const dmsFilter = {
};
const columns = computed(() => [
{
label: '',
name: 'file',
align: 'left',
component: VnImg,
props: (prop) => {
return {
storage: 'dms',
collection: null,
resolution: null,
id: prop.row.file.split('.')[0],
token: token,
class: 'rounded',
ratio: 1,
};
},
},
{
align: 'left',
field: 'id',
@ -162,6 +142,13 @@ const columns = computed(() => [
'model-value': Boolean(prop.value),
}),
},
{
align: 'left',
field: 'file',
label: t('globals.file'),
name: 'file',
component: 'span',
},
{
align: 'left',
field: 'worker',
@ -400,14 +387,7 @@ defineExpose({
/>
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn
fab
color="primary"
icon="add"
shortcut="+"
@click="showFormDialog()"
class="fill-icon"
>
<QBtn fab color="primary" icon="add" @click="showFormDialog()" class="fill-icon">
<QTooltip>
{{ t('Upload file') }}
</QTooltip>
@ -415,6 +395,10 @@ defineExpose({
</QPageSticky>
</template>
<style scoped>
.q-gutter-y-ms {
display: grid;
row-gap: 20px;
}
.labelColor {
color: var(--vn-label-color);
}

View File

@ -67,13 +67,9 @@ const mixinRules = [
requiredFieldRule,
...($attrs.rules ?? []),
(val) => {
const { min, max } = vnInputRef.value.$attrs;
const { min } = vnInputRef.value.$attrs;
if (!min) return null;
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
if (!max) return null;
if (max > 0) {
if (Math.floor(val) > max) return t('inputMax', { value: max });
}
},
];
</script>
@ -103,7 +99,6 @@ const mixinRules = [
@click="
() => {
value = null;
vnInputRef.focus();
emit('remove');
}
"
@ -121,10 +116,8 @@ const mixinRules = [
<i18n>
en:
inputMin: Must be more than {value}
inputMax: Must be less than {value}
es:
inputMin: Debe ser mayor a {value}
inputMax: Debe ser menor a {value}
</i18n>
<style lang="scss">
.q-field__append {

View File

@ -2,8 +2,6 @@
import { onMounted, watch, computed, ref } from 'vue';
import { date } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useAttrs } from 'vue';
import VnDate from './VnDate.vue';
const model = defineModel({ type: [String, Date] });
const $props = defineProps({
@ -16,20 +14,29 @@ const $props = defineProps({
default: true,
},
});
import { useValidator } from 'src/composables/useValidator';
const { validations } = useValidator();
const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
const vnInputDateRef = ref(null);
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
const dateFormat = 'DD/MM/YYYY';
const isPopupOpen = ref();
const hover = ref();
const mask = ref();
const $attrs = useAttrs();
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
onMounted(() => {
// fix quasar bug
mask.value = '##/##/####';
});
const styleAttrs = computed(() => {
return $props.isOutlined
? {
dense: true,
outlined: true,
rounded: true,
}
: {};
});
const formattedDate = computed({
get() {
@ -41,12 +48,15 @@ const formattedDate = computed({
let newDate;
if (value) {
// parse input
if (value.includes('/') && value.length >= 10) {
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
value = date.formatDate(
new Date(value).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ'
);
if (value.includes('/')) {
if (value.length == 6) value = value + new Date().getFullYear();
if (value.length >= 10) {
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
value = date.formatDate(
new Date(value).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ'
);
}
}
const [year, month, day] = value.split('-').map((e) => parseInt(e));
newDate = new Date(year, month - 1, day);
@ -69,46 +79,26 @@ const formattedDate = computed({
const popupDate = computed(() =>
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value
);
onMounted(() => {
// fix quasar bug
mask.value = '##/##/####';
});
watch(
() => model.value,
(val) => (formattedDate.value = val),
{ immediate: true }
);
const styleAttrs = computed(() => {
return $props.isOutlined
? {
dense: true,
outlined: true,
rounded: true,
}
: {};
});
const manageDate = (date) => {
formattedDate.value = date;
isPopupOpen.value = false;
};
</script>
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
ref="vnInputDateRef"
v-model="formattedDate"
class="vn-input-date"
:mask="mask"
placeholder="dd/mm/aaaa"
v-bind="{ ...$attrs, ...styleAttrs }"
:class="{ required: $attrs.required }"
:rules="mixinRules"
:rules="$attrs.required ? [requiredFieldRule] : null"
:clearable="false"
@click="isPopupOpen = true"
hide-bottom-space
>
<template #append>
<QIcon
@ -121,7 +111,6 @@ const manageDate = (date) => {
!$attrs.disable
"
@click="
vnInputDateRef.focus();
model = null;
isPopupOpen = false;
"
@ -135,7 +124,6 @@ const manageDate = (date) => {
/>
</template>
<QMenu
v-if="$q.screen.gt.xs"
transition-show="scale"
transition-hide="scale"
v-model="isPopupOpen"
@ -144,11 +132,19 @@ const manageDate = (date) => {
:no-focus="true"
:no-parent-event="true"
>
<VnDate v-model="popupDate" @update:model-value="manageDate" />
<QDate
v-model="popupDate"
:landscape="true"
:today-btn="true"
:options="$attrs.options"
@update:model-value="
(date) => {
formattedDate = date;
isPopupOpen = false;
}
"
/>
</QMenu>
<QDialog v-else v-model="isPopupOpen">
<VnDate v-model="popupDate" @update:model-value="manageDate" />
</QDialog>
</QInput>
</div>
</template>

View File

@ -1,12 +1,8 @@
<script setup>
import { computed, ref, useAttrs } from 'vue';
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { date } from 'quasar';
import { useValidator } from 'src/composables/useValidator';
import VnTime from './VnTime.vue';
const { validations } = useValidator();
const $attrs = useAttrs();
const model = defineModel({ type: String });
const props = defineProps({
timeOnly: {
@ -18,11 +14,10 @@ const props = defineProps({
default: false,
},
});
const vnInputTimeRef = ref(null);
const initialDate = ref(model.value ?? Date.vnNew());
const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
const dateFormat = 'HH:mm';
const isPopupOpen = ref();
const hover = ref();
@ -72,7 +67,6 @@ function dateToTime(newDate) {
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
ref="vnInputTimeRef"
class="vn-input-time"
mask="##:##"
placeholder="--:--"
@ -80,10 +74,9 @@ function dateToTime(newDate) {
v-bind="{ ...$attrs, ...styleAttrs }"
:class="{ required: $attrs.required }"
style="min-width: 100px"
:rules="mixinRules"
:rules="$attrs.required ? [requiredFieldRule] : null"
@click="isPopupOpen = false"
type="time"
hide-bottom-space
>
<template #append>
<QIcon
@ -96,7 +89,6 @@ function dateToTime(newDate) {
!$attrs.disable
"
@click="
vnInputTimeRef.focus();
model = null;
isPopupOpen = false;
"
@ -109,7 +101,6 @@ function dateToTime(newDate) {
/>
</template>
<QMenu
v-if="$q.screen.gt.xs"
transition-show="scale"
transition-hide="scale"
v-model="isPopupOpen"
@ -118,11 +109,8 @@ function dateToTime(newDate) {
:no-focus="true"
:no-parent-event="true"
>
<VnTime v-model="formattedTime" />
<QTime v-model="formattedTime" mask="HH:mm" landscape now-btn />
</QMenu>
<QDialog v-else v-model="isPopupOpen">
<VnTime v-model="formattedTime" />
</QDialog>
</QInput>
</div>
</template>

View File

@ -2,69 +2,21 @@
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
const { t } = useI18n();
const emit = defineEmits(['update:model-value', 'update:options']);
const props = defineProps({
location: {
type: Object,
default: null,
},
});
const locationProperties = [
'postcode',
(obj) =>
obj.city
? `${obj.city}${obj.province?.name ? `(${obj.province.name})` : ''}`
: null,
(obj) => obj.country?.name,
];
const formatLocation = (obj, properties) => {
const parts = properties.map((prop) => {
if (typeof prop === 'string') {
return obj[prop];
} else if (typeof prop === 'function') {
return prop(obj);
}
return null;
});
const filteredParts = parts.filter(
(part) => part !== null && part !== undefined && part !== ''
);
return filteredParts.join(', ');
};
const modelValue = ref(
props.location ? formatLocation(props.location, locationProperties) : null
);
const value = defineModel({ type: [String, Number, Object] });
function showLabel(data) {
const dataProperties = [
'code',
(obj) => (obj.town ? `${obj.town}(${obj.province})` : null),
'country',
];
return formatLocation(data, dataProperties);
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
}
const handleModelValue = (data) => {
emit('update:model-value', data);
};
</script>
<template>
<VnSelectDialog
v-model="modelValue"
v-model="value"
option-value="code"
option-filter-value="search"
:option-label="
(opt) => (typeof modelValue === 'string' ? modelValue : showLabel(opt))
"
:option-label="(opt) => showLabel(opt)"
url="Postcodes/filter"
@update:model-value="handleModelValue"
:use-like="false"
:label="t('Location')"
:placeholder="t('search_by_postalcode')"
@ -73,17 +25,9 @@ const handleModelValue = (data) => {
v-bind="$attrs"
clearable
:emit-value="false"
:tooltip="t('Create new location')"
>
<template #form>
<CreateNewPostcode
@on-data-saved="
(newValue) => {
modelValue = newValue;
emit('update:model-value', newValue);
}
"
/>
<CreateNewPostcode @on-data-saved="(newValue) => (value = newValue)" />
</template>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
@ -106,9 +50,7 @@ const handleModelValue = (data) => {
<i18n>
en:
search_by_postalcode: Search by postalcode, town, province or country
Create new location: Create new location
es:
Location: Ubicación
Create new location: Crear nueva ubicación
search_by_postalcode: Buscar por código postal, ciudad o país
</i18n>

View File

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

View File

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

View File

@ -2,7 +2,6 @@
import { useStateStore } from 'stores/useStateStore';
import LeftMenu from 'components/LeftMenu.vue';
import { onMounted } from 'vue';
import { useQuasar } from 'quasar';
const stateStore = useStateStore();
const $props = defineProps({
@ -11,9 +10,7 @@ const $props = defineProps({
default: true,
},
});
onMounted(
() => (stateStore.leftDrawer = useQuasar().screen.gt.xs ? $props.leftDrawer : false)
);
onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
</script>
<template>
@ -23,8 +20,6 @@ onMounted(
</QScrollArea>
</QDrawer>
<QPageContainer>
<QPage>
<RouterView />
</QPage>
<RouterView></RouterView>
</QPageContainer>
</template>

View File

@ -1,8 +1,7 @@
<script setup>
import { ref, toRefs, computed, watch, onMounted, useAttrs } from 'vue';
import { ref, toRefs, computed, watch, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'src/components/FetchData.vue';
import { useValidator } from 'src/composables/useValidator';
const emit = defineEmits(['update:modelValue', 'update:options', 'remove']);
const $props = defineProps({
@ -38,10 +37,6 @@ const $props = defineProps({
type: [Array],
default: () => [],
},
exprBuilder: {
type: Function,
default: null,
},
isClearable: {
type: Boolean,
default: true,
@ -87,11 +82,10 @@ const $props = defineProps({
default: false,
},
});
const { validations } = useValidator();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
const $attrs = useAttrs();
const { t } = useI18n();
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
const requiredFieldRule = (val) => val ?? t('globals.fieldRequired');
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
toRefs($props);
const myOptions = ref([]);
@ -141,7 +135,6 @@ function findKeyInOptions() {
function setOptions(data) {
myOptions.value = JSON.parse(JSON.stringify(data));
myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
emit('update:options', data);
}
function filter(val, options) {
@ -184,7 +177,6 @@ async function fetchFilter(val) {
}, {});
} else defaultWhere = { [key]: getVal(val) };
const where = { ...(val ? defaultWhere : {}), ...$props.where };
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
const fetchOptions = { where, include, limit };
if (fields) fetchOptions.fields = fields;
if (sortBy) fetchOptions.order = sortBy;
@ -228,8 +220,6 @@ function nullishToTrue(value) {
}
const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
defineExpose({ opts: myOptions });
</script>
<template>
@ -258,9 +248,8 @@ defineExpose({ opts: myOptions });
ref="vnSelectRef"
lazy-rules
:class="{ required: $attrs.required }"
:rules="mixinRules"
:rules="$attrs.required ? [requiredFieldRule] : null"
virtual-scroll-slice-size="options.length"
hide-bottom-space
>
<template v-if="isClearable" #append>
<QIcon

View File

@ -1,5 +1,5 @@
<script setup>
import { computed } from 'vue';
import { ref, computed } from 'vue';
import { useRole } from 'src/composables/useRole';
import { useAcl } from 'src/composables/useAcl';
@ -28,6 +28,7 @@ const $props = defineProps({
const role = useRole();
const acl = useAcl();
const showForm = ref(false);
const isAllowedToCreate = computed(() => {
if ($props.acls.length) return acl.hasAny($props.acls);

View File

@ -1,52 +0,0 @@
<script setup>
import { onBeforeMount, ref, useAttrs } from 'vue';
import axios from 'axios';
import VnSelect from 'components/common/VnSelect.vue';
const { schema, table, column, translation, defaultOptions } = defineProps({
schema: {
type: String,
default: 'vn',
},
table: {
type: String,
required: true,
},
column: {
type: String,
required: true,
},
translation: {
type: Function,
default: null,
},
defaultOptions: {
type: Array,
default: () => [],
},
});
const $attrs = useAttrs();
const options = ref([]);
onBeforeMount(async () => {
options.value = [].concat(defaultOptions);
const { data } = await axios.get(`Applications/get-enum-values`, {
params: { schema, table, column },
});
for (const value of data)
options.value.push({
[$attrs['option-value'] ?? 'id']: value,
[$attrs['option-label'] ?? 'name']: translation ? translation(value) : value,
});
});
</script>
<template>
<VnSelect
v-bind="$attrs"
:options="options"
:key="options.length"
:input-debounce="0"
/>
</template>

View File

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

View File

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

View File

@ -31,7 +31,7 @@ const dialog = ref(null);
<div class="container order-catalog-item overflow-hidden">
<QCard class="card shadow-6">
<div class="img-wrapper">
<VnImg :id="item.id" class="image" zoom-resolution="1600x900" />
<VnImg :id="item.id" class="image" />
<div v-if="item.hex && isCatalog" class="item-color-container">
<div
class="item-color"
@ -127,6 +127,11 @@ const dialog = ref(null);
flex-direction: column;
gap: 4px;
.subName {
color: var(--vn-label-color);
text-transform: uppercase;
}
p {
margin-bottom: 0;
}

View File

@ -31,7 +31,6 @@ const props = defineProps({
});
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
const { dialogRef, onDialogOK } = useDialogPluginComponent();
@ -69,10 +68,8 @@ async function confirm() {
<QSpace />
<QBtn icon="close" :disable="isLoading" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="q-pb-none">
<QCardSection class="row items-center">
<span v-if="message !== false" v-html="message" />
</QCardSection>
<QCardSection class="row items-center q-pt-none">
<slot name="customHTML"></slot>
</QCardSection>
<QCardActions align="right">

View File

@ -211,7 +211,7 @@ function sanitizer(params) {
icon="search"
@click="search()"
></QBtn>
<QForm @submit="search" id="filterPanelForm" @keyup.enter="search()">
<QForm @submit="search" id="filterPanelForm">
<QList dense>
<QItem class="q-mt-xs">
<QItemSection top>

View File

@ -39,8 +39,6 @@ const getUrl = (zoom = false) => {
const curResolution = zoom
? $props.zoomResolution || $props.resolution
: $props.resolution;
if ($props.storage === 'dms')
return `/api/${$props.storage}/${$props.id}/downloadFile?access_token=${token}`;
return isEmployee
? `/api/${$props.storage}/${$props.collection}/${curResolution}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
: noImage;
@ -54,21 +52,18 @@ defineExpose({
</script>
<template>
<QImg
:draggable="true"
:class="{ zoomIn: zoom }"
:src="getUrl()"
v-bind="$attrs"
@click.stop="show = $props.zoom"
@click.stop="show = $props.zoom ? true : false"
spinner-color="primary"
/>
<QDialog v-if="$props.zoom" v-model="show">
<QImg
:draggable="true"
:src="getUrl(true)"
v-bind="$attrs"
spinner-color="primary"
class="img_zoom"
:ratio="0"
/>
</QDialog>
</template>

View File

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

View File

@ -56,7 +56,7 @@ const props = defineProps({
},
offset: {
type: Number,
default: undefined,
default: 0,
},
skeleton: {
type: Boolean,
@ -119,9 +119,10 @@ watch(
);
watch(
() => [props.url, props.filter],
([url, filter]) => mounted.value && fetch({ url, filter })
() => [props.url, props.filter, props.userParams],
([url, filter, userParams]) => mounted.value && fetch({ url, filter, userParams })
);
const addFilter = async (filter, params) => {
await arrayData.addFilter({ filter, params });
};
@ -130,8 +131,9 @@ async function fetch(params) {
useArrayData(props.dataKey, params);
arrayData.reset(['filter.skip', 'skip']);
await arrayData.fetch({ append: false });
if (!store.hasMoreData) isLoading.value = false;
if (!store.hasMoreData) {
isLoading.value = false;
}
emit('onFetch', store.data);
return store.data;
}
@ -222,20 +224,13 @@ defineExpose({ fetch, addFilter, paginate });
v-bind="$attrs"
>
<slot name="body" :rows="store.data"></slot>
<div v-if="isLoading" class="spinner info-row q-pa-md text-center">
<div v-if="isLoading" class="info-row q-pa-md text-center">
<QSpinner color="primary" size="md" />
</div>
</QInfiniteScroll>
</template>
<style lang="scss" scoped>
.spinner {
z-index: 1;
align-content: end;
position: absolute;
bottom: 0;
left: 0;
}
.info-row {
width: 100%;

View File

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

View File

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

View File

@ -1,18 +1,20 @@
<script setup>
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { useI18n } from 'vue-i18n';
defineProps({
const $props = defineProps({
name: { type: String, default: null },
tag: { type: String, default: null },
workerId: { type: Number, default: null },
defaultName: { type: Boolean, default: false },
});
const { t } = useI18n();
</script>
<template>
<slot name="link">
<span :class="{ link: workerId }">
{{ defaultName ? name ?? $t('globals.system') : name }}
<span :class="{ link: $props.workerId }">
{{ $props.defaultName ? $props.name ?? t('globals.system') : $props.name }}
</span>
</slot>
<WorkerDescriptorProxy v-if="workerId" :id="workerId" />
<WorkerDescriptorProxy v-if="$props.workerId" :id="$props.workerId" />
</template>

View File

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

View File

@ -4,8 +4,15 @@ import { getUrl } from './getUrl';
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
let appUrl = await getUrl('', 'lilium');
export async function downloadFile(
id,
model = 'dms',
urlPath = '/downloadFile',
url,
route = '',
app = 'lilium'
) {
let appUrl = await getUrl(route, app);
appUrl = appUrl.replace('/#/', '');
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
}

View File

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

View File

@ -0,0 +1,6 @@
export function isProduction(localAsProduction = true) {
return (
(!process.env.NODE_ENV && localAsProduction) ||
process.env.NODE_ENV == 'production'
);
}

View File

@ -1,26 +1,22 @@
import { useSession } from './useSession';
import axios from 'axios';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
export function usePrintService() {
const quasar = useQuasar();
const { t } = useI18n();
const { getTokenMultimedia } = useSession();
function sendEmail(path, params) {
return axios.post(path, params).then(() =>
quasar.notify({
message: t('globals.notificationSent'),
message: 'Notification sent',
type: 'positive',
icon: 'check',
})
);
}
function openReport(path, params, isNewTab = '_self') {
if (typeof params === 'string') params = JSON.parse(params);
function openReport(path, params) {
params = Object.assign(
{
access_token: getTokenMultimedia(),
@ -29,7 +25,8 @@ export function usePrintService() {
);
const query = new URLSearchParams(params).toString();
window.open(`api/${path}?${query}`, isNewTab);
window.open(`api/${path}?${query}`);
}
return {

View File

@ -268,7 +268,6 @@ input::-webkit-inner-spin-button {
max-width: 400px;
}
}
.edit-photo-btn {
position: absolute;
right: 12px;
@ -276,19 +275,3 @@ input::-webkit-inner-spin-button {
z-index: 1;
cursor: pointer;
}
.subName {
color: var(--vn-label-color);
text-transform: uppercase;
}
.q-date {
&__today {
border: 2px solid $info;
color: $info;
}
}
.no-visible {
visibility: hidden;
}

View File

@ -36,6 +36,7 @@ $color-font-secondary: #777;
.bg-success {
background-color: $positive;
}
.bg-notice {
background-color: $info;
}

View File

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

View File

@ -2,7 +2,6 @@ globals:
lang:
es: Spanish
en: English
quantity: Quantity
language: Language
entity: Entity
user: User
@ -50,7 +49,6 @@ globals:
summary:
basicData: Basic data
daysOnward: Days onward
daysAgo: Days ago
today: Today
yesterday: Yesterday
dateFormat: en-GB
@ -100,20 +98,13 @@ globals:
to: To
notes: Notes
refresh: Refresh
item: Item
ticket: Ticket
campaign: Campaign
weight: Weight
error: Ups! Something went wrong
recalc: Recalculate
pageTitles:
logIn: Login
addressEdit: Update address
summary: Summary
basicData: Basic data
log: Logs
parkingList: Parkings list
agencyList: Agencies
agencyList: Agencies list
agency: Agency
workCenters: Work centers
modes: Modes
@ -133,11 +124,9 @@ globals:
notifications: Notifications
defaulter: Defaulter
customerCreate: New customer
createOrder: New order
fiscalData: Fiscal data
billingData: Billing data
consignees: Consignees
address-create: New address
notes: Notes
credits: Credits
greuges: Greuges
@ -161,7 +150,6 @@ globals:
dms: File management
entryCreate: New entry
latestBuys: Latest buys
reserves: Reserves
tickets: Tickets
ticketCreate: New Tickets
boxing: Boxing
@ -209,7 +197,7 @@ globals:
roadmap: Roadmap
stops: Stops
routes: Routes
cmrsList: CMRs
cmrsList: CMRs list
RouteList: List
routeCreate: New route
RouteRoadmap: Roadmaps
@ -275,9 +263,6 @@ globals:
clientsActionsMonitor: Clients and actions
serial: Serial
medical: Mutual
RouteExtendedList: Router
wasteRecalc: Waste recaclulate
operator: Operator
supplier: Supplier
created: Created
worker: Worker
@ -293,32 +278,12 @@ globals:
createInvoiceIn: Create invoice in
myAccount: My account
noOne: No one
maxTemperature: Max
minTemperature: Min
params:
id: ID
clientFk: Client id
salesPersonFk: Sales person
warehouseFk: Warehouse
provinceFk: Province
from: From
To: To
stateFk: State
email: Email
SSN: SSN
fi: FI
myTeam: My team
departmentFk: Department
changePass: Change password
deleteConfirmTitle: Delete selected elements
changeState: Change state
errors:
statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred
statusBadGateway: It seems that the server has fall down
statusGatewayTimeout: Could not contact the server
userConfig: Error fetching user config
updateUserConfig: Error updating user config
tokenConfig: Error fetching token config
writeRequest: The requested operation could not be completed
login:
@ -349,6 +314,135 @@ resetPassword:
repeatPassword: Repeat password
passwordNotMatch: Passwords don't match
passwordChanged: Password changed
customer:
list:
phone: Phone
email: Email
customerOrders: Display customer orders
moreOptions: More options
card:
customerList: Customer list
customerId: Claim ID
salesPerson: Sales person
credit: Credit
risk: Risk
securedCredit: Secured credit
payMethod: Pay method
debt: Debt
isFrozen: Customer frozen
hasDebt: Customer has debt
isDisabled: Customer inactive
notChecked: Customer no checked
webAccountInactive: Web account inactive
noWebAccess: Web access is disabled
businessType: Business type
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
businessTypeFk: Business type
summary:
basicData: Basic data
fiscalAddress: Fiscal address
fiscalData: Fiscal data
billingData: Billing data
consignee: Default consignee
businessData: Business data
financialData: Financial data
customerId: Customer ID
name: Name
contact: Contact
phone: Phone
mobile: Mobile
email: Email
salesPerson: Sales person
contactChannel: Contact channel
socialName: Social name
fiscalId: Fiscal ID
postcode: Postcode
province: Province
country: Country
street: Address
isEqualizated: Is equalizated
isActive: Is active
invoiceByAddress: Invoice by address
verifiedData: Verified data
hasToInvoice: Has to invoice
notifyByEmail: Notify by email
vies: VIES
payMethod: Pay method
bankAccount: Bank account
dueDay: Due day
hasLcr: Has LCR
hasCoreVnl: Has core VNL
hasB2BVnl: Has B2B VNL
addressName: Address name
addressCity: City
addressStreet: Street
username: Username
webAccess: Web access
totalGreuge: Total greuge
mana: Mana
priceIncreasingRate: Price increasing rate
averageInvoiced: Average invoiced
claimRate: Claming rate
risk: Risk
riskInfo: Invoices minus payments plus orders not yet invoiced
credit: Credit
creditInfo: Company's maximum risk
securedCredit: Secured credit
securedCreditInfo: Solunion's maximum risk
balance: Balance
balanceInfo: Invoices minus payments
balanceDue: Balance due
balanceDueInfo: Deviated invoices minus payments
recoverySince: Recovery since
businessType: Business Type
city: City
descriptorInfo: Invoices minus payments plus orders not yet
rating: Rating
recommendCredit: Recommended credit
basicData:
socialName: Fiscal name
businessType: Business type
contact: Contact
youCanSaveMultipleEmails: You can save multiple emails
email: Email
phone: Phone
mobile: Mobile
salesPerson: Sales person
contactChannel: Contact channel
previousClient: Previous client
extendedList:
tableVisibleColumns:
id: Identifier
name: Name
socialName: Social name
fi: Tax number
salesPersonFk: Salesperson
credit: Credit
creditInsurance: Credit insurance
phone: Phone
mobile: Mobile
street: Street
countryFk: Country
provinceFk: Province
city: City
postcode: Postcode
email: Email
created: Created
businessTypeFk: Business type
payMethodFk: Billing data
sageTaxTypeFk: Sage tax type
sageTransactionTypeFk: Sage tr. type
isActive: Active
isVies: Vies
isTaxDataChecked: Verified data
isEqualizated: Is equalizated
isFreezed: Freezed
hasToInvoice: Invoice
hasToInvoiceByAddress: Invoice by address
isToBeMailed: Mailing
hasLcr: Received LCR
hasCoreVnl: VNL core received
hasSepaVnl: VNL B2B received
entry:
list:
newEntry: New entry
@ -512,8 +606,6 @@ ticket:
warehouse: Warehouse
customerCard: Customer card
alias: Alias
ticketList: Ticket List
newOrder: New Order
boxing:
expedition: Expedition
item: Item
@ -535,7 +627,6 @@ ticket:
landed: Landed
consigneePhone: Consignee phone
consigneeMobile: Consignee mobile
consigneeAddress: Consignee address
clientPhone: Client phone
clientMobile: Client mobile
consignee: Consignee
@ -558,17 +649,13 @@ ticket:
package: Package
taxClass: Tax class
services: Services
changeState: Change state
requester: Requester
atender: Atender
request: Request
weight: Weight
goTo: Go to
summaryAmount: Summary
purchaseRequest: Purchase request
service: Service
description: Description
attender: Attender
ok: Ok
create:
client: Client
address: Address
@ -592,6 +679,7 @@ invoiceOut:
client: Client
company: Company
customerCard: Customer card
ticketList: Ticket List
summary:
issued: Issued
created: Created
@ -745,7 +833,6 @@ worker:
locker: Locker
balance: Balance
medical: Medical
operator: Operator
list:
name: Name
email: Email
@ -757,7 +844,6 @@ worker:
newWorker: New worker
card:
workerId: Worker ID
user: User
name: Name
email: Email
phone: Phone
@ -798,6 +884,9 @@ worker:
model: Model
serialNumber: Serial number
removePDA: Deallocate PDA
sendToTablet: Send to sign
refresh: Refresh
download: Download
create:
name: Name
lastName: Last name
@ -818,14 +907,14 @@ worker:
bankEntity: Swift / BIC
formation:
tableVisibleColumns:
course: Course
startDate: Start date
endDate: End date
center: Training center
invoice: Invoice
amount: Amount
remark: Remark
hasDiploma: Has diploma
course: Curso
startDate: Fecha Inicio
endDate: Fecha Fin
center: Centro Formación
invoice: Factura
amount: Importe
remark: Bonficado
hasDiploma: Diploma
medical:
tableVisibleColumns:
date: Date
@ -843,29 +932,7 @@ worker:
debit: Debt
credit: Have
concept: Concept
operator:
numberOfWagons: Number of wagons
train: Train
itemPackingType: Item packing type
warehouse: Warehouse
sector: Sector
labeler: Printer
linesLimit: Lines limit
volumeLimit: Volume limit
sizeLimit: Size limit
isOnReservationMode: Reservation mode
machine: Machine
wagon:
pageTitles:
wagons: Wagons
wagonsList: Wagons List
wagonCreate: Create wagon
wagonEdit: Edit wagon
typesList: Types List
typeCreate: Create type
typeEdit: Edit type
wagonCounter: Trolley counter
wagonTray: Tray List
type:
name: Name
submit: Submit
@ -894,7 +961,34 @@ wagon:
minHeightBetweenTrays: 'The minimum height between trays is '
maxWagonHeight: 'The maximum height of the wagon is '
uncompleteTrays: There are incomplete trays
route:
pageTitles:
agency: Agency List
routes: Routes
cmrsList: CMRs list
RouteList: List
routeCreate: New route
basicData: Basic Data
summary: Summary
RouteRoadmap: Roadmaps
RouteRoadmapCreate: Create roadmap
tickets: Tickets
log: Log
autonomous: Autonomous
cmr:
list:
results: results
cmrFk: CMR id
hasCmrDms: Attached in gestdoc
'true': 'Yes'
'false': 'No'
ticketFk: Ticketd id
routeFk: Route id
country: Country
clientFk: Client id
shipped: Preparation date
viewCmr: View CMR
downloadCmrs: Download CMRs
supplier:
list:
payMethod: Pay method
@ -910,7 +1004,6 @@ supplier:
account: Account
payMethod: Pay Method
payDay: Pay Day
country: Country
summary:
responsible: Responsible
notes: Notes
@ -1009,7 +1102,6 @@ travel:
warehouseOut: Warehouse out
totalEntries: Total entries
totalEntriesTooltip: Total entries
daysOnward: Landed days onwards
summary:
confirmed: Confirmed
entryId: Entry Id
@ -1085,7 +1177,7 @@ item:
producer: Producer
landed: Landed
fixedPrice:
itemFk: Item ID
itemId: Item ID
groupingPrice: Grouping price
packingPrice: Packing price
hasMinPrice: Has min price

View File

@ -3,7 +3,6 @@ globals:
es: Español
en: Inglés
language: Idioma
quantity: Cantidad
entity: Entidad
user: Usuario
details: Detalles
@ -49,7 +48,6 @@ globals:
summary:
basicData: Datos básicos
daysOnward: Días adelante
daysAgo: Días atras
today: Hoy
yesterday: Ayer
dateFormat: es-ES
@ -64,7 +62,7 @@ globals:
shipped: F. envío
totalEntries: Ent. totales
amount: Importe
packages: Embalajes
packages: Bultos
download: Descargar
downloadPdf: Descargar PDF
selectRows: 'Seleccionar las { numberRows } filas(s)'
@ -102,20 +100,13 @@ globals:
to: Hasta
notes: Notas
refresh: Actualizar
item: Artículo
ticket: Ticket
campaign: Campaña
weight: Peso
error: ¡Ups! Algo salió mal
recalc: Recalcular
pageTitles:
logIn: Inicio de sesión
addressEdit: Modificar consignatario
summary: Resumen
basicData: Datos básicos
log: Historial
parkingList: Listado de parkings
agencyList: Agencias
agencyList: Listado de agencias
agency: Agencia
workCenters: Centros de trabajo
modes: Modos
@ -130,7 +121,6 @@ globals:
inheritedRoles: Roles heredados
customers: Clientes
customerCreate: Nuevo cliente
createOrder: Nuevo pedido
list: Listado
webPayments: Pagos Web
extendedList: Listado extendido
@ -140,7 +130,6 @@ globals:
fiscalData: Datos fiscales
billingData: Forma de pago
consignees: Consignatarios
'address-create': Nuevo consignatario
notes: Notas
credits: Créditos
greuges: Greuges
@ -164,7 +153,6 @@ globals:
dms: Gestión documental
entryCreate: Nueva entrada
latestBuys: Últimas compras
reserves: Reservas
tickets: Tickets
ticketCreate: Nuevo ticket
boxing: Encajado
@ -213,13 +201,12 @@ globals:
roadmap: Troncales
stops: Paradas
routes: Rutas
cmrsList: CMRs
cmrsList: Listado de CMRs
RouteList: Listado
routeCreate: Nueva ruta
RouteRoadmap: Troncales
RouteRoadmapCreate: Crear troncal
autonomous: Autónomos
RouteExtendedList: Enrutador
suppliers: Proveedores
supplier: Proveedor
supplierCreate: Nuevo proveedor
@ -270,7 +257,7 @@ globals:
tracking: Estados
components: Componentes
pictures: Fotos
packages: Embalajes
packages: Bultos
ldap: LDAP
samba: Samba
twoFactor: Doble factor
@ -280,8 +267,6 @@ globals:
clientsActionsMonitor: Clientes y acciones
serial: Facturas por serie
medical: Mutua
wasteRecalc: Recalcular mermas
operator: Operario
supplier: Proveedor
created: Fecha creación
worker: Trabajador
@ -297,32 +282,12 @@ globals:
createInvoiceIn: Crear factura recibida
myAccount: Mi cuenta
noOne: Nadie
maxTemperature: Máx
minTemperature: Mín
params:
id: Id
clientFk: Id cliente
salesPersonFk: Comercial
warehouseFk: Almacén
provinceFk: Provincia
from: Desde
To: Hasta
stateFk: Estado
departmentFk: Departamento
email: Correo
SSN: NSS
fi: NIF
myTeam: Mi equipo
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado
errors:
statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor
statusBadGateway: Parece ser que el servidor ha caído
statusGatewayTimeout: No se ha podido contactar con el servidor
userConfig: Error al obtener configuración de usuario
updateUserConfig: Error al actualizar la configuración de usuario
tokenConfig: Error al obtener configuración de token
writeRequest: No se pudo completar la operación solicitada
login:
@ -351,6 +316,134 @@ resetPassword:
repeatPassword: Repetir contraseña
passwordNotMatch: Las contraseñas no coinciden
passwordChanged: Contraseña cambiada
customer:
list:
phone: Teléfono
email: Email
customerOrders: Mostrar órdenes del cliente
moreOptions: Más opciones
card:
customerId: ID cliente
salesPerson: Comercial
credit: Crédito
risk: Riesgo
securedCredit: Crédito asegurado
payMethod: Método de pago
debt: Riesgo
isFrozen: Cliente congelado
hasDebt: Cliente con riesgo
isDisabled: Cliente inactivo
notChecked: Cliente no comprobado
webAccountInactive: Sin acceso web
noWebAccess: El acceso web está desactivado
businessType: Tipo de negocio
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
businessTypeFk: Tipo de negocio
summary:
basicData: Datos básicos
fiscalAddress: Dirección fiscal
fiscalData: Datos fiscales
billingData: Datos de facturación
consignee: Consignatario pred.
businessData: Datos comerciales
financialData: Datos financieros
customerId: ID cliente
name: Nombre
contact: Contacto
phone: Teléfono
mobile: Móvil
email: Email
salesPerson: Comercial
contactChannel: Canal de contacto
socialName: Razón social
fiscalId: NIF/CIF
postcode: Código postal
province: Provincia
country: País
street: Calle
isEqualizated: Recargo de equivalencia
isActive: Activo
invoiceByAddress: Facturar por consignatario
verifiedData: Datos verificados
hasToInvoice: Facturar
notifyByEmail: Notificar por email
vies: VIES
payMethod: Método de pago
bankAccount: Cuenta bancaria
dueDay: Día de pago
hasLcr: Recibido LCR
hasCoreVnl: Recibido core VNL
hasB2BVnl: Recibido B2B VNL
addressName: Nombre de la dirección
addressCity: Ciudad
addressStreet: Calle
username: Usuario
webAccess: Acceso web
totalGreuge: Greuge total
mana: Maná
priceIncreasingRate: Ratio de incremento de precio
averageInvoiced: Facturación media
claimRate: Ratio de reclamaciones
risk: Riesgo
riskInfo: Facturas menos recibos mas pedidos sin facturar
credit: Crédito
creditInfo: Riesgo máximo asumido por la empresa
securedCredit: Crédito asegurado
securedCreditInfo: Riesgo máximo asumido por Solunion
balance: Balance
balanceInfo: Facturas menos recibos
balanceDue: Saldo vencido
balanceDueInfo: Facturas fuera de plazo menos recibos
recoverySince: Recobro desde
businessType: Tipo de negocio
city: Población
descriptorInfo: Facturas menos recibos mas pedidos sin facturar
rating: Clasificación
recommendCredit: Crédito recomendado
basicData:
socialName: Nombre fiscal
businessType: Tipo de negocio
contact: Contacto
youCanSaveMultipleEmails: Puede guardar varios correos electrónicos encadenándolos mediante comas sin espacios{','} ejemplo{':'} user{'@'}dominio{'.'}com, user2{'@'}dominio{'.'}com siendo el primer correo electrónico el principal
email: Email
phone: Teléfono
mobile: Móvil
salesPerson: Comercial
contactChannel: Canal de contacto
previousClient: Cliente anterior
extendedList:
tableVisibleColumns:
id: Identificador
name: Nombre
socialName: Razón social
fi: NIF / CIF
salesPersonFk: Comercial
credit: Crédito
creditInsurance: Crédito asegurado
phone: Teléfono
mobile: Móvil
street: Dirección fiscal
countryFk: País
provinceFk: Provincia
city: Población
postcode: Código postal
email: Email
created: Fecha creación
businessTypeFk: Tipo de negocio
payMethodFk: Forma de pago
sageTaxTypeFk: Tipo de impuesto Sage
sageTransactionTypeFk: Tipo tr. sage
isActive: Activo
isVies: Vies
isTaxDataChecked: Datos comprobados
isEqualizated: Recargo de equivalencias
isFreezed: Congelado
hasToInvoice: Factura
hasToInvoiceByAddress: Factura por consigna
isToBeMailed: Env. emails
hasLcr: Recibido LCR
hasCoreVnl: Recibido core VNL
hasSepaVnl: Recibido B2B VNL
entry:
list:
newEntry: Nueva entrada
@ -503,7 +596,7 @@ ticket:
tracking: Estados
components: Componentes
pictures: Fotos
packages: Embalajes
packages: Bultos
list:
nickname: Alias
state: Estado
@ -521,8 +614,6 @@ ticket:
warehouse: Almacén
customerCard: Ficha del cliente
alias: Alias
ticketList: Listado de tickets
newOrder: Nuevo pedido
boxing:
expedition: Expedición
item: Artículo
@ -544,7 +635,6 @@ ticket:
landed: Entregado
consigneePhone: Tel. consignatario
consigneeMobile: Móv. consignatario
consigneeAddress: Dir. consignatario
clientPhone: Tel. cliente
clientMobile: Móv. cliente
consignee: Consignatario
@ -567,16 +657,13 @@ ticket:
package: Embalaje
taxClass: Tipo IVA
services: Servicios
changeState: Cambiar estado
requester: Solicitante
atender: Comprador
request: Petición de compra
weight: Peso
goTo: Ir a
summaryAmount: Resumen
purchaseRequest: Petición de compra
service: Servicio
description: Descripción
attender: Consignatario
create:
client: Cliente
address: Dirección
@ -752,7 +839,6 @@ worker:
balance: Balance
formation: Formación
medical: Mutua
operator: Operario
list:
name: Nombre
email: Email
@ -764,7 +850,6 @@ worker:
newWorker: Nuevo trabajador
card:
workerId: ID Trabajador
user: Usuario
name: Nombre
email: Correo personal
phone: Teléfono
@ -796,6 +881,9 @@ worker:
model: Modelo
serialNumber: Número de serie
removePDA: Desasignar PDA
sendToTablet: Enviar a tablet
refresh: Refrescar
download: Descargar justificante
create:
name: Nombre
lastName: Apellido
@ -841,30 +929,7 @@ worker:
debit: Debe
credit: Haber
concept: Concepto
operator:
numberOfWagons: Número de vagones
train: tren
itemPackingType: Tipo de embalaje
warehouse: Almacén
sector: Sector
labeler: Impresora
linesLimit: Líneas límite
volumeLimit: Volumen límite
sizeLimit: Tamaño límite
isOnReservationMode: Modo de reserva
machine: Máquina
wagon:
pageTitles:
wagons: Vagones
wagonsList: Listado vagones
wagonCreate: Crear tipo
wagonEdit: Editar tipo
typesList: Listado tipos
typeCreate: Crear tipo
typeEdit: Editar tipo
wagonCounter: Contador de carros
wagonTray: Listado bandejas
type:
name: Nombre
submit: Guardar
@ -893,6 +958,21 @@ wagon:
minHeightBetweenTrays: 'La distancia mínima entre bandejas es '
maxWagonHeight: 'La altura máxima del vagón es '
uncompleteTrays: Hay bandejas sin completar
route:
cmr:
list:
results: resultados
cmrFk: Id CMR
hasCmrDms: Gestdoc
'true':
'false': 'No'
ticketFk: Id ticket
routeFk: Id ruta
country: País
clientFk: Id cliente
shipped: Fecha preparación
viewCmr: Ver CMR
downloadCmrs: Descargar CMRs
supplier:
list:
payMethod: Método de pago
@ -908,7 +988,6 @@ supplier:
account: Cuenta
payMethod: Método de pago
payDay: Dia de pago
country: País
summary:
responsible: Responsable
notes: Notas
@ -1007,7 +1086,6 @@ travel:
warehouseOut: Alm.entrada
totalEntries:
totalEntriesTooltip: Entradas totales
daysOnward: Días de llegada en adelante
summary:
confirmed: Confirmado
entryId: Id entrada
@ -1083,7 +1161,7 @@ item:
producer: Productor
landed: F. entrega
fixedPrice:
itemFk: ID Artículo
itemId: ID Artículo
groupingPrice: Precio grouping
packingPrice: Precio packing
hasMinPrice: Tiene precio mínimo

View File

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

View File

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

View File

@ -2,7 +2,6 @@
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import FormModel from 'components/FormModel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import { ref, watch } from 'vue';
@ -25,7 +24,7 @@ watch(
<template>
<FormModel
ref="formModelRef"
url="VnUsers/preview"
:url="`VnUsers/preview`"
:url-update="`VnUsers/${route.params.id}/update-user`"
:filter="accountFilter"
model="Accounts"
@ -44,15 +43,6 @@ watch(
option-value="code"
option-label="code"
/>
<VnSelectEnum
schema="account"
table="user"
column="twoFactor"
v-model="data.twoFactor"
:label="t('account.card.twoFactor')"
option-value="code"
option-label="code"
/>
</div>
</template>
</FormModel>

View File

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

View File

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

View File

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

View File

@ -19,15 +19,7 @@ watch(
</script>
<template>
<FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" />
<FormModel
ref="formModelRef"
model="AccountPrivileges"
url="VnUsers/preview"
:filter="{ where: { id: route.params.id } }"
:url-create="`VnUsers/${route.params.id}/privileges`"
:id="route.params.id"
auto-load
>
<FormModel ref="formModelRef" model="AccountPrivileges" url="VnUsers" auto-load>
<template #form="{ data }">
<div class="q-gutter-y-sm">
<QCheckbox

View File

@ -46,15 +46,29 @@ const columns = computed(() => [
]);
const deleteSubRole = async (row) => {
await axios.delete(`${urlPath.value}/${row.id}`);
fetchSubRoles();
notify(t('Role removed. Changes will take a while to fully propagate.'), 'positive');
try {
await axios.delete(`${urlPath.value}/${row.id}`);
fetchSubRoles();
notify(
t('Role removed. Changes will take a while to fully propagate.'),
'positive'
);
} catch (error) {
console.error(error);
}
};
const createSubRole = async (subRoleFormData) => {
await axios.post(urlPath.value, subRoleFormData);
notify(t('Role added! Changes will take a while to fully propagate.'), 'positive');
fetchSubRoles();
try {
await axios.post(urlPath.value, subRoleFormData);
notify(
t('Role added! Changes will take a while to fully propagate.'),
'positive'
);
fetchSubRoles();
} catch (error) {
console.error(error);
}
};
watch(
@ -128,13 +142,7 @@ const redirectToRoleSummary = (id) =>
<SubRoleCreateForm @on-submit-create-subrole="createSubRole" />
</QDialog>
<QPageSticky position="bottom-right" :offset="[18, 18]">
<QBtn
fab
icon="add"
shortcut="+"
color="primary"
@click="openCreateSubRoleForm()"
>
<QBtn fab icon="add" color="primary" @click="openCreateSubRoleForm()">
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
</QBtn>
</QPageSticky>

View File

@ -35,7 +35,6 @@ account:
willDeactivated: User will be deactivated
activated: User activated!
deactivated: User deactivated!
twoFactor: Two factor
actions:
setPassword: Set password
disableAccount:

View File

@ -32,7 +32,6 @@ account:
activated: ¡Usuario activado!
deactivated: ¡Usuario desactivado!
newUser: Nuevo usuario
twoFactor: Doble factor
privileges:
delegate: Puede delegar privilegios
actions:

View File

@ -3,18 +3,58 @@ import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import axios from 'axios';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
const route = useRoute();
const { t } = useI18n();
const claimStates = ref([]);
const claimStatesCopy = ref([]);
const optionsList = ref([]);
const workersOptions = ref([]);
function setClaimStates(data) {
claimStates.value = data;
claimStatesCopy.value = data;
}
async function getEnumValues() {
optionsList.value = [{ id: null, description: t('claim.null') }];
const { data } = await axios.get(`Applications/get-enum-values`, {
params: {
schema: 'vn',
table: 'claim',
column: 'pickup',
},
});
for (let value of data)
optionsList.value.push({ id: value, description: t(`claim.${value}`) });
}
getEnumValues();
const statesFilter = {
options: claimStates,
filterFn: (options, value) => {
const search = value.toLowerCase();
if (value === '') return claimStatesCopy.value;
return options.value.filter((row) => {
const description = row.description.toLowerCase();
return description.indexOf(search) > -1;
});
},
};
</script>
<template>
<FetchData
@ -30,7 +70,7 @@ const workersOptions = ref([]);
auto-load
:reload="true"
>
<template #form="{ data, validate }">
<template #form="{ data, validate, filter }">
<VnRow>
<VnInput
v-model="data.client.name"
@ -61,14 +101,20 @@ const workersOptions = ref([]);
/>
</template>
</VnSelect>
<VnSelect
<QSelect
v-model="data.claimStateFk"
url="ClaimStates"
:label="t('claim.state')"
:options="claimStates"
option-value="id"
option-label="description"
emit-value
:label="t('claim.state')"
map-options
use-input
@filter="(value, update) => filter(value, update, statesFilter)"
:rules="validate('claim.claimStateFk')"
:input-debounce="0"
/>
>
</QSelect>
</VnRow>
<VnRow>
<QInput
@ -77,14 +123,16 @@ const workersOptions = ref([]);
:rules="validate('claim.packages')"
type="number"
/>
<VnSelectEnum
<QSelect
v-model="data.pickup"
:label="t('claim.pickup')"
table="claim"
column="pickup"
:options="optionsList"
option-value="id"
option-label="description"
:translation="(value) => t(`claim.${value}`)"
:default-options="[{ id: null, description: t('claim.null') }]"
emit-value
:label="t('claim.pickup')"
map-options
use-input
:input-debounce="0"
/>
</VnRow>
</template>

View File

@ -16,6 +16,7 @@ const claimReasons = ref([]);
const claimResults = ref([]);
const claimResponsibles = ref([]);
const claimRedeliveries = ref([]);
const workers = ref([]);
const selected = ref([]);
const saveButtonRef = ref();
@ -81,9 +82,7 @@ const columns = computed(() => [
label: t('Worker'),
field: (row) => row.workerFk,
sortable: true,
url: 'Workers/search',
where: { active: 1 },
sortBy: 'name ASC',
options: workers.value,
model: 'workerFk',
optionValue: 'id',
optionLabel: 'nickname',
@ -130,6 +129,13 @@ const columns = computed(() => [
@on-fetch="(data) => (claimRedeliveries = data)"
auto-load
/>
<FetchData
url="Workers/search"
:where="{ active: 1 }"
order="name ASC"
@on-fetch="(data) => (workers = data)"
auto-load
/>
<CrudModel
data-key="ClaimDevelopments"
url="ClaimDevelopments"
@ -159,9 +165,6 @@ const columns = computed(() => [
>
<VnSelect
v-model="row[col.model]"
:url="col.url"
:where="col.where"
:sort-by="col.sortBy"
:options="col.options"
:option-value="col.optionValue"
:option-label="col.optionLabel"

View File

@ -45,7 +45,7 @@ async function onFetchClaim(data) {
const amount = ref();
const amountClaimed = ref();
function onFetch(rows, newRows) {
async function onFetch(rows, newRows) {
if (newRows) rows = newRows;
amount.value = 0;
amountClaimed.value = 0;
@ -155,7 +155,7 @@ function showImportDialog() {
async function saveWhenHasChanges() {
if (claimLinesForm.value.getChanges().updates) {
await claimLinesForm.value.onSubmit();
onFetch(claimLinesForm.value.formData);
await claimLinesForm.value.reload();
}
}
</script>
@ -211,7 +211,7 @@ async function saveWhenHasChanges() {
<template #body-cell-claimed="{ row }">
<QTd auto-width align="right" class="text-primary">
<QInput
v-model.number="row.quantity"
v-model="row.quantity"
type="number"
dense
@keyup.enter="saveWhenHasChanges()"
@ -266,9 +266,7 @@ async function saveWhenHasChanges() {
<template v-if="column.name === 'claimed'">
<QItemLabel class="text-primary">
<QInput
v-model.number="
props.row.quantity
"
v-model="props.row.quantity"
type="number"
dense
autofocus
@ -317,7 +315,7 @@ async function saveWhenHasChanges() {
</div>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" shortcut="+" icon="add" @click="showImportDialog()" />
<QBtn fab color="primary" icon="add" @click="showImportDialog()" />
</QPageSticky>
</template>

View File

@ -246,13 +246,7 @@ function onDrag() {
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<label for="fileInput">
<QBtn
fab
@click="inputFile.nativeEl.click()"
shortcut="+"
icon="add"
color="primary"
>
<QBtn fab @click="inputFile.nativeEl.click()" icon="add" color="primary">
<QInput
ref="inputFile"
type="file"

View File

@ -94,8 +94,8 @@ const detailsColumns = ref([
{
name: 'total',
label: 'claim.total',
field: (row) =>
toCurrency(row.quantity * row.sale.price * ((100 - row.sale.discount) / 100)),
field: ({ sale }) =>
toCurrency(sale.quantity * sale.price * ((100 - sale.discount) / 100)),
sortable: true,
},
]);
@ -204,7 +204,7 @@ function claimUrl(section) {
top
color="black"
text-color="white"
:label="t('globals.changeState')"
:label="t('ticket.summary.changeState')"
>
<QList>
<QVirtualScroll

View File

@ -52,7 +52,6 @@ const columns = computed(() => [
name: 'attendedBy',
orderBy: 'workerFk',
columnFilter: {
name: 'attenderFk',
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',

View File

@ -5,12 +5,15 @@ import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';
import FetchData from 'components/FetchData.vue';
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const addresses = ref([]);
const client = ref(null);
const provincesLocation = ref([]);
const addressFilter = {
fields: [
@ -38,13 +41,7 @@ const addressFilter = {
{
relation: 'province',
scope: {
fields: ['id', 'name', 'countryFk'],
include: [
{
relation: 'country',
scope: { fields: ['id', 'name'] },
},
],
fields: ['id', 'name'],
},
},
],
@ -86,6 +83,13 @@ const getClientData = async (id) => {
}
};
const setProvince = (provinceFk) => {
const result = provincesLocation.value.filter(
(province) => province.id === provinceFk
);
return result[0]?.name || '';
};
const isDefaultAddress = (address) => {
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
};
@ -124,6 +128,12 @@ const toCustomerAddressEdit = (addressId) => {
</script>
<template>
<FetchData
@on-fetch="(data) => (provincesLocation = data)"
auto-load
url="Provinces/location"
/>
<div class="full-width flex justify-center">
<QCard class="card-width q-pa-lg" v-if="addresses.length">
<QCardSection>
@ -167,14 +177,7 @@ const toCustomerAddressEdit = (addressId) => {
<div>{{ item.street }}</div>
<div>
{{ item.postalCode }} - {{ item.city }},
{{ item.province.name }}
</div>
<div>
{{ item.phone }}
<span v-if="item.mobile"
>,
{{ item.mobile }}
</span>
{{ setProvince(item.provinceFk) }}
</div>
<div class="flex">
<QCheckbox

View File

@ -5,27 +5,29 @@ import { useRoute } from 'vue-router';
import { useAcl } from 'src/composables/useAcl';
import axios from 'axios';
import { useQuasar } from 'quasar';
import FetchData from 'components/FetchData.vue';
import { toCurrency, toDate, toDateHourMin } from 'src/filters';
import { useState } from 'composables/useState';
import { useStateStore } from 'stores/useStateStore';
import { usePrintService } from 'composables/usePrintService';
import { useSession } from 'composables/useSession';
import { useVnConfirm } from 'composables/useVnConfirm';
import VnTable from 'components/VnTable/VnTable.vue';
import VnInput from 'components/common/VnInput.vue';
import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnFilter from 'components/VnTable/VnFilter.vue';
import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue';
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
const { openConfirmationModal } = useVnConfirm();
const { sendEmail, openReport } = usePrintService();
const { sendEmail } = usePrintService();
const { t } = useI18n();
const { hasAny } = useAcl();
const currentBalance = ref({});
const session = useSession();
const tokenMultimedia = session.getTokenMultimedia();
const quasar = useQuasar();
const route = useRoute();
const state = useState();
@ -33,9 +35,9 @@ const stateStore = useStateStore();
const user = state.getUser();
const clientRisk = ref([]);
const companies = ref([]);
const tableRef = ref();
const companyId = ref(user.value.companyFk);
const companyId = ref();
const companyLastId = ref(user.value.companyFk);
const balances = ref([]);
const vnFilterRef = ref({});
const filter = computed(() => {
@ -45,16 +47,43 @@ const filter = computed(() => {
};
});
const companyFilterColumn = {
align: 'left',
name: 'companyId',
label: t('Company'),
component: 'select',
attrs: {
url: 'Companies',
optionLabel: 'code',
sortBy: 'code',
limit: 0,
},
columnFilter: {
event: {
remove: () => (companyId.value = null),
'update:modelValue': (newCompanyFk) => {
if (!newCompanyFk) return;
vnFilterRef.value.addFilter(newCompanyFk);
companyLastId.value = newCompanyFk;
},
blur: () =>
!companyId.value &&
(companyId.value = companyLastId.value ?? user.value.companyFk),
},
},
visible: false,
};
const columns = computed(() => [
{
align: 'right',
align: 'left',
name: 'payed',
label: t('Date'),
format: ({ payed }) => toDate(payed),
cardVisible: true,
},
{
align: 'right',
align: 'left',
name: 'created',
label: t('Creation date'),
format: ({ created }) => toDateHourMin(created),
@ -62,10 +91,16 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'workerFk',
label: t('Employee'),
columnField: {
component: 'userLink',
attrs: ({ row }) => ({ workerId: row.workerFk, name: row.userName }),
attrs: ({ row }) => {
return {
workerId: row.workerFk,
name: row.userName,
};
},
},
cardVisible: true,
},
@ -90,14 +125,14 @@ const columns = computed(() => [
isId: true,
},
{
align: 'left',
align: 'right',
name: 'credit',
label: t('Havings'),
format: ({ credit }) => credit && toCurrency(credit),
cardVisible: true,
},
{
align: 'left',
align: 'right',
name: 'balance',
label: t('Balance'),
format: ({ balance }) => toCurrency(balance),
@ -136,20 +171,41 @@ const columns = computed(() => [
onBeforeMount(() => {
stateStore.rightDrawer = true;
companyId.value = user.value.companyFk;
});
async function getCurrentBalance(data) {
currentBalance.value[companyId.value] = {
amount: 0,
code: companies.value.find((c) => c.id === companyId.value)?.code,
};
async function getClientRisk() {
const { data } = await axios.get(`clientRisks`, {
params: {
filter: JSON.stringify({
include: { relation: 'company', scope: { fields: ['code'] } },
where: { clientFk: route.params.id, companyFk: user.value.companyFk },
}),
},
});
clientRisk.value = data;
return clientRisk.value;
}
for (const balance of data) {
currentBalance.value[balance.companyFk] = {
code: balance.company.code,
amount: balance.amount,
};
async function getCurrentBalance() {
const currentBalance = (await getClientRisk()).find((balance) => {
return balance.companyFk === companyId.value;
});
return currentBalance && currentBalance.amount;
}
async function onFetch(data) {
balances.value = [];
for (const [index, balance] of data.entries()) {
if (index === 0) {
balance.balance = await getCurrentBalance();
continue;
}
const previousBalance = data[index - 1];
balance.balance =
previousBalance?.balance - (previousBalance?.debit - previousBalance?.credit);
}
balances.value = data;
}
const showNewPaymentDialog = () => {
@ -164,48 +220,31 @@ const showNewPaymentDialog = () => {
};
const showBalancePdf = ({ id }) => {
openReport(`InvoiceOuts/${id}/download`, {}, '_blank');
const url = `api/InvoiceOuts/${id}/download?access_token=${tokenMultimedia}`;
window.open(url, '_blank');
};
</script>
<template>
<FetchData
url="Companies"
auto-load
@on-fetch="(data) => (companies = data)"
></FetchData>
<FetchData
v-if="companies.length > 0"
url="clientRisks"
:filter="{
include: { relation: 'company', scope: { fields: ['code'] } },
where: { clientFk: route.params.id },
}"
auto-load
@on-fetch="getCurrentBalance"
></FetchData>
<VnSubToolbar class="q-mb-md">
<template #st-data>
<div class="column justify-center q-px-md q-py-sm">
<span class="text-bold">{{ t('Total by company') }}</span>
<div class="row justify-center">
{{ currentBalance[companyId]?.code }}:
{{ toCurrency(currentBalance[companyId]?.amount) }}
<div class="row justify-center" v-if="clientRisk?.length">
{{ clientRisk[0].company.code }}:
{{ toCurrency(clientRisk[0].amount) }}
</div>
</div>
</template>
<template #st-actions>
<div>
<VnSelect
:label="t('Company')"
<VnFilter
ref="vnFilterRef"
v-model="companyId"
data-key="CustomerBalance"
:options="companies"
option-label="code"
option-value="id"
></VnSelect>
:column="companyFilterColumn"
search-url="balance"
/>
</div>
</template>
</VnSubToolbar>
@ -219,7 +258,7 @@ const showBalancePdf = ({ id }) => {
:right-search="false"
:is-editable="false"
:column-search="false"
:disable-option="{ card: true }"
@on-fetch="onFetch"
auto-load
>
<template #column-balance="{ rowIndex }">
@ -227,7 +266,7 @@ const showBalancePdf = ({ id }) => {
</template>
<template #column-description="{ row }">
<div class="link" v-if="row.isInvoice">
{{ t('bill', { ref: row.description }) }}
{{ row.description }}
<InvoiceOutDescriptorProxy :id="row.description" />
</div>
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">

View File

@ -16,20 +16,6 @@ const { t } = useI18n();
const businessTypes = ref([]);
const contactChannels = ref([]);
const title = ref();
const handleSalesModelValue = (val) => ({
or: [
{ id: val },
{ name: val },
{ nickname: { like: '%' + val + '%' } },
{ code: { like: `${val}%` } },
],
});
const exprBuilder = (param, value) => {
return {
and: [{ active: { neq: false } }, handleSalesModelValue(value)],
};
};
</script>
<template>
<FetchData
@ -39,7 +25,6 @@ const exprBuilder = (param, value) => {
/>
<FetchData
url="BusinessTypes"
:filter="{ fields: ['code', 'description'], order: 'description ASC ' }"
@on-fetch="(data) => (businessTypes = data)"
auto-load
/>
@ -48,12 +33,12 @@ const exprBuilder = (param, value) => {
<VnRow>
<VnInput
:label="t('globals.name')"
:rules="validate('client.name')"
:rules="validate('client.socialName')"
autofocus
clearable
v-model="data.name"
/>
<VnSelect
<QSelect
:input-debounce="0"
:label="t('customer.basicData.businessType')"
:options="businessTypes"
@ -104,20 +89,20 @@ const exprBuilder = (param, value) => {
</VnRow>
<VnRow>
<VnSelect
url="Workers/search"
url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }"
option-filter="firstName"
v-model="data.salesPersonFk"
:label="t('customer.basicData.salesPerson')"
:params="{
departmentCodes: ['VT', 'shopping'],
}"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
option-label="nickname"
option-value="id"
:rules="validate('client.salesPersonFk')"
:expr-builder="exprBuilder"
emit-value
auto-load
:use-like="false"
:emit-value="false"
@update:model-value="
(val) => {
title = val?.nickname;
data.salesPersonFk = val?.id;
}
"
>
<template #prepend>
<VnAvatar
@ -126,19 +111,8 @@ const exprBuilder = (param, value) => {
: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
<QSelect
v-model="data.contactChannelFk"
:options="contactChannels"
option-value="id"
@ -151,8 +125,7 @@ const exprBuilder = (param, value) => {
/>
</VnRow>
<VnRow>
<VnSelect
url="Clients"
<QSelect
:input-debounce="0"
:label="t('customer.basicData.previousClient')"
:options="clients"
@ -161,9 +134,7 @@ const exprBuilder = (param, value) => {
map-options
option-label="name"
option-value="id"
sort-by="name ASC"
v-model="data.transferorFk"
:fields="['id', 'name']"
>
<template #append>
<QIcon name="info" class="cursor-pointer">
@ -174,7 +145,7 @@ const exprBuilder = (param, value) => {
}}</QTooltip>
</QIcon>
</template>
</VnSelect>
</QSelect>
</VnRow>
</template>
</FormModel>

View File

@ -3,6 +3,7 @@ import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
@ -13,6 +14,8 @@ import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
const { t } = useI18n();
const route = useRoute();
const payMethods = ref([]);
const bankEntitiesOptions = ref([]);
const bankEntitiesRef = ref(null);
const filter = {
@ -28,6 +31,15 @@ const getBankEntities = (data, formData) => {
</script>
<template>
<fetch-data @on-fetch="(data) => (payMethods = data)" auto-load url="PayMethods" />
<fetch-data
ref="bankEntitiesRef"
@on-fetch="(data) => (bankEntitiesOptions = data)"
:filter="filter"
auto-load
url="BankEntities"
/>
<FormModel
:url-update="`Clients/${route.params.id}`"
:url="`Clients/${route.params.id}/getCard`"
@ -37,9 +49,8 @@ const getBankEntities = (data, formData) => {
<template #form="{ data, validate }">
<VnRow>
<VnSelect
auto-load
url="PayMethods"
:label="t('Billing data')"
:options="payMethods"
hide-selected
option-label="name"
option-value="id"
@ -58,10 +69,7 @@ const getBankEntities = (data, formData) => {
</VnInput>
<VnSelectDialog
:label="t('Swift / BIC')"
ref="bankEntitiesRef"
:filter="filter"
auto-load
url="BankEntities"
:options="bankEntitiesOptions"
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
:rules="validate('Worker.bankEntity')"
hide-selected
@ -77,8 +85,9 @@ const getBankEntities = (data, formData) => {
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection v-if="scope.opt">
<QItemLabel>{{ scope.opt.bic }} </QItemLabel>
<QItemLabel caption> {{ scope.opt.name }}</QItemLabel>
<QItemLabel
>{{ scope.opt.bic }} {{ scope.opt.name }}</QItemLabel
>
</QItemSection>
</QItem>
</template>

View File

@ -1,23 +1,17 @@
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import VnCard from 'components/common/VnCard.vue';
import CustomerDescriptor from './CustomerDescriptor.vue';
import CustomerFilter from '../CustomerFilter.vue';
const route = useRoute();
const routeName = computed(() => route.name);
</script>
<template>
<VnCard
data-key="Client"
base-url="Clients"
:descriptor="CustomerDescriptor"
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
:filter-panel="CustomerFilter"
search-data-key="CustomerList"
:searchbar-props="{
url: 'Clients/filter',
url: 'Clients/extendedListFilter',
label: 'Search customer',
info: 'You can search by customer id or name',
}"

View File

@ -1,241 +1,15 @@
<script setup>
import { ref, computed, onBeforeMount } from 'vue';
import axios from 'axios';
import { useI18n } from 'vue-i18n';
import { toDate } from 'src/filters/index';
import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import { useArrayData } from 'src/composables/useArrayData';
import { usePrintService } from 'src/composables/usePrintService';
import { useVnConfirm } from 'src/composables/useVnConfirm';
const { openConfirmationModal } = useVnConfirm();
const { openReport, sendEmail } = usePrintService();
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
const arrayData = useArrayData('Client');
const { t } = useI18n();
const route = useRoute();
const campaignList = ref();
const showActionBtns = computed(() => handleQueryParams());
function handleQueryParams() {
const query = getQueryParams();
return query.from && query.to;
}
const columns = computed(() => [
{
name: 'search',
align: 'left',
label: t('globals.search'),
visible: false,
},
{
name: 'itemFk',
align: 'left',
label: t('globals.item'),
columnClass: 'shrink',
cardVisible: true,
columnFilter: {
name: 'itemId',
},
},
{
name: 'ticketFk',
align: 'left',
label: t('globals.ticket'),
cardVisible: true,
columnFilter: {
inWhere: true,
},
},
{
name: 'shipped',
align: 'left',
label: t('globals.shipped'),
format: ({ shipped }) => toDate(shipped),
columnFilter: false,
cardVisible: true,
},
{
name: 'description',
align: 'left',
label: t('globals.description'),
columnClass: 'expand',
columnFilter: {
inWhere: true,
},
},
{
name: 'quantity',
label: t('globals.quantity'),
cardVisible: true,
columnFilter: {
inWhere: true,
},
},
{
name: 'grouped',
label: t('Group by items'),
component: 'checkbox',
visible: false,
orderBy: false,
},
]);
onBeforeMount(async () => {
campaignList.value = (await axios('Campaigns/latest')).data;
});
function getQueryParams() {
return JSON.parse(route.query.consumption ?? '{}');
}
function getParams() {
const query = getQueryParams();
return {
from: query.from,
to: query.to,
recipient: arrayData.store.data.email,
recipientId: arrayData.store.data.id,
};
}
const userParams = computed(() => {
const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0);
minDate.setMonth(minDate.getMonth() - 2);
const maxDate = Date.vnNew();
maxDate.setHours(23, 59, 59, 59);
return {
campaign: campaignList.value[0]?.id,
from: minDate,
to: maxDate,
};
});
const openReportPdf = () => {
openReport(`Clients/${route.params.id}/campaign-metrics-pdf`, getParams());
};
const openSendEmailDialog = async () => {
openConfirmationModal(
t('The consumption report will be sent'),
t('Please, confirm'),
() => sendCampaignMetricsEmail({ address: arrayData.store.data.email })
);
};
const sendCampaignMetricsEmail = ({ address }) => {
sendEmail(`Clients/${route.params.id}/campaign-metrics-email`, {
recipient: address,
...getParams(),
});
};
import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue';
import { useStateStore } from 'src/stores/useStateStore';
</script>
<template>
<VnTable
v-if="campaignList"
data-key="CustomerConsumption"
url="Clients/consumption"
:order="['itemTypeFk', 'itemName', 'itemSize', 'description']"
:columns="columns"
search-url="consumption"
:filter="filter"
:user-params="userParams"
:default-remove="false"
:default-reset="false"
:default-save="false"
:has-sub-toolbar="true"
auto-load
>
<template #moreBeforeActions>
<QBtn
color="primary"
flat
icon-right="picture_as_pdf"
@click="openReportPdf()"
:disabled="!showActionBtns"
>
<QTooltip>{{ t('globals.downloadPdf') }}</QTooltip>
</QBtn>
<QBtn
color="primary"
flat
icon-right="email"
@click="openSendEmailDialog()"
:disabled="!showActionBtns"
>
<QTooltip>{{ t('Send to email') }}</QTooltip>
</QBtn>
</template>
<template #column-itemFk="{ row }">
<span class="link">
{{ row.itemFk }}
<ItemDescriptorProxy :id="row.itemFk" />
</span>
</template>
<template #column-ticketFk="{ row }">
<span class="link">
{{ row.ticketFk }}
<TicketDescriptorProxy :id="row.ticketFk" />
</span>
</template>
<template #column-description="{ row }">
<div>{{ row.concept }}</div>
<div v-if="row.subName" class="subName">
{{ row.subName }}
</div>
<FetchedTags :item="row" :max-length="3" />
</template>
<template #moreFilterPanel="{ params }">
<div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl">
<VnSelect
v-model="params.campaign"
:options="campaignList"
:label="t('globals.campaign')"
:filled="true"
class="q-px-sm q-pt-none fit"
dense
option-label="code"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.code }}
{{
new Date(scope.opt?.dated).getFullYear()
}}</QItemLabel
>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnInputDate
v-model="params.from"
:label="t('globals.from')"
:filled="true"
class="q-px-xs q-pt-none fit"
dense
/>
<VnInputDate
v-model="params.to"
:label="t('globals.to')"
:filled="true"
class="q-px-xs q-pt-none fit"
dense
/>
</div>
</template>
</VnTable>
<Teleport to="#right-panel" v-if="useStateStore().isHeaderMounted()">
<CustomerConsumptionFilter data-key="CustomerConsumption" />
</Teleport>
</template>
<i18n>
es:
Enter a new search: Introduce una nueva búsqueda
Group by items: Agrupar por artículos
</i18n>

View File

@ -5,8 +5,6 @@ import VnInput from 'src/components/common/VnInput.vue';
import { QItem } from 'quasar';
import VnSelect from 'src/components/common/VnSelect.vue';
import { QItemSection } from 'quasar';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { toDate } from 'src/filters';
const { t } = useI18n();
defineProps({ dataKey: { type: String, required: true } });
@ -35,8 +33,6 @@ defineProps({ dataKey: { type: String, required: true } });
<VnSelect
v-model="params.buyerId"
url="TicketRequests/getItemTypeWorker"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
:label="t('params.buyer')"
option-value="id"
option-label="nickname"
@ -47,97 +43,35 @@ defineProps({ dataKey: { type: String, required: true } });
</QItemSection>
</QItem>
<QItem>
<!--It's required to include the relation category !! There's 413 records in production-->
<QItemSection>
<VnSelect
v-model="params.typeId"
url="ItemTypes"
:include="['category']"
:fields="['id', 'name', 'categoryFk']"
sort-by="name ASC"
:label="t('params.typeId')"
:label="t('params.type')"
option-label="name"
option-value="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>{{
scope.opt?.category?.name
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.categoryId"
url="ItemCategories"
:fields="['id', 'name']"
sort-by="name ASC"
:label="t('params.categoryId')"
:label="t('params.category')"
option-label="name"
option-value="id"
v-model="params.categoryId"
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.campaignId"
url="Campaigns/latest"
sort-by="dated DESC"
:label="t('params.campaignId')"
option-label="code"
option-value="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
t(`params.${scope.opt?.code}`)
}}</QItemLabel>
<QItemLabel caption>{{
toDate(scope.opt.dated)
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.from')"
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.to')"
v-model="params.to"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
@ -148,30 +82,10 @@ en:
buyer: Buyer
type: Type
category: Category
itemId: Item id
buyerId: Buyer
typeId: Type
categoryId: Category
from: From
to: To
campaignId: Campaña
valentinesDay: Valentine's Day
mothersDay: Mother's Day
allSaints: All Saints' Day
es:
params:
item: Id artículo
buyer: Comprador
type: Tipo
category: Categoría
itemId: Id Artículo
buyerId: Comprador
typeId: Tipo
categoryId: Reino
from: Desde
to: Hasta
campaignId: Campaña
valentinesDay: Día de San Valentín
mothersDay: Día de la Madre
allSaints: Día de Todos los Santos
</i18n>

View File

@ -56,18 +56,17 @@ const customerContactsRef = ref(null);
</div>
</VnRow>
<VnRow>
<QBtn
<QIcon
@click="customerContactsRef.insert()"
class="cursor-pointer"
color="primary"
flat
icon="add"
shortcut="+"
name="add"
size="sm"
>
<QTooltip>
{{ t('Add contact') }}
</QTooltip>
</QBtn>
</QIcon>
</VnRow>
</QCard>
</template>

View File

@ -53,8 +53,6 @@ const openDialog = (item) => {
promise: updateData,
},
});
updateData();
showQPageSticky.value = true;
};
const openViewCredit = (credit) => {

View File

@ -1,17 +1,23 @@
<script setup>
import { computed, ref } from 'vue';
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { toCurrency, toDateHourMin } from 'src/filters';
import VnTable from 'src/components/VnTable/VnTable.vue';
import { QBtn } from 'quasar';
import { toCurrency, toDateHourMin } from 'src/filters';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
const { t } = useI18n();
const route = useRoute();
const tableRef = ref();
const clientInformasRef = ref(null);
const rows = ref([]);
const filter = {
include: [
@ -31,9 +37,10 @@ const filter = {
const columns = computed(() => [
{
align: 'left',
format: ({ created }) => toDateHourMin(created),
field: 'created',
format: (value) => toDateHourMin(value),
label: t('Since'),
name: 'created',
name: 'since',
},
{
align: 'left',
@ -44,56 +51,66 @@ const columns = computed(() => [
{
align: 'right',
field: 'rating',
label: t('customer.summary.rating'),
label: t('Rating'),
name: 'rating',
create: true,
columnCreate: {
component: 'number',
autofocus: true,
},
},
{
align: 'right',
field: 'recommendedCredit',
format: ({ recommendedCredit }) => toCurrency(recommendedCredit),
label: t('customer.summary.recommendCredit'),
format: (value) => toCurrency(value),
label: t('Recommended credit'),
name: 'recommendedCredit',
create: true,
columnCreate: {
component: 'number',
autofocus: true,
},
},
]);
watch(
() => route.params.id,
(newValue) => {
if (!newValue) return;
filter.where.clientFk = newValue;
clientInformasRef.value?.fetch();
}
);
</script>
<template>
<VnTable
ref="tableRef"
data-key="ClientInformas"
url="ClientInformas"
<FetchData
:filter="filter"
:order="['created DESC']"
:columns="columns"
:right-search="false"
:is-editable="false"
:use-model="true"
:column-search="false"
:disable-option="{ card: true }"
@on-fetch="(data) => (rows = data)"
auto-load
:create="{
urlCreate: `Clients/${route.params.id}/setRating`,
title: 'Create rating',
onDataSaved: () => tableRef.reload(),
formInitialData: {},
}"
ref="clientInformasRef"
url="ClientInformas"
/>
<FormModel
:form-initial-data="{}"
:observe-form-changes="false"
:url-create="`Clients/${route.params.id}/setRating`"
>
<template #column-employee="{ row }">
<span class="link">{{ row.worker.user.nickname }}</span>
<WorkerDescriptorProxy :id="row.worker.id" />
<template #form="{ data }">
<VnRow>
<div class="col">
<VnInput
:label="t('Rating')"
clearable
type="number"
v-model.number="data.rating"
/>
</div>
<div class="col">
<VnInput
:label="t('Recommended credit')"
clearable
type="number"
v-model.number="data.recommendedCredit"
/>
</div>
</VnRow>
</template>
</VnTable>
<!-- <QTable
</FormModel>
<div class="full-width flex justify-center" v-if="rows.length">
<QTable
:columns="columns"
:pagination="{ rowsPerPage: 0 }"
:rows="rows"
@ -103,16 +120,22 @@ const columns = computed(() => [
class="card-width q-px-lg"
>
<template #body-cell-employee="{ row }">
<QTd @click.stop>
<span class="link">{{ row.worker.user.nickname }}</span>
<QTd auto-width @click.stop>
<QBtn color="blue" flat no-caps>{{ row.worker.user.nickname }}</QBtn>
<WorkerDescriptorProxy :id="row.clientFk" />
</QTd>
</template>
</QTable> -->
</QTable>
</div>
<h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }}
</h5>
</template>
<i18n>
es:
Rating: Clasificación
Recommended credit: Crédito recomendado
Since: Desde
Employee: Empleado

View File

@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
import { toCurrency, toDate } from 'src/filters';
import useCardDescription from 'src/composables/useCardDescription';
@ -11,10 +11,6 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
import { useState } from 'src/composables/useState';
const state = useState();
const customer = computed(() => state.get('customer'));
const $props = defineProps({
id: {
@ -47,7 +43,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
:subtitle="data.subtitle"
@on-fetch="setData"
:summary="$props.summary"
data-key="customer"
data-key="customerData"
>
<template #menu="{ entity }">
<CustomerDescriptorMenu :customer="entity" />
@ -61,46 +57,35 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
:value="toCurrency(entity.creditInsurance)"
/>
<VnLv
:label="t('customer.card.debt')"
:value="toCurrency(entity.debt)"
:info="t('customer.summary.riskInfo')"
/>
<VnLv :label="t('customer.card.salesPerson')">
<VnLv :label="t('customer.card.debt')" :value="toCurrency(entity.debt)" />
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
<template #value>
<VnUserLink
v-if="entity.salesPersonUser"
:name="entity.salesPersonUser.name"
:name="entity.salesPersonUser?.name"
:worker-id="entity.salesPersonFk"
/>
<span v-else>{{ dashIfEmpty(entity.salesPersonUser) }}</span>
</template>
</VnLv>
<VnLv
:label="t('customer.card.businessTypeFk')"
:value="entity.businessType.description"
:value="entity.businessTypeFk"
/>
</template>
<template #icons>
<QCardActions v-if="customer" class="q-gutter-x-md">
<template #icons="{ entity }">
<QCardActions class="q-gutter-x-md">
<QIcon
v-if="!customer.isActive"
v-if="!entity.isActive"
name="vn:disabled"
size="xs"
color="primary"
>
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
</QIcon>
<QIcon
v-if="customer.isFreezed"
name="vn:frozen"
size="xs"
color="primary"
>
<QIcon v-if="entity.isFreezed" name="vn:frozen" size="xs" color="primary">
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
</QIcon>
<QIcon
v-if="!customer.account?.active"
v-if="!entity.account.active"
color="primary"
name="vn:noweb"
size="xs"
@ -108,7 +93,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
</QIcon>
<QIcon
v-if="customer.debt > customer.credit"
v-if="entity.debt > entity.credit"
name="vn:risk"
size="xs"
color="primary"
@ -116,7 +101,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
<QTooltip>{{ t('customer.card.hasDebt') }}</QTooltip>
</QIcon>
<QIcon
v-if="!customer.isTaxDataChecked"
v-if="!entity.isTaxDataChecked"
name="vn:no036"
size="xs"
color="primary"
@ -124,7 +109,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
</QIcon>
<QBtn
v-if="customer.unpaid"
v-if="entity.unpaid"
flat
size="sm"
icon="vn:Client_unpaid"
@ -136,13 +121,13 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
<br />
{{
t('unpaidDated', {
dated: toDate(customer.unpaid.dated),
dated: toDate(entity.unpaid.dated),
})
}}
<br />
{{
t('unpaidAmount', {
amount: toCurrency(customer.unpaid.amount),
amount: toCurrency(entity.unpaid.amount),
})
}}
</QTooltip>
@ -154,13 +139,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
<QBtn
:to="{
name: 'TicketList',
query: {
from: undefined,
to: undefined,
table: JSON.stringify({
clientFk: entity.id,
}),
},
query: { table: JSON.stringify({ clientFk: entity.id }) },
}"
size="md"
icon="vn:ticket"
@ -181,8 +160,23 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
</QBtn>
<QBtn
:to="{
name: 'AccountSummary',
params: { id: entity.id },
name: 'OrderCreate',
query: { clientId: entity.id },
}"
size="md"
icon="vn:basketadd"
color="primary"
>
<QTooltip>{{ t('New order') }}</QTooltip>
</QBtn>
<QBtn
:to="{
name: 'AccountList',
query: {
table: JSON.stringify({
filter: { where: { id: entity.id } },
}),
},
}"
size="md"
icon="face"
@ -190,18 +184,6 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
>
<QTooltip>{{ t('Go to user') }}</QTooltip>
</QBtn>
<QBtn
v-if="entity.supplier"
:to="{
name: 'SupplierSummary',
params: { id: entity.supplier.id },
}"
size="md"
icon="vn:supplier"
color="primary"
>
<QTooltip>{{ t('Go to supplier') }}</QTooltip>
</QBtn>
</QCardActions>
</template>
</CardDescriptor>
@ -215,8 +197,8 @@ es:
Go to module index: Ir al índice del módulo
Customer ticket list: Listado de tickets del cliente
Customer invoice out list: Listado de facturas del cliente
New order: Nuevo pedido
Go to user: Ir al usuario
Go to supplier: Ir al proveedor
Customer unpaid: Cliente impago
Unpaid: Impagado
unpaidDated: 'Fecha {dated}'

View File

@ -8,9 +8,6 @@ import { useQuasar } from 'quasar';
import useNotify from 'src/composables/useNotify';
import VnSmsDialog from 'src/components/common/VnSmsDialog.vue';
import TicketCreateDialog from 'src/pages/Ticket/TicketCreateDialog.vue';
import OrderCreateDialog from 'src/pages/Order/Card/OrderCreateDialog.vue';
import { ref } from 'vue';
const $props = defineProps({
customer: {
@ -43,32 +40,20 @@ const sendSms = async (payload) => {
notify(error.message, 'positive');
}
};
const ticketCreateFormDialog = ref(null);
const openTicketCreateForm = () => {
ticketCreateFormDialog.value.show();
};
const orderCreateFormDialog = ref(null);
const openOrderCreateForm = () => {
orderCreateFormDialog.value.show();
};
</script>
<template>
<QItem v-ripple clickable @click="openTicketCreateForm()">
<QItem v-ripple clickable>
<QItemSection>
{{ t('globals.pageTitles.createTicket') }}
<QDialog ref="ticketCreateFormDialog">
<TicketCreateDialog />
</QDialog>
</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openOrderCreateForm()">
<QItemSection>
{{ t('globals.pageTitles.createOrder') }}
<QDialog ref="orderCreateFormDialog">
<OrderCreateDialog :client-fk="customer.id" />
</QDialog>
<RouterLink
:to="{
name: 'TicketCreate',
query: { clientFk: customer.id },
}"
class="color-vn-text"
>
{{ t('Simple ticket') }}
</RouterLink>
</QItemSection>
</QItem>
<QItem v-ripple clickable>

View File

@ -236,7 +236,6 @@ const toCustomerFileManagementCreate = () => {
@click.stop="toCustomerFileManagementCreate()"
color="primary"
fab
shortcut="+"
icon="add"
/>
<QTooltip>

View File

@ -93,9 +93,8 @@ function handleLocation(data, location) {
<VnRow>
<VnLocation
:rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:location="data"
v-model="data.postcode"
@update:model-value="(location) => handleLocation(data, location)"
/>
</VnRow>
@ -135,17 +134,15 @@ function handleLocation(data, location) {
</QTooltip>
</QIcon>
</div>
<QCheckbox :label="t('Daily invoice')" v-model="data.hasDailyInvoice" />
<QCheckbox :label="t('Verified data')" v-model="data.isTaxDataChecked" />
</VnRow>
<VnRow>
<QCheckbox
:label="t('Electronic invoice')"
v-model="data.hasElectronicInvoice"
/><QCheckbox
:label="t('Verified data')"
v-model="data.isTaxDataChecked"
/>
<QCheckbox :label="t('Daily invoice')" v-model="data.hasDailyInvoice" />
</VnRow>
</template>
</FormModel>

View File

@ -5,10 +5,10 @@ import { useRoute } from 'vue-router';
import { toCurrency } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date';
import VnTable from 'components/VnTable/VnTable.vue';
import FetchData from 'components/FetchData.vue';
const entityId = computed(() => route.params.id);
const { t } = useI18n();
const route = useRoute();
const rows = ref([]);
const totalAmount = ref();
const tableRef = ref();
const filter = computed(() => {
@ -28,7 +28,7 @@ const filter = computed(() => {
},
],
where: {
clientFk: entityId,
clientFk: route.params.id,
},
};
});
@ -47,6 +47,7 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'userFk',
label: t('Created by'),
component: 'userLink',
attrs: ({ row }) => {
@ -72,7 +73,6 @@ const columns = computed(() => [
columnCreate: {
component: 'select',
url: 'greugeTypes',
sortBy: 'name ASC ',
limit: 0,
},
},
@ -84,14 +84,14 @@ const columns = computed(() => [
create: true,
},
]);
const setRows = (data) => {
rows.value = data;
totalAmount.value = data.reduce((acc, { amount = 0 }) => acc + amount, 0);
};
</script>
<template>
<FetchData
:url="`Greuges/${entityId}/sumAmount`"
auto-load
@on-fetch="({ sumAmount }) => (totalAmount = sumAmount)"
></FetchData>
<VnTable
ref="tableRef"
data-key="Greuges"
@ -104,10 +104,10 @@ const columns = computed(() => [
:is-editable="false"
:use-model="true"
:column-search="false"
:disable-option="{ card: true }"
@on-fetch="(data) => setRows(data)"
:create="{
urlCreate: `Greuges`,
title: t('New greuge'),
title: t('New credit'),
onDataSaved: () => tableRef.reload(),
formInitialData: { shipped: new Date(), clientFk: route.params.id },
}"

View File

@ -1,19 +1,20 @@
<script setup>
import { computed } from 'vue';
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { toDateTimeFormat } from 'src/filters/date';
import VnTable from 'src/components/VnTable/VnTable.vue';
import { dashIfEmpty } from 'src/filters';
import FetchData from 'components/FetchData.vue';
const { t } = useI18n();
const route = useRoute();
const rows = ref([]);
const filter = {
include: [
{ relation: 'mandateType', scope: { fields: ['id', 'code'] } },
{ relation: 'mandateType', scope: { fields: ['id', 'name'] } },
{ relation: 'company', scope: { fields: ['id', 'code'] } },
],
where: { clientFk: route.params.id },
@ -21,61 +22,114 @@ const filter = {
limit: 20,
};
const tableColumnComponents = {
id: {
component: 'span',
props: () => {},
event: () => {},
},
company: {
component: 'span',
props: () => {},
event: () => {},
},
type: {
component: 'span',
props: () => {},
event: () => {},
},
registerDate: {
component: 'span',
props: () => {},
event: () => {},
},
endDate: {
component: 'span',
props: () => {},
event: () => {},
},
};
const columns = computed(() => [
{
align: 'left',
name: 'id',
label: t('globals.id'),
field: 'id',
isId: true,
label: t('Id'),
name: 'id',
},
{
align: 'left',
cardVisible: true,
format: ({ company }) => company.code,
label: t('globals.company'),
field: (row) => row.company.code,
label: t('Company'),
name: 'company',
},
{
align: 'left',
cardVisible: true,
format: ({ mandateType }) => mandateType.code,
label: t('globals.type'),
field: (row) => row.mandateType.name,
label: t('Type'),
name: 'type',
},
{
align: 'left',
cardVisible: true,
field: 'created',
label: t('Register date'),
name: 'created',
format: ({ created }) => toDateTimeFormat(created),
name: 'registerDate',
format: (value) => toDateTimeFormat(value),
},
{
align: 'right',
cardVisible: true,
name: 'finished',
align: 'left',
field: 'finished',
label: t('End date'),
format: ({ finished }) => dashIfEmpty(toDateTimeFormat(finished)),
name: 'endDate',
format: (value) => (value ? toDateTimeFormat(value) : '-'),
},
]);
</script>
<template>
<FetchData
:filter="filter"
@on-fetch="(data) => (rows = data)"
auto-load
url="Mandates"
/>
<QPage class="column items-center q-pa-md">
<VnTable
:filter="filter"
auto-load
url="Mandates"
<QTable
:columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows"
class="full-width q-mt-md"
:right-search="false"
:row-click="false"
/>
row-key="id"
v-if="rows?.length"
>
<template #body-cell="props">
<QTd :props="props">
<QTr :props="props" class="cursor-pointer">
<component
:is="tableColumnComponents[props.col.name].component"
@click="tableColumnComponents[props.col.name].event(props)"
class="rounded-borders q-pa-sm"
v-bind="tableColumnComponents[props.col.name].props(props)"
>
{{ props.value }}
</component>
</QTr>
</QTd>
</template>
</QTable>
<h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }}
</h5>
</QPage>
</template>
<i18n>
es:
Id: Id
Company: Empresa
Type: Tipo
Register date: Fecha alta
End date: Fecha baja
</i18n>

View File

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

View File

@ -89,10 +89,9 @@ function setFinished(id) {
:columns="columns"
:use-model="true"
:right-search="false"
:disable-option="{ card: true }"
:create="{
urlCreate: 'Recoveries',
title: t('New recovery'),
title: 'New recovery',
onDataSaved: () => tableRef.reload(),
formInitialData: { clientFk: route.params.id, started: Date.vnNew() },
}"

View File

@ -1,18 +1,19 @@
<script setup>
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { QBtn, useQuasar } from 'quasar';
import { QBtn } from 'quasar';
import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { toDateTimeFormat } from 'src/filters/date';
import VnTable from 'src/components/VnTable/VnTable.vue';
import { dashIfEmpty } from 'src/filters';
import CustomerSamplesCreate from '../components/CustomerSamplesCreate.vue';
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const rows = ref([]);
const filter = {
include: [
@ -25,87 +26,108 @@ const filter = {
limit: 20,
};
const tableColumnComponents = {
sent: {
component: 'span',
props: () => {},
event: () => {},
},
description: {
component: 'span',
props: () => {},
event: () => {},
},
worker: {
component: QBtn,
props: () => ({ flat: true, color: 'blue', noCaps: true }),
event: () => {},
},
company: {
component: 'span',
props: () => {},
event: () => {},
},
};
const columns = computed(() => [
{
align: 'left',
name: 'created',
field: 'created',
label: t('Sent'),
format: ({ created }) => toDateTimeFormat(created),
name: 'sent',
format: (value) => toDateTimeFormat(value),
},
{
align: 'left',
format: (row) => row.type.description,
field: (value) => value.type.description,
label: t('Description'),
name: 'description',
},
{
align: 'left',
field: (value) => value.user.name,
label: t('Worker'),
columnField: {
component: 'userLink',
attrs: ({ row }) => {
return {
defaultName: true,
workerId: row?.user?.id,
name: row?.user?.name,
};
},
},
name: 'worker',
},
{
align: 'left',
format: ({ company }) => company?.code ?? dashIfEmpty(company),
field: (value) => value.company?.code,
label: t('Company'),
name: 'company',
},
]);
const quasar = useQuasar();
const toCustomerSamplesCreate = () => {
quasar
.dialog({
component: CustomerSamplesCreate,
})
.onOk(() => tableRef.value.reload());
router.push({ name: 'CustomerSamplesCreate' });
};
const tableRef = ref();
</script>
<template>
<VnTable
ref="tableRef"
data-key="ClientSamples"
auto-load
<FetchData
:filter="filter"
@on-fetch="(data) => (rows = data)"
auto-load
url="ClientSamples"
:columns="columns"
:pagination="{ rowsPerPage: 12 }"
:disable-option="{ card: true }"
:right-search="false"
:rows="rows"
:order="['created DESC']"
class="full-width q-mt-md"
row-key="id"
:create="false"
:no-data-label="t('globals.noResults')"
>
<template #column-worker="{ row }">
<div v-if="row.user">
<span class="link">{{ row.user?.name }}</span
><WorkerDescriptorProxy :id="row.userFk" />
</div>
<span v-else>{{ dashIfEmpty(row.user) }}</span>
</template>
</VnTable>
/>
<div class="full-width flex justify-center">
<QPage class="card-width q-pa-lg">
<QTable
:columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows"
class="full-width q-mt-md"
row-key="id"
:no-data-label="t('globals.noResults')"
>
<template #body-cell="props">
<QTd :props="props">
<QTr :props="props" class="cursor-pointer">
<component
:is="tableColumnComponents[props.col.name].component"
class="col-content"
v-bind="
tableColumnComponents[props.col.name].props(props)
"
@click="
tableColumnComponents[props.col.name].event(props)
"
>
{{ props.value }}
<WorkerDescriptorProxy
:id="props.row.userFk"
v-if="props.col.name === 'worker'"
/>
</component>
</QTr>
</QTd>
</template>
</QTable>
</QPage>
</div>
<QPageSticky :offset="[18, 18]">
<QBtn
@click.stop="toCustomerSamplesCreate()"
color="primary"
fab
icon="add"
shortcut="+"
/>
<QBtn @click.stop="toCustomerSamplesCreate()" color="primary" fab icon="add" />
<QTooltip>
{{ t('Send sample') }}
</QTooltip>

View File

@ -1,11 +1,10 @@
<script setup>
import { computed, ref } from 'vue';
import { computed, ref, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import { toCurrency, toPercentage, toDate } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
@ -13,7 +12,6 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import VnRow from 'src/components/ui/VnRow.vue';
const route = useRoute();
const { t } = useI18n();
const grafanaUrl = 'https://grafana.verdnatura.es';
const $props = defineProps({
id: {
@ -25,6 +23,11 @@ const $props = defineProps({
const entityId = computed(() => $props.id || route.params.id);
const customer = computed(() => summary.value.entity);
const summary = ref();
const clientUrl = ref();
onMounted(async () => {
clientUrl.value = (await getUrl('client/')) + entityId.value + '/';
});
const balanceDue = computed(() => {
return (
@ -37,11 +40,11 @@ const balanceDue = computed(() => {
const balanceDueWarning = computed(() => (balanceDue.value ? 'negative' : ''));
const claimRate = computed(() => {
return customer.value.claimsRatio?.claimingRate ?? 0;
return customer.value.claimsRatio.claimingRate;
});
const priceIncreasingRate = computed(() => {
return customer.value.claimsRatio?.priceIncreasing ?? 0 / 100;
return customer.value.claimsRatio.priceIncreasing / 100;
});
const debtWarning = computed(() => {
@ -55,11 +58,6 @@ const creditWarning = computed(() => {
return tooMuchInsurance || noCreditInsurance ? 'negative' : '';
});
const sumRisk = ({ clientRisks }) => {
let total = clientRisks.reduce((acc, { amount }) => acc + amount, 0);
return total;
};
</script>
<template>
@ -93,13 +91,7 @@ const sumRisk = ({ clientRisks }) => {
<VnLv
:label="t('customer.summary.salesPerson')"
:value="entity?.salesPersonUser?.name"
>
<template #value>
<VnUserLink
:name="entity.salesPersonUser?.name"
:worker-id="entity.salesPersonFk"
/> </template
></VnLv>
/>
<VnLv
:label="t('customer.summary.contactChannel')"
:value="entity?.contactChannel?.name"
@ -139,7 +131,7 @@ const sumRisk = ({ clientRisks }) => {
:url="`#/customer/${entityId}/fiscal-data`"
:text="t('customer.summary.fiscalData')"
/>
<VnRow class="block">
<VnRow>
<VnLv
:label="t('customer.summary.isEqualizated')"
:value="entity.isEqualizated"
@ -148,6 +140,8 @@ const sumRisk = ({ clientRisks }) => {
:label="t('customer.summary.isActive')"
:value="entity.isActive"
/>
</VnRow>
<VnRow>
<VnLv
:label="t('customer.summary.verifiedData')"
:value="entity.isTaxDataChecked"
@ -156,6 +150,8 @@ const sumRisk = ({ clientRisks }) => {
:label="t('customer.summary.hasToInvoice')"
:value="entity.hasToInvoice"
/>
</VnRow>
<VnRow>
<VnLv
:label="t('customer.summary.notifyByEmail')"
:value="entity.isToBeMailed"
@ -166,7 +162,7 @@ const sumRisk = ({ clientRisks }) => {
<QCard class="vn-one">
<VnTitle
:url="`#/customer/${entityId}/billing-data`"
:text="t('customer.summary.payMethodFk')"
:text="t('customer.summary.billingData')"
/>
<VnLv
:label="t('customer.summary.payMethod')"
@ -174,7 +170,7 @@ const sumRisk = ({ clientRisks }) => {
/>
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
<VnRow class="q-mt-sm block">
<VnRow class="q-mt-sm" wrap>
<VnLv :label="t('customer.summary.hasLcr')" :value="entity.hasLcr" />
<VnLv
:label="t('customer.summary.hasCoreVnl')"
@ -189,7 +185,7 @@ const sumRisk = ({ clientRisks }) => {
</QCard>
<QCard class="vn-one" v-if="entity.defaultAddress">
<VnTitle
:url="`#/customer/${entityId}/address`"
:url="`#/customer/${entityId}/consignees`"
:text="t('customer.summary.consignee')"
/>
<VnLv
@ -222,7 +218,7 @@ const sumRisk = ({ clientRisks }) => {
</QCard>
<QCard class="vn-one" v-if="entity.account">
<VnTitle
:url="`${grafanaUrl}/d/adjlxzv5yjt34d/analisis-de-clientes-7c-crm?orgId=1&var-clientFk=${entityId}`"
:url="`https://grafana.verdnatura.es/d/adjlxzv5yjt34d/analisis-de-clientes-7c-crm?orgId=1&var-clientFk=${entityId}`"
:text="t('customer.summary.businessData')"
icon="vn:grafana"
/>
@ -235,6 +231,7 @@ const sumRisk = ({ clientRisks }) => {
:value="toCurrency(entity?.mana?.mana)"
/>
<VnLv
v-if="entity.claimsRatio"
:label="t('customer.summary.priceIncreasingRate')"
:value="toPercentage(priceIncreasingRate)"
/>
@ -243,14 +240,15 @@ const sumRisk = ({ clientRisks }) => {
:value="toCurrency(entity?.averageInvoiced?.invoiced)"
/>
<VnLv
v-if="entity.claimsRatio"
:label="t('customer.summary.claimRate')"
:value="toPercentage(claimRate)"
/>
</QCard>
<QCard class="vn-one" v-if="entity.account">
<VnTitle
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
:text="t('customer.summary.payMethodFk')"
:url="`https://grafana.verdnatura.es/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
:text="t('customer.summary.financialData')"
icon="vn:grafana"
/>
<VnLv
@ -268,13 +266,15 @@ const sumRisk = ({ clientRisks }) => {
/>
<VnLv
v-if="entity.creditInsurance"
:label="t('customer.summary.securedCredit')"
:value="toCurrency(entity.creditInsurance)"
:info="t('customer.summary.securedCreditInfo')"
/>
<VnLv
:label="t('customer.summary.balance')"
:value="toCurrency(sumRisk(entity)) || toCurrency(0)"
:value="toCurrency(entity.sumRisk) || toCurrency(0)"
:info="t('customer.summary.balanceInfo')"
/>
@ -301,7 +301,7 @@ const sumRisk = ({ clientRisks }) => {
:value="entity.recommendedCredit"
/>
</QCard>
<QCard>
<QCard class="vn-one">
<VnTitle :text="t('Latest tickets')" />
<CustomerSummaryTable />
</QCard>

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