Merge branch 'dev' into 8443-vehicleEvent
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
ff24971df9
285
CHANGELOG.md
285
CHANGELOG.md
|
@ -1,3 +1,288 @@
|
||||||
|
# Version 25.06 - 2025-02-18
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #7405 remove examples documentation by:jorgep
|
||||||
|
- chore: refs #7405 remove VitePress cache files and update .gitignore by:jorgep
|
||||||
|
- chore: refs #8316 remove search and searchInfo entries from shelving in English and Spanish locales by:jtubau
|
||||||
|
- feat: #8258 added hover and description to uppercase button by:PAU ROVIRA ROSALENY
|
||||||
|
- feat: add addressFk by:Javier Segarra
|
||||||
|
- feat: add inactive car icon by:jorgep
|
||||||
|
- feat: downgrade pnpm by:Javier Segarra
|
||||||
|
- feat: new command by:Javier Segarra
|
||||||
|
- feat: refs #6629 addressObservation by:robert
|
||||||
|
- feat: refs #6629 change values by:robert
|
||||||
|
- feat: refs #6629 customerAddressEdit by:robert
|
||||||
|
- feat: refs #6629 delete consolelog by:robert
|
||||||
|
- feat: refs #6629 traduction message by:robert
|
||||||
|
- feat: refs #6629 update by:robert
|
||||||
|
- feat: refs #6822 by:robert
|
||||||
|
- feat: refs #6822 change request by:robert
|
||||||
|
- feat: refs #6822 change traduction Partial delay (origin/6822-changeTitlePartialDelay) by:robert
|
||||||
|
- feat: refs #6822 redirection by:robert
|
||||||
|
- feat: refs #6943 addressPropagate by:Javier Segarra
|
||||||
|
- feat: refs #6943 updateAndEmit param as object by:Javier Segarra
|
||||||
|
- feat: refs #7065 created unit tests for UserPanel by:provira
|
||||||
|
- feat: refs #7068 created VnVisibleColumns unit test by:Jon
|
||||||
|
- feat: refs #7103 created test for VnSearchbar by:provira
|
||||||
|
- feat: refs #7134 #7124 handle columns by:Javier Segarra
|
||||||
|
- feat: refs #7134 #7124 handle filter by:Javier Segarra
|
||||||
|
- feat: refs #7134 #7134 Create new route by:Javier Segarra
|
||||||
|
- feat: refs #7134 #7134 Create SupplierBalance layout by:Javier Segarra
|
||||||
|
- feat: refs #7134 #7134 split newPayment by:Javier Segarra
|
||||||
|
- feat: refs #7134 add bank by:Javier Segarra
|
||||||
|
- feat: refs #7134 apply supplierBalanceFilter by:Javier Segarra
|
||||||
|
- feat: refs #7134 default currency parameter by:Javier Segarra
|
||||||
|
- feat: refs #7134 minor changes by:Javier Segarra
|
||||||
|
- feat: refs #7134 order by:Javier Segarra
|
||||||
|
- feat: refs #7134 perf VnTable by:Javier Segarra
|
||||||
|
- feat: refs #7134 remove add btn by:Javier Segarra
|
||||||
|
- feat: refs #7134 unremovableParams by:Javier Segarra
|
||||||
|
- feat: refs #7134 use tableFooter by:Javier Segarra
|
||||||
|
- feat: refs #7134 use VnAccountNumber by:Javier Segarra
|
||||||
|
- feat: refs #7134 vnTable setTableFooter by:Javier Segarra
|
||||||
|
- feat: refs #7184 added myTeam filter at WorkerFilter by:Jon
|
||||||
|
- feat: refs #7196 update vite and q-calendar by:alexm
|
||||||
|
- feat: refs #7305 deleted warnings by:Jon
|
||||||
|
- feat: refs #7308 remove warning by:Javier Segarra
|
||||||
|
- feat: refs #7317 deleted warnings in fiscalData and dms by:Jon
|
||||||
|
- feat: refs #7322 add address selection for ticket transfer by:jtubau
|
||||||
|
- feat: refs #7405 add initial documentation and components for Lilium by:jorgep
|
||||||
|
- feat: refs #7405 add navigation links and documentation for useArrayData composable by:jorgep
|
||||||
|
- feat: refs #7826 add error handling and refresh icon to NavBar by:Javier Segarra
|
||||||
|
- feat: refs #8077 change request by:robert
|
||||||
|
- feat: refs #8077 changes request by:robert
|
||||||
|
- feat: refs #8077 sumDefaulter by:robert
|
||||||
|
- feat: refs #8120 added new style to summary popups by:Jon
|
||||||
|
- feat: refs #8120 use new prop in the requierd modules by:Jon
|
||||||
|
- feat: refs #8197 create advancedMenu and add in VnSection by:alexm
|
||||||
|
- feat: refs #8316 added order param by:jtubau
|
||||||
|
- feat: refs #8316 add slots on VnTable from VnFilterPanel by:alexm
|
||||||
|
- feat: refs #8316 parking inside shelving by:alexm
|
||||||
|
- feat: refs #8322 added RouteRoadmap and Agency by:provira
|
||||||
|
- feat: refs #8322 fix route.js and unify with /agency by:alexm
|
||||||
|
- feat: refs #8322 fix route.js and unify with /roadmap by:alexm
|
||||||
|
- feat: refs #8339 define global.spreview by:Javier Segarra
|
||||||
|
- feat: refs #8381 add carrier field to travel thermographs and update localization by:jgallego
|
||||||
|
- feat: refs #8387 changes by:robert
|
||||||
|
- feat: refs #8387 changes request by:robert
|
||||||
|
- feat: refs #8387 crudModel by:robert
|
||||||
|
- feat: refs #8387 refs#8387 change request by:robert
|
||||||
|
- feat: refs #8395 added computed to calculate and display amounts by:provira
|
||||||
|
- feat: refs #8395 added total column in invoiceInVat by:provira
|
||||||
|
- feat: refs #8398 modify previous changes by:robert
|
||||||
|
- feat: refs #8398 moveTicketsFuture by:robert
|
||||||
|
- feat: refs #8409 added VnSelectSupplier by:Jon
|
||||||
|
- feat: refs #8410 added new feature to module searchbar by:provira
|
||||||
|
- feat: refs #8418 add data-cy attribute for print labels button in EntryBuysTableDialog by:jtubau
|
||||||
|
- feat: refs #8450 added new version by:Jon
|
||||||
|
- feat: toCurrency in risk icon by:Javier Segarra
|
||||||
|
- feat: update quasar version by:Javier Segarra
|
||||||
|
- feat: update vitest to 1.0 by:Javier Segarra
|
||||||
|
- feat: update vue to 3.5 by:Javier Segarra
|
||||||
|
- style: customerDescriptor by:Javier Segarra
|
||||||
|
- style: refs #6943 order imports by:Javier Segarra
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- feat: refs #7134 perf VnTable by:Javier Segarra
|
||||||
|
- perf: pnpm-lock by:Javier Segarra
|
||||||
|
- perf: refs #7134 #7134 changes by:Javier Segarra
|
||||||
|
- perf: refs #7134 #7134 fix filter panel by:Javier Segarra
|
||||||
|
- perf: refs #7134 #7134 global dialog newPayment and composable getRisk by:Javier Segarra
|
||||||
|
- perf: refs #7134 currencies fetch by:Javier Segarra
|
||||||
|
- perf: refs #7134 format columns by:Javier Segarra
|
||||||
|
- perf: refs #7134 imports by:Javier Segarra
|
||||||
|
- perf: refs #7134 use ForModelPopup by:Javier Segarra
|
||||||
|
- perf: refs #7134 use map-key by:Javier Segarra
|
||||||
|
- perf: refs #7134 use where to get only EUR currency by:Javier Segarra
|
||||||
|
- perf: refs #7196 update eslint by:alexm
|
||||||
|
- perf: refs #7308 call 1 time useSession by:Javier Segarra
|
||||||
|
- perf: refs #7826 code onError by:Javier Segarra
|
||||||
|
- perf: refs #7826 improve condition by:Javier Segarra
|
||||||
|
- perf: refs #8197 default is object by:alexm
|
||||||
|
- perf: refs #8197 fix and imrpove filters by:alexm
|
||||||
|
- perf: refs #8197 perf by:alexm
|
||||||
|
- perf: refs #8339 minor changes by:Javier Segarra
|
||||||
|
- perf: refs #8339 removew preview tag by:Javier Segarra
|
||||||
|
- perf: use util in OutLayout by:Javier Segarra
|
||||||
|
- perf: vitest to 0.34.0 by:Javier Segarra
|
||||||
|
- refactor: advancedMenu button inside searchbar by:alexm
|
||||||
|
- refactor: move remaining data to descriptorMenu by:Jon
|
||||||
|
- refactor: refs #6822 transferEntry moved to descriptor menu by:robert
|
||||||
|
- refactor: refs #7068 adjust variables by:Jon
|
||||||
|
- refactor: refs #7068 requested changes by:Jon
|
||||||
|
- refactor: refs #7317 requested changes by:Jon
|
||||||
|
- refactor: refs #7322 extract repeated functions and create tests by:jtubau
|
||||||
|
- refactor: refs #7322 update API functions to accept filters for enhanced data retrieval by:jtubau
|
||||||
|
- refactor: refs #7322 update getAgencies to handle client and return default agency by:jtubau
|
||||||
|
- refactor: refs #8120 change prop and classes' names by:Jon
|
||||||
|
- refactor: refs #8120 requested changes by:Jon
|
||||||
|
- refactor: refs #8120 use only defineProps by:Jon
|
||||||
|
- refactor: refs #8316 added shelvingCardBeta and localizations by:jtubau
|
||||||
|
- refactor: refs #8316 add new localization keys and update existing ones for invoiceIn components by:jtubau
|
||||||
|
- refactor: refs #8316 add new localization keys and update existing ones for invoiceOut components by:jtubau
|
||||||
|
- refactor: refs #8316 moved userFilter to array-data-props by:jtubau
|
||||||
|
- refactor: refs #8316 remove invoiceInSearchbar by:alexm
|
||||||
|
- refactor: refs #8316 remove unused ItemTypeSearchbar component by:jtubau
|
||||||
|
- refactor: refs #8316 restore exprBuilder function to filter invoice data by:jtubau
|
||||||
|
- refactor: refs #8316 restore filter for supplier and related entities in InvoiceInCard by:jtubau
|
||||||
|
- refactor: refs #8316 unify router item and itemType by:alexm
|
||||||
|
- refactor: refs #8316 update prefix casing for InvoiceIn component by:jtubau
|
||||||
|
- refactor: refs #8316 update Spanish translations for ItemsFilterPanel by:jtubau
|
||||||
|
- refactor: refs #8316 used VnSection and VnBetaCard by:jtubau
|
||||||
|
- refactor: refs #8316 used VnSection and VnCardBeta by:jtubau
|
||||||
|
- refactor: refs #8316 used VnSection and VnCardBeta on ItemCard by:jtubau
|
||||||
|
- refactor: refs #8322 changed Route component to use VnSection/VnCardBeta by:provira
|
||||||
|
- refactor: refs #8322 changed Travel component to use VnSection/VnCardBeta by:provira
|
||||||
|
- refactor: refs #8351 deleted skip and fixed TicketList e2e by:Jon
|
||||||
|
- refactor: refs #8351 put appropriate name by:Jon
|
||||||
|
- refactor: refs #8380 remove unnecessary stubs in VnImg test wrapper by:jtubau
|
||||||
|
- refactor: refs #8381 update travel data handling in TravelThermographs component by:jgallego
|
||||||
|
- refactor: refs #8409 deleted unused variable by:Jon
|
||||||
|
- refactor: refs #8409 use defineModel instead or defineProps by:Jon
|
||||||
|
- refactor: refs #8410 restructured code by:provira
|
||||||
|
- refactor: refs #8418 remove commented issue reference from myEntry.spec.js by:jtubau
|
||||||
|
- refactor: refs #8418 update data-cy attribute for print labels button in EntryBuysTableDialog by:jtubau
|
||||||
|
- refactor: refs #8418 update selector to use cy.dataCy instead cy.get by:jtubau
|
||||||
|
- refactor: request changes by:Jon
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- feat: refs #8322 fix route.js and unify with /agency by:alexm
|
||||||
|
- feat: refs #8322 fix route.js and unify with /roadmap by:alexm
|
||||||
|
- fix: added witdth when opening summary by:Jon
|
||||||
|
- fix: defineProps not import by:alexm
|
||||||
|
- fix: deleted duplicate request by:Jon
|
||||||
|
- fix: fixed descriptor e2e by:Jon
|
||||||
|
- fix: fixed InvoiceOutList e2e by:Jon
|
||||||
|
- fix: fixed list and e2e by:Jon
|
||||||
|
- fix: fixed pagiante by:Jon
|
||||||
|
- fix: fixed rectificative class by:Jon
|
||||||
|
- fix: fixed states column in claim list and filter by:Jon
|
||||||
|
- fix: fixed VnLocation and warnings by:Jon
|
||||||
|
- fix: fixed wagons e2e (origin/Fix-WagonModuleE2E) by:Jon
|
||||||
|
- fix: fix grid two by:carlossa
|
||||||
|
- fix: improve method (origin/warmfix_reload_scriptIsMissing) by:Javier Segarra
|
||||||
|
- fix: init by:Javier Segarra
|
||||||
|
- fix: minor cli error by:Javier Segarra
|
||||||
|
- fix: modified front to show new field by:Jon
|
||||||
|
- fix: move dialog to descriptorMenu by:Jon
|
||||||
|
- fix: refs #6553 clean pr by:carlossa
|
||||||
|
- fix: refs #6553 fix BeforeMount filters by:carlossa
|
||||||
|
- fix: refs #6553 fix front and translations by:carlossa
|
||||||
|
- fix: refs #6553 fix pr by:carlossa
|
||||||
|
- fix: refs #6553 fix PR, fix vnTableCard by:carlossa
|
||||||
|
- fix: refs #6553 fix qScrollArea by:carlossa
|
||||||
|
- fix: refs #6553 fix summary by:carlossa
|
||||||
|
- fix: refs #6553 fix user-filter by:carlossa
|
||||||
|
- fix: refs #6553 fix vnTable by:carlossa
|
||||||
|
- fix: refs #6553 fix vnTable css by:carlossa
|
||||||
|
- fix: refs #6553 front advanced by:carlossa
|
||||||
|
- fix: refs #6553 front by:carlossa
|
||||||
|
- fix: refs #6553 label css by:carlossa
|
||||||
|
- fix: refs #6553 onBeforeMount by:carlossa
|
||||||
|
- fix: refs #6943 minor changes by:Javier Segarra
|
||||||
|
- fix: refs #6943 redirect when change addressId by:Javier Segarra
|
||||||
|
- fix: refs #6943 required by:Javier Segarra
|
||||||
|
- fix: refs #7065 made consts for repeated values by:provira
|
||||||
|
- fix: refs #7065 removed unnecessary code by:provira
|
||||||
|
- fix: refs #7103 removed unused code on spies by:provira
|
||||||
|
- fix: refs #7103 updated tests for new changes by:provira
|
||||||
|
- fix: refs #7103 used consts for repeated variables by:provira
|
||||||
|
- fix: refs #7134 getRiskComposable by:Javier Segarra
|
||||||
|
- fix: refs #7134 minor change by:Javier Segarra
|
||||||
|
- fix: refs #7134 params filter by:Javier Segarra
|
||||||
|
- fix: refs #7134 remove risk by:Javier Segarra
|
||||||
|
- fix: refs #7134 remove supplierRisk by:Javier Segarra
|
||||||
|
- fix: refs #7134 solve comments by:Javier Segarra
|
||||||
|
- fix: refs #7196 not neccessary by:alexm
|
||||||
|
- fix: refs #7196 sass by:alexm
|
||||||
|
- fix: refs #7322 handle null responses in client, agency and address fetching by:jtubau
|
||||||
|
- fix: refs #7826 init by:Javier Segarra
|
||||||
|
- fix: refs #8120 ticket descriptor & summary by:Jon
|
||||||
|
- fix: refs #8172 Remove unused row and column fields from ParkingBasicData by:guillermo
|
||||||
|
- fix: refs #8197 improve code robustness by adding optional chaining and fixing syntax errors by:alexm
|
||||||
|
- fix: refs #8197 use rightMenu by:alexm
|
||||||
|
- fix: refs #8197 use RightMenu in subsections by:alexm
|
||||||
|
- fix: refs #8227 clean pr (origin/8227-warmfixRoute) by:carlossa
|
||||||
|
- fix: refs #8227 fix front descriptor, Form by:carlossa
|
||||||
|
- fix: refs #8227 warmfix by:carlossa
|
||||||
|
- fix: refs #8316 advanced-menu by:alexm
|
||||||
|
- fix: refs #8316 filter by:alexm
|
||||||
|
- fix: refs #8316 fix broken localizations for entry descriptor menu and items filter panel by:jtubau
|
||||||
|
- fix: refs #8316 icon by:alexm
|
||||||
|
- fix: refs #8316 redirections by:alexm
|
||||||
|
- fix: refs #8316 translations by:alexm
|
||||||
|
- fix: refs #8316 user-filter by:alexm
|
||||||
|
- fix: refs #8322 add userFilter by:alexm
|
||||||
|
- fix: refs #8322 filter and params by:alexm
|
||||||
|
- fix: refs #8322 fixed route creation url by:provira
|
||||||
|
- fix: refs #8322 moved filter inside array-data-props by:provira
|
||||||
|
- fix: refs #8322 use userFilter by:alexm
|
||||||
|
- fix: refs #8347 remove skip, fix unpaid by:carlossa
|
||||||
|
- fix: refs #8352 fix datacy by:carlossa
|
||||||
|
- fix: refs #8352 fix right by:carlossa
|
||||||
|
- fix: refs #8352 fix rightPanel vnLog by:carlossa
|
||||||
|
- fix: refs #8381 update travel data fetching to use correct URL and include necessary fields by:jgallego
|
||||||
|
- fix: refs #8381 update travel data reference in TravelThermographs component by:jgallego
|
||||||
|
- fix: refs #8395 update label for total column by:provira
|
||||||
|
- fix: refs #8409 deleted code due to merge by:Jon
|
||||||
|
- fix: refs #8409 deleted code of merge by:Jon
|
||||||
|
- fix: refs #8410 removed ref from searching boolean by:provira
|
||||||
|
- fix: refs #8410 removed unused code by:provira
|
||||||
|
- fix: refs #8410 removed unused condition by:provira
|
||||||
|
- fix: refs #8410 removed unused ref by:provira
|
||||||
|
- fix: refs #8410 simplified searchModule function by:provira
|
||||||
|
- fix: refs #8418 adjusted route for button click by:jtubau
|
||||||
|
- fix: refs #8418 correct casing in translation keys for supplier reference and issued date labels by:jtubau
|
||||||
|
- fix: refs #8419 modified list and fixed e2e by:Jon
|
||||||
|
- fix: refs #8420 ensure search bar is visible before typing and enable details test by:jtubau
|
||||||
|
- fix: refs #8422 fixed ItemTag e2e test not working by:provira
|
||||||
|
- fix: refs #8422 optimized get and dataCy by:provira
|
||||||
|
- fix: refs #8423 fixed zoneWarehouse e2e test not working by:provira
|
||||||
|
- fix: refs #8423 removed data-cy usage by:provira
|
||||||
|
- fix: refs #8423 used dataCy to get data-cy by:provira
|
||||||
|
- fix: refs #8524 parking section router by:alexm
|
||||||
|
- fix: refs #8524 parking test (origin/8524-devToTest, 8524-devToTest) by:alexm
|
||||||
|
- fix: remove console by:Javier Segarra
|
||||||
|
- fix: replace labels by:Javier Segarra
|
||||||
|
- fix: rightAdvancedMenu by:alexm
|
||||||
|
- fix: routeCard use customUrl by:alexm
|
||||||
|
- fix: show descriptors when click on it by:Javier Segarra
|
||||||
|
- fix: update query parameters for thermograph routing by:jgallego
|
||||||
|
- fix: update selector for buyLabel button in myEntry.spec.js (origin/fix-myEntryTest) by:jtubau
|
||||||
|
- fix: update setupNodeEvents to use async/await for plugin import by:jgallego
|
||||||
|
- fix: use model by:alexm
|
||||||
|
- fix: use rightMenu by:alexm
|
||||||
|
- fix(VnSection): destroy data when unmounted by:alexm
|
||||||
|
- fix(VnSection): refs #8197 check route by:alexm
|
||||||
|
- fix(WorkerBusiness): fix card label by:alexm
|
||||||
|
- fix: workerSummary by:alexm
|
||||||
|
- perf: refs #7134 #7134 fix filter panel by:Javier Segarra
|
||||||
|
- perf: refs #8197 fix and imrpove filters by:alexm
|
||||||
|
- refactor: refs #8316 update prefix casing for InvoiceIn component by:jtubau
|
||||||
|
- refactor: refs #8351 deleted skip and fixed TicketList e2e by:Jon
|
||||||
|
- refs #6553 fix business slot by:carlossa
|
||||||
|
- refs #6553 fix business summary by:carlossa
|
||||||
|
- refs #6553 fix business summary traductions by:carlossa
|
||||||
|
- refs #6553 fix front ibject by:carlossa
|
||||||
|
- refs #6553 fix front trad by:carlossa
|
||||||
|
- refs #6553 fix names by:carlossa
|
||||||
|
- refs #6553 fix reactivateWorker by:carlossa
|
||||||
|
- refs #6553 fix relations by:carlossa
|
||||||
|
- refs #6553 fix VnTable by:carlossa
|
||||||
|
- refs #7917 fix routeCard by:carlossa
|
||||||
|
- revert: refs #7134 change by:Javier Segarra
|
||||||
|
- revert: refs #7134 customer changes by:Javier Segarra
|
||||||
|
- revert: vitest to 0.31.1 by:Javier Segarra
|
||||||
|
- test: fix clientList spec by:Javier Segarra
|
||||||
|
- test: fix component by:Javier Segarra
|
||||||
|
- test: fix VnSearchbar by:alexm
|
||||||
|
- test: refs #6943 fix tests by:Javier Segarra
|
||||||
|
- test: refs #7308 fix axios.spec.js by:Javier Segarra
|
||||||
|
- test: refs #8524 fix by:alexm
|
||||||
|
|
||||||
# Version 25.04 - 2025-01-28
|
# Version 25.04 - 2025-01-28
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -34,6 +34,17 @@ export default defineConfig({
|
||||||
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
||||||
plugin.default(on);
|
plugin.default(on);
|
||||||
|
|
||||||
|
const fs = await import('fs');
|
||||||
|
on('task', {
|
||||||
|
deleteFile(filePath) {
|
||||||
|
if (fs.existsSync(filePath)) {
|
||||||
|
fs.unlinkSync(filePath);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
viewportWidth: 1280,
|
viewportWidth: 1280,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "25.08.0",
|
"version": "25.10.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -9,19 +9,19 @@ export default {
|
||||||
if (!form) return;
|
if (!form) return;
|
||||||
try {
|
try {
|
||||||
const inputsFormCard = form.querySelectorAll(
|
const inputsFormCard = form.querySelectorAll(
|
||||||
`input:not([disabled]):not([type="checkbox"])`
|
`input:not([disabled]):not([type="checkbox"])`,
|
||||||
);
|
);
|
||||||
if (inputsFormCard.length) {
|
if (inputsFormCard.length) {
|
||||||
focusFirstInput(inputsFormCard[0]);
|
focusFirstInput(inputsFormCard[0]);
|
||||||
}
|
}
|
||||||
const textareas = document.querySelectorAll(
|
const textareas = document.querySelectorAll(
|
||||||
'textarea:not([disabled]), [contenteditable]:not([disabled])'
|
'textarea:not([disabled]), [contenteditable]:not([disabled])',
|
||||||
);
|
);
|
||||||
if (textareas.length) {
|
if (textareas.length) {
|
||||||
focusFirstInput(textareas[textareas.length - 1]);
|
focusFirstInput(textareas[textareas.length - 1]);
|
||||||
}
|
}
|
||||||
const inputs = document.querySelectorAll(
|
const inputs = document.querySelectorAll(
|
||||||
'form#formModel input:not([disabled]):not([type="checkbox"])'
|
'form#formModel input:not([disabled]):not([type="checkbox"])',
|
||||||
);
|
);
|
||||||
const input = inputs[0];
|
const input = inputs[0];
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
@ -30,22 +30,5 @@ export default {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
form.addEventListener('keyup', function (evt) {
|
|
||||||
if (evt.key === 'Enter' && !that.$attrs['prevent-submit']) {
|
|
||||||
const input = evt.target;
|
|
||||||
if (input.type == 'textarea' && evt.shiftKey) {
|
|
||||||
evt.preventDefault();
|
|
||||||
let { selectionStart, selectionEnd } = input;
|
|
||||||
input.value =
|
|
||||||
input.value.substring(0, selectionStart) +
|
|
||||||
'\n' +
|
|
||||||
input.value.substring(selectionEnd);
|
|
||||||
selectionStart = selectionEnd = selectionStart + 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
evt.preventDefault();
|
|
||||||
that.onSubmit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectProvince from 'src/components/VnSelectProvince.vue';
|
import VnSelectProvince from 'src/components/VnSelectProvince.vue';
|
||||||
|
@ -21,14 +20,11 @@ const postcodeFormData = reactive({
|
||||||
provinceFk: null,
|
provinceFk: null,
|
||||||
townFk: null,
|
townFk: null,
|
||||||
});
|
});
|
||||||
const townsFetchDataRef = ref(false);
|
|
||||||
const townFilter = ref({});
|
const townFilter = ref({});
|
||||||
|
|
||||||
const countriesRef = ref(false);
|
const countriesRef = ref(false);
|
||||||
const provincesOptions = ref([]);
|
const provincesOptions = ref([]);
|
||||||
const townsOptions = ref([]);
|
|
||||||
const town = ref({});
|
const town = ref({});
|
||||||
const countryFilter = ref({});
|
|
||||||
|
|
||||||
function onDataSaved(formData) {
|
function onDataSaved(formData) {
|
||||||
const newPostcode = {
|
const newPostcode = {
|
||||||
|
@ -51,7 +47,6 @@ async function setCountry(countryFk, data) {
|
||||||
data.townFk = null;
|
data.townFk = null;
|
||||||
data.provinceFk = null;
|
data.provinceFk = null;
|
||||||
data.countryFk = countryFk;
|
data.countryFk = countryFk;
|
||||||
await fetchTowns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Province
|
// Province
|
||||||
|
@ -60,22 +55,11 @@ async function setProvince(id, data) {
|
||||||
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
||||||
if (newProvince) data.countryFk = newProvince.countryFk;
|
if (newProvince) data.countryFk = newProvince.countryFk;
|
||||||
postcodeFormData.provinceFk = id;
|
postcodeFormData.provinceFk = id;
|
||||||
await fetchTowns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onProvinceCreated(data) {
|
async function onProvinceCreated(data) {
|
||||||
postcodeFormData.provinceFk = data.id;
|
postcodeFormData.provinceFk = data.id;
|
||||||
}
|
}
|
||||||
function provinceByCountry(countryFk = postcodeFormData.countryFk) {
|
|
||||||
return provincesOptions.value
|
|
||||||
.filter((province) => province.countryFk === countryFk)
|
|
||||||
.map(({ id }) => id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Town
|
|
||||||
async function handleTowns(data) {
|
|
||||||
townsOptions.value = data;
|
|
||||||
}
|
|
||||||
function setTown(newTown, data) {
|
function setTown(newTown, data) {
|
||||||
town.value = newTown;
|
town.value = newTown;
|
||||||
data.provinceFk = newTown?.provinceFk ?? newTown;
|
data.provinceFk = newTown?.provinceFk ?? newTown;
|
||||||
|
@ -88,18 +72,6 @@ async function onCityCreated(newTown, formData) {
|
||||||
formData.townFk = newTown;
|
formData.townFk = newTown;
|
||||||
setTown(newTown, formData);
|
setTown(newTown, formData);
|
||||||
}
|
}
|
||||||
async function fetchTowns(countryFk = postcodeFormData.countryFk) {
|
|
||||||
if (!countryFk) return;
|
|
||||||
const provinces = postcodeFormData.provinceFk
|
|
||||||
? [postcodeFormData.provinceFk]
|
|
||||||
: provinceByCountry();
|
|
||||||
townFilter.value.where = {
|
|
||||||
provinceFk: {
|
|
||||||
inq: provinces,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
await townsFetchDataRef.value?.fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function filterTowns(name) {
|
async function filterTowns(name) {
|
||||||
if (name !== '') {
|
if (name !== '') {
|
||||||
|
@ -108,22 +80,11 @@ async function filterTowns(name) {
|
||||||
like: `%${name}%`,
|
like: `%${name}%`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
await townsFetchDataRef.value?.fetch();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
ref="townsFetchDataRef"
|
|
||||||
:sort-by="['name ASC']"
|
|
||||||
:limit="30"
|
|
||||||
:filter="townFilter"
|
|
||||||
@on-fetch="handleTowns"
|
|
||||||
auto-load
|
|
||||||
url="Towns/location"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
model="postcode"
|
model="postcode"
|
||||||
|
@ -149,14 +110,13 @@ async function filterTowns(name) {
|
||||||
@filter="filterTowns"
|
@filter="filterTowns"
|
||||||
:tooltip="t('Create city')"
|
:tooltip="t('Create city')"
|
||||||
v-model="data.townFk"
|
v-model="data.townFk"
|
||||||
:options="townsOptions"
|
url="Towns/location"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
:rules="validate('postcode.city')"
|
:rules="validate('postcode.city')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
required
|
required
|
||||||
data-cy="locationTown"
|
data-cy="locationTown"
|
||||||
|
sort-by="name ASC"
|
||||||
>
|
>
|
||||||
<template #option="{ itemProps, opt }">
|
<template #option="{ itemProps, opt }">
|
||||||
<QItem v-bind="itemProps">
|
<QItem v-bind="itemProps">
|
||||||
|
@ -197,16 +157,12 @@ async function filterTowns(name) {
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
ref="countriesRef"
|
ref="countriesRef"
|
||||||
:limit="30"
|
|
||||||
:filter="countryFilter"
|
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
auto-load
|
auto-load
|
||||||
url="Countries"
|
url="Countries"
|
||||||
required
|
required
|
||||||
:label="t('Country')"
|
:label="t('Country')"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.countryFk"
|
v-model="data.countryFk"
|
||||||
:rules="validate('postcode.countryFk')"
|
:rules="validate('postcode.countryFk')"
|
||||||
@update:model-value="(value) => setCountry(value, data)"
|
@update:model-value="(value) => setCountry(value, data)"
|
||||||
|
|
|
@ -62,12 +62,9 @@ const where = computed(() => {
|
||||||
auto-load
|
auto-load
|
||||||
:where="where"
|
:where="where"
|
||||||
url="Autonomies/location"
|
url="Autonomies/location"
|
||||||
:sort-by="['name ASC']"
|
sort-by="name ASC"
|
||||||
:limit="30"
|
|
||||||
:label="t('Autonomy')"
|
:label="t('Autonomy')"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.autonomyFk"
|
v-model="data.autonomyFk"
|
||||||
:rules="validate('province.autonomyFk')"
|
:rules="validate('province.autonomyFk')"
|
||||||
>
|
>
|
||||||
|
|
|
@ -42,7 +42,6 @@ const itemFilter = {
|
||||||
const itemFilterParams = reactive({});
|
const itemFilterParams = reactive({});
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const producersOptions = ref([]);
|
|
||||||
const ItemTypesOptions = ref([]);
|
const ItemTypesOptions = ref([]);
|
||||||
const InksOptions = ref([]);
|
const InksOptions = ref([]);
|
||||||
const tableRows = ref([]);
|
const tableRows = ref([]);
|
||||||
|
@ -121,23 +120,17 @@ const selectItem = ({ id }) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Producers"
|
|
||||||
@on-fetch="(data) => (producersOptions = data)"
|
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="ItemTypes"
|
url="ItemTypes"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
order="name"
|
order="name ASC"
|
||||||
@on-fetch="(data) => (ItemTypesOptions = data)"
|
@on-fetch="(data) => (ItemTypesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Inks"
|
url="Inks"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
order="name"
|
order="name ASC"
|
||||||
@on-fetch="(data) => (InksOptions = data)"
|
@on-fetch="(data) => (InksOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -152,11 +145,11 @@ const selectItem = ({ id }) => {
|
||||||
<VnInput :label="t('entry.buys.size')" v-model="itemFilterParams.size" />
|
<VnInput :label="t('entry.buys.size')" v-model="itemFilterParams.size" />
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.producer')"
|
:label="t('globals.producer')"
|
||||||
:options="producersOptions"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="itemFilterParams.producerFk"
|
v-model="itemFilterParams.producerFk"
|
||||||
|
url="Producers"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
sort-by="name ASC"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.type')"
|
:label="t('globals.type')"
|
||||||
|
|
|
@ -124,7 +124,7 @@ const selectTravel = ({ id }) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
|
import { onMounted, onUnmounted, computed, ref, watch, nextTick, useAttrs } from 'vue';
|
||||||
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
|
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -22,6 +22,7 @@ const { validate } = useValidator();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const myForm = ref(null);
|
const myForm = ref(null);
|
||||||
|
const attrs = useAttrs();
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -106,14 +107,14 @@ const isLoading = ref(false);
|
||||||
const isResetting = ref(false);
|
const isResetting = ref(false);
|
||||||
const hasChanges = ref(!$props.observeFormChanges);
|
const hasChanges = ref(!$props.observeFormChanges);
|
||||||
const originalData = computed(() => state.get(modelValue));
|
const originalData = computed(() => state.get(modelValue));
|
||||||
const formData = ref({});
|
const formData = ref();
|
||||||
const defaultButtons = computed(() => ({
|
const defaultButtons = computed(() => ({
|
||||||
save: {
|
save: {
|
||||||
dataCy: 'saveDefaultBtn',
|
dataCy: 'saveDefaultBtn',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
icon: 'save',
|
icon: 'save',
|
||||||
label: 'globals.save',
|
label: 'globals.save',
|
||||||
click: () => myForm.value.submit(),
|
click: async () => await save(),
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
},
|
},
|
||||||
reset: {
|
reset: {
|
||||||
|
@ -134,7 +135,8 @@ onMounted(async () => {
|
||||||
|
|
||||||
if (!$props.formInitialData) {
|
if (!$props.formInitialData) {
|
||||||
if ($props.autoLoad && $props.url) await fetch();
|
if ($props.autoLoad && $props.url) await fetch();
|
||||||
else if (arrayData.store.data) updateAndEmit('onFetch', arrayData.store.data);
|
else if (arrayData.store.data)
|
||||||
|
updateAndEmit('onFetch', { val: arrayData.store.data });
|
||||||
}
|
}
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
watch(
|
watch(
|
||||||
|
@ -154,7 +156,7 @@ onMounted(async () => {
|
||||||
if (!$props.url)
|
if (!$props.url)
|
||||||
watch(
|
watch(
|
||||||
() => arrayData.store.data,
|
() => arrayData.store.data,
|
||||||
(val) => updateAndEmit('onFetch', val),
|
(val) => updateAndEmit('onFetch', { val }),
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -200,7 +202,7 @@ async function fetch() {
|
||||||
});
|
});
|
||||||
if (Array.isArray(data)) data = data[0] ?? {};
|
if (Array.isArray(data)) data = data[0] ?? {};
|
||||||
|
|
||||||
updateAndEmit('onFetch', data);
|
updateAndEmit('onFetch', { val: data });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
state.set(modelValue, {});
|
state.set(modelValue, {});
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -227,7 +229,11 @@ async function save() {
|
||||||
|
|
||||||
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
|
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
|
||||||
|
|
||||||
updateAndEmit('onDataSaved', formData.value, response?.data);
|
updateAndEmit('onDataSaved', {
|
||||||
|
val: formData.value,
|
||||||
|
res: response?.data,
|
||||||
|
old: originalData.value,
|
||||||
|
});
|
||||||
if ($props.reload) await arrayData.fetch({});
|
if ($props.reload) await arrayData.fetch({});
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -242,7 +248,7 @@ async function saveAndGo() {
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
formData.value = JSON.parse(JSON.stringify(originalData.value));
|
formData.value = JSON.parse(JSON.stringify(originalData.value));
|
||||||
updateAndEmit('onFetch', originalData.value);
|
updateAndEmit('onFetch', { val: originalData.value });
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
isResetting.value = true;
|
isResetting.value = true;
|
||||||
|
@ -264,11 +270,11 @@ function filter(value, update, filterOptions) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateAndEmit(evt, val, res) {
|
function updateAndEmit(evt, { val, res, old } = { val: null, res: null, old: null }) {
|
||||||
state.set(modelValue, val);
|
state.set(modelValue, val);
|
||||||
if (!$props.url) arrayData.store.data = val;
|
if (!$props.url) arrayData.store.data = val;
|
||||||
|
|
||||||
emit(evt, state.get(modelValue), res);
|
emit(evt, state.get(modelValue), res, old);
|
||||||
}
|
}
|
||||||
|
|
||||||
function trimData(data) {
|
function trimData(data) {
|
||||||
|
@ -279,6 +285,22 @@ function trimData(data) {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onKeyup(evt) {
|
||||||
|
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
||||||
|
const input = evt.target;
|
||||||
|
if (input.type == 'textarea' && evt.shiftKey) {
|
||||||
|
let { selectionStart, selectionEnd } = input;
|
||||||
|
input.value =
|
||||||
|
input.value.substring(0, selectionStart) +
|
||||||
|
'\n' +
|
||||||
|
input.value.substring(selectionEnd);
|
||||||
|
selectionStart = selectionEnd = selectionStart + 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
save,
|
save,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
@ -293,12 +315,12 @@ defineExpose({
|
||||||
<QForm
|
<QForm
|
||||||
ref="myForm"
|
ref="myForm"
|
||||||
v-if="formData"
|
v-if="formData"
|
||||||
@submit="save"
|
@submit.prevent
|
||||||
|
@keyup.prevent="onKeyup"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||||
id="formModel"
|
id="formModel"
|
||||||
:prevent-submit="$attrs['prevent-submit']"
|
|
||||||
>
|
>
|
||||||
<QCard>
|
<QCard>
|
||||||
<slot
|
<slot
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
@ -27,10 +27,15 @@ const formModelRef = ref(null);
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isSaveAndContinue = ref(false);
|
const isSaveAndContinue = ref(false);
|
||||||
const onDataSaved = (formData, requestResponse) => {
|
const onDataSaved = (formData, requestResponse) => {
|
||||||
if (closeButton.value && isSaveAndContinue) closeButton.value.click();
|
if (closeButton.value && !isSaveAndContinue.value) closeButton.value.click();
|
||||||
emit('onDataSaved', formData, requestResponse);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onClick = async (saveAndContinue) => {
|
||||||
|
isSaveAndContinue.value = saveAndContinue;
|
||||||
|
await formModelRef.value.save();
|
||||||
|
};
|
||||||
|
|
||||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||||
const reset = computed(() => formModelRef.value?.reset);
|
const reset = computed(() => formModelRef.value?.reset);
|
||||||
|
|
||||||
|
@ -58,19 +63,6 @@ defineExpose({
|
||||||
<p>{{ subtitle }}</p>
|
<p>{{ subtitle }}</p>
|
||||||
<slot name="form-inputs" :data="data" :validate="validate" />
|
<slot name="form-inputs" :data="data" :validate="validate" />
|
||||||
<div class="q-mt-lg row justify-end">
|
<div class="q-mt-lg row justify-end">
|
||||||
<QBtn
|
|
||||||
v-if="showSaveAndContinueBtn"
|
|
||||||
:label="t('globals.isSaveAndContinue')"
|
|
||||||
:title="t('globals.isSaveAndContinue')"
|
|
||||||
type="submit"
|
|
||||||
color="primary"
|
|
||||||
class="q-ml-sm"
|
|
||||||
:disabled="isLoading"
|
|
||||||
:loading="isLoading"
|
|
||||||
data-cy="FormModelPopup_isSaveAndContinue"
|
|
||||||
z-max
|
|
||||||
@click="() => (isSaveAndContinue = true)"
|
|
||||||
/>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.cancel')"
|
:label="t('globals.cancel')"
|
||||||
:title="t('globals.cancel')"
|
:title="t('globals.cancel')"
|
||||||
|
@ -83,23 +75,33 @@ defineExpose({
|
||||||
v-close-popup
|
v-close-popup
|
||||||
z-max
|
z-max
|
||||||
@click="
|
@click="
|
||||||
() => {
|
|
||||||
isSaveAndContinue = false;
|
isSaveAndContinue = false;
|
||||||
emit('onDataCanceled');
|
emit('onDataCanceled');
|
||||||
}
|
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
:flat="showSaveAndContinueBtn"
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
type="submit"
|
@click="onClick(false)"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
data-cy="FormModelPopup_save"
|
data-cy="FormModelPopup_save"
|
||||||
z-max
|
z-max
|
||||||
@click="() => (isSaveAndContinue = false)"
|
/>
|
||||||
|
<QBtn
|
||||||
|
v-if="showSaveAndContinueBtn"
|
||||||
|
:label="t('globals.isSaveAndContinue')"
|
||||||
|
:title="t('globals.isSaveAndContinue')"
|
||||||
|
color="primary"
|
||||||
|
class="q-ml-sm"
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
data-cy="FormModelPopup_isSaveAndContinue"
|
||||||
|
z-max
|
||||||
|
@click="onClick(true)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -121,9 +121,7 @@ const removeTag = (index, params, search) => {
|
||||||
applyTags(params, search);
|
applyTags(params, search);
|
||||||
};
|
};
|
||||||
const setCategoryList = (data) => {
|
const setCategoryList = (data) => {
|
||||||
categoryList.value = (data || [])
|
categoryList.value = (data || []).map((category) => ({
|
||||||
.filter((category) => category.display)
|
|
||||||
.map((category) => ({
|
|
||||||
...category,
|
...category,
|
||||||
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
||||||
}));
|
}));
|
||||||
|
@ -132,12 +130,16 @@ const setCategoryList = (data) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
<FetchData
|
||||||
|
url="ItemCategories"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="setCategoryList"
|
||||||
|
:where="{ display: { neq: 0 } }"
|
||||||
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Tags"
|
url="Tags"
|
||||||
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
||||||
auto-load
|
auto-load
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (tagOptions = data)"
|
@on-fetch="(data) => (tagOptions = data)"
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
|
@ -195,8 +197,6 @@ const setCategoryList = (data) => {
|
||||||
:label="t('components.itemsFilterPanel.typeFk')"
|
:label="t('components.itemsFilterPanel.typeFk')"
|
||||||
v-model="params.typeFk"
|
v-model="params.typeFk"
|
||||||
:options="itemTypesOptions"
|
:options="itemTypesOptions"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -234,7 +234,6 @@ const setCategoryList = (data) => {
|
||||||
:label="t('globals.tag')"
|
:label="t('globals.tag')"
|
||||||
v-model="value.selectedTag"
|
v-model="value.selectedTag"
|
||||||
:options="tagOptions"
|
:options="tagOptions"
|
||||||
option-label="name"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -1,8 +1,22 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { toCurrency } from 'src/filters';
|
||||||
|
|
||||||
defineProps({ row: { type: Object, required: true } });
|
defineProps({ row: { type: Object, required: true } });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<span class="q-gutter-x-xs">
|
<span class="q-gutter-x-xs">
|
||||||
|
<router-link
|
||||||
|
v-if="row.claim?.claimFk"
|
||||||
|
:to="{ name: 'ClaimBasicData', params: { id: row.claim?.claimFk } }"
|
||||||
|
class="link"
|
||||||
|
>
|
||||||
|
<QIcon name="vn:claims" size="xs">
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketSale.claim') }}:
|
||||||
|
{{ row.claim?.claimFk }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</router-link>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row?.risk"
|
v-if="row?.risk"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
|
@ -10,7 +24,8 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
{{ $t('salesTicketsTable.risk') }}:
|
||||||
|
{{ toCurrency(row.risk - row.credit) }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
@ -53,7 +68,7 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!row?.isTaxDataChecked === 0"
|
v-if="row?.isTaxDataChecked !== 0"
|
||||||
name="vn:no036"
|
name="vn:no036"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { markRaw, computed } from 'vue';
|
import { markRaw, computed } from 'vue';
|
||||||
import { QIcon, QCheckbox, QToggle } from 'quasar';
|
import { QIcon, QToggle } from 'quasar';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
|
|
@ -152,7 +152,7 @@ const onTabPressed = async () => {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div v-if="showFilter" class="full-width flex-center" style="overflow: hidden">
|
<div v-if="showFilter" class="full-width" style="overflow: hidden">
|
||||||
<VnColumn
|
<VnColumn
|
||||||
:column="$props.column"
|
:column="$props.column"
|
||||||
default="input"
|
default="input"
|
||||||
|
|
|
@ -23,6 +23,10 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
align: {
|
||||||
|
type: String,
|
||||||
|
default: 'end',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const hover = ref();
|
const hover = ref();
|
||||||
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
const arrayData = useArrayData($props.dataKey, { searchUrl: $props.searchUrl });
|
||||||
|
@ -46,16 +50,27 @@ async function orderBy(name, direction) {
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ orderBy });
|
defineExpose({ orderBy });
|
||||||
|
|
||||||
|
function textAlignToFlex(textAlign) {
|
||||||
|
return `justify-content: ${
|
||||||
|
{
|
||||||
|
'text-center': 'center',
|
||||||
|
'text-left': 'start',
|
||||||
|
'text-right': 'end',
|
||||||
|
}[textAlign] || 'start'
|
||||||
|
};`;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
@mouseenter="hover = true"
|
@mouseenter="hover = true"
|
||||||
@mouseleave="hover = false"
|
@mouseleave="hover = false"
|
||||||
@click="orderBy(name, model?.direction)"
|
@click="orderBy(name, model?.direction)"
|
||||||
class="row items-center no-wrap cursor-pointer title"
|
class="items-center no-wrap cursor-pointer title"
|
||||||
|
:style="textAlignToFlex(align)"
|
||||||
>
|
>
|
||||||
<span :title="label">{{ label }}</span>
|
<span :title="label">{{ label }}</span>
|
||||||
<sup v-if="name && model?.index">
|
<div v-if="name && model?.index">
|
||||||
<QChip
|
<QChip
|
||||||
:label="!vertical ? model?.index : ''"
|
:label="!vertical ? model?.index : ''"
|
||||||
:icon="
|
:icon="
|
||||||
|
@ -92,20 +107,16 @@ defineExpose({ orderBy });
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</QChip>
|
</QChip>
|
||||||
</sup>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: var(--vn-label-color);
|
color: var(--vn-label-color);
|
||||||
}
|
white-space: nowrap;
|
||||||
sup {
|
|
||||||
vertical-align: super; /* Valor predeterminado */
|
|
||||||
/* También puedes usar otros valores como "baseline", "top", "text-top", etc. */
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -10,14 +10,15 @@ import {
|
||||||
render,
|
render,
|
||||||
inject,
|
inject,
|
||||||
useAttrs,
|
useAttrs,
|
||||||
|
nextTick,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar, date } from 'quasar';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useFilterParams } from 'src/composables/useFilterParams';
|
import { useFilterParams } from 'src/composables/useFilterParams';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
|
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
|
@ -164,7 +165,6 @@ const app = inject('app');
|
||||||
const editingRow = ref(null);
|
const editingRow = ref(null);
|
||||||
const editingField = ref(null);
|
const editingField = ref(null);
|
||||||
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
||||||
const showRightIcon = computed(() => $props.rightSearch || $props.rightSearchIcon);
|
|
||||||
const selectRegex = /select/;
|
const selectRegex = /select/;
|
||||||
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
|
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
|
||||||
const tableModes = [
|
const tableModes = [
|
||||||
|
@ -340,11 +340,12 @@ const clickHandler = async (event) => {
|
||||||
|
|
||||||
const isDateElement = event.target.closest('.q-date');
|
const isDateElement = event.target.closest('.q-date');
|
||||||
const isTimeElement = event.target.closest('.q-time');
|
const isTimeElement = event.target.closest('.q-time');
|
||||||
|
const isQselectDropDown = event.target.closest('.q-select__dropdown-icon');
|
||||||
|
|
||||||
if (isDateElement || isTimeElement) return;
|
if (isDateElement || isTimeElement || isQselectDropDown) return;
|
||||||
|
|
||||||
if (clickedElement === null) {
|
if (clickedElement === null) {
|
||||||
destroyInput(editingRow.value, editingField.value);
|
await destroyInput(editingRow.value, editingField.value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const rowIndex = clickedElement.getAttribute('data-row-index');
|
const rowIndex = clickedElement.getAttribute('data-row-index');
|
||||||
|
@ -352,19 +353,19 @@ const clickHandler = async (event) => {
|
||||||
const column = $props.columns.find((col) => col.name === colField);
|
const column = $props.columns.find((col) => col.name === colField);
|
||||||
|
|
||||||
if (editingRow.value !== null && editingField.value !== null) {
|
if (editingRow.value !== null && editingField.value !== null) {
|
||||||
if (editingRow.value === rowIndex && editingField.value === colField) {
|
if (editingRow.value == rowIndex && editingField.value == colField) return;
|
||||||
return;
|
|
||||||
|
await destroyInput(editingRow.value, editingField.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroyInput(editingRow.value, editingField.value);
|
if (isEditableColumn(column)) {
|
||||||
}
|
|
||||||
if (isEditableColumn(column))
|
|
||||||
await renderInput(Number(rowIndex), colField, clickedElement);
|
await renderInput(Number(rowIndex), colField, clickedElement);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function handleTabKey(event, rowIndex, colField) {
|
async function handleTabKey(event, rowIndex, colField) {
|
||||||
if (editingRow.value == rowIndex && editingField.value == colField)
|
if (editingRow.value == rowIndex && editingField.value == colField)
|
||||||
destroyInput(editingRow.value, editingField.value);
|
await destroyInput(editingRow.value, editingField.value);
|
||||||
|
|
||||||
const direction = event.shiftKey ? -1 : 1;
|
const direction = event.shiftKey ? -1 : 1;
|
||||||
const { nextRowIndex, nextColumnName } = await handleTabNavigation(
|
const { nextRowIndex, nextColumnName } = await handleTabNavigation(
|
||||||
|
@ -411,7 +412,7 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
focusOnMount: true,
|
focusOnMount: true,
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
'update:modelValue': async (value) => {
|
'update:modelValue': async (value) => {
|
||||||
if (isSelect) {
|
if (isSelect && value) {
|
||||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
row[column?.name + 'TextValue'] =
|
row[column?.name + 'TextValue'] =
|
||||||
value[column.attrs?.optionLabel ?? 'name'];
|
value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
@ -424,7 +425,8 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
||||||
},
|
},
|
||||||
keyup: async (event) => {
|
keyup: async (event) => {
|
||||||
if (event.key === 'Enter') handleBlur(rowId, field, clickedElement);
|
if (event.key === 'Enter')
|
||||||
|
await destroyInput(rowIndex, field, clickedElement);
|
||||||
},
|
},
|
||||||
keydown: async (event) => {
|
keydown: async (event) => {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
@ -433,7 +435,7 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
case 'Escape':
|
case 'Escape':
|
||||||
destroyInput(rowId, field, clickedElement);
|
await destroyInput(rowId, field, clickedElement);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -448,16 +450,20 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
node.appContext = app._context;
|
node.appContext = app._context;
|
||||||
render(node, clickedElement);
|
render(node, clickedElement);
|
||||||
|
|
||||||
if (['checkbox', 'toggle', undefined].includes(column?.component))
|
if (['toggle'].includes(column?.component))
|
||||||
node.el?.querySelector('span > div').focus();
|
node.el?.querySelector('span > div').focus();
|
||||||
|
|
||||||
|
if (['checkbox', undefined].includes(column?.component))
|
||||||
|
node.el?.querySelector('span > div > div').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyInput(rowIndex, field, clickedElement) {
|
async function destroyInput(rowIndex, field, clickedElement) {
|
||||||
if (!clickedElement)
|
if (!clickedElement)
|
||||||
clickedElement = document.querySelector(
|
clickedElement = document.querySelector(
|
||||||
`[data-row-index="${rowIndex}"][data-col-field="${field}"]`,
|
`[data-row-index="${rowIndex}"][data-col-field="${field}"]`,
|
||||||
);
|
);
|
||||||
if (clickedElement) {
|
if (clickedElement) {
|
||||||
|
await nextTick();
|
||||||
render(null, clickedElement);
|
render(null, clickedElement);
|
||||||
Array.from(clickedElement.childNodes).forEach((child) => {
|
Array.from(clickedElement.childNodes).forEach((child) => {
|
||||||
child.style.visibility = 'visible';
|
child.style.visibility = 'visible';
|
||||||
|
@ -469,10 +475,6 @@ function destroyInput(rowIndex, field, clickedElement) {
|
||||||
editingField.value = null;
|
editingField.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleBlur(rowIndex, field, clickedElement) {
|
|
||||||
destroyInput(rowIndex, field, clickedElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleTabNavigation(rowIndex, colName, direction) {
|
async function handleTabNavigation(rowIndex, colName, direction) {
|
||||||
const columns = $props.columns;
|
const columns = $props.columns;
|
||||||
const totalColumns = columns.length;
|
const totalColumns = columns.length;
|
||||||
|
@ -488,9 +490,7 @@ async function handleTabNavigation(rowIndex, colName, direction) {
|
||||||
if (isEditableColumn(columns[newColumnIndex])) break;
|
if (isEditableColumn(columns[newColumnIndex])) break;
|
||||||
} while (iterations < totalColumns);
|
} while (iterations < totalColumns);
|
||||||
|
|
||||||
if (iterations >= totalColumns) {
|
if (iterations >= totalColumns + 1) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (direction === 1 && newColumnIndex <= currentColumnIndex) {
|
if (direction === 1 && newColumnIndex <= currentColumnIndex) {
|
||||||
rowIndex++;
|
rowIndex++;
|
||||||
|
@ -525,11 +525,38 @@ function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
} else {
|
} else {
|
||||||
return col.format(row, dashIfEmpty);
|
return col.format(row, dashIfEmpty);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return dashIfEmpty(row[col?.name]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (col?.component === 'date') return dashIfEmpty(toDate(row[col?.name]));
|
||||||
|
|
||||||
|
if (col?.component === 'time')
|
||||||
|
return row[col?.name] >= 5
|
||||||
|
? dashIfEmpty(date.formatDate(new Date(row[col?.name]), 'HH:mm'))
|
||||||
|
: row[col?.name];
|
||||||
|
|
||||||
|
if (selectRegex.test(col?.component) && $props.isEditable) {
|
||||||
|
const { find, url } = col.attrs;
|
||||||
|
const urlRelation = url?.charAt(0)?.toLocaleLowerCase() + url?.slice(1, -1);
|
||||||
|
|
||||||
|
if (col?.attrs.options) {
|
||||||
|
const find = col?.attrs.options.find((option) => option.id === row[col.name]);
|
||||||
|
if (!col.attrs?.optionLabel || !find) return dashIfEmpty(row[col?.name]);
|
||||||
|
return dashIfEmpty(find[col.attrs?.optionLabel ?? 'name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof row[urlRelation] == 'object') {
|
||||||
|
if (typeof find == 'object')
|
||||||
|
return dashIfEmpty(row[urlRelation][find?.label ?? 'name']);
|
||||||
|
|
||||||
|
return dashIfEmpty(row[urlRelation][col?.attrs.optionLabel ?? 'name']);
|
||||||
|
}
|
||||||
|
if (typeof row[urlRelation] == 'string') return dashIfEmpty(row[urlRelation]);
|
||||||
|
}
|
||||||
|
return dashIfEmpty(row[col?.name]);
|
||||||
|
}
|
||||||
|
function cardClick(_, row) {
|
||||||
|
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
||||||
}
|
}
|
||||||
const checkbox = ref(null);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDrawer
|
<QDrawer
|
||||||
|
@ -593,6 +620,7 @@ const checkbox = ref(null);
|
||||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||||
@update:selected="emit('update:selected', $event)"
|
@update:selected="emit('update:selected', $event)"
|
||||||
@selection="(details) => handleSelection(details, rows)"
|
@selection="(details) => handleSelection(details, rows)"
|
||||||
|
:hide-selected-banner="true"
|
||||||
>
|
>
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
<slot name="top-left"> </slot>
|
<slot name="top-left"> </slot>
|
||||||
|
@ -612,29 +640,21 @@ const checkbox = ref(null);
|
||||||
dense
|
dense
|
||||||
:options="tableModes.filter((mode) => !mode.disable)"
|
:options="tableModes.filter((mode) => !mode.disable)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QBtn
|
|
||||||
v-if="showRightIcon"
|
|
||||||
icon="filter_alt"
|
|
||||||
class="bg-vn-section-color q-ml-sm"
|
|
||||||
dense
|
|
||||||
@click="stateStore.toggleRightDrawer()"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template #header-cell="{ col }">
|
<template #header-cell="{ col }">
|
||||||
<QTh
|
<QTh
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
|
v-bind:class="col.headerClass"
|
||||||
class="body-cell"
|
class="body-cell"
|
||||||
:style="col?.width ? `max-width: ${col?.width}` : ''"
|
:style="col?.width ? `max-width: ${col?.width}` : ''"
|
||||||
style="padding: inherit"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="no-padding"
|
class="no-padding"
|
||||||
:style="
|
:style="[
|
||||||
withFilters && $props.columnSearch ? 'height: 75px' : ''
|
withFilters && $props.columnSearch ? 'height: 75px' : '',
|
||||||
"
|
]"
|
||||||
>
|
>
|
||||||
<div class="text-center" style="height: 30px">
|
<div style="height: 30px">
|
||||||
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip>
|
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip>
|
||||||
<VnTableOrder
|
<VnTableOrder
|
||||||
v-model="orders[col.orderBy ?? col.name]"
|
v-model="orders[col.orderBy ?? col.name]"
|
||||||
|
@ -642,6 +662,7 @@ const checkbox = ref(null);
|
||||||
:label="col?.labelAbbreviation ?? col?.label"
|
:label="col?.labelAbbreviation ?? col?.label"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
|
:align="getColAlign(col)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<VnFilter
|
<VnFilter
|
||||||
|
@ -723,7 +744,11 @@ const checkbox = ref(null);
|
||||||
<span
|
<span
|
||||||
v-else
|
v-else
|
||||||
:class="hasEditableFormat(col)"
|
:class="hasEditableFormat(col)"
|
||||||
:style="col?.style ? col.style(row) : null"
|
:style="
|
||||||
|
typeof col?.style == 'function'
|
||||||
|
? col.style(row)
|
||||||
|
: col?.style
|
||||||
|
"
|
||||||
style="bottom: 0"
|
style="bottom: 0"
|
||||||
>
|
>
|
||||||
{{ formatColumnValue(col, row, dashIfEmpty) }}
|
{{ formatColumnValue(col, row, dashIfEmpty) }}
|
||||||
|
@ -750,7 +775,7 @@ const checkbox = ref(null);
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
:class="
|
:class="
|
||||||
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
btn.isPrimary ? 'text-primary-light' : 'color-vn-label'
|
||||||
"
|
"
|
||||||
:style="`visibility: ${
|
:style="`visibility: ${
|
||||||
((btn.show && btn.show(row)) ?? true)
|
((btn.show && btn.show(row)) ?? true)
|
||||||
|
@ -758,23 +783,19 @@ const checkbox = ref(null);
|
||||||
: 'hidden'
|
: 'hidden'
|
||||||
}`"
|
}`"
|
||||||
@click="btn.action(row)"
|
@click="btn.action(row)"
|
||||||
|
:data-cy="btn?.name ?? `tableAction-${index}`"
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #item="{ row, colsMap }">
|
<template #item="{ row, colsMap }">
|
||||||
<component
|
<component
|
||||||
:is="$props.redirect ? 'router-link' : 'span'"
|
v-bind:is="'div'"
|
||||||
:to="`/${$props.redirect}/` + row.id"
|
@click="(event) => cardClick(event, row)"
|
||||||
>
|
>
|
||||||
<QCard
|
<QCard
|
||||||
bordered
|
bordered
|
||||||
flat
|
flat
|
||||||
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
||||||
@click="
|
|
||||||
(_, row) => {
|
|
||||||
$props.rowClick && $props.rowClick(row);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
style="height: 100%"
|
style="height: 100%"
|
||||||
>
|
>
|
||||||
<QCardSection
|
<QCardSection
|
||||||
|
@ -811,7 +832,7 @@ const checkbox = ref(null);
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<!-- Fields -->
|
<!-- Fields -->
|
||||||
<QCardSection
|
<QCardSection
|
||||||
class="q-pl-sm q-pr-lg q-py-xs"
|
class="q-pl-sm q-py-xs"
|
||||||
:class="$props.cardClass"
|
:class="$props.cardClass"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
@ -858,13 +879,14 @@ const checkbox = ref(null);
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="btn.title"
|
:title="btn.title"
|
||||||
:icon="btn.icon"
|
:icon="btn.icon"
|
||||||
|
data-cy="cardBtn"
|
||||||
class="q-pa-xs"
|
class="q-pa-xs"
|
||||||
flat
|
|
||||||
:class="
|
:class="
|
||||||
btn.isPrimary
|
btn.isPrimary
|
||||||
? 'text-primary-light'
|
? 'text-primary-light'
|
||||||
: 'color-vn-text '
|
: 'color-vn-label'
|
||||||
"
|
"
|
||||||
|
flat
|
||||||
@click="btn.action(row)"
|
@click="btn.action(row)"
|
||||||
/>
|
/>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
|
@ -1022,8 +1044,8 @@ es:
|
||||||
}
|
}
|
||||||
|
|
||||||
.body-cell {
|
.body-cell {
|
||||||
padding-left: 2px !important;
|
padding-left: 4px !important;
|
||||||
padding-right: 2px !important;
|
padding-right: 4px !important;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.bg-chip-secondary {
|
.bg-chip-secondary {
|
||||||
|
@ -1042,8 +1064,8 @@ es:
|
||||||
|
|
||||||
.grid-three {
|
.grid-three {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(300px, max-content));
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
@ -1117,6 +1139,7 @@ es:
|
||||||
.vn-label-value {
|
.vn-label-value {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
.value {
|
.value {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -57,6 +57,7 @@ describe('FormModel', () => {
|
||||||
vm.state.set(model, formInitialData);
|
vm.state.set(model, formInitialData);
|
||||||
expect(vm.hasChanges).toBe(false);
|
expect(vm.hasChanges).toBe(false);
|
||||||
|
|
||||||
|
await vm.$nextTick();
|
||||||
vm.formData.mockKey = 'newVal';
|
vm.formData.mockKey = 'newVal';
|
||||||
await vm.$nextTick();
|
await vm.$nextTick();
|
||||||
expect(vm.hasChanges).toBe(true);
|
expect(vm.hasChanges).toBe(true);
|
||||||
|
@ -94,8 +95,12 @@ describe('FormModel', () => {
|
||||||
it('should call axios.patch with the right data', async () => {
|
it('should call axios.patch with the right data', async () => {
|
||||||
const spy = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
const spy = vi.spyOn(axios, 'patch').mockResolvedValue({ data: {} });
|
||||||
const { vm } = mount({ propsData: { url, model } });
|
const { vm } = mount({ propsData: { url, model } });
|
||||||
vm.formData.mockKey = 'newVal';
|
|
||||||
|
vm.formData = {};
|
||||||
await vm.$nextTick();
|
await vm.$nextTick();
|
||||||
|
vm.formData = { mockKey: 'newVal' };
|
||||||
|
await vm.$nextTick();
|
||||||
|
|
||||||
await vm.save();
|
await vm.save();
|
||||||
expect(spy).toHaveBeenCalled();
|
expect(spy).toHaveBeenCalled();
|
||||||
vm.formData.mockKey = 'mockVal';
|
vm.formData.mockKey = 'mockVal';
|
||||||
|
|
|
@ -39,6 +39,13 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
|
if (hasRouteParam(to.params)) {
|
||||||
|
const { matched } = router.currentRoute.value;
|
||||||
|
const { name } = matched.at(-3);
|
||||||
|
if (name) {
|
||||||
|
router.push({ name, params: to.params });
|
||||||
|
}
|
||||||
|
}
|
||||||
const id = to.params.id;
|
const id = to.params.id;
|
||||||
if (id !== from.params.id) await fetch(id, true);
|
if (id !== from.params.id) await fetch(id, true);
|
||||||
});
|
});
|
||||||
|
@ -50,6 +57,9 @@ async function fetch(id, append = false) {
|
||||||
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
||||||
await arrayData.fetch({ append, updateRouter: false });
|
await arrayData.fetch({ append, updateRouter: false });
|
||||||
}
|
}
|
||||||
|
function hasRouteParam(params, valueToCheck = ':addressId') {
|
||||||
|
return Object.values(params).includes(valueToCheck);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#left-panel" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#left-panel" v-if="stateStore.isHeaderMounted()">
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
colors: {
|
colors: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '{"value":[]}',
|
default: '{"value": []}',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ const maxHeight = 30;
|
||||||
const colorHeight = maxHeight / colorArray?.length;
|
const colorHeight = maxHeight / colorArray?.length;
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="color-div" :style="{ height: `${maxHeight}px` }">
|
<div v-if="colors" class="color-div" :style="{ height: `${maxHeight}px` }">
|
||||||
<div
|
<div
|
||||||
v-for="(color, index) in colorArray"
|
v-for="(color, index) in colorArray"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|
|
@ -48,7 +48,8 @@ function toValueAttrs(attrs) {
|
||||||
<span
|
<span
|
||||||
v-for="toComponent of componentArray"
|
v-for="toComponent of componentArray"
|
||||||
:key="toComponent.name"
|
:key="toComponent.name"
|
||||||
class="column flex-center fit"
|
class="column fit"
|
||||||
|
:class="toComponent?.component == 'checkbox' ? 'flex-center' : ''"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
v-if="toComponent?.component"
|
v-if="toComponent?.component"
|
||||||
|
|
|
@ -107,6 +107,7 @@ const manageDate = (date) => {
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
@keydown="isPopupOpen = false"
|
@keydown="isPopupOpen = false"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_inputDate'"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -85,6 +85,7 @@ const handleModelValue = (data) => {
|
||||||
:tooltip="t('Create new location')"
|
:tooltip="t('Create new location')"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:lazy-rules="true"
|
:lazy-rules="true"
|
||||||
|
required
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewPostcode
|
<CreateNewPostcode
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useClipboard } from 'src/composables/useClipboard';
|
||||||
import VnMoreOptions from './VnMoreOptions.vue';
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -29,10 +30,6 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
module: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
summary: {
|
summary: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -46,6 +43,7 @@ const $props = defineProps({
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { copyText } = useClipboard();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
let arrayData;
|
let arrayData;
|
||||||
let store;
|
let store;
|
||||||
|
@ -103,6 +101,14 @@ function getValueFromPath(path) {
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyIdText(id) {
|
||||||
|
copyText(id, {
|
||||||
|
component: {
|
||||||
|
copyValue: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const iconModule = computed(() => route.matched[1].meta.icon);
|
const iconModule = computed(() => route.matched[1].meta.icon);
|
||||||
|
@ -148,7 +154,9 @@ const toModule = computed(() =>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<RouterLink :to="{ name: `${module}Summary`, params: { id: entity.id } }">
|
<RouterLink
|
||||||
|
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
|
||||||
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
class="link"
|
class="link"
|
||||||
color="white"
|
color="white"
|
||||||
|
@ -184,10 +192,25 @@ const toModule = computed(() =>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItem dense>
|
<QItem>
|
||||||
<QItemLabel class="subtitle" caption>
|
<QItemLabel class="subtitle">
|
||||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
|
|
||||||
|
<QBtn
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="sm"
|
||||||
|
icon="content_copy"
|
||||||
|
color="primary"
|
||||||
|
@click.stop="copyIdText(entity.id)"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('globals.copyId') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
<!-- </QItemLabel> -->
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
<div class="list-box q-mt-xs">
|
<div class="list-box q-mt-xs">
|
||||||
|
@ -294,3 +317,11 @@ const toModule = computed(() =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
globals:
|
||||||
|
copyId: Copy ID
|
||||||
|
es:
|
||||||
|
globals:
|
||||||
|
copyId: Copiar ID
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -53,3 +53,8 @@ const manaCode = ref(props.manaCode);
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Promotion mana: Maná promoción
|
||||||
|
Claim mana: Maná reclamación
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
|
import { useRequired } from '../useRequired';
|
||||||
|
|
||||||
|
vi.mock('../useValidator', () => ({
|
||||||
|
useValidator: () => ({
|
||||||
|
validations: () => ({
|
||||||
|
required: vi.fn((isRequired, val) => {
|
||||||
|
if (!isRequired) return true;
|
||||||
|
return val !== null && val !== undefined && val !== '';
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('useRequired', () => {
|
||||||
|
it('should detect required when attr is boolean true', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should detect required when attr is boolean false', () => {
|
||||||
|
const attrs = { required: false };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should detect required when attr exists without value', () => {
|
||||||
|
const attrs = { required: '' };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false when required attr does not exist', () => {
|
||||||
|
const attrs = { someOtherAttr: 'value' };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('requiredFieldRule', () => {
|
||||||
|
it('should validate required field with value', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule('some value')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should validate required field with empty value', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule('')).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should pass validation when field is not required', () => {
|
||||||
|
const attrs = { required: false };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule('')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle null and undefined values', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule(null)).toBe(false);
|
||||||
|
expect(requiredFieldRule(undefined)).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,13 +1,14 @@
|
||||||
export function getColAlign(col) {
|
export function getColAlign(col) {
|
||||||
let align;
|
let align;
|
||||||
switch (col.component) {
|
switch (col.component) {
|
||||||
|
case 'time':
|
||||||
|
case 'date':
|
||||||
case 'select':
|
case 'select':
|
||||||
align = 'left';
|
align = 'left';
|
||||||
break;
|
break;
|
||||||
case 'number':
|
case 'number':
|
||||||
align = 'right';
|
align = 'right';
|
||||||
break;
|
break;
|
||||||
case 'date':
|
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
align = 'center';
|
align = 'center';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,6 +11,7 @@ export async function useCau(res, message) {
|
||||||
const { config, headers, request, status, statusText, data } = res || {};
|
const { config, headers, request, status, statusText, data } = res || {};
|
||||||
const { params, url, method, signal, headers: confHeaders } = config || {};
|
const { params, url, method, signal, headers: confHeaders } = config || {};
|
||||||
const { message: resMessage, code, name } = data?.error || {};
|
const { message: resMessage, code, name } = data?.error || {};
|
||||||
|
delete confHeaders?.Authorization;
|
||||||
|
|
||||||
const additionalData = {
|
const additionalData = {
|
||||||
path: location.hash,
|
path: location.hash,
|
||||||
|
@ -40,7 +41,7 @@ export async function useCau(res, message) {
|
||||||
handler: async () => {
|
handler: async () => {
|
||||||
const locale = i18n.global.t;
|
const locale = i18n.global.t;
|
||||||
const reason = ref(
|
const reason = ref(
|
||||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
|
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : '',
|
||||||
);
|
);
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
locale('cau.title'),
|
locale('cau.title'),
|
||||||
|
@ -59,10 +60,9 @@ export async function useCau(res, message) {
|
||||||
'onUpdate:modelValue': (val) => (reason.value = val),
|
'onUpdate:modelValue': (val) => (reason.value = val),
|
||||||
label: locale('cau.inputLabel'),
|
label: locale('cau.inputLabel'),
|
||||||
class: 'full-width',
|
class: 'full-width',
|
||||||
required: true,
|
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,14 +2,10 @@ import { useValidator } from 'src/composables/useValidator';
|
||||||
|
|
||||||
export function useRequired($attrs) {
|
export function useRequired($attrs) {
|
||||||
const { validations } = useValidator();
|
const { validations } = useValidator();
|
||||||
const hasRequired = Object.keys($attrs).includes('required');
|
const isRequired =
|
||||||
let isRequired = false;
|
typeof $attrs['required'] === 'boolean'
|
||||||
if (hasRequired) {
|
? $attrs['required']
|
||||||
const required = $attrs['required'];
|
: Object.keys($attrs).includes('required');
|
||||||
if (typeof required === 'boolean') {
|
|
||||||
isRequired = required;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const requiredFieldRule = (val) => validations().required(isRequired, val);
|
const requiredFieldRule = (val) => validations().required(isRequired, val);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -335,3 +335,7 @@ input::-webkit-inner-spin-button {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
box-shadow: 0 4px 6px #00000000;
|
box-shadow: 0 4px 6px #00000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.containerShrinked {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { useI18n } from 'vue-i18n';
|
||||||
export default function (value, options = {}) {
|
export default function (value, options = {}) {
|
||||||
if (!value) return;
|
if (!value) return;
|
||||||
|
|
||||||
|
if (!isValidDate(value)) return null;
|
||||||
|
|
||||||
if (!options.dateStyle && !options.timeStyle) {
|
if (!options.dateStyle && !options.timeStyle) {
|
||||||
options.day = '2-digit';
|
options.day = '2-digit';
|
||||||
options.month = '2-digit';
|
options.month = '2-digit';
|
||||||
|
@ -10,7 +12,12 @@ export default function (value, options = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
const date = new Date(value);
|
const newDate = new Date(value);
|
||||||
|
|
||||||
return new Intl.DateTimeFormat(locale.value, options).format(date);
|
return new Intl.DateTimeFormat(locale.value, options).format(newDate);
|
||||||
|
}
|
||||||
|
// handle 0000-00-00
|
||||||
|
function isValidDate(date) {
|
||||||
|
const parsedDate = new Date(date);
|
||||||
|
return parsedDate instanceof Date && !isNaN(parsedDate.getTime());
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ globals:
|
||||||
rowRemoved: Row removed
|
rowRemoved: Row removed
|
||||||
pleaseWait: Please wait...
|
pleaseWait: Please wait...
|
||||||
noPinnedModules: You don't have any pinned modules
|
noPinnedModules: You don't have any pinned modules
|
||||||
|
enterToConfirm: Press Enter to confirm
|
||||||
summary:
|
summary:
|
||||||
basicData: Basic data
|
basicData: Basic data
|
||||||
daysOnward: Days onward
|
daysOnward: Days onward
|
||||||
|
@ -156,6 +157,7 @@ globals:
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: No data available
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
@ -829,6 +831,8 @@ travel:
|
||||||
CloneTravelAndEntries: Clone travel and his entries
|
CloneTravelAndEntries: Clone travel and his entries
|
||||||
deleteTravel: Delete travel
|
deleteTravel: Delete travel
|
||||||
AddEntry: Add entry
|
AddEntry: Add entry
|
||||||
|
availabled: Availabled
|
||||||
|
availabledHour: Availabled hour
|
||||||
thermographs: Thermographs
|
thermographs: Thermographs
|
||||||
hb: HB
|
hb: HB
|
||||||
basicData:
|
basicData:
|
||||||
|
|
|
@ -51,6 +51,7 @@ globals:
|
||||||
pleaseWait: Por favor espera...
|
pleaseWait: Por favor espera...
|
||||||
noPinnedModules: No has fijado ningún módulo
|
noPinnedModules: No has fijado ningún módulo
|
||||||
split: Split
|
split: Split
|
||||||
|
enterToConfirm: Pulsa Enter para confirmar
|
||||||
summary:
|
summary:
|
||||||
basicData: Datos básicos
|
basicData: Datos básicos
|
||||||
daysOnward: Días adelante
|
daysOnward: Días adelante
|
||||||
|
@ -160,6 +161,7 @@ globals:
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: Datos no disponibles
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
@ -838,6 +840,7 @@ supplier:
|
||||||
verified: Verificado
|
verified: Verificado
|
||||||
isActive: Está activo
|
isActive: Está activo
|
||||||
billingData: Forma de pago
|
billingData: Forma de pago
|
||||||
|
financialData: Datos financieros
|
||||||
payDeadline: Plazo de pago
|
payDeadline: Plazo de pago
|
||||||
payDay: Día de pago
|
payDay: Día de pago
|
||||||
account: Cuenta
|
account: Cuenta
|
||||||
|
@ -915,6 +918,8 @@ travel:
|
||||||
deleteTravel: Eliminar envío
|
deleteTravel: Eliminar envío
|
||||||
AddEntry: Añadir entrada
|
AddEntry: Añadir entrada
|
||||||
thermographs: Termógrafos
|
thermographs: Termógrafos
|
||||||
|
availabled: F. Disponible
|
||||||
|
availabledHour: Hora Disponible
|
||||||
hb: HB
|
hb: HB
|
||||||
basicData:
|
basicData:
|
||||||
daysInForward: Desplazamiento automatico (redada)
|
daysInForward: Desplazamiento automatico (redada)
|
||||||
|
|
|
@ -51,7 +51,6 @@ const removeAlias = () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`MailAliases/${entityId}`"
|
:url="`MailAliases/${entityId}`"
|
||||||
module="Alias"
|
|
||||||
data-key="Alias"
|
data-key="Alias"
|
||||||
title="alias"
|
title="alias"
|
||||||
>
|
>
|
||||||
|
|
|
@ -24,7 +24,6 @@ onMounted(async () => {
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`VnUsers/preview`"
|
:url="`VnUsers/preview`"
|
||||||
:filter="{ ...filter, where: { id: entityId } }"
|
:filter="{ ...filter, where: { id: entityId } }"
|
||||||
module="Account"
|
|
||||||
data-key="Account"
|
data-key="Account"
|
||||||
title="nickname"
|
title="nickname"
|
||||||
>
|
>
|
||||||
|
|
|
@ -35,6 +35,12 @@ account.value.hasAccount = hasAccount.value;
|
||||||
const entityId = computed(() => +route.params.id);
|
const entityId = computed(() => +route.params.id);
|
||||||
const hasitManagementAccess = ref();
|
const hasitManagementAccess = ref();
|
||||||
const hasSysadminAccess = ref();
|
const hasSysadminAccess = ref();
|
||||||
|
const isHimself = computed(() => user.value.id === account.value.id);
|
||||||
|
const url = computed(() =>
|
||||||
|
isHimself.value
|
||||||
|
? 'Accounts/change-password'
|
||||||
|
: `Accounts/${entityId.value}/setPassword`
|
||||||
|
);
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
|
@ -107,11 +113,8 @@ onMounted(() => {
|
||||||
:ask-old-pass="askOldPass"
|
:ask-old-pass="askOldPass"
|
||||||
:submit-fn="
|
:submit-fn="
|
||||||
async (newPassword, oldPassword) => {
|
async (newPassword, oldPassword) => {
|
||||||
await axios.patch(`Accounts/change-password`, {
|
const body = isHimself ? { userId: entityId, oldPassword } : {};
|
||||||
userId: entityId,
|
await axios.patch(url, { ...body, newPassword });
|
||||||
newPassword,
|
|
||||||
oldPassword,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -155,16 +158,10 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem v-if="hasSysadminAccess || isHimself" v-ripple clickable>
|
||||||
v-if="hasSysadminAccess"
|
<QItemSection @click="onChangePass(isHimself)">
|
||||||
v-ripple
|
{{ isHimself ? t('globals.changePass') : t('globals.setPass') }}
|
||||||
clickable
|
|
||||||
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
|
||||||
>
|
|
||||||
<QItemSection v-if="user.id === account.id">
|
|
||||||
{{ t('globals.changePass') }}
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!account.hasAccount && hasSysadminAccess"
|
v-if="!account.hasAccount && hasSysadminAccess"
|
||||||
|
|
|
@ -35,7 +35,6 @@ const removeRole = async () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
url="VnRoles"
|
url="VnRoles"
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
module="Role"
|
|
||||||
data-key="Role"
|
data-key="Role"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
>
|
>
|
||||||
|
|
|
@ -46,7 +46,6 @@ onMounted(async () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
:url="`Claims/${entityId}`"
|
:url="`Claims/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Claim"
|
|
||||||
title="client.name"
|
title="client.name"
|
||||||
data-key="Claim"
|
data-key="Claim"
|
||||||
>
|
>
|
||||||
|
|
|
@ -190,7 +190,7 @@ async function saveWhenHasChanges() {
|
||||||
ref="claimLinesForm"
|
ref="claimLinesForm"
|
||||||
:url="`Claims/${route.params.id}/lines`"
|
:url="`Claims/${route.params.id}/lines`"
|
||||||
save-url="ClaimBeginnings/crud"
|
save-url="ClaimBeginnings/crud"
|
||||||
:filter="linesFilter"
|
:user-filter="linesFilter"
|
||||||
@on-fetch="onFetch"
|
@on-fetch="onFetch"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:default-save="false"
|
:default-save="false"
|
||||||
|
|
|
@ -156,7 +156,6 @@ function onDrag() {
|
||||||
url="Claims"
|
url="Claims"
|
||||||
:filter="claimDmsFilter"
|
:filter="claimDmsFilter"
|
||||||
@on-fetch="([data]) => setClaimDms(data)"
|
@on-fetch="([data]) => setClaimDms(data)"
|
||||||
limit="20"
|
|
||||||
auto-load
|
auto-load
|
||||||
ref="claimDmsRef"
|
ref="claimDmsRef"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
@ -14,15 +12,14 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
states: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const states = ref([]);
|
|
||||||
|
|
||||||
defineExpose({ states });
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
|
|
@ -10,12 +10,13 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const dataKey = 'ClaimList';
|
const dataKey = 'ClaimList';
|
||||||
|
|
||||||
const claimFilterRef = ref();
|
const states = ref([]);
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -81,8 +82,7 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('claim.state'),
|
label: t('claim.state'),
|
||||||
format: ({ stateCode }) =>
|
format: ({ stateCode }) =>
|
||||||
claimFilterRef.value?.states.find(({ code }) => code === stateCode)
|
states.value?.find(({ code }) => code === stateCode)?.description,
|
||||||
?.description,
|
|
||||||
name: 'stateCode',
|
name: 'stateCode',
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
|
@ -92,7 +92,7 @@ const columns = computed(() => [
|
||||||
name: 'claimStateFk',
|
name: 'claimStateFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
options: claimFilterRef.value?.states,
|
options: states.value,
|
||||||
optionLabel: 'description',
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -125,6 +125,7 @@ const STATE_COLOR = {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -135,7 +136,7 @@ const STATE_COLOR = {
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
|
<ClaimFilter :data-key ref="claimFilterRef" :states />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
|
|
@ -17,8 +17,7 @@ const bankEntitiesRef = ref(null);
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['id', 'bic', 'name'],
|
fields: ['id', 'bic', 'name'],
|
||||||
order: 'bic ASC',
|
order: 'bic ASC'
|
||||||
limit: 30,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getBankEntities = (data, formData) => {
|
const getBankEntities = (data, formData) => {
|
||||||
|
|
|
@ -232,7 +232,6 @@ const updateDateParams = (value, params) => {
|
||||||
:include="'category'"
|
:include="'category'"
|
||||||
:sortBy="'name ASC'"
|
:sortBy="'name ASC'"
|
||||||
dense
|
dense
|
||||||
@update:model-value="(data) => updateDateParams(data, params)"
|
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -254,7 +253,6 @@ const updateDateParams = (value, params) => {
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
:sortBy="'name ASC'"
|
:sortBy="'name ASC'"
|
||||||
dense
|
dense
|
||||||
@update:model-value="(data) => updateDateParams(data, params)"
|
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="params.campaign"
|
v-model="params.campaign"
|
||||||
|
@ -303,12 +301,14 @@ en:
|
||||||
valentinesDay: Valentine's Day
|
valentinesDay: Valentine's Day
|
||||||
mothersDay: Mother's Day
|
mothersDay: Mother's Day
|
||||||
allSaints: All Saints' Day
|
allSaints: All Saints' Day
|
||||||
|
frenchMothersDay: Mother's Day in France
|
||||||
es:
|
es:
|
||||||
Enter a new search: Introduce una nueva búsqueda
|
Enter a new search: Introduce una nueva búsqueda
|
||||||
Group by items: Agrupar por artículos
|
Group by items: Agrupar por artículos
|
||||||
valentinesDay: Día de San Valentín
|
valentinesDay: Día de San Valentín
|
||||||
mothersDay: Día de la Madre
|
mothersDay: Día de la Madre
|
||||||
allSaints: Día de Todos los Santos
|
allSaints: Día de Todos los Santos
|
||||||
|
frenchMothersDay: (Francia) Día de la Madre
|
||||||
Campaign consumption: Consumo campaña
|
Campaign consumption: Consumo campaña
|
||||||
Campaign: Campaña
|
Campaign: Campaña
|
||||||
From: Desde
|
From: Desde
|
||||||
|
|
|
@ -55,7 +55,6 @@ const debtWarning = computed(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Customer"
|
|
||||||
:url="`Clients/${entityId}/getCard`"
|
:url="`Clients/${entityId}/getCard`"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
data-key="Customer"
|
data-key="Customer"
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
@ -10,9 +13,13 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||||
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
|
|
||||||
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const typesTaxes = ref([]);
|
const typesTaxes = ref([]);
|
||||||
const typesTransactions = ref([]);
|
const typesTransactions = ref([]);
|
||||||
|
@ -24,6 +31,37 @@ function handleLocation(data, location) {
|
||||||
data.provinceFk = provinceFk;
|
data.provinceFk = provinceFk;
|
||||||
data.countryFk = countryFk;
|
data.countryFk = countryFk;
|
||||||
}
|
}
|
||||||
|
function onBeforeSave(formData, originalData) {
|
||||||
|
return getUpdatedValues(
|
||||||
|
Object.keys(getDifferences(formData, originalData)),
|
||||||
|
formData,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function checkEtChanges(data, _, originalData) {
|
||||||
|
const equalizatedHasChanged = originalData.isEqualizated != data.isEqualizated;
|
||||||
|
const hasToInvoiceByAddress =
|
||||||
|
originalData.hasToInvoiceByAddress || data.hasToInvoiceByAddress;
|
||||||
|
if (equalizatedHasChanged && hasToInvoiceByAddress) {
|
||||||
|
quasar.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('You changed the equalization tax'),
|
||||||
|
message: t('Do you want to spread the change?'),
|
||||||
|
promise: () => acceptPropagate(data),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else if (equalizatedHasChanged) {
|
||||||
|
await acceptPropagate(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function acceptPropagate({ isEqualizated }) {
|
||||||
|
await axios.patch(`Clients/${route.params.id}/addressesPropagateRe`, {
|
||||||
|
isEqualizated,
|
||||||
|
});
|
||||||
|
notify(t('Equivalent tax spreaded'), 'warning');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,6 +75,9 @@ function handleLocation(data, location) {
|
||||||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||||
auto-load
|
auto-load
|
||||||
model="Customer"
|
model="Customer"
|
||||||
|
:mapper="onBeforeSave"
|
||||||
|
observe-form-changes
|
||||||
|
@on-data-saved="checkEtChanges"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -172,6 +213,9 @@ es:
|
||||||
whenActivatingIt: Al activarlo, no informar el código del país en el campo nif
|
whenActivatingIt: Al activarlo, no informar el código del país en el campo nif
|
||||||
inOrderToInvoice: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automaticamente el cambio a todos lo consignatarios, en caso contrario preguntará al usuario si quiere o no propagar
|
inOrderToInvoice: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automaticamente el cambio a todos lo consignatarios, en caso contrario preguntará al usuario si quiere o no propagar
|
||||||
Daily invoice: Facturación diaria
|
Daily invoice: Facturación diaria
|
||||||
|
Equivalent tax spreaded: Recargo de equivalencia propagado
|
||||||
|
You changed the equalization tax: Has cambiado el recargo de equivalencia
|
||||||
|
Do you want to spread the change?: ¿Deseas propagar el cambio a sus consignatarios?
|
||||||
en:
|
en:
|
||||||
onlyLetters: Only letters, numbers and spaces can be used
|
onlyLetters: Only letters, numbers and spaces can be used
|
||||||
whenActivatingIt: When activating it, do not enter the country code in the ID field
|
whenActivatingIt: When activating it, do not enter the country code in the ID field
|
||||||
|
|
|
@ -270,7 +270,7 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
<VnTitle
|
<VnTitle
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
||||||
:text="t('customer.summary.payMethodFk')"
|
:text="t('customer.summary.financialData')"
|
||||||
icon="vn:grafana"
|
icon="vn:grafana"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
|
|
@ -87,7 +87,7 @@ onMounted(async () => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Campaigns/latest"
|
url="Campaigns/latest"
|
||||||
@on-fetch="(data) => (campaignsOptions = data)"
|
@on-fetch="(data) => (campaignsOptions = data)"
|
||||||
:filter="{ fields: ['id', 'code', 'dated'], order: 'code ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'code', 'dated'], order: 'code ASC' }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
|
|
@ -98,7 +98,6 @@ function onAgentCreated({ id, fiscalName }, data) {
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.location"
|
v-model="data.location"
|
||||||
:required="true"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -96,11 +96,11 @@ const updateObservations = async (payload) => {
|
||||||
await axios.post('AddressObservations/crud', payload);
|
await axios.post('AddressObservations/crud', payload);
|
||||||
notes.value = [];
|
notes.value = [];
|
||||||
deletes.value = [];
|
deletes.value = [];
|
||||||
toCustomerAddress();
|
|
||||||
};
|
};
|
||||||
async function updateAll({ data, payload }) {
|
async function updateAll({ data, payload }) {
|
||||||
await updateObservations(payload);
|
await updateObservations(payload);
|
||||||
await updateAddress(data);
|
await updateAddress(data);
|
||||||
|
toCustomerAddress();
|
||||||
}
|
}
|
||||||
function getPayload() {
|
function getPayload() {
|
||||||
return {
|
return {
|
||||||
|
@ -137,15 +137,12 @@ async function handleDialog(data) {
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
await updateAddressTicket();
|
await updateAddressTicket();
|
||||||
await updateAll(body);
|
await updateAll(body);
|
||||||
toCustomerAddress();
|
|
||||||
})
|
})
|
||||||
.onCancel(async () => {
|
.onCancel(async () => {
|
||||||
await updateAll(body);
|
await updateAll(body);
|
||||||
toCustomerAddress();
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
updateAll(body);
|
await updateAll(body);
|
||||||
toCustomerAddress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +233,7 @@ function handleLocation(data, location) {
|
||||||
postcode: data.postalCode,
|
postcode: data.postalCode,
|
||||||
city: data.city,
|
city: data.city,
|
||||||
province: data.province,
|
province: data.province,
|
||||||
country: data.province.country,
|
country: data.province?.country,
|
||||||
}"
|
}"
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
></VnLocation>
|
></VnLocation>
|
||||||
|
|
|
@ -84,7 +84,7 @@ function setPaymentType(accounting) {
|
||||||
viewReceipt.value = isCash.value;
|
viewReceipt.value = isCash.value;
|
||||||
if (accountingType.value.daysInFuture)
|
if (accountingType.value.daysInFuture)
|
||||||
initialData.payed.setDate(
|
initialData.payed.setDate(
|
||||||
initialData.payed.getDate() + accountingType.value.daysInFuture
|
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
||||||
);
|
);
|
||||||
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ function onBeforeSave(data) {
|
||||||
if (isCash.value && shouldSendEmail.value && !data.email)
|
if (isCash.value && shouldSendEmail.value && !data.email)
|
||||||
return notify(t('There is no assigned email for this client'), 'negative');
|
return notify(t('There is no assigned email for this client'), 'negative');
|
||||||
|
|
||||||
data.bankFk = data.bankFk.id;
|
data.bankFk = data.bankFk?.id;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ async function getAmountPaid() {
|
||||||
:url-create="urlCreate"
|
:url-create="urlCreate"
|
||||||
:mapper="onBeforeSave"
|
:mapper="onBeforeSave"
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
:prevent-submit="true"
|
prevent-submit
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<span ref="closeButton" class="row justify-end close-icon" v-close-popup>
|
<span ref="closeButton" class="row justify-end close-icon" v-close-popup>
|
||||||
|
|
|
@ -16,7 +16,6 @@ import ItemDescriptor from 'src/pages/Item/Card/ItemDescriptor.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
|
||||||
import { checkEntryLock } from 'src/composables/checkEntryLock';
|
import { checkEntryLock } from 'src/composables/checkEntryLock';
|
||||||
import SkeletonDescriptor from 'src/components/ui/SkeletonDescriptor.vue';
|
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -103,7 +102,7 @@ const columns = [
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
component: 'number',
|
component: 'number',
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
width: '40px',
|
width: '35px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
labelAbbreviation: '',
|
labelAbbreviation: '',
|
||||||
|
@ -111,7 +110,7 @@ const columns = [
|
||||||
name: 'hex',
|
name: 'hex',
|
||||||
columnSearch: false,
|
columnSearch: false,
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
width: '5px',
|
width: '9px',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Inks',
|
url: 'Inks',
|
||||||
|
@ -156,10 +155,10 @@ const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: t('Sti.'),
|
labelAbbreviation: t('Sti.'),
|
||||||
label: t('Printed Stickers/Stickers'),
|
label: t('Stickers'),
|
||||||
toolTip: t('Printed Stickers/Stickers'),
|
toolTip: t('Printed Stickers/Stickers'),
|
||||||
name: 'stickers',
|
name: 'stickers',
|
||||||
component: 'number',
|
component: 'input',
|
||||||
create: true,
|
create: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
positive: false,
|
positive: false,
|
||||||
|
@ -179,8 +178,9 @@ const columns = [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'packagings',
|
url: 'packagings',
|
||||||
fields: ['id', 'volume'],
|
fields: ['id'],
|
||||||
optionLabel: 'id',
|
optionLabel: 'id',
|
||||||
|
optionValue: 'id',
|
||||||
},
|
},
|
||||||
create: true,
|
create: true,
|
||||||
width: '40px',
|
width: '40px',
|
||||||
|
@ -192,10 +192,10 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
create: true,
|
create: true,
|
||||||
width: '35px',
|
width: '35px',
|
||||||
|
format: (row) => parseFloat(row['weight']).toFixed(1),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
labelAbbreviation: 'P',
|
||||||
labelAbbreviation: 'Pack',
|
|
||||||
label: 'Packing',
|
label: 'Packing',
|
||||||
toolTip: 'Packing',
|
toolTip: 'Packing',
|
||||||
name: 'packing',
|
name: 'packing',
|
||||||
|
@ -209,7 +209,7 @@ const columns = [
|
||||||
row['amount'] = row['quantity'] * row['buyingValue'];
|
row['amount'] = row['quantity'] * row['buyingValue'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: '35px',
|
width: '30px',
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (row.groupingMode === 'grouping')
|
if (row.groupingMode === 'grouping')
|
||||||
return { color: 'var(--vn-label-color)' };
|
return { color: 'var(--vn-label-color)' };
|
||||||
|
@ -229,7 +229,7 @@ const columns = [
|
||||||
indeterminateValue: null,
|
indeterminateValue: null,
|
||||||
},
|
},
|
||||||
size: 'xs',
|
size: 'xs',
|
||||||
width: '30px',
|
width: '25px',
|
||||||
create: true,
|
create: true,
|
||||||
rightFilter: false,
|
rightFilter: false,
|
||||||
getIcon: (value) => {
|
getIcon: (value) => {
|
||||||
|
@ -245,12 +245,12 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: 'Group',
|
labelAbbreviation: 'G',
|
||||||
label: 'Grouping',
|
label: 'Grouping',
|
||||||
toolTip: 'Grouping',
|
toolTip: 'Grouping',
|
||||||
name: 'grouping',
|
name: 'grouping',
|
||||||
component: 'number',
|
component: 'number',
|
||||||
width: '35px',
|
width: '30px',
|
||||||
create: true,
|
create: true,
|
||||||
style: (row) => {
|
style: (row) => {
|
||||||
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
|
if (row.groupingMode === 'packing') return { color: 'var(--vn-label-color)' };
|
||||||
|
@ -290,6 +290,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: '45px',
|
width: '45px',
|
||||||
|
format: (row) => parseFloat(row['buyingValue']).toFixed(3),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -301,6 +302,7 @@ const columns = [
|
||||||
positive: false,
|
positive: false,
|
||||||
},
|
},
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
|
format: (row) => parseFloat(row['amount']).toFixed(2),
|
||||||
style: getAmountStyle,
|
style: getAmountStyle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -312,6 +314,7 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
width: '35px',
|
width: '35px',
|
||||||
create: true,
|
create: true,
|
||||||
|
format: (row) => parseFloat(row['price2']).toFixed(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -325,25 +328,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
width: '35px',
|
width: '35px',
|
||||||
create: true,
|
create: true,
|
||||||
},
|
format: (row) => parseFloat(row['price3']).toFixed(2),
|
||||||
{
|
|
||||||
align: 'center',
|
|
||||||
labelAbbreviation: 'Min.',
|
|
||||||
label: t('Minimum price'),
|
|
||||||
toolTip: t('Minimum price'),
|
|
||||||
name: 'minPrice',
|
|
||||||
component: 'number',
|
|
||||||
cellEvent: {
|
|
||||||
'update:modelValue': async (value, oldValue, row) => {
|
|
||||||
await axios.patch(`Items/${row['itemFk']}`, {
|
|
||||||
minPrice: value,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
width: '35px',
|
|
||||||
style: (row) => {
|
|
||||||
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -364,6 +349,26 @@ const columns = [
|
||||||
},
|
},
|
||||||
width: '25px',
|
width: '25px',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align: 'center',
|
||||||
|
labelAbbreviation: 'Min.',
|
||||||
|
label: t('Minimum price'),
|
||||||
|
toolTip: t('Minimum price'),
|
||||||
|
name: 'minPrice',
|
||||||
|
component: 'number',
|
||||||
|
cellEvent: {
|
||||||
|
'update:modelValue': async (value, oldValue, row) => {
|
||||||
|
await axios.patch(`Items/${row['itemFk']}`, {
|
||||||
|
minPrice: value,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
width: '35px',
|
||||||
|
style: (row) => {
|
||||||
|
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
|
||||||
|
},
|
||||||
|
format: (row) => parseFloat(row['minPrice']).toFixed(2),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
labelAbbreviation: t('P.Sen'),
|
labelAbbreviation: t('P.Sen'),
|
||||||
|
@ -373,6 +378,9 @@ const columns = [
|
||||||
component: 'number',
|
component: 'number',
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
width: '40px',
|
width: '40px',
|
||||||
|
style: () => {
|
||||||
|
return { color: 'var(--vn-label-color)' };
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -412,6 +420,9 @@ const columns = [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
width: '35px',
|
width: '35px',
|
||||||
|
style: () => {
|
||||||
|
return { color: 'var(--vn-label-color)' };
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -504,7 +515,7 @@ async function setBuyUltimate(itemFk, data) {
|
||||||
|
|
||||||
allowedKeys.forEach((key) => {
|
allowedKeys.forEach((key) => {
|
||||||
if (buyUltimateData.hasOwnProperty(key) && key !== 'entryFk') {
|
if (buyUltimateData.hasOwnProperty(key) && key !== 'entryFk') {
|
||||||
data[key] = buyUltimateData[key];
|
if (!['stickers', 'quantity'].includes(key)) data[key] = buyUltimateData[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -518,7 +529,7 @@ onMounted(() => {
|
||||||
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
|
<Teleport to="#st-data" v-if="stateStore?.isSubToolbarShown() && editableMode">
|
||||||
<QBtnGroup push style="column-gap: 1px">
|
<QBtnGroup push style="column-gap: 1px">
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
icon="exposure_neg_1"
|
label="+/-"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
:title="t('Invert quantity value')"
|
:title="t('Invert quantity value')"
|
||||||
|
@ -533,7 +544,7 @@ onMounted(() => {
|
||||||
@click="invertQuantitySign(selectedRows, -1)"
|
@click="invertQuantitySign(selectedRows, -1)"
|
||||||
data-cy="set-negative-quantity"
|
data-cy="set-negative-quantity"
|
||||||
>
|
>
|
||||||
<span style="font-size: medium">-1</span>
|
<span style="font-size: large">-</span>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -544,7 +555,7 @@ onMounted(() => {
|
||||||
@click="invertQuantitySign(selectedRows, 1)"
|
@click="invertQuantitySign(selectedRows, 1)"
|
||||||
data-cy="set-positive-quantity"
|
data-cy="set-positive-quantity"
|
||||||
>
|
>
|
||||||
<span style="font-size: medium">1</span>
|
<span style="font-size: large">+</span>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -558,11 +569,11 @@ onMounted(() => {
|
||||||
:disable="!selectedRows.length"
|
:disable="!selectedRows.length"
|
||||||
data-cy="check-buy-amount"
|
data-cy="check-buy-amount"
|
||||||
>
|
>
|
||||||
<QTooltip>{{}}</QTooltip>
|
|
||||||
<QList>
|
<QList>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
size="sm"
|
||||||
icon="check"
|
icon="check"
|
||||||
flat
|
flat
|
||||||
@click="setIsChecked(selectedRows, true)"
|
@click="setIsChecked(selectedRows, true)"
|
||||||
|
@ -573,6 +584,7 @@ onMounted(() => {
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
size="sm"
|
||||||
icon="close"
|
icon="close"
|
||||||
flat
|
flat
|
||||||
@click="setIsChecked(selectedRows, false)"
|
@click="setIsChecked(selectedRows, false)"
|
||||||
|
@ -595,7 +607,6 @@ onMounted(() => {
|
||||||
ref="entryBuysRef"
|
ref="entryBuysRef"
|
||||||
data-key="EntryBuys"
|
data-key="EntryBuys"
|
||||||
:url="`Entries/${entityId}/getBuyList`"
|
:url="`Entries/${entityId}/getBuyList`"
|
||||||
order="name DESC"
|
|
||||||
save-url="Buys/crud"
|
save-url="Buys/crud"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
|
@ -639,7 +650,8 @@ onMounted(() => {
|
||||||
:is-editable="editableMode"
|
:is-editable="editableMode"
|
||||||
:without-header="!editableMode"
|
:without-header="!editableMode"
|
||||||
:with-filters="editableMode"
|
:with-filters="editableMode"
|
||||||
:right-search="editableMode"
|
:right-search="true"
|
||||||
|
:right-search-icon="true"
|
||||||
:row-click="false"
|
:row-click="false"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:beforeSaveFn="beforeSave"
|
:beforeSaveFn="beforeSave"
|
||||||
|
@ -662,7 +674,7 @@ onMounted(() => {
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" :columns="3" />
|
||||||
</template>
|
</template>
|
||||||
<template #column-stickers="{ row }">
|
<template #column-stickers="{ row }">
|
||||||
<span class="editable-text">
|
<span :class="editableMode ? 'editable-text' : ''">
|
||||||
<span style="color: var(--vn-label-color)">
|
<span style="color: var(--vn-label-color)">
|
||||||
{{ row.printedStickers }}
|
{{ row.printedStickers }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -693,20 +705,36 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
<template #column-create-itemFk="{ data }">
|
<template #column-create-itemFk="{ data }">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Items"
|
url="Items/search"
|
||||||
v-model="data.itemFk"
|
v-model="data.itemFk"
|
||||||
:label="t('Article')"
|
:label="t('Article')"
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name', 'size', 'producerName']"
|
||||||
|
:filter-options="['id', 'name', 'size', 'producerName']"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
@update:modelValue="
|
@update:modelValue="
|
||||||
async (value) => {
|
async (value) => {
|
||||||
setBuyUltimate(value, data);
|
await setBuyUltimate(value, data);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
:required="true"
|
:required="true"
|
||||||
data-cy="itemFk-create-popup"
|
data-cy="itemFk-create-popup"
|
||||||
/>
|
sort-by="nickname DESC"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
#{{ scope.opt.id }}, {{ scope.opt?.size }},
|
||||||
|
{{ scope.opt?.producerName }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</template>
|
</template>
|
||||||
<template #column-create-groupingMode="{ data }">
|
<template #column-create-groupingMode="{ data }">
|
||||||
<VnSelectEnum
|
<VnSelectEnum
|
||||||
|
@ -720,9 +748,14 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #previous-create-dialog="{ data }">
|
<template #previous-create-dialog="{ data }">
|
||||||
<div style="position: absolute">
|
<div
|
||||||
|
style="position: absolute"
|
||||||
|
:class="{ 'centered-container': !data.itemFk }"
|
||||||
|
>
|
||||||
<ItemDescriptor :id="data.itemFk" v-if="data.itemFk" />
|
<ItemDescriptor :id="data.itemFk" v-if="data.itemFk" />
|
||||||
<SkeletonDescriptor v-if="!data.itemFk" :has-image="true" />
|
<div v-else>
|
||||||
|
<span>{{ t('globals.noData') }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
@ -744,6 +777,7 @@ es:
|
||||||
Com.: Ref.
|
Com.: Ref.
|
||||||
Comment: Referencia
|
Comment: Referencia
|
||||||
Minimum price: Precio mínimo
|
Minimum price: Precio mínimo
|
||||||
|
Stickers: Etiquetas
|
||||||
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
|
Printed Stickers/Stickers: Etiquetas impresas/Etiquetas
|
||||||
Cost: Cost.
|
Cost: Cost.
|
||||||
Buying value: Coste
|
Buying value: Coste
|
||||||
|
@ -761,7 +795,12 @@ es:
|
||||||
Check buy amount: Marcar como correcta la cantidad de compra
|
Check buy amount: Marcar como correcta la cantidad de compra
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.test {
|
.centered-container {
|
||||||
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -147,7 +147,6 @@ async function deleteEntry() {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="entryDescriptorRef"
|
ref="entryDescriptorRef"
|
||||||
module="Entry"
|
|
||||||
:url="`Entries/${entityId}`"
|
:url="`Entries/${entityId}`"
|
||||||
:userFilter="entryFilter"
|
:userFilter="entryFilter"
|
||||||
title="supplier.nickname"
|
title="supplier.nickname"
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
@ -18,18 +16,10 @@ defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemTypeWorkersOptions = ref([]);
|
|
||||||
const tagValues = ref([]);
|
const tagValues = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="TicketRequests/getItemTypeWorker"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
|
||||||
/>
|
|
||||||
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
|
@ -37,9 +27,10 @@ const tagValues = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('components.itemsFilterPanel.salesPersonFk')"
|
:label="t('components.itemsFilterPanel.salesPersonFk')"
|
||||||
v-model="params.salesPersonFk"
|
v-model="params.salesPersonFk"
|
||||||
:options="itemTypeWorkersOptions"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
|
:fields="['id', 'nickname']"
|
||||||
|
sort-by="nickname ASC"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -52,8 +43,9 @@ const tagValues = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelectSupplier
|
<VnSelectSupplier
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
@update:model-value="searchFn()"
|
url="Suppliers"
|
||||||
hide-selected
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
sort-by="name ASC"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -44,28 +44,32 @@ const entryQueryFilter = {
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
label: 'Ex',
|
labelAbbreviation: 'Ex',
|
||||||
|
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
||||||
toolTip: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
toolTip: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
||||||
name: 'isExcludedFromAvailable',
|
name: 'isExcludedFromAvailable',
|
||||||
component: 'checkbox',
|
component: 'checkbox',
|
||||||
width: '35px',
|
width: '35px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Pe',
|
labelAbbreviation: 'Pe',
|
||||||
|
label: t('entry.list.tableVisibleColumns.isOrdered'),
|
||||||
toolTip: t('entry.list.tableVisibleColumns.isOrdered'),
|
toolTip: t('entry.list.tableVisibleColumns.isOrdered'),
|
||||||
name: 'isOrdered',
|
name: 'isOrdered',
|
||||||
component: 'checkbox',
|
component: 'checkbox',
|
||||||
width: '35px',
|
width: '35px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Le',
|
labelAbbreviation: 'LE',
|
||||||
|
label: t('entry.list.tableVisibleColumns.isConfirmed'),
|
||||||
toolTip: t('entry.list.tableVisibleColumns.isConfirmed'),
|
toolTip: t('entry.list.tableVisibleColumns.isConfirmed'),
|
||||||
name: 'isConfirmed',
|
name: 'isConfirmed',
|
||||||
component: 'checkbox',
|
component: 'checkbox',
|
||||||
width: '35px',
|
width: '35px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Re',
|
labelAbbreviation: 'Re',
|
||||||
|
label: t('entry.list.tableVisibleColumns.isReceived'),
|
||||||
toolTip: t('entry.list.tableVisibleColumns.isReceived'),
|
toolTip: t('entry.list.tableVisibleColumns.isReceived'),
|
||||||
name: 'isReceived',
|
name: 'isReceived',
|
||||||
component: 'checkbox',
|
component: 'checkbox',
|
||||||
|
@ -89,6 +93,7 @@ const columns = computed(() => [
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
},
|
},
|
||||||
|
width: '50px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('entry.list.tableVisibleColumns.supplierFk'),
|
label: t('entry.list.tableVisibleColumns.supplierFk'),
|
||||||
|
@ -99,8 +104,10 @@ const columns = computed(() => [
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'suppliers',
|
url: 'suppliers',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
|
where: { order: 'name DESC' },
|
||||||
},
|
},
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.supplierName),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.supplierName),
|
||||||
|
width: '110px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -124,6 +131,7 @@ const columns = computed(() => [
|
||||||
label: 'AWB',
|
label: 'AWB',
|
||||||
name: 'awbCode',
|
name: 'awbCode',
|
||||||
component: 'input',
|
component: 'input',
|
||||||
|
width: '100px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -160,6 +168,7 @@ const columns = computed(() => [
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseOutName),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseOutName),
|
||||||
|
width: '65px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -175,20 +184,23 @@ const columns = computed(() => [
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseInName),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseInName),
|
||||||
|
width: '65px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
labelAbbreviation: t('Type'),
|
||||||
label: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
label: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
||||||
|
toolTip: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
||||||
name: 'entryTypeCode',
|
name: 'entryTypeCode',
|
||||||
cardVisible: true,
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'entryTypes',
|
||||||
|
fields: ['code', 'description'],
|
||||||
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
{
|
width: '65px',
|
||||||
name: 'dated',
|
format: (row, dashIfEmpty) => dashIfEmpty(row.entryTypeDescription),
|
||||||
label: t('entry.list.tableVisibleColumns.dated'),
|
|
||||||
component: 'date',
|
|
||||||
cardVisible: false,
|
|
||||||
visible: false,
|
|
||||||
create: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'companyFk',
|
name: 'companyFk',
|
||||||
|
@ -220,7 +232,8 @@ function getBadgeAttrs(row) {
|
||||||
|
|
||||||
let timeDiff = today - timeTicket;
|
let timeDiff = today - timeTicket;
|
||||||
|
|
||||||
if (timeDiff > 0) return { color: 'warning', 'text-color': 'black' };
|
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
|
||||||
|
if (timeDiff < 0) return { color: 'warning', 'text-color': 'black' };
|
||||||
switch (row.entryTypeCode) {
|
switch (row.entryTypeCode) {
|
||||||
case 'regularization':
|
case 'regularization':
|
||||||
case 'life':
|
case 'life':
|
||||||
|
@ -245,7 +258,6 @@ function getBadgeAttrs(row) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (timeDiff < 0) return { color: 'info', 'text-color': 'black' };
|
|
||||||
return { color: 'transparent' };
|
return { color: 'transparent' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,4 +340,5 @@ es:
|
||||||
Search entries: Buscar entradas
|
Search entries: Buscar entradas
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
You can search by entry reference: Puedes buscar por referencia de la entrada
|
||||||
Create entry: Crear entrada
|
Create entry: Crear entrada
|
||||||
|
Type: Tipo
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -34,18 +34,20 @@ const columns = computed(() => [
|
||||||
label: t('entryStockBought.buyer'),
|
label: t('entryStockBought.buyer'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
|
isEditable: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'nickname'],
|
||||||
where: { role: 'buyer' },
|
where: { role: 'buyer' },
|
||||||
optionFilter: 'firstName',
|
optionFilter: 'firstName',
|
||||||
optionLabel: 'name',
|
optionLabel: 'nickname',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
useLike: false,
|
useLike: false,
|
||||||
},
|
},
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -55,6 +57,7 @@ const columns = computed(() => [
|
||||||
create: true,
|
create: true,
|
||||||
component: 'number',
|
component: 'number',
|
||||||
summation: true,
|
summation: true,
|
||||||
|
width: '50px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -78,6 +81,7 @@ const columns = computed(() => [
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('entryStockBought.viewMoreDetails'),
|
title: t('entryStockBought.viewMoreDetails'),
|
||||||
|
name: 'searchBtn',
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => {
|
action: (row) => {
|
||||||
|
@ -91,6 +95,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
'data-cy': 'table-actions',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -158,7 +163,7 @@ function round(value) {
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
travel = data.find(
|
travel = data.find(
|
||||||
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh'
|
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
@ -179,6 +184,7 @@ function round(value) {
|
||||||
@click="openDialog()"
|
@click="openDialog()"
|
||||||
:title="t('entryStockBought.editTravel')"
|
:title="t('entryStockBought.editTravel')"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
data-cy="edit-travel"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
@ -239,10 +245,11 @@ function round(value) {
|
||||||
table-height="80vh"
|
table-height="80vh"
|
||||||
auto-load
|
auto-load
|
||||||
:column-search="false"
|
:column-search="false"
|
||||||
|
:without-header="true"
|
||||||
>
|
>
|
||||||
<template #column-workerFk="{ row }">
|
<template #column-workerFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row?.worker?.user?.name }}
|
{{ row?.worker?.user?.nickname }}
|
||||||
<WorkerDescriptorProxy :id="row?.workerFk" />
|
<WorkerDescriptorProxy :id="row?.workerFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -279,10 +286,11 @@ function round(value) {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.column {
|
.column {
|
||||||
|
min-width: 40%;
|
||||||
|
margin-top: 5%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-width: 35%;
|
|
||||||
}
|
}
|
||||||
.text-negative {
|
.text-negative {
|
||||||
color: $negative !important;
|
color: $negative !important;
|
||||||
|
|
|
@ -21,7 +21,7 @@ const $props = defineProps({
|
||||||
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&dated=${$props.dated}`;
|
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&dated=${$props.dated}`;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: t('Entry'),
|
label: t('Entry'),
|
||||||
name: 'entryFk',
|
name: 'entryFk',
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
|
@ -29,7 +29,7 @@ const columns = [
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
label: t('Item'),
|
label: t('Item'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
@ -44,21 +44,21 @@ const columns = [
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
label: t('Volume'),
|
label: t('Volume'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: t('Packaging'),
|
label: t('Packaging'),
|
||||||
name: 'packagingFk',
|
name: 'packagingFk',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: 'Packing',
|
label: 'Packing',
|
||||||
name: 'packing',
|
name: 'packing',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
@ -73,12 +73,14 @@ const columns = [
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="StockBoughtsDetail"
|
data-key="StockBoughtsDetail"
|
||||||
:url="customUrl"
|
:url="customUrl"
|
||||||
order="itemName DESC"
|
order="volume DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:disable-infinite-scroll="true"
|
:disable-infinite-scroll="true"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:limit="0"
|
:limit="0"
|
||||||
|
:without-header="true"
|
||||||
|
:with-filters="false"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #column-entryFk="{ row }">
|
<template #column-entryFk="{ row }">
|
||||||
|
@ -99,16 +101,14 @@ const columns = [
|
||||||
</template>
|
</template>
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
.container {
|
.container {
|
||||||
max-width: 50vw;
|
max-width: 100%;
|
||||||
|
width: 50%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
padding: 4px;
|
padding: 2%;
|
||||||
}
|
|
||||||
.container > div > div > .q-table__top.relative-position.row.items-center {
|
|
||||||
background-color: red !important;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -90,7 +90,6 @@ async function setInvoiceCorrection(id) {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="InvoiceIn"
|
|
||||||
data-key="InvoiceIn"
|
data-key="InvoiceIn"
|
||||||
:url="`InvoiceIns/${entityId}`"
|
:url="`InvoiceIns/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { toDate } from 'src/filters';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { getTotal } from 'src/composables/getTotal';
|
import { getTotal } from 'src/composables/getTotal';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
@ -22,7 +21,6 @@ const invoiceIn = computed(() => arrayData.store.data);
|
||||||
const currency = computed(() => invoiceIn.value?.currency?.code);
|
const currency = computed(() => invoiceIn.value?.currency?.code);
|
||||||
|
|
||||||
const rowsSelected = ref([]);
|
const rowsSelected = ref([]);
|
||||||
const banks = ref([]);
|
|
||||||
const invoiceInFormRef = ref();
|
const invoiceInFormRef = ref();
|
||||||
const invoiceId = +route.params.id;
|
const invoiceId = +route.params.id;
|
||||||
const filter = { where: { invoiceInFk: invoiceId } };
|
const filter = { where: { invoiceInFk: invoiceId } };
|
||||||
|
@ -41,10 +39,9 @@ const columns = computed(() => [
|
||||||
name: 'bank',
|
name: 'bank',
|
||||||
label: t('Bank'),
|
label: t('Bank'),
|
||||||
field: (row) => row.bankFk,
|
field: (row) => row.bankFk,
|
||||||
options: banks.value,
|
|
||||||
model: 'bankFk',
|
model: 'bankFk',
|
||||||
optionValue: 'id',
|
|
||||||
optionLabel: 'bank',
|
optionLabel: 'bank',
|
||||||
|
url: 'Accountings',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
tabIndex: 2,
|
tabIndex: 2,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -82,12 +79,6 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Accountings"
|
|
||||||
auto-load
|
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (banks = data)"
|
|
||||||
/>
|
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-if="invoiceIn"
|
v-if="invoiceIn"
|
||||||
ref="invoiceInFormRef"
|
ref="invoiceInFormRef"
|
||||||
|
@ -117,9 +108,9 @@ onBeforeMount(async () => {
|
||||||
<QTd>
|
<QTd>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
:options="col.options"
|
:url="col.url"
|
||||||
:option-value="col.optionValue"
|
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
|
:option-value="col.optionValue"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -193,8 +184,7 @@ onBeforeMount(async () => {
|
||||||
:label="t('Bank')"
|
:label="t('Bank')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
v-model="props.row['bankFk']"
|
v-model="props.row['bankFk']"
|
||||||
:options="banks"
|
url="Accountings"
|
||||||
option-value="id"
|
|
||||||
option-label="bank"
|
option-label="bank"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
|
|
@ -36,7 +36,6 @@ function ticketFilter(invoice) {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
module="InvoiceOut"
|
|
||||||
:url="`InvoiceOuts/${entityId}`"
|
:url="`InvoiceOuts/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="ref"
|
title="ref"
|
||||||
|
|
|
@ -103,7 +103,7 @@ const refundInvoice = async (withWarehouse) => {
|
||||||
t('refundInvoiceSuccessMessage', {
|
t('refundInvoiceSuccessMessage', {
|
||||||
refundTicket: data[0].id,
|
refundTicket: data[0].id,
|
||||||
}),
|
}),
|
||||||
'positive'
|
'positive',
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -124,6 +124,13 @@ const showRefundInvoiceForm = () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showExportationLetter = () => {
|
||||||
|
openReport(`InvoiceOuts/${$props.invoiceOutData.ref}/exportation-pdf`, {
|
||||||
|
recipientId: $props.invoiceOutData.client.id,
|
||||||
|
refFk: $props.invoiceOutData.ref,
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -172,7 +179,7 @@ const showRefundInvoiceForm = () => {
|
||||||
t('Confirm deletion'),
|
t('Confirm deletion'),
|
||||||
t('Are you sure you want to delete this invoice?'),
|
t('Are you sure you want to delete this invoice?'),
|
||||||
deleteInvoice,
|
deleteInvoice,
|
||||||
redirectToInvoiceOutList
|
redirectToInvoiceOutList,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -185,7 +192,7 @@ const showRefundInvoiceForm = () => {
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
'',
|
'',
|
||||||
t('Are you sure you want to book this invoice?'),
|
t('Are you sure you want to book this invoice?'),
|
||||||
bookInvoice
|
bookInvoice,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -198,7 +205,7 @@ const showRefundInvoiceForm = () => {
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Generate PDF invoice document'),
|
t('Generate PDF invoice document'),
|
||||||
t('Are you sure you want to generate/regenerate the PDF invoice?'),
|
t('Are you sure you want to generate/regenerate the PDF invoice?'),
|
||||||
generateInvoicePdf
|
generateInvoicePdf,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -226,6 +233,14 @@ const showRefundInvoiceForm = () => {
|
||||||
{{ t('Create a single ticket with all the content of the current invoice') }}
|
{{ t('Create a single ticket with all the content of the current invoice') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="$props.invoiceOutData.serial === 'E'"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="showExportationLetter()"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('Show CITES letter') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
@ -255,7 +270,7 @@ es:
|
||||||
Create a single ticket with all the content of the current invoice: Crear un ticket único con todo el contenido de la factura actual
|
Create a single ticket with all the content of the current invoice: Crear un ticket único con todo el contenido de la factura actual
|
||||||
refundInvoiceSuccessMessage: Se ha creado el siguiente ticket de abono {refundTicket}
|
refundInvoiceSuccessMessage: Se ha creado el siguiente ticket de abono {refundTicket}
|
||||||
The email can't be empty: El email no puede estar vacío
|
The email can't be empty: El email no puede estar vacío
|
||||||
|
Show CITES letter: Ver carta CITES
|
||||||
en:
|
en:
|
||||||
refundInvoiceSuccessMessage: The following refund ticket have been created {refundTicket}
|
refundInvoiceSuccessMessage: The following refund ticket have been created {refundTicket}
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -125,7 +125,7 @@ const ticketsColumns = ref([
|
||||||
:value="toDate(invoiceOut.issued)"
|
:value="toDate(invoiceOut.issued)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('invoiceOut.summary.dued')"
|
:label="t('invoiceOut.summary.expirationDate')"
|
||||||
:value="toDate(invoiceOut.dued)"
|
:value="toDate(invoiceOut.dued)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('globals.created')" :value="toDate(invoiceOut.created)" />
|
<VnLv :label="t('globals.created')" :value="toDate(invoiceOut.created)" />
|
||||||
|
|
|
@ -22,7 +22,7 @@ const states = ref();
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`invoiceOut.params.${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -84,15 +84,6 @@ const states = ref();
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInputDate
|
|
||||||
v-model="params.issued"
|
|
||||||
:label="t('Issued')"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
|
@ -110,37 +101,3 @@ const states = ref();
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
params:
|
|
||||||
search: Contains
|
|
||||||
clientFk: Customer
|
|
||||||
fi: FI
|
|
||||||
amount: Amount
|
|
||||||
min: Min
|
|
||||||
max: Max
|
|
||||||
hasPdf: Has PDF
|
|
||||||
issued: Issued
|
|
||||||
created: Created
|
|
||||||
dued: Dued
|
|
||||||
es:
|
|
||||||
params:
|
|
||||||
search: Contiene
|
|
||||||
clientFk: Cliente
|
|
||||||
fi: CIF
|
|
||||||
amount: Importe
|
|
||||||
min: Min
|
|
||||||
max: Max
|
|
||||||
hasPdf: Tiene PDF
|
|
||||||
issued: Emitida
|
|
||||||
created: Creada
|
|
||||||
dued: Vencida
|
|
||||||
Customer ID: ID cliente
|
|
||||||
FI: CIF
|
|
||||||
Amount: Importe
|
|
||||||
Has PDF: Tiene PDF
|
|
||||||
Issued: Fecha emisión
|
|
||||||
Created: Fecha creación
|
|
||||||
Dued: Fecha vencimiento
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -71,14 +71,6 @@ const columns = computed(() => [
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'issued',
|
|
||||||
label: t('invoiceOut.summary.issued'),
|
|
||||||
component: 'date',
|
|
||||||
format: (row) => toDate(row.issued),
|
|
||||||
columnField: { component: null },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'clientFk',
|
name: 'clientFk',
|
||||||
|
|
|
@ -10,6 +10,8 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
|
||||||
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
import InvoiceOutNegativeBasesFilter from './InvoiceOutNegativeBasesFilter.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
@ -97,16 +99,19 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'isActive',
|
name: 'isActive',
|
||||||
label: t('invoiceOut.negativeBases.active'),
|
label: t('invoiceOut.negativeBases.active'),
|
||||||
|
component: 'checkbox',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'hasToInvoice',
|
name: 'hasToInvoice',
|
||||||
label: t('invoiceOut.negativeBases.hasToInvoice'),
|
label: t('invoiceOut.negativeBases.hasToInvoice'),
|
||||||
|
component: 'checkbox',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'hasVerifiedData',
|
name: 'isTaxDataChecked',
|
||||||
label: t('invoiceOut.negativeBases.verifiedData'),
|
label: t('invoiceOut.negativeBases.verifiedData'),
|
||||||
|
component: 'checkbox',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -142,7 +147,7 @@ const downloadCSV = async () => {
|
||||||
await invoiceOutGlobalStore.getNegativeBasesCsv(
|
await invoiceOutGlobalStore.getNegativeBasesCsv(
|
||||||
userParams.from,
|
userParams.from,
|
||||||
userParams.to,
|
userParams.to,
|
||||||
filterParams
|
filterParams,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -154,6 +159,11 @@ const downloadCSV = async () => {
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<InvoiceOutNegativeBasesFilter data-key="negativeFilter" />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="negativeFilter"
|
data-key="negativeFilter"
|
||||||
|
@ -174,6 +184,7 @@ const downloadCSV = async () => {
|
||||||
auto-load
|
auto-load
|
||||||
:is-editable="false"
|
:is-editable="false"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:right-search="false"
|
||||||
>
|
>
|
||||||
<template #column-clientId="{ row }">
|
<template #column-clientId="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -24,11 +25,11 @@ const props = defineProps({
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`invoiceOut.params.${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
|
@ -49,38 +50,70 @@ const props = defineProps({
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnSelect
|
||||||
v-model="params.company"
|
url="Companies"
|
||||||
:label="t('globals.company')"
|
:label="t('globals.company')"
|
||||||
is-outlined
|
v-model="params.company"
|
||||||
/>
|
option-label="code"
|
||||||
|
option-value="code"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.code }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnSelect
|
||||||
|
url="Countries"
|
||||||
|
:label="t('globals.params.countryFk')"
|
||||||
v-model="params.country"
|
v-model="params.country"
|
||||||
:label="t('globals.country')"
|
option-label="name"
|
||||||
is-outlined
|
option-value="name"
|
||||||
/>
|
outlined
|
||||||
|
dense
|
||||||
|
rounded
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id}` }}
|
||||||
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
</template>
|
||||||
<QItem>
|
</VnSelect>
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
v-model="params.clientId"
|
|
||||||
:label="t('invoiceOut.negativeBases.clientId')"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnSelect
|
||||||
v-model="params.clientSocialName"
|
url="Clients"
|
||||||
:label="t('globals.client')"
|
:label="t('globals.client')"
|
||||||
is-outlined
|
v-model="params.clientId"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
rounded
|
||||||
|
@update:model-value="searchFn()"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -90,15 +123,18 @@ const props = defineProps({
|
||||||
v-model="params.amount"
|
v-model="params.amount"
|
||||||
:label="t('globals.amount')"
|
:label="t('globals.amount')"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
:positive="false"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnSelectWorker
|
||||||
v-model="params.comercialName"
|
|
||||||
:label="t('invoiceOut.negativeBases.comercial')"
|
:label="t('invoiceOut.negativeBases.comercial')"
|
||||||
|
v-model="params.workerName"
|
||||||
|
option-value="name"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@update:model-value="searchFn()"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -4,7 +4,7 @@ invoiceOut:
|
||||||
params:
|
params:
|
||||||
company: Company
|
company: Company
|
||||||
country: Country
|
country: Country
|
||||||
clientId: Client ID
|
clientId: Client
|
||||||
clientSocialName: Client
|
clientSocialName: Client
|
||||||
taxableBase: Base
|
taxableBase: Base
|
||||||
ticketFk: Ticket
|
ticketFk: Ticket
|
||||||
|
@ -12,6 +12,18 @@ invoiceOut:
|
||||||
hasToInvoice: Has to invoice
|
hasToInvoice: Has to invoice
|
||||||
hasVerifiedData: Verified data
|
hasVerifiedData: Verified data
|
||||||
workerName: Worker
|
workerName: Worker
|
||||||
|
isTaxDataChecked: Verified data
|
||||||
|
amount: Amount
|
||||||
|
clientFk: Client
|
||||||
|
companyFk: Company
|
||||||
|
created: Created
|
||||||
|
dued: Dued
|
||||||
|
customsAgentFk: Custom Agent
|
||||||
|
ref: Reference
|
||||||
|
fi: FI
|
||||||
|
min: Min
|
||||||
|
max: Max
|
||||||
|
hasPdf: Has PDF
|
||||||
card:
|
card:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
customerCard: Customer card
|
customerCard: Customer card
|
||||||
|
@ -19,6 +31,7 @@ invoiceOut:
|
||||||
summary:
|
summary:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
dued: Due
|
dued: Due
|
||||||
|
expirationDate: Expiration date
|
||||||
booked: Booked
|
booked: Booked
|
||||||
taxBreakdown: Tax breakdown
|
taxBreakdown: Tax breakdown
|
||||||
taxableBase: Taxable base
|
taxableBase: Taxable base
|
||||||
|
@ -52,7 +65,7 @@ invoiceOut:
|
||||||
active: Active
|
active: Active
|
||||||
hasToInvoice: Has to Invoice
|
hasToInvoice: Has to Invoice
|
||||||
verifiedData: Verified Data
|
verifiedData: Verified Data
|
||||||
comercial: Commercial
|
comercial: Sales person
|
||||||
errors:
|
errors:
|
||||||
downloadCsvFailed: CSV download failed
|
downloadCsvFailed: CSV download failed
|
||||||
invoiceOutModule:
|
invoiceOutModule:
|
||||||
|
|
|
@ -4,7 +4,7 @@ invoiceOut:
|
||||||
params:
|
params:
|
||||||
company: Empresa
|
company: Empresa
|
||||||
country: País
|
country: País
|
||||||
clientId: ID del cliente
|
clientId: Cliente
|
||||||
clientSocialName: Cliente
|
clientSocialName: Cliente
|
||||||
taxableBase: Base
|
taxableBase: Base
|
||||||
ticketFk: Ticket
|
ticketFk: Ticket
|
||||||
|
@ -12,6 +12,18 @@ invoiceOut:
|
||||||
hasToInvoice: Debe facturar
|
hasToInvoice: Debe facturar
|
||||||
hasVerifiedData: Datos verificados
|
hasVerifiedData: Datos verificados
|
||||||
workerName: Comercial
|
workerName: Comercial
|
||||||
|
isTaxDataChecked: Datos comprobados
|
||||||
|
amount: Importe
|
||||||
|
clientFk: Cliente
|
||||||
|
companyFk: Empresa
|
||||||
|
created: Creada
|
||||||
|
dued: Vencida
|
||||||
|
customsAgentFk: Agente aduanas
|
||||||
|
ref: Referencia
|
||||||
|
fi: CIF
|
||||||
|
min: Min
|
||||||
|
max: Max
|
||||||
|
hasPdf: Tiene PDF
|
||||||
card:
|
card:
|
||||||
issued: Fecha emisión
|
issued: Fecha emisión
|
||||||
customerCard: Ficha del cliente
|
customerCard: Ficha del cliente
|
||||||
|
@ -19,6 +31,7 @@ invoiceOut:
|
||||||
summary:
|
summary:
|
||||||
issued: Fecha
|
issued: Fecha
|
||||||
dued: Fecha límite
|
dued: Fecha límite
|
||||||
|
expirationDate: Fecha vencimiento
|
||||||
booked: Contabilizada
|
booked: Contabilizada
|
||||||
taxBreakdown: Desglose impositivo
|
taxBreakdown: Desglose impositivo
|
||||||
taxableBase: Base imp.
|
taxableBase: Base imp.
|
||||||
|
|
|
@ -92,7 +92,6 @@ const updateStock = async () => {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
data-key="Item"
|
data-key="Item"
|
||||||
module="Item"
|
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
:url="`Items/${entityId}/getCard`"
|
:url="`Items/${entityId}/getCard`"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
|
|
@ -110,10 +110,16 @@ const columns = computed(() => [
|
||||||
attrs: { inWhere: true },
|
attrs: { inWhere: true },
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.visible'),
|
||||||
|
name: 'stock',
|
||||||
|
attrs: { inWhere: true },
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const totalLabels = computed(() =>
|
const totalLabels = computed(() =>
|
||||||
rows.value.reduce((acc, row) => acc + row.stock / row.packing, 0).toFixed(2)
|
rows.value.reduce((acc, row) => acc + row.stock / row.packing, 0).toFixed(2),
|
||||||
);
|
);
|
||||||
|
|
||||||
const removeLines = async () => {
|
const removeLines = async () => {
|
||||||
|
@ -157,7 +163,7 @@ watchEffect(selectedRows);
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('shelvings.removeConfirmTitle'),
|
t('shelvings.removeConfirmTitle'),
|
||||||
t('shelvings.removeConfirmSubtitle'),
|
t('shelvings.removeConfirmSubtitle'),
|
||||||
removeLines
|
removeLines,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
||||||
|
@ -16,17 +14,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemTypeWorkersOptions = ref([]);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="TicketRequests/getItemTypeWorker"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
|
||||||
/>
|
|
||||||
<ItemsFilterPanel :data-key="props.dataKey" :custom-tags="['tags']">
|
<ItemsFilterPanel :data-key="props.dataKey" :custom-tags="['tags']">
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
|
@ -34,14 +24,15 @@ const itemTypeWorkersOptions = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.buyerFk')"
|
:label="t('params.buyerFk')"
|
||||||
v-model="params.buyerFk"
|
v-model="params.buyerFk"
|
||||||
:options="itemTypeWorkersOptions"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
option-value="id"
|
:fields="['id', 'nickname']"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
use-input
|
use-input
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
sort-by="nickname ASC"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -50,11 +41,10 @@ const itemTypeWorkersOptions = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:fields="['id', 'name']"
|
||||||
|
sort-by="name ASC"
|
||||||
:label="t('params.warehouseFk')"
|
:label="t('params.warehouseFk')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -26,7 +26,6 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="ItemType"
|
|
||||||
:url="`ItemTypes/${entityId}`"
|
:url="`ItemTypes/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -61,6 +61,7 @@ function exprBuilder(param, value) {
|
||||||
case 'nickname':
|
case 'nickname':
|
||||||
return { [`t.nickname`]: { like: `%${value}%` } };
|
return { [`t.nickname`]: { like: `%${value}%` } };
|
||||||
case 'zoneFk':
|
case 'zoneFk':
|
||||||
|
return { 't.zoneFk': value };
|
||||||
case 'department':
|
case 'department':
|
||||||
return { 'd.name': value };
|
return { 'd.name': value };
|
||||||
case 'totalWithVat':
|
case 'totalWithVat':
|
||||||
|
|
|
@ -39,7 +39,7 @@ const addToOrder = async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: orderTotal } = await axios.get(
|
const { data: orderTotal } = await axios.get(
|
||||||
`Orders/${Number(route.params.id)}/getTotal`
|
`Orders/${Number(route.params.id)}/getTotal`,
|
||||||
);
|
);
|
||||||
|
|
||||||
state.set('orderTotal', orderTotal);
|
state.set('orderTotal', orderTotal);
|
||||||
|
@ -56,7 +56,7 @@ const canAddToOrder = () => {
|
||||||
if (canAddToOrder) {
|
if (canAddToOrder) {
|
||||||
const excedQuantity = prices.value.reduce(
|
const excedQuantity = prices.value.reduce(
|
||||||
(acc, { quantity }) => acc + quantity,
|
(acc, { quantity }) => acc + quantity,
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
if (excedQuantity > props.item.available) {
|
if (excedQuantity > props.item.available) {
|
||||||
canAddToOrder = false;
|
canAddToOrder = false;
|
||||||
|
|
|
@ -57,7 +57,6 @@ const total = ref(0);
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`Orders/${entityId}`"
|
:url="`Orders/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Order"
|
|
||||||
title="client.name"
|
title="client.name"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="Order"
|
data-key="Order"
|
||||||
|
|
|
@ -22,7 +22,6 @@ const card = computed(() => store.data);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Agency"
|
|
||||||
data-key="Agency"
|
data-key="Agency"
|
||||||
:url="`Agencies/${entityId}`"
|
:url="`Agencies/${entityId}`"
|
||||||
:title="card?.name"
|
:title="card?.name"
|
||||||
|
|
|
@ -46,7 +46,6 @@ const exprBuilder = (param, value) => {
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (agencyList = data)"
|
@on-fetch="(data) => (agencyList = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -54,7 +53,6 @@ const exprBuilder = (param, value) => {
|
||||||
url="Agencies"
|
url="Agencies"
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (agencyAgreementList = data)"
|
@on-fetch="(data) => (agencyAgreementList = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -120,7 +118,11 @@ const exprBuilder = (param, value) => {
|
||||||
<VnSelectSupplier
|
<VnSelectSupplier
|
||||||
:label="t('Autonomous')"
|
:label="t('Autonomous')"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
hide-selected
|
url="Suppliers"
|
||||||
|
:fields="['name']"
|
||||||
|
sort-by="name ASC"
|
||||||
|
option-value="name"
|
||||||
|
option-label="name"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
import { dashIfEmpty, toDate } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
|
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
|
||||||
import filter from './RouteFilter.js';
|
import filter from './RouteFilter.js';
|
||||||
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -16,14 +18,32 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const zone = ref();
|
||||||
|
const zoneId = ref();
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
const getZone = async () => {
|
||||||
|
const filter = {
|
||||||
|
where: { routeFk: $props.id ? $props.id : route.params.id },
|
||||||
|
};
|
||||||
|
const { data } = await axios.get('Tickets/findOne', {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify(filter),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
zoneId.value = data.zoneFk;
|
||||||
|
const { data: zoneData } = await axios.get(`Zones/${zoneId.value}`);
|
||||||
|
zone.value = zoneData.name;
|
||||||
|
};
|
||||||
|
const data = ref(useCardDescription());
|
||||||
|
const setData = (entity) => (data.value = useCardDescription(entity.code, entity.id));
|
||||||
|
onMounted(async () => {
|
||||||
|
getZone();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Route"
|
|
||||||
:url="`Routes/${entityId}`"
|
:url="`Routes/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:title="null"
|
:title="null"
|
||||||
|
@ -31,9 +51,9 @@ const entityId = computed(() => {
|
||||||
width="lg-width"
|
width="lg-width"
|
||||||
>
|
>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="$t('Date')" :value="toDate(entity?.created)" />
|
<VnLv :label="$t('Date')" :value="toDate(entity?.dated)" />
|
||||||
<VnLv :label="$t('Agency')" :value="entity?.agencyMode?.name" />
|
<VnLv :label="$t('Agency')" :value="entity?.agencyMode?.name" />
|
||||||
<VnLv :label="$t('Zone')" :value="entity?.zone?.name" />
|
<VnLv :label="$t('Zone')" :value="zone" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="$t('Volume')"
|
:label="$t('Volume')"
|
||||||
:value="`${dashIfEmpty(entity?.m3)} / ${dashIfEmpty(
|
:value="`${dashIfEmpty(entity?.m3)} / ${dashIfEmpty(
|
||||||
|
|
|
@ -14,7 +14,6 @@ export default {
|
||||||
'started',
|
'started',
|
||||||
'finished',
|
'finished',
|
||||||
'cost',
|
'cost',
|
||||||
'zoneFk',
|
|
||||||
'isOk',
|
'isOk',
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
|
@ -23,7 +22,6 @@ export default {
|
||||||
relation: 'vehicle',
|
relation: 'vehicle',
|
||||||
scope: { fields: ['id', 'm3'] },
|
scope: { fields: ['id', 'm3'] },
|
||||||
},
|
},
|
||||||
{ relation: 'zone', scope: { fields: ['id', 'name'] } },
|
|
||||||
{
|
{
|
||||||
relation: 'worker',
|
relation: 'worker',
|
||||||
scope: {
|
scope: {
|
||||||
|
|
|
@ -28,7 +28,6 @@ const defaultInitialData = {
|
||||||
isOk: false,
|
isOk: false,
|
||||||
};
|
};
|
||||||
const maxDistance = ref();
|
const maxDistance = ref();
|
||||||
|
|
||||||
const onSave = (data, response) => {
|
const onSave = (data, response) => {
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
axios.post(`Routes/${response?.id}/updateWorkCenter`);
|
axios.post(`Routes/${response?.id}/updateWorkCenter`);
|
||||||
|
|
|
@ -48,7 +48,6 @@ const onFetch = (data) => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}"
|
}"
|
||||||
limit="30"
|
|
||||||
@on-fetch="onFetch"
|
@on-fetch="onFetch"
|
||||||
/>
|
/>
|
||||||
<div :class="[isDialog ? 'column' : 'form-gap', 'full-width flex']">
|
<div :class="[isDialog ? 'column' : 'form-gap', 'full-width flex']">
|
||||||
|
|
|
@ -18,6 +18,7 @@ const onSave = (data, response) => {
|
||||||
<template>
|
<template>
|
||||||
<FormModel
|
<FormModel
|
||||||
:update-url="`Roadmaps/${$route.params?.id}`"
|
:update-url="`Roadmaps/${$route.params?.id}`"
|
||||||
|
:url="`Roadmaps/${$route.params?.id}`"
|
||||||
observe-form-changes
|
observe-form-changes
|
||||||
model="Roadmap"
|
model="Roadmap"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -26,12 +26,7 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor :url="`Roadmaps/${entityId}`" :filter="filter" data-key="Roadmap">
|
||||||
module="Roadmap"
|
|
||||||
:url="`Roadmaps/${entityId}`"
|
|
||||||
:filter="filter"
|
|
||||||
data-key="Roadmap"
|
|
||||||
>
|
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('Roadmap')" :value="entity?.name" />
|
<VnLv :label="t('Roadmap')" :value="entity?.name" />
|
||||||
<VnLv :label="t('ETD')" :value="toDateHourMin(entity?.etd)" />
|
<VnLv :label="t('ETD')" :value="toDateHourMin(entity?.etd)" />
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
@ -65,6 +63,7 @@ const emit = defineEmits(['search']);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelectSupplier
|
<VnSelectSupplier
|
||||||
:label="t('Carrier')"
|
:label="t('Carrier')"
|
||||||
|
:fields="['id', 'nickname']"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
|
@ -280,7 +280,7 @@ const openTicketsDialog = (id) => {
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="q-pt-none">
|
<QCardSection class="q-pt-none">
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('route.Stating date')"
|
:label="t('route.Starting date')"
|
||||||
v-model="startingDate"
|
v-model="startingDate"
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
|
@ -335,6 +335,7 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="vn:clone"
|
icon="vn:clone"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
flat
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="confirmationDialog = true"
|
@click="confirmationDialog = true"
|
||||||
|
@ -344,6 +345,7 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="cloud_download"
|
icon="cloud_download"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
flat
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="showRouteReport"
|
@click="showRouteReport"
|
||||||
|
@ -353,6 +355,7 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="check"
|
icon="check"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
flat
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="markAsServed()"
|
@click="markAsServed()"
|
||||||
|
|
|
@ -9,7 +9,6 @@ const { notify } = useNotify();
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
:url="`Vehicles/${$route.params.id}`"
|
:url="`Vehicles/${$route.params.id}`"
|
||||||
module="Vehicle"
|
|
||||||
data-key="Vehicle"
|
data-key="Vehicle"
|
||||||
title="numberPlate"
|
title="numberPlate"
|
||||||
:to-module="{ name: 'VehicleList' }"
|
:to-module="{ name: 'VehicleList' }"
|
||||||
|
|
|
@ -25,7 +25,6 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Shelving"
|
|
||||||
:url="`Shelvings/${entityId}`"
|
:url="`Shelvings/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -8,6 +8,11 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
|
||||||
const sectors = ref([]);
|
const sectors = ref([]);
|
||||||
const sectorFilter = { fields: ['id', 'description'] };
|
const sectorFilter = { fields: ['id', 'description'] };
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: ['sectorFk', 'code', 'pickingOrder'],
|
||||||
|
include: [{ relation: 'sector', scope: sectorFilter }],
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -26,10 +31,6 @@ const sectorFilter = { fields: ['id', 'description'] };
|
||||||
:label="$t('parking.pickingOrder')"
|
:label="$t('parking.pickingOrder')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
|
||||||
<VnInput v-model="data.row" :label="$t('parking.row')" />
|
|
||||||
<VnInput v-model="data.column" :label="$t('parking.column')" />
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.sectorFk"
|
v-model="data.sectorFk"
|
||||||
|
|
|
@ -17,7 +17,6 @@ const entityId = computed(() => props.id || route.params.id);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Parking"
|
|
||||||
data-key="Parking"
|
data-key="Parking"
|
||||||
:url="`Parkings/${entityId}`"
|
:url="`Parkings/${entityId}`"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
parking:
|
parking:
|
||||||
pickingOrder: Picking order
|
pickingOrder: Picking order
|
||||||
sector: Sector
|
sector: Sector
|
||||||
row: Row
|
|
||||||
column: Column
|
|
||||||
search: Search parking
|
search: Search parking
|
||||||
searchInfo: You can search by parking code
|
searchInfo: You can search by parking code
|
|
@ -1,7 +1,5 @@
|
||||||
parking:
|
parking:
|
||||||
pickingOrder: Orden de recogida
|
pickingOrder: Orden de recogida
|
||||||
row: Fila
|
|
||||||
sector: Sector
|
sector: Sector
|
||||||
column: Columna
|
|
||||||
search: Buscar parking
|
search: Buscar parking
|
||||||
searchInfo: Puedes buscar por código de parking
|
searchInfo: Puedes buscar por código de parking
|
|
@ -62,7 +62,6 @@ const getEntryQueryParams = (supplier) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Supplier"
|
|
||||||
:url="`Suppliers/${entityId}`"
|
:url="`Suppliers/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
data-key="Supplier"
|
data-key="Supplier"
|
||||||
|
|
|
@ -44,7 +44,6 @@ function ticketFilter(ticket) {
|
||||||
@on-fetch="(data) => ([problems] = data)"
|
@on-fetch="(data) => ([problems] = data)"
|
||||||
/>
|
/>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Ticket"
|
|
||||||
:url="`Tickets/${entityId}`"
|
:url="`Tickets/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
data-key="Ticket"
|
data-key="Ticket"
|
||||||
|
|
|
@ -21,6 +21,10 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: 'mana',
|
default: 'mana',
|
||||||
},
|
},
|
||||||
|
sale: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['save', 'cancel']);
|
const emit = defineEmits(['save', 'cancel']);
|
||||||
|
@ -29,8 +33,8 @@ const { t } = useI18n();
|
||||||
const QPopupProxyRef = ref(null);
|
const QPopupProxyRef = ref(null);
|
||||||
const manaCode = ref($props.manaCode);
|
const manaCode = ref($props.manaCode);
|
||||||
|
|
||||||
const save = () => {
|
const save = (sale = $props.sale) => {
|
||||||
emit('save');
|
emit('save', sale);
|
||||||
QPopupProxyRef.value.hide();
|
QPopupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,16 +42,20 @@ const cancel = () => {
|
||||||
emit('cancel');
|
emit('cancel');
|
||||||
QPopupProxyRef.value.hide();
|
QPopupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
defineExpose({ save });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy ref="QPopupProxyRef">
|
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketEditManaProxy">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<QSpinner v-if="!mana" color="primary" size="md" />
|
<QSpinner v-if="!mana" color="primary" size="md" />
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<slot />
|
<slot :popup="QPopupProxyRef" />
|
||||||
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
|
<VnUsesMana :mana-code="manaCode" />
|
||||||
|
</div>
|
||||||
<div v-if="newPrice" class="column items-center q-mt-lg">
|
<div v-if="newPrice" class="column items-center q-mt-lg">
|
||||||
<span class="text-primary">{{ t('New price') }}</span>
|
<span class="text-primary">{{ t('New price') }}</span>
|
||||||
<span class="text-subtitle1">
|
<span class="text-subtitle1">
|
||||||
|
@ -56,9 +64,6 @@ const cancel = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
|
||||||
<VnUsesMana :mana-code="manaCode" />
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -49,7 +49,7 @@ watch(
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="(data) => (listPackagingsOptions = data)"
|
@on-fetch="(data) => (listPackagingsOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{ fields: ['packagingFk', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['packagingFk', 'name'], order: 'name ASC' }"
|
||||||
url="Packagings/listPackaging"
|
url="Packagings/listPackaging"
|
||||||
/>
|
/>
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
|
|
|
@ -22,7 +22,6 @@ import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnUsesMana from 'src/components/ui/VnUsesMana.vue';
|
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
@ -33,6 +32,7 @@ const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const editPriceProxyRef = ref(null);
|
const editPriceProxyRef = ref(null);
|
||||||
|
const editManaProxyRef = ref(null);
|
||||||
const stateBtnDropdownRef = ref(null);
|
const stateBtnDropdownRef = ref(null);
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const arrayData = useArrayData('Ticket');
|
const arrayData = useArrayData('Ticket');
|
||||||
|
@ -53,7 +53,6 @@ const transfer = ref({
|
||||||
sales: [],
|
sales: [],
|
||||||
});
|
});
|
||||||
const tableRef = ref([]);
|
const tableRef = ref([]);
|
||||||
const canProceed = ref();
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.params.id,
|
() => route.params.id,
|
||||||
|
@ -133,7 +132,6 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.amount'),
|
label: t('globals.amount'),
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
format: (row) => parseInt(row.amount * row.quantity),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -183,8 +181,6 @@ const resetChanges = async () => {
|
||||||
};
|
};
|
||||||
const rowToUpdate = ref(null);
|
const rowToUpdate = ref(null);
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
canProceed.value = await isSalePrepared(sale);
|
|
||||||
if (!canProceed.value) return;
|
|
||||||
if (
|
if (
|
||||||
!sale.itemFk ||
|
!sale.itemFk ||
|
||||||
sale.quantity == null ||
|
sale.quantity == null ||
|
||||||
|
@ -193,11 +189,21 @@ const changeQuantity = async (sale) => {
|
||||||
return;
|
return;
|
||||||
if (!sale.id) return addSale(sale);
|
if (!sale.id) return addSale(sale);
|
||||||
|
|
||||||
|
if (await isSalePrepared(sale)) {
|
||||||
|
await confirmUpdate(() => updateQuantity(sale));
|
||||||
|
} else await updateQuantity(sale);
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateQuantity = async (sale) => {
|
||||||
try {
|
try {
|
||||||
|
let { quantity, id } = sale;
|
||||||
if (!rowToUpdate.value) return;
|
if (!rowToUpdate.value) return;
|
||||||
rowToUpdate.value = null;
|
rowToUpdate.value = null;
|
||||||
sale.isNew = false;
|
sale.isNew = false;
|
||||||
await updateQuantity(sale);
|
const params = { quantity: quantity };
|
||||||
|
await axios.post(`Sales/${id}/updateQuantity`, params);
|
||||||
|
notify('globals.dataSaved', 'positive');
|
||||||
|
tableRef.value.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
||||||
(s) => s.id === sale.id,
|
(s) => s.id === sale.id,
|
||||||
|
@ -207,12 +213,6 @@ const changeQuantity = async (sale) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateQuantity = async ({ quantity, id }) => {
|
|
||||||
const params = { quantity: quantity };
|
|
||||||
await axios.post(`Sales/${id}/updateQuantity`, params);
|
|
||||||
notify('globals.dataSaved', 'positive');
|
|
||||||
};
|
|
||||||
|
|
||||||
const addSale = async (sale) => {
|
const addSale = async (sale) => {
|
||||||
const params = {
|
const params = {
|
||||||
barcode: sale.itemFk,
|
barcode: sale.itemFk,
|
||||||
|
@ -237,13 +237,17 @@ const addSale = async (sale) => {
|
||||||
sale.isNew = false;
|
sale.isNew = false;
|
||||||
arrayData.fetch({});
|
arrayData.fetch({});
|
||||||
};
|
};
|
||||||
|
const changeConcept = async (sale) => {
|
||||||
|
if (await isSalePrepared(sale)) {
|
||||||
|
await confirmUpdate(() => updateConcept(sale));
|
||||||
|
} else await updateConcept(sale);
|
||||||
|
};
|
||||||
|
|
||||||
const updateConcept = async (sale) => {
|
const updateConcept = async (sale) => {
|
||||||
canProceed.value = await isSalePrepared(sale);
|
|
||||||
if (!canProceed.value) return;
|
|
||||||
const data = { newConcept: sale.concept };
|
const data = { newConcept: sale.concept };
|
||||||
await axios.post(`Sales/${sale.id}/updateConcept`, data);
|
await axios.post(`Sales/${sale.id}/updateConcept`, data);
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
|
tableRef.value.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_EDIT = {
|
const DEFAULT_EDIT = {
|
||||||
|
@ -295,33 +299,43 @@ const onOpenEditDiscountPopover = async (sale) => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const changePrice = async (sale) => {
|
||||||
const updatePrice = async (sale) => {
|
|
||||||
canProceed.value = await isSalePrepared(sale);
|
|
||||||
if (!canProceed.value) return;
|
|
||||||
const newPrice = edit.value.price;
|
const newPrice = edit.value.price;
|
||||||
if (newPrice != null && newPrice != sale.price) {
|
if (newPrice != null && newPrice != sale.price) {
|
||||||
|
if (await isSalePrepared(sale)) {
|
||||||
|
await confirmUpdate(() => updatePrice(sale, newPrice));
|
||||||
|
} else updatePrice(sale, newPrice);
|
||||||
|
}
|
||||||
|
await getMana();
|
||||||
|
};
|
||||||
|
const updatePrice = async (sale, newPrice) => {
|
||||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||||
sale.price = newPrice;
|
sale.price = newPrice;
|
||||||
edit.value = { ...DEFAULT_EDIT };
|
edit.value = { ...DEFAULT_EDIT };
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
}
|
tableRef.value.reload();
|
||||||
|
|
||||||
await getMana();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeDiscount = async (sale) => {
|
const changeDiscount = async (sale) => {
|
||||||
canProceed.value = await isSalePrepared(sale);
|
|
||||||
if (!canProceed.value) return;
|
|
||||||
const newDiscount = edit.value.discount;
|
const newDiscount = edit.value.discount;
|
||||||
if (newDiscount != null && newDiscount != sale.discount) updateDiscount([sale]);
|
if (newDiscount != null && newDiscount != sale.discount) {
|
||||||
|
if (await isSalePrepared(sale))
|
||||||
|
await confirmUpdate(() => updateDiscount([sale], newDiscount));
|
||||||
|
else await updateDiscount([sale], newDiscount);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateDiscounts = async (sales, newDiscount = null) => {
|
||||||
|
const salesTracking = await fetchSalesTracking();
|
||||||
|
|
||||||
|
const someSaleIsPrepared = salesTracking.some((sale) =>
|
||||||
|
matchSale(salesTracking, sale),
|
||||||
|
);
|
||||||
|
if (someSaleIsPrepared) await confirmUpdate(() => updateDiscount(sales, newDiscount));
|
||||||
|
else updateDiscount(sales, newDiscount);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateDiscount = async (sales, newDiscount = null) => {
|
const updateDiscount = async (sales, newDiscount = null) => {
|
||||||
for (const sale of sales) {
|
|
||||||
const canProceed = await isSalePrepared(sale);
|
|
||||||
if (!canProceed) return;
|
|
||||||
}
|
|
||||||
const saleIds = sales.map((sale) => sale.id);
|
const saleIds = sales.map((sale) => sale.id);
|
||||||
const _newDiscount = newDiscount || edit.value.discount;
|
const _newDiscount = newDiscount || edit.value.discount;
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -331,8 +345,7 @@ const updateDiscount = async (sales, newDiscount = null) => {
|
||||||
};
|
};
|
||||||
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
|
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
for (let sale of sales) sale.discount = _newDiscount;
|
tableRef.value.reload();
|
||||||
edit.value = { ...DEFAULT_EDIT };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNewPrice = computed(() => {
|
const getNewPrice = computed(() => {
|
||||||
|
@ -425,9 +438,13 @@ onMounted(async () => {
|
||||||
const items = ref([]);
|
const items = ref([]);
|
||||||
const newRow = ref({});
|
const newRow = ref({});
|
||||||
|
|
||||||
|
const changeItem = async (sale) => {
|
||||||
|
if (await isSalePrepared(sale)) {
|
||||||
|
await confirmUpdate(() => updateItem(sale));
|
||||||
|
} else await updateItem(sale);
|
||||||
|
};
|
||||||
|
|
||||||
const updateItem = async (row) => {
|
const updateItem = async (row) => {
|
||||||
canProceed.value = await isSalePrepared(row);
|
|
||||||
if (!canProceed.value) return;
|
|
||||||
const selectedItem = items.value.find((item) => item.id === row.itemFk);
|
const selectedItem = items.value.find((item) => item.id === row.itemFk);
|
||||||
if (selectedItem) {
|
if (selectedItem) {
|
||||||
row.item = selectedItem;
|
row.item = selectedItem;
|
||||||
|
@ -471,7 +488,18 @@ const endNewRow = (row) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function isSalePrepared(item) {
|
async function confirmUpdate(cb) {
|
||||||
|
await quasar
|
||||||
|
.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('Item prepared'),
|
||||||
|
message: t('This item is already prepared. Do you want to continue?'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.onOk(cb);
|
||||||
|
}
|
||||||
|
async function fetchSalesTracking() {
|
||||||
const filter = {
|
const filter = {
|
||||||
params: {
|
params: {
|
||||||
where: { ticketFk: route.params.id },
|
where: { ticketFk: route.params.id },
|
||||||
|
@ -483,48 +511,37 @@ async function isSalePrepared(item) {
|
||||||
filter: JSON.stringify(filter),
|
filter: JSON.stringify(filter),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
return data;
|
||||||
const matchingSale = data.find((sale) => sale.itemFk === item.itemFk);
|
|
||||||
if (!matchingSale) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
matchingSale.hasSaleGroupDetail ||
|
|
||||||
matchingSale.isControled ||
|
|
||||||
matchingSale.isPrepared ||
|
|
||||||
matchingSale.isPrevious ||
|
|
||||||
matchingSale.isPreviousSelected
|
|
||||||
) {
|
|
||||||
try {
|
|
||||||
await new Promise((resolve, reject) => {
|
|
||||||
quasar
|
|
||||||
.dialog({
|
|
||||||
component: VnConfirm,
|
|
||||||
componentProps: {
|
|
||||||
title: t('Item prepared'),
|
|
||||||
message: t(
|
|
||||||
'This item is already prepared. Do you want to continue?',
|
|
||||||
),
|
|
||||||
data: item,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.onOk(() => resolve(true))
|
|
||||||
.onCancel(() => reject(new Error('cancelled')));
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
tableRef.value.reload();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function isSalePrepared(sale) {
|
||||||
|
const data = await fetchSalesTracking();
|
||||||
|
return matchSale(data, sale);
|
||||||
|
}
|
||||||
|
function matchSale(data, sale) {
|
||||||
|
const matchingSale = data.find(({ itemFk }) => itemFk === sale.itemFk);
|
||||||
|
|
||||||
|
if (!matchingSale) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isPrepared(matchingSale);
|
||||||
|
}
|
||||||
|
function isPrepared(sale) {
|
||||||
|
const flagsToCheck = [
|
||||||
|
'hasSaleGroupDetail',
|
||||||
|
'isControled',
|
||||||
|
'isPrepared',
|
||||||
|
'isPrevious',
|
||||||
|
'isPreviousSelected',
|
||||||
|
];
|
||||||
|
return flagsToCheck.some((flag) => sale[flag] === 1);
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => newRow.value.itemFk,
|
() => newRow.value.itemFk,
|
||||||
(newItemFk) => {
|
(newItemFk) => {
|
||||||
if (newItemFk) {
|
if (newItemFk) {
|
||||||
updateItem(newRow.value);
|
changeItem(newRow.value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -585,7 +602,7 @@ watch(
|
||||||
:mana="mana"
|
:mana="mana"
|
||||||
:ticket-config="ticketConfig"
|
:ticket-config="ticketConfig"
|
||||||
@get-mana="getMana()"
|
@get-mana="getMana()"
|
||||||
@update-discounts="updateDiscount"
|
@update-discounts="updateDiscounts"
|
||||||
@refresh-table="resetChanges"
|
@refresh-table="resetChanges"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -716,7 +733,7 @@ watch(
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="row.itemFk"
|
v-model="row.itemFk"
|
||||||
:use-like="false"
|
:use-like="false"
|
||||||
@update:model-value="updateItem(row)"
|
@update:model-value="changeItem(row)"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -742,16 +759,21 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row" :max-length="6" />
|
<FetchedTags :item="row" :max-length="6" />
|
||||||
<QPopupProxy v-if="row.id && isTicketEditable">
|
<QPopupProxy v-if="row.id && isTicketEditable">
|
||||||
<VnInput v-model="row.concept" @change="updateConcept(row)" />
|
<VnInput
|
||||||
|
v-model="row.concept"
|
||||||
|
@keyup.enter.stop="changeConcept(row)"
|
||||||
|
:hint="t('globals.enterToConfirm')"
|
||||||
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
<template #column-quantity="{ row }">
|
<template #column-quantity="{ row }">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
data-cy="ticketSaleQuantityInput"
|
||||||
v-if="row.isNew || isTicketEditable"
|
v-if="row.isNew || isTicketEditable"
|
||||||
type="number"
|
type="number"
|
||||||
v-model.number="row.quantity"
|
v-model.number="row.quantity"
|
||||||
@blur="changeQuantity(row)"
|
@blur="changeQuantity(row)"
|
||||||
@keyup.enter="changeQuantity(row)"
|
@keyup.enter.stop="changeQuantity(row)"
|
||||||
@update:model-value="() => (rowToUpdate = row)"
|
@update:model-value="() => (rowToUpdate = row)"
|
||||||
@focus="edit.oldQuantity = row.quantity"
|
@focus="edit.oldQuantity = row.quantity"
|
||||||
/>
|
/>
|
||||||
|
@ -765,10 +787,12 @@ watch(
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
ref="editPriceProxyRef"
|
ref="editPriceProxyRef"
|
||||||
:mana="mana"
|
:mana="mana"
|
||||||
|
:sale="row"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
@save="updatePrice(row)"
|
@save="changePrice"
|
||||||
>
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||||
v-model.number="edit.price"
|
v-model.number="edit.price"
|
||||||
:label="t('basicData.price')"
|
:label="t('basicData.price')"
|
||||||
type="number"
|
type="number"
|
||||||
|
@ -782,27 +806,29 @@ watch(
|
||||||
<QBtn flat class="link" dense @click="onOpenEditDiscountPopover(row)">
|
<QBtn flat class="link" dense @click="onOpenEditDiscountPopover(row)">
|
||||||
{{ toPercentage(row.discount / 100) }}
|
{{ toPercentage(row.discount / 100) }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
|
ref="editManaProxyRef"
|
||||||
:mana="mana"
|
:mana="mana"
|
||||||
|
:sale="row"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
:uses-mana="usesMana"
|
:uses-mana="usesMana"
|
||||||
:mana-code="manaCode"
|
:mana-code="manaCode"
|
||||||
@save="changeDiscount(row)"
|
@save="changeDiscount"
|
||||||
>
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
autofocus
|
||||||
|
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||||
v-model.number="edit.discount"
|
v-model.number="edit.discount"
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
|
||||||
<VnUsesMana :mana-code="manaCode" />
|
|
||||||
</div>
|
|
||||||
</TicketEditManaProxy>
|
</TicketEditManaProxy>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-amount="{ row }">
|
<template #column-amount="{ row }">
|
||||||
{{ toCurrency(row.quantity * row.price) }}
|
{{ toCurrency(getSaleTotal(row)) }}
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ const redirectToCreateView = ({ itemFk }) => {
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'date',
|
name: 'date',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.date'),
|
label: t('negative.date'),
|
||||||
format: ({ timed }) => toDate(timed),
|
format: ({ timed }) => toDate(timed),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -47,7 +47,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
columnClass: 'shrink',
|
columnClass: 'shrink',
|
||||||
name: 'timed',
|
name: 'timed',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.timed'),
|
label: t('negative.timed'),
|
||||||
format: ({ timed }) => toHour(timed),
|
format: ({ timed }) => toHour(timed),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -58,7 +58,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.id'),
|
label: t('negative.id'),
|
||||||
format: ({ itemFk }) => itemFk,
|
format: ({ itemFk }) => itemFk,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -70,7 +70,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'longName',
|
name: 'longName',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.longName'),
|
label: t('negative.longName'),
|
||||||
field: ({ longName }) => longName,
|
field: ({ longName }) => longName,
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'producer',
|
name: 'producer',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.supplier'),
|
label: t('negative.supplier'),
|
||||||
field: ({ producer }) => dashIfEmpty(producer),
|
field: ({ producer }) => dashIfEmpty(producer),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -89,7 +89,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'inkFk',
|
name: 'inkFk',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.colour'),
|
label: t('negative.colour'),
|
||||||
field: ({ inkFk }) => inkFk,
|
field: ({ inkFk }) => inkFk,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -97,7 +97,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'size',
|
name: 'size',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.size'),
|
label: t('negative.size'),
|
||||||
field: ({ size }) => size,
|
field: ({ size }) => size,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -110,7 +110,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'category',
|
name: 'category',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.origen'),
|
label: t('negative.origen'),
|
||||||
field: ({ category }) => dashIfEmpty(category),
|
field: ({ category }) => dashIfEmpty(category),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -118,7 +118,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'lack',
|
name: 'lack',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
label: t('negative.lack'),
|
label: t('negative.lack'),
|
||||||
field: ({ lack }) => lack,
|
field: ({ lack }) => lack,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
@ -127,12 +127,12 @@ const columns = computed(() => [
|
||||||
columnClass: 'shrink',
|
columnClass: 'shrink',
|
||||||
},
|
},
|
||||||
sortable: true,
|
sortable: true,
|
||||||
headerStyle: 'padding-left: 33px',
|
headerStyle: 'padding-center: 33px',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('Open details'),
|
title: t('Open details'),
|
||||||
|
|
|
@ -52,27 +52,26 @@ const route = useRoute();
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'status',
|
name: 'status',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
columnClass: 'expand',
|
columnClass: 'shrink',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ticketFk',
|
name: 'ticketFk',
|
||||||
label: t('negative.detail.ticketFk'),
|
label: t('negative.detail.ticketFk'),
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'input',
|
component: 'input',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
},
|
},
|
||||||
columnClass: 'shrink',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
label: t('negative.detail.shipped'),
|
label: t('negative.detail.shipped'),
|
||||||
field: 'shipped',
|
field: 'shipped',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
format: ({ shipped }) => toDate(shipped),
|
format: ({ shipped }) => toDate(shipped),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
@ -84,11 +83,9 @@ const columns = computed(() => [
|
||||||
name: 'minTimed',
|
name: 'minTimed',
|
||||||
label: t('negative.detail.theoreticalhour'),
|
label: t('negative.detail.theoreticalhour'),
|
||||||
field: 'minTimed',
|
field: 'minTimed',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
format: ({ minTimed }) => toHour(minTimed),
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
component: 'time',
|
component: 'time',
|
||||||
columnClass: 'shrink',
|
|
||||||
columnFilter: {},
|
columnFilter: {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -104,29 +101,27 @@ const columns = computed(() => [
|
||||||
optionValue: 'code',
|
optionValue: 'code',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
columnClass: 'expand',
|
align: 'center',
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'zoneName',
|
name: 'zoneName',
|
||||||
label: t('negative.detail.zoneName'),
|
label: t('negative.detail.zoneName'),
|
||||||
field: 'zoneName',
|
field: 'zoneName',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'nickname',
|
name: 'nickname',
|
||||||
label: t('negative.detail.nickname'),
|
label: t('negative.detail.nickname'),
|
||||||
field: 'nickname',
|
field: 'nickname',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'quantity',
|
name: 'quantity',
|
||||||
label: t('negative.detail.quantity'),
|
label: t('negative.detail.quantity'),
|
||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
component: 'input',
|
component: 'input',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -167,7 +162,6 @@ const saveChange = async (field, { row }) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasToIgnore = (row) => row.hasToIgnore === 1;
|
|
||||||
function onBuysFetched(data) {
|
function onBuysFetched(data) {
|
||||||
Object.assign(item.value, data[0]);
|
Object.assign(item.value, data[0]);
|
||||||
}
|
}
|
||||||
|
@ -244,7 +238,7 @@ function onBuysFetched(data) {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-status="{ row }">
|
<template #column-status="{ row }">
|
||||||
<QTd style="width: 150px">
|
<QTd style="min-width: 150px">
|
||||||
<div class="icon-container">
|
<div class="icon-container">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.isBasket"
|
v-if="row.isBasket"
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, computed, reactive } from 'vue';
|
import { ref, computed, reactive, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import TicketFutureFilter from './TicketFutureFilter.vue';
|
import TicketFutureFilter from './TicketFutureFilter.vue';
|
||||||
|
|
||||||
import { dashIfEmpty, toCurrency } from 'src/filters';
|
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
|
||||||
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { toDateTimeFormat } from 'src/filters/date.js';
|
import { toDateTimeFormat } from 'src/filters/date.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -26,214 +24,126 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
|
|
||||||
const itemPackingTypesOptions = ref([]);
|
|
||||||
const selectedTickets = ref([]);
|
const selectedTickets = ref([]);
|
||||||
|
const vnTableRef = ref({});
|
||||||
const exprBuilder = (param, value) => {
|
const originElRef = ref(null);
|
||||||
switch (param) {
|
const destinationElRef = ref(null);
|
||||||
case 'id':
|
|
||||||
return { id: value };
|
|
||||||
case 'futureId':
|
|
||||||
return { futureId: value };
|
|
||||||
case 'liters':
|
|
||||||
return { liters: value };
|
|
||||||
case 'lines':
|
|
||||||
return { lines: value };
|
|
||||||
case 'iptColFilter':
|
|
||||||
return { ipt: { like: `%${value}%` } };
|
|
||||||
case 'futureIptColFilter':
|
|
||||||
return { futureIpt: { like: `%${value}%` } };
|
|
||||||
case 'totalWithVat':
|
|
||||||
return { totalWithVat: value };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const userParams = reactive({
|
const userParams = reactive({
|
||||||
futureScopeDays: Date.vnNew().toISOString(),
|
futureScopeDays: Date.vnNew().toISOString(),
|
||||||
originScopeDays: Date.vnNew().toISOString(),
|
originScopeDays: Date.vnNew().toISOString(),
|
||||||
warehouseFk: user.value.warehouseFk,
|
warehouseFk: user.value.warehouseFk,
|
||||||
});
|
});
|
||||||
|
|
||||||
const arrayData = useArrayData('FutureTickets', {
|
|
||||||
url: 'Tickets/getTicketsFuture',
|
|
||||||
userParams: userParams,
|
|
||||||
exprBuilder: exprBuilder,
|
|
||||||
});
|
|
||||||
const { store } = arrayData;
|
|
||||||
|
|
||||||
const params = reactive({
|
|
||||||
futureScopeDays: Date.vnNew(),
|
|
||||||
originScopeDays: Date.vnNew(),
|
|
||||||
warehouseFk: user.value.warehouseFk,
|
|
||||||
});
|
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
|
||||||
params[paramKey] = col.columnFilter.filterValue;
|
|
||||||
await arrayData.addFilter({ params });
|
|
||||||
};
|
|
||||||
|
|
||||||
const getInputEvents = (col) => {
|
|
||||||
return col.columnFilter.type === 'select'
|
|
||||||
? { 'update:modelValue': () => applyColumnFilter(col) }
|
|
||||||
: {
|
|
||||||
'keyup.enter': () => applyColumnFilter(col),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const tickets = computed(() => store.data);
|
|
||||||
|
|
||||||
const ticketColumns = computed(() => [
|
const ticketColumns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('futureTickets.problems'),
|
label: '',
|
||||||
name: 'problems',
|
name: 'problems',
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: null,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.ticketId'),
|
label: t('advanceTickets.ticketId'),
|
||||||
name: 'ticketId',
|
name: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'id',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('futureTickets.shipped'),
|
label: t('futureTickets.shipped'),
|
||||||
name: 'shipped',
|
name: 'shipped',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
columnFilter: false,
|
||||||
columnFilter: null,
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'center',
|
||||||
|
class: 'shrink',
|
||||||
label: t('advanceTickets.ipt'),
|
label: t('advanceTickets.ipt'),
|
||||||
name: 'ipt',
|
name: 'ipt',
|
||||||
field: 'ipt',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'iptColFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: itemPackingTypesOptions.value,
|
url: 'itemPackingTypes',
|
||||||
'option-value': 'code',
|
fields: ['code', 'description'],
|
||||||
'option-label': 'description',
|
where: { isActive: true },
|
||||||
dense: true,
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
|
inWhere: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.ipt),
|
||||||
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('ticketList.state'),
|
label: t('ticketList.state'),
|
||||||
name: 'state',
|
name: 'state',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
columnFilter: false,
|
||||||
columnFilter: null,
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.liters'),
|
label: t('advanceTickets.liters'),
|
||||||
name: 'liters',
|
name: 'liters',
|
||||||
field: 'liters',
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: {
|
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.import'),
|
label: t('advanceTickets.import'),
|
||||||
field: 'import',
|
|
||||||
name: 'import',
|
name: 'import',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
|
columnFilter: false,
|
||||||
|
format: (row) => toCurrency(row.totalWithVat),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('futureTickets.availableLines'),
|
label: t('futureTickets.availableLines'),
|
||||||
name: 'lines',
|
name: 'lines',
|
||||||
field: 'lines',
|
field: 'lines',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: {
|
format: (row, dashIfEmpty) => dashIfEmpty(row.lines),
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
format: (val) => dashIfEmpty(val),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.futureId'),
|
label: t('advanceTickets.futureId'),
|
||||||
name: 'futureId',
|
name: 'futureId',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator vertical-separator ',
|
||||||
columnFilter: {
|
columnClass: 'vertical-separator',
|
||||||
component: VnInput,
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
filterParamKey: 'futureId',
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('futureTickets.futureShipped'),
|
label: t('futureTickets.futureShipped'),
|
||||||
name: 'futureShipped',
|
name: 'futureShipped',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: null,
|
columnFilter: false,
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (row) => toDateTimeFormat(row.futureShipped),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
align: 'center',
|
||||||
label: t('advanceTickets.futureIpt'),
|
label: t('advanceTickets.futureIpt'),
|
||||||
|
class: 'shrink',
|
||||||
name: 'futureIpt',
|
name: 'futureIpt',
|
||||||
field: 'futureIpt',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnSelect,
|
component: 'select',
|
||||||
filterParamKey: 'futureIptColFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
attrs: {
|
||||||
options: itemPackingTypesOptions.value,
|
url: 'itemPackingTypes',
|
||||||
'option-value': 'code',
|
fields: ['code', 'description'],
|
||||||
'option-label': 'description',
|
where: { isActive: true },
|
||||||
dense: true,
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format: (val) => dashIfEmpty(val),
|
headerClass: 'horizontal-separator',
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.futureIpt),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.futureState'),
|
label: t('advanceTickets.futureState'),
|
||||||
name: 'futureState',
|
name: 'futureState',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
sortable: true,
|
headerClass: 'horizontal-separator',
|
||||||
columnFilter: null,
|
class: 'expand',
|
||||||
format: (val) => dashIfEmpty(val),
|
columnFilter: false,
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.futureState),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -258,26 +168,51 @@ const moveTicketsFuture = async () => {
|
||||||
await axios.post('Tickets/merge', params);
|
await axios.post('Tickets/merge', params);
|
||||||
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
notify(t('advanceTickets.moveTicketSuccess'), 'positive');
|
||||||
selectedTickets.value = [];
|
selectedTickets.value = [];
|
||||||
arrayData.fetch({ append: false });
|
vnTableRef.value.reload();
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
|
||||||
await arrayData.fetch({ append: false });
|
watch(
|
||||||
});
|
() => vnTableRef.value.tableRef?.$el,
|
||||||
|
($el) => {
|
||||||
|
if (!$el) return;
|
||||||
|
const head = $el.querySelector('thead');
|
||||||
|
const firstRow = $el.querySelector('thead > tr');
|
||||||
|
|
||||||
|
const newRow = document.createElement('tr');
|
||||||
|
destinationElRef.value = document.createElement('th');
|
||||||
|
originElRef.value = document.createElement('th');
|
||||||
|
|
||||||
|
newRow.classList.add('bg-header');
|
||||||
|
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
|
||||||
|
destinationElRef.value.setAttribute('colspan', '7');
|
||||||
|
originElRef.value.setAttribute('colspan', '9');
|
||||||
|
|
||||||
|
originElRef.value.textContent = `${t('advanceTickets.origin')}`;
|
||||||
|
destinationElRef.value.textContent = `${t('advanceTickets.destination')}`;
|
||||||
|
|
||||||
|
newRow.append(destinationElRef.value, originElRef.value);
|
||||||
|
head.insertBefore(newRow, firstRow);
|
||||||
|
},
|
||||||
|
{ once: true, inmmediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => vnTableRef.value.params,
|
||||||
|
() => {
|
||||||
|
if (originElRef.value && destinationElRef.value) {
|
||||||
|
destinationElRef.value.textContent = `${t('advanceTickets.origin')}`;
|
||||||
|
originElRef.value.textContent = `${t('advanceTickets.destination')}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true },
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="itemPackingTypes"
|
|
||||||
:filter="{
|
|
||||||
fields: ['code', 'description'],
|
|
||||||
order: 'description ASC',
|
|
||||||
where: { isActive: true },
|
|
||||||
}"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (itemPackingTypesOptions = data)"
|
|
||||||
/>
|
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="FutureTickets"
|
data-key="futureTicket"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('futureTickets.searchInfo')"
|
:info="t('futureTickets.searchInfo')"
|
||||||
/>
|
/>
|
||||||
|
@ -293,7 +228,7 @@ onMounted(async () => {
|
||||||
t(`futureTickets.moveTicketDialogSubtitle`, {
|
t(`futureTickets.moveTicketDialogSubtitle`, {
|
||||||
selectedTickets: selectedTickets.length,
|
selectedTickets: selectedTickets.length,
|
||||||
}),
|
}),
|
||||||
moveTicketsFuture
|
moveTicketsFuture,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -305,77 +240,29 @@ onMounted(async () => {
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<TicketFutureFilter data-key="FutureTickets" />
|
<TicketFutureFilter data-key="futureTickets" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<VnTable
|
||||||
:rows="tickets"
|
data-key="futureTickets"
|
||||||
|
ref="vnTableRef"
|
||||||
|
url="Tickets/getTicketsFuture"
|
||||||
|
search-url="futureTickets"
|
||||||
|
:user-params="userParams"
|
||||||
|
:limit="0"
|
||||||
:columns="ticketColumns"
|
:columns="ticketColumns"
|
||||||
row-key="id"
|
:table="{
|
||||||
selection="multiple"
|
'row-key': '$index',
|
||||||
|
selection: 'multiple',
|
||||||
|
}"
|
||||||
v-model:selected="selectedTickets"
|
v-model:selected="selectedTickets"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
:right-search="false"
|
||||||
:no-data-label="t('globals.noResults')"
|
auto-load
|
||||||
style="max-width: 99%"
|
:disable-option="{ card: true }"
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #column-problems="{ row }">
|
||||||
<QTr>
|
<span class="q-gutter-x-xs">
|
||||||
<QTh class="horizontal-separator" />
|
|
||||||
<QTh
|
|
||||||
class="horizontal-separator text-uppercase color-vn-label"
|
|
||||||
colspan="8"
|
|
||||||
translate
|
|
||||||
>
|
|
||||||
{{ t('advanceTickets.origin') }}
|
|
||||||
</QTh>
|
|
||||||
<QTh
|
|
||||||
class="horizontal-separator text-uppercase color-vn-label"
|
|
||||||
colspan="4"
|
|
||||||
translate
|
|
||||||
>
|
|
||||||
{{ t('advanceTickets.destination') }}
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
<QTr>
|
|
||||||
<QTh>
|
|
||||||
<QCheckbox v-model="props.selected" />
|
|
||||||
</QTh>
|
|
||||||
<QTh
|
|
||||||
v-for="(col, index) in ticketColumns"
|
|
||||||
:key="index"
|
|
||||||
:class="{ 'vertical-separator': col.name === 'futureId' }"
|
|
||||||
>
|
|
||||||
{{ col.label }}
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #top-row="{ cols }">
|
|
||||||
<QTr>
|
|
||||||
<QTd />
|
|
||||||
<QTd
|
|
||||||
v-for="(col, index) in cols"
|
|
||||||
:key="index"
|
|
||||||
style="max-width: 100px"
|
|
||||||
>
|
|
||||||
<component
|
|
||||||
:is="col.columnFilter.component"
|
|
||||||
v-if="col.columnFilter"
|
|
||||||
v-model="col.columnFilter.filterValue"
|
|
||||||
v-bind="col.columnFilter.attrs"
|
|
||||||
v-on="col.columnFilter.event(col)"
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #header-cell-availableLines="{ col }">
|
|
||||||
<QTh class="vertical-separator">
|
|
||||||
{{ col.label }}
|
|
||||||
</QTh>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-problems="{ row }">
|
|
||||||
<QTd class="q-gutter-x-xs">
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row.futureAgencyFk !== row.agencyFk && row.agencyFk"
|
v-if="row.futureAgencyFk !== row.agencyFk && row.agencyFk"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -400,83 +287,16 @@ onMounted(async () => {
|
||||||
</span>
|
</span>
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<TicketProblems :row />
|
||||||
v-if="row.isTaxDataChecked === 0"
|
</span>
|
||||||
color="primary"
|
|
||||||
name="vn:no036"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('futureTickets.noVerified') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasTicketRequest"
|
|
||||||
color="primary"
|
|
||||||
name="vn:buyrequest"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('futureTickets.purchaseRequest') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.itemShortage"
|
|
||||||
color="primary"
|
|
||||||
name="vn:unavailable"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('ticketSale.noVisible') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.isFreezed"
|
|
||||||
color="primary"
|
|
||||||
name="vn:frozen"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('futureTickets.clientFrozen') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.risk" color="primary" name="vn:risk" size="xs">
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('futureTickets.risk') }}: {{ row.risk }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasComponentLack"
|
|
||||||
color="primary"
|
|
||||||
name="vn:components"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('futureTickets.componentLack') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.hasRounding"
|
|
||||||
color="primary"
|
|
||||||
name="sync_problem"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('futureTickets.rounding') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-ticketId="{ row }">
|
<template #column-id="{ row }">
|
||||||
<QTd>
|
<QBtn flat class="link" @click.stop dense>
|
||||||
<QBtn flat class="link">
|
|
||||||
{{ row.id }}
|
{{ row.id }}
|
||||||
<TicketDescriptorProxy :id="row.id" />
|
<TicketDescriptorProxy :id="row.id" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-shipped="{ row }">
|
<template #column-shipped="{ row }">
|
||||||
<QTd class="shipped">
|
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="getDateQBadgeColor(row.shipped)"
|
:color="getDateQBadgeColor(row.shipped)"
|
||||||
|
@ -484,11 +304,10 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
{{ toDateTimeFormat(row.shipped) }}
|
{{ toDateTimeFormat(row.shipped) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-state="{ row }">
|
<template #column-state="{ row }">
|
||||||
<QTd>
|
|
||||||
<QBadge
|
<QBadge
|
||||||
|
v-if="row.state"
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="row.classColor"
|
:color="row.classColor"
|
||||||
class="q-ma-none"
|
class="q-ma-none"
|
||||||
|
@ -496,10 +315,9 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-import="{ row }">
|
<template #column-import="{ row }">
|
||||||
<QTd>
|
|
||||||
<QBadge
|
<QBadge
|
||||||
:text-color="
|
:text-color="
|
||||||
totalPriceColor(row.totalWithVat) === 'warning'
|
totalPriceColor(row.totalWithVat) === 'warning'
|
||||||
|
@ -512,18 +330,14 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
{{ toCurrency(row.totalWithVat || 0) }}
|
{{ toCurrency(row.totalWithVat || 0) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureId="{ row }">
|
<template #column-futureId="{ row }">
|
||||||
<QTd class="vertical-separator">
|
<QBtn flat class="link" @click.stop dense>
|
||||||
<QBtn flat class="link" dense>
|
|
||||||
{{ row.futureId }}
|
{{ row.futureId }}
|
||||||
<TicketDescriptorProxy :id="row.futureId" />
|
<TicketDescriptorProxy :id="row.futureId" />
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureShipped="{ row }">
|
<template #column-futureShipped="{ row }">
|
||||||
<QTd class="shipped">
|
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="getDateQBadgeColor(row.futureShipped)"
|
:color="getDateQBadgeColor(row.futureShipped)"
|
||||||
|
@ -531,33 +345,30 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
{{ toDateTimeFormat(row.futureShipped) }}
|
{{ toDateTimeFormat(row.futureShipped) }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureState="{ row }">
|
<template #column-futureState="{ row }">
|
||||||
<QTd>
|
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="row.futureClassColor"
|
:color="row.futureClassColor"
|
||||||
class="q-ma-none"
|
class="q-mr-xs"
|
||||||
dense
|
dense
|
||||||
>
|
>
|
||||||
{{ row.futureState }}
|
{{ row.futureState }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.shipped {
|
:deep(.vertical-separator) {
|
||||||
min-width: 132px;
|
|
||||||
}
|
|
||||||
.vertical-separator {
|
|
||||||
border-left: 4px solid white !important;
|
border-left: 4px solid white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.horizontal-separator {
|
:deep(.horizontal-separator) {
|
||||||
|
border-top: 4px solid white !important;
|
||||||
|
}
|
||||||
|
:deep(.horizontal-bottom-separator) {
|
||||||
border-bottom: 4px solid white !important;
|
border-bottom: 4px solid white !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import axios from 'axios';
|
||||||
import { onMounted } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
defineProps({
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -58,7 +58,7 @@ onMounted(async () => {
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="props.dataKey"
|
:data-key
|
||||||
:un-removable-params="['warehouseFk', 'originScopeDays ', 'futureScopeDays']"
|
:un-removable-params="['warehouseFk', 'originScopeDays ', 'futureScopeDays']"
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
|
|
|
@ -232,7 +232,7 @@ const columns = computed(() => [
|
||||||
|
|
||||||
function resetAgenciesSelector(formData) {
|
function resetAgenciesSelector(formData) {
|
||||||
agenciesOptions.value = [];
|
agenciesOptions.value = [];
|
||||||
if(formData) formData.agencyModeId = null;
|
if (formData) formData.agencyModeId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirectToLines(id) {
|
function redirectToLines(id) {
|
||||||
|
@ -248,14 +248,12 @@ const onClientSelected = async (formData) => {
|
||||||
|
|
||||||
const fetchAvailableAgencies = async (formData) => {
|
const fetchAvailableAgencies = async (formData) => {
|
||||||
resetAgenciesSelector(formData);
|
resetAgenciesSelector(formData);
|
||||||
const response= await getAgencies(formData, selectedClient.value);
|
const response = await getAgencies(formData, selectedClient.value);
|
||||||
if (!response) return;
|
if (!response) return;
|
||||||
|
|
||||||
const { options, agency } = response
|
const { options, agency } = response;
|
||||||
if(options)
|
if (options) agenciesOptions.value = options;
|
||||||
agenciesOptions.value = options;
|
if (agency) formData.agencyModeId = agency;
|
||||||
if(agency)
|
|
||||||
formData.agencyModeId = agency;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchClient = async (formData) => {
|
const fetchClient = async (formData) => {
|
||||||
|
@ -330,7 +328,7 @@ function openBalanceDialog(ticket) {
|
||||||
const description = ref([]);
|
const description = ref([]);
|
||||||
const firstTicketClientId = checkedTickets[0].clientFk;
|
const firstTicketClientId = checkedTickets[0].clientFk;
|
||||||
const isSameClient = checkedTickets.every(
|
const isSameClient = checkedTickets.every(
|
||||||
(ticket) => ticket.clientFk === firstTicketClientId
|
(ticket) => ticket.clientFk === firstTicketClientId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isSameClient) {
|
if (!isSameClient) {
|
||||||
|
@ -369,7 +367,7 @@ async function onSubmit() {
|
||||||
description: dialogData.value.value.description,
|
description: dialogData.value.value.description,
|
||||||
clientFk: dialogData.value.value.clientFk,
|
clientFk: dialogData.value.value.clientFk,
|
||||||
email: email[0].email,
|
email: email[0].email,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (data) notify('globals.dataSaved', 'positive');
|
if (data) notify('globals.dataSaved', 'positive');
|
||||||
|
@ -388,32 +386,32 @@ function setReference(data) {
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case 1:
|
case 1:
|
||||||
newDescription = `${t(
|
newDescription = `${t(
|
||||||
'ticketList.creditCard'
|
'ticketList.creditCard',
|
||||||
)}, ${dialogData.value.value.description.replace(
|
)}, ${dialogData.value.value.description.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
newDescription = `${t(
|
newDescription = `${t(
|
||||||
'ticketList.cash'
|
'ticketList.cash',
|
||||||
)}, ${dialogData.value.value.description.replace(
|
)}, ${dialogData.value.value.description.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
newDescription = `${newDescription.replace(
|
newDescription = `${newDescription.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
newDescription = `${t(
|
newDescription = `${t(
|
||||||
'ticketList.transfers'
|
'ticketList.transfers',
|
||||||
)}, ${dialogData.value.value.description.replace(
|
)}, ${dialogData.value.value.description.replace(
|
||||||
/^(Credit Card, |Cash, |Transfers, )/,
|
/^(Credit Card, |Cash, |Transfers, )/,
|
||||||
''
|
'',
|
||||||
)}`;
|
)}`;
|
||||||
break;
|
break;
|
||||||
case 3317:
|
case 3317:
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue