Compare commits
12 Commits
dev
...
fix_moreOp
Author | SHA1 | Date |
---|---|---|
Alex Moreno | 40568e183f | |
Alex Moreno | a8ad48fae1 | |
Alex Moreno | 34e00653f5 | |
Alex Moreno | ed3ad310c5 | |
Alex Moreno | b93633fc77 | |
Alex Moreno | 0aa75043b8 | |
Alex Moreno | af32a4d512 | |
Alex Moreno | 3506d2517a | |
Alex Moreno | 62ecc42a4b | |
Alex Moreno | 752456915c | |
Alex Moreno | 51ed160e5e | |
Alex Moreno | 6f7b83d593 |
186
CHANGELOG.md
186
CHANGELOG.md
|
@ -1,189 +1,3 @@
|
||||||
# Version 24.48 - 2024-11-25
|
|
||||||
|
|
||||||
### Added 🆕
|
|
||||||
|
|
||||||
- chore: correct checkNotification (fix_customer_issues) by:alexm
|
|
||||||
- chore: perf (warmFix_order_equalSalix) by:alexm
|
|
||||||
- chore: refs #6818 add spaces by:jorgep
|
|
||||||
- chore: refs #6818 drop useless code & comment by:jorgep
|
|
||||||
- chore: refs #7273 sticky add btn & refactor by:jorgep
|
|
||||||
- chore: refs #7524 fix test by:jorgep
|
|
||||||
- chore: refs #8039 not required by:alexm
|
|
||||||
- chore: refs #8078 fiz tests by:jorgep
|
|
||||||
- chore: refs #8078 rollback ref by:jorgep
|
|
||||||
- chore: remove console.log (warmFix_invoiceOut_Global) by:alexm
|
|
||||||
- chore: typo (fix_itemType-redirection) by:alexm
|
|
||||||
- feat: #6943 use openURL quasar by:Javier Segarra
|
|
||||||
- feat: #7782 add cypress report by:Javier Segarra
|
|
||||||
- feat: #7782 cypress.config watchForFileChanges by:Javier Segarra
|
|
||||||
- feat: #7782 npm run resetDatabase by:Javier Segarra
|
|
||||||
- feat: #7782 waitUntil domContentLoad by:Javier Segarra
|
|
||||||
- feat: added composable to confirm orders by:Jon
|
|
||||||
- feat: add /reports in gitignore (warmFix_reports_in_gitignore) by:alexm
|
|
||||||
- feat: apply changes for customerModule by:Javier Segarra
|
|
||||||
- feat: disabled buttons by:Javier Segarra
|
|
||||||
- feat: move buttons to DescriptorMenu by:Javier Segarra
|
|
||||||
- feat: refs #6818 add icon by:jorgep
|
|
||||||
- feat: refs #6818 fetch url & default channel by:jorgep
|
|
||||||
- feat: refs #6818 saysimple integration by:jorgep
|
|
||||||
- feat: refs #6839 module searching (6839-addSearchMenu) by:jorgep
|
|
||||||
- feat: refs #6839 normalize search by:jorgep
|
|
||||||
- feat: refs #6919 sync entry data by:jorgep
|
|
||||||
- feat: refs #7006 itemType basic data new inputs by:guillermo
|
|
||||||
- feat: refs #7006 itemTypeLog added by:guillermo
|
|
||||||
- feat: refs #7193 modified parking to use the scope and corrected small errors by:Jon
|
|
||||||
- feat: refs #7206 added inactive label and corrected minor errors by:Jon
|
|
||||||
- feat: refs #7308 #7308 remove warnings related to useSession by:Javier Segarra
|
|
||||||
- feat: refs #7349 usa back con permisos by:jgallego
|
|
||||||
- feat: refs #7524 add front test by:jorgep
|
|
||||||
- feat: refs #7874 improve vn-notes ui by:jorgep
|
|
||||||
- feat: refs #7970 notify changes by:Jon
|
|
||||||
- feat(): refs #8039 canceledError not notify by:alexm
|
|
||||||
- feat: refs #8039 notify error unify by:alexm
|
|
||||||
- feat: refs #8039 show duplicate request in local by:alexm
|
|
||||||
- feat: refs #8078 add shortcut multi selection by:jorgep
|
|
||||||
- feat: refs #8078 add tests by:jorgep
|
|
||||||
- feat: refs#8087 Redadas en travel by:Carlos Andrés
|
|
||||||
- feat: refs #8087 Traspasar redadas a travels by:Carlos Andrés
|
|
||||||
- feat: remove comments by:Javier Segarra
|
|
||||||
- feat(Supplier): add companySize by:alexm
|
|
||||||
- feat: use composable to unify logic by:Javier Segarra
|
|
||||||
- feat(VnInput): empty to null by:alexm
|
|
||||||
- feat(VnSelect): order data equal salix by:alexm
|
|
||||||
- feat(VnSelect): refs #7136 add scroll (7136-vnSelect_paginate_simplify_2) by:alexm
|
|
||||||
|
|
||||||
### Changed 📦
|
|
||||||
|
|
||||||
- chore: perf (warmFix_order_equalSalix) by:alexm
|
|
||||||
- chore: refs #7273 sticky add btn & refactor by:jorgep
|
|
||||||
- fix: better performance (warmFix_accountAcls) by:alexm
|
|
||||||
- perf: minor bugs detected by:Javier Segarra
|
|
||||||
- perf: refs #6943 #6943 merge command by:Javier Segarra
|
|
||||||
- perf: refs #7283 #7283 declare composable inst4ead code duplicated by:Javier Segarra
|
|
||||||
- perf: refs #7283 #7283 handle composable i18n by:Javier Segarra
|
|
||||||
- perf: refs #7283 #7283 handle i18n by:Javier Segarra
|
|
||||||
- perf: refs #7283 #7283 i18n params by:Javier Segarra
|
|
||||||
- perf: refs #7308 #7308 remove comments by:Javier Segarra
|
|
||||||
- perf: remove appendParams by:Javier Segarra
|
|
||||||
- perf: use const in VnLocation by:Javier Segarra
|
|
||||||
- perf: use required instead :required="true" by:Javier Segarra
|
|
||||||
- refactor: apply QPopupProxy by:wbuezas
|
|
||||||
- refactor: changed confirmOrder directory by:Jon
|
|
||||||
- refactor: change keyup.enter for update:model-value by:wbuezas
|
|
||||||
- refactor(InvoiceInBasicData): use VnDms by:alexm
|
|
||||||
- refactor: modified composable by:Jon
|
|
||||||
- refactor: refs #6818 change channel source by:jorgep
|
|
||||||
- refactor: refs #6818 channel logic by:jorgep
|
|
||||||
- refactor: refs #6919 export filter by:jorgep
|
|
||||||
- refactor: refs #7132 1st wave of changes in global translations files by:Jon
|
|
||||||
- refactor: refs #7132 account's module translations by:Jon
|
|
||||||
- refactor: refs #7132 customer's module translations by:Jon
|
|
||||||
- refactor: refs #7132 deleted pageTitles repeated by:Jon
|
|
||||||
- refactor: refs #7132 delete duplicate translations' keys by:Jon
|
|
||||||
- refactor: refs #7132 deleted useless code by:Jon
|
|
||||||
- refactor: refs #7132 global translations files changed by:Jon
|
|
||||||
- refactor: refs #7266 Changed method name by:guillermo
|
|
||||||
- refactor: refs #7950 Created cmr model by:guillermo
|
|
||||||
- refactor: refs #7970 added emit by:Jon
|
|
||||||
- refactor: refs #7970 refactored VnConfirm to emit events by:Jon
|
|
||||||
- refactor: refs #8185 modified LeftMenu to avoid duplicates by:Jon
|
|
||||||
- refactor: remove unused variable by:wbuezas
|
|
||||||
- refactor: revert catalog changes by:Jon
|
|
||||||
- refactor: small change by:wbuezas
|
|
||||||
- test: refactor e2e by:alexm
|
|
||||||
- test: refs #8039 add hasNotify and, refactor: agencyWorkCenter test by:alexm
|
|
||||||
|
|
||||||
### Fixed 🛠️
|
|
||||||
|
|
||||||
- chore: refs #7524 fix test by:jorgep
|
|
||||||
- fix: better performance (warmFix_accountAcls) by:alexm
|
|
||||||
- fix: catalog view category and type filter by:wbuezas
|
|
||||||
- fix: category and tags filters by:Jon
|
|
||||||
- fix: changed route.query by:Jon
|
|
||||||
- fix: change type vnput by:Javier Segarra
|
|
||||||
- fix(ClaimList): stateCode orderBy priority by:alexm
|
|
||||||
- fix: entryFilters by:carlossa
|
|
||||||
- fix: filter panel by:Jon
|
|
||||||
- fix(InvoiceOutGlobal): parallelism by:alexm
|
|
||||||
- fix: itemBotanical by:Javier Segarra
|
|
||||||
- fix: itemType redirection and fix filters by:alexm
|
|
||||||
- fix: logout spec (warmFix_logout.spec) by:alexm
|
|
||||||
- fix: merge errors by:alexm
|
|
||||||
- fix: order catalog by:wbuezas
|
|
||||||
- fix: order catalog fixes by:wbuezas
|
|
||||||
- fix: refs #6818 use right icon by:jorgep
|
|
||||||
- fix: refs #6896 fixed module problems by:Jon
|
|
||||||
- fix: refs #7193 fixed e2e test by:Jon
|
|
||||||
- fix: refs #7206 deleted duplicate code by:Jon
|
|
||||||
- fix: refs #7273 use same filter by:jorgep
|
|
||||||
- fix: refs #7283 #7283 bugs by:Javier Segarra
|
|
||||||
- fix: refs #7283 #7283 ItemDiary subToolbar by:Javier Segarra
|
|
||||||
- fix: refs #7283 #7283 ItemSummary bugs by:Javier Segarra
|
|
||||||
- fix: refs #7283 Account image resolution by:guillermo
|
|
||||||
- fix: refs #7283 css by:jorgep
|
|
||||||
- fix: refs #7283 filter by:carlossa
|
|
||||||
- fix: refs #7283 fix image by:carlossa
|
|
||||||
- fix: refs #7283 fix pr by:carlossa
|
|
||||||
- fix: refs #7283 fix preview by:carlossa
|
|
||||||
- fix: refs #7283 fix required by:carlossa
|
|
||||||
- fix: refs #7283 item filters by:carlossa
|
|
||||||
- fix: refs #7283 itemtype fix by:carlossa
|
|
||||||
- fix: refs #7283 order translation by:carlossa
|
|
||||||
- fix: refs #7283 preview by:carlossa
|
|
||||||
- fix: refs #7283 tooltips !Item by:Javier Segarra
|
|
||||||
- fix: refs #7306 clean warning by:carlossa
|
|
||||||
- fix: refs #7310 clean warning by:carlossa
|
|
||||||
- fix: refs #7323 locale #7396 by:jorgep
|
|
||||||
- fix: refs #7323 show advanced fields by:jorgep
|
|
||||||
- fix: refs #7349 dependencia no usada by:jgallego
|
|
||||||
- fix: refs #7524 e2e & worker module by:jorgep
|
|
||||||
- fix: refs #7874 add title by:jorgep
|
|
||||||
- fix: refs #7874 show name by:jorgep
|
|
||||||
- fix: refs #7943 use correct data-key by:jorgep
|
|
||||||
- fix: refs #7943 use summary by:jorgep
|
|
||||||
- fix: refs #8039 bad tests by:alexm
|
|
||||||
- fix: refs #8039 o not handle unnecessary errors by:alexm
|
|
||||||
- fix: refs #8078 e2e #7970 by:jorgep
|
|
||||||
- fix: refs #8078 handleSelection by:jorgep
|
|
||||||
- fix: refs #8078 improve cy command (8078-enableMultiSelection) by:jorgep
|
|
||||||
- fix: refs #8078 improve handleSelection by:jorgep
|
|
||||||
- fix: reset category by:wbuezas
|
|
||||||
- fix: tag chips by:Jon
|
|
||||||
- fix: vnSearchbar spec (warmFix_vnSearchBar.spec) by:alexm
|
|
||||||
- fix(VnSelect): setOptions when applyFilter by:alexm
|
|
||||||
- fix: worker test e2e by:Jon
|
|
||||||
- Merge branch 'dev' into fix_customer_issues by:Javier Segarra
|
|
||||||
- refactor: revert catalog changes by:Jon
|
|
||||||
- refs #7283 fix conflicts by:carlossa
|
|
||||||
- refs #7283 fix descriptorproxy by:carlossa
|
|
||||||
- refs #7283 fixedPrice by:carlossa
|
|
||||||
- refs #7283 fixedPrices by:carlossa
|
|
||||||
- refs #7283 fix itemFixed by:carlossa
|
|
||||||
- refs #7283 fix itemFixedPrice by:carlossa
|
|
||||||
- refs #7283 fix itemMigration by:carlossa
|
|
||||||
- refs #7283 fix itemMigration list filters by:carlossa
|
|
||||||
- refs #7283 fix items by:carlossa
|
|
||||||
- refs #7283 fix items error get images by:carlossa
|
|
||||||
- refs #7283 fix items images by:carlossa
|
|
||||||
- refs #7283 fix request by:carlossa
|
|
||||||
- refs #7283 fix searchbar by:carlossa
|
|
||||||
- refs #7283 fix viewSummary by:carlossa
|
|
||||||
- refs #7283 fix yml list basicData by:carlossa
|
|
||||||
- refs #7283 itemRequest fix by:carlossa
|
|
||||||
- refs #7283 itemRequest fix deny by:carlossa
|
|
||||||
- refs #7283 itemRequest fix reload by:carlossa
|
|
||||||
- refs #72983 fix filters by:carlossa
|
|
||||||
- revert: commit by:Javier Segarra
|
|
||||||
- revert e57a253c6f649382da187d1129449d265fb26d3b by:Javier Segarra
|
|
||||||
- test: #8162 fix clientList spec by:Javier Segarra
|
|
||||||
- test: #8162 fix vnLocation spec by:Javier Segarra
|
|
||||||
- test: fix arrayData by:Javier Segarra
|
|
||||||
- test: fix e2e by:alexm
|
|
||||||
- test: fix e2e by:Javier Segarra
|
|
||||||
- test: refs #8039 fix WorkerNotification e2e by:alexm
|
|
||||||
- test: refs #8039 fix ZoneWarehouse e2e by:alexm
|
|
||||||
- warmfix: ItemLastEntries to date (origin/warmfix_itemLastEntriesFilter) by:Javier Segarra
|
|
||||||
|
|
||||||
# Version 24.40 - 2024-10-02
|
# Version 24.40 - 2024-10-02
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
const { defineConfig } = require('cypress');
|
const { defineConfig } = require('cypress');
|
||||||
// https://docs.cypress.io/app/tooling/reporters
|
|
||||||
// https://docs.cypress.io/app/references/configuration
|
|
||||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
|
@ -19,7 +16,6 @@ module.exports = defineConfig({
|
||||||
reporterOptions: {
|
reporterOptions: {
|
||||||
charts: true,
|
charts: true,
|
||||||
reportPageTitle: 'Cypress Inline Reporter',
|
reportPageTitle: 'Cypress Inline Reporter',
|
||||||
reportFilename: '[status]_[datetime]-report',
|
|
||||||
embeddedScreenshots: true,
|
embeddedScreenshots: true,
|
||||||
reportDir: 'test/cypress/reports',
|
reportDir: 'test/cypress/reports',
|
||||||
inlineAssets: true,
|
inlineAssets: true,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.50.0",
|
"version": "24.48.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -0,0 +1,155 @@
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, computed } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import FormModelPopup from './FormModelPopup.vue';
|
||||||
|
import VnInputDate from './common/VnInputDate.vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['onDataSaved']);
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const manualInvoiceFormData = reactive({
|
||||||
|
maxShipped: Date.vnNew(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const formModelPopupRef = ref();
|
||||||
|
const invoiceOutSerialsOptions = ref([]);
|
||||||
|
const taxAreasOptions = ref([]);
|
||||||
|
const ticketsOptions = ref([]);
|
||||||
|
const clientsOptions = ref([]);
|
||||||
|
const isLoading = computed(() => formModelPopupRef.value?.isLoading);
|
||||||
|
|
||||||
|
const onDataSaved = async (formData, requestResponse) => {
|
||||||
|
emit('onDataSaved', formData, requestResponse);
|
||||||
|
if (requestResponse && requestResponse.id)
|
||||||
|
router.push({ name: 'InvoiceOutSummary', params: { id: requestResponse.id } });
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="InvoiceOutSerials"
|
||||||
|
:filter="{ where: { code: { neq: 'R' } }, order: ['code'] }"
|
||||||
|
@on-fetch="(data) => (invoiceOutSerialsOptions = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="TaxAreas"
|
||||||
|
:filter="{ order: ['code'] }"
|
||||||
|
@on-fetch="(data) => (taxAreasOptions = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FormModelPopup
|
||||||
|
ref="formModelPopupRef"
|
||||||
|
:title="t('Create manual invoice')"
|
||||||
|
url-create="InvoiceOuts/createManualInvoice"
|
||||||
|
model="invoiceOut"
|
||||||
|
:form-initial-data="manualInvoiceFormData"
|
||||||
|
@on-data-saved="onDataSaved"
|
||||||
|
>
|
||||||
|
<template #form-inputs="{ data }">
|
||||||
|
<span v-if="isLoading" class="text-primary invoicing-text">
|
||||||
|
<QIcon name="warning" class="fill-icon q-mr-sm" size="md" />
|
||||||
|
{{ t('Invoicing in progress...') }}
|
||||||
|
</span>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Ticket')"
|
||||||
|
:options="ticketsOptions"
|
||||||
|
hide-selected
|
||||||
|
option-label="id"
|
||||||
|
option-value="id"
|
||||||
|
v-model="data.ticketFk"
|
||||||
|
@update:model-value="data.clientFk = null"
|
||||||
|
url="Tickets"
|
||||||
|
:where="{ refFk: null }"
|
||||||
|
:fields="['id', 'nickname']"
|
||||||
|
:filter-options="{ order: 'shipped DESC' }"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
|
||||||
|
<QItemLabel caption>{{ scope.opt?.nickname }}</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<span class="row items-center" style="max-width: max-content">{{
|
||||||
|
t('Or')
|
||||||
|
}}</span>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Client')"
|
||||||
|
:options="clientsOptions"
|
||||||
|
hide-selected
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
v-model="data.clientFk"
|
||||||
|
@update:model-value="data.ticketFk = null"
|
||||||
|
url="Clients"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
:filter-options="{ order: 'name ASC' }"
|
||||||
|
/>
|
||||||
|
<VnInputDate :label="t('Max date')" v-model="data.maxShipped" />
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Serial')"
|
||||||
|
:options="invoiceOutSerialsOptions"
|
||||||
|
hide-selected
|
||||||
|
option-label="description"
|
||||||
|
option-value="code"
|
||||||
|
v-model="data.serial"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('Area')"
|
||||||
|
:options="taxAreasOptions"
|
||||||
|
hide-selected
|
||||||
|
option-label="code"
|
||||||
|
option-value="code"
|
||||||
|
v-model="data.taxArea"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('Reference')"
|
||||||
|
type="textarea"
|
||||||
|
v-model="data.reference"
|
||||||
|
fill-input
|
||||||
|
autogrow
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormModelPopup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.invoicing-text {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: $primary;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Create manual invoice: Crear factura manual
|
||||||
|
Ticket: Ticket
|
||||||
|
Client: Cliente
|
||||||
|
Max date: Fecha límite
|
||||||
|
Serial: Serie
|
||||||
|
Area: Area
|
||||||
|
Reference: Referencia
|
||||||
|
Or: O
|
||||||
|
Invoicing in progress...: Facturación en progreso...
|
||||||
|
</i18n>
|
|
@ -17,6 +17,10 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
provinces: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -44,7 +48,7 @@ const onDataSaved = (...args) => {
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Name')"
|
:label="t('Names')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:rules="validate('city.name')"
|
:rules="validate('city.name')"
|
||||||
/>
|
/>
|
||||||
|
@ -52,6 +56,7 @@ const onDataSaved = (...args) => {
|
||||||
:province-selected="$props.provinceSelected"
|
:province-selected="$props.provinceSelected"
|
||||||
:country-fk="$props.countryFk"
|
:country-fk="$props.countryFk"
|
||||||
v-model="data.provinceFk"
|
v-model="data.provinceFk"
|
||||||
|
:provinces="$props.provinces"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -22,15 +22,12 @@ const postcodeFormData = reactive({
|
||||||
townFk: null,
|
townFk: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const townsFetchDataRef = ref(false);
|
const townsFetchDataRef = ref(null);
|
||||||
const countriesFetchDataRef = ref(false);
|
const provincesFetchDataRef = ref(null);
|
||||||
const provincesFetchDataRef = ref(false);
|
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
const provincesOptions = ref([]);
|
const provincesOptions = ref([]);
|
||||||
const townsOptions = ref([]);
|
const townsOptions = ref([]);
|
||||||
const town = ref({});
|
const town = ref({});
|
||||||
const townFilter = ref({});
|
|
||||||
const countryFilter = ref({});
|
|
||||||
|
|
||||||
function onDataSaved(formData) {
|
function onDataSaved(formData) {
|
||||||
const newPostcode = {
|
const newPostcode = {
|
||||||
|
@ -59,60 +56,10 @@ async function onCityCreated(newTown, formData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTown(newTown, data) {
|
function setTown(newTown, data) {
|
||||||
|
if (!newTown) return;
|
||||||
town.value = newTown;
|
town.value = newTown;
|
||||||
data.provinceFk = newTown?.provinceFk ?? newTown;
|
data.provinceFk = newTown.provinceFk;
|
||||||
data.countryFk = newTown?.province?.countryFk ?? newTown;
|
data.countryFk = newTown.province.countryFk;
|
||||||
}
|
|
||||||
|
|
||||||
async function setCountry(countryFk, data) {
|
|
||||||
data.townFk = null;
|
|
||||||
data.provinceFk = null;
|
|
||||||
data.countryFk = countryFk;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function filterTowns(name) {
|
|
||||||
if (name !== '') {
|
|
||||||
townFilter.value.where = {
|
|
||||||
name: {
|
|
||||||
like: `%${name}%`,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
await townsFetchDataRef.value?.fetch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function filterCountries(name) {
|
|
||||||
if (name !== '') {
|
|
||||||
countryFilter.value.where = {
|
|
||||||
name: {
|
|
||||||
like: `%${name}%`,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
await countriesFetchDataRef.value?.fetch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchTowns(countryFk) {
|
|
||||||
if (!countryFk) return;
|
|
||||||
townFilter.value.where = {
|
|
||||||
provinceFk: {
|
|
||||||
inq: provincesOptions.value.map(({ id }) => id),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
await townsFetchDataRef.value?.fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleProvinces(data) {
|
|
||||||
provincesOptions.value = data;
|
|
||||||
if (postcodeFormData.countryFk) {
|
|
||||||
await fetchTowns(postcodeFormData.countryFk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function handleTowns(data) {
|
|
||||||
townsOptions.value = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleCountries(data) {
|
|
||||||
countriesOptions.value = data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setProvince(id, data) {
|
async function setProvince(id, data) {
|
||||||
|
@ -126,7 +73,60 @@ async function onProvinceCreated(data) {
|
||||||
await provincesFetchDataRef.value.fetch({
|
await provincesFetchDataRef.value.fetch({
|
||||||
where: { countryFk: postcodeFormData.countryFk },
|
where: { countryFk: postcodeFormData.countryFk },
|
||||||
});
|
});
|
||||||
postcodeFormData.provinceFk = data.id;
|
postcodeFormData.provinceFk.value = data.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => [postcodeFormData.countryFk],
|
||||||
|
async (newCountryFk, oldValueFk) => {
|
||||||
|
if (Array.isArray(newCountryFk)) {
|
||||||
|
newCountryFk = newCountryFk[0];
|
||||||
|
}
|
||||||
|
if (Array.isArray(oldValueFk)) {
|
||||||
|
oldValueFk = oldValueFk[0];
|
||||||
|
}
|
||||||
|
if (!!oldValueFk && newCountryFk !== oldValueFk) {
|
||||||
|
postcodeFormData.provinceFk = null;
|
||||||
|
postcodeFormData.townFk = null;
|
||||||
|
}
|
||||||
|
if (oldValueFk !== newCountryFk) {
|
||||||
|
await provincesFetchDataRef.value.fetch({
|
||||||
|
where: {
|
||||||
|
countryFk: newCountryFk,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await townsFetchDataRef.value.fetch({
|
||||||
|
where: {
|
||||||
|
provinceFk: {
|
||||||
|
inq: provincesOptions.value.map(({ id }) => id),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => postcodeFormData.provinceFk,
|
||||||
|
async (newProvinceFk, oldValueFk) => {
|
||||||
|
if (Array.isArray(newProvinceFk)) {
|
||||||
|
newProvinceFk = newProvinceFk[0];
|
||||||
|
}
|
||||||
|
if (newProvinceFk !== oldValueFk) {
|
||||||
|
await townsFetchDataRef.value.fetch({
|
||||||
|
where: { provinceFk: newProvinceFk },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
async function handleProvinces(data) {
|
||||||
|
provincesOptions.value = data;
|
||||||
|
}
|
||||||
|
async function handleTowns(data) {
|
||||||
|
townsOptions.value = data;
|
||||||
|
}
|
||||||
|
async function handleCountries(data) {
|
||||||
|
countriesOptions.value = data;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -143,20 +143,10 @@ async function onProvinceCreated(data) {
|
||||||
ref="townsFetchDataRef"
|
ref="townsFetchDataRef"
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
:limit="30"
|
:limit="30"
|
||||||
:filter="townFilter"
|
|
||||||
@on-fetch="handleTowns"
|
@on-fetch="handleTowns"
|
||||||
auto-load
|
auto-load
|
||||||
url="Towns/location"
|
url="Towns/location"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
ref="countriesFetchDataRef"
|
|
||||||
:limit="30"
|
|
||||||
:filter="countryFilter"
|
|
||||||
:sort-by="['name ASC']"
|
|
||||||
@on-fetch="handleCountries"
|
|
||||||
auto-load
|
|
||||||
url="Countries"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
|
@ -178,7 +168,6 @@ async function onProvinceCreated(data) {
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('City')"
|
:label="t('City')"
|
||||||
@update:model-value="(value) => setTown(value, data)"
|
@update:model-value="(value) => setTown(value, data)"
|
||||||
@filter="filterTowns"
|
|
||||||
:tooltip="t('Create city')"
|
:tooltip="t('Create city')"
|
||||||
v-model="data.townFk"
|
v-model="data.townFk"
|
||||||
:options="townsOptions"
|
:options="townsOptions"
|
||||||
|
@ -204,6 +193,7 @@ async function onProvinceCreated(data) {
|
||||||
<CreateNewCityForm
|
<CreateNewCityForm
|
||||||
:country-fk="data.countryFk"
|
:country-fk="data.countryFk"
|
||||||
:province-selected="data.provinceFk"
|
:province-selected="data.provinceFk"
|
||||||
|
:provinces="provincesOptions"
|
||||||
@on-data-saved="
|
@on-data-saved="
|
||||||
(_, requestResponse) =>
|
(_, requestResponse) =>
|
||||||
onCityCreated(requestResponse, data)
|
onCityCreated(requestResponse, data)
|
||||||
|
@ -218,20 +208,20 @@ async function onProvinceCreated(data) {
|
||||||
:province-selected="data.provinceFk"
|
:province-selected="data.provinceFk"
|
||||||
@update:model-value="(value) => setProvince(value, data)"
|
@update:model-value="(value) => setProvince(value, data)"
|
||||||
v-model="data.provinceFk"
|
v-model="data.provinceFk"
|
||||||
@on-province-fetched="handleProvinces"
|
:clearable="true"
|
||||||
|
:provinces="provincesOptions"
|
||||||
@on-province-created="onProvinceCreated"
|
@on-province-created="onProvinceCreated"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
url="Countries"
|
||||||
|
:sort-by="['name ASC']"
|
||||||
:label="t('Country')"
|
:label="t('Country')"
|
||||||
@update:options="handleCountries"
|
@update:options="handleCountries"
|
||||||
:options="countriesOptions"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
@filter="filterCountries"
|
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
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)"
|
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, 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 FetchData from 'components/FetchData.vue';
|
||||||
|
@ -34,12 +34,6 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
);
|
);
|
||||||
emit('onDataSaved', dataSaved, requestResponse);
|
emit('onDataSaved', dataSaved, requestResponse);
|
||||||
};
|
};
|
||||||
const where = computed(() => {
|
|
||||||
if (!$props.countryFk) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
return { countryFk: $props.countryFk };
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -47,7 +41,9 @@ const where = computed(() => {
|
||||||
@on-fetch="(data) => (autonomiesOptions = data)"
|
@on-fetch="(data) => (autonomiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{
|
:filter="{
|
||||||
where,
|
where: {
|
||||||
|
countryFk: $props.countryFk,
|
||||||
|
},
|
||||||
}"
|
}"
|
||||||
url="Autonomies/location"
|
url="Autonomies/location"
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
|
|
|
@ -94,7 +94,6 @@ defineExpose({
|
||||||
saveChanges,
|
saveChanges,
|
||||||
getChanges,
|
getChanges,
|
||||||
formData,
|
formData,
|
||||||
originalData,
|
|
||||||
vnPaginateRef,
|
vnPaginateRef,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -395,7 +394,6 @@ watch(formUrl, async () => {
|
||||||
@click="onSubmit"
|
@click="onSubmit"
|
||||||
:disable="!hasChanges"
|
:disable="!hasChanges"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
data-cy="crudModelDefaultSaveBtn"
|
|
||||||
/>
|
/>
|
||||||
<slot name="moreAfterActions" />
|
<slot name="moreAfterActions" />
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
|
|
|
@ -91,10 +91,6 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
maxWidth: {
|
|
||||||
type: [String, Boolean],
|
|
||||||
default: '800px',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
const emit = defineEmits(['onFetch', 'onDataSaved']);
|
||||||
const modelValue = computed(
|
const modelValue = computed(
|
||||||
|
@ -287,7 +283,6 @@ defineExpose({
|
||||||
@submit="save"
|
@submit="save"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
|
||||||
id="formModel"
|
id="formModel"
|
||||||
>
|
>
|
||||||
<QCard>
|
<QCard>
|
||||||
|
@ -376,6 +371,7 @@ defineExpose({
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
#formModel {
|
#formModel {
|
||||||
|
max-width: 800px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const emit = defineEmits(['onSubmit']);
|
const emit = defineEmits(['onSubmit']);
|
||||||
|
|
||||||
const $props = defineProps({
|
defineProps({
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -25,21 +25,16 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
submitOnEnter: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
if ($props.submitOnEnter) {
|
|
||||||
emit('onSubmit');
|
emit('onSubmit');
|
||||||
closeForm();
|
closeForm();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeForm = () => {
|
const closeForm = () => {
|
||||||
|
|
|
@ -44,7 +44,7 @@ const onDataSaved = (data) => {
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="Items/regularize"
|
url-create="Items/regularize"
|
||||||
model="Items"
|
model="Items"
|
||||||
:title="t('Regularize stock')"
|
:title="t('item.regularizeStock')"
|
||||||
:form-initial-data="regularizeFormData"
|
:form-initial-data="regularizeFormData"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved($event)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
<script setup>
|
|
||||||
defineProps({ row: { type: Object, required: true } });
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<span>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.isTaxDataChecked === 0"
|
|
||||||
name="vn:no036"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.hasTicketRequest" name="vn:buyrequest" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.itemShortage" name="vn:unavailable" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
|
||||||
v-if="row.risk"
|
|
||||||
name="vn:risk"
|
|
||||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.hasComponentLack" name="vn:components" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="row.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
|
|
||||||
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['onProvinceCreated', 'onProvinceFetched']);
|
const emit = defineEmits(['onProvinceCreated']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
countryFk: {
|
countryFk: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -17,23 +17,20 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
provinces: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const provinceFk = defineModel({ type: Number, default: null });
|
const provinceFk = defineModel({ type: Number, default: null });
|
||||||
|
|
||||||
const { validate } = useValidator();
|
const { validate } = useValidator();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const filter = ref({
|
|
||||||
include: { relation: 'country' },
|
|
||||||
where: {
|
|
||||||
countryFk: $props.countryFk,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const provincesOptions = ref($props.provinces);
|
const provincesOptions = ref($props.provinces);
|
||||||
const provincesFetchDataRef = ref();
|
|
||||||
provinceFk.value = $props.provinceSelected;
|
provinceFk.value = $props.provinceSelected;
|
||||||
if (!$props.countryFk) {
|
const provincesFetchDataRef = ref();
|
||||||
filter.value.where = {};
|
|
||||||
}
|
|
||||||
async function onProvinceCreated(_, data) {
|
async function onProvinceCreated(_, data) {
|
||||||
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } });
|
await provincesFetchDataRef.value.fetch({ where: { countryFk: $props.countryFk } });
|
||||||
provinceFk.value = data.id;
|
provinceFk.value = data.id;
|
||||||
|
@ -42,33 +39,25 @@ async function onProvinceCreated(_, data) {
|
||||||
async function handleProvinces(data) {
|
async function handleProvinces(data) {
|
||||||
provincesOptions.value = data;
|
provincesOptions.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
|
||||||
() => $props.countryFk,
|
|
||||||
async () => {
|
|
||||||
if ($props.countryFk) {
|
|
||||||
filter.value.where.countryFk = $props.countryFk;
|
|
||||||
} else filter.value.where = {};
|
|
||||||
await provincesFetchDataRef.value.fetch({});
|
|
||||||
emit('onProvinceFetched', provincesOptions.value);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
ref="provincesFetchDataRef"
|
ref="provincesFetchDataRef"
|
||||||
:filter="filter"
|
:filter="{
|
||||||
|
include: { relation: 'country' },
|
||||||
|
where: {
|
||||||
|
countryFk: $props.countryFk,
|
||||||
|
},
|
||||||
|
}"
|
||||||
@on-fetch="handleProvinces"
|
@on-fetch="handleProvinces"
|
||||||
url="Provinces"
|
url="Provinces"
|
||||||
auto-load
|
|
||||||
/>
|
/>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('Province')"
|
:label="t('Province')"
|
||||||
:options="provincesOptions"
|
:options="$props.provinces"
|
||||||
:tooltip="t('Create province')"
|
:tooltip="t('Create province')"
|
||||||
hide-selected
|
hide-selected
|
||||||
:clearable="true"
|
|
||||||
v-model="provinceFk"
|
v-model="provinceFk"
|
||||||
:rules="validate && validate('postcode.provinceFk')"
|
:rules="validate && validate('postcode.provinceFk')"
|
||||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||||
|
|
|
@ -143,10 +143,6 @@ function alignRow() {
|
||||||
const showFilter = computed(
|
const showFilter = computed(
|
||||||
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions'
|
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions'
|
||||||
);
|
);
|
||||||
|
|
||||||
const onTabPressed = async () => {
|
|
||||||
if (model.value) enterEvent['keyup.enter']();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
|
@ -161,7 +157,6 @@ const onTabPressed = async () => {
|
||||||
v-model="model"
|
v-model="model"
|
||||||
:components="components"
|
:components="components"
|
||||||
component-prop="columnFilter"
|
component-prop="columnFilter"
|
||||||
@keydown.tab="onTabPressed"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -162,7 +162,9 @@ onMounted(() => {
|
||||||
: $props.defaultMode;
|
: $props.defaultMode;
|
||||||
stateStore.rightDrawer = quasar.screen.gt.xs;
|
stateStore.rightDrawer = quasar.screen.gt.xs;
|
||||||
columnsVisibilitySkipped.value = [
|
columnsVisibilitySkipped.value = [
|
||||||
...splittedColumns.value.columns.filter((c) => !c.visible).map((c) => c.name),
|
...splittedColumns.value.columns
|
||||||
|
.filter((c) => c.visible == false)
|
||||||
|
.map((c) => c.name),
|
||||||
...['tableActions'],
|
...['tableActions'],
|
||||||
];
|
];
|
||||||
createForm.value = $props.create;
|
createForm.value = $props.create;
|
||||||
|
@ -235,7 +237,7 @@ function splitColumns(columns) {
|
||||||
if (col.create) splittedColumns.value.create.push(col);
|
if (col.create) splittedColumns.value.create.push(col);
|
||||||
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
|
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
|
||||||
if ($props.isEditable && col.disable == null) col.disable = false;
|
if ($props.isEditable && col.disable == null) col.disable = false;
|
||||||
if ($props.useModel && col.columnFilter !== false)
|
if ($props.useModel && col.columnFilter != false)
|
||||||
col.columnFilter = { inWhere: true, ...col.columnFilter };
|
col.columnFilter = { inWhere: true, ...col.columnFilter };
|
||||||
splittedColumns.value.columns.push(col);
|
splittedColumns.value.columns.push(col);
|
||||||
}
|
}
|
||||||
|
@ -394,7 +396,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:name="col.orderBy ?? col.name"
|
:name="col.orderBy ?? col.name"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:vertical="false"
|
:vertical="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<slot
|
<slot
|
||||||
|
@ -737,7 +739,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
fab
|
fab
|
||||||
icon="add"
|
icon="add"
|
||||||
shortcut="+"
|
shortcut="+"
|
||||||
data-cy="vnTableCreateBtn"
|
|
||||||
/>
|
/>
|
||||||
<QTooltip self="top right">
|
<QTooltip self="top right">
|
||||||
{{ createForm?.title }}
|
{{ createForm?.title }}
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { QInput } from 'quasar';
|
import { QInput } from 'quasar';
|
||||||
|
|
||||||
const $props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
insertable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
||||||
|
|
||||||
let internalValue = ref($props.modelValue);
|
let internalValue = ref(props.modelValue);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => $props.modelValue,
|
() => props.modelValue,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
internalValue.value = newVal;
|
internalValue.value = newVal;
|
||||||
}
|
}
|
||||||
|
@ -32,46 +28,8 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleKeydown = (e) => {
|
|
||||||
if (e.key === 'Backspace') return;
|
|
||||||
if (e.key === '.') {
|
|
||||||
accountShortToStandard();
|
|
||||||
// TODO: Fix this setTimeout, with nextTick doesn't work
|
|
||||||
setTimeout(() => {
|
|
||||||
setCursorPosition(0, e.target);
|
|
||||||
}, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
|
||||||
handleInsertMode(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function setCursorPosition(pos, el = vnInputRef.value) {
|
|
||||||
el.focus();
|
|
||||||
el.setSelectionRange(pos, pos);
|
|
||||||
}
|
|
||||||
const vnInputRef = ref(false);
|
|
||||||
const handleInsertMode = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const input = e.target;
|
|
||||||
const cursorPos = input.selectionStart;
|
|
||||||
const { maxlength } = vnInputRef.value;
|
|
||||||
let currentValue = internalValue.value;
|
|
||||||
if (!currentValue) currentValue = e.key;
|
|
||||||
const newValue = e.key;
|
|
||||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
|
||||||
internalValue.value =
|
|
||||||
currentValue.substring(0, cursorPos) +
|
|
||||||
newValue +
|
|
||||||
currentValue.substring(cursorPos + 1);
|
|
||||||
}
|
|
||||||
nextTick(() => {
|
|
||||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
function accountShortToStandard() {
|
function accountShortToStandard() {
|
||||||
internalValue.value = internalValue.value?.replace(
|
internalValue.value = internalValue.value.replace(
|
||||||
'.',
|
'.',
|
||||||
'0'.repeat(11 - internalValue.value.length)
|
'0'.repeat(11 - internalValue.value.length)
|
||||||
);
|
);
|
||||||
|
@ -79,5 +37,5 @@ function accountShortToStandard() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QInput @keydown="handleKeydown" ref="vnInputRef" v-model="internalValue" />
|
<q-input v-model="internalValue" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, useAttrs, nextTick } from 'vue';
|
import { computed, ref, useAttrs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
|
@ -34,14 +34,6 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
insertable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
maxlength: {
|
|
||||||
type: Number,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const vnInputRef = ref(null);
|
const vnInputRef = ref(null);
|
||||||
|
@ -77,9 +69,6 @@ const mixinRules = [
|
||||||
requiredFieldRule,
|
requiredFieldRule,
|
||||||
...($attrs.rules ?? []),
|
...($attrs.rules ?? []),
|
||||||
(val) => {
|
(val) => {
|
||||||
const { maxlength } = vnInputRef.value;
|
|
||||||
if (maxlength && +val.length > maxlength)
|
|
||||||
return t(`maxLength`, { value: maxlength });
|
|
||||||
const { min, max } = vnInputRef.value.$attrs;
|
const { min, max } = vnInputRef.value.$attrs;
|
||||||
if (!min) return null;
|
if (!min) return null;
|
||||||
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min });
|
||||||
|
@ -89,33 +78,6 @@ const mixinRules = [
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleKeydown = (e) => {
|
|
||||||
if (e.key === 'Backspace') return;
|
|
||||||
|
|
||||||
if ($props.insertable && e.key.match(/[0-9]/)) {
|
|
||||||
handleInsertMode(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleInsertMode = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const input = e.target;
|
|
||||||
const cursorPos = input.selectionStart;
|
|
||||||
const { maxlength } = vnInputRef.value;
|
|
||||||
let currentValue = value.value;
|
|
||||||
if (!currentValue) currentValue = e.key;
|
|
||||||
const newValue = e.key;
|
|
||||||
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
|
|
||||||
value.value =
|
|
||||||
currentValue.substring(0, cursorPos) +
|
|
||||||
newValue +
|
|
||||||
currentValue.substring(cursorPos + 1);
|
|
||||||
}
|
|
||||||
nextTick(() => {
|
|
||||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -127,12 +89,10 @@ const handleInsertMode = (e) => {
|
||||||
:type="$attrs.type"
|
:type="$attrs.type"
|
||||||
:class="{ required: isRequired }"
|
:class="{ required: isRequired }"
|
||||||
@keyup.enter="emit('keyup.enter')"
|
@keyup.enter="emit('keyup.enter')"
|
||||||
@keydown="handleKeydown"
|
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:lazy-rules="true"
|
:lazy-rules="true"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
|
||||||
>
|
>
|
||||||
<template v-if="$slots.prepend" #prepend>
|
<template v-if="$slots.prepend" #prepend>
|
||||||
<slot name="prepend" />
|
<slot name="prepend" />
|
||||||
|
@ -169,11 +129,9 @@ const handleInsertMode = (e) => {
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
inputMin: Must be more than {value}
|
inputMin: Must be more than {value}
|
||||||
maxLength: The value exceeds {value} characters
|
|
||||||
inputMax: Must be less than {value}
|
inputMax: Must be less than {value}
|
||||||
es:
|
es:
|
||||||
inputMin: Debe ser mayor a {value}
|
inputMin: Debe ser mayor a {value}
|
||||||
maxLength: El valor excede los {value} carácteres
|
|
||||||
inputMax: Debe ser menor a {value}
|
inputMax: Debe ser menor a {value}
|
||||||
</i18n>
|
</i18n>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, watch, computed, ref, useAttrs } from 'vue';
|
import { onMounted, watch, computed, ref } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useAttrs } from 'vue';
|
||||||
import VnDate from './VnDate.vue';
|
import VnDate from './VnDate.vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,5 @@
|
||||||
const model = defineModel({ type: Boolean, required: true });
|
const model = defineModel({ type: Boolean, required: true });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QRadio
|
<QRadio v-model="model" v-bind="$attrs" dense :dark="true" class="q-mr-sm" />
|
||||||
v-model="model"
|
|
||||||
v-bind="$attrs"
|
|
||||||
dense
|
|
||||||
:dark="true"
|
|
||||||
class="q-mr-sm"
|
|
||||||
size="xs"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -138,6 +138,8 @@ onMounted(() => {
|
||||||
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ opts: myOptions });
|
||||||
|
|
||||||
const arrayDataKey =
|
const arrayDataKey =
|
||||||
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
|
||||||
|
|
||||||
|
@ -257,30 +259,6 @@ async function onScroll({ to, direction, from, index }) {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ opts: myOptions });
|
|
||||||
|
|
||||||
function handleKeyDown(event) {
|
|
||||||
if (event.key === 'Tab') {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const inputValue = vnSelectRef.value?.inputValue;
|
|
||||||
|
|
||||||
if (inputValue) {
|
|
||||||
const matchingOption = myOptions.value.find(
|
|
||||||
(option) =>
|
|
||||||
option[optionLabel.value].toLowerCase() === inputValue.toLowerCase()
|
|
||||||
);
|
|
||||||
|
|
||||||
if (matchingOption) {
|
|
||||||
emit('update:modelValue', matchingOption[optionValue.value]);
|
|
||||||
} else {
|
|
||||||
emit('update:modelValue', inputValue);
|
|
||||||
}
|
|
||||||
vnSelectRef.value?.hidePopup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -291,7 +269,6 @@ function handleKeyDown(event) {
|
||||||
:option-value="optionValue"
|
:option-value="optionValue"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@filter="filterHandler"
|
@filter="filterHandler"
|
||||||
@keydown="handleKeyDown"
|
|
||||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||||
:map-options="nullishToTrue($attrs['map-options'])"
|
:map-options="nullishToTrue($attrs['map-options'])"
|
||||||
:use-input="nullishToTrue($attrs['use-input'])"
|
:use-input="nullishToTrue($attrs['use-input'])"
|
||||||
|
@ -306,7 +283,6 @@ function handleKeyDown(event) {
|
||||||
:input-debounce="useURL ? '300' : '0'"
|
:input-debounce="useURL ? '300' : '0'"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
@virtual-scroll="onScroll"
|
@virtual-scroll="onScroll"
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
|
||||||
>
|
>
|
||||||
<template v-if="isClearable" #append>
|
<template v-if="isClearable" #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -86,7 +86,7 @@ async function send() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QDialog ref="dialogRef" data-cy="vnSmsDialog">
|
<QDialog ref="dialogRef">
|
||||||
<QCard class="q-pa-sm">
|
<QCard class="q-pa-sm">
|
||||||
<QCardSection class="row items-center q-pb-none">
|
<QCardSection class="row items-center q-pb-none">
|
||||||
<span class="text-h6 text-grey">
|
<span class="text-h6 text-grey">
|
||||||
|
@ -161,7 +161,6 @@ async function send() {
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
color="primary"
|
color="primary"
|
||||||
unelevated
|
unelevated
|
||||||
data-cy="sendSmsBtn"
|
|
||||||
/>
|
/>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
|
@ -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 VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -47,7 +48,6 @@ let store;
|
||||||
let entity;
|
let entity;
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
||||||
const menuRef = ref();
|
|
||||||
defineExpose({ getData });
|
defineExpose({ getData });
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
@ -159,25 +159,11 @@ const toModule = computed(() =>
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<QBtn
|
<VnMoreOptions v-if="$slots.menu">
|
||||||
v-if="$slots.menu"
|
<template #menu="{ menuRef }">
|
||||||
color="white"
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
icon="more_vert"
|
|
||||||
round
|
|
||||||
size="md"
|
|
||||||
data-cy="descriptor-more-opts"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('components.cardDescriptor.moreOptions') }}
|
|
||||||
</QTooltip>
|
|
||||||
<QMenu :ref="menuRef">
|
|
||||||
<QList>
|
|
||||||
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
||||||
</QList>
|
</template>
|
||||||
</QMenu>
|
</VnMoreOptions>
|
||||||
</QBtn>
|
|
||||||
</div>
|
</div>
|
||||||
<slot name="before" />
|
<slot name="before" />
|
||||||
<div class="body q-py-sm">
|
<div class="body q-py-sm">
|
||||||
|
|
|
@ -5,6 +5,7 @@ import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { isDialogOpened } from 'src/filters';
|
import { isDialogOpened } from 'src/filters';
|
||||||
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -83,9 +84,14 @@ async function fetch() {
|
||||||
<slot name="header" :entity="entity" dense>
|
<slot name="header" :entity="entity" dense>
|
||||||
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="header-right" :entity="entity">
|
<span class="row no-wrap">
|
||||||
<span></span>
|
<slot name="header-right" :entity="entity" />
|
||||||
</slot>
|
<VnMoreOptions v-if="$slots.menu && isDialogOpened()">
|
||||||
|
<template #menu="{ menuRef }">
|
||||||
|
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
|
||||||
|
</template>
|
||||||
|
</VnMoreOptions>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="summaryBody row q-mb-md">
|
<div class="summaryBody row q-mb-md">
|
||||||
<slot name="body" :entity="entity" />
|
<slot name="body" :entity="entity" />
|
||||||
|
|
|
@ -37,7 +37,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
hiddenTags: {
|
hiddenTags: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ['filter', 'or', 'and'],
|
default: () => ['filter', 'search', 'or', 'and'],
|
||||||
},
|
},
|
||||||
customTags: {
|
customTags: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -61,6 +61,7 @@ const emit = defineEmits([
|
||||||
'update:modelValue',
|
'update:modelValue',
|
||||||
'refresh',
|
'refresh',
|
||||||
'clear',
|
'clear',
|
||||||
|
'search',
|
||||||
'init',
|
'init',
|
||||||
'remove',
|
'remove',
|
||||||
'setUserParams',
|
'setUserParams',
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<template>
|
||||||
|
<QBtn
|
||||||
|
color="white"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
icon="more_vert"
|
||||||
|
round
|
||||||
|
size="md"
|
||||||
|
data-cy="descriptor-more-opts"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ $t('components.cardDescriptor.moreOptions') }}
|
||||||
|
</QTooltip>
|
||||||
|
<QMenu ref="menuRef">
|
||||||
|
<QList>
|
||||||
|
<slot name="menu" :menu-ref="$refs.menuRef" />
|
||||||
|
</QList>
|
||||||
|
</QMenu>
|
||||||
|
</QBtn>
|
||||||
|
</template>
|
|
@ -132,24 +132,10 @@ const addFilter = async (filter, params) => {
|
||||||
|
|
||||||
async function fetch(params) {
|
async function fetch(params) {
|
||||||
useArrayData(props.dataKey, params);
|
useArrayData(props.dataKey, params);
|
||||||
arrayData.reset(['filter.skip', 'skip', 'page']);
|
arrayData.reset(['filter.skip', 'skip']);
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
return emitStoreData();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function update(params) {
|
|
||||||
useArrayData(props.dataKey, params);
|
|
||||||
const { limit, skip } = store;
|
|
||||||
store.limit = limit + skip;
|
|
||||||
store.skip = 0;
|
|
||||||
await arrayData.fetch({ append: false });
|
|
||||||
store.limit = limit;
|
|
||||||
store.skip = skip;
|
|
||||||
return emitStoreData();
|
|
||||||
}
|
|
||||||
|
|
||||||
function emitStoreData() {
|
|
||||||
if (!store.hasMoreData) isLoading.value = false;
|
if (!store.hasMoreData) isLoading.value = false;
|
||||||
|
|
||||||
emit('onFetch', store.data);
|
emit('onFetch', store.data);
|
||||||
return store.data;
|
return store.data;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +181,7 @@ async function onLoad(index, done) {
|
||||||
done(isDone);
|
done(isDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ fetch, update, addFilter, paginate });
|
defineExpose({ fetch, addFilter, paginate });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="vn-row q-gutter-md">
|
<div class="vn-row q-gutter-md q-mb-md">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -18,9 +18,6 @@
|
||||||
&:not(.wrap) {
|
&:not(.wrap) {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
&[fixed] {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -130,7 +130,6 @@ async function search() {
|
||||||
dense
|
dense
|
||||||
standout
|
standout
|
||||||
autofocus
|
autofocus
|
||||||
data-cy="vnSearchBar"
|
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -1,24 +1,11 @@
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import { getUrl } from './getUrl';
|
import { getUrl } from './getUrl';
|
||||||
import axios from 'axios';
|
|
||||||
import { exportFile } from 'quasar';
|
|
||||||
|
|
||||||
const { getTokenMultimedia } = useSession();
|
const { getTokenMultimedia } = useSession();
|
||||||
const token = getTokenMultimedia();
|
const token = getTokenMultimedia();
|
||||||
|
|
||||||
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
||||||
const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
|
let appUrl = await getUrl('', 'lilium');
|
||||||
const response = await axios.get(
|
appUrl = appUrl.replace('/#/', '');
|
||||||
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
|
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
|
||||||
{ responseType: 'blob' }
|
|
||||||
);
|
|
||||||
|
|
||||||
const contentDisposition = response.headers['content-disposition'];
|
|
||||||
const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(contentDisposition);
|
|
||||||
const filename =
|
|
||||||
matches != null && matches[1]
|
|
||||||
? matches[1].replace(/['"]/g, '')
|
|
||||||
: 'downloaded-file';
|
|
||||||
|
|
||||||
exportFile(filename, response.data);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default async (id) => {
|
||||||
|
const { data } = await axios.get(`Accounts/${id}/exists`);
|
||||||
|
return data.exists;
|
||||||
|
};
|
|
@ -241,7 +241,7 @@ input::-webkit-inner-spin-button {
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
padding: 1px 10px 1px 10px;
|
padding: 1px 10px 1px 10px;
|
||||||
max-width: 130px;
|
max-width: 100px;
|
||||||
div span {
|
div span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
@ -60,7 +60,7 @@ globals:
|
||||||
reference: Reference
|
reference: Reference
|
||||||
agency: Agency
|
agency: Agency
|
||||||
warehouseOut: Warehouse Out
|
warehouseOut: Warehouse Out
|
||||||
warehouseIn: Warehouse In
|
wareHouseIn: Warehouse In
|
||||||
landed: Landed
|
landed: Landed
|
||||||
shipped: Shipped
|
shipped: Shipped
|
||||||
totalEntries: Total entries
|
totalEntries: Total entries
|
||||||
|
@ -298,7 +298,6 @@ globals:
|
||||||
clientsActionsMonitor: Clients and actions
|
clientsActionsMonitor: Clients and actions
|
||||||
serial: Serial
|
serial: Serial
|
||||||
medical: Mutual
|
medical: Mutual
|
||||||
pit: IRPF
|
|
||||||
RouteExtendedList: Router
|
RouteExtendedList: Router
|
||||||
wasteRecalc: Waste recaclulate
|
wasteRecalc: Waste recaclulate
|
||||||
operator: Operator
|
operator: Operator
|
||||||
|
@ -507,7 +506,6 @@ invoiceOut:
|
||||||
invoiceWithFutureDate: Exists an invoice with a future date
|
invoiceWithFutureDate: Exists an invoice with a future date
|
||||||
noTicketsToInvoice: There are not tickets to invoice
|
noTicketsToInvoice: There are not tickets to invoice
|
||||||
criticalInvoiceError: 'Critical invoicing error, process stopped'
|
criticalInvoiceError: 'Critical invoicing error, process stopped'
|
||||||
invalidSerialTypeForAll: The serial type must be global when invoicing all clients
|
|
||||||
table:
|
table:
|
||||||
addressId: Address id
|
addressId: Address id
|
||||||
streetAddress: Street
|
streetAddress: Street
|
||||||
|
@ -860,7 +858,6 @@ components:
|
||||||
downloadFile: Download file
|
downloadFile: Download file
|
||||||
openCard: View
|
openCard: View
|
||||||
openSummary: Summary
|
openSummary: Summary
|
||||||
viewSummary: Summary
|
|
||||||
cardDescriptor:
|
cardDescriptor:
|
||||||
mainList: Main list
|
mainList: Main list
|
||||||
summary: Summary
|
summary: Summary
|
||||||
|
|
|
@ -303,7 +303,6 @@ globals:
|
||||||
clientsActionsMonitor: Clientes y acciones
|
clientsActionsMonitor: Clientes y acciones
|
||||||
serial: Facturas por serie
|
serial: Facturas por serie
|
||||||
medical: Mutua
|
medical: Mutua
|
||||||
pit: IRPF
|
|
||||||
wasteRecalc: Recalcular mermas
|
wasteRecalc: Recalcular mermas
|
||||||
operator: Operario
|
operator: Operario
|
||||||
parking: Parking
|
parking: Parking
|
||||||
|
@ -510,7 +509,6 @@ invoiceOut:
|
||||||
invoiceWithFutureDate: Existe una factura con una fecha futura
|
invoiceWithFutureDate: Existe una factura con una fecha futura
|
||||||
noTicketsToInvoice: No existen tickets para facturar
|
noTicketsToInvoice: No existen tickets para facturar
|
||||||
criticalInvoiceError: Error crítico en la facturación proceso detenido
|
criticalInvoiceError: Error crítico en la facturación proceso detenido
|
||||||
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
|
|
||||||
table:
|
table:
|
||||||
addressId: Id dirección
|
addressId: Id dirección
|
||||||
streetAddress: Dirección fiscal
|
streetAddress: Dirección fiscal
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -23,6 +23,7 @@ const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
|
const hasAccount = ref();
|
||||||
const setData = (entity) => (data.value = useCardDescription(entity.nickname, entity.id));
|
const setData = (entity) => (data.value = useCardDescription(entity.nickname, entity.id));
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
|
@ -30,15 +31,13 @@ const filter = {
|
||||||
fields: ['id', 'nickname', 'name', 'role'],
|
fields: ['id', 'nickname', 'name', 'role'],
|
||||||
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
||||||
};
|
};
|
||||||
const hasAccount = ref(false);
|
|
||||||
|
onMounted(async () => {
|
||||||
|
hasAccount.value = await useHasAccount(entityId.value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
:url="`Accounts/${entityId}/exists`"
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (hasAccount = data.exists)"
|
|
||||||
/>
|
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`VnUsers/preview`"
|
:url="`VnUsers/preview`"
|
||||||
|
@ -50,7 +49,7 @@ const hasAccount = ref(false);
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
>
|
>
|
||||||
<template #menu>
|
<template #menu>
|
||||||
<AccountDescriptorMenu :has-account="hasAccount" />
|
<AccountDescriptorMenu :entity-id="entityId" />
|
||||||
</template>
|
</template>
|
||||||
<template #before>
|
<template #before>
|
||||||
<!-- falla id :id="entityId.value" collection="user" size="160x160" -->
|
<!-- falla id :id="entityId.value" collection="user" size="160x160" -->
|
||||||
|
@ -91,7 +90,7 @@ const hasAccount = ref(false);
|
||||||
<QIcon
|
<QIcon
|
||||||
color="primary"
|
color="primary"
|
||||||
name="contact_mail"
|
name="contact_mail"
|
||||||
v-if="entity.hasAccount"
|
v-if="hasAccount"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref, toRefs } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount.js';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
hasAccount: {
|
entityId: {
|
||||||
type: Boolean,
|
type: Number,
|
||||||
default: false,
|
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { hasAccount } = toRefs($props);
|
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const route = useRoute();
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
||||||
account.value.hasAccount = hasAccount.value;
|
|
||||||
const entityId = computed(() => +route.params.id);
|
onMounted(async () => {
|
||||||
|
account.value.hasAccount = await useHasAccount($props.entityId);
|
||||||
|
});
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
await axios.post(`Accounts`, { id: entityId.value });
|
await axios.post(`Accounts`, { id: $props.entityId });
|
||||||
} else {
|
} else {
|
||||||
await axios.delete(`Accounts/${entityId.value}`);
|
await axios.delete(`Accounts/${$props.entityId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
account.value.hasAccount = active;
|
account.value.hasAccount = active;
|
||||||
|
@ -41,7 +41,7 @@ async function updateStatusAccount(active) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async function updateStatusUser(active) {
|
async function updateStatusUser(active) {
|
||||||
await axios.patch(`VnUsers/${entityId.value}`, { active });
|
await axios.patch(`VnUsers/${$props.entityId}`, { active });
|
||||||
account.value.active = active;
|
account.value.active = active;
|
||||||
const status = active ? 'activate' : 'deactivate';
|
const status = active ? 'activate' : 'deactivate';
|
||||||
notify({
|
notify({
|
||||||
|
|
|
@ -9,6 +9,7 @@ import AccountMailAliasCreateForm from './AccountMailAliasCreateForm.vue';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -50,16 +51,6 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const fetchAccountExistence = async () => {
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get(`Accounts/${route.params.id}/exists`);
|
|
||||||
return data.exists;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching account existence', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const deleteMailAlias = async (row) => {
|
const deleteMailAlias = async (row) => {
|
||||||
await axios.delete(`${urlPath}/${row.id}`);
|
await axios.delete(`${urlPath}/${row.id}`);
|
||||||
fetchMailAliases();
|
fetchMailAliases();
|
||||||
|
@ -79,7 +70,7 @@ const fetchMailAliases = async () => {
|
||||||
|
|
||||||
const getAccountData = async (reload = true) => {
|
const getAccountData = async (reload = true) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
hasAccount.value = await fetchAccountExistence();
|
hasAccount.value = await useHasAccount(route.params.id);
|
||||||
if (!hasAccount.value) {
|
if (!hasAccount.value) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
store.data = [];
|
store.data = [];
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import useHasAccount from 'src/composables/useHasAccount';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -30,16 +31,6 @@ const hasDataChanged = computed(
|
||||||
initialData.value.hasData !== hasData.value
|
initialData.value.hasData !== hasData.value
|
||||||
);
|
);
|
||||||
|
|
||||||
const fetchAccountExistence = async () => {
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get(`Accounts/${route.params.id}/exists`);
|
|
||||||
return data.exists;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching account existence', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchMailForwards = async () => {
|
const fetchMailForwards = async () => {
|
||||||
const response = await axios.get(`MailForwards/${route.params.id}`);
|
const response = await axios.get(`MailForwards/${route.params.id}`);
|
||||||
return response.data;
|
return response.data;
|
||||||
|
@ -68,7 +59,7 @@ const setInitialData = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
initialData.value.account = route.params.id;
|
initialData.value.account = route.params.id;
|
||||||
formData.value.account = route.params.id;
|
formData.value.account = route.params.id;
|
||||||
hasAccount.value = await fetchAccountExistence(route.params.id);
|
hasAccount.value = await useHasAccount(route.params.id);
|
||||||
if (!hasAccount.value) {
|
if (!hasAccount.value) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -30,13 +31,15 @@ const filter = {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary
|
||||||
data-key="AccountSummary"
|
data-key="AccountId"
|
||||||
ref="AccountSummary"
|
|
||||||
url="VnUsers/preview"
|
url="VnUsers/preview"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="(data) => (account = data)"
|
@on-fetch="(data) => (account = data)"
|
||||||
>
|
>
|
||||||
<template #header>{{ account.id }} - {{ account.nickname }}</template>
|
<template #header>{{ account.id }} - {{ account.nickname }}</template>
|
||||||
|
<template #menu="">
|
||||||
|
<AccountDescriptorMenu :entity-id="entityId" />
|
||||||
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
|
|
|
@ -100,7 +100,7 @@ async function remove() {
|
||||||
</QMenu>
|
</QMenu>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<QItem @click="confirmRemove()" v-ripple clickable data-cy="deleteClaim">
|
<QItem @click="confirmRemove()" v-ripple clickable>
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="delete" />
|
<QIcon name="delete" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
|
|
@ -19,6 +19,7 @@ import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import ClaimDescriptorMenu from './ClaimDescriptorMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -228,6 +229,9 @@ function claimUrl(section) {
|
||||||
</QList>
|
</QList>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<ClaimDescriptorMenu :claim="entity.claim" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||||
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, onMounted } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
|
|
||||||
import { toCurrency, toPercentage, toDate, dashOrCurrency } from 'src/filters';
|
import { toCurrency, toPercentage, toDate, dashOrCurrency } from 'src/filters';
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
import VnLinkMail from 'src/components/ui/VnLinkMail.vue';
|
import VnLinkMail from 'src/components/ui/VnLinkMail.vue';
|
||||||
import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
|
import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const grafanaUrl = 'https://grafana.verdnatura.es';
|
const grafanaUrl = 'https://grafana.verdnatura.es';
|
||||||
|
@ -71,6 +71,9 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
data-key="CustomerSummary"
|
data-key="CustomerSummary"
|
||||||
module-name="Customer"
|
module-name="Customer"
|
||||||
>
|
>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<CustomerDescriptorMenu :customer="entity" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { toDate } from 'src/filters';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import filter from './EntryFilter.js';
|
import filter from './EntryFilter.js';
|
||||||
|
import EntryDescriptorMenu from './EntryDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -68,9 +69,7 @@ const showEntryReport = () => {
|
||||||
data-key="Entry"
|
data-key="Entry"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
<EntryDescriptorMenu :id="entity.id" />
|
||||||
<QItemSection>{{ t('Show entry report') }}</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.agency')" :value="entity.travel?.agency?.name" />
|
<VnLv :label="t('globals.agency')" :value="entity.travel?.agency?.name" />
|
||||||
|
@ -154,7 +153,6 @@ es:
|
||||||
Supplier card: Ficha del proveedor
|
Supplier card: Ficha del proveedor
|
||||||
All travels with current agency: Todos los envíos con la agencia actual
|
All travels with current agency: Todos los envíos con la agencia actual
|
||||||
All entries with current supplier: Todas las entradas con el proveedor actual
|
All entries with current supplier: Todas las entradas con el proveedor actual
|
||||||
Show entry report: Ver informe del pedido
|
|
||||||
Go to module index: Ir al índice del modulo
|
Go to module index: Ir al índice del modulo
|
||||||
Inventory entry: Es inventario
|
Inventory entry: Es inventario
|
||||||
Virtual entry: Es una redada
|
Virtual entry: Es una redada
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<script setup>
|
||||||
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
|
|
||||||
|
const { openReport } = usePrintService();
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function showEntryReport() {
|
||||||
|
openReport(`Entries/${$props.id}/entry-order-pdf`);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QItem v-ripple clickable @click="showEntryReport">
|
||||||
|
<QItemSection>{{ $t('entryList.list.showEntryReport') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
|
@ -12,6 +12,7 @@ import { getUrl } from 'src/composables/getUrl';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||||
|
import EntryDescriptorMenu from './EntryDescriptorMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -149,7 +150,6 @@ async function setEntryData(data) {
|
||||||
const fetchEntryBuys = async () => {
|
const fetchEntryBuys = async () => {
|
||||||
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
||||||
if (data) entryBuys.value = data;
|
if (data) entryBuys.value = data;
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -171,6 +171,9 @@ const fetchEntryBuys = async () => {
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<EntryDescriptorMenu :id="entity.id" />
|
||||||
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<router-link
|
<router-link
|
||||||
|
|
|
@ -12,7 +12,6 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -235,6 +234,7 @@ const columns = [
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
const tableRef = ref();
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
|
|
|
@ -247,7 +247,6 @@ onMounted(async () => {
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Inventory entry: Es inventario
|
|
||||||
Virtual entry: Es una redada
|
Virtual entry: Es una redada
|
||||||
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
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
entryList:
|
entryList:
|
||||||
list:
|
list:
|
||||||
inventoryEntry: Inventory entry
|
inventoryEntry: Inventory entry
|
||||||
|
showEntryReport: Show entry report
|
||||||
entryFilter:
|
entryFilter:
|
||||||
filter:
|
filter:
|
||||||
search: General search
|
search: General search
|
||||||
|
|
|
@ -4,6 +4,7 @@ You can search by entry reference: Puedes buscar por referencia de la entrada
|
||||||
entryList:
|
entryList:
|
||||||
list:
|
list:
|
||||||
inventoryEntry: Es inventario
|
inventoryEntry: Es inventario
|
||||||
|
showEntryReport: Ver informe del pedido
|
||||||
entryFilter:
|
entryFilter:
|
||||||
filter:
|
filter:
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { getUrl } from 'src/composables/getUrl';
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
|
import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue';
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
fetch();
|
fetch();
|
||||||
|
@ -113,6 +114,9 @@ const ticketsColumns = ref([
|
||||||
<template #header="{ entity: { invoiceOut } }">
|
<template #header="{ entity: { invoiceOut } }">
|
||||||
<div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
|
<div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<InvoiceOutDescriptorMenu :invoice-out-data="entity.invoiceOut" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity: { invoiceOut } }">
|
<template #body="{ entity: { invoiceOut } }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle :text="t('globals.pageTitles.basicData')" />
|
<VnTitle :text="t('globals.pageTitles.basicData')" />
|
||||||
|
|
|
@ -183,7 +183,7 @@ onMounted(async () => {
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
invoiceDate: Invoice date
|
invoiceDate: Invoice date
|
||||||
maxShipped: Max date ticket
|
maxShipped: Max date
|
||||||
allClients: All clients
|
allClients: All clients
|
||||||
oneClient: One client
|
oneClient: One client
|
||||||
company: Company
|
company: Company
|
||||||
|
@ -195,7 +195,7 @@ en:
|
||||||
|
|
||||||
es:
|
es:
|
||||||
invoiceDate: Fecha de factura
|
invoiceDate: Fecha de factura
|
||||||
maxShipped: Fecha límite ticket
|
maxShipped: Fecha límite
|
||||||
allClients: Todos los clientes
|
allClients: Todos los clientes
|
||||||
oneClient: Un solo cliente
|
oneClient: Un solo cliente
|
||||||
company: Empresa
|
company: Empresa
|
||||||
|
|
|
@ -6,19 +6,15 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { usePrintService } from 'src/composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
||||||
import { toCurrency, toDate } from 'src/filters/index';
|
import { toCurrency, toDate } from 'src/filters/index';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { QBtn } from 'quasar';
|
import { QBtn } from 'quasar';
|
||||||
import axios from 'axios';
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
import InvoiceOutFilter from './InvoiceOutFilter.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
|
||||||
import VnRadio from 'src/components/common/VnRadio.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -30,86 +26,99 @@ const selectedRows = ref([]);
|
||||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||||
const MODEL = 'InvoiceOuts';
|
const MODEL = 'InvoiceOuts';
|
||||||
const { openReport } = usePrintService();
|
const { openReport } = usePrintService();
|
||||||
const addressOptions = ref([]);
|
|
||||||
const selectedOption = ref('ticket');
|
|
||||||
async function fetchClientAddress(id) {
|
|
||||||
const { data } = await axios.get(
|
|
||||||
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
|
||||||
);
|
|
||||||
addressOptions.value = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
const exprBuilder = (_, value) => {
|
|
||||||
return {
|
|
||||||
or: [{ code: value }, { description: { like: `%${value}%` } }],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('invoiceOutList.tableVisibleColumns.id'),
|
label: t('invoiceOutList.tableVisibleColumns.id'),
|
||||||
chip: { condition: () => true },
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
},
|
||||||
isId: true,
|
isId: true,
|
||||||
columnFilter: { name: 'search' },
|
columnFilter: {
|
||||||
|
name: 'search',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'ref',
|
name: 'ref',
|
||||||
label: t('globals.reference'),
|
label: t('invoiceOutList.tableVisibleColumns.ref'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' },
|
attrs: {
|
||||||
columnField: { component: null },
|
url: MODEL,
|
||||||
|
optionLabel: 'ref',
|
||||||
|
optionValue: 'id',
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'issued',
|
name: 'Issued',
|
||||||
label: t('invoiceOut.summary.issued'),
|
label: t('invoiceOutList.tableVisibleColumns.issued'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
format: (row) => toDate(row.issued),
|
format: (row) => toDate(row.issued),
|
||||||
columnField: { component: null },
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'clientFk',
|
name: 'clientFk',
|
||||||
label: t('globals.client'),
|
label: t('invoiceOutModule.customer'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: { url: 'Clients', fields: ['id', 'name'] },
|
attrs: {
|
||||||
columnField: { component: null },
|
url: 'Clients',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'companyCode',
|
name: 'companyCode',
|
||||||
label: t('globals.company'),
|
label: t('invoiceOutModule.company'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: { url: 'Companies', optionLabel: 'code', optionValue: 'id' },
|
attrs: {
|
||||||
columnField: { component: null },
|
url: 'Companies',
|
||||||
|
optionLabel: 'code',
|
||||||
|
optionValue: 'id',
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
label: t('globals.amount'),
|
label: t('invoiceOutModule.amount'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
format: (row) => toCurrency(row.amount),
|
format: (row) => toCurrency(row.amount),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'created',
|
name: 'created',
|
||||||
label: t('globals.created'),
|
label: t('invoiceOutList.tableVisibleColumns.created'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
columnField: { component: null },
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
format: (row) => toDate(row.created),
|
format: (row) => toDate(row.created),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'dued',
|
name: 'dued',
|
||||||
label: t('invoiceOut.summary.dued'),
|
label: t('invoiceOutList.tableVisibleColumns.dueDate'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
columnField: { component: null },
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
format: (row) => toDate(row.dued),
|
format: (row) => toDate(row.dued),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -119,12 +128,11 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('components.smartCard.viewSummary'),
|
title: t('components.smartCard.viewSummary'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
isPrimary: true,
|
|
||||||
action: (row) => viewSummary(row.id, InvoiceOutSummary),
|
action: (row) => viewSummary(row.id, InvoiceOutSummary),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('globals.downloadPdf'),
|
title: t('DownloadPdf'),
|
||||||
icon: 'cloud_download',
|
icon: 'vn:ticket',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => openPdf(row.id),
|
action: (row) => openPdf(row.id),
|
||||||
},
|
},
|
||||||
|
@ -166,7 +174,7 @@ watchEffect(selectedRows);
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
:info="t('youCanSearchByInvoiceReference')"
|
:info="t('youCanSearchByInvoiceReference')"
|
||||||
:label="t('Search invoice')"
|
:label="t('searchInvoice')"
|
||||||
data-key="invoiceOutList"
|
data-key="invoiceOutList"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
|
@ -182,7 +190,7 @@ watchEffect(selectedRows);
|
||||||
@click="downloadPdf()"
|
@click="downloadPdf()"
|
||||||
:disable="!hasSelectedCards"
|
:disable="!hasSelectedCards"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
|
<QTooltip>{{ t('globals.downloadPdf') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
@ -192,9 +200,11 @@ watchEffect(selectedRows);
|
||||||
:url="`${MODEL}/filter`"
|
:url="`${MODEL}/filter`"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'InvoiceOuts/createManualInvoice',
|
urlCreate: 'InvoiceOuts/createManualInvoice',
|
||||||
title: t('createManualInvoice'),
|
title: t('Create manual invoice'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: { active: true },
|
formInitialData: {
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
}"
|
}"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
|
@ -214,154 +224,45 @@ watchEffect(selectedRows);
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<div class="row q-col-gutter-xs">
|
<div class="flex no-wrap flex-center">
|
||||||
<div class="col-12">
|
<VnSelect
|
||||||
<div class="q-col-gutter-xs">
|
url="Tickets"
|
||||||
<VnRow fixed>
|
v-model="data.ticketFk"
|
||||||
<VnRadio
|
:label="t('invoiceOutList.tableVisibleColumns.ticket')"
|
||||||
v-model="selectedOption"
|
option-label="id"
|
||||||
val="ticket"
|
option-value="id"
|
||||||
:label="t('globals.ticket')"
|
>
|
||||||
class="q-my-none q-mr-md"
|
<template #option="scope">
|
||||||
/>
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
<VnInput
|
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
|
||||||
v-show="selectedOption === 'ticket'"
|
<QItemLabel caption>{{ scope.opt?.nickname }}</QItemLabel>
|
||||||
v-model="data.ticketFk"
|
</QItemSection>
|
||||||
:label="t('globals.ticket')"
|
</QItem>
|
||||||
style="flex: 1"
|
</template>
|
||||||
/>
|
</VnSelect>
|
||||||
|
<span class="q-ml-md">O</span>
|
||||||
<div
|
</div>
|
||||||
class="row q-col-gutter-xs q-ml-none"
|
|
||||||
v-show="selectedOption !== 'ticket'"
|
|
||||||
>
|
|
||||||
<div class="col">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="data.clientFk"
|
|
||||||
:label="t('globals.client')"
|
|
||||||
url="Clients"
|
url="Clients"
|
||||||
|
v-model="data.clientFk"
|
||||||
|
:label="t('invoiceOutModule.customer')"
|
||||||
:options="customerOptions"
|
:options="customerOptions"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
@update:model-value="fetchClientAddress"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
#{{ scope.opt?.id }} -
|
|
||||||
{{ scope.opt?.name }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<VnSelect
|
|
||||||
v-model="data.addressFk"
|
|
||||||
:label="t('ticket.summary.consignee')"
|
|
||||||
:options="addressOptions"
|
|
||||||
option-label="nickname"
|
|
||||||
option-value="id"
|
|
||||||
v-if="
|
|
||||||
data.clientFk &&
|
|
||||||
selectedOption === 'consignatario'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel
|
|
||||||
:class="{
|
|
||||||
'color-vn-label':
|
|
||||||
!scope.opt?.isActive,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
`${
|
|
||||||
!scope.opt?.isActive
|
|
||||||
? t('inactive')
|
|
||||||
: ''
|
|
||||||
} `
|
|
||||||
}}
|
|
||||||
<span>{{
|
|
||||||
scope.opt?.nickname
|
|
||||||
}}</span>
|
|
||||||
<span
|
|
||||||
v-if="
|
|
||||||
scope.opt?.province ||
|
|
||||||
scope.opt?.city ||
|
|
||||||
scope.opt?.street
|
|
||||||
"
|
|
||||||
>
|
|
||||||
, {{ scope.opt?.street }},
|
|
||||||
{{ scope.opt?.city }},
|
|
||||||
{{
|
|
||||||
scope.opt?.province?.name
|
|
||||||
}}
|
|
||||||
-
|
|
||||||
{{
|
|
||||||
scope.opt?.agencyMode
|
|
||||||
?.name
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow fixed>
|
|
||||||
<VnRadio
|
|
||||||
v-model="selectedOption"
|
|
||||||
val="cliente"
|
|
||||||
:label="t('globals.client')"
|
|
||||||
class="q-my-none q-mr-md"
|
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
|
||||||
<VnRow fixed>
|
|
||||||
<VnRadio
|
|
||||||
v-model="selectedOption"
|
|
||||||
val="consignatario"
|
|
||||||
:label="t('ticket.summary.consignee')"
|
|
||||||
class="q-my-none q-mr-md"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="full-width">
|
|
||||||
<VnRow class="row q-col-gutter-xs">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="InvoiceOutSerials"
|
url="InvoiceOutSerials"
|
||||||
v-model="data.serial"
|
v-model="data.serial"
|
||||||
:label="t('invoiceIn.serial')"
|
:label="t('invoiceOutList.tableVisibleColumns.invoiceOutSerial')"
|
||||||
:options="invoiceOutSerialsOptions"
|
:options="invoiceOutSerialsOptions"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-filter
|
/>
|
||||||
:expr-builder="exprBuilder"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.code }} -
|
|
||||||
{{ scope.opt?.description }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('invoiceOut.summary.dued')"
|
:label="t('invoiceOutList.tableVisibleColumns.dueDate')"
|
||||||
v-model="data.maxShipped"
|
v-model="data.maxShipped"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
|
||||||
<VnRow class="row q-col-gutter-xs">
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="TaxAreas"
|
url="TaxAreas"
|
||||||
v-model="data.taxArea"
|
v-model="data.taxArea"
|
||||||
|
@ -370,43 +271,27 @@ watchEffect(selectedRows);
|
||||||
option-label="code"
|
option-label="code"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<QInput
|
||||||
v-model="data.reference"
|
v-model="data.reference"
|
||||||
:label="t('globals.reference')"
|
:label="t('invoiceOutList.tableVisibleColumns.ref')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
#formModel .vn-row {
|
|
||||||
min-height: 45px;
|
|
||||||
|
|
||||||
.q-radio {
|
|
||||||
align-self: flex-end;
|
|
||||||
flex: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .q-input,
|
|
||||||
> .q-select {
|
|
||||||
flex: 0.75;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
invoiceId: Invoice ID
|
searchInvoice: Search issued invoice
|
||||||
|
fileDenied: Browser denied file download...
|
||||||
|
fileAllowed: Successful download of CSV file
|
||||||
youCanSearchByInvoiceReference: You can search by invoice reference
|
youCanSearchByInvoiceReference: You can search by invoice reference
|
||||||
createManualInvoice: Create Manual Invoice
|
createInvoice: Make invoice
|
||||||
inactive: (Inactive)
|
Create manual invoice: Create manual invoice
|
||||||
|
es:
|
||||||
es:
|
searchInvoice: Buscar factura emitida
|
||||||
invoiceId: ID de factura
|
fileDenied: El navegador denegó la descarga de archivos...
|
||||||
|
fileAllowed: Descarga exitosa de archivo CSV
|
||||||
youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
|
youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
|
||||||
createManualInvoice: Crear factura manual
|
createInvoice: Crear factura
|
||||||
inactive: (Inactivo)
|
Create manual invoice: Crear factura manual
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -2,7 +2,6 @@ invoiceOutModule:
|
||||||
customer: Client
|
customer: Client
|
||||||
amount: Amount
|
amount: Amount
|
||||||
company: Company
|
company: Company
|
||||||
address: Address
|
|
||||||
invoiceOutList:
|
invoiceOutList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
id: ID
|
id: ID
|
||||||
|
|
|
@ -4,7 +4,6 @@ invoiceOutModule:
|
||||||
customer: Cliente
|
customer: Cliente
|
||||||
amount: Importe
|
amount: Importe
|
||||||
company: Empresa
|
company: Empresa
|
||||||
address: Consignatario
|
|
||||||
invoiceOutList:
|
invoiceOutList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
id: ID
|
id: ID
|
||||||
|
|
|
@ -6,13 +6,12 @@ import { useI18n } from 'vue-i18n';
|
||||||
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
|
||||||
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
import ItemDescriptorMenu from './ItemDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -38,7 +37,6 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { openCloneDialog } = cloneItem();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const warehouseConfig = ref(null);
|
const warehouseConfig = ref(null);
|
||||||
|
@ -46,7 +44,6 @@ const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const regularizeStockFormDialog = ref(null);
|
|
||||||
const mounted = ref();
|
const mounted = ref();
|
||||||
|
|
||||||
const arrayDataStock = useArrayData('descriptorStock', {
|
const arrayDataStock = useArrayData('descriptorStock', {
|
||||||
|
@ -68,7 +65,7 @@ const setData = async (entity) => {
|
||||||
const getItemConfigs = async () => {
|
const getItemConfigs = async () => {
|
||||||
const { data } = await axios.get('ItemConfigs/findOne');
|
const { data } = await axios.get('ItemConfigs/findOne');
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
return (warehouseConfig.value = data.warehouseFk);
|
warehouseConfig.value = data.warehouseFk;
|
||||||
};
|
};
|
||||||
const updateStock = async () => {
|
const updateStock = async () => {
|
||||||
if (!mounted.value) return;
|
if (!mounted.value) return;
|
||||||
|
@ -89,10 +86,6 @@ const updateStock = async () => {
|
||||||
if (storeData?.itemFk == entityId.value) return;
|
if (storeData?.itemFk == entityId.value) return;
|
||||||
await stock.fetch({});
|
await stock.fetch({});
|
||||||
};
|
};
|
||||||
|
|
||||||
const openRegularizeStockForm = () => {
|
|
||||||
regularizeStockFormDialog.value.show();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -105,24 +98,12 @@ const openRegularizeStockForm = () => {
|
||||||
:url="`Items/${entityId}/getCard`"
|
:url="`Items/${entityId}/getCard`"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
>
|
>
|
||||||
<template #menu="{}">
|
<template #menu>
|
||||||
<QItem v-ripple clickable @click="openRegularizeStockForm()">
|
<ItemDescriptorMenu
|
||||||
<QItemSection>
|
:entity-id="entityId"
|
||||||
{{ t('Regularize stock') }}
|
|
||||||
<QDialog ref="regularizeStockFormDialog">
|
|
||||||
<RegularizeStockForm
|
|
||||||
:item-fk="entityId"
|
|
||||||
:warehouse-fk="warehouseFk"
|
:warehouse-fk="warehouseFk"
|
||||||
@on-data-saved="updateStock()"
|
@regularized="updateStock"
|
||||||
/>
|
/>
|
||||||
</QDialog>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem v-ripple clickable @click="openCloneDialog(entityId)">
|
|
||||||
<QItemSection>
|
|
||||||
{{ t('globals.clone') }}
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
</template>
|
||||||
<template #before>
|
<template #before>
|
||||||
<ItemDescriptorImage
|
<ItemDescriptorImage
|
||||||
|
@ -191,7 +172,6 @@ const openRegularizeStockForm = () => {
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Regularize stock: Regularizar stock
|
|
||||||
Inactive article: Artículo inactivo
|
Inactive article: Artículo inactivo
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,6 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Regularize stock: Regularizar stock
|
|
||||||
All it's properties will be copied: Todas sus propiedades serán copiadas
|
All it's properties will be copied: Todas sus propiedades serán copiadas
|
||||||
Do you want to clone this item?: ¿Desea clonar este artículo?
|
Do you want to clone this item?: ¿Desea clonar este artículo?
|
||||||
warehouseText: Calculado sobre el almacén de { warehouseName }
|
warehouseText: Calculado sobre el almacén de { warehouseName }
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
<script setup>
|
||||||
|
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
||||||
|
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
||||||
|
|
||||||
|
const { openCloneDialog } = cloneItem();
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
entityId: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
warehouseFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
defineEmits(['regularized']);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QItem v-ripple clickable @click="$refs.regularizeStockFormDialog.show()">
|
||||||
|
<QItemSection>
|
||||||
|
{{ $t('item.regularizeStock') }}
|
||||||
|
<QDialog ref="regularizeStockFormDialog">
|
||||||
|
<RegularizeStockForm
|
||||||
|
:item-fk="entityId"
|
||||||
|
:warehouse-fk="warehouseFk"
|
||||||
|
@on-data-saved="$emit('regularized')"
|
||||||
|
/>
|
||||||
|
</QDialog>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-ripple clickable @click="openCloneDialog(entityId)">
|
||||||
|
<QItemSection>
|
||||||
|
{{ $t('globals.clone') }}
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.weekdaysBtn {
|
||||||
|
margin: 1%;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -8,6 +8,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
|
import ItemDescriptorMenu from './ItemDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -43,6 +44,9 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
|
||||||
<template #header="{ entity: { item } }">
|
<template #header="{ entity: { item } }">
|
||||||
{{ item.id }} - {{ item.name }}
|
{{ item.id }} - {{ item.name }}
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu>
|
||||||
|
<ItemDescriptorMenu :entity-id="entityId" :warehouse-fk="warehouseFk" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity: { item, tags, visible, available, botanical } }">
|
<template #body="{ entity: { item, tags, visible, available, botanical } }">
|
||||||
<QCard class="vn-one photo">
|
<QCard class="vn-one photo">
|
||||||
<ItemDescriptorImage
|
<ItemDescriptorImage
|
||||||
|
|
|
@ -373,5 +373,4 @@ const columns = computed(() => [
|
||||||
es:
|
es:
|
||||||
New item: Nuevo artículo
|
New item: Nuevo artículo
|
||||||
Preview: Vista previa
|
Preview: Vista previa
|
||||||
Regularize stock: Regularizar stock
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -205,3 +205,4 @@ item:
|
||||||
minSalesQuantity: 'Cantidad mínima de venta'
|
minSalesQuantity: 'Cantidad mínima de venta'
|
||||||
genus: 'Genus'
|
genus: 'Genus'
|
||||||
specie: 'Specie'
|
specie: 'Specie'
|
||||||
|
regularizeStock: Regularize stock
|
||||||
|
|
|
@ -207,3 +207,4 @@ item:
|
||||||
achieved: 'Conseguido'
|
achieved: 'Conseguido'
|
||||||
concept: 'Concepto'
|
concept: 'Concepto'
|
||||||
state: 'Estado'
|
state: 'Estado'
|
||||||
|
regularizeStock: Regularizar stock
|
||||||
|
|
|
@ -18,7 +18,7 @@ const groupedStates = ref();
|
||||||
const handleScopeDays = (params, days, callback) => {
|
const handleScopeDays = (params, days, callback) => {
|
||||||
const [from, to] = dateRange(Date.vnNew());
|
const [from, to] = dateRange(Date.vnNew());
|
||||||
if (!days) {
|
if (!days) {
|
||||||
Object.assign(params, { from, to, scopeDays: 0 });
|
Object.assign(params, { from, to, scopeDays: 1 });
|
||||||
} else {
|
} else {
|
||||||
params.from = from;
|
params.from = from;
|
||||||
to.setDate(to.getDate() + days);
|
to.setDate(to.getDate() + days);
|
||||||
|
@ -59,7 +59,7 @@ const getLocale = (label) => {
|
||||||
</template>
|
</template>
|
||||||
<template #customTags="{ params, searchFn, formatFn }">
|
<template #customTags="{ params, searchFn, formatFn }">
|
||||||
<VnFilterPanelChip
|
<VnFilterPanelChip
|
||||||
v-if="params.scopeDays !== null"
|
v-if="params.scopeDays"
|
||||||
removable
|
removable
|
||||||
@remove="handleScopeDays(params, null, searchFn)"
|
@remove="handleScopeDays(params, null, searchFn)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -15,7 +15,6 @@ import { toCurrency, dateRange, dashIfEmpty } from 'src/filters';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
||||||
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
||||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
|
||||||
|
|
||||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -24,15 +23,13 @@ const tableRef = ref(null);
|
||||||
const provinceOpts = ref([]);
|
const provinceOpts = ref([]);
|
||||||
const stateOpts = ref([]);
|
const stateOpts = ref([]);
|
||||||
const zoneOpts = ref([]);
|
const zoneOpts = ref([]);
|
||||||
|
const visibleColumns = ref([]);
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
const from = Date.vnNew();
|
||||||
const [from, to] = dateRange(Date.vnNew());
|
from.setHours(0, 0, 0, 0);
|
||||||
const stateColors = {
|
const to = new Date(from.getTime());
|
||||||
notice: 'info',
|
to.setDate(to.getDate() + 1);
|
||||||
success: 'positive',
|
to.setHours(23, 59, 59, 999);
|
||||||
warning: 'warning',
|
|
||||||
alert: 'negative',
|
|
||||||
};
|
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -227,7 +224,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('salesTicketsTable.goToLines'),
|
title: t('salesTicketsTable.goToLines'),
|
||||||
icon: 'vn:lines',
|
icon: 'vn:lines',
|
||||||
color: 'primary',
|
color: 'priamry',
|
||||||
action: (row) => openTab(row.id),
|
action: (row) => openTab(row.id),
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -238,7 +235,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
title: t('salesTicketsTable.preview'),
|
title: t('salesTicketsTable.preview'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
color: 'primary',
|
color: 'priamry',
|
||||||
action: (row) => viewSummary(row.id, TicketSummary),
|
action: (row) => viewSummary(row.id, TicketSummary),
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -256,10 +253,10 @@ const getBadgeAttrs = (date) => {
|
||||||
let timeTicket = new Date(date);
|
let timeTicket = new Date(date);
|
||||||
timeTicket.setHours(0, 0, 0, 0);
|
timeTicket.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
let timeDiff = today - timeTicket;
|
let comparation = today - timeTicket;
|
||||||
|
|
||||||
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
|
if (comparation == 0) return { color: 'warning', 'text-color': 'black' };
|
||||||
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
|
if (comparation < 0) return { color: 'success', 'text-color': 'black' };
|
||||||
return { color: 'transparent', 'text-color': 'white' };
|
return { color: 'transparent', 'text-color': 'white' };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -274,6 +271,13 @@ const autoRefreshHandler = (value) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const stateColors = {
|
||||||
|
notice: 'info',
|
||||||
|
success: 'positive',
|
||||||
|
warning: 'warning',
|
||||||
|
alert: 'negative',
|
||||||
|
};
|
||||||
|
|
||||||
const totalPriceColor = (ticket) => {
|
const totalPriceColor = (ticket) => {
|
||||||
const total = parseInt(ticket.totalWithVat);
|
const total = parseInt(ticket.totalWithVat);
|
||||||
if (total > 0 && total < 50) return 'warning';
|
if (total > 0 && total < 50) return 'warning';
|
||||||
|
@ -281,10 +285,10 @@ const totalPriceColor = (ticket) => {
|
||||||
|
|
||||||
const formatShippedDate = (date) => {
|
const formatShippedDate = (date) => {
|
||||||
if (!date) return '-';
|
if (!date) return '-';
|
||||||
const dateSplit = date.split('T');
|
const split1 = date.split('T');
|
||||||
const [year, month, day] = dateSplit[0].split('-');
|
const [year, month, day] = split1[0].split('-');
|
||||||
const newDate = new Date(year, month - 1, day);
|
const _date = new Date(year, month - 1, day);
|
||||||
return toDateFormat(newDate);
|
return toDateFormat(_date);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openTab = (id) =>
|
const openTab = (id) =>
|
||||||
|
@ -332,12 +336,13 @@ const openTab = (id) =>
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
:offset="50"
|
:offset="50"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
auto-load
|
auto-load
|
||||||
:row-click="({ id }) => openTab(id)"
|
:row-click="({ id }) => openTab(id)"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:user-params="{ from, to, scopeDays: 0 }"
|
:user-params="{ from, to, scopeDays: 1 }"
|
||||||
>
|
>
|
||||||
<template #top-left>
|
<template #top-left>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -347,7 +352,7 @@ const openTab = (id) =>
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
@click="tableRef.CrudModelRef.vnPaginateRef.update()"
|
@click="$refs.tableRef.reload()"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -361,7 +366,61 @@ const openTab = (id) =>
|
||||||
</QCheckbox>
|
</QCheckbox>
|
||||||
</template>
|
</template>
|
||||||
<template #column-totalProblems="{ row }">
|
<template #column-totalProblems="{ row }">
|
||||||
<TicketProblems :row="row" />
|
<span>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.isTaxDataChecked === 0"
|
||||||
|
name="vn:no036"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.hasTicketRequest"
|
||||||
|
name="vn:buyrequest"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.itemShortage"
|
||||||
|
name="vn:unavailable"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.risk"
|
||||||
|
name="vn:risk"
|
||||||
|
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip
|
||||||
|
>{{ $t('salesTicketsTable.risk') }}: {{ row.risk }}</QTooltip
|
||||||
|
>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.hasComponentLack"
|
||||||
|
name="vn:components"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.isTooLittle"
|
||||||
|
name="vn:isTooLittle"
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-id="{ row }">
|
<template #column-id="{ row }">
|
||||||
<span class="link" @click.stop.prevent>
|
<span class="link" @click.stop.prevent>
|
||||||
|
@ -416,7 +475,7 @@ const openTab = (id) =>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
<template #column-zoneFk="{ row }">
|
<template #column-zoneFk="{ row }">
|
||||||
<div v-if="row.zoneFk" @click.stop.prevent :title="row.zoneName">
|
<div @click.stop.prevent :title="row.zoneName">
|
||||||
<span class="link">{{ row.zoneName }}</span>
|
<span class="link">{{ row.zoneName }}</span>
|
||||||
<ZoneDescriptorProxy :id="row.zoneFk" />
|
<ZoneDescriptorProxy :id="row.zoneFk" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,6 +36,7 @@ const getSelectedTagValues = async (tag) => {
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['value'],
|
fields: ['value'],
|
||||||
order: 'value ASC',
|
order: 'value ASC',
|
||||||
|
limit: 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
const url = `Tags/${tag?.id}/filterValue`;
|
const url = `Tags/${tag?.id}/filterValue`;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { reactive, onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useState } from 'composables/useState';
|
import { useState } from 'composables/useState';
|
||||||
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import { useDialogPluginComponent } from 'quasar';
|
import { useDialogPluginComponent } from 'quasar';
|
||||||
|
import { reactive } from 'vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -47,6 +48,10 @@ const fetchAgencyList = async (landed, addressFk) => {
|
||||||
agencyList.value = data;
|
agencyList.value = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// const fetchOrderDetails = (order) => {
|
||||||
|
// fetchAddressList(order?.addressFk);
|
||||||
|
// fetchAgencyList(order?.landed, order?.addressFk);
|
||||||
|
// };
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
clientFk: {
|
clientFk: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -58,6 +63,39 @@ const initialFormState = reactive({
|
||||||
addressId: null,
|
addressId: null,
|
||||||
clientFk: $props.clientFk,
|
clientFk: $props.clientFk,
|
||||||
});
|
});
|
||||||
|
// const orderMapper = (order) => {
|
||||||
|
// return {
|
||||||
|
// addressId: order.addressFk,
|
||||||
|
// agencyModeId: order.agencyModeFk,
|
||||||
|
// landed: new Date(order.landed).toISOString(),
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
// const orderFilter = {
|
||||||
|
// include: [
|
||||||
|
// { relation: 'agencyMode', scope: { fields: ['name'] } },
|
||||||
|
// {
|
||||||
|
// relation: 'address',
|
||||||
|
// scope: { fields: ['nickname'] },
|
||||||
|
// },
|
||||||
|
// { relation: 'rows', scope: { fields: ['id'] } },
|
||||||
|
// {
|
||||||
|
// relation: 'client',
|
||||||
|
// scope: {
|
||||||
|
// fields: [
|
||||||
|
// 'salesPersonFk',
|
||||||
|
// 'name',
|
||||||
|
// 'isActive',
|
||||||
|
// 'isFreezed',
|
||||||
|
// 'isTaxDataChecked',
|
||||||
|
// ],
|
||||||
|
// include: {
|
||||||
|
// relation: 'salesPersonUser',
|
||||||
|
// scope: { fields: ['id', 'name'] },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// };
|
||||||
|
|
||||||
const onClientChange = async (clientId = $props.clientFk) => {
|
const onClientChange = async (clientId = $props.clientFk) => {
|
||||||
const { data } = await axios.get(`Clients/${clientId}`);
|
const { data } = await axios.get(`Clients/${clientId}`);
|
||||||
|
|
|
@ -89,9 +89,6 @@ const total = ref(null);
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="orderData"
|
data-key="orderData"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
|
||||||
<OrderDescriptorMenu :order="entity" />
|
|
||||||
</template>
|
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('globals.state')"
|
:label="t('globals.state')"
|
||||||
|
|
|
@ -12,6 +12,7 @@ import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy
|
||||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
import OrderDescriptorMenu from './OrderDescriptorMenu.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -91,6 +92,9 @@ async function handleConfirm() {
|
||||||
<QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip>
|
<QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<OrderDescriptorMenu :order="entity" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -52,7 +52,7 @@ async function actualizeVolume() {
|
||||||
const params = { isOk: true };
|
const params = { isOk: true };
|
||||||
await axios.post(`Routes/${routeId}/updateVolume`, params);
|
await axios.post(`Routes/${routeId}/updateVolume`, params);
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataUpdated'),
|
message: t('globals.dataSaved'),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy
|
||||||
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
|
import RouteDescriptorMenu from './RouteDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -128,6 +129,9 @@ const ticketColumns = ref([
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
|
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<RouteDescriptorMenu :route="entity.route" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-max">
|
<QCard class="vn-max">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -10,6 +10,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import VnLinkPhone from 'components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'components/ui/VnLinkPhone.vue';
|
||||||
|
import RoadmapDescriptorMenu from './RoadmapDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -86,6 +87,9 @@ const filter = {
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<span>{{ `${entity?.id} - ${entity?.name}` }}</span>
|
<span>{{ `${entity?.id} - ${entity?.name}` }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<RoadmapDescriptorMenu :route="entity" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useQuasar } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
shelving: {
|
shelving: {
|
||||||
|
@ -14,8 +15,11 @@ const $props = defineProps({
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const emit = defineEmits(['onRemove']);
|
||||||
|
|
||||||
function confirmRemove() {
|
function confirmRemove() {
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
|
@ -32,11 +36,12 @@ async function remove() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await axios.delete(`Shelvings/${$props.shelving.id}`);
|
await axios.delete(`Shelvings/${$props.shelving.id}`);
|
||||||
await router.push({ name: 'ShelvingList' });
|
if (route.name != 'ShelvingList') await router.push({ name: 'ShelvingList' });
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataDeleted'),
|
message: t('globals.dataDeleted'),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
|
emit('onRemove', {});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
import VnUserLink from 'components/ui/VnUserLink.vue';
|
import VnUserLink from 'components/ui/VnUserLink.vue';
|
||||||
|
import ShelvingDescriptorMenu from './ShelvingDescriptorMenu.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -14,7 +15,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const summary = ref({});
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
|
@ -45,6 +46,12 @@ const filter = {
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<div>{{ entity.code }}</div>
|
<div>{{ entity.code }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<ShelvingDescriptorMenu
|
||||||
|
:shelving="entity"
|
||||||
|
@on-remove="$refs.summary.fetch()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<RouterLink
|
<RouterLink
|
||||||
|
|
|
@ -9,7 +9,6 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
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 VnAccountNumber from 'src/components/common/VnAccountNumber.vue';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -101,13 +100,10 @@ function handleLocation(data, location) {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnAccountNumber
|
<VnInput
|
||||||
v-model="data.account"
|
v-model="data.account"
|
||||||
:label="t('supplier.fiscalData.account')"
|
:label="t('supplier.fiscalData.account')"
|
||||||
clearable
|
clearable
|
||||||
data-cy="supplierFiscalDataAccount"
|
|
||||||
insertable
|
|
||||||
:maxlength="10"
|
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('supplier.fiscalData.sageTaxTypeFk')"
|
:label="t('supplier.fiscalData.sageTaxTypeFk')"
|
||||||
|
|
|
@ -33,7 +33,6 @@ const canEditZone = useAcl().hasAny([
|
||||||
const agencyFetchRef = ref();
|
const agencyFetchRef = ref();
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
const currenciesOptions = ref([]);
|
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
const zonesOptions = ref([]);
|
const zonesOptions = ref([]);
|
||||||
const addresses = ref([]);
|
const addresses = ref([]);
|
||||||
|
|
|
@ -130,7 +130,6 @@ function ticketFilter(ticket) {
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="entity.ticketState.state.classColor"
|
:color="entity.ticketState.state.classColor"
|
||||||
data-cy="ticketDescriptorStateBadge"
|
|
||||||
>
|
>
|
||||||
{{ entity.ticketState.state.name }}
|
{{ entity.ticketState.state.name }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
|
@ -175,7 +174,7 @@ function ticketFilter(ticket) {
|
||||||
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="entity?.problem?.includes('hasRisk')"
|
v-if="entity.problem.includes('hasRisk')"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -75,7 +75,6 @@ const cancel = () => {
|
||||||
dense
|
dense
|
||||||
style="width: 50%"
|
style="width: 50%"
|
||||||
@click="save()"
|
@click="save()"
|
||||||
data-cy="saveManaBtn"
|
|
||||||
>
|
>
|
||||||
{{ t('globals.save') }}
|
{{ t('globals.save') }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
|
@ -80,14 +80,12 @@ async function handleSave() {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
v-model="row.observationTypeFk"
|
v-model="row.observationTypeFk"
|
||||||
:disable="!!row.id"
|
:disable="!!row.id"
|
||||||
data-cy="ticketNotesObservationType"
|
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('basicData.description')"
|
:label="t('basicData.description')"
|
||||||
v-model="row.description"
|
v-model="row.description"
|
||||||
class="col"
|
class="col"
|
||||||
@keyup.enter="handleSave"
|
@keyup.enter="handleSave"
|
||||||
data-cy="ticketNotesDescription"
|
|
||||||
/>
|
/>
|
||||||
<QIcon
|
<QIcon
|
||||||
name="delete"
|
name="delete"
|
||||||
|
@ -95,7 +93,6 @@ async function handleSave() {
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="handleDelete(row)"
|
@click="handleDelete(row)"
|
||||||
data-cy="ticketNotesRemoveNoteBtn"
|
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketNotes.removeNote') }}
|
{{ t('ticketNotes.removeNote') }}
|
||||||
|
@ -110,7 +107,6 @@ async function handleSave() {
|
||||||
class="fill-icon-on-hover q-ml-md"
|
class="fill-icon-on-hover q-ml-md"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="ticketNotesCrudRef.insert()"
|
@click="ticketNotesCrudRef.insert()"
|
||||||
data-cy="ticketNotesAddNoteBtn"
|
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketNotes.addNote') }}
|
{{ t('ticketNotes.addNote') }}
|
||||||
|
|
|
@ -183,25 +183,18 @@ const resetChanges = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
const params = { quantity: sale.quantity };
|
const payload = { quantity: sale.quantity };
|
||||||
try {
|
await axios.post(`Sales/${sale.id}/updateQuantity`, payload);
|
||||||
await axios.post(`Sales/${sale.id}/updateQuantity`, params);
|
|
||||||
} catch (e) {
|
|
||||||
sale.quantity = tableRef.value.CrudModelRef.originalData.find(
|
|
||||||
(s) => s.id === sale.id
|
|
||||||
).quantity;
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
};
|
};
|
||||||
|
|
||||||
const addSale = async (sale) => {
|
const addSale = async (sale) => {
|
||||||
const params = {
|
const payload = {
|
||||||
barcode: sale.itemFk,
|
barcode: sale.itemFk,
|
||||||
quantity: sale.quantity,
|
quantity: sale.quantity,
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data } = await axios.post(`tickets/${route.params.id}/addSale`, params);
|
const { data } = await axios.post(`tickets/${route.params.id}/addSale`, payload);
|
||||||
|
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
|
@ -229,7 +222,7 @@ const changeQuantity = async (sale) => {
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
if (!sale.id) return addSale(sale);
|
if (!sale.id) return addSale(sale);
|
||||||
await updateQuantity(sale);
|
updateQuantity(sale);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateConcept = async (sale) => {
|
const updateConcept = async (sale) => {
|
||||||
|
@ -551,7 +544,6 @@ watch(
|
||||||
color="primary"
|
color="primary"
|
||||||
:disable="!isTicketEditable || ticketState === 'OK'"
|
:disable="!isTicketEditable || ticketState === 'OK'"
|
||||||
@click="changeTicketState('OK')"
|
@click="changeTicketState('OK')"
|
||||||
data-cy="ticketSaleOkStateBtn"
|
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t(`Change ticket state to 'Ok'`) }}</QTooltip>
|
<QTooltip>{{ t(`Change ticket state to 'Ok'`) }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -560,7 +552,6 @@ watch(
|
||||||
color="primary"
|
color="primary"
|
||||||
:label="t('ticketList.state')"
|
:label="t('ticketList.state')"
|
||||||
:disable="!isTicketEditable"
|
:disable="!isTicketEditable"
|
||||||
data-cy="ticketSaleStateDropdown"
|
|
||||||
>
|
>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:options="editableStatesOptions"
|
:options="editableStatesOptions"
|
||||||
|
@ -570,7 +561,6 @@ watch(
|
||||||
hide-dropdown-icon
|
hide-dropdown-icon
|
||||||
focus-on-mount
|
focus-on-mount
|
||||||
@update:model-value="changeTicketState"
|
@update:model-value="changeTicketState"
|
||||||
data-cy="ticketSaleStateSelect"
|
|
||||||
/>
|
/>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
<TicketSaleMoreActions
|
<TicketSaleMoreActions
|
||||||
|
@ -603,7 +593,6 @@ watch(
|
||||||
icon="vn:splitline"
|
icon="vn:splitline"
|
||||||
:disable="!isTicketEditable || !hasSelectedRows"
|
:disable="!isTicketEditable || !hasSelectedRows"
|
||||||
@click="setTransferParams()"
|
@click="setTransferParams()"
|
||||||
data-cy="ticketSaleTransferBtn"
|
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Transfer lines') }}</QTooltip>
|
<QTooltip>{{ t('Transfer lines') }}</QTooltip>
|
||||||
<TicketTransfer
|
<TicketTransfer
|
||||||
|
@ -683,13 +672,7 @@ watch(
|
||||||
{{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
|
{{ t('ticketSale.visible') }}: {{ row.visible || 0 }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon v-if="row.reserved" color="primary" name="vn:reserva" size="xs">
|
||||||
v-if="row.reserved"
|
|
||||||
color="primary"
|
|
||||||
name="vn:reserva"
|
|
||||||
size="xs"
|
|
||||||
data-cy="ticketSaleReservedIcon"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('ticketSale.reserved') }}
|
{{ t('ticketSale.reserved') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
@ -842,14 +825,7 @@ watch(
|
||||||
</VnTable>
|
</VnTable>
|
||||||
|
|
||||||
<QPageSticky :offset="[20, 20]" style="z-index: 2">
|
<QPageSticky :offset="[20, 20]" style="z-index: 2">
|
||||||
<QBtn
|
<QBtn @click="newOrderFromTicket()" color="primary" fab icon="add" shortcut="+" />
|
||||||
@click="newOrderFromTicket()"
|
|
||||||
color="primary"
|
|
||||||
fab
|
|
||||||
icon="add"
|
|
||||||
shortcut="+"
|
|
||||||
data-cy="ticketSaleAddToBasketBtn"
|
|
||||||
/>
|
|
||||||
<QTooltip class="text-no-wrap">
|
<QTooltip class="text-no-wrap">
|
||||||
{{ t('Add item to basket') }}
|
{{ t('Add item to basket') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
|
|
@ -175,7 +175,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:label="t('ticketSale.more')"
|
:label="t('ticketSale.more')"
|
||||||
:disable="disable"
|
:disable="disable"
|
||||||
data-cy="ticketSaleMoreActionsDropdown"
|
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
|
||||||
|
@ -187,7 +186,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="showSmsDialog('productNotAvailable')"
|
@click="showSmsDialog('productNotAvailable')"
|
||||||
data-cy="sendShortageSMSItem"
|
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Send shortage SMS') }}</QItemLabel>
|
<QItemLabel>{{ t('Send shortage SMS') }}</QItemLabel>
|
||||||
|
@ -199,18 +197,12 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="calculateSalePrice()"
|
@click="calculateSalePrice()"
|
||||||
data-cy="recalculatePriceItem"
|
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Recalculate price') }}</QItemLabel>
|
<QItemLabel>{{ t('Recalculate price') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem clickable v-ripple @click="emit('getMana')">
|
||||||
clickable
|
|
||||||
v-ripple
|
|
||||||
@click="emit('getMana')"
|
|
||||||
data-cy="updateDiscountItem"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -219,7 +211,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-model.number="newDiscount"
|
v-model.number="newDiscount"
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
data-cy="ticketSaleDiscountInput"
|
|
||||||
/>
|
/>
|
||||||
</TicketEditManaProxy>
|
</TicketEditManaProxy>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -229,7 +220,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="createClaim()"
|
@click="createClaim()"
|
||||||
data-cy="createClaimItem"
|
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
||||||
|
@ -241,7 +231,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="setReserved(true)"
|
@click="setReserved(true)"
|
||||||
data-cy="markAsReservedItem"
|
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
||||||
|
@ -253,13 +242,12 @@ const createRefund = async (withWarehouse) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-ripple
|
v-ripple
|
||||||
@click="setReserved(false)"
|
@click="setReserved(false)"
|
||||||
data-cy="unmarkAsReservedItem"
|
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Unmark as reserved') }}</QItemLabel>
|
<QItemLabel>{{ t('Unmark as reserved') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
<QItem clickable v-ripple>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -268,22 +256,12 @@ const createRefund = async (withWarehouse) => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QMenu anchor="top end" self="top start" auto-close bordered>
|
<QMenu anchor="top end" self="top start" auto-close bordered>
|
||||||
<QList>
|
<QList>
|
||||||
<QItem
|
<QItem v-ripple clickable @click="createRefund(true)">
|
||||||
v-ripple
|
|
||||||
clickable
|
|
||||||
@click="createRefund(true)"
|
|
||||||
data-cy="ticketSaleRefundWithWarehouse"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('with warehouse') }}
|
{{ t('with warehouse') }}
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem v-ripple clickable @click="createRefund(false)">
|
||||||
v-ripple
|
|
||||||
clickable
|
|
||||||
@click="createRefund(false)"
|
|
||||||
data-cy="ticketSaleRefundWithoutWarehouse"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('without warehouse') }}
|
{{ t('without warehouse') }}
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
|
|
@ -96,7 +96,6 @@ function toTicketUrl(section) {
|
||||||
ref="summaryRef"
|
ref="summaryRef"
|
||||||
:url="`Tickets/${entityId}/summary`"
|
:url="`Tickets/${entityId}/summary`"
|
||||||
data-key="TicketSummary"
|
data-key="TicketSummary"
|
||||||
data-cy="ticketSummary"
|
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<VnToSummary
|
<VnToSummary
|
||||||
|
@ -114,7 +113,7 @@ function toTicketUrl(section) {
|
||||||
{{ entity.nickname }}
|
{{ entity.nickname }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #header-right="{ entity }">
|
<template #header-right>
|
||||||
<div>
|
<div>
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
ref="stateBtnDropdownRef"
|
ref="stateBtnDropdownRef"
|
||||||
|
@ -133,18 +132,11 @@ function toTicketUrl(section) {
|
||||||
@update:model-value="changeState"
|
@update:model-value="changeState"
|
||||||
/>
|
/>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
<QBtn color="white" dense flat icon="more_vert" round size="md">
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('components.cardDescriptor.moreOptions') }}
|
|
||||||
</QTooltip>
|
|
||||||
<QMenu>
|
|
||||||
<QList>
|
|
||||||
<TicketDescriptorMenu :ticket="entity" />
|
|
||||||
</QList>
|
|
||||||
</QMenu>
|
|
||||||
</QBtn>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<TicketDescriptorMenu :ticket="entity" />
|
||||||
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -91,7 +91,7 @@ onMounted(() => (_transfer.value = $props.transfer));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketTransferPopup">
|
<QPopupProxy ref="QPopupProxyRef">
|
||||||
<QCard class="q-px-md" style="display: flex; width: 80vw">
|
<QCard class="q-px-md" style="display: flex; width: 80vw">
|
||||||
<QTable
|
<QTable
|
||||||
:rows="transfer.sales"
|
:rows="transfer.sales"
|
||||||
|
|
|
@ -57,7 +57,6 @@ defineExpose({ transferSales });
|
||||||
v-model.number="_transfer.ticketId"
|
v-model.number="_transfer.ticketId"
|
||||||
:label="t('Transfer to ticket')"
|
:label="t('Transfer to ticket')"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
data-cy="ticketTransferDestinationTicketInput"
|
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -65,7 +64,6 @@ defineExpose({ transferSales });
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="transferSales(_transfer.ticketId)"
|
@click="transferSales(_transfer.ticketId)"
|
||||||
style="width: 30px"
|
style="width: 30px"
|
||||||
data-cy="ticketTransferTransferBtn"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
|
@ -74,7 +72,6 @@ defineExpose({ transferSales });
|
||||||
color="primary"
|
color="primary"
|
||||||
class="full-width q-my-lg"
|
class="full-width q-my-lg"
|
||||||
@click="transferSales()"
|
@click="transferSales()"
|
||||||
data-cy="ticketTransferNewTicketBtn"
|
|
||||||
/>
|
/>
|
||||||
</QForm>
|
</QForm>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -215,7 +215,7 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => {
|
||||||
|
|
||||||
if (!newLanded) {
|
if (!newLanded) {
|
||||||
notify(t('advanceTickets.noDeliveryZone'), 'negative');
|
notify(t('advanceTickets.noDeliveryZone'), 'negative');
|
||||||
throw new Error(t('advanceTickets.noDeliveryZone'));
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ticket.landed = newLanded.landed;
|
ticket.landed = newLanded.landed;
|
||||||
|
@ -299,10 +299,10 @@ const splitTickets = async () => {
|
||||||
const { query, params } = await requestComponentUpdate(ticket, true);
|
const { query, params } = await requestComponentUpdate(ticket, true);
|
||||||
await axios.post(query, params);
|
await axios.post(query, params);
|
||||||
progressAdd(ticket.futureId);
|
progressAdd(ticket.futureId);
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
splitErrors.value.push({
|
splitErrors.value.push({
|
||||||
id: ticket.futureId,
|
id: ticket.futureId,
|
||||||
reason: e.message || e.response?.data?.error?.message,
|
reason: error.response?.data?.error?.message,
|
||||||
});
|
});
|
||||||
progressAdd(ticket.futureId);
|
progressAdd(ticket.futureId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@ import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorP
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import { toTimeFormat } from 'src/filters/date';
|
import { toTimeFormat } from 'src/filters/date';
|
||||||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -456,7 +455,6 @@ function setReference(data) {
|
||||||
data-key="TicketList"
|
data-key="TicketList"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('You can search by ticket id or alias')"
|
:info="t('You can search by ticket id or alias')"
|
||||||
data-cy="ticketListSearchBar"
|
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
@ -484,10 +482,68 @@ function setReference(data) {
|
||||||
'row-key': 'id',
|
'row-key': 'id',
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
data-cy="ticketListTable"
|
|
||||||
>
|
>
|
||||||
<template #column-statusIcons="{ row }">
|
<template #column-statusIcons="{ row }">
|
||||||
<TicketProblems :row="row" />
|
<div class="q-gutter-x-xs">
|
||||||
|
<QIcon
|
||||||
|
v-if="row.isTaxDataChecked === 0"
|
||||||
|
color="primary"
|
||||||
|
name="vn:no036"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('No verified data') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.hasTicketRequest"
|
||||||
|
color="primary"
|
||||||
|
name="vn:buyrequest"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('Purchase request') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.itemShortage"
|
||||||
|
color="primary"
|
||||||
|
name="vn:unavailable"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('Not visible') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.isFreezed" color="primary" name="vn:frozen" size="xs">
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('Client frozen') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon v-if="row.risk" color="primary" name="vn:risk" size="xs">
|
||||||
|
<QTooltip> {{ t('Risk') }}: {{ row.risk }} </QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.hasComponentLack"
|
||||||
|
color="primary"
|
||||||
|
name="vn:components"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('Component lack') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="row.hasRounding"
|
||||||
|
color="primary"
|
||||||
|
name="sync_problem"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('Rounding') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-salesPersonFk="{ row }">
|
<template #column-salesPersonFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
|
|
|
@ -14,8 +14,6 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
const warehousesOptionsOut = ref([]);
|
|
||||||
const warehousesOptionsIn = ref([]);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -23,18 +21,6 @@ const warehousesOptionsIn = ref([]);
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
url="Warehouses"
|
|
||||||
@on-fetch="(data) => (warehousesOptionsOut = data)"
|
|
||||||
auto-load
|
|
||||||
:filter="{ where: { isOrigin: TRUE } }"
|
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
url="Warehouses"
|
|
||||||
@on-fetch="(data) => (warehousesOptionsIn = data)"
|
|
||||||
auto-load
|
|
||||||
:filter="{ where: { isDestiny: TRUE } }"
|
|
||||||
/>
|
|
||||||
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel" auto-load>
|
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel" auto-load>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -53,12 +39,11 @@ const warehousesOptionsIn = ref([]);
|
||||||
<VnInputDate v-model="data.shipped" :label="t('globals.shipped')" />
|
<VnInputDate v-model="data.shipped" :label="t('globals.shipped')" />
|
||||||
<VnInputDate v-model="data.landed" :label="t('globals.landed')" />
|
<VnInputDate v-model="data.landed" :label="t('globals.landed')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.warehouseOut')"
|
:label="t('globals.warehouseOut')"
|
||||||
v-model="data.warehouseOutFk"
|
v-model="data.warehouseOutFk"
|
||||||
:options="warehousesOptionsOut"
|
:options="agenciesOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
map-options
|
map-options
|
||||||
|
@ -67,7 +52,7 @@ const warehousesOptionsIn = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.warehouseIn')"
|
:label="t('globals.warehouseIn')"
|
||||||
v-model="data.warehouseInFk"
|
v-model="data.warehouseInFk"
|
||||||
:options="warehousesOptionsIn"
|
:options="agenciesOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
map-options
|
map-options
|
||||||
|
@ -104,7 +89,7 @@ const warehousesOptionsIn = ref([]);
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
raidDays: Si se marca "Redada", la fecha de entrega se moverá automáticamente los días indicados.
|
raidDays: Si se marca "Redada", la fecha de entrega se moverá automáticamente los días indicados (incluido 0). Si se deja vacio, la fecha no cambiará
|
||||||
en:
|
en:
|
||||||
raidDays: If "Raid" is checked, the landing date will automatically shift by the specified number of days.
|
raidDays: If "Raid" is checked, the landing date will automatically shift by the specified number of days (including 0). If left empty, the date will stay the same.
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -44,8 +44,8 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
||||||
<TravelDescriptorMenuItems :travel="entity" />
|
<TravelDescriptorMenuItems :travel="entity" />
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.warehouseIn')" :value="entity.warehouseIn?.name" />
|
<VnLv :label="t('globals.warehouseIn')" :value="entity.warehouseIn.name" />
|
||||||
<VnLv :label="t('globals.warehouseOut')" :value="entity.warehouseOut?.name" />
|
<VnLv :label="t('globals.warehouseOut')" :value="entity.warehouseOut.name" />
|
||||||
<VnLv :label="t('globals.shipped')" :value="toDate(entity.shipped)" />
|
<VnLv :label="t('globals.shipped')" :value="toDate(entity.shipped)" />
|
||||||
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" />
|
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" />
|
||||||
<VnLv :label="t('globals.totalEntries')" :value="entity.totalEntries" />
|
<VnLv :label="t('globals.totalEntries')" :value="entity.totalEntries" />
|
||||||
|
|
|
@ -300,6 +300,10 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
|
||||||
<VnLv :label="t('globals.reference')" :value="travel.ref" />
|
<VnLv :label="t('globals.reference')" :value="travel.ref" />
|
||||||
<VnLv label="m³" :value="travel.m3" />
|
<VnLv label="m³" :value="travel.m3" />
|
||||||
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
|
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('travel.basicData.daysInForward')"
|
||||||
|
:value="travel?.daysInForward"
|
||||||
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="full-width">
|
<QCard class="full-width">
|
||||||
<VnTitle :text="t('travel.summary.entries')" />
|
<VnTitle :text="t('travel.summary.entries')" />
|
||||||
|
|
|
@ -1,263 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
|
||||||
import axios from 'axios';
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import FormModel from 'src/components/FormModel.vue';
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
import CrudModel from 'components/CrudModel.vue';
|
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
|
||||||
import { useQuasar } from 'quasar';
|
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
|
||||||
const { notify } = useNotify();
|
|
||||||
const route = useRoute();
|
|
||||||
const { t } = useI18n();
|
|
||||||
const disabilityGradesOptions = ref();
|
|
||||||
const workerPitCrudRef = ref({});
|
|
||||||
const insertTag = () => {
|
|
||||||
workerPitCrudRef.value.insert();
|
|
||||||
};
|
|
||||||
const quasar = useQuasar();
|
|
||||||
const deleteRelative = async (id) => {
|
|
||||||
await new Promise((resolve) => {
|
|
||||||
quasar
|
|
||||||
.dialog({
|
|
||||||
component: VnConfirm,
|
|
||||||
componentProps: {
|
|
||||||
title: t('Remove Relative'),
|
|
||||||
message: t('Do you want to remove this relative?'),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.onOk(() => {
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.onCancel(() => {
|
|
||||||
resolve(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
await axios.delete(`WorkerRelatives/${id}`);
|
|
||||||
workerPitCrudRef.value.reload();
|
|
||||||
notify('Relative removed', 'positive');
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<FetchData
|
|
||||||
url="DisabilityGrades"
|
|
||||||
@on-fetch="(data) => (disabilityGradesOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormModel
|
|
||||||
url="WorkerIrpfs"
|
|
||||||
:filter="{ where: { workerFk: route.params.id } }"
|
|
||||||
auto-load
|
|
||||||
data-key="workerIrpfs"
|
|
||||||
:max-width="false"
|
|
||||||
>
|
|
||||||
<template #form="{ data }">
|
|
||||||
<QCard class="q-px-lg q-py-lg">
|
|
||||||
<VnTitle :text="t('IRPF')" />
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
:label="t('familySituation')"
|
|
||||||
clearable
|
|
||||||
v-model="data.familySituation"
|
|
||||||
/>
|
|
||||||
<VnInput :label="t('spouseNif')" clearable v-model="data.spouseNif" />
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('disabilityGrades')"
|
|
||||||
:options="disabilityGradesOptions"
|
|
||||||
option-label="description"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.disabilityGradeFk"
|
|
||||||
id="disabilityGrades"
|
|
||||||
data-cy="disabilityGrades"
|
|
||||||
hide-selected
|
|
||||||
/>
|
|
||||||
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('geographicMobilityDate')"
|
|
||||||
v-model="data.geographicMobilityDate"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<VnInput
|
|
||||||
clearable
|
|
||||||
v-model="data.childPension"
|
|
||||||
:label="t(`childPension`)"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
clearable
|
|
||||||
v-model="data.spousePension"
|
|
||||||
:label="t(`spousePension`)"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<QCheckbox v-model="data.isDependend" :label="t(`isDependend`)" />
|
|
||||||
<QCheckbox
|
|
||||||
v-model="data.hasHousingPaymentBefore"
|
|
||||||
:label="t(`hasHousingPaymentBefore`)"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
|
||||||
<QCheckbox
|
|
||||||
v-model="data.hasHousingPaymentAfter"
|
|
||||||
:label="t(`hasHousingPaymentAfter`)"
|
|
||||||
/>
|
|
||||||
<QCheckbox
|
|
||||||
v-model="data.hasExtendedWorking"
|
|
||||||
:label="t(`hasExtendedWorking`)"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
</QCard>
|
|
||||||
|
|
||||||
<CrudModel
|
|
||||||
ref="workerPitCrudRef"
|
|
||||||
data-key="workerPit"
|
|
||||||
url="WorkerRelatives"
|
|
||||||
auto-load
|
|
||||||
:filter="{
|
|
||||||
where: { workerFk: route.params.id },
|
|
||||||
}"
|
|
||||||
:data-required="{ workerFk: route.params.id }"
|
|
||||||
:has-sub-toolbar="false"
|
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QCard class="q-px-lg q-py-lg" flat>
|
|
||||||
<div class="row no-wrap justify-between q-pb-md">
|
|
||||||
<VnTitle :text="t('Relatives')" />
|
|
||||||
<QBtnGroup push style="column-gap: 10px">
|
|
||||||
<QBtn
|
|
||||||
color="primary"
|
|
||||||
icon="restart_alt"
|
|
||||||
flat
|
|
||||||
@click="workerPitCrudRef.reset"
|
|
||||||
:disable="!workerPitCrudRef.hasChanges"
|
|
||||||
:title="t('globals.reset')"
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
ref="saveButtonRef"
|
|
||||||
color="primary"
|
|
||||||
icon="save"
|
|
||||||
@click="workerPitCrudRef.onSubmit"
|
|
||||||
:disable="!workerPitCrudRef.hasChanges"
|
|
||||||
:title="t('globals.save')"
|
|
||||||
data-cy="workerPitRelativeSaveBtn"
|
|
||||||
/>
|
|
||||||
</QBtnGroup>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-for="(row, index) in rows"
|
|
||||||
:key="index"
|
|
||||||
class="row no-wrap q-mb-lg q-gutter-lg"
|
|
||||||
padding="none"
|
|
||||||
>
|
|
||||||
<VnSelect
|
|
||||||
:options="[
|
|
||||||
{ id: 0, name: 'Ascendiente' },
|
|
||||||
{ id: 1, name: 'Descendiente' },
|
|
||||||
]"
|
|
||||||
:label="t('isDescendant')"
|
|
||||||
v-model="row.isDescendant"
|
|
||||||
class="q-gutter-xs q-mb-xs"
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('disabilityGrades')"
|
|
||||||
:options="disabilityGradesOptions"
|
|
||||||
option-label="description"
|
|
||||||
option-value="id"
|
|
||||||
v-model="row.disabilityGradeFk"
|
|
||||||
class="q-gutter-xs q-mb-xs"
|
|
||||||
/>
|
|
||||||
<VnInput
|
|
||||||
type="number"
|
|
||||||
v-model="row.birthed"
|
|
||||||
:label="t(`birthed`)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<VnInput
|
|
||||||
type="number"
|
|
||||||
v-model="row.adoptionYear"
|
|
||||||
:label="t(`adoptionYear`)"
|
|
||||||
/>
|
|
||||||
<QCheckbox
|
|
||||||
v-model="row.isDependend"
|
|
||||||
:label="t(`isDependend`)"
|
|
||||||
/>
|
|
||||||
<QCheckbox
|
|
||||||
v-model="row.isJointCustody"
|
|
||||||
:label="t(`isJointCustody`)"
|
|
||||||
size="xs"
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
@click="deleteRelative(rows[0].id)"
|
|
||||||
class="cursor-pointer"
|
|
||||||
color="primary"
|
|
||||||
flat
|
|
||||||
icon="delete"
|
|
||||||
style="flex: 0"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<VnRow class="justify-left items-center">
|
|
||||||
<QBtn
|
|
||||||
@click="insertTag(rows)"
|
|
||||||
class="cursor-pointer"
|
|
||||||
color="primary"
|
|
||||||
flat
|
|
||||||
icon="add"
|
|
||||||
shortcut="+"
|
|
||||||
style="flex: 0"
|
|
||||||
data-cy="addRelative"
|
|
||||||
/>
|
|
||||||
</VnRow>
|
|
||||||
</QCard>
|
|
||||||
</template>
|
|
||||||
</CrudModel>
|
|
||||||
</template>
|
|
||||||
</FormModel>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
familySituation: Situación familiar
|
|
||||||
disabilityGrades: Discapacidad
|
|
||||||
geographicMobilityDate: Movilidad geografica
|
|
||||||
childPension: Pensión hijos
|
|
||||||
spousePension: Pensión cónyuge
|
|
||||||
isDependend: Ayuda / Movilidad reducida
|
|
||||||
spouseNif: NIF cónyuge
|
|
||||||
hasHousingPaymentBefore: Pagos vivienda anterior 2011
|
|
||||||
hasHousingPaymentAfter: Pagos vivienda posterior 2011
|
|
||||||
hasExtendedWorking: Prolongación actividad laboral
|
|
||||||
isDescendant: Descen/Ascen
|
|
||||||
disabilityGradeFk: Discapacidad
|
|
||||||
birthed: Año nacimiento
|
|
||||||
adoptionYear: Año adopción
|
|
||||||
isJointCustody: Computo por entero
|
|
||||||
Relatives: Relacionados
|
|
||||||
en:
|
|
||||||
familySituation: Family Situation
|
|
||||||
disabilityGrades: Disability Grades
|
|
||||||
geographicMobilityDate: Geographic Mobility Date
|
|
||||||
childPension: Child Pension
|
|
||||||
spousePension: Spouse Pension
|
|
||||||
isDependend: Dependent Suport / Reduced Mobility
|
|
||||||
spouseNif: Spouse NIF (Tax ID)
|
|
||||||
hasHousingPaymentBefore: Housing Payments Before 2011
|
|
||||||
hasHousingPaymentAfter: Housing Payments After 2011
|
|
||||||
hasExtendedWorking: Extended Work Activity
|
|
||||||
isDescendant: Descendant/Ascendant
|
|
||||||
disabilityGradeFk: Disability Grade
|
|
||||||
birthed: Birth Year
|
|
||||||
adoptionYear: Adoption Year
|
|
||||||
isJointCustody: Joint custody
|
|
||||||
Relatives: Relatives
|
|
||||||
</i18n>
|
|
|
@ -43,7 +43,7 @@ const { t } = useI18n();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
||||||
const isNew = computed(() => props.isNewMode);
|
const isNew = computed(() => props.isNewMode);
|
||||||
const dated = ref(props.date);
|
const dated = ref(null);
|
||||||
const tickedNodes = ref();
|
const tickedNodes = ref();
|
||||||
|
|
||||||
const _excludeType = ref('all');
|
const _excludeType = ref('all');
|
||||||
|
@ -73,6 +73,7 @@ const exclusionCreate = async () => {
|
||||||
await axios.post(`Zones/${route.params.id}/exclusions`, {
|
await axios.post(`Zones/${route.params.id}/exclusions`, {
|
||||||
dated: dated.value,
|
dated: dated.value,
|
||||||
});
|
});
|
||||||
|
|
||||||
await refetchEvents();
|
await refetchEvents();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -114,14 +115,13 @@ onMounted(() => {
|
||||||
@on-submit="onSubmit()"
|
@on-submit="onSubmit()"
|
||||||
:default-cancel-button="false"
|
:default-cancel-button="false"
|
||||||
:default-submit-button="false"
|
:default-submit-button="false"
|
||||||
:submit-on-enter="false"
|
|
||||||
>
|
>
|
||||||
<template #form-inputs>
|
<template #form-inputs>
|
||||||
<VnRow class="row q-gutter-md q-mb-lg">
|
<VnRow class="row q-gutter-md q-mb-lg">
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('eventsInclusionForm.day')"
|
:label="t('eventsInclusionForm.day')"
|
||||||
v-model="dated"
|
v-model="dated"
|
||||||
:required="true"
|
:model-value="props.date"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<div class="column q-gutter-y-sm q-mb-md">
|
<div class="column q-gutter-y-sm q-mb-md">
|
||||||
|
@ -182,7 +182,6 @@ onMounted(() => {
|
||||||
:label="isNew ? t('globals.add') : t('globals.save')"
|
:label="isNew ? t('globals.add') : t('globals.save')"
|
||||||
type="submit"
|
type="submit"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="onSubmit()"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</FormPopup>
|
</FormPopup>
|
||||||
|
|
|
@ -38,7 +38,6 @@ const datakey = 'ZoneLocations';
|
||||||
const url = computed(() => `Zones/${route.params.id}/getLeaves`);
|
const url = computed(() => `Zones/${route.params.id}/getLeaves`);
|
||||||
const arrayData = useArrayData(datakey, {
|
const arrayData = useArrayData(datakey, {
|
||||||
url: url.value,
|
url: url.value,
|
||||||
limit: null,
|
|
||||||
});
|
});
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
|
|
||||||
|
@ -75,7 +74,6 @@ const onNodeExpanded = async (nodeKeysArray) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
node.childs = response.data.map((n) => {
|
node.childs = response.data.map((n) => {
|
||||||
if (n.sons > 0) n.childs = [{}];
|
if (n.sons > 0) n.childs = [{}];
|
||||||
n.selected = isSelected(n.selected);
|
|
||||||
return n;
|
return n;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -92,16 +90,21 @@ const onNodeExpanded = async (nodeKeysArray) => {
|
||||||
previousExpandedNodes.value = nodeKeysSet;
|
previousExpandedNodes.value = nodeKeysSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatNodeSelected = (node) => {
|
||||||
|
if (node.selected === 1) node.selected = true;
|
||||||
|
else if (node.selected === 0) node.selected = false;
|
||||||
|
|
||||||
|
if (node.sons > 0 && !node.childs) node.childs = [{}];
|
||||||
|
};
|
||||||
|
|
||||||
const fetchNodeLeaves = async (nodeKey) => {
|
const fetchNodeLeaves = async (nodeKey) => {
|
||||||
if (!treeRef.value) return;
|
if (!treeRef.value) return;
|
||||||
const node = treeRef.value?.getNodeByKey(nodeKey);
|
const node = treeRef.value?.getNodeByKey(nodeKey);
|
||||||
if (typeof node.selected === 'number') node.selected = !!node.selected;
|
if (node.selected === 1) node.selected = true;
|
||||||
if (node.sons > 0 && !node.childs) {
|
else if (node.selected === 0) node.selected = false;
|
||||||
node.childs = [{}];
|
|
||||||
const index = expanded.value.indexOf(node.id);
|
|
||||||
expanded.value.splice(index, 1);
|
|
||||||
}
|
|
||||||
if (!node || node.sons === 0) return;
|
if (!node || node.sons === 0) return;
|
||||||
|
|
||||||
|
state.set('Tree', node);
|
||||||
};
|
};
|
||||||
|
|
||||||
function getNodeIds(node) {
|
function getNodeIds(node) {
|
||||||
|
@ -116,10 +119,6 @@ function getNodeIds(node) {
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSelected(selected) {
|
|
||||||
if (typeof selected === 'number') return !!selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => store.data,
|
() => store.data,
|
||||||
async (val) => {
|
async (val) => {
|
||||||
|
@ -129,21 +128,32 @@ watch(
|
||||||
nodes.value[0].childs = [...val];
|
nodes.value[0].childs = [...val];
|
||||||
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
||||||
state.set('Tree', [...fetchedNodeKeys]);
|
state.set('Tree', [...fetchedNodeKeys]);
|
||||||
expanded.value = [null, ...fetchedNodeKeys];
|
|
||||||
|
if (!store.userParams?.search) {
|
||||||
|
val.forEach((n) => {
|
||||||
|
formatNodeSelected(n);
|
||||||
|
});
|
||||||
|
store.data = null;
|
||||||
|
expanded.value = [null];
|
||||||
|
} else {
|
||||||
for (let n of state.get('Tree')) {
|
for (let n of state.get('Tree')) {
|
||||||
await fetchNodeLeaves(n);
|
await fetchNodeLeaves(n);
|
||||||
}
|
}
|
||||||
|
expanded.value = [null, ...fetchedNodeKeys];
|
||||||
|
}
|
||||||
previousExpandedNodes.value = new Set(expanded.value);
|
previousExpandedNodes.value = new Set(expanded.value);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
const reFetch = async () => {
|
const reFetch = async () => {
|
||||||
await arrayData.fetch({});
|
const { data } = await arrayData.fetch({ append: false });
|
||||||
|
nodes.value = data;
|
||||||
|
expanded.value = [null];
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await reFetch();
|
if (store.userParams?.search) await arrayData.fetch({});
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
@ -157,13 +167,13 @@ onUnmounted(() => {
|
||||||
v-if="showSearchBar"
|
v-if="showSearchBar"
|
||||||
v-model="store.userParams.search"
|
v-model="store.userParams.search"
|
||||||
:placeholder="$t('globals.search')"
|
:placeholder="$t('globals.search')"
|
||||||
@keydown.enter.stop.prevent="reFetch"
|
@update:model-value="reFetch()"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QBtn color="primary" icon="search" dense flat @click="reFetch()" />
|
<QBtn color="primary" icon="search" dense flat @click="reFetch()" />
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
<VnSearchbar v-if="!showSearchBar" :data-key="datakey" :url="url" :redirect="false" />
|
<VnSearchbar :data-key="datakey" :url="url" :redirect="false" />
|
||||||
<QTree
|
<QTree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:nodes="nodes"
|
:nodes="nodes"
|
||||||
|
|
|
@ -113,7 +113,7 @@ export default {
|
||||||
name: 'SupplierAccounts',
|
name: 'SupplierAccounts',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'accounts',
|
title: 'accounts',
|
||||||
icon: 'vn:credit',
|
icon: 'vn:account',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: () =>
|
||||||
import('src/pages/Supplier/Card/SupplierAccounts.vue'),
|
import('src/pages/Supplier/Card/SupplierAccounts.vue'),
|
||||||
|
|
|
@ -24,7 +24,6 @@ export default {
|
||||||
'WorkerDms',
|
'WorkerDms',
|
||||||
'WorkerTimeControl',
|
'WorkerTimeControl',
|
||||||
'WorkerLocker',
|
'WorkerLocker',
|
||||||
'WorkerPit',
|
|
||||||
'WorkerBalance',
|
'WorkerBalance',
|
||||||
'WorkerFormation',
|
'WorkerFormation',
|
||||||
'WorkerMedical',
|
'WorkerMedical',
|
||||||
|
@ -217,15 +216,6 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'WorkerPit',
|
|
||||||
path: 'pit',
|
|
||||||
meta: {
|
|
||||||
title: 'pit',
|
|
||||||
icon: 'lock',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'WorkerOperator',
|
name: 'WorkerOperator',
|
||||||
path: 'operator',
|
path: 'operator',
|
||||||
|
|
|
@ -162,15 +162,6 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
);
|
);
|
||||||
throw new Error('Invalid Serial Type');
|
throw new Error('Invalid Serial Type');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clientsToInvoice === 'all' && params.serialType !== 'global') {
|
|
||||||
notify(
|
|
||||||
'invoiceOut.globalInvoices.errors.invalidSerialTypeForAll',
|
|
||||||
'negative'
|
|
||||||
);
|
|
||||||
throw new Error('For "all" clients, the serialType must be "global"');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!params.companyFk) {
|
if (!params.companyFk) {
|
||||||
notify('invoiceOut.globalInvoices.errors.chooseValidCompany', 'negative');
|
notify('invoiceOut.globalInvoices.errors.chooseValidCompany', 'negative');
|
||||||
throw new Error('Invalid company');
|
throw new Error('Invalid company');
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('TicketList', () => {
|
|
||||||
const firstRow = 'tbody > :nth-child(1)';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/ticket/list');
|
|
||||||
});
|
|
||||||
|
|
||||||
const searchResults = (search) => {
|
|
||||||
cy.dataCy('vnSearchBar').find('input').focus();
|
|
||||||
if (search) cy.dataCy('vnSearchBar').find('input').type(search);
|
|
||||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
|
||||||
cy.dataCy('ticketListTable').should('exist');
|
|
||||||
cy.get(firstRow).should('exist');
|
|
||||||
};
|
|
||||||
|
|
||||||
it('should search results', () => {
|
|
||||||
cy.dataCy('ticketListTable').should('not.exist');
|
|
||||||
cy.get('.q-field__control').should('exist');
|
|
||||||
searchResults();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should open ticket sales', () => {
|
|
||||||
searchResults();
|
|
||||||
cy.window().then((win) => {
|
|
||||||
cy.stub(win, 'open').as('windowOpen');
|
|
||||||
});
|
|
||||||
cy.get(firstRow).find('.q-btn:first').click();
|
|
||||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should open ticket summary', () => {
|
|
||||||
searchResults();
|
|
||||||
cy.get(firstRow).find('.q-btn:last').click();
|
|
||||||
cy.dataCy('ticketSummary').should('exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Client list create new client', () => {
|
|
||||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
|
||||||
const data = {
|
|
||||||
Customer: { val: 1, type: 'select' },
|
|
||||||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
|
||||||
Address: { val: 'employee', type: 'select' },
|
|
||||||
Landed: { val: '01-01-2024', type: 'date' },
|
|
||||||
};
|
|
||||||
cy.fillInForm(data);
|
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
||||||
cy.checkNotification('Data created');
|
|
||||||
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,25 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('TicketRequest', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/ticket/31/observation');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Creates and deletes a note', () => {
|
|
||||||
cy.dataCy('ticketNotesAddNoteBtn').should('exist');
|
|
||||||
cy.dataCy('ticketNotesAddNoteBtn').click();
|
|
||||||
cy.dataCy('ticketNotesObservationType').should('exist');
|
|
||||||
cy.selectOption('[data-cy="ticketNotesObservationType"]:last', 'Weight');
|
|
||||||
cy.dataCy('ticketNotesDescription').should('exist');
|
|
||||||
cy.get('[data-cy="ticketNotesDescription"]:last').type(
|
|
||||||
'This is a note description'
|
|
||||||
);
|
|
||||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
|
||||||
cy.checkNotification('Data saved');
|
|
||||||
cy.dataCy('ticketNotesRemoveNoteBtn').should('exist');
|
|
||||||
cy.dataCy('ticketNotesRemoveNoteBtn').click();
|
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
|
||||||
cy.checkNotification('Data saved');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,22 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('TicketRequest', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/ticket/31/request');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Creates a new request', () => {
|
|
||||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
|
||||||
const data = {
|
|
||||||
Description: { val: 'Purchase description' },
|
|
||||||
Atender: { val: 'buyerNick', type: 'select' },
|
|
||||||
Quantity: { val: 2 },
|
|
||||||
Price: { val: 123 },
|
|
||||||
};
|
|
||||||
cy.fillInForm(data);
|
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
||||||
cy.checkNotification('Data created');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,131 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
|
|
||||||
const c = require('croppie');
|
|
||||||
|
|
||||||
describe('TicketSale', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/ticket/31/sale');
|
|
||||||
});
|
|
||||||
|
|
||||||
const firstRow = 'tbody > :nth-child(1)';
|
|
||||||
|
|
||||||
const selectFirstRow = () => {
|
|
||||||
cy.waitForElement(firstRow);
|
|
||||||
cy.get(firstRow).find('.q-checkbox__inner').click();
|
|
||||||
};
|
|
||||||
|
|
||||||
it('it should add item to basket', () => {
|
|
||||||
cy.window().then((win) => {
|
|
||||||
cy.stub(win, 'open').as('windowOpen');
|
|
||||||
});
|
|
||||||
cy.dataCy('ticketSaleAddToBasketBtn').should('exist');
|
|
||||||
cy.dataCy('ticketSaleAddToBasketBtn').click();
|
|
||||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/order\/\d+\/catalog/);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should send SMS', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.waitForElement('[data-cy="sendShortageSMSItem"]');
|
|
||||||
cy.dataCy('sendShortageSMSItem').should('exist');
|
|
||||||
cy.dataCy('sendShortageSMSItem').click();
|
|
||||||
cy.dataCy('vnSmsDialog').should('exist');
|
|
||||||
cy.dataCy('sendSmsBtn').click();
|
|
||||||
cy.checkNotification('SMS sent');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should recalculate price when "Recalculate price" is clicked', () => {
|
|
||||||
cy.intercept('POST', '**/recalculatePrice').as('recalculatePrice');
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.waitForElement('[data-cy="recalculatePriceItem"]');
|
|
||||||
cy.dataCy('recalculatePriceItem').should('exist');
|
|
||||||
cy.dataCy('recalculatePriceItem').click();
|
|
||||||
cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200);
|
|
||||||
cy.checkNotification('Data saved');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should update discount when "Update discount" is clicked', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.waitForElement('[data-cy="updateDiscountItem"]');
|
|
||||||
cy.dataCy('updateDiscountItem').should('exist');
|
|
||||||
cy.dataCy('updateDiscountItem').click();
|
|
||||||
cy.waitForElement('[data-cy="ticketSaleDiscountInput"]');
|
|
||||||
cy.dataCy('ticketSaleDiscountInput').find('input').focus();
|
|
||||||
cy.dataCy('ticketSaleDiscountInput').find('input').type('10');
|
|
||||||
cy.dataCy('saveManaBtn').click();
|
|
||||||
cy.waitForElement('.q-notification__message');
|
|
||||||
cy.checkNotification('Data saved');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('adds claim', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.dataCy('createClaimItem').click();
|
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
|
||||||
cy.url().should('match', /\/claim\/\d+\/basic-data/);
|
|
||||||
// Delete created claim to avoid cluttering the database
|
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
|
||||||
cy.dataCy('deleteClaim').click();
|
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
|
||||||
cy.checkNotification('Data deleted');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('marks row as reserved', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.waitForElement('[data-cy="markAsReservedItem"]');
|
|
||||||
cy.dataCy('markAsReservedItem').click();
|
|
||||||
cy.dataCy('ticketSaleReservedIcon').should('exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('unmarks row as reserved', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.waitForElement('[data-cy="unmarkAsReservedItem"]');
|
|
||||||
cy.dataCy('unmarkAsReservedItem').click();
|
|
||||||
cy.dataCy('ticketSaleReservedIcon').should('not.exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('refunds row with warehouse', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.dataCy('ticketSaleRefundItem').click();
|
|
||||||
cy.dataCy('ticketSaleRefundWithWarehouse').click();
|
|
||||||
cy.checkNotification('The following refund ticket have been created');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('refunds row without warehouse', () => {
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleMoreActionsDropdown').click();
|
|
||||||
cy.dataCy('ticketSaleRefundItem').click();
|
|
||||||
cy.dataCy('ticketSaleRefundWithoutWarehouse').click();
|
|
||||||
cy.checkNotification('The following refund ticket have been created');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('transfers ticket', () => {
|
|
||||||
cy.visit('/#/ticket/32/sale');
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleTransferBtn').click();
|
|
||||||
cy.dataCy('ticketTransferPopup').should('exist');
|
|
||||||
cy.dataCy('ticketTransferNewTicketBtn').click();
|
|
||||||
// existen 3 elementos "tbody" necesito checkear que el segundo elemento tbody tenga una row sola
|
|
||||||
cy.get('tbody').eq(1).find('tr').should('have.length', 1);
|
|
||||||
selectFirstRow();
|
|
||||||
cy.dataCy('ticketSaleTransferBtn').click();
|
|
||||||
cy.dataCy('ticketTransferPopup').should('exist');
|
|
||||||
cy.dataCy('ticketTransferDestinationTicketInput').find('input').focus();
|
|
||||||
cy.dataCy('ticketTransferDestinationTicketInput').find('input').type('32');
|
|
||||||
cy.dataCy('ticketTransferTransferBtn').click();
|
|
||||||
// checkear que la url contenga /ticket/1000002/sale
|
|
||||||
cy.url().should('match', /\/ticket\/32\/sale/);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should redirect to ticket logs', () => {
|
|
||||||
cy.get(firstRow).find('.q-btn:last').click();
|
|
||||||
cy.url().should('match', /\/ticket\/31\/log/);
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,39 +0,0 @@
|
||||||
describe('VnInput Component', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/supplier/1/fiscal-data');
|
|
||||||
cy.domContentLoad();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
|
||||||
// Simula escribir en el input
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('4100000001');
|
|
||||||
// Coloca el cursor en la posición 0
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
|
|
||||||
// Escribe un número y verifica que se reemplace correctamente
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('999');
|
|
||||||
cy.dataCy('supplierFiscalDataAccount')
|
|
||||||
.should('have.value', '9990000001');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
|
||||||
// Simula escribir en el input
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('4100000001');
|
|
||||||
// Coloca el cursor en la posición 0
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
|
|
||||||
// Escribe un número y verifica que se reemplace correctamente en la posicion incial
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('999');
|
|
||||||
cy.dataCy('supplierFiscalDataAccount')
|
|
||||||
.should('have.value', '9990000001');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should respect maxlength prop', () => {
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').clear();
|
|
||||||
cy.dataCy('supplierFiscalDataAccount').type('123456789012345');
|
|
||||||
cy.dataCy('supplierFiscalDataAccount')
|
|
||||||
.should('have.value', '1234567890'); // asumiendo que maxlength es 10
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,5 +1,3 @@
|
||||||
const { randomNumber, randomString } = require('../../support');
|
|
||||||
|
|
||||||
describe('VnLocation', () => {
|
describe('VnLocation', () => {
|
||||||
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
|
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
|
||||||
const dialogInputs = '.q-dialog label input';
|
const dialogInputs = '.q-dialog label input';
|
||||||
|
@ -101,26 +99,25 @@ describe('VnLocation', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Create postCode', () => {
|
it('Create postCode', () => {
|
||||||
const postCode = Math.floor(100000 + Math.random() * 900000);
|
const postCode = '1234475';
|
||||||
const province = 'Valencia';
|
const province = 'Valencia';
|
||||||
cy.get(createLocationButton).click();
|
cy.get(createLocationButton).click();
|
||||||
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||||||
|
cy.get(dialogInputs).eq(0).clear();
|
||||||
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
cy.selectOption(
|
cy.selectOption(
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||||
province
|
province
|
||||||
);
|
);
|
||||||
cy.get(dialogInputs).eq(0).clear();
|
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get(`${createForm.prefix}`).should('not.exist');
|
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
|
|
||||||
checkVnLocation(postCode, province);
|
checkVnLocation(postCode, province);
|
||||||
});
|
});
|
||||||
|
it('Create city', () => {
|
||||||
it('Create city without country', () => {
|
const postCode = '9011';
|
||||||
const postCode = randomNumber();
|
const province = 'Saskatchew';
|
||||||
const province = randomString({ length: 4 });
|
|
||||||
cy.get(createLocationButton).click();
|
cy.get(createLocationButton).click();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
cy.get(
|
cy.get(
|
||||||
|
@ -134,58 +131,6 @@ describe('VnLocation', () => {
|
||||||
checkVnLocation(postCode, province);
|
checkVnLocation(postCode, province);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Create province without country', () => {
|
|
||||||
const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
|
|
||||||
cy.get(createLocationButton).click();
|
|
||||||
cy.get(
|
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
|
||||||
)
|
|
||||||
.eq(0)
|
|
||||||
.click();
|
|
||||||
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
|
|
||||||
cy.countSelectOptions('#q-portal--dialog--3 .q-select', 4);
|
|
||||||
cy.get('#q-portal--dialog--3 .q-input').type(provinceName);
|
|
||||||
|
|
||||||
cy.get('#q-portal--dialog--3 .q-btn--standard').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Create city with country', () => {
|
|
||||||
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
|
|
||||||
cy.get(createLocationButton).click();
|
|
||||||
cy.selectOption(
|
|
||||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
|
||||||
'Italia'
|
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
|
|
||||||
).click();
|
|
||||||
cy.selectOption('#q-portal--dialog--4 .q-select', 'Province four');
|
|
||||||
cy.countSelectOptions('#q-portal--dialog--4 .q-select', 1);
|
|
||||||
|
|
||||||
cy.get('#q-portal--dialog--4 .q-input').type(cityName);
|
|
||||||
cy.get('#q-portal--dialog--4 .q-btn--standard').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Create province with country', () => {
|
|
||||||
const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
|
|
||||||
cy.get(createLocationButton).click();
|
|
||||||
cy.selectOption(
|
|
||||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
|
||||||
'España'
|
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
|
||||||
)
|
|
||||||
.eq(0)
|
|
||||||
.click();
|
|
||||||
|
|
||||||
cy.selectOption('#q-portal--dialog--4 .q-select', 'one');
|
|
||||||
cy.countSelectOptions('#q-portal--dialog--4 .q-select', 2);
|
|
||||||
|
|
||||||
cy.get('#q-portal--dialog--4 .q-input').type(provinceName);
|
|
||||||
cy.get('#q-portal--dialog--4 .q-btn--standard').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
function checkVnLocation(postCode, province) {
|
function checkVnLocation(postCode, province) {
|
||||||
cy.get(`${createForm.prefix}`).should('not.exist');
|
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||||
cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
|
cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue