forked from verdnatura/salix-front
WIP on 7553_FixTicketExpedition: 1f78d457 Merge branch '7553_FixTicketExpedition' of https://gitea.verdnatura.es/verdnatura/salix-front into 7553_FixTicketExpedition
This commit is contained in:
commit
6b95b2ea18
319
CHANGELOG.md
319
CHANGELOG.md
|
@ -1,3 +1,322 @@
|
|||
# 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 🆕
|
||||
|
||||
- feat(FormModel): trim data by default by:alexm
|
||||
- feat(orderBasicData): add notes by:alexm
|
||||
- feat(orderList): correct create order by:alexm
|
||||
- feat(orderList): use orderFilter and fixed this by:alexm
|
||||
- feat: #7323 handle workerPhoto (origin/7323_workerPhoto, 7323_workerPhoto) by:Javier Segarra
|
||||
- feat: add recover password and reset password by:alexm
|
||||
- feat: refs #7346 add seriaType option by:jgallego
|
||||
- feat: refs #7346 elimino === by:jgallego
|
||||
- feat: refs #7346 formdata uses serialType by:jgallego
|
||||
- feat: refs #7346 refactor by:jgallego
|
||||
- feat: refs #7346 sonarLint warnings (origin/7346-invoiceOutMultilple, 7346-invoiceOutMultilple) by:jgallego
|
||||
- feat: refs #7710 uses cloneAll by:jgallego
|
||||
- fix: refs #7717 fix OrderList table filters' and summary table style by:Jon
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- feat: refs #7346 refactor by:jgallego
|
||||
- perf: date fields (mindshore/feature/TicketFutureFilter, feature/TicketFutureFilter) by:Javier Segarra
|
||||
- perf: refs #7717 right menu filter by:Jon
|
||||
- perf: use ref at component start by:Javier Segarra
|
||||
- refactor: refs #7717 delete useless function and import by:Jon
|
||||
- refactor: refs #7717 deleted useless code by:Jon
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- feat(orderList): use orderFilter and fixed this by:alexm
|
||||
- fix(VnTable): orderBy v-model by:alexm
|
||||
- fix(account_card): redirection by:carlossa
|
||||
- fix(orderLines): reload when delete and redirect when confirm by:alexm
|
||||
- fix: #6336 ClaimListStates by:Javier Segarra
|
||||
- fix: account subsections cards by:carlossa
|
||||
- fix: duplicate key by:Jon
|
||||
- fix: order description to vnTable by:alexm
|
||||
- fix: orderCatalogFilter order by:alexm
|
||||
- fix: quasar build warnings (6336_claim_fix_states) by:Javier Segarra
|
||||
- fix: refs #7717 fix OrderList table filters' and summary table style by:Jon
|
||||
- fix: refs #7717 fix basic data form & minor errors by:Jon
|
||||
- fix: refs #7717 fix catalog filter, searchbar redirect and search by:Jon
|
||||
- fix: refs #7717 fix catalog searchbar and worker tests(refs #7323) by:Jon
|
||||
- fix: refs #7717 fix order sections by:Jon
|
||||
- fix: refs #7717 fix volume and lines redirect by:Jon
|
||||
- fix: refs #7717 fixed searchbar filter with rightmenu filters' applied by:Jon
|
||||
- fix: test by:alexm
|
||||
- fix: ticketDescriptorMenu by:Javier Segarra
|
||||
- refs #7355 account fixes by:carlossa
|
||||
|
||||
# Version 24.34 - 2024-08-20
|
||||
|
||||
### Added 🆕
|
||||
|
||||
- chore: #6900 order params by:jorgep
|
||||
- chore: refs #6900 drop console log by:jorgep
|
||||
- chore: refs #6900 drop vnCurrency by:jorgep
|
||||
- chore: refs #6900 fix e2e tests by:jorgep
|
||||
- chore: refs #6900 mv rectificative logic by:jorgep
|
||||
- chore: refs #6900 responsive code by:jorgep
|
||||
- chore: refs #7283 drop array types by:jorgep
|
||||
- chore: refs #7283 drop import by:jorgep
|
||||
- chore: refs #7283 fix e2e logout by:jorgep
|
||||
- chore: refs #7283 update VnAvatar title handling by:jorgep
|
||||
- chore: refs #7323 fix test by:jorgep
|
||||
- chore: refs #7323 remove unused import by:jorgep
|
||||
- chore: refs #7323drop commented code by:jorgep
|
||||
- feat(VnCard): use props searchbar by:alexm
|
||||
- feat(customer): improve basicData to balance by:alexm
|
||||
- feat(customer_balance): refs #6943 add functionality from salix by:alexm
|
||||
- feat(customer_balance): refs #6943 translations by:alexm
|
||||
- feat: refs #6130 husky commitLint config by:pablone
|
||||
- feat: refs #6130 husky hooks by:pablone
|
||||
- feat: refs #6900 add InvoiceInSerial by:jorgep
|
||||
- feat: refs #6900 add locale by:jorgep
|
||||
- feat: refs #6900 use VnTable & sort filter fields by:jorgep
|
||||
- feat: refs #7323 add flex-wrap by:jorgep
|
||||
- feat: refs #7323 add my account" btn & fix models log selectable by:jorgep
|
||||
- feat: refs #7323 improve test by:jorgep
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- refactor(customer_log: use VnLog by:alexm
|
||||
- refactor(customer_recovery): to vnTable by:alexm
|
||||
- refactor(customer_webAccess): FormModel by:alexm
|
||||
- refactor: refs #7283 update avatar size and color by:jorgep
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- chore: refs #6900 fix e2e tests by:jorgep
|
||||
- chore: refs #7283 fix e2e logout by:jorgep
|
||||
- chore: refs #7323 fix test by:jorgep
|
||||
- feat: refs #7323 add my account" btn & fix models log selectable by:jorgep
|
||||
- fix #7355 fix acls list by:carlossa
|
||||
- fix(VnFilterPanel): emit userParams better by:alexm
|
||||
- fix(claim_summary): url links (HEAD -> 7864_testToMaster_2434, origin/test, origin/7864_testToMaster_2434, test) by:alexm
|
||||
- fix(customer_sms: fix reload by:alexm
|
||||
- fix(twoFactor): unify code login and twoFactor by:alexm
|
||||
- fix: VnCard VnSearchbar props by:alexm
|
||||
- fix: accountMailAlias by:alexm
|
||||
- fix: refs #6130 add commit lint modules by:pablone
|
||||
- fix: refs #6130 pnpm-lock.yml by:pablone
|
||||
- fix: refs #6900 improve loading by:jorgep
|
||||
- fix: refs #6900 improve logic (origin/6900-addSerial) by:jorgep
|
||||
- fix: refs #6900 improve logic by:jorgep
|
||||
- fix: refs #6900 rectificative btn reactivity by:jorgep
|
||||
- fix: refs #6900 use type number by:jorgep
|
||||
- fix: refs #6900 vat & dueday by:jorgep
|
||||
- fix: refs #6900 vat, dueday & intrastat by:jorgep
|
||||
- fix: refs #6989 show entity name & default time from config table by:jorgep
|
||||
- fix: refs #7283 basicData locale by:jorgep
|
||||
- fix: refs #7283 itemLastEntries filter by:jorgep
|
||||
- fix: refs #7283 itemTags & VnImg by:jorgep
|
||||
- fix: refs #7283 locale by:jorgep
|
||||
- fix: refs #7283 min-width vnImg by:jorgep
|
||||
- fix: refs #7283 use vnAvatar & add optional zoom by:jorgep
|
||||
- fix: refs #7283 userPanel pic by:jorgep
|
||||
- fix: refs #7323 add department popup by:jorgep
|
||||
- fix: refs #7323 add locale by:jorgep
|
||||
- fix: refs #7323 css righ menu by:jorgep
|
||||
- fix: refs #7323 data-key & add select by:jorgep
|
||||
- fix: refs #7323 load all opts by:jorgep
|
||||
- fix: refs #7323 righ menu bug by:jorgep
|
||||
- fix: refs #7323 use global locale by:jorgep
|
||||
- fix: refs #7323 use workerFilter (origin/7323-warmfix-fixErrors) by:jorgep
|
||||
- fix: refs #7323 vnsubtoolbar css by:jorgep
|
||||
- fix: refs #7323 wrong css by:jorgep
|
||||
- refs #7355 fix Rol, alias by:carlossa
|
||||
- refs #7355 fix accountAlias by:carlossa
|
||||
- refs #7355 fix alias summary by:carlossa
|
||||
- refs #7355 fix conflicts by:carlossa
|
||||
- refs #7355 fix create Rol by:carlossa
|
||||
- refs #7355 fix list by:carlossa
|
||||
- refs #7355 fix lists redirects summary by:carlossa
|
||||
- refs #7355 fix roles by:carlossa
|
||||
- refs #7355 fix search exprBuilder by:carlossa
|
||||
- refs #7355 fix vnTable by:carlossa
|
||||
|
||||
# Version 24.32 - 2024-08-06
|
||||
|
||||
### Added 🆕
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-front",
|
||||
"version": "24.34.0",
|
||||
"version": "24.40.0",
|
||||
"description": "Salix frontend",
|
||||
"productName": "Salix",
|
||||
"author": "Verdnatura",
|
||||
|
|
|
@ -5,8 +5,10 @@ import useNotify from 'src/composables/useNotify.js';
|
|||
|
||||
const session = useSession();
|
||||
const { notify } = useNotify();
|
||||
const baseUrl = '/api/';
|
||||
|
||||
axios.defaults.baseURL = '/api/';
|
||||
axios.defaults.baseURL = baseUrl;
|
||||
const axiosNoError = axios.create({ baseURL: baseUrl });
|
||||
|
||||
const onRequest = (config) => {
|
||||
const token = session.getToken();
|
||||
|
@ -79,5 +81,7 @@ const onResponseError = (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 };
|
||||
export { onRequest, onResponseError, axiosNoError };
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
export default {
|
||||
mounted: function (el, binding) {
|
||||
const shortcut = binding.value ?? '+';
|
||||
|
||||
const { key, ctrl, alt, callback } =
|
||||
typeof shortcut === 'string'
|
||||
? {
|
||||
key: shortcut,
|
||||
ctrl: true,
|
||||
alt: true,
|
||||
callback: () =>
|
||||
document
|
||||
.querySelector(`button[shortcut="${shortcut}"]`)
|
||||
?.click(),
|
||||
}
|
||||
: binding.value;
|
||||
|
||||
const handleKeydown = (event) => {
|
||||
if (event.key === key && (!ctrl || event.ctrlKey) && (!alt || event.altKey)) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
// Attach the event listener to the window
|
||||
window.addEventListener('keydown', handleKeydown);
|
||||
|
||||
el._handleKeydown = handleKeydown;
|
||||
},
|
||||
unmounted: function (el) {
|
||||
if (el._handleKeydown) {
|
||||
window.removeEventListener('keydown', el._handleKeydown);
|
||||
}
|
||||
},
|
||||
};
|
|
@ -0,0 +1,38 @@
|
|||
import routes from 'src/router/modules';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
let isNotified = false;
|
||||
|
||||
export default {
|
||||
created: function () {
|
||||
const router = useRouter();
|
||||
const keyBindingMap = routes
|
||||
.filter((route) => route.meta.keyBinding)
|
||||
.reduce((map, route) => {
|
||||
map['Key' + route.meta.keyBinding.toUpperCase()] = route.path;
|
||||
return map;
|
||||
}, {});
|
||||
|
||||
const handleKeyDown = (event) => {
|
||||
const { ctrlKey, altKey, code } = event;
|
||||
|
||||
if (ctrlKey && altKey && keyBindingMap[code] && !isNotified) {
|
||||
event.preventDefault();
|
||||
router.push(keyBindingMap[code]);
|
||||
isNotified = true;
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyUp = (event) => {
|
||||
const { ctrlKey, altKey } = event;
|
||||
|
||||
// Resetea la bandera cuando se sueltan las teclas ctrl o alt
|
||||
if (!ctrlKey || !altKey) {
|
||||
isNotified = false;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
window.addEventListener('keyup', handleKeyUp);
|
||||
},
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
export default {
|
||||
mounted() {
|
||||
const observer = new MutationObserver((mutations, observerInstance) => {
|
||||
const firstInput = this?.$el?.querySelector(
|
||||
'input:not([disabled]):not([type="checkbox"]), textarea:not([disabled]), [contenteditable]:not([disabled])'
|
||||
);
|
||||
if (firstInput?.form) {
|
||||
firstInput.focus();
|
||||
observerInstance.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(this.$el, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
},
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
import { getCurrentInstance } from 'vue';
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
const vm = getCurrentInstance();
|
||||
if (vm.type.name === 'QForm') {
|
||||
if (!['searchbarForm', 'filterPanelForm'].includes(this.$el?.id))
|
||||
this.observeForInputs();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
observeForInputs() {
|
||||
const observer = new MutationObserver((mutations, observerInstance) => {
|
||||
const firstInput = this.$el.querySelector(
|
||||
'input:not([disabled]):not([type="checkbox"], textarea:not([disabled]), [contenteditable]:not([disabled])'
|
||||
);
|
||||
if (firstInput) {
|
||||
firstInput.focus();
|
||||
observerInstance.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(this.$el, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
|
@ -1,8 +1,18 @@
|
|||
import { boot } from 'quasar/wrappers';
|
||||
import qformEnterEvent from './qformEnterEvent';
|
||||
import qformFocus from './qformFocus';
|
||||
import qFormEnterEvent from './qFormEnterEvent';
|
||||
import qFormFocus from './qFormFocus';
|
||||
import mainShortcutMixin from './mainShortcutMixin';
|
||||
import keyShortcut from './keyShortcut';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
const { notify } = useNotify();
|
||||
|
||||
export default boot(({ app }) => {
|
||||
app.mixin(qformEnterEvent);
|
||||
app.mixin(qformFocus);
|
||||
app.mixin(qFormEnterEvent);
|
||||
app.mixin(qFormFocus);
|
||||
app.mixin(mainShortcutMixin);
|
||||
app.directive('shortcut', keyShortcut);
|
||||
app.config.errorHandler = function (err) {
|
||||
console.error(err);
|
||||
notify('globals.error', 'negative', 'error');
|
||||
};
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||
import { reactive, ref, onMounted, nextTick, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
|
@ -7,16 +7,21 @@ 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: null,
|
||||
countryFk: customer.value.countryFk,
|
||||
id: null,
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import FormModelPopup from './FormModelPopup.vue';
|
||||
|
||||
const emit = defineEmits(['onDataSaved']);
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
<template>
|
||||
<FormModelPopup
|
||||
url-create="Expenses"
|
||||
model="Expense"
|
||||
:title="t('New expense')"
|
||||
:form-initial-data="{ id: null, isWithheld: false, name: null }"
|
||||
@on-data-saved="emit('onDataSaved', $event)"
|
||||
>
|
||||
<template #form-inputs="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="`${t('globals.code')}`"
|
||||
v-model="data.id"
|
||||
:required="true"
|
||||
:rules="validate('expense.code')"
|
||||
/>
|
||||
<QCheckbox
|
||||
dense
|
||||
size="sm"
|
||||
:label="`${t('It\'s a withholding')}`"
|
||||
v-model="data.isWithheld"
|
||||
:rules="validate('expense.isWithheld')"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="`${t('globals.description')}`"
|
||||
v-model="data.name"
|
||||
:required="true"
|
||||
:rules="validate('expense.description')"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModelPopup>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
New expense: Nuevo gasto
|
||||
It's a withholding: Es una retención
|
||||
</i18n>
|
|
@ -105,7 +105,7 @@ async function setProvince(id, data) {
|
|||
option-label="name"
|
||||
option-value="id"
|
||||
:rules="validate('postcode.city')"
|
||||
:roles-allowed-to-create="['deliveryAssistant']"
|
||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||
:emit-value="false"
|
||||
clearable
|
||||
>
|
||||
|
|
|
@ -189,11 +189,11 @@ async function saveChanges(data) {
|
|||
});
|
||||
}
|
||||
|
||||
async function insert() {
|
||||
async function insert(pushData = $props.dataRequired) {
|
||||
const $index = formData.value.length
|
||||
? formData.value[formData.value.length - 1].$index + 1
|
||||
: 0;
|
||||
formData.value.push(Object.assign({ $index }, $props.dataRequired));
|
||||
formData.value.push(Object.assign({ $index }, pushData));
|
||||
hasChanges.value = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ onMounted(async () => {
|
|||
|
||||
async function fetch(fetchFilter = {}) {
|
||||
try {
|
||||
const filter = Object.assign(fetchFilter, $props.filter); // eslint-disable-line vue/no-dupe-keys
|
||||
const filter = { ...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;
|
||||
|
|
|
@ -22,7 +22,7 @@ const { t } = useI18n();
|
|||
const { validate } = useValidator();
|
||||
const { notify } = useNotify();
|
||||
const route = useRoute();
|
||||
|
||||
const myForm = ref(null);
|
||||
const $props = defineProps({
|
||||
url: {
|
||||
type: String,
|
||||
|
@ -87,6 +87,10 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
defaultTrim: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||
const modelValue = computed(
|
||||
|
@ -105,11 +109,14 @@ const defaultButtons = computed(() => ({
|
|||
color: 'primary',
|
||||
icon: 'save',
|
||||
label: 'globals.save',
|
||||
click: () => myForm.value.submit(),
|
||||
type: 'submit',
|
||||
},
|
||||
reset: {
|
||||
color: 'primary',
|
||||
icon: 'restart_alt',
|
||||
label: 'globals.reset',
|
||||
click: () => reset(),
|
||||
},
|
||||
...$props.defaultButtons,
|
||||
}));
|
||||
|
@ -195,6 +202,7 @@ async function save() {
|
|||
|
||||
isLoading.value = true;
|
||||
try {
|
||||
formData.value = trimData(formData.value);
|
||||
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
|
||||
const method = $props.urlCreate ? 'post' : 'patch';
|
||||
const url =
|
||||
|
@ -253,6 +261,14 @@ function updateAndEmit(evt, val, res) {
|
|||
emit(evt, state.get(modelValue), res);
|
||||
}
|
||||
|
||||
function trimData(data) {
|
||||
if (!$props.defaultTrim) return data;
|
||||
for (const key in data) {
|
||||
if (typeof data[key] == 'string') data[key] = data[key].trim();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
save,
|
||||
isLoading,
|
||||
|
@ -263,7 +279,14 @@ defineExpose({
|
|||
</script>
|
||||
<template>
|
||||
<div class="column items-center full-width">
|
||||
<QForm @submit="save" @reset="reset" class="q-pa-md" id="formModel">
|
||||
<QForm
|
||||
ref="myForm"
|
||||
v-if="formData"
|
||||
@submit="save"
|
||||
@reset="reset"
|
||||
class="q-pa-md"
|
||||
id="formModel"
|
||||
>
|
||||
<QCard>
|
||||
<slot
|
||||
v-if="formData"
|
||||
|
@ -291,7 +314,7 @@ defineExpose({
|
|||
:color="defaultButtons.reset.color"
|
||||
:icon="defaultButtons.reset.icon"
|
||||
flat
|
||||
@click="reset"
|
||||
@click="defaultButtons.reset.click"
|
||||
:disable="!hasChanges"
|
||||
:title="t(defaultButtons.reset.label)"
|
||||
/>
|
||||
|
@ -331,7 +354,7 @@ defineExpose({
|
|||
:label="tMobile('globals.save')"
|
||||
color="primary"
|
||||
icon="save"
|
||||
@click="save"
|
||||
@click="defaultButtons.save.click"
|
||||
:disable="!hasChanges"
|
||||
:title="t(defaultButtons.save.label)"
|
||||
/>
|
||||
|
|
|
@ -159,8 +159,8 @@ const removeTag = (index, params, search) => {
|
|||
/>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:expr-builder="exprBuilder"
|
||||
:custom-tags="customTags"
|
||||
:expr-builder="props.exprBuilder"
|
||||
:custom-tags="props.customTags"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<strong v-if="tag.label === 'categoryFk'">
|
||||
|
@ -297,11 +297,12 @@ const removeTag = (index, params, search) => {
|
|||
/>
|
||||
</QItem>
|
||||
<QItem class="q-mt-lg">
|
||||
<QIcon
|
||||
name="add_circle"
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
flat
|
||||
class="fill-icon-on-hover q-px-xs"
|
||||
color="primary"
|
||||
size="sm"
|
||||
@click="tagValues.push({})"
|
||||
/>
|
||||
</QItem>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { onMounted, ref, reactive } from 'vue';
|
||||
import { onMounted, watch, ref, reactive } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { QSeparator, useQuasar } from 'quasar';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
@ -29,6 +29,15 @@ onMounted(async () => {
|
|||
getRoutes();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.matched,
|
||||
() => {
|
||||
items.value = [];
|
||||
getRoutes();
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
function findMatches(search, item) {
|
||||
const matches = [];
|
||||
function findRoute(search, item) {
|
||||
|
|
|
@ -33,7 +33,12 @@ const itemComputed = computed(() => {
|
|||
<QItemSection avatar v-if="!itemComputed.icon">
|
||||
<QIcon name="disabled_by_default" />
|
||||
</QItemSection>
|
||||
<QItemSection>{{ t(itemComputed.title) }}</QItemSection>
|
||||
<QItemSection>
|
||||
{{ t(itemComputed.title) }}
|
||||
<QTooltip v-if="item.keyBinding">
|
||||
{{ 'Ctrl + Alt + ' + item?.keyBinding?.toUpperCase() }}
|
||||
</QTooltip>
|
||||
</QItemSection>
|
||||
<QItemSection side>
|
||||
<slot name="side" :item="itemComputed" />
|
||||
</QItemSection>
|
||||
|
|
|
@ -24,7 +24,13 @@ const pinnedModulesRef = ref();
|
|||
<template>
|
||||
<QHeader color="white" elevated>
|
||||
<QToolbar class="q-py-sm q-px-md">
|
||||
<QBtn @click="stateStore.toggleLeftDrawer()" icon="menu" round dense flat>
|
||||
<QBtn
|
||||
@click="stateStore.toggleLeftDrawer()"
|
||||
icon="dock_to_right"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<QTooltip bottom anchor="bottom right">
|
||||
{{ t('globals.collapseMenu') }}
|
||||
</QTooltip>
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import FormPopup from './FormPopup.vue';
|
||||
import axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
|
||||
const $props = defineProps({
|
||||
invoiceOutData: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
const { dialogRef } = useDialogPluginComponent();
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const { notify } = useNotify();
|
||||
|
||||
const rectificativeTypeOptions = ref([]);
|
||||
const siiTypeInvoiceOutsOptions = ref([]);
|
||||
const inheritWarehouse = ref(true);
|
||||
const invoiceParams = reactive({
|
||||
id: $props.invoiceOutData?.id,
|
||||
});
|
||||
const invoiceCorrectionTypesOptions = ref([]);
|
||||
|
||||
const refund = async () => {
|
||||
const params = {
|
||||
id: invoiceParams.id,
|
||||
withWarehouse: invoiceParams.inheritWarehouse,
|
||||
cplusRectificationTypeFk: invoiceParams.cplusRectificationTypeFk,
|
||||
siiTypeInvoiceOutFk: invoiceParams.siiTypeInvoiceOutFk,
|
||||
invoiceCorrectionTypeFk: invoiceParams.invoiceCorrectionTypeFk,
|
||||
};
|
||||
|
||||
try {
|
||||
const { data } = await axios.post('InvoiceOuts/refundAndInvoice', params);
|
||||
notify(t('Refunded invoice'), 'positive');
|
||||
const [id] = data?.refundId || [];
|
||||
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
||||
} catch (err) {
|
||||
console.error('Error refunding invoice', err);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="CplusRectificationTypes"
|
||||
:filter="{ order: 'description' }"
|
||||
@on-fetch="
|
||||
(data) => (
|
||||
(rectificativeTypeOptions = data),
|
||||
(invoiceParams.cplusRectificationTypeFk = data.filter(
|
||||
(type) => type.description == 'I – Por diferencias'
|
||||
)[0].id)
|
||||
)
|
||||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceOuts"
|
||||
:filter="{ where: { code: { like: 'R%' } } }"
|
||||
@on-fetch="
|
||||
(data) => (
|
||||
(siiTypeInvoiceOutsOptions = data),
|
||||
(invoiceParams.siiTypeInvoiceOutFk = data.filter(
|
||||
(type) => type.code == 'R4'
|
||||
)[0].id)
|
||||
)
|
||||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="InvoiceCorrectionTypes"
|
||||
@on-fetch="(data) => (invoiceCorrectionTypesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
||||
<QDialog ref="dialogRef">
|
||||
<FormPopup
|
||||
@on-submit="refund()"
|
||||
:custom-submit-button-label="t('Accept')"
|
||||
:default-cancel-button="false"
|
||||
>
|
||||
<template #form-inputs>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Rectificative type')"
|
||||
:options="rectificativeTypeOptions"
|
||||
hide-selected
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="invoiceParams.cplusRectificationTypeFk"
|
||||
:required="true"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Class')"
|
||||
:options="siiTypeInvoiceOutsOptions"
|
||||
hide-selected
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="invoiceParams.siiTypeInvoiceOutFk"
|
||||
:required="true"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt?.code }} -
|
||||
{{ scope.opt?.description }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</VnRow>
|
||||
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Type')"
|
||||
:options="invoiceCorrectionTypesOptions"
|
||||
hide-selected
|
||||
option-label="description"
|
||||
option-value="id"
|
||||
v-model="invoiceParams.invoiceCorrectionTypeFk"
|
||||
:required="true"
|
||||
/> </VnRow
|
||||
><VnRow>
|
||||
<div>
|
||||
<QCheckbox
|
||||
:label="t('Inherit warehouse')"
|
||||
v-model="inheritWarehouse"
|
||||
/>
|
||||
<QIcon name="info" class="cursor-info q-ml-sm" size="sm">
|
||||
<QTooltip>{{ t('Inherit warehouse tooltip') }}</QTooltip>
|
||||
</QIcon>
|
||||
</div>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormPopup>
|
||||
</QDialog>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
Refund invoice: Refund invoice
|
||||
Rectificative type: Rectificative type
|
||||
Class: Class
|
||||
Type: Type
|
||||
Refunded invoice: Refunded invoice
|
||||
Inherit warehouse: Inherit the warehouse
|
||||
Inherit warehouse tooltip: Select this option to inherit the warehouse when refunding the invoice
|
||||
Accept: Accept
|
||||
Error refunding invoice: Error refunding invoice
|
||||
es:
|
||||
Refund invoice: Abonar factura
|
||||
Rectificative type: Tipo rectificativa
|
||||
Class: Clase
|
||||
Type: Tipo
|
||||
Refunded invoice: Factura abonada
|
||||
Inherit warehouse: Heredar el almacén
|
||||
Inherit warehouse tooltip: Seleccione esta opción para heredar el almacén al abonar la factura.
|
||||
Accept: Aceptar
|
||||
Error refunding invoice: Error abonando factura
|
||||
</i18n>
|
|
@ -2,13 +2,12 @@
|
|||
import { ref, reactive } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useQuasar, useDialogPluginComponent } from 'quasar';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import FormPopup from './FormPopup.vue';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
import axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
|
||||
|
@ -18,19 +17,19 @@ const $props = defineProps({
|
|||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
const { dialogRef } = useDialogPluginComponent();
|
||||
const quasar = useQuasar();
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const { notify } = useNotify();
|
||||
const checked = ref(true);
|
||||
const transferInvoiceParams = reactive({
|
||||
id: $props.invoiceOutData?.id,
|
||||
refFk: $props.invoiceOutData?.ref,
|
||||
});
|
||||
|
||||
const rectificativeTypeOptions = ref([]);
|
||||
const siiTypeInvoiceOutsOptions = ref([]);
|
||||
const checked = ref(true);
|
||||
const transferInvoiceParams = reactive({
|
||||
id: $props.invoiceOutData?.id,
|
||||
});
|
||||
const invoiceCorrectionTypesOptions = ref([]);
|
||||
|
||||
const selectedClient = (client) => {
|
||||
|
@ -44,10 +43,9 @@ const makeInvoice = async () => {
|
|||
const params = {
|
||||
id: transferInvoiceParams.id,
|
||||
cplusRectificationTypeFk: transferInvoiceParams.cplusRectificationTypeFk,
|
||||
siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk,
|
||||
invoiceCorrectionTypeFk: transferInvoiceParams.invoiceCorrectionTypeFk,
|
||||
newClientFk: transferInvoiceParams.newClientFk,
|
||||
refFk: transferInvoiceParams.refFk,
|
||||
siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk,
|
||||
makeInvoice: checked.value,
|
||||
};
|
||||
|
||||
|
@ -74,7 +72,7 @@ const makeInvoice = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const { data } = await axios.post('InvoiceOuts/transferInvoice', params);
|
||||
const { data } = await axios.post('InvoiceOuts/transfer', params);
|
||||
notify(t('Transferred invoice'), 'positive');
|
||||
const id = data?.[0];
|
||||
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });
|
||||
|
|
|
@ -164,7 +164,7 @@ const isEmployee = computed(() => useRole().isEmployee());
|
|||
class="q-mt-sm q-px-md"
|
||||
:to="`/worker/${user.id}`"
|
||||
color="primary"
|
||||
:label="t('My account')"
|
||||
:label="t('globals.myAccount')"
|
||||
dense
|
||||
/>
|
||||
<div class="text-subtitle1 q-mt-md">
|
||||
|
@ -270,7 +270,3 @@ const isEmployee = computed(() => useRole().isEmployee());
|
|||
}
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
es:
|
||||
My account: Mi cuenta
|
||||
</i18n>
|
||||
|
|
|
@ -38,7 +38,7 @@ async function onProvinceCreated(_, data) {
|
|||
hide-selected
|
||||
v-model="provinceFk"
|
||||
:rules="validate && validate('postcode.provinceFk')"
|
||||
:roles-allowed-to-create="['deliveryAssistant']"
|
||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
|
|
@ -34,7 +34,7 @@ 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, remove: () => addFilter(null) };
|
||||
const updateEvent = { 'update:modelValue': addFilter };
|
||||
const enterEvent = {
|
||||
'keyup.enter': () => addFilter(model.value),
|
||||
remove: () => addFilter(null),
|
||||
|
|
|
@ -4,7 +4,7 @@ import { useArrayData } from 'composables/useArrayData';
|
|||
const model = defineModel({ type: Object });
|
||||
const $props = defineProps({
|
||||
name: {
|
||||
type: String,
|
||||
type: [String, Boolean],
|
||||
default: '',
|
||||
},
|
||||
label: {
|
||||
|
|
|
@ -49,6 +49,10 @@ const $props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
createAsDialog: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
cardClass: {
|
||||
type: String,
|
||||
default: 'flex-one',
|
||||
|
@ -65,9 +69,10 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
hasSubToolbar: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
default: null,
|
||||
},
|
||||
disableOption: {
|
||||
type: Object,
|
||||
|
@ -85,10 +90,18 @@ const $props = defineProps({
|
|||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
crudModel: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
tableHeight: {
|
||||
type: String,
|
||||
default: '90vh',
|
||||
},
|
||||
footer: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const { t } = useI18n();
|
||||
const stateStore = useStateStore();
|
||||
|
@ -107,7 +120,7 @@ const orders = ref(parseOrder(routeQuery.filter?.order));
|
|||
const CrudModelRef = ref({});
|
||||
const showForm = ref(false);
|
||||
const splittedColumns = ref({ columns: [] });
|
||||
const columnsVisibilitySkiped = ref();
|
||||
const columnsVisibilitySkipped = ref();
|
||||
const createForm = ref();
|
||||
|
||||
const tableModes = [
|
||||
|
@ -134,8 +147,8 @@ onMounted(() => {
|
|||
quasar.platform.is.mobile && !$props.disableOption?.card
|
||||
? CARD_MODE
|
||||
: $props.defaultMode;
|
||||
stateStore.rightDrawer = true;
|
||||
columnsVisibilitySkiped.value = [
|
||||
stateStore.rightDrawer = quasar.screen.gt.xs;
|
||||
columnsVisibilitySkipped.value = [
|
||||
...splittedColumns.value.columns
|
||||
.filter((c) => c.visible == false)
|
||||
.map((c) => c.name),
|
||||
|
@ -178,10 +191,20 @@ function setUserParams(watchedParams, watchedOrder) {
|
|||
watchedParams = { ...watchedParams, ...where };
|
||||
delete watchedParams.filter;
|
||||
delete params.value?.filter;
|
||||
params.value = { ...params.value, ...watchedParams };
|
||||
params.value = { ...params.value, ...sanitizer(watchedParams) };
|
||||
orders.value = parseOrder(order);
|
||||
}
|
||||
|
||||
function sanitizer(params) {
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
if (value && typeof value == 'object') {
|
||||
const param = Object.values(value)[0];
|
||||
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
function splitColumns(columns) {
|
||||
splittedColumns.value = {
|
||||
columns: [],
|
||||
|
@ -274,10 +297,18 @@ function parseOrder(urlOrders) {
|
|||
|
||||
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
|
||||
defineExpose({
|
||||
create: createForm,
|
||||
reload,
|
||||
redirect: redirectFn,
|
||||
selected,
|
||||
CrudModelRef,
|
||||
params,
|
||||
});
|
||||
|
||||
function handleOnDataSaved(_) {
|
||||
if (_.onDataSaved) _.onDataSaved(this);
|
||||
else $props.create.onDataSaved(_);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QDrawer
|
||||
|
@ -315,7 +346,7 @@ defineExpose({
|
|||
col?.columnFilter !== false &&
|
||||
col?.name !== 'tableActions'
|
||||
"
|
||||
v-model="orders[col.name]"
|
||||
v-model="orders[col.orderBy ?? col.name]"
|
||||
:name="col.orderBy ?? col.name"
|
||||
:data-key="$attrs['data-key']"
|
||||
:search-url="searchUrl"
|
||||
|
@ -332,300 +363,313 @@ defineExpose({
|
|||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<!-- class in div to fix warn-->
|
||||
<div class="q-px-md">
|
||||
<CrudModel
|
||||
v-bind="$attrs"
|
||||
:limit="20"
|
||||
ref="CrudModelRef"
|
||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||
:search-url="searchUrl"
|
||||
:disable-infinite-scroll="isTableMode"
|
||||
@save-changes="reload"
|
||||
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
|
||||
:auto-load="hasParams || $attrs['auto-load']"
|
||||
>
|
||||
<template
|
||||
v-for="(_, slotName) in $slots"
|
||||
#[slotName]="slotData"
|
||||
:key="slotName"
|
||||
<CrudModel
|
||||
v-bind="$attrs"
|
||||
:class="$attrs['class'] ?? 'q-px-md'"
|
||||
:limit="$attrs['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"
|
||||
:auto-load="hasParams || $attrs['auto-load']"
|
||||
>
|
||||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
<template #body="{ rows }">
|
||||
<QTable
|
||||
v-bind="table"
|
||||
class="vnTable"
|
||||
:columns="splittedColumns.columns"
|
||||
:rows="rows"
|
||||
v-model:selected="selected"
|
||||
:grid="!isTableMode"
|
||||
table-header-class="bg-header"
|
||||
card-container-class="grid-three"
|
||||
flat
|
||||
:style="isTableMode && `max-height: ${tableHeight}`"
|
||||
:virtual-scroll="isTableMode"
|
||||
@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)"
|
||||
>
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
<template #body="{ rows }">
|
||||
<QTable
|
||||
v-bind="table"
|
||||
class="vnTable"
|
||||
:columns="splittedColumns.columns"
|
||||
:rows="rows"
|
||||
v-model:selected="selected"
|
||||
:grid="!isTableMode"
|
||||
table-header-class="bg-header"
|
||||
card-container-class="grid-three"
|
||||
flat
|
||||
:style="isTableMode && `max-height: ${tableHeight}`"
|
||||
virtual-scroll
|
||||
@virtual-scroll="
|
||||
(event) =>
|
||||
event.index > rows.length - 2 &&
|
||||
CrudModelRef.vnPaginateRef.paginate()
|
||||
"
|
||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||
@update:selected="emit('update:selected', $event)"
|
||||
>
|
||||
<template #top-left v-if="!$props.withoutHeader">
|
||||
<slot name="top-left"></slot>
|
||||
</template>
|
||||
<template #top-right v-if="!$props.withoutHeader">
|
||||
<VnVisibleColumn
|
||||
v-if="isTableMode"
|
||||
v-model="splittedColumns.columns"
|
||||
:table-code="tableCode ?? route.name"
|
||||
:skip="columnsVisibilitySkiped"
|
||||
/>
|
||||
<QBtnToggle
|
||||
v-model="mode"
|
||||
toggle-color="primary"
|
||||
class="bg-vn-section-color"
|
||||
dense
|
||||
:options="tableModes"
|
||||
/>
|
||||
<QBtn
|
||||
v-if="$props.rightSearch"
|
||||
icon="filter_alt"
|
||||
class="bg-vn-section-color q-ml-md"
|
||||
dense
|
||||
@click="stateStore.toggleRightDrawer()"
|
||||
/>
|
||||
</template>
|
||||
<template #header-cell="{ col }">
|
||||
<QTh v-if="col.visible ?? true">
|
||||
<div
|
||||
class="column self-start q-ml-xs ellipsis"
|
||||
:class="`text-${col?.align ?? 'left'}`"
|
||||
:style="$props.columnSearch ? 'height: 75px' : ''"
|
||||
>
|
||||
<div
|
||||
class="row items-center no-wrap"
|
||||
style="height: 30px"
|
||||
>
|
||||
<VnTableOrder
|
||||
v-model="orders[col.name]"
|
||||
:name="col.orderBy ?? col.name"
|
||||
:label="col?.label"
|
||||
:data-key="$attrs['data-key']"
|
||||
:search-url="searchUrl"
|
||||
/>
|
||||
</div>
|
||||
<VnTableFilter
|
||||
v-if="$props.columnSearch"
|
||||
:column="col"
|
||||
:show-title="true"
|
||||
<template #top-left v-if="!$props.withoutHeader">
|
||||
<slot name="top-left"></slot>
|
||||
</template>
|
||||
<template #top-right v-if="!$props.withoutHeader">
|
||||
<VnVisibleColumn
|
||||
v-if="isTableMode"
|
||||
v-model="splittedColumns.columns"
|
||||
:table-code="tableCode ?? route.name"
|
||||
:skip="columnsVisibilitySkipped"
|
||||
/>
|
||||
<QBtnToggle
|
||||
v-model="mode"
|
||||
toggle-color="primary"
|
||||
class="bg-vn-section-color"
|
||||
dense
|
||||
:options="tableModes.filter((mode) => !mode.disable)"
|
||||
/>
|
||||
<QBtn
|
||||
v-if="$props.rightSearch"
|
||||
icon="filter_alt"
|
||||
class="bg-vn-section-color q-ml-md"
|
||||
dense
|
||||
@click="stateStore.toggleRightDrawer()"
|
||||
/>
|
||||
</template>
|
||||
<template #header-cell="{ col }">
|
||||
<QTh v-if="col.visible ?? true">
|
||||
<div
|
||||
class="column self-start q-ml-xs ellipsis"
|
||||
:class="`text-${col?.align ?? 'left'}`"
|
||||
:style="$props.columnSearch ? 'height: 75px' : ''"
|
||||
>
|
||||
<div class="row items-center no-wrap" style="height: 30px">
|
||||
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip>
|
||||
<VnTableOrder
|
||||
v-model="orders[col.orderBy ?? col.name]"
|
||||
:name="col.orderBy ?? col.name"
|
||||
:label="col?.label"
|
||||
:data-key="$attrs['data-key']"
|
||||
v-model="params[columnName(col)]"
|
||||
:search-url="searchUrl"
|
||||
class="full-width"
|
||||
/>
|
||||
</div>
|
||||
</QTh>
|
||||
</template>
|
||||
<template #header-cell-tableActions>
|
||||
<QTh auto-width class="sticky" />
|
||||
</template>
|
||||
<template #body-cell-tableStatus="{ col, row }">
|
||||
<QTd auto-width :class="getColAlign(col)">
|
||||
<VnTableChip
|
||||
:columns="splittedColumns.columnChips"
|
||||
<VnTableFilter
|
||||
v-if="$props.columnSearch"
|
||||
:column="col"
|
||||
:show-title="true"
|
||||
:data-key="$attrs['data-key']"
|
||||
v-model="params[columnName(col)]"
|
||||
:search-url="searchUrl"
|
||||
class="full-width"
|
||||
/>
|
||||
</div>
|
||||
</QTh>
|
||||
</template>
|
||||
<template #header-cell-tableActions>
|
||||
<QTh auto-width class="sticky" />
|
||||
</template>
|
||||
<template #body-cell-tableStatus="{ col, row }">
|
||||
<QTd auto-width :class="getColAlign(col)">
|
||||
<VnTableChip :columns="splittedColumns.columnChips" :row="row">
|
||||
<template #afterChip>
|
||||
<slot name="afterChip" :row="row"></slot>
|
||||
</template>
|
||||
</VnTableChip>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell="{ col, row, rowIndex }">
|
||||
<!-- Columns -->
|
||||
<QTd
|
||||
auto-width
|
||||
class="no-margin q-px-xs"
|
||||
:class="[getColAlign(col), col.columnClass]"
|
||||
v-if="col.visible ?? true"
|
||||
@click.ctrl="
|
||||
($event) =>
|
||||
rowCtrlClickFunction && rowCtrlClickFunction($event, row)
|
||||
"
|
||||
>
|
||||
<slot
|
||||
:name="`column-${col.name}`"
|
||||
:col="col"
|
||||
:row="row"
|
||||
:row-index="rowIndex"
|
||||
>
|
||||
<VnTableColumn
|
||||
:column="col"
|
||||
:row="row"
|
||||
>
|
||||
<template #afterChip>
|
||||
<slot name="afterChip" :row="row"></slot>
|
||||
</template>
|
||||
</VnTableChip>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell="{ col, row, rowIndex }">
|
||||
<!-- Columns -->
|
||||
<QTd
|
||||
auto-width
|
||||
class="no-margin q-px-xs"
|
||||
:class="[getColAlign(col), col.columnClass]"
|
||||
v-if="col.visible ?? true"
|
||||
@click.ctrl="
|
||||
($event) =>
|
||||
rowCtrlClickFunction &&
|
||||
rowCtrlClickFunction($event, row)
|
||||
:is-editable="col.isEditable ?? isEditable"
|
||||
v-model="row[col.name]"
|
||||
component-prop="columnField"
|
||||
/>
|
||||
</slot>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-tableActions="{ col, row }">
|
||||
<QTd
|
||||
auto-width
|
||||
:class="getColAlign(col)"
|
||||
class="sticky no-padding"
|
||||
@click="stopEventPropagation($event)"
|
||||
>
|
||||
<QBtn
|
||||
v-for="(btn, index) of col.actions"
|
||||
v-show="btn.show ? btn.show(row) : true"
|
||||
:key="index"
|
||||
:title="btn.title"
|
||||
:icon="btn.icon"
|
||||
class="q-px-sm text-primary-light"
|
||||
flat
|
||||
:style="`visibility: ${
|
||||
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
||||
}`"
|
||||
@click="btn.action(row)"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #item="{ row, colsMap }">
|
||||
<component
|
||||
:is="$props.redirect ? 'router-link' : 'span'"
|
||||
:to="`/${$props.redirect}/` + row.id"
|
||||
>
|
||||
<QCard
|
||||
bordered
|
||||
flat
|
||||
class="row no-wrap justify-between cursor-pointer"
|
||||
@click="
|
||||
(_, row) => {
|
||||
$props.rowClick && $props.rowClick(row);
|
||||
}
|
||||
"
|
||||
>
|
||||
<slot
|
||||
:name="`column-${col.name}`"
|
||||
:col="col"
|
||||
:row="row"
|
||||
:row-index="rowIndex"
|
||||
>
|
||||
<VnTableColumn
|
||||
:column="col"
|
||||
:row="row"
|
||||
:is-editable="col.isEditable ?? isEditable"
|
||||
v-model="row[col.name]"
|
||||
component-prop="columnField"
|
||||
/>
|
||||
</slot>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-tableActions="{ col, row }">
|
||||
<QTd
|
||||
auto-width
|
||||
:class="getColAlign(col)"
|
||||
class="sticky no-padding"
|
||||
@click="stopEventPropagation($event)"
|
||||
>
|
||||
<QBtn
|
||||
v-for="(btn, index) of col.actions"
|
||||
:key="index"
|
||||
:title="btn.title"
|
||||
:icon="btn.icon"
|
||||
class="q-px-sm"
|
||||
flat
|
||||
:class="
|
||||
btn.isPrimary
|
||||
? 'text-primary-light'
|
||||
: 'color-vn-text '
|
||||
"
|
||||
:style="`visibility: ${
|
||||
(btn.show && btn.show(row)) ?? true
|
||||
? 'visible'
|
||||
: 'hidden'
|
||||
}`"
|
||||
@click="btn.action(row)"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #item="{ row, colsMap }">
|
||||
<component
|
||||
:is="$props.redirect ? 'router-link' : 'span'"
|
||||
:to="`/${$props.redirect}/` + row.id"
|
||||
>
|
||||
<QCard
|
||||
bordered
|
||||
flat
|
||||
class="row no-wrap justify-between cursor-pointer"
|
||||
@click="
|
||||
(_, row) => {
|
||||
$props.rowClick && $props.rowClick(row);
|
||||
}
|
||||
"
|
||||
<QCardSection
|
||||
vertical
|
||||
class="no-margin no-padding"
|
||||
:class="colsMap.tableActions ? 'w-80' : 'fit'"
|
||||
>
|
||||
<!-- Chips -->
|
||||
<QCardSection
|
||||
vertical
|
||||
class="no-margin no-padding"
|
||||
:class="colsMap.tableActions ? 'w-80' : 'fit'"
|
||||
v-if="splittedColumns.chips.length"
|
||||
class="no-margin q-px-xs q-py-none"
|
||||
>
|
||||
<!-- Chips -->
|
||||
<QCardSection
|
||||
v-if="splittedColumns.chips.length"
|
||||
class="no-margin q-px-xs q-py-none"
|
||||
<VnTableChip
|
||||
:columns="splittedColumns.chips"
|
||||
:row="row"
|
||||
>
|
||||
<VnTableChip
|
||||
:columns="splittedColumns.chips"
|
||||
:row="row"
|
||||
>
|
||||
<template #afterChip>
|
||||
<slot name="afterChip" :row="row"></slot>
|
||||
</template>
|
||||
</VnTableChip>
|
||||
</QCardSection>
|
||||
<!-- Title -->
|
||||
<QCardSection
|
||||
v-if="splittedColumns.title"
|
||||
class="q-pl-sm q-py-none text-primary-light text-bold text-h6 cardEllipsis"
|
||||
<template #afterChip>
|
||||
<slot name="afterChip" :row="row"></slot>
|
||||
</template>
|
||||
</VnTableChip>
|
||||
</QCardSection>
|
||||
<!-- Title -->
|
||||
<QCardSection
|
||||
v-if="splittedColumns.title"
|
||||
class="q-pl-sm q-py-none text-primary-light text-bold text-h6 cardEllipsis"
|
||||
>
|
||||
<span
|
||||
:title="row[splittedColumns.title.name]"
|
||||
@click="stopEventPropagation($event)"
|
||||
class="cursor-text"
|
||||
>
|
||||
<span
|
||||
:title="row[splittedColumns.title.name]"
|
||||
@click="stopEventPropagation($event)"
|
||||
class="cursor-text"
|
||||
>
|
||||
{{ row[splittedColumns.title.name] }}
|
||||
</span>
|
||||
</QCardSection>
|
||||
<!-- Fields -->
|
||||
<QCardSection
|
||||
class="q-pl-sm q-pr-lg q-py-xs"
|
||||
:class="$props.cardClass"
|
||||
{{ row[splittedColumns.title.name] }}
|
||||
</span>
|
||||
</QCardSection>
|
||||
<!-- Fields -->
|
||||
<QCardSection
|
||||
class="q-pl-sm q-pr-lg q-py-xs"
|
||||
:class="$props.cardClass"
|
||||
>
|
||||
<div
|
||||
v-for="(
|
||||
col, index
|
||||
) of splittedColumns.cardVisible"
|
||||
:key="col.name"
|
||||
class="fields"
|
||||
>
|
||||
<div
|
||||
v-for="(
|
||||
col, index
|
||||
) of splittedColumns.cardVisible"
|
||||
:key="col.name"
|
||||
class="fields"
|
||||
<VnLv
|
||||
:label="
|
||||
!col.component && col.label
|
||||
? `${col.label}:`
|
||||
: ''
|
||||
"
|
||||
>
|
||||
<VnLv
|
||||
:label="
|
||||
!col.component && col.label
|
||||
? `${col.label}:`
|
||||
: ''
|
||||
"
|
||||
>
|
||||
<template #value>
|
||||
<span
|
||||
@click="
|
||||
stopEventPropagation($event)
|
||||
"
|
||||
<template #value>
|
||||
<span
|
||||
@click="stopEventPropagation($event)"
|
||||
>
|
||||
<slot
|
||||
:name="`column-${col.name}`"
|
||||
:col="col"
|
||||
:row="row"
|
||||
:row-index="index"
|
||||
>
|
||||
<slot
|
||||
:name="`column-${col.name}`"
|
||||
:col="col"
|
||||
<VnTableColumn
|
||||
:column="col"
|
||||
:row="row"
|
||||
:row-index="index"
|
||||
>
|
||||
<VnTableColumn
|
||||
:column="col"
|
||||
:row="row"
|
||||
:is-editable="false"
|
||||
v-model="row[col.name]"
|
||||
component-prop="columnField"
|
||||
:show-label="true"
|
||||
/>
|
||||
</slot>
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
</div>
|
||||
</QCardSection>
|
||||
:is-editable="false"
|
||||
v-model="row[col.name]"
|
||||
component-prop="columnField"
|
||||
:show-label="true"
|
||||
/>
|
||||
</slot>
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
</div>
|
||||
</QCardSection>
|
||||
<!-- Actions -->
|
||||
<QCardSection
|
||||
v-if="colsMap.tableActions"
|
||||
class="column flex-center w-10 no-margin q-pa-xs q-gutter-y-xs"
|
||||
@click="stopEventPropagation($event)"
|
||||
>
|
||||
<QBtn
|
||||
v-for="(btn, index) of splittedColumns.actions
|
||||
.actions"
|
||||
:key="index"
|
||||
:title="btn.title"
|
||||
:icon="btn.icon"
|
||||
class="q-pa-xs"
|
||||
flat
|
||||
:class="
|
||||
btn.isPrimary
|
||||
? 'text-primary-light'
|
||||
: 'color-vn-text '
|
||||
"
|
||||
@click="btn.action(row)"
|
||||
/>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</component>
|
||||
</template>
|
||||
</QTable>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</div>
|
||||
<QPageSticky v-if="create" :offset="[20, 20]" style="z-index: 2">
|
||||
<QBtn @click="showForm = !showForm" color="primary" fab icon="add" />
|
||||
</QCardSection>
|
||||
<!-- Actions -->
|
||||
<QCardSection
|
||||
v-if="colsMap.tableActions"
|
||||
class="column flex-center w-10 no-margin q-pa-xs q-gutter-y-xs"
|
||||
@click="stopEventPropagation($event)"
|
||||
>
|
||||
<QBtn
|
||||
v-for="(btn, index) of splittedColumns.actions
|
||||
.actions"
|
||||
:key="index"
|
||||
:title="btn.title"
|
||||
:icon="btn.icon"
|
||||
class="q-pa-xs"
|
||||
flat
|
||||
:class="
|
||||
btn.isPrimary
|
||||
? 'text-primary-light'
|
||||
: 'color-vn-text '
|
||||
"
|
||||
@click="btn.action(row)"
|
||||
/>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</component>
|
||||
</template>
|
||||
<template #bottom-row="{ cols }" v-if="footer">
|
||||
<QTr v-if="rows.length" class="bg-header" style="height: 30px">
|
||||
<QTh
|
||||
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
||||
:key="col?.id"
|
||||
class="text-center"
|
||||
>
|
||||
<div
|
||||
v-if="col?.summation"
|
||||
:class="`text-${col?.align ?? 'left'}`"
|
||||
class="text-bold q-pa-sm"
|
||||
>
|
||||
{{
|
||||
rows.reduce(
|
||||
(sum, currentRow) => sum + currentRow[col.name],
|
||||
0
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
</QTable>
|
||||
</template>
|
||||
</CrudModel>
|
||||
<QPageSticky v-if="$props.create" :offset="[20, 20]" style="z-index: 2">
|
||||
<QBtn
|
||||
@click="
|
||||
() =>
|
||||
createAsDialog ? (showForm = !showForm) : handleOnDataSaved(create)
|
||||
"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ createForm.title }}
|
||||
{{ createForm?.title }}
|
||||
</QTooltip>
|
||||
</QPageSticky>
|
||||
<QDialog v-model="showForm" transition-show="scale" transition-hide="scale">
|
||||
|
@ -677,7 +721,7 @@ es:
|
|||
}
|
||||
|
||||
.bg-header {
|
||||
background-color: var(--vn-header-color);
|
||||
background-color: var(--vn-accent-color);
|
||||
color: var(--vn-text-color);
|
||||
}
|
||||
|
||||
|
@ -687,9 +731,7 @@ es:
|
|||
|
||||
.q-table--dark .q-table__bottom,
|
||||
.q-table--dark thead,
|
||||
.q-table--dark tr,
|
||||
.q-table--dark th,
|
||||
.q-table--dark td {
|
||||
.q-table--dark tr {
|
||||
border-color: var(--vn-section-color);
|
||||
}
|
||||
|
||||
|
@ -739,6 +781,7 @@ es:
|
|||
}
|
||||
.q-table__top {
|
||||
top: 0;
|
||||
padding: 12px 0;
|
||||
}
|
||||
tbody {
|
||||
.q-checkbox {
|
||||
|
|
|
@ -37,7 +37,7 @@ const stateStore = useStateStore();
|
|||
@click="stateStore.toggleRightDrawer()"
|
||||
round
|
||||
dense
|
||||
icon="menu"
|
||||
icon="dock_to_left"
|
||||
>
|
||||
<QTooltip bottom anchor="bottom right">
|
||||
{{ t('globals.collapseMenu') }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import { onBeforeMount, computed } from 'vue';
|
||||
import { useRoute, onBeforeRouteUpdate } from 'vue-router';
|
||||
import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import useCardSize from 'src/composables/useCardSize';
|
||||
|
@ -8,7 +8,6 @@ import VnSubToolbar from '../ui/VnSubToolbar.vue';
|
|||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import LeftMenu from 'components/LeftMenu.vue';
|
||||
import RightMenu from 'components/common/RightMenu.vue';
|
||||
|
||||
const props = defineProps({
|
||||
dataKey: { type: String, required: true },
|
||||
baseUrl: { type: String, default: undefined },
|
||||
|
@ -18,23 +17,36 @@ const props = defineProps({
|
|||
filterPanel: { type: Object, default: undefined },
|
||||
searchDataKey: { type: String, default: undefined },
|
||||
searchbarProps: { type: Object, default: undefined },
|
||||
redirectOnError: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
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(() => {
|
||||
if (!props.searchDataKey) return route.name;
|
||||
return props.searchDataKey;
|
||||
});
|
||||
const arrayData = useArrayData(props.dataKey, {
|
||||
url: url.value,
|
||||
filter: props.filter,
|
||||
});
|
||||
|
||||
onBeforeMount(async () => {
|
||||
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
|
||||
await arrayData.fetch({ append: false, updateRouter: false });
|
||||
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.*/, '') });
|
||||
}
|
||||
});
|
||||
|
||||
if (props.baseUrl) {
|
||||
|
@ -62,17 +74,16 @@ if (props.baseUrl) {
|
|||
<slot name="searchbar" v-if="props.searchDataKey">
|
||||
<VnSearchbar :data-key="props.searchDataKey" v-bind="props.searchbarProps" />
|
||||
</slot>
|
||||
<slot v-else name="searchbar" />
|
||||
<RightMenu>
|
||||
<template #right-panel v-if="props.filterPanel">
|
||||
<component :is="props.filterPanel" :data-key="props.searchDataKey" />
|
||||
<component :is="props.filterPanel" :data-key="searchRightDataKey" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<QPageContainer>
|
||||
<QPage>
|
||||
<VnSubToolbar />
|
||||
<div :class="[useCardSize(), $attrs.class]">
|
||||
<RouterView />
|
||||
<RouterView :key="route.path" />
|
||||
</div>
|
||||
</QPage>
|
||||
</QPageContainer>
|
||||
|
|
|
@ -17,17 +17,15 @@ 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];
|
||||
mixed = {
|
||||
return {
|
||||
component: customComponent?.component ?? component,
|
||||
attrs: {
|
||||
...toValueAttrs(attrs),
|
||||
|
@ -37,7 +35,6 @@ function mix(toComponent) {
|
|||
},
|
||||
event: { ...customComponent?.event, ...event },
|
||||
};
|
||||
return mixed;
|
||||
}
|
||||
|
||||
function toValueAttrs(attrs) {
|
||||
|
|
|
@ -5,12 +5,14 @@ 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 VnUserLink from '../ui/VnUserLink.vue';
|
||||
import { downloadFile } from 'src/composables/downloadFile';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
|
||||
const route = useRoute();
|
||||
const quasar = useQuasar();
|
||||
|
@ -18,6 +20,7 @@ const { t } = useI18n();
|
|||
const rows = ref();
|
||||
const dmsRef = ref();
|
||||
const formDialog = ref({});
|
||||
const token = useSession().getTokenMultimedia();
|
||||
|
||||
const $props = defineProps({
|
||||
model: {
|
||||
|
@ -89,6 +92,23 @@ 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',
|
||||
|
@ -135,19 +155,13 @@ const columns = computed(() => [
|
|||
field: 'hasFile',
|
||||
label: t('globals.original'),
|
||||
name: 'hasFile',
|
||||
toolTip: t('The documentation is available in paper form'),
|
||||
component: QCheckbox,
|
||||
props: (prop) => ({
|
||||
disable: true,
|
||||
'model-value': Boolean(prop.value),
|
||||
}),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
field: 'file',
|
||||
label: t('globals.file'),
|
||||
name: 'file',
|
||||
component: 'span',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
field: 'worker',
|
||||
|
@ -297,6 +311,14 @@ defineExpose({
|
|||
row-key="clientFk"
|
||||
:grid="$q.screen.lt.sm"
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip
|
||||
>{{ col.label }}
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
<template #body-cell="props">
|
||||
<QTd :props="props">
|
||||
<QTr :props="props">
|
||||
|
@ -378,7 +400,14 @@ defineExpose({
|
|||
/>
|
||||
</QDialog>
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<QBtn fab color="primary" icon="add" @click="showFormDialog()" class="fill-icon">
|
||||
<QBtn
|
||||
fab
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
@click="showFormDialog()"
|
||||
class="fill-icon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Upload file') }}
|
||||
</QTooltip>
|
||||
|
@ -386,10 +415,6 @@ defineExpose({
|
|||
</QPageSticky>
|
||||
</template>
|
||||
<style scoped>
|
||||
.q-gutter-y-ms {
|
||||
display: grid;
|
||||
row-gap: 20px;
|
||||
}
|
||||
.labelColor {
|
||||
color: var(--vn-label-color);
|
||||
}
|
||||
|
@ -397,8 +422,10 @@ defineExpose({
|
|||
<i18n>
|
||||
en:
|
||||
contentTypesInfo: Allowed file types {allowedContentTypes}
|
||||
The documentation is available in paper form: The documentation is available in paper form
|
||||
es:
|
||||
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
|
||||
Generate identifier for original file: Generar identificador para archivo original
|
||||
Upload file: Subir fichero
|
||||
the documentation is available in paper form: Se tiene la documentación en papel
|
||||
</i18n>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:modelValue',
|
||||
|
@ -27,9 +28,11 @@ const $props = defineProps({
|
|||
default: true,
|
||||
},
|
||||
});
|
||||
const { validations } = useValidator();
|
||||
|
||||
const { t } = useI18n();
|
||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
||||
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||
|
||||
const vnInputRef = ref(null);
|
||||
const value = computed({
|
||||
get() {
|
||||
|
@ -57,21 +60,26 @@ const focus = () => {
|
|||
defineExpose({
|
||||
focus,
|
||||
});
|
||||
import { useAttrs } from 'vue';
|
||||
const $attrs = useAttrs();
|
||||
|
||||
const inputRules = [
|
||||
const mixinRules = [
|
||||
requiredFieldRule,
|
||||
...($attrs.rules ?? []),
|
||||
(val) => {
|
||||
const { min } = vnInputRef.value.$attrs;
|
||||
const { min, max } = 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>
|
||||
|
||||
<template>
|
||||
<div
|
||||
@mouseover="hover = true"
|
||||
@mouseleave="hover = false"
|
||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
||||
>
|
||||
<div @mouseover="hover = true" @mouseleave="hover = false">
|
||||
<QInput
|
||||
ref="vnInputRef"
|
||||
v-model="value"
|
||||
|
@ -80,7 +88,7 @@ const inputRules = [
|
|||
:class="{ required: $attrs.required }"
|
||||
@keyup.enter="emit('keyup.enter')"
|
||||
:clearable="false"
|
||||
:rules="inputRules"
|
||||
:rules="mixinRules"
|
||||
:lazy-rules="true"
|
||||
hide-bottom-space
|
||||
>
|
||||
|
@ -88,7 +96,6 @@ const inputRules = [
|
|||
<slot name="prepend" />
|
||||
</template>
|
||||
<template #append>
|
||||
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
||||
<QIcon
|
||||
name="close"
|
||||
size="xs"
|
||||
|
@ -100,6 +107,7 @@ const inputRules = [
|
|||
}
|
||||
"
|
||||
></QIcon>
|
||||
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
||||
<QIcon v-if="info" name="info">
|
||||
<QTooltip max-width="350px">
|
||||
{{ info }}
|
||||
|
@ -112,6 +120,13 @@ const inputRules = [
|
|||
<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 {
|
||||
padding-inline: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,37 +2,32 @@
|
|||
import { onMounted, watch, computed, ref } from 'vue';
|
||||
import { date } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAttrs } from 'vue';
|
||||
|
||||
const model = defineModel({ type: String });
|
||||
const model = defineModel({ type: [String, Date] });
|
||||
const $props = defineProps({
|
||||
isOutlined: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
showEvent: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
const { validations } = useValidator();
|
||||
|
||||
const { t } = useI18n();
|
||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
||||
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||
|
||||
const dateFormat = 'DD/MM/YYYY';
|
||||
const isPopupOpen = ref();
|
||||
const hover = ref();
|
||||
const mask = ref();
|
||||
const $attrs = useAttrs();
|
||||
|
||||
onMounted(() => {
|
||||
// fix quasar bug
|
||||
mask.value = '##/##/####';
|
||||
});
|
||||
|
||||
const styleAttrs = computed(() => {
|
||||
return $props.isOutlined
|
||||
? {
|
||||
dense: true,
|
||||
outlined: true,
|
||||
rounded: true,
|
||||
}
|
||||
: {};
|
||||
});
|
||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||
|
||||
const formattedDate = computed({
|
||||
get() {
|
||||
|
@ -44,15 +39,12 @@ const formattedDate = computed({
|
|||
let newDate;
|
||||
if (value) {
|
||||
// parse input
|
||||
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'
|
||||
);
|
||||
}
|
||||
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'
|
||||
);
|
||||
}
|
||||
const [year, month, day] = value.split('-').map((e) => parseInt(e));
|
||||
newDate = new Date(year, month - 1, day);
|
||||
|
@ -75,12 +67,25 @@ 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,
|
||||
}
|
||||
: {};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -92,8 +97,10 @@ watch(
|
|||
placeholder="dd/mm/aaaa"
|
||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||
:class="{ required: $attrs.required }"
|
||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
||||
:rules="mixinRules"
|
||||
:clearable="false"
|
||||
@click="isPopupOpen = true"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
|
@ -111,6 +118,7 @@ watch(
|
|||
"
|
||||
/>
|
||||
<QIcon
|
||||
v-if="showEvent"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
@click="isPopupOpen = !isPopupOpen"
|
||||
|
@ -130,6 +138,7 @@ watch(
|
|||
v-model="popupDate"
|
||||
:landscape="true"
|
||||
:today-btn="true"
|
||||
:options="$attrs.options"
|
||||
@update:model-value="
|
||||
(date) => {
|
||||
formattedDate = date;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<script setup>
|
||||
import { watch, computed, ref, nextTick } from 'vue';
|
||||
import { computed, ref, useAttrs } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { date } from 'quasar';
|
||||
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
const { validations } = useValidator();
|
||||
const $attrs = useAttrs();
|
||||
const model = defineModel({ type: String });
|
||||
const props = defineProps({
|
||||
timeOnly: {
|
||||
|
@ -14,13 +16,13 @@ const props = defineProps({
|
|||
default: false,
|
||||
},
|
||||
});
|
||||
const initialDate = ref(model.value ?? Date.vnNew());
|
||||
const { t } = useI18n();
|
||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
||||
|
||||
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||
const dateFormat = 'HH:mm';
|
||||
const isPopupOpen = ref();
|
||||
const hover = ref();
|
||||
const inputRef = ref();
|
||||
|
||||
const styleAttrs = computed(() => {
|
||||
return props.isOutlined
|
||||
|
@ -50,7 +52,8 @@ const formattedTime = computed({
|
|||
}
|
||||
if (!props.timeOnly) {
|
||||
const [hh, mm] = time.split(':');
|
||||
const date = new Date(model.value ? model.value : null);
|
||||
|
||||
const date = new Date(model.value ? model.value : initialDate.value);
|
||||
date.setHours(hh, mm, 0);
|
||||
time = date?.toISOString();
|
||||
}
|
||||
|
@ -62,37 +65,10 @@ const formattedTime = computed({
|
|||
function dateToTime(newDate) {
|
||||
return date.formatDate(new Date(newDate), dateFormat);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => model.value,
|
||||
(val) => (formattedTime.value = val),
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => formattedTime.value,
|
||||
async (val) => {
|
||||
let position = 3;
|
||||
const input = inputRef.value?.getNativeElement();
|
||||
if (!val || !input) return;
|
||||
|
||||
let [hh, mm] = val.split(':');
|
||||
hh = parseInt(hh);
|
||||
if (hh >= 10 || mm != '00') return;
|
||||
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
if (!hh) position = 0;
|
||||
input.setSelectionRange(position, position);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div @mouseover="hover = true" @mouseleave="hover = false">
|
||||
<QInput
|
||||
ref="inputRef"
|
||||
class="vn-input-time"
|
||||
mask="##:##"
|
||||
placeholder="--:--"
|
||||
|
@ -100,9 +76,10 @@ watch(
|
|||
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||
:class="{ required: $attrs.required }"
|
||||
style="min-width: 100px"
|
||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
||||
:rules="mixinRules"
|
||||
@click="isPopupOpen = false"
|
||||
@focus="inputRef.getNativeElement().setSelectionRange(0, 0)"
|
||||
type="time"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
|
@ -149,6 +126,11 @@ watch(
|
|||
border-style: solid;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
:deep(input[type='time']::-webkit-calendar-picker-indicator) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
es:
|
||||
Open time: Abrir tiempo
|
||||
|
|
|
@ -2,21 +2,37 @@
|
|||
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 value = defineModel({ type: [String, Number, Object] });
|
||||
const emit = defineEmits(['update:model-value', 'update:options']);
|
||||
|
||||
const props = defineProps({
|
||||
location: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
const modelValue = ref(
|
||||
props.location
|
||||
? `${props.location?.postcode} - ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
|
||||
: null
|
||||
);
|
||||
function showLabel(data) {
|
||||
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
|
||||
}
|
||||
const handleModelValue = (data) => {
|
||||
emit('update:model-value', data);
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<VnSelectDialog
|
||||
v-model="value"
|
||||
option-value="code"
|
||||
v-model="modelValue"
|
||||
option-filter-value="search"
|
||||
:option-label="(opt) => showLabel(opt)"
|
||||
:option-label="
|
||||
(opt) => (typeof modelValue === 'string' ? modelValue : showLabel(opt))
|
||||
"
|
||||
url="Postcodes/filter"
|
||||
@update:model-value="handleModelValue"
|
||||
:use-like="false"
|
||||
:label="t('Location')"
|
||||
:placeholder="t('search_by_postalcode')"
|
||||
|
@ -27,7 +43,14 @@ function showLabel(data) {
|
|||
:emit-value="false"
|
||||
>
|
||||
<template #form>
|
||||
<CreateNewPostcode @on-data-saved="(newValue) => (value = newValue)" />
|
||||
<CreateNewPostcode
|
||||
@on-data-saved="
|
||||
(newValue) => {
|
||||
modelValue = newValue;
|
||||
emit('update:model-value', newValue);
|
||||
}
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
|
|
@ -14,6 +14,7 @@ import VnJsonValue from '../common/VnJsonValue.vue';
|
|||
import FetchData from '../FetchData.vue';
|
||||
import VnSelect from './VnSelect.vue';
|
||||
import VnUserLink from '../ui/VnUserLink.vue';
|
||||
import VnPaginate from '../ui/VnPaginate.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const validationsStore = useValidator();
|
||||
|
@ -66,9 +67,10 @@ const filter = {
|
|||
},
|
||||
},
|
||||
],
|
||||
where: { and: [{ originFk: route.params.id }] },
|
||||
};
|
||||
|
||||
const workers = ref();
|
||||
const paginate = ref();
|
||||
const actions = ref();
|
||||
const changeInput = ref();
|
||||
const searchInput = ref();
|
||||
|
@ -235,9 +237,7 @@ async function openPointRecord(id, modelLog) {
|
|||
const locale = validations[modelLog.model]?.locale || {};
|
||||
pointRecord.value = parseProps(propNames, locale, data);
|
||||
}
|
||||
async function setLogTree() {
|
||||
filter.where = { and: [{ originFk: route.params.id }] };
|
||||
const { data } = await getLogs(filter);
|
||||
async function setLogTree(data) {
|
||||
logTree.value = getLogTree(data);
|
||||
}
|
||||
|
||||
|
@ -266,15 +266,7 @@ async function applyFilter() {
|
|||
filter.where.and.push(selectedFilters.value);
|
||||
}
|
||||
|
||||
const { data } = await getLogs(filter);
|
||||
|
||||
logTree.value = getLogTree(data);
|
||||
}
|
||||
|
||||
async function getLogs(filter) {
|
||||
return axios.get(props.url ?? `${props.model}Logs`, {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
paginate.value.fetch(filter);
|
||||
}
|
||||
|
||||
function setDate(type) {
|
||||
|
@ -377,8 +369,6 @@ async function clearFilter() {
|
|||
await applyFilter();
|
||||
}
|
||||
|
||||
setLogTree();
|
||||
|
||||
onUnmounted(() => {
|
||||
stateStore.rightDrawer = false;
|
||||
});
|
||||
|
@ -391,16 +381,6 @@ watch(
|
|||
);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
:url="`${props.model}Logs/${route.params.id}/editors`"
|
||||
:filter="{
|
||||
fields: ['id', 'nickname', 'name', 'image'],
|
||||
order: 'nickname',
|
||||
limit: 30,
|
||||
}"
|
||||
@on-fetch="(data) => (workers = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
:url="`${props.model}Logs/${route.params.id}/models`"
|
||||
:filter="{ order: ['changedModel'] }"
|
||||
|
@ -418,231 +398,283 @@ watch(
|
|||
"
|
||||
auto-load
|
||||
/>
|
||||
<div
|
||||
class="column items-center logs origin-log q-mt-md"
|
||||
v-for="(originLog, originLogIndex) in logTree"
|
||||
:key="originLogIndex"
|
||||
<VnPaginate
|
||||
ref="paginate"
|
||||
:data-key="`${model}Log`"
|
||||
:url="`${model}Logs`"
|
||||
:filter="filter"
|
||||
:skeleton="false"
|
||||
auto-load
|
||||
@on-fetch="setLogTree"
|
||||
>
|
||||
<QItem class="origin-info items-center q-my-md" v-if="logTree.length > 1">
|
||||
<h6 class="origin-id text-grey">
|
||||
{{ useCapitalize(validations[props.model].locale.name) }}
|
||||
#{{ originLog.originFk }}
|
||||
</h6>
|
||||
<div class="line bg-grey"></div>
|
||||
</QItem>
|
||||
<div
|
||||
class="user-log q-mb-sm"
|
||||
v-for="(userLog, userIndex) in originLog.logs"
|
||||
:key="userIndex"
|
||||
>
|
||||
<div class="timeline">
|
||||
<div class="user-avatar">
|
||||
<VnUserLink :worker-id="userLog?.user?.id">
|
||||
<template #link>
|
||||
<VnAvatar
|
||||
:class="{ 'cursor-pointer': userLog?.user?.id }"
|
||||
:worker-id="userLog?.user?.id"
|
||||
:title="userLog?.user?.nickname"
|
||||
:show-letter="!userLog?.user"
|
||||
size="lg"
|
||||
/>
|
||||
</template>
|
||||
</VnUserLink>
|
||||
</div>
|
||||
<div class="arrow bg-panel" v-if="byRecord"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<QList class="user-changes" v-if="userLog">
|
||||
<QItem
|
||||
class="model-log column q-px-none q-py-xs"
|
||||
v-for="(modelLog, modelLogIndex) in userLog.logs"
|
||||
:key="modelLogIndex"
|
||||
<template #body>
|
||||
<div
|
||||
class="column items-center logs origin-log q-mt-md"
|
||||
v-for="(originLog, originLogIndex) in logTree"
|
||||
:key="originLogIndex"
|
||||
>
|
||||
<QItem class="origin-info items-center q-my-md" v-if="logTree.length > 1">
|
||||
<h6 class="origin-id text-grey">
|
||||
{{ useCapitalize(validations[props.model].locale.name) }}
|
||||
#{{ originLog.originFk }}
|
||||
</h6>
|
||||
<div class="line bg-grey"></div>
|
||||
</QItem>
|
||||
<div
|
||||
class="user-log q-mb-sm"
|
||||
v-for="(userLog, userIndex) in originLog.logs"
|
||||
:key="userIndex"
|
||||
>
|
||||
<QItemSection>
|
||||
<QItemLabel class="model-info q-mb-xs" v-if="!byRecord">
|
||||
<QChip
|
||||
dense
|
||||
size="md"
|
||||
class="model-name q-mr-xs text-white"
|
||||
v-if="
|
||||
!(modelLog.changedModel && modelLog.changedModelId) &&
|
||||
modelLog.model
|
||||
"
|
||||
:style="{
|
||||
backgroundColor: useColor(modelLog.model),
|
||||
}"
|
||||
:title="`${modelLog.model} #${modelLog.id}`"
|
||||
>
|
||||
{{ t(modelLog.modelI18n) }}
|
||||
</QChip>
|
||||
|
||||
<span
|
||||
class="model-id q-mr-xs"
|
||||
v-if="modelLog.summaryId"
|
||||
v-text="`#${modelLog.summaryId}`"
|
||||
/>
|
||||
<span
|
||||
class="model-value"
|
||||
:title="modelLog.showValue"
|
||||
v-text="modelLog.showValue"
|
||||
/>
|
||||
<QBtn
|
||||
flat
|
||||
round
|
||||
color="grey"
|
||||
class="q-mr-xs q-ml-auto"
|
||||
size="sm"
|
||||
icon="filter_alt"
|
||||
:title="t('recordChanges')"
|
||||
@click.stop="filterByRecord(modelLog)"
|
||||
/>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCard
|
||||
class="changes-log q-py-none q-mb-xs"
|
||||
v-for="(log, logIndex) in modelLog.logs"
|
||||
:key="logIndex"
|
||||
<div class="timeline">
|
||||
<div class="user-avatar">
|
||||
<VnUserLink :worker-id="userLog?.user?.id">
|
||||
<template #link>
|
||||
<VnAvatar
|
||||
:class="{ 'cursor-pointer': userLog?.user?.id }"
|
||||
:worker-id="userLog?.user?.id"
|
||||
:title="userLog?.user?.nickname"
|
||||
:show-letter="!userLog?.user"
|
||||
size="lg"
|
||||
/>
|
||||
</template>
|
||||
</VnUserLink>
|
||||
</div>
|
||||
<div class="arrow bg-panel" v-if="byRecord"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<QList class="user-changes" v-if="userLog">
|
||||
<QItem
|
||||
class="model-log column q-px-none q-py-xs"
|
||||
v-for="(modelLog, modelLogIndex) in userLog.logs"
|
||||
:key="modelLogIndex"
|
||||
>
|
||||
<QCardSection class="change-info q-pa-none">
|
||||
<QItem
|
||||
class="q-px-sm q-py-xs justify-between items-center"
|
||||
>
|
||||
<div
|
||||
class="date text-grey text-caption q-mr-sm"
|
||||
:title="
|
||||
date.formatDate(
|
||||
log.creationDate,
|
||||
'DD/MM/YYYY hh:mm:ss'
|
||||
) ?? `date:'dd/MM/yyyy HH:mm:ss'`
|
||||
<QItemSection>
|
||||
<QItemLabel class="model-info q-mb-xs" v-if="!byRecord">
|
||||
<QChip
|
||||
dense
|
||||
size="md"
|
||||
class="model-name q-mr-xs text-white"
|
||||
v-if="
|
||||
!(
|
||||
modelLog.changedModel &&
|
||||
modelLog.changedModelId
|
||||
) && modelLog.model
|
||||
"
|
||||
:style="{
|
||||
backgroundColor: useColor(modelLog.model),
|
||||
}"
|
||||
:title="`${modelLog.model} #${modelLog.id}`"
|
||||
>
|
||||
{{ toRelativeDate(log.creationDate) }}
|
||||
</div>
|
||||
<div>
|
||||
<QBtn
|
||||
color="grey"
|
||||
class="pit"
|
||||
icon="preview"
|
||||
flat
|
||||
round
|
||||
:title="t('pointRecord')"
|
||||
padding="none"
|
||||
v-if="log.action != 'insert'"
|
||||
@click.stop="
|
||||
openPointRecord(log.id, modelLog)
|
||||
"
|
||||
>
|
||||
<QPopupProxy>
|
||||
<QCard v-if="pointRecord">
|
||||
<div
|
||||
class="header q-px-sm q-py-xs q-ma-none text-white text-bold bg-primary"
|
||||
>
|
||||
{{ modelLog.modelI18n }}
|
||||
<span v-if="modelLog.id"
|
||||
>#{{ modelLog.id }}</span
|
||||
>
|
||||
</div>
|
||||
<QCardSection
|
||||
class="change-detail q-pa-sm"
|
||||
>
|
||||
<QItem
|
||||
v-for="(
|
||||
value, index
|
||||
) in pointRecord"
|
||||
:key="index"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<span
|
||||
class="json-field q-mr-xs text-grey"
|
||||
:title="value.name"
|
||||
>
|
||||
{{ value.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue
|
||||
:value="value.val.val"
|
||||
/>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QPopupProxy>
|
||||
</QBtn>
|
||||
<QIcon
|
||||
class="action q-ml-xs"
|
||||
:class="actionsClass[log.action]"
|
||||
:name="actionsIcon[log.action]"
|
||||
:title="
|
||||
t(`actions.${actionsText[log.action]}`)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardSection
|
||||
class="change-detail q-px-sm q-py-xs"
|
||||
:class="{ expanded: log.expand }"
|
||||
v-if="log.props.length || log.description"
|
||||
>
|
||||
<QIcon
|
||||
class="cursor-pointer q-mr-md"
|
||||
color="grey"
|
||||
name="expand_more"
|
||||
:title="t('globals.details')"
|
||||
size="sm"
|
||||
@click="log.expand = !log.expand"
|
||||
/>
|
||||
<span v-if="log.props.length" class="attributes">
|
||||
<span v-if="!log.expand" class="q-pa-none text-grey">
|
||||
<span
|
||||
v-for="(prop, propIndex) in log.props"
|
||||
:key="propIndex"
|
||||
class="basic-json"
|
||||
>
|
||||
<span class="json-field" :title="prop.name">
|
||||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue :value="prop.val.val" />
|
||||
<span v-if="propIndex < log.props.length - 1"
|
||||
>,
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
{{ t(modelLog.modelI18n) }}
|
||||
</QChip>
|
||||
|
||||
<span
|
||||
v-if="log.expand"
|
||||
class="expanded-json column q-pa-none"
|
||||
>
|
||||
<div
|
||||
v-for="(prop, prop2Index) in log.props"
|
||||
:key="prop2Index"
|
||||
class="q-pa-none text-grey"
|
||||
class="model-id q-mr-xs"
|
||||
v-if="modelLog.summaryId"
|
||||
v-text="`#${modelLog.summaryId}`"
|
||||
/>
|
||||
<span
|
||||
class="model-value"
|
||||
:title="modelLog.showValue"
|
||||
v-text="modelLog.showValue"
|
||||
/>
|
||||
<QBtn
|
||||
flat
|
||||
round
|
||||
color="grey"
|
||||
class="q-mr-xs q-ml-auto"
|
||||
size="sm"
|
||||
icon="filter_alt"
|
||||
:title="t('recordChanges')"
|
||||
@click.stop="filterByRecord(modelLog)"
|
||||
/>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCard
|
||||
class="changes-log q-py-none q-mb-xs"
|
||||
v-for="(log, logIndex) in modelLog.logs"
|
||||
:key="logIndex"
|
||||
>
|
||||
<QCardSection class="change-info q-pa-none">
|
||||
<QItem
|
||||
class="q-px-sm q-py-xs justify-between items-center"
|
||||
>
|
||||
<span class="json-field" :title="prop.name">
|
||||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue :value="prop.val.val" />
|
||||
<span v-if="prop.val.id" class="id-value">
|
||||
#{{ prop.val.id }}
|
||||
</span>
|
||||
<span v-if="log.action == 'update'">
|
||||
←
|
||||
<VnJsonValue :value="prop.old.val" />
|
||||
<span v-if="prop.old.id" class="id-value">
|
||||
#{{ prop.old.id }}
|
||||
<div
|
||||
class="date text-grey text-caption q-mr-sm"
|
||||
:title="
|
||||
date.formatDate(
|
||||
log.creationDate,
|
||||
'DD/MM/YYYY hh:mm:ss'
|
||||
) ?? `date:'dd/MM/yyyy HH:mm:ss'`
|
||||
"
|
||||
>
|
||||
{{ toRelativeDate(log.creationDate) }}
|
||||
</div>
|
||||
<div>
|
||||
<QBtn
|
||||
color="grey"
|
||||
class="pit"
|
||||
icon="preview"
|
||||
flat
|
||||
round
|
||||
:title="t('pointRecord')"
|
||||
padding="none"
|
||||
v-if="log.action != 'insert'"
|
||||
@click.stop="
|
||||
openPointRecord(log.id, modelLog)
|
||||
"
|
||||
>
|
||||
<QPopupProxy>
|
||||
<QCard v-if="pointRecord">
|
||||
<div
|
||||
class="header q-px-sm q-py-xs q-ma-none text-white text-bold bg-primary"
|
||||
>
|
||||
{{ modelLog.modelI18n }}
|
||||
<span v-if="modelLog.id"
|
||||
>#{{
|
||||
modelLog.id
|
||||
}}</span
|
||||
>
|
||||
</div>
|
||||
<QCardSection
|
||||
class="change-detail q-pa-sm"
|
||||
>
|
||||
<QItem
|
||||
v-for="(
|
||||
value, index
|
||||
) in pointRecord"
|
||||
:key="index"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<span
|
||||
class="json-field q-mr-xs text-grey"
|
||||
:title="
|
||||
value.name
|
||||
"
|
||||
>
|
||||
{{
|
||||
value.nameI18n
|
||||
}}:
|
||||
</span>
|
||||
<VnJsonValue
|
||||
:value="
|
||||
value.val.val
|
||||
"
|
||||
/>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QPopupProxy>
|
||||
</QBtn>
|
||||
<QIcon
|
||||
class="action q-ml-xs"
|
||||
:class="actionsClass[log.action]"
|
||||
:name="actionsIcon[log.action]"
|
||||
:title="
|
||||
t(
|
||||
`actions.${
|
||||
actionsText[log.action]
|
||||
}`
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardSection
|
||||
class="change-detail q-px-sm q-py-xs"
|
||||
:class="{ expanded: log.expand }"
|
||||
v-if="log.props.length || log.description"
|
||||
>
|
||||
<QIcon
|
||||
class="cursor-pointer q-mr-md"
|
||||
color="grey"
|
||||
name="expand_more"
|
||||
:title="t('globals.details')"
|
||||
size="sm"
|
||||
@click="log.expand = !log.expand"
|
||||
/>
|
||||
<span v-if="log.props.length" class="attributes">
|
||||
<span
|
||||
v-if="!log.expand"
|
||||
class="q-pa-none text-grey"
|
||||
>
|
||||
<span
|
||||
v-for="(prop, propIndex) in log.props"
|
||||
:key="propIndex"
|
||||
class="basic-json"
|
||||
>
|
||||
<span
|
||||
class="json-field"
|
||||
:title="prop.name"
|
||||
>
|
||||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue :value="prop.val.val" />
|
||||
<span
|
||||
v-if="
|
||||
propIndex <
|
||||
log.props.length - 1
|
||||
"
|
||||
>,
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
<span v-if="!log.props.length" class="description">
|
||||
{{ log.description }}
|
||||
</span>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QList>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
v-if="log.expand"
|
||||
class="expanded-json column q-pa-none"
|
||||
>
|
||||
<div
|
||||
v-for="(
|
||||
prop, prop2Index
|
||||
) in log.props"
|
||||
:key="prop2Index"
|
||||
class="q-pa-none text-grey"
|
||||
>
|
||||
<span
|
||||
class="json-field"
|
||||
:title="prop.name"
|
||||
>
|
||||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue :value="prop.val.val" />
|
||||
<span
|
||||
v-if="prop.val.id"
|
||||
class="id-value"
|
||||
>
|
||||
#{{ prop.val.id }}
|
||||
</span>
|
||||
<span v-if="log.action == 'update'">
|
||||
←
|
||||
<VnJsonValue
|
||||
:value="prop.old.val"
|
||||
/>
|
||||
<span
|
||||
v-if="prop.old.id"
|
||||
class="id-value"
|
||||
>
|
||||
#{{ prop.old.id }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-if="!log.props.length"
|
||||
class="description"
|
||||
>
|
||||
{{ log.description }}
|
||||
</span>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QList>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<QList dense>
|
||||
<QSeparator />
|
||||
|
@ -691,17 +723,16 @@ watch(
|
|||
</QOptionGroup>
|
||||
</QItem>
|
||||
<QItem class="q-mt-sm">
|
||||
<QItemSection v-if="!workers">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="workers && userRadio !== null">
|
||||
<QItemSection v-if="userRadio !== null">
|
||||
<VnSelect
|
||||
class="full-width"
|
||||
:label="t('globals.user')"
|
||||
v-model="userSelect"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="workers"
|
||||
:url="`${model}Logs/${$route.params.id}/editors`"
|
||||
:fields="['id', 'nickname', 'name', 'image']"
|
||||
sort-by="nickname"
|
||||
@update:model-value="selectFilter('userSelect')"
|
||||
hide-selected
|
||||
>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
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({
|
||||
|
@ -10,7 +11,9 @@ const $props = defineProps({
|
|||
default: true,
|
||||
},
|
||||
});
|
||||
onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
|
||||
onMounted(
|
||||
() => (stateStore.leftDrawer = useQuasar().screen.gt.xs ? $props.leftDrawer : false)
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -20,6 +23,8 @@ onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
|
|||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<QPageContainer>
|
||||
<RouterView></RouterView>
|
||||
<QPage>
|
||||
<RouterView />
|
||||
</QPage>
|
||||
</QPageContainer>
|
||||
</template>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<script setup>
|
||||
import { ref, toRefs, computed, watch, onMounted } from 'vue';
|
||||
import { ref, toRefs, computed, watch, onMounted, useAttrs } 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({
|
||||
|
@ -73,11 +74,20 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
params: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
noOne: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const { validations } = useValidator();
|
||||
const requiredFieldRule = (val) => validations().required($attrs.required, val);
|
||||
const $attrs = useAttrs();
|
||||
const { t } = useI18n();
|
||||
const requiredFieldRule = (val) => val ?? t('globals.fieldRequired');
|
||||
|
||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
|
||||
toRefs($props);
|
||||
const myOptions = ref([]);
|
||||
|
@ -85,6 +95,11 @@ const myOptionsOriginal = ref([]);
|
|||
const vnSelectRef = ref();
|
||||
const dataRef = ref();
|
||||
const lastVal = ref();
|
||||
const noOneText = t('globals.noOne');
|
||||
const noOneOpt = ref({
|
||||
[optionValue.value]: false,
|
||||
[optionLabel.value]: noOneText,
|
||||
});
|
||||
|
||||
const value = computed({
|
||||
get() {
|
||||
|
@ -100,9 +115,11 @@ watch(options, (newValue) => {
|
|||
setOptions(newValue);
|
||||
});
|
||||
|
||||
watch(modelValue, (newValue) => {
|
||||
watch(modelValue, async (newValue) => {
|
||||
if (!myOptions.value.some((option) => option[optionValue.value] == newValue))
|
||||
fetchFilter(newValue);
|
||||
await fetchFilter(newValue);
|
||||
|
||||
if ($props.noOne) myOptions.value.unshift(noOneOpt.value);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
@ -153,13 +170,19 @@ async function fetchFilter(val) {
|
|||
? optionValue.value
|
||||
: optionFilter.value ?? optionLabel.value);
|
||||
|
||||
const defaultWhere = $props.useLike
|
||||
? { [key]: { like: `%${val}%` } }
|
||||
: { [key]: val };
|
||||
let defaultWhere = {};
|
||||
if ($props.filterOptions.length) {
|
||||
defaultWhere = $props.filterOptions.reduce((obj, prop) => {
|
||||
if (!obj.or) obj.or = [];
|
||||
obj.or.push({ [prop]: getVal(val) });
|
||||
return obj;
|
||||
}, {});
|
||||
} else defaultWhere = { [key]: getVal(val) };
|
||||
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
||||
const fetchOptions = { where, include, limit };
|
||||
if (fields) fetchOptions.fields = fields;
|
||||
if (sortBy) fetchOptions.order = sortBy;
|
||||
|
||||
return dataRef.value.fetch(fetchOptions);
|
||||
}
|
||||
|
||||
|
@ -180,6 +203,9 @@ async function filterHandler(val, update) {
|
|||
} else newOptions = filter(val, myOptionsOriginal.value);
|
||||
update(
|
||||
() => {
|
||||
if ($props.noOne && noOneText.toLowerCase().includes(val.toLowerCase()))
|
||||
newOptions.unshift(noOneOpt.value);
|
||||
|
||||
myOptions.value = newOptions;
|
||||
},
|
||||
(ref) => {
|
||||
|
@ -194,6 +220,8 @@ async function filterHandler(val, update) {
|
|||
function nullishToTrue(value) {
|
||||
return value ?? true;
|
||||
}
|
||||
|
||||
const getVal = (val) => ($props.useLike ? { like: `%${val}%` } : val);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -205,6 +233,7 @@ function nullishToTrue(value) {
|
|||
:limit="limit"
|
||||
:sort-by="sortBy"
|
||||
:fields="fields"
|
||||
:params="params"
|
||||
/>
|
||||
<QSelect
|
||||
v-model="value"
|
||||
|
@ -221,8 +250,9 @@ function nullishToTrue(value) {
|
|||
ref="vnSelectRef"
|
||||
lazy-rules
|
||||
:class="{ required: $attrs.required }"
|
||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
||||
:rules="mixinRules"
|
||||
virtual-scroll-slice-size="options.length"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-if="isClearable" #append>
|
||||
<QIcon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRole } from 'src/composables/useRole';
|
||||
import { useAcl } from 'src/composables/useAcl';
|
||||
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
@ -11,6 +12,10 @@ const $props = defineProps({
|
|||
type: Array,
|
||||
default: () => ['developer'],
|
||||
},
|
||||
acls: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
actionIcon: {
|
||||
type: String,
|
||||
default: 'add',
|
||||
|
@ -22,15 +27,12 @@ const $props = defineProps({
|
|||
});
|
||||
|
||||
const role = useRole();
|
||||
const showForm = ref(false);
|
||||
const acl = useAcl();
|
||||
|
||||
const isAllowedToCreate = computed(() => {
|
||||
if ($props.acls.length) return acl.hasAny($props.acls);
|
||||
return role.hasAny($props.rolesAllowedToCreate);
|
||||
});
|
||||
|
||||
const toggleForm = () => {
|
||||
showForm.value = !showForm.value;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -41,7 +43,7 @@ const toggleForm = () => {
|
|||
>
|
||||
<template v-if="isAllowedToCreate" #append>
|
||||
<QIcon
|
||||
@click.stop.prevent="toggleForm()"
|
||||
@click.stop.prevent="$refs.dialog.show()"
|
||||
:name="actionIcon"
|
||||
:size="actionIcon === 'add' ? 'xs' : 'sm'"
|
||||
:class="['default-icon', { '--add-icon': actionIcon === 'add' }]"
|
||||
|
@ -51,7 +53,7 @@ const toggleForm = () => {
|
|||
>
|
||||
<QTooltip v-if="tooltip">{{ tooltip }}</QTooltip>
|
||||
</QIcon>
|
||||
<QDialog v-model="showForm" transition-show="scale" transition-hide="scale">
|
||||
<QDialog ref="dialog" transition-show="scale" transition-hide="scale">
|
||||
<slot name="form" />
|
||||
</QDialog>
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
<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>
|
|
@ -127,11 +127,6 @@ const dialog = ref(null);
|
|||
flex-direction: column;
|
||||
gap: 4px;
|
||||
|
||||
.subName {
|
||||
color: var(--vn-label-color);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
import { computed } from 'vue';
|
||||
|
||||
const $props = defineProps({
|
||||
maxLength: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
required: true,
|
||||
|
|
|
@ -15,7 +15,7 @@ const props = defineProps({
|
|||
default: null,
|
||||
},
|
||||
message: {
|
||||
type: String,
|
||||
type: [String, Boolean],
|
||||
default: null,
|
||||
},
|
||||
data: {
|
||||
|
@ -31,11 +31,15 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
|
||||
|
||||
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
||||
|
||||
const title = props.title || t('Confirm');
|
||||
const message = props.message || t('Are you sure you want to continue?');
|
||||
const message =
|
||||
props.message ||
|
||||
(props.message !== false ? t('Are you sure you want to continue?') : false);
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
async function confirm() {
|
||||
|
@ -61,12 +65,14 @@ async function confirm() {
|
|||
size="xl"
|
||||
v-if="icon"
|
||||
/>
|
||||
<span class="text-h6 text-grey">{{ title }}</span>
|
||||
<span class="text-h6">{{ title }}</span>
|
||||
<QSpace />
|
||||
<QBtn icon="close" :disable="isLoading" flat round dense v-close-popup />
|
||||
</QCardSection>
|
||||
<QCardSection class="row items-center">
|
||||
<span v-html="message"></span>
|
||||
<QCardSection class="q-pb-none">
|
||||
<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">
|
||||
|
|
|
@ -3,6 +3,7 @@ import { onMounted, ref, computed, watch } from 'vue';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { date } from 'quasar';
|
||||
import toDate from 'filters/toDate';
|
||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||
|
||||
|
@ -24,7 +25,7 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
unRemovableParams: {
|
||||
unremovableParams: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => [],
|
||||
|
@ -58,6 +59,7 @@ const $props = defineProps({
|
|||
});
|
||||
|
||||
defineExpose({ search, sanitizer });
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:modelValue',
|
||||
'refresh',
|
||||
|
@ -92,16 +94,18 @@ function setUserParams(watchedParams) {
|
|||
const order = watchedParams.filter?.order;
|
||||
|
||||
delete watchedParams.filter;
|
||||
userParams.value = { ...userParams.value, ...sanitizer(watchedParams) };
|
||||
userParams.value = sanitizer(watchedParams);
|
||||
emit('setUserParams', userParams.value, order);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [route.query[$props.searchUrl], arrayData.store.userParams],
|
||||
([newSearchUrl, newUserParams], [oldSearchUrl, oldUserParams]) => {
|
||||
if (newSearchUrl || oldSearchUrl) setUserParams(newSearchUrl);
|
||||
if (newUserParams || oldUserParams) setUserParams(newUserParams);
|
||||
}
|
||||
() => route.query[$props.searchUrl],
|
||||
(val, oldValue) => (val || oldValue) && setUserParams(val)
|
||||
);
|
||||
|
||||
watch(
|
||||
() => arrayData.store.userParams,
|
||||
(val, oldValue) => (val || oldValue) && setUserParams(val)
|
||||
);
|
||||
|
||||
watch(
|
||||
|
@ -111,58 +115,51 @@ watch(
|
|||
|
||||
const isLoading = ref(false);
|
||||
async function search(evt) {
|
||||
if (evt && $props.disableSubmitEvent) return;
|
||||
try {
|
||||
if (evt && $props.disableSubmitEvent) return;
|
||||
|
||||
store.filter.where = {};
|
||||
isLoading.value = true;
|
||||
const filter = { ...userParams.value, ...$props.modelValue };
|
||||
store.userParamsChanged = true;
|
||||
const { params: newParams } = await arrayData.addFilter({
|
||||
params: filter,
|
||||
});
|
||||
userParams.value = newParams;
|
||||
store.filter.where = {};
|
||||
isLoading.value = true;
|
||||
const filter = { ...userParams.value, ...$props.modelValue };
|
||||
store.userParamsChanged = true;
|
||||
const { params: newParams } = await arrayData.addFilter({
|
||||
params: filter,
|
||||
});
|
||||
userParams.value = newParams;
|
||||
|
||||
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
||||
|
||||
isLoading.value = false;
|
||||
emit('search');
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
isLoading.value = true;
|
||||
const params = Object.values(userParams.value).filter((param) => param);
|
||||
store.skip = 0;
|
||||
store.page = 1;
|
||||
await arrayData.fetch({ append: false });
|
||||
if (!$props.showAll && !params.length) store.data = [];
|
||||
isLoading.value = false;
|
||||
emit('refresh');
|
||||
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
||||
emit('search');
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function clearFilters() {
|
||||
isLoading.value = true;
|
||||
store.userParamsChanged = true;
|
||||
arrayData.reset(['skip', 'filter.skip', 'page']);
|
||||
// Filtrar los params no removibles
|
||||
const removableFilters = Object.keys(userParams.value).filter((param) =>
|
||||
$props.unRemovableParams.includes(param)
|
||||
);
|
||||
const newParams = {};
|
||||
// Conservar solo los params que no son removibles
|
||||
for (const key of removableFilters) {
|
||||
newParams[key] = userParams.value[key];
|
||||
}
|
||||
userParams.value = {};
|
||||
userParams.value = { ...newParams }; // Actualizar los params con los removibles
|
||||
await arrayData.applyFilter({ params: userParams.value });
|
||||
try {
|
||||
isLoading.value = true;
|
||||
store.userParamsChanged = true;
|
||||
arrayData.reset(['skip', 'filter.skip', 'page']);
|
||||
// Filtrar los params no removibles
|
||||
const removableFilters = Object.keys(userParams.value).filter((param) =>
|
||||
$props.unremovableParams.includes(param)
|
||||
);
|
||||
const newParams = {};
|
||||
// Conservar solo los params que no son removibles
|
||||
for (const key of removableFilters) {
|
||||
newParams[key] = userParams.value[key];
|
||||
}
|
||||
userParams.value = {};
|
||||
userParams.value = { ...newParams }; // Actualizar los params con los removibles
|
||||
await arrayData.applyFilter({ params: userParams.value });
|
||||
|
||||
if (!$props.showAll) {
|
||||
store.data = [];
|
||||
if (!$props.showAll) {
|
||||
store.data = [];
|
||||
}
|
||||
emit('clear');
|
||||
emit('update:modelValue', userParams.value);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
isLoading.value = false;
|
||||
emit('clear');
|
||||
emit('update:modelValue', userParams.value);
|
||||
}
|
||||
|
||||
const tagsList = computed(() => {
|
||||
|
@ -176,10 +173,10 @@ const tagsList = computed(() => {
|
|||
});
|
||||
|
||||
const tags = computed(() => {
|
||||
return tagsList.value.filter((tag) => !($props.customTags || []).includes(tag.key));
|
||||
return tagsList.value.filter((tag) => !($props.customTags || []).includes(tag.label));
|
||||
});
|
||||
const customTags = computed(() =>
|
||||
tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.key))
|
||||
tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.label))
|
||||
);
|
||||
|
||||
async function remove(key) {
|
||||
|
@ -190,6 +187,7 @@ async function remove(key) {
|
|||
}
|
||||
|
||||
function formatValue(value) {
|
||||
if (value instanceof Date) return date.formatDate(value, 'DD/MM/YYYY');
|
||||
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
|
||||
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
|
||||
|
||||
|
@ -198,7 +196,7 @@ function formatValue(value) {
|
|||
|
||||
function sanitizer(params) {
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
if (typeof value == 'object') {
|
||||
if (value && typeof value === 'object') {
|
||||
const param = Object.values(value)[0];
|
||||
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
|
||||
}
|
||||
|
@ -225,32 +223,18 @@ function sanitizer(params) {
|
|||
</QItemLabel>
|
||||
</QItemSection>
|
||||
<QItemSection top side>
|
||||
<div class="q-gutter-xs">
|
||||
<QBtn
|
||||
@click="clearFilters"
|
||||
color="primary"
|
||||
dense
|
||||
flat
|
||||
icon="filter_list_off"
|
||||
padding="none"
|
||||
round
|
||||
size="sm"
|
||||
>
|
||||
<QTooltip>{{ t('Remove filters') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
@click="reload"
|
||||
color="primary"
|
||||
dense
|
||||
flat
|
||||
icon="refresh"
|
||||
padding="none"
|
||||
round
|
||||
size="sm"
|
||||
>
|
||||
<QTooltip>{{ t('Refresh') }}</QTooltip>
|
||||
</QBtn>
|
||||
</div>
|
||||
<QBtn
|
||||
@click="clearFilters"
|
||||
color="primary"
|
||||
dense
|
||||
flat
|
||||
icon="filter_list_off"
|
||||
padding="none"
|
||||
round
|
||||
size="sm"
|
||||
>
|
||||
<QTooltip>{{ t('Remove filters') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
|
@ -264,7 +248,7 @@ function sanitizer(params) {
|
|||
<VnFilterPanelChip
|
||||
v-for="chip of tags"
|
||||
:key="chip.label"
|
||||
:removable="!unRemovableParams.includes(chip.label)"
|
||||
:removable="!unremovableParams?.includes(chip.label)"
|
||||
@remove="remove(chip.label)"
|
||||
>
|
||||
<slot name="tags" :tag="chip" :format-fn="formatValue">
|
||||
|
|
|
@ -39,6 +39,8 @@ 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;
|
||||
|
@ -52,6 +54,7 @@ defineExpose({
|
|||
</script>
|
||||
<template>
|
||||
<QImg
|
||||
:draggable="true"
|
||||
:class="{ zoomIn: zoom }"
|
||||
:src="getUrl()"
|
||||
v-bind="$attrs"
|
||||
|
@ -60,10 +63,12 @@ defineExpose({
|
|||
/>
|
||||
<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>
|
||||
|
|
|
@ -10,6 +10,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
class: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
autoLoad: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
@ -115,8 +119,8 @@ 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) => {
|
||||
|
@ -215,18 +219,25 @@ defineExpose({ fetch, addFilter, paginate });
|
|||
v-if="store.data"
|
||||
@load="onLoad"
|
||||
:offset="offset"
|
||||
class="full-width"
|
||||
:class="['full-width', props.class]"
|
||||
:disable="disableInfiniteScroll || !store.hasMoreData"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
<slot name="body" :rows="store.data"></slot>
|
||||
<div v-if="isLoading" class="info-row q-pa-md text-center">
|
||||
<div v-if="isLoading" class="spinner 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%;
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<script setup>
|
||||
defineProps({ wrap: { type: Boolean, default: false } });
|
||||
</script>
|
||||
<template>
|
||||
<div class="vn-row q-gutter-md q-mb-md">
|
||||
<slot />
|
||||
|
@ -9,10 +12,15 @@
|
|||
> :deep(*) {
|
||||
flex: 1;
|
||||
}
|
||||
&[wrap] {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 800px) {
|
||||
.vn-row {
|
||||
flex-direction: column;
|
||||
&:not(.wrap) {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -63,17 +63,13 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: '',
|
||||
},
|
||||
makeFetch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
searchUrl: {
|
||||
type: String,
|
||||
default: 'params',
|
||||
whereFilter: {
|
||||
type: Function,
|
||||
default: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
const searchText = ref('');
|
||||
const searchText = ref();
|
||||
let arrayDataProps = { ...props };
|
||||
if (props.redirect)
|
||||
arrayDataProps = {
|
||||
|
@ -104,18 +100,23 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
async function search() {
|
||||
const staticParams = Object.entries(store.userParams).filter(
|
||||
([key, value]) => value && (props.staticParams || []).includes(key)
|
||||
);
|
||||
const staticParams = Object.entries(store.userParams);
|
||||
arrayData.reset(['skip', 'page']);
|
||||
|
||||
if (props.makeFetch)
|
||||
await arrayData.applyFilter({
|
||||
params: {
|
||||
...Object.fromEntries(staticParams),
|
||||
search: searchText.value,
|
||||
},
|
||||
});
|
||||
const filter = {
|
||||
params: {
|
||||
...Object.fromEntries(staticParams),
|
||||
search: searchText.value,
|
||||
},
|
||||
};
|
||||
|
||||
if (props.whereFilter) {
|
||||
filter.filter = {
|
||||
where: props.whereFilter(searchText.value),
|
||||
};
|
||||
delete filter.params.search;
|
||||
}
|
||||
await arrayData.applyFilter(filter);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
@ -123,7 +124,7 @@ async function search() {
|
|||
<QForm @submit="search" id="searchbarForm">
|
||||
<VnInput
|
||||
id="searchbar"
|
||||
v-model="searchText"
|
||||
v-model.trim="searchText"
|
||||
:placeholder="t(props.label)"
|
||||
dense
|
||||
standout
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { watch, computed } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import { date } from 'quasar';
|
||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||
import VnAvatar from '../ui/VnAvatar.vue';
|
||||
|
|
|
@ -43,20 +43,9 @@ onBeforeUnmount(() => stateStore.toggleSubToolbar());
|
|||
</slot>
|
||||
</QToolbar>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
.q-toolbar {
|
||||
background: var(--vn-section-color);
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.sticky {
|
||||
position: sticky;
|
||||
top: 61px;
|
||||
z-index: 1;
|
||||
}
|
||||
@media (max-width: $breakpoint-sm) {
|
||||
.sticky {
|
||||
top: 90px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
<script setup>
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const $props = defineProps({
|
||||
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: $props.workerId }">
|
||||
{{ $props.defaultName ? $props.name ?? t('globals.system') : $props.name }}
|
||||
<span :class="{ link: workerId }">
|
||||
{{ defaultName ? name ?? $t('globals.system') : name }}
|
||||
</span>
|
||||
</slot>
|
||||
<WorkerDescriptorProxy v-if="$props.workerId" :id="$props.workerId" />
|
||||
<WorkerDescriptorProxy v-if="workerId" :id="workerId" />
|
||||
</template>
|
||||
|
|
|
@ -7,5 +7,5 @@ export function getDateQBadgeColor(date) {
|
|||
let comparation = today - timeTicket;
|
||||
|
||||
if (comparation == 0) return 'warning';
|
||||
if (comparation < 0) return 'negative';
|
||||
if (comparation < 0) return 'success';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import { toCurrency } from 'src/filters';
|
||||
|
||||
export function getTotal(rows, key, opts = {}) {
|
||||
const { currency, cb } = opts;
|
||||
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
||||
|
||||
return currency
|
||||
? toCurrency(total, currency == 'default' ? undefined : currency)
|
||||
: total;
|
||||
}
|
|
@ -16,13 +16,18 @@ export function useAcl() {
|
|||
state.setAcls(acls);
|
||||
}
|
||||
|
||||
function hasAny(model, prop, accessType) {
|
||||
const acls = state.getAcls().value[model];
|
||||
if (acls)
|
||||
return ['*', prop].some((key) => {
|
||||
const acl = acls[key];
|
||||
return acl && (acl['*'] || acl[accessType]);
|
||||
});
|
||||
function hasAny(acls) {
|
||||
for (const acl of acls) {
|
||||
let { model, props, accessType } = acl;
|
||||
const modelAcls = state.getAcls().value[model];
|
||||
Array.isArray(props) || (props = [props]);
|
||||
if (modelAcls)
|
||||
return ['*', ...props].some((key) => {
|
||||
const acl = modelAcls[key];
|
||||
return acl && (acl['*'] || acl[accessType]);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -16,7 +16,8 @@ export function usePrintService() {
|
|||
);
|
||||
}
|
||||
|
||||
function openReport(path, params) {
|
||||
function openReport(path, params, isNewTab = '_self') {
|
||||
if (typeof params === 'string') params = JSON.parse(params);
|
||||
params = Object.assign(
|
||||
{
|
||||
access_token: getTokenMultimedia(),
|
||||
|
@ -25,8 +26,7 @@ export function usePrintService() {
|
|||
);
|
||||
|
||||
const query = new URLSearchParams(params).toString();
|
||||
|
||||
window.open(`api/${path}?${query}`);
|
||||
window.open(`api/${path}?${query}`, isNewTab);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -28,7 +28,7 @@ export function useValidator() {
|
|||
}
|
||||
|
||||
const { t } = useI18n();
|
||||
const validations = function (validation) {
|
||||
const validations = function (validation = {}) {
|
||||
return {
|
||||
format: (value) => {
|
||||
const { allowNull, with: format, allowBlank } = validation;
|
||||
|
@ -40,12 +40,15 @@ export function useValidator() {
|
|||
if (!isValid) return message;
|
||||
},
|
||||
presence: (value) => {
|
||||
let message = `Value can't be empty`;
|
||||
let message = t(`globals.valueCantBeEmpty`);
|
||||
if (validation.message)
|
||||
message = t(validation.message) || validation.message;
|
||||
|
||||
return !validator.isEmpty(value ? String(value) : '') || message;
|
||||
},
|
||||
required: (required, value) => {
|
||||
return required ? !!value || t('globals.fieldRequired') : null;
|
||||
},
|
||||
length: (value) => {
|
||||
const options = {
|
||||
min: validation.min || validation.is,
|
||||
|
@ -71,12 +74,17 @@ export function useValidator() {
|
|||
return validator.isInt(value) || 'Value should be integer';
|
||||
return validator.isNumeric(value) || 'Value should be a number';
|
||||
},
|
||||
min: (value, min) => {
|
||||
if (min >= 0)
|
||||
if (Math.floor(value) < min) return t('inputMin', { value: min });
|
||||
},
|
||||
custom: (value) => validation.bindedFunction(value) || 'Invalid value',
|
||||
};
|
||||
};
|
||||
|
||||
return {
|
||||
validate,
|
||||
validations,
|
||||
models,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,6 +37,10 @@ a {
|
|||
.link {
|
||||
color: $color-link;
|
||||
cursor: pointer;
|
||||
|
||||
&--white {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.tx-color-link {
|
||||
|
@ -103,10 +107,6 @@ select:-webkit-autofill {
|
|||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.card-width {
|
||||
width: 770px;
|
||||
}
|
||||
|
||||
.vn-card-list {
|
||||
width: 100%;
|
||||
max-width: 60em;
|
||||
|
@ -190,6 +190,10 @@ select:-webkit-autofill {
|
|||
font-size: medium;
|
||||
}
|
||||
|
||||
.q-toolbar {
|
||||
background: var(--vn-section-color);
|
||||
}
|
||||
|
||||
.q-card__actions {
|
||||
justify-content: center;
|
||||
}
|
||||
|
@ -264,3 +268,23 @@ input::-webkit-inner-spin-button {
|
|||
max-width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-photo-btn {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.subName {
|
||||
color: var(--vn-label-color);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.q-date {
|
||||
&__today {
|
||||
border: 2px solid $info;
|
||||
color: $info;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,21 +20,21 @@ export function isValidDate(date) {
|
|||
* Converts a given date to a specific format.
|
||||
*
|
||||
* @param {number|string|Date} date - The date to be formatted.
|
||||
* @param {Object} opts - Optional parameters to customize the output format.
|
||||
* @returns {string} The formatted date as a string in 'dd/mm/yyyy' format. If the provided date is not valid, an empty string is returned.
|
||||
*
|
||||
* @example
|
||||
* // returns "02/12/2022"
|
||||
* toDateFormat(new Date(2022, 11, 2));
|
||||
*/
|
||||
export function toDateFormat(date, locale = 'es-ES') {
|
||||
if (!isValidDate(date)) {
|
||||
return '';
|
||||
}
|
||||
return new Date(date).toLocaleDateString(locale, {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
});
|
||||
export function toDateFormat(date, locale = 'es-ES', opts = {}) {
|
||||
if (!isValidDate(date)) return '';
|
||||
|
||||
const format = Object.assign(
|
||||
{ year: 'numeric', month: '2-digit', day: '2-digit' },
|
||||
opts
|
||||
);
|
||||
return new Date(date).toLocaleDateString(locale, format);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export default function dateRange(value) {
|
||||
const minHour = new Date(value);
|
||||
minHour.setHours(0, 0, 0, 0);
|
||||
const maxHour = new Date();
|
||||
const maxHour = new Date(value);
|
||||
maxHour.setHours(23, 59, 59, 59);
|
||||
|
||||
return [minHour, maxHour];
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// parsing JSON safely
|
||||
function parseJSON(str, fallback) {
|
||||
try {
|
||||
return JSON.parse(str ?? '{}');
|
||||
} catch (e) {
|
||||
console.error('Error parsing JSON:', e);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
export default function (route, param) {
|
||||
// catch route query params
|
||||
const params = parseJSON(route?.query?.params, {});
|
||||
|
||||
// extract and parse filter from params
|
||||
const { filter: filterStr = '{}' } = params;
|
||||
const where = parseJSON(filterStr, {})?.where;
|
||||
if (where && where[param] !== undefined) {
|
||||
return where[param];
|
||||
}
|
||||
return null;
|
||||
}
|
|
@ -11,6 +11,7 @@ import dashIfEmpty from './dashIfEmpty';
|
|||
import dateRange from './dateRange';
|
||||
import toHour from './toHour';
|
||||
import dashOrCurrency from './dashOrCurrency';
|
||||
import getParamWhere from './getParamWhere';
|
||||
|
||||
export {
|
||||
toLowerCase,
|
||||
|
@ -26,4 +27,5 @@ export {
|
|||
toPercentage,
|
||||
dashIfEmpty,
|
||||
dateRange,
|
||||
getParamWhere,
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@ globals:
|
|||
lang:
|
||||
es: Spanish
|
||||
en: English
|
||||
quantity: Quantity
|
||||
language: Language
|
||||
entity: Entity
|
||||
user: User
|
||||
|
@ -40,6 +41,8 @@ globals:
|
|||
noChanges: No changes to save
|
||||
changesToSave: You have changes pending to save
|
||||
confirmRemove: You are about to delete this row. Are you sure?
|
||||
rowWillBeRemoved: This row will be removed
|
||||
sureToContinue: Are you sure you want to continue?
|
||||
rowAdded: Row added
|
||||
rowRemoved: Row removed
|
||||
pleaseWait: Please wait...
|
||||
|
@ -67,6 +70,7 @@ globals:
|
|||
allRows: 'All { numberRows } row(s)'
|
||||
markAll: Mark all
|
||||
requiredField: Required field
|
||||
valueCantBeEmpty: Value cannot be empty
|
||||
class: clase
|
||||
type: Type
|
||||
reason: reason
|
||||
|
@ -83,7 +87,7 @@ globals:
|
|||
description: Description
|
||||
id: Id
|
||||
order: Order
|
||||
original: Original
|
||||
original: Phys. Doc
|
||||
file: File
|
||||
selectFile: Select a file
|
||||
copyClipboard: Copy on clipboard
|
||||
|
@ -93,8 +97,16 @@ globals:
|
|||
since: Since
|
||||
from: From
|
||||
to: To
|
||||
notes: Notes
|
||||
refresh: Refresh
|
||||
item: Item
|
||||
ticket: Ticket
|
||||
campaign: Campaign
|
||||
weight: Weight
|
||||
error: Ups! Something went wrong
|
||||
pageTitles:
|
||||
logIn: Login
|
||||
addressEdit: Update address
|
||||
summary: Summary
|
||||
basicData: Basic data
|
||||
log: Logs
|
||||
|
@ -119,9 +131,11 @@ 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
|
||||
|
@ -145,6 +159,7 @@ globals:
|
|||
dms: File management
|
||||
entryCreate: New entry
|
||||
latestBuys: Latest buys
|
||||
reserves: Reserves
|
||||
tickets: Tickets
|
||||
ticketCreate: New Tickets
|
||||
boxing: Boxing
|
||||
|
@ -254,6 +269,11 @@ globals:
|
|||
twoFactor: Two factor
|
||||
recoverPassword: Recover password
|
||||
resetPassword: Reset password
|
||||
ticketsMonitor: Tickets monitor
|
||||
clientsActionsMonitor: Clients and actions
|
||||
serial: Serial
|
||||
medical: Mutual
|
||||
supplier: Supplier
|
||||
created: Created
|
||||
worker: Worker
|
||||
now: Now
|
||||
|
@ -266,6 +286,16 @@ globals:
|
|||
title: Unsaved changes will be lost
|
||||
subtitle: Are you sure exit without saving?
|
||||
createInvoiceIn: Create invoice in
|
||||
myAccount: My account
|
||||
noOne: No one
|
||||
params:
|
||||
clientFk: Client id
|
||||
salesPersonFk: Sales person
|
||||
warehouseFk: Warehouse
|
||||
provinceFk: Province
|
||||
from: From
|
||||
To: To
|
||||
stateFk: State
|
||||
errors:
|
||||
statusUnauthorized: Access denied
|
||||
statusInternalServerError: An internal server error has ocurred
|
||||
|
@ -302,135 +332,6 @@ 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
|
||||
|
@ -452,6 +353,7 @@ entry:
|
|||
travelFk: Travel
|
||||
isExcludedFromAvailable: Inventory
|
||||
isRaid: Raid
|
||||
invoiceAmount: Import
|
||||
summary:
|
||||
commission: Commission
|
||||
currency: Currency
|
||||
|
@ -688,6 +590,7 @@ invoiceOut:
|
|||
chooseValidClient: Choose a valid client
|
||||
chooseValidCompany: Choose a valid company
|
||||
chooseValidPrinter: Choose a valid printer
|
||||
chooseValidSerialType: Choose a serial type
|
||||
fillDates: Invoice date and the max date should be filled
|
||||
invoiceDateLessThanMaxDate: Invoice date can not be less than max date
|
||||
invoiceWithFutureDate: Exists an invoice with a future date
|
||||
|
@ -742,56 +645,6 @@ parking:
|
|||
searchBar:
|
||||
info: You can search by parking code
|
||||
label: Search parking...
|
||||
invoiceIn:
|
||||
list:
|
||||
ref: Reference
|
||||
supplier: Supplier
|
||||
supplierRef: Supplier ref.
|
||||
serialNumber: Serial number
|
||||
serial: Serial
|
||||
file: File
|
||||
issued: Issued
|
||||
isBooked: Is booked
|
||||
awb: AWB
|
||||
amount: Amount
|
||||
card:
|
||||
issued: Issued
|
||||
amount: Amount
|
||||
client: Client
|
||||
company: Company
|
||||
customerCard: Customer card
|
||||
ticketList: Ticket List
|
||||
vat: Vat
|
||||
dueDay: Due day
|
||||
intrastat: Intrastat
|
||||
summary:
|
||||
supplier: Supplier
|
||||
supplierRef: Supplier ref.
|
||||
currency: Currency
|
||||
docNumber: Doc number
|
||||
issued: Expedition date
|
||||
operated: Operation date
|
||||
bookEntried: Entry date
|
||||
bookedDate: Booked date
|
||||
sage: Sage withholding
|
||||
vat: Undeductible VAT
|
||||
company: Company
|
||||
booked: Booked
|
||||
expense: Expense
|
||||
taxableBase: Taxable base
|
||||
rate: Rate
|
||||
sageVat: Sage vat
|
||||
sageTransaction: Sage transaction
|
||||
dueDay: Date
|
||||
bank: Bank
|
||||
amount: Amount
|
||||
foreignValue: Foreign value
|
||||
dueTotal: Due day
|
||||
noMatch: Do not match
|
||||
code: Code
|
||||
net: Net
|
||||
stems: Stems
|
||||
country: Country
|
||||
order:
|
||||
field:
|
||||
salesPersonFk: Sales Person
|
||||
|
@ -868,6 +721,7 @@ worker:
|
|||
timeControl: Time control
|
||||
locker: Locker
|
||||
balance: Balance
|
||||
medical: Medical
|
||||
list:
|
||||
name: Name
|
||||
email: Email
|
||||
|
@ -879,6 +733,7 @@ worker:
|
|||
newWorker: New worker
|
||||
card:
|
||||
workerId: Worker ID
|
||||
user: User
|
||||
name: Name
|
||||
email: Email
|
||||
phone: Phone
|
||||
|
@ -947,6 +802,15 @@ worker:
|
|||
amount: Importe
|
||||
remark: Bonficado
|
||||
hasDiploma: Diploma
|
||||
medical:
|
||||
tableVisibleColumns:
|
||||
date: Date
|
||||
time: Hour
|
||||
center: Formation Center
|
||||
invoice: Invoice
|
||||
amount: Amount
|
||||
isFit: Fit
|
||||
remark: Observations
|
||||
imageNotFound: Image not found
|
||||
balance:
|
||||
tableVisibleColumns:
|
||||
|
@ -956,6 +820,16 @@ worker:
|
|||
credit: Have
|
||||
concept: Concept
|
||||
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
|
||||
|
@ -1119,9 +993,12 @@ travel:
|
|||
agency: Agency
|
||||
shipped: Shipped
|
||||
landed: Landed
|
||||
shipHour: Shipment Hour
|
||||
landHour: Landing Hour
|
||||
warehouseIn: Warehouse in
|
||||
warehouseOut: Warehouse out
|
||||
totalEntries: Total entries
|
||||
totalEntriesTooltip: Total entries
|
||||
summary:
|
||||
confirmed: Confirmed
|
||||
entryId: Entry Id
|
||||
|
@ -1274,6 +1151,7 @@ components:
|
|||
active: Is active
|
||||
visible: Is visible
|
||||
floramondo: Is floramondo
|
||||
showBadDates: Show future items
|
||||
userPanel:
|
||||
copyToken: Token copied to clipboard
|
||||
settings: Settings
|
||||
|
|
|
@ -3,6 +3,7 @@ globals:
|
|||
es: Español
|
||||
en: Inglés
|
||||
language: Idioma
|
||||
quantity: Cantidad
|
||||
entity: Entidad
|
||||
user: Usuario
|
||||
details: Detalles
|
||||
|
@ -39,6 +40,8 @@ globals:
|
|||
noChanges: Sin cambios que guardar
|
||||
changesToSave: Tienes cambios pendientes de guardar
|
||||
confirmRemove: Vas a eliminar este registro. ¿Continuar?
|
||||
rowWillBeRemoved: Esta linea se eliminará
|
||||
sureToContinue: ¿Seguro que quieres continuar?
|
||||
rowAdded: Fila añadida
|
||||
rowRemoved: Fila eliminada
|
||||
pleaseWait: Por favor espera...
|
||||
|
@ -76,6 +79,9 @@ globals:
|
|||
warehouse: Almacén
|
||||
company: Empresa
|
||||
fieldRequired: Campo requerido
|
||||
valueCantBeEmpty: El valor no puede estar vacío
|
||||
Value can't be blank: El valor no puede estar en blanco
|
||||
Value can't be null: El valor no puede ser nulo
|
||||
allowedFilesText: 'Tipos de archivo permitidos: { allowedContentTypes }'
|
||||
smsSent: SMS enviado
|
||||
confirmDeletion: Confirmar eliminación
|
||||
|
@ -83,7 +89,7 @@ globals:
|
|||
description: Descripción
|
||||
id: Id
|
||||
order: Orden
|
||||
original: Original
|
||||
original: Doc. física
|
||||
file: Fichero
|
||||
selectFile: Seleccione un fichero
|
||||
copyClipboard: Copiar en portapapeles
|
||||
|
@ -93,8 +99,16 @@ globals:
|
|||
since: Desde
|
||||
from: Desde
|
||||
to: Hasta
|
||||
notes: Notas
|
||||
refresh: Actualizar
|
||||
item: Artículo
|
||||
ticket: Ticket
|
||||
campaign: Campaña
|
||||
weight: Peso
|
||||
error: ¡Ups! Algo salió mal
|
||||
pageTitles:
|
||||
logIn: Inicio de sesión
|
||||
addressEdit: Modificar consignatario
|
||||
summary: Resumen
|
||||
basicData: Datos básicos
|
||||
log: Historial
|
||||
|
@ -114,6 +128,7 @@ globals:
|
|||
inheritedRoles: Roles heredados
|
||||
customers: Clientes
|
||||
customerCreate: Nuevo cliente
|
||||
createOrder: Nuevo pedido
|
||||
list: Listado
|
||||
webPayments: Pagos Web
|
||||
extendedList: Listado extendido
|
||||
|
@ -123,6 +138,7 @@ globals:
|
|||
fiscalData: Datos fiscales
|
||||
billingData: Forma de pago
|
||||
consignees: Consignatarios
|
||||
'address-create': Nuevo consignatario
|
||||
notes: Notas
|
||||
credits: Créditos
|
||||
greuges: Greuges
|
||||
|
@ -235,7 +251,7 @@ globals:
|
|||
purchaseRequest: Petición de compra
|
||||
weeklyTickets: Tickets programados
|
||||
formation: Formación
|
||||
locations: Ubicaciones
|
||||
locations: Localizaciones
|
||||
warehouses: Almacenes
|
||||
roles: Roles
|
||||
connections: Conexiones
|
||||
|
@ -256,6 +272,11 @@ globals:
|
|||
twoFactor: Doble factor
|
||||
recoverPassword: Recuperar contraseña
|
||||
resetPassword: Restablecer contraseña
|
||||
ticketsMonitor: Monitor de tickets
|
||||
clientsActionsMonitor: Clientes y acciones
|
||||
serial: Facturas por serie
|
||||
medical: Mutua
|
||||
supplier: Proveedor
|
||||
created: Fecha creación
|
||||
worker: Trabajador
|
||||
now: Ahora
|
||||
|
@ -268,7 +289,16 @@ globals:
|
|||
title: Los cambios que no haya guardado se perderán
|
||||
subtitle: ¿Seguro que quiere salir sin guardar?
|
||||
createInvoiceIn: Crear factura recibida
|
||||
|
||||
myAccount: Mi cuenta
|
||||
noOne: Nadie
|
||||
params:
|
||||
clientFk: Id cliente
|
||||
salesPersonFk: Comercial
|
||||
warehouseFk: Almacén
|
||||
provinceFk: Provincia
|
||||
from: Desde
|
||||
To: Hasta
|
||||
stateFk: Estado
|
||||
errors:
|
||||
statusUnauthorized: Acceso denegado
|
||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||
|
@ -303,134 +333,6 @@ 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
|
||||
|
@ -452,6 +354,7 @@ entry:
|
|||
travelFk: Envio
|
||||
isExcludedFromAvailable: Inventario
|
||||
isRaid: Redada
|
||||
invoiceAmount: Importe
|
||||
summary:
|
||||
commission: Comisión
|
||||
currency: Moneda
|
||||
|
@ -695,6 +598,7 @@ invoiceOut:
|
|||
chooseValidClient: Selecciona un cliente válido
|
||||
chooseValidCompany: Selecciona una empresa válida
|
||||
chooseValidPrinter: Selecciona una impresora válida
|
||||
chooseValidSerialType: Selecciona una tipo de serie válida
|
||||
fillDates: La fecha de la factura y la fecha máxima deben estar completas
|
||||
invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima
|
||||
invoiceWithFutureDate: Existe una factura con una fecha futura
|
||||
|
@ -787,54 +691,6 @@ parking:
|
|||
searchBar:
|
||||
info: Puedes buscar por código de parking
|
||||
label: Buscar parking...
|
||||
invoiceIn:
|
||||
list:
|
||||
ref: Referencia
|
||||
supplier: Proveedor
|
||||
supplierRef: Ref. proveedor
|
||||
serialNumber: Num. serie
|
||||
shortIssued: F. emisión
|
||||
serial: Serie
|
||||
file: Fichero
|
||||
issued: Fecha emisión
|
||||
isBooked: Conciliada
|
||||
awb: AWB
|
||||
amount: Importe
|
||||
card:
|
||||
issued: Fecha emisión
|
||||
amount: Importe
|
||||
client: Cliente
|
||||
company: Empresa
|
||||
customerCard: Ficha del cliente
|
||||
ticketList: Listado de tickets
|
||||
vat: Iva
|
||||
dueDay: Fecha de vencimiento
|
||||
summary:
|
||||
supplier: Proveedor
|
||||
supplierRef: Ref. proveedor
|
||||
currency: Divisa
|
||||
docNumber: Número documento
|
||||
issued: Fecha de expedición
|
||||
operated: Fecha operación
|
||||
bookEntried: Fecha asiento
|
||||
bookedDate: Fecha contable
|
||||
sage: Retención sage
|
||||
vat: Iva no deducible
|
||||
company: Empresa
|
||||
booked: Contabilizada
|
||||
expense: Gasto
|
||||
taxableBase: Base imp.
|
||||
rate: Tasa
|
||||
sageTransaction: Sage transación
|
||||
dueDay: Fecha
|
||||
bank: Caja
|
||||
amount: Importe
|
||||
foreignValue: Divisa
|
||||
dueTotal: Vencimiento
|
||||
code: Código
|
||||
net: Neto
|
||||
stems: Tallos
|
||||
country: País
|
||||
department:
|
||||
pageTitles:
|
||||
basicData: Basic data
|
||||
|
@ -870,6 +726,8 @@ worker:
|
|||
timeControl: Control de horario
|
||||
locker: Taquilla
|
||||
balance: Balance
|
||||
formation: Formación
|
||||
medical: Mutua
|
||||
list:
|
||||
name: Nombre
|
||||
email: Email
|
||||
|
@ -881,6 +739,7 @@ worker:
|
|||
newWorker: Nuevo trabajador
|
||||
card:
|
||||
workerId: ID Trabajador
|
||||
user: Usuario
|
||||
name: Nombre
|
||||
email: Correo personal
|
||||
phone: Teléfono
|
||||
|
@ -940,6 +799,15 @@ worker:
|
|||
amount: Importe
|
||||
remark: Bonficado
|
||||
hasDiploma: Diploma
|
||||
medical:
|
||||
tableVisibleColumns:
|
||||
date: Fecha
|
||||
time: Hora
|
||||
center: Centro de Formación
|
||||
invoice: Factura
|
||||
amount: Importe
|
||||
isFit: Apto
|
||||
remark: Observaciones
|
||||
imageNotFound: No se ha encontrado la imagen
|
||||
balance:
|
||||
tableVisibleColumns:
|
||||
|
@ -949,6 +817,16 @@ worker:
|
|||
credit: Haber
|
||||
concept: Concepto
|
||||
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
|
||||
|
@ -1097,11 +975,14 @@ travel:
|
|||
id: Id
|
||||
ref: Referencia
|
||||
agency: Agencia
|
||||
shipped: Enviado
|
||||
landed: Llegada
|
||||
warehouseIn: Almacén de salida
|
||||
warehouseOut: Almacén de entrada
|
||||
totalEntries: Total de entradas
|
||||
shipped: F.envío
|
||||
shipHour: Hora de envío
|
||||
landHour: Hora de llegada
|
||||
landed: F.entrega
|
||||
warehouseIn: Alm.salida
|
||||
warehouseOut: Alm.entrada
|
||||
totalEntries: ∑
|
||||
totalEntriesTooltip: Entradas totales
|
||||
summary:
|
||||
confirmed: Confirmado
|
||||
entryId: Id entrada
|
||||
|
@ -1252,6 +1133,7 @@ components:
|
|||
active: Activo
|
||||
visible: Visible
|
||||
floramondo: Floramondo
|
||||
showBadDates: Ver items a futuro
|
||||
userPanel:
|
||||
copyToken: Token copiado al portapapeles
|
||||
settings: Configuración
|
||||
|
@ -1266,6 +1148,7 @@ components:
|
|||
clone: Clonar
|
||||
openCard: Ficha
|
||||
openSummary: Detalles
|
||||
viewSummary: Vista previa
|
||||
cardDescriptor:
|
||||
mainList: Listado principal
|
||||
summary: Resumen
|
||||
|
|
|
@ -5,7 +5,7 @@ const quasar = useQuasar();
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<QLayout view="hHh LpR fFf">
|
||||
<QLayout view="hHh LpR fFf" v-shortcut>
|
||||
<Navbar />
|
||||
<RouterView></RouterView>
|
||||
<QFooter v-if="quasar.platform.is.mobile"></QFooter>
|
||||
|
|
|
@ -6,7 +6,6 @@ import axios from 'axios';
|
|||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
|
@ -24,7 +23,6 @@ const stateStore = useStateStore();
|
|||
const quasar = useQuasar();
|
||||
|
||||
const tableRef = ref();
|
||||
const rolesOptions = ref([]);
|
||||
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
|
@ -143,6 +141,7 @@ const deleteAcl = async ({ id }) => {
|
|||
formInitialData: {},
|
||||
}"
|
||||
order="id DESC"
|
||||
:disable-option="{ card: true }"
|
||||
:columns="columns"
|
||||
default-mode="table"
|
||||
:right-search="true"
|
||||
|
|
|
@ -21,24 +21,21 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('id'),
|
||||
label: t('Id'),
|
||||
isId: true,
|
||||
field: 'id',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'alias',
|
||||
label: t('alias'),
|
||||
field: 'alias',
|
||||
label: t('Alias'),
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'description',
|
||||
label: t('description'),
|
||||
field: 'description',
|
||||
label: t('Description'),
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -69,9 +66,17 @@ const columns = computed(() => [
|
|||
}"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
:disable-option="{ card: true }"
|
||||
default-mode="table"
|
||||
redirect="account/alias"
|
||||
:is-editable="true"
|
||||
:use-model="true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Id: Id
|
||||
Alias: Alias
|
||||
Description: Descripción
|
||||
</i18n>
|
||||
|
|
|
@ -27,15 +27,15 @@ const filter = {
|
|||
order: 'created DESC',
|
||||
};
|
||||
|
||||
const urlPath = 'AccessTokens';
|
||||
const urlPath = 'VnTokens';
|
||||
|
||||
const refresh = () => paginateRef.value.fetch();
|
||||
|
||||
const navigate = (id) => router.push({ name: 'AccountSummary', params: { id } });
|
||||
|
||||
const killSession = async (id) => {
|
||||
const killSession = async ({ userId, created }) => {
|
||||
try {
|
||||
await axios.delete(`${urlPath}/${id}`);
|
||||
await axios.post(`${urlPath}/killSession`, { userId, created });
|
||||
paginateRef.value.fetch();
|
||||
notify(t('Session killed'), 'positive');
|
||||
} catch (error) {
|
||||
|
@ -84,7 +84,7 @@ const killSession = async (id) => {
|
|||
openConfirmationModal(
|
||||
t('Session will be killed'),
|
||||
t('Are you sure you want to continue?'),
|
||||
() => killSession(row.id)
|
||||
() => killSession(row)
|
||||
)
|
||||
"
|
||||
outline
|
||||
|
|
|
@ -14,15 +14,23 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('id'),
|
||||
label: t('Id'),
|
||||
isId: true,
|
||||
field: 'id',
|
||||
cardVisible: true,
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'search',
|
||||
attrs: {
|
||||
url: 'VnUsers/preview',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'username',
|
||||
label: t('nickname'),
|
||||
label: t('Nickname'),
|
||||
isTitle: true,
|
||||
component: 'input',
|
||||
columnField: {
|
||||
|
@ -37,7 +45,7 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'name',
|
||||
label: t('name'),
|
||||
label: t('Name'),
|
||||
component: 'input',
|
||||
columnField: {
|
||||
component: null,
|
||||
|
@ -65,6 +73,7 @@ const columns = computed(() => [
|
|||
title: t('View Summary'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row.id, AccountSummary),
|
||||
isPrimary: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -108,3 +117,10 @@ const exprBuilder = (param, value) => {
|
|||
:use-model="true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Id: Id
|
||||
Nickname: Nickname
|
||||
Name: Nombre
|
||||
</i18n>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
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';
|
||||
|
@ -24,7 +25,7 @@ watch(
|
|||
<template>
|
||||
<FormModel
|
||||
ref="formModelRef"
|
||||
:url="`VnUsers/preview`"
|
||||
url="VnUsers/preview"
|
||||
:url-update="`VnUsers/${route.params.id}/update-user`"
|
||||
:filter="accountFilter"
|
||||
model="Accounts"
|
||||
|
@ -43,6 +44,15 @@ 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>
|
||||
|
|
|
@ -15,7 +15,6 @@ const { t } = useI18n();
|
|||
url: 'VnUsers/preview',
|
||||
label: t('account.search'),
|
||||
info: t('account.searchInfo'),
|
||||
searchUrl: 'table',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -72,7 +72,7 @@ const hasAccount = ref(false);
|
|||
</VnImg>
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('account.card.nickname')" :value="entity.nickname" />
|
||||
<VnLv :label="t('account.card.nickname')" :value="entity.name" />
|
||||
<VnLv :label="t('account.card.role')" :value="entity.role.name" />
|
||||
</template>
|
||||
<template #actions="{ entity }">
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { computed, ref, toRefs } from 'vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue';
|
||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
const quasar = useQuasar();
|
||||
const $props = defineProps({
|
||||
hasAccount: {
|
||||
type: Boolean,
|
||||
|
@ -35,7 +32,7 @@ async function updateStatusAccount(active) {
|
|||
|
||||
account.value.hasAccount = active;
|
||||
const status = active ? 'enable' : 'disable';
|
||||
quasar.notify({
|
||||
notify({
|
||||
message: t(`account.card.${status}Account.success`),
|
||||
type: 'positive',
|
||||
});
|
||||
|
@ -44,19 +41,11 @@ async function updateStatusUser(active) {
|
|||
await axios.patch(`VnUsers/${entityId.value}`, { active });
|
||||
account.value.active = active;
|
||||
const status = active ? 'activate' : 'deactivate';
|
||||
quasar.notify({
|
||||
notify({
|
||||
message: t(`account.card.actions.${status}User.success`),
|
||||
type: 'positive',
|
||||
});
|
||||
}
|
||||
function setPassword() {
|
||||
quasar.dialog({
|
||||
component: CustomerChangePassword,
|
||||
componentProps: {
|
||||
id: entityId.value,
|
||||
},
|
||||
});
|
||||
}
|
||||
const showSyncDialog = ref(false);
|
||||
const syncPassword = ref(null);
|
||||
const shouldSyncPassword = ref(false);
|
||||
|
@ -66,20 +55,11 @@ async function sync() {
|
|||
await axios.patch(`Accounts/${account.value.name}/sync`, {
|
||||
params,
|
||||
});
|
||||
quasar.notify({
|
||||
notify({
|
||||
message: t('account.card.actions.sync.success'),
|
||||
type: 'positive',
|
||||
});
|
||||
}
|
||||
|
||||
const removeAccount = async () => {
|
||||
try {
|
||||
await axios.delete(`VnUsers/${account.value.id}`);
|
||||
notify(t('Account removed'), 'positive');
|
||||
} catch (error) {
|
||||
console.error('Error deleting user', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<VnConfirm
|
||||
|
@ -112,24 +92,6 @@ const removeAccount = async () => {
|
|||
/>
|
||||
</template>
|
||||
</VnConfirm>
|
||||
<!-- <QItem v-ripple clickable @click="setPassword">
|
||||
<QItemSection>{{ t('account.card.actions.setPassword') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="!account.hasAccount"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('account.card.actions.enableAccount.title'),
|
||||
t('account.card.actions.enableAccount.subtitle'),
|
||||
() => updateStatusAccount(true)
|
||||
)
|
||||
"
|
||||
>
|
||||
<QItemSection>{{ t('account.card.actions.enableAccount.name') }}</QItemSection>
|
||||
</QItem> -->
|
||||
|
||||
<QItem
|
||||
v-if="account.hasAccount"
|
||||
v-ripple
|
||||
|
@ -178,10 +140,4 @@ const removeAccount = async () => {
|
|||
</QItem>
|
||||
|
||||
<QSeparator />
|
||||
<!-- <QItem @click="removeAccount(id)" v-ripple clickable>
|
||||
<QItemSection avatar>
|
||||
<QIcon name="delete" />
|
||||
</QItemSection>
|
||||
<QItemSection>{{ t('account.card.actions.delete.name') }}</QItemSection>
|
||||
</QItem> -->
|
||||
</template>
|
||||
|
|
|
@ -169,7 +169,13 @@ onMounted(async () => await getAccountData(false));
|
|||
<AccountMailAliasCreateForm @on-submit-create-alias="createMailAlias" />
|
||||
</QDialog>
|
||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||
<QBtn fab icon="add" color="primary" @click="openCreateMailAliasForm()">
|
||||
<QBtn
|
||||
fab
|
||||
icon="add"
|
||||
color="primary"
|
||||
@click="openCreateMailAliasForm()"
|
||||
shortcut="+"
|
||||
>
|
||||
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
@ -12,16 +12,21 @@ const route = useRoute();
|
|||
|
||||
const rolesOptions = ref([]);
|
||||
const formModelRef = ref();
|
||||
watch(
|
||||
() => route.params.id,
|
||||
() => formModelRef.value.reset()
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" />
|
||||
<FormModel
|
||||
ref="formModelRef"
|
||||
model="AccountPrivileges"
|
||||
:url="`VnUsers/${route.params.id}/privileges`"
|
||||
url="VnUsers/preview"
|
||||
:filter="{ where: { id: route.params.id } }"
|
||||
:url-create="`VnUsers/${route.params.id}/privileges`"
|
||||
:id="route.params.id"
|
||||
auto-load
|
||||
@on-data-saved="formModelRef.fetch()"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<div class="q-gutter-y-sm">
|
||||
|
|
|
@ -48,7 +48,7 @@ const filter = {
|
|||
<QIcon name="open_in_new" />
|
||||
</router-link>
|
||||
</QCardSection>
|
||||
<VnLv :label="t('account.card.nickname')" :value="account.nickname" />
|
||||
<VnLv :label="t('account.card.nickname')" :value="account.name" />
|
||||
<VnLv :label="t('account.card.role')" :value="account.role.name" />
|
||||
</QCard>
|
||||
</template>
|
||||
|
|
|
@ -4,11 +4,9 @@ import { computed, ref } from 'vue';
|
|||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import RoleSummary from './Card/RoleSummary.vue';
|
||||
const route = useRoute();
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -23,24 +21,30 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('id'),
|
||||
label: t('Id'),
|
||||
isId: true,
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
component: 'select',
|
||||
name: 'search',
|
||||
attrs: {
|
||||
url: 'VnRoles',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'name',
|
||||
label: t('name'),
|
||||
label: t('Name'),
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'description',
|
||||
label: t('description'),
|
||||
label: t('Description'),
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -53,6 +57,7 @@ const columns = computed(() => [
|
|||
title: t('View Summary'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row.id, RoleSummary),
|
||||
isPrimary: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -95,8 +100,16 @@ const exprBuilder = (param, value) => {
|
|||
},
|
||||
}"
|
||||
order="id ASC"
|
||||
:disable-option="{ card: true }"
|
||||
:columns="columns"
|
||||
default-mode="table"
|
||||
redirect="account/role"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Id: Id
|
||||
Description: Descripción
|
||||
Name: Nombre
|
||||
</i18n>
|
||||
|
|
|
@ -142,7 +142,13 @@ const redirectToRoleSummary = (id) =>
|
|||
<SubRoleCreateForm @on-submit-create-subrole="createSubRole" />
|
||||
</QDialog>
|
||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||
<QBtn fab icon="add" color="primary" @click="openCreateSubRoleForm()">
|
||||
<QBtn
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
color="primary"
|
||||
@click="openCreateSubRoleForm()"
|
||||
>
|
||||
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
|
|
|
@ -35,6 +35,7 @@ account:
|
|||
willDeactivated: User will be deactivated
|
||||
activated: User activated!
|
||||
deactivated: User deactivated!
|
||||
twoFactor: Two factor
|
||||
actions:
|
||||
setPassword: Set password
|
||||
disableAccount:
|
||||
|
|
|
@ -32,6 +32,7 @@ account:
|
|||
activated: ¡Usuario activado!
|
||||
deactivated: ¡Usuario desactivado!
|
||||
newUser: Nuevo usuario
|
||||
twoFactor: Doble factor
|
||||
privileges:
|
||||
delegate: Puede delegar privilegios
|
||||
actions:
|
||||
|
|
|
@ -3,58 +3,18 @@ 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
|
||||
|
@ -70,7 +30,7 @@ const statesFilter = {
|
|||
auto-load
|
||||
:reload="true"
|
||||
>
|
||||
<template #form="{ data, validate, filter }">
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
v-model="data.client.name"
|
||||
|
@ -101,20 +61,14 @@ const statesFilter = {
|
|||
/>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<QSelect
|
||||
<VnSelect
|
||||
v-model="data.claimStateFk"
|
||||
:options="claimStates"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
emit-value
|
||||
url="ClaimStates"
|
||||
:label="t('claim.state')"
|
||||
map-options
|
||||
use-input
|
||||
@filter="(value, update) => filter(value, update, statesFilter)"
|
||||
option-label="description"
|
||||
:rules="validate('claim.claimStateFk')"
|
||||
:input-debounce="0"
|
||||
>
|
||||
</QSelect>
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QInput
|
||||
|
@ -123,16 +77,14 @@ const statesFilter = {
|
|||
:rules="validate('claim.packages')"
|
||||
type="number"
|
||||
/>
|
||||
<QSelect
|
||||
<VnSelectEnum
|
||||
v-model="data.pickup"
|
||||
:options="optionsList"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
emit-value
|
||||
:label="t('claim.pickup')"
|
||||
map-options
|
||||
use-input
|
||||
:input-debounce="0"
|
||||
table="claim"
|
||||
column="pickup"
|
||||
option-label="description"
|
||||
:translation="(value) => t(`claim.${value}`)"
|
||||
:default-options="[{ id: null, description: t('claim.null') }]"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -16,7 +16,6 @@ const claimReasons = ref([]);
|
|||
const claimResults = ref([]);
|
||||
const claimResponsibles = ref([]);
|
||||
const claimRedeliveries = ref([]);
|
||||
const workers = ref([]);
|
||||
const selected = ref([]);
|
||||
const saveButtonRef = ref();
|
||||
|
||||
|
@ -82,7 +81,9 @@ const columns = computed(() => [
|
|||
label: t('Worker'),
|
||||
field: (row) => row.workerFk,
|
||||
sortable: true,
|
||||
options: workers.value,
|
||||
url: 'Workers/search',
|
||||
where: { active: 1 },
|
||||
sortBy: 'name ASC',
|
||||
model: 'workerFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'nickname',
|
||||
|
@ -129,13 +130,6 @@ 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"
|
||||
|
@ -165,6 +159,9 @@ 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"
|
||||
|
|
|
@ -45,7 +45,7 @@ async function onFetchClaim(data) {
|
|||
|
||||
const amount = ref();
|
||||
const amountClaimed = ref();
|
||||
async function onFetch(rows, newRows) {
|
||||
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();
|
||||
await claimLinesForm.value.reload();
|
||||
onFetch(claimLinesForm.value.formData);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -211,7 +211,7 @@ async function saveWhenHasChanges() {
|
|||
<template #body-cell-claimed="{ row }">
|
||||
<QTd auto-width align="right" class="text-primary">
|
||||
<QInput
|
||||
v-model="row.quantity"
|
||||
v-model.number="row.quantity"
|
||||
type="number"
|
||||
dense
|
||||
@keyup.enter="saveWhenHasChanges()"
|
||||
|
@ -266,7 +266,9 @@ async function saveWhenHasChanges() {
|
|||
<template v-if="column.name === 'claimed'">
|
||||
<QItemLabel class="text-primary">
|
||||
<QInput
|
||||
v-model="props.row.quantity"
|
||||
v-model.number="
|
||||
props.row.quantity
|
||||
"
|
||||
type="number"
|
||||
dense
|
||||
autofocus
|
||||
|
@ -315,7 +317,7 @@ async function saveWhenHasChanges() {
|
|||
</div>
|
||||
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<QBtn fab color="primary" icon="add" @click="showImportDialog()" />
|
||||
<QBtn fab color="primary" shortcut="+" icon="add" @click="showImportDialog()" />
|
||||
</QPageSticky>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -246,7 +246,13 @@ function onDrag() {
|
|||
</QDialog>
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<label for="fileInput">
|
||||
<QBtn fab @click="inputFile.nativeEl.click()" icon="add" color="primary">
|
||||
<QBtn
|
||||
fab
|
||||
@click="inputFile.nativeEl.click()"
|
||||
shortcut="+"
|
||||
icon="add"
|
||||
color="primary"
|
||||
>
|
||||
<QInput
|
||||
ref="inputFile"
|
||||
type="file"
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { onMounted, ref, computed } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { toDate, toCurrency } from 'src/filters';
|
||||
import dashIfEmpty from 'src/filters/dashIfEmpty';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
|
@ -36,8 +35,6 @@ const $props = defineProps({
|
|||
|
||||
const entityId = computed(() => $props.id || route.params.id);
|
||||
const ClaimStates = ref([]);
|
||||
const claimUrl = ref();
|
||||
const salixUrl = ref();
|
||||
const claimDmsRef = ref();
|
||||
const claimDms = ref([]);
|
||||
const multimediaDialog = ref();
|
||||
|
@ -97,8 +94,8 @@ const detailsColumns = ref([
|
|||
{
|
||||
name: 'total',
|
||||
label: 'claim.total',
|
||||
field: ({ sale }) =>
|
||||
toCurrency(sale.quantity * sale.price * ((100 - sale.discount) / 100)),
|
||||
field: (row) =>
|
||||
toCurrency(row.quantity * row.sale.price * ((100 - row.sale.discount) / 100)),
|
||||
sortable: true,
|
||||
},
|
||||
]);
|
||||
|
@ -152,11 +149,6 @@ const developmentColumns = ref([
|
|||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
salixUrl.value = await getUrl('');
|
||||
claimUrl.value = salixUrl.value + `claim/${entityId.value}/`;
|
||||
});
|
||||
|
||||
async function getClaimDms() {
|
||||
claimDmsFilter.value.where = { claimFk: entityId.value };
|
||||
await claimDmsRef.value.fetch();
|
||||
|
@ -177,10 +169,15 @@ function openDialog(dmsId) {
|
|||
multimediaSlide.value = dmsId;
|
||||
multimediaDialog.value = true;
|
||||
}
|
||||
|
||||
async function changeState(value) {
|
||||
await axios.patch(`Claims/updateClaim/${entityId.value}`, { claimStateFk: value });
|
||||
router.go(route.fullPath);
|
||||
}
|
||||
|
||||
function claimUrl(section) {
|
||||
return '#/claim/' + entityId.value + '/' + section;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -234,7 +231,7 @@ async function changeState(value) {
|
|||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
||||
<VnTitle
|
||||
:url="`#/claim/${entityId}/basic-data`"
|
||||
:url="claimUrl('basic-data')"
|
||||
:text="t('globals.pageTitles.basicData')"
|
||||
/>
|
||||
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" />
|
||||
|
@ -275,7 +272,7 @@ async function changeState(value) {
|
|||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-two">
|
||||
<VnTitle :url="`#/claim/${entityId}/notes`" :text="t('claim.notes')" />
|
||||
<VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" />
|
||||
<ClaimNotes
|
||||
:id="entityId"
|
||||
:add-note="false"
|
||||
|
@ -284,7 +281,7 @@ async function changeState(value) {
|
|||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-two" v-if="claimDms?.length">
|
||||
<VnTitle :url="`#/claim/${entityId}/photos`" :text="t('claim.photos')" />
|
||||
<VnTitle :url="claimUrl('photos')" :text="t('claim.photos')" />
|
||||
<div class="container max-container-height" style="overflow: auto">
|
||||
<div
|
||||
class="multimedia-container"
|
||||
|
@ -326,7 +323,7 @@ async function changeState(value) {
|
|||
</div>
|
||||
</QCard>
|
||||
<QCard class="vn-max" v-if="salesClaimed.length > 0">
|
||||
<VnTitle :url="`#/claim/${entityId}/lines`" :text="t('claim.details')" />
|
||||
<VnTitle :url="claimUrl('lines')" :text="t('claim.details')" />
|
||||
<QTable
|
||||
:columns="detailsColumns"
|
||||
:rows="salesClaimed"
|
||||
|
@ -365,7 +362,7 @@ async function changeState(value) {
|
|||
</QTable>
|
||||
</QCard>
|
||||
<QCard class="vn-max" v-if="developments.length > 0">
|
||||
<VnTitle :url="claimUrl + 'development'" :text="t('claim.development')" />
|
||||
<VnTitle :url="claimUrl('development')" :text="t('claim.development')" />
|
||||
<QTable
|
||||
:columns="developmentColumns"
|
||||
:rows="developments"
|
||||
|
@ -390,7 +387,7 @@ async function changeState(value) {
|
|||
</QTable>
|
||||
</QCard>
|
||||
<QCard class="vn-max">
|
||||
<VnTitle :url="claimUrl + 'action'" :text="t('claim.actions')" />
|
||||
<VnTitle :url="claimUrl('action')" :text="t('claim.actions')" />
|
||||
<div id="slider-container" class="q-px-xl q-py-md">
|
||||
<QSlider
|
||||
v-model="claim.responsibility"
|
||||
|
|
|
@ -50,8 +50,9 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
label: t('claim.attendedBy'),
|
||||
name: 'attendedBy',
|
||||
cardVisible: true,
|
||||
orderBy: 'workerFk',
|
||||
columnFilter: {
|
||||
name: 'attenderFk',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
|
@ -63,6 +64,7 @@ const columns = computed(() => [
|
|||
optionFilter: 'firstName',
|
||||
},
|
||||
},
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -77,6 +79,9 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
label: t('claim.state'),
|
||||
format: ({ stateCode }) =>
|
||||
claimFilterRef.value?.states.find(({ code }) => code === stateCode)
|
||||
?.description,
|
||||
name: 'stateCode',
|
||||
chip: {
|
||||
condition: () => true,
|
||||
|
@ -96,7 +101,7 @@ const columns = computed(() => [
|
|||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('Client ticket list'),
|
||||
title: t('components.smartCard.viewSummary'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row.id, ClaimSummary),
|
||||
},
|
||||
|
|
|
@ -42,7 +42,7 @@ claim:
|
|||
pickup: Recoger
|
||||
null: No
|
||||
agency: Agencia
|
||||
delivery: Entrega
|
||||
delivery: Reparto
|
||||
fileDescription: 'ID de reclamación {claimId} del cliente {clientName} con ID {clientId}'
|
||||
noData: 'No hay imágenes/videos, haz clic aquí o arrastra y suelta el archivo'
|
||||
dragDrop: Arrastra y suelta aquí
|
||||
|
|
|
@ -5,15 +5,12 @@ 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: [
|
||||
|
@ -41,7 +38,13 @@ const addressFilter = {
|
|||
{
|
||||
relation: 'province',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
fields: ['id', 'name', 'countryFk'],
|
||||
include: [
|
||||
{
|
||||
relation: 'country',
|
||||
scope: { fields: ['id', 'name'] },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -83,13 +86,6 @@ 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;
|
||||
};
|
||||
|
@ -128,12 +124,6 @@ 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>
|
||||
|
@ -177,7 +167,14 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
<div>{{ item.street }}</div>
|
||||
<div>
|
||||
{{ item.postalCode }} - {{ item.city }},
|
||||
{{ setProvince(item.provinceFk) }}
|
||||
{{ item.province.name }}
|
||||
</div>
|
||||
<div>
|
||||
{{ item.phone }}
|
||||
<span v-if="item.mobile"
|
||||
>,
|
||||
{{ item.mobile }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<QCheckbox
|
||||
|
@ -218,7 +215,13 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
</div>
|
||||
|
||||
<QPageSticky :offset="[18, 18]">
|
||||
<QBtn @click.stop="toCustomerAddressCreate()" color="primary" fab icon="add" />
|
||||
<QBtn
|
||||
@click.stop="toCustomerAddressCreate()"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New consignee') }}
|
||||
</QTooltip>
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
import { computed, onBeforeMount, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useRole } from 'src/composables/useRole';
|
||||
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';
|
||||
|
@ -22,12 +22,10 @@ import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment
|
|||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
const { sendEmail } = usePrintService();
|
||||
const { sendEmail, openReport } = usePrintService();
|
||||
const { t } = useI18n();
|
||||
const { hasAny } = useRole();
|
||||
|
||||
const session = useSession();
|
||||
const tokenMultimedia = session.getTokenMultimedia();
|
||||
const { hasAny } = useAcl();
|
||||
const currentBalance = ref({});
|
||||
const quasar = useQuasar();
|
||||
const route = useRoute();
|
||||
const state = useState();
|
||||
|
@ -36,7 +34,7 @@ const user = state.getUser();
|
|||
|
||||
const clientRisk = ref([]);
|
||||
const tableRef = ref();
|
||||
const companyId = ref();
|
||||
const companyId = ref(user.value.companyFk);
|
||||
const companyLastId = ref(user.value.companyFk);
|
||||
const balances = ref([]);
|
||||
const vnFilterRef = ref({});
|
||||
|
@ -76,14 +74,14 @@ const companyFilterColumn = {
|
|||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
name: 'payed',
|
||||
label: t('Date'),
|
||||
format: ({ payed }) => toDate(payed),
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
name: 'created',
|
||||
label: t('Creation date'),
|
||||
format: ({ created }) => toDateHourMin(created),
|
||||
|
@ -91,16 +89,10 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'workerFk',
|
||||
label: t('Employee'),
|
||||
columnField: {
|
||||
component: 'userLink',
|
||||
attrs: ({ row }) => {
|
||||
return {
|
||||
workerId: row.workerFk,
|
||||
name: row.userName,
|
||||
};
|
||||
},
|
||||
attrs: ({ row }) => ({ workerId: row.workerFk, name: row.userName }),
|
||||
},
|
||||
cardVisible: true,
|
||||
},
|
||||
|
@ -125,14 +117,14 @@ const columns = computed(() => [
|
|||
isId: true,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
align: 'left',
|
||||
name: 'credit',
|
||||
label: t('Havings'),
|
||||
format: ({ credit }) => credit && toCurrency(credit),
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
align: 'left',
|
||||
name: 'balance',
|
||||
label: t('Balance'),
|
||||
format: ({ balance }) => toCurrency(balance),
|
||||
|
@ -171,41 +163,15 @@ const columns = computed(() => [
|
|||
|
||||
onBeforeMount(() => {
|
||||
stateStore.rightDrawer = true;
|
||||
companyId.value = user.value.companyFk;
|
||||
});
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
async function getCurrentBalance(data) {
|
||||
for (const balance of data) {
|
||||
currentBalance.value[balance.companyFk] = {
|
||||
code: balance.company.code,
|
||||
amount: balance.amount,
|
||||
};
|
||||
}
|
||||
balances.value = data;
|
||||
}
|
||||
|
||||
const showNewPaymentDialog = () => {
|
||||
|
@ -220,19 +186,27 @@ const showNewPaymentDialog = () => {
|
|||
};
|
||||
|
||||
const showBalancePdf = ({ id }) => {
|
||||
const url = `api/InvoiceOuts/${id}/download?access_token=${tokenMultimedia}`;
|
||||
window.open(url, '_blank');
|
||||
openReport(`InvoiceOuts/${id}/download`, {}, '_blank');
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="clientRisks"
|
||||
:filter="{
|
||||
include: { relation: 'company', scope: { fields: ['code'] } },
|
||||
where: { clientFk: route.params.id, companyFk: companyId },
|
||||
}"
|
||||
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" v-if="clientRisk?.length">
|
||||
{{ clientRisk[0].company.code }}:
|
||||
{{ toCurrency(clientRisk[0].amount) }}
|
||||
<div class="row justify-center">
|
||||
{{ currentBalance[companyId]?.code }}:
|
||||
{{ toCurrency(currentBalance[companyId]?.amount) }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -258,7 +232,7 @@ const showBalancePdf = ({ id }) => {
|
|||
:right-search="false"
|
||||
:is-editable="false"
|
||||
:column-search="false"
|
||||
@on-fetch="onFetch"
|
||||
:disable-option="{ card: true }"
|
||||
auto-load
|
||||
>
|
||||
<template #column-balance="{ rowIndex }">
|
||||
|
@ -266,7 +240,7 @@ const showBalancePdf = ({ id }) => {
|
|||
</template>
|
||||
<template #column-description="{ row }">
|
||||
<div class="link" v-if="row.isInvoice">
|
||||
{{ row.description }}
|
||||
{{ t('bill', { ref: row.description }) }}
|
||||
<InvoiceOutDescriptorProxy :id="row.description" />
|
||||
</div>
|
||||
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
||||
|
@ -284,7 +258,9 @@ const showBalancePdf = ({ id }) => {
|
|||
>
|
||||
<VnInput
|
||||
v-model="scope.value"
|
||||
:disable="!hasAny(['administrative'])"
|
||||
:disable="
|
||||
!hasAny([{ model: 'Receipt', props: '*', accessType: 'WRITE' }])
|
||||
"
|
||||
@keypress.enter="scope.set"
|
||||
autofocus
|
||||
/>
|
||||
|
@ -292,7 +268,13 @@ const showBalancePdf = ({ id }) => {
|
|||
</template>
|
||||
</VnTable>
|
||||
<QPageSticky :offset="[18, 18]" style="z-index: 2">
|
||||
<QBtn @click.stop="showNewPaymentDialog()" color="primary" fab icon="add" />
|
||||
<QBtn
|
||||
@click.stop="showNewPaymentDialog()"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New payment') }}
|
||||
</QTooltip>
|
||||
|
|
|
@ -25,6 +25,7 @@ const title = ref();
|
|||
/>
|
||||
<FetchData
|
||||
url="BusinessTypes"
|
||||
:filter="{ fields: ['code', 'description'], order: 'description ASC ' }"
|
||||
@on-fetch="(data) => (businessTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
@ -38,7 +39,7 @@ const title = ref();
|
|||
clearable
|
||||
v-model="data.name"
|
||||
/>
|
||||
<QSelect
|
||||
<VnSelect
|
||||
:input-debounce="0"
|
||||
:label="t('customer.basicData.businessType')"
|
||||
:options="businessTypes"
|
||||
|
@ -89,15 +90,18 @@ const title = ref();
|
|||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
option-filter="firstName"
|
||||
url="Workers/search"
|
||||
v-model="data.salesPersonFk"
|
||||
:label="t('customer.basicData.salesPerson')"
|
||||
:params="{
|
||||
departmentCodes: ['VT', 'shopping'],
|
||||
}"
|
||||
:fields="['id', 'nickname']"
|
||||
sort-by="nickname ASC"
|
||||
:rules="validate('client.salesPersonFk')"
|
||||
:use-like="false"
|
||||
:emit-value="false"
|
||||
@update:model-value="(val) => (title = val?.nickname)"
|
||||
emit-value
|
||||
auto-load
|
||||
>
|
||||
<template #prepend>
|
||||
<VnAvatar
|
||||
|
@ -106,8 +110,19 @@ const title = ref();
|
|||
: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>
|
||||
<QSelect
|
||||
<VnSelect
|
||||
v-model="data.contactChannelFk"
|
||||
:options="contactChannels"
|
||||
option-value="id"
|
||||
|
@ -120,7 +135,8 @@ const title = ref();
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QSelect
|
||||
<VnSelect
|
||||
url="Clients"
|
||||
:input-debounce="0"
|
||||
:label="t('customer.basicData.previousClient')"
|
||||
:options="clients"
|
||||
|
@ -129,7 +145,9 @@ const title = ref();
|
|||
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">
|
||||
|
@ -140,7 +158,7 @@ const title = ref();
|
|||
}}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
</QSelect>
|
||||
</VnSelect>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModel>
|
||||
|
|
|
@ -3,7 +3,6 @@ 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';
|
||||
|
@ -14,8 +13,6 @@ 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 = {
|
||||
|
@ -31,15 +28,6 @@ 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`"
|
||||
|
@ -49,8 +37,9 @@ 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"
|
||||
|
@ -69,8 +58,11 @@ const getBankEntities = (data, formData) => {
|
|||
</VnInput>
|
||||
<VnSelectDialog
|
||||
:label="t('Swift / BIC')"
|
||||
:options="bankEntitiesOptions"
|
||||
:roles-allowed-to-create="['salesAssistant', 'hr']"
|
||||
ref="bankEntitiesRef"
|
||||
:filter="filter"
|
||||
auto-load
|
||||
url="BankEntities"
|
||||
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
|
||||
:rules="validate('Worker.bankEntity')"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
|
@ -85,9 +77,8 @@ const getBankEntities = (data, formData) => {
|
|||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection v-if="scope.opt">
|
||||
<QItemLabel
|
||||
>{{ scope.opt.bic }} {{ scope.opt.name }}</QItemLabel
|
||||
>
|
||||
<QItemLabel>{{ scope.opt.bic }} </QItemLabel>
|
||||
<QItemLabel caption> {{ scope.opt.name }}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
<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="CustomerFilter"
|
||||
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
|
||||
search-data-key="CustomerList"
|
||||
:searchbar-props="{
|
||||
url: 'Clients/extendedListFilter',
|
||||
url: 'Clients/filter',
|
||||
label: 'Search customer',
|
||||
info: 'You can search by customer id or name',
|
||||
}"
|
||||
|
|
|
@ -1,17 +1,241 @@
|
|||
<script setup>
|
||||
import { ref, computed, onBeforeMount } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue';
|
||||
import { useStateStore } from 'src/stores/useStateStore';
|
||||
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(),
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="#right-panel" v-if="useStateStore().isHeaderMounted()">
|
||||
<CustomerConsumptionFilter data-key="CustomerConsumption" />
|
||||
</Teleport>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Enter a new search: Introduce una nueva búsqueda
|
||||
Group by items: Agrupar por artículos
|
||||
</i18n>
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import { QItem } from 'quasar';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import { QItemSection } from 'quasar';
|
||||
|
||||
const { t } = useI18n();
|
||||
defineProps({ dataKey: { type: String, required: true } });
|
||||
</script>
|
||||
<template>
|
||||
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ params }">
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.item')"
|
||||
v-model="params.itemId"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
v-model="params.buyerId"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
:label="t('params.buyer')"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</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"
|
||||
:label="t('params.type')"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
url="ItemCategories"
|
||||
:label="t('params.category')"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="params.categoryId"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
<i18n>
|
||||
en:
|
||||
params:
|
||||
item: Item id
|
||||
buyer: Buyer
|
||||
type: Type
|
||||
category: Category
|
||||
es:
|
||||
params:
|
||||
item: Id artículo
|
||||
buyer: Comprador
|
||||
type: Tipo
|
||||
category: Categoría
|
||||
</i18n>
|
|
@ -56,17 +56,18 @@ const customerContactsRef = ref(null);
|
|||
</div>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QIcon
|
||||
<QBtn
|
||||
@click="customerContactsRef.insert()"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
name="add"
|
||||
size="sm"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add contact') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</QBtn>
|
||||
</VnRow>
|
||||
</QCard>
|
||||
</template>
|
||||
|
|
|
@ -53,6 +53,8 @@ const openDialog = (item) => {
|
|||
promise: updateData,
|
||||
},
|
||||
});
|
||||
updateData();
|
||||
showQPageSticky.value = true;
|
||||
};
|
||||
|
||||
const openViewCredit = (credit) => {
|
||||
|
@ -193,6 +195,7 @@ const updateData = () => {
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New contract') }}
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { QBtn } from 'quasar';
|
||||
|
||||
import { toCurrency, toDateHourMin } from 'src/filters';
|
||||
import VnTable from 'src/components/VnTable/VnTable.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 WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
||||
const clientInformasRef = ref(null);
|
||||
const rows = ref([]);
|
||||
const tableRef = ref();
|
||||
|
||||
const filter = {
|
||||
include: [
|
||||
|
@ -37,10 +31,9 @@ const filter = {
|
|||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
field: 'created',
|
||||
format: (value) => toDateHourMin(value),
|
||||
format: ({ created }) => toDateHourMin(created),
|
||||
label: t('Since'),
|
||||
name: 'since',
|
||||
name: 'created',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -51,66 +44,56 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'right',
|
||||
field: 'rating',
|
||||
label: t('Rating'),
|
||||
label: t('customer.summary.rating'),
|
||||
name: 'rating',
|
||||
create: true,
|
||||
columnCreate: {
|
||||
component: 'number',
|
||||
autofocus: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
field: 'recommendedCredit',
|
||||
format: (value) => toCurrency(value),
|
||||
label: t('Recommended credit'),
|
||||
format: ({ recommendedCredit }) => toCurrency(recommendedCredit),
|
||||
label: t('customer.summary.recommendCredit'),
|
||||
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>
|
||||
<FetchData
|
||||
:filter="filter"
|
||||
@on-fetch="(data) => (rows = data)"
|
||||
auto-load
|
||||
ref="clientInformasRef"
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="ClientInformas"
|
||||
url="ClientInformas"
|
||||
/>
|
||||
|
||||
<FormModel
|
||||
:form-initial-data="{}"
|
||||
:observe-form-changes="false"
|
||||
:url-create="`Clients/${route.params.id}/setRating`"
|
||||
:filter="filter"
|
||||
:order="['created DESC']"
|
||||
:columns="columns"
|
||||
:right-search="false"
|
||||
:is-editable="false"
|
||||
:use-model="true"
|
||||
:column-search="false"
|
||||
:disable-option="{ card: true }"
|
||||
auto-load
|
||||
:create="{
|
||||
urlCreate: `Clients/${route.params.id}/setRating`,
|
||||
title: 'Create rating',
|
||||
onDataSaved: () => tableRef.reload(),
|
||||
formInitialData: {},
|
||||
}"
|
||||
>
|
||||
<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 #column-employee="{ row }">
|
||||
<span class="link">{{ row.worker.user.nickname }}</span>
|
||||
<WorkerDescriptorProxy :id="row.worker.id" />
|
||||
</template>
|
||||
</FormModel>
|
||||
|
||||
<div class="full-width flex justify-center" v-if="rows.length">
|
||||
<QTable
|
||||
</VnTable>
|
||||
<!-- <QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:rows="rows"
|
||||
|
@ -120,22 +103,16 @@ watch(
|
|||
class="card-width q-px-lg"
|
||||
>
|
||||
<template #body-cell-employee="{ row }">
|
||||
<QTd auto-width @click.stop>
|
||||
<QBtn color="blue" flat no-caps>{{ row.worker.user.nickname }}</QBtn>
|
||||
<QTd @click.stop>
|
||||
<span class="link">{{ row.worker.user.nickname }}</span>
|
||||
<WorkerDescriptorProxy :id="row.clientFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
</div>
|
||||
|
||||
<h5 class="flex justify-center color-vn-label" v-else>
|
||||
{{ t('globals.noResults') }}
|
||||
</h5>
|
||||
</QTable> -->
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Rating: Clasificación
|
||||
Recommended credit: Crédito recomendado
|
||||
Since: Desde
|
||||
Employee: Empleado
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
|
|||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { toCurrency, toDate } from 'src/filters';
|
||||
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
|
||||
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
|
||||
|
@ -11,6 +11,10 @@ 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: {
|
||||
|
@ -43,7 +47,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
:subtitle="data.subtitle"
|
||||
@on-fetch="setData"
|
||||
:summary="$props.summary"
|
||||
data-key="customerData"
|
||||
data-key="customer"
|
||||
>
|
||||
<template #menu="{ entity }">
|
||||
<CustomerDescriptorMenu :customer="entity" />
|
||||
|
@ -57,35 +61,46 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
:value="toCurrency(entity.creditInsurance)"
|
||||
/>
|
||||
|
||||
<VnLv :label="t('customer.card.debt')" :value="toCurrency(entity.debt)" />
|
||||
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
|
||||
<VnLv
|
||||
:label="t('customer.card.debt')"
|
||||
:value="toCurrency(entity.debt)"
|
||||
:info="t('customer.summary.riskInfo')"
|
||||
/>
|
||||
<VnLv :label="t('customer.card.salesPerson')">
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="entity.salesPersonUser?.name"
|
||||
v-if="entity.salesPersonUser"
|
||||
: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.businessTypeFk"
|
||||
:value="entity.businessType.description"
|
||||
/>
|
||||
</template>
|
||||
<template #icons="{ entity }">
|
||||
<QCardActions class="q-gutter-x-md">
|
||||
<template #icons>
|
||||
<QCardActions v-if="customer" class="q-gutter-x-md">
|
||||
<QIcon
|
||||
v-if="!entity.isActive"
|
||||
v-if="!customer.isActive"
|
||||
name="vn:disabled"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="entity.isFreezed" name="vn:frozen" size="xs" color="primary">
|
||||
<QIcon
|
||||
v-if="customer.isFreezed"
|
||||
name="vn:frozen"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!entity.account.active"
|
||||
v-if="!customer.account?.active"
|
||||
color="primary"
|
||||
name="vn:noweb"
|
||||
size="xs"
|
||||
|
@ -93,7 +108,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="entity.debt > entity.credit"
|
||||
v-if="customer.debt > customer.credit"
|
||||
name="vn:risk"
|
||||
size="xs"
|
||||
color="primary"
|
||||
|
@ -101,7 +116,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QTooltip>{{ t('customer.card.hasDebt') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!entity.isTaxDataChecked"
|
||||
v-if="!customer.isTaxDataChecked"
|
||||
name="vn:no036"
|
||||
size="xs"
|
||||
color="primary"
|
||||
|
@ -109,7 +124,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QBtn
|
||||
v-if="entity.unpaid"
|
||||
v-if="customer.unpaid"
|
||||
flat
|
||||
size="sm"
|
||||
icon="vn:Client_unpaid"
|
||||
|
@ -121,13 +136,13 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<br />
|
||||
{{
|
||||
t('unpaidDated', {
|
||||
dated: toDate(entity.unpaid.dated),
|
||||
dated: toDate(customer.unpaid.dated),
|
||||
})
|
||||
}}
|
||||
<br />
|
||||
{{
|
||||
t('unpaidAmount', {
|
||||
amount: toCurrency(entity.unpaid.amount),
|
||||
amount: toCurrency(customer.unpaid.amount),
|
||||
})
|
||||
}}
|
||||
</QTooltip>
|
||||
|
@ -139,7 +154,13 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
<QBtn
|
||||
:to="{
|
||||
name: 'TicketList',
|
||||
query: { table: JSON.stringify({ clientFk: entity.id }) },
|
||||
query: {
|
||||
from: undefined,
|
||||
to: undefined,
|
||||
table: JSON.stringify({
|
||||
clientFk: entity.id,
|
||||
}),
|
||||
},
|
||||
}"
|
||||
size="md"
|
||||
icon="vn:ticket"
|
||||
|
@ -160,23 +181,8 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
|||
</QBtn>
|
||||
<QBtn
|
||||
:to="{
|
||||
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 } },
|
||||
}),
|
||||
},
|
||||
name: 'AccountSummary',
|
||||
params: { id: entity.id },
|
||||
}"
|
||||
size="md"
|
||||
icon="face"
|
||||
|
@ -197,7 +203,6 @@ 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
|
||||
Customer unpaid: Cliente impago
|
||||
Unpaid: Impagado
|
||||
|
|
|
@ -8,6 +8,9 @@ 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: {
|
||||
|
@ -40,20 +43,32 @@ 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>
|
||||
<QItem v-ripple clickable @click="openTicketCreateForm()">
|
||||
<QItemSection>
|
||||
<RouterLink
|
||||
:to="{
|
||||
name: 'TicketCreate',
|
||||
query: { clientFk: customer.id },
|
||||
}"
|
||||
class="color-vn-text"
|
||||
>
|
||||
{{ t('Simple ticket') }}
|
||||
</RouterLink>
|
||||
{{ 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>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
|
|
|
@ -236,6 +236,7 @@ const toCustomerFileManagementCreate = () => {
|
|||
@click.stop="toCustomerFileManagementCreate()"
|
||||
color="primary"
|
||||
fab
|
||||
shortcut="+"
|
||||
icon="add"
|
||||
/>
|
||||
<QTooltip>
|
||||
|
|
|
@ -93,8 +93,8 @@ function handleLocation(data, location) {
|
|||
<VnRow>
|
||||
<VnLocation
|
||||
:rules="validate('Worker.postcode')"
|
||||
:roles-allowed-to-create="['deliveryAssistant']"
|
||||
v-model="data.postcode"
|
||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||
:location="data"
|
||||
@update:model-value="(location) => handleLocation(data, location)"
|
||||
/>
|
||||
</VnRow>
|
||||
|
|
|
@ -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: route.params.id,
|
||||
clientFk: entityId,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -47,7 +47,6 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'userFk',
|
||||
label: t('Created by'),
|
||||
component: 'userLink',
|
||||
attrs: ({ row }) => {
|
||||
|
@ -73,6 +72,7 @@ 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 setRows = (data) => {
|
|||
:is-editable="false"
|
||||
:use-model="true"
|
||||
:column-search="false"
|
||||
@on-fetch="(data) => setRows(data)"
|
||||
:disable-option="{ card: true }"
|
||||
:create="{
|
||||
urlCreate: `Greuges`,
|
||||
title: t('New credit'),
|
||||
title: t('New greuge'),
|
||||
onDataSaved: () => tableRef.reload(),
|
||||
formInitialData: { shipped: new Date(), clientFk: route.params.id },
|
||||
}"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue