Compare commits
24 Commits
933e6b88b1
...
a350de9119
Author | SHA1 | Date |
---|---|---|
Robert Ferrús | a350de9119 | |
Jon Elias | 81d0e397f0 | |
Jon Elias | e3e6c74afa | |
Jon Elias | 09ceefb7c5 | |
Jorge Penadés | a153146f82 | |
Jon Elias | f9de26933a | |
Jorge Penadés | 83bf8183f0 | |
Jorge Penadés | 6349a3e790 | |
Jon Elias | 15d4b54dda | |
Jon Elias | 65626446fd | |
Jon Elias | c217e8a1a7 | |
Jorge Penadés | 50bce40613 | |
Guillermo Bonet | be9dd8b2b7 | |
Guillermo Bonet | 4b9e69625b | |
Jorge Penadés | fdfa99c718 | |
Jon Elias | 0e064b3305 | |
Jorge Penadés | 16548dadef | |
Jorge Penadés | 8de3ea16a6 | |
Guillermo Bonet | b2ef381f1d | |
Guillermo Bonet | 1a15ccec2c | |
Guillermo Bonet | 9310d863aa | |
Guillermo Bonet | 58b9eb1c78 | |
Guillermo Bonet | 8d7670cc85 | |
Guillermo Bonet | b09ecefad4 |
|
@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (General) => Se vuelven a mostrar los parámetros en la url al aplicar un filtro
|
||||||
|
|
||||||
## [2414.01] - 2024-04-04
|
## [2414.01] - 2024-04-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -101,8 +101,7 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeRouteLeave((to, from, next) => {
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
if (!hasChanges.value) next();
|
if (hasChanges.value)
|
||||||
|
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
@ -111,6 +110,7 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
promise: () => next(),
|
promise: () => next(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
else next();
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
@ -132,12 +132,12 @@ const formUrl = computed(() => $props.url);
|
||||||
const defaultButtons = computed(() => ({
|
const defaultButtons = computed(() => ({
|
||||||
save: {
|
save: {
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
icon: 'restart_alt',
|
icon: 'save',
|
||||||
label: 'globals.save',
|
label: 'globals.save',
|
||||||
},
|
},
|
||||||
reset: {
|
reset: {
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
icon: 'save',
|
icon: 'restart_alt',
|
||||||
label: 'globals.reset',
|
label: 'globals.reset',
|
||||||
},
|
},
|
||||||
...$props.defaultButtons,
|
...$props.defaultButtons,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { useCapitalize } from 'src/composables/useCapitalize';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: { type: String, default: '' },
|
modelValue: { type: [String, Number], default: '' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ en:
|
||||||
ticketCreated: Created
|
ticketCreated: Created
|
||||||
created: Created
|
created: Created
|
||||||
isChargedToMana: Charged to mana
|
isChargedToMana: Charged to mana
|
||||||
hasToPickUp: Has to pick Up
|
pickup: Type of pickup
|
||||||
dmsFk: Document ID
|
dmsFk: Document ID
|
||||||
text: Description
|
text: Description
|
||||||
claimStateFk: Claim State
|
claimStateFk: Claim State
|
||||||
|
@ -1069,7 +1069,7 @@ es:
|
||||||
ticketCreated: Creado
|
ticketCreated: Creado
|
||||||
created: Creado
|
created: Creado
|
||||||
isChargedToMana: Cargado a maná
|
isChargedToMana: Cargado a maná
|
||||||
hasToPickUp: Se debe recoger
|
pickup: Se debe recoger
|
||||||
dmsFk: ID documento
|
dmsFk: ID documento
|
||||||
text: Descripción
|
text: Descripción
|
||||||
claimStateFk: Estado de la reclamación
|
claimStateFk: Estado de la reclamación
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { onMounted, ref, computed } from 'vue';
|
import { onMounted, ref, computed } from 'vue';
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useArrayDataStore } from 'stores/useArrayDataStore';
|
import { useArrayDataStore } from 'stores/useArrayDataStore';
|
||||||
import { buildFilter } from 'filters/filterPanel';
|
import { buildFilter } from 'filters/filterPanel';
|
||||||
|
@ -15,7 +15,6 @@ export function useArrayData(key, userOptions) {
|
||||||
|
|
||||||
const store = arrayDataStore.get(key);
|
const store = arrayDataStore.get(key);
|
||||||
const hasMoreData = ref(false);
|
const hasMoreData = ref(false);
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
let canceller = null;
|
let canceller = null;
|
||||||
|
|
||||||
|
@ -105,7 +104,7 @@ export function useArrayData(key, userOptions) {
|
||||||
for (const row of response.data) store.data.push(row);
|
for (const row of response.data) store.data.push(row);
|
||||||
} else {
|
} else {
|
||||||
store.data = response.data;
|
store.data = response.data;
|
||||||
if (!document.querySelectorAll('[role="dialog"]'))
|
if (!document.querySelectorAll('[role="dialog"]').length)
|
||||||
updateRouter && updateStateParams();
|
updateRouter && updateStateParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,11 +187,15 @@ export function useArrayData(key, userOptions) {
|
||||||
if (store.userParams && Object.keys(store.userParams).length !== 0)
|
if (store.userParams && Object.keys(store.userParams).length !== 0)
|
||||||
query.params = JSON.stringify(store.userParams);
|
query.params = JSON.stringify(store.userParams);
|
||||||
|
|
||||||
if (router)
|
const url = new URL(window.location.href);
|
||||||
router.replace({
|
const { hash: currentHash } = url;
|
||||||
path: route.path,
|
const [currentRoute] = currentHash.split('?');
|
||||||
query: query,
|
|
||||||
});
|
const params = new URLSearchParams();
|
||||||
|
for (const param in query) params.append(param, query[param]);
|
||||||
|
|
||||||
|
url.hash = currentRoute + '?' + params.toString();
|
||||||
|
window.history.pushState({}, '', url.hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
const totalRows = computed(() => (store.data && store.data.length) || 0);
|
const totalRows = computed(() => (store.data && store.data.length) || 0);
|
||||||
|
|
|
@ -544,6 +544,7 @@ export default {
|
||||||
assignedTo: 'Assigned',
|
assignedTo: 'Assigned',
|
||||||
attendedBy: 'Attended by',
|
attendedBy: 'Attended by',
|
||||||
created: 'Created',
|
created: 'Created',
|
||||||
|
pickup: 'Pickup',
|
||||||
state: 'State',
|
state: 'State',
|
||||||
details: 'Details',
|
details: 'Details',
|
||||||
item: 'Item',
|
item: 'Item',
|
||||||
|
@ -565,13 +566,19 @@ export default {
|
||||||
responsible: 'Responsible',
|
responsible: 'Responsible',
|
||||||
worker: 'Worker',
|
worker: 'Worker',
|
||||||
redelivery: 'Redelivery',
|
redelivery: 'Redelivery',
|
||||||
|
null: 'No',
|
||||||
|
agency: 'Agency',
|
||||||
|
delivery: 'Delivery',
|
||||||
},
|
},
|
||||||
basicData: {
|
basicData: {
|
||||||
customer: 'Customer',
|
customer: 'Customer',
|
||||||
assignedTo: 'Assigned',
|
assignedTo: 'Assigned',
|
||||||
created: 'Created',
|
created: 'Created',
|
||||||
state: 'State',
|
state: 'State',
|
||||||
picked: 'Picked',
|
pickup: 'Pickup',
|
||||||
|
null: 'No',
|
||||||
|
agency: 'Agency',
|
||||||
|
delivery: 'Delivery',
|
||||||
},
|
},
|
||||||
photo: {
|
photo: {
|
||||||
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',
|
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',
|
||||||
|
|
|
@ -543,6 +543,7 @@ export default {
|
||||||
assignedTo: 'Asignada a',
|
assignedTo: 'Asignada a',
|
||||||
attendedBy: 'Atendida por',
|
attendedBy: 'Atendida por',
|
||||||
created: 'Creada',
|
created: 'Creada',
|
||||||
|
pickup: 'Recogida',
|
||||||
state: 'Estado',
|
state: 'Estado',
|
||||||
details: 'Detalles',
|
details: 'Detalles',
|
||||||
item: 'Artículo',
|
item: 'Artículo',
|
||||||
|
@ -564,13 +565,19 @@ export default {
|
||||||
responsible: 'Responsable',
|
responsible: 'Responsable',
|
||||||
worker: 'Trabajador',
|
worker: 'Trabajador',
|
||||||
redelivery: 'Devolución',
|
redelivery: 'Devolución',
|
||||||
|
null: 'No',
|
||||||
|
agency: 'Agencia',
|
||||||
|
delivery: 'Reparto',
|
||||||
},
|
},
|
||||||
basicData: {
|
basicData: {
|
||||||
customer: 'Cliente',
|
customer: 'Cliente',
|
||||||
assignedTo: 'Asignada a',
|
assignedTo: 'Asignada a',
|
||||||
created: 'Creada',
|
created: 'Creada',
|
||||||
state: 'Estado',
|
state: 'Estado',
|
||||||
picked: 'Recogida',
|
pickup: 'Recogida',
|
||||||
|
null: 'No',
|
||||||
|
agency: 'Agencia',
|
||||||
|
delivery: 'Reparto',
|
||||||
},
|
},
|
||||||
photo: {
|
photo: {
|
||||||
fileDescription:
|
fileDescription:
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -24,7 +25,7 @@ const claimFilter = {
|
||||||
'workerFk',
|
'workerFk',
|
||||||
'claimStateFk',
|
'claimStateFk',
|
||||||
'packages',
|
'packages',
|
||||||
'hasToPickUp',
|
'pickup',
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
@ -50,6 +51,20 @@ function setClaimStates(data) {
|
||||||
claimStates.value = data;
|
claimStates.value = data;
|
||||||
claimStatesCopy.value = data;
|
claimStatesCopy.value = data;
|
||||||
}
|
}
|
||||||
|
let optionsList;
|
||||||
|
async function getEnumValues() {
|
||||||
|
optionsList = [{ id: null, description: t('claim.basicData.null') }];
|
||||||
|
const { data } = await axios.get(`Applications/get-enum-values`, {
|
||||||
|
params: {
|
||||||
|
schema: 'vn',
|
||||||
|
table: 'claim',
|
||||||
|
column: 'pickup',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
for (let value of data)
|
||||||
|
optionsList.push({ id: value, description: t(`claim.basicData.${value}`) });
|
||||||
|
}
|
||||||
|
getEnumValues();
|
||||||
|
|
||||||
const workerFilter = {
|
const workerFilter = {
|
||||||
options: workers,
|
options: workers,
|
||||||
|
@ -168,13 +183,19 @@ const statesFilter = {
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QCheckbox
|
<QSelect
|
||||||
v-model="data.hasToPickUp"
|
v-model="data.pickup"
|
||||||
:label="t('claim.basicData.picked')"
|
:options="optionsList"
|
||||||
/>
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
emit-value
|
||||||
|
:label="t('claim.basicData.pickup')"
|
||||||
|
map-options
|
||||||
|
use-input
|
||||||
|
:input-debounce="0"
|
||||||
|
>
|
||||||
|
</QSelect>
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -220,10 +220,9 @@ function openDialog(dmsId) {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<QCheckbox
|
<VnLv
|
||||||
:label="t('claim.basicData.picked')"
|
:label="t('claim.summary.pickup')"
|
||||||
v-model="claim.hasToPickUp"
|
:value="t(`claim.summary.${claim.pickup}`)"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-three">
|
<QCard class="vn-three">
|
||||||
|
|
|
@ -32,6 +32,13 @@ const invoiceInFormRef = ref();
|
||||||
const expensesRef = ref();
|
const expensesRef = ref();
|
||||||
const newExpenseRef = ref();
|
const newExpenseRef = ref();
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
actionIcon: {
|
||||||
|
type: String,
|
||||||
|
default: 'add',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'expense',
|
name: 'expense',
|
||||||
|
@ -207,17 +214,16 @@ async function addExpense() {
|
||||||
@click.stop="value = null"
|
@click.stop="value = null"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QIcon
|
||||||
padding="xs"
|
@click.stop.prevent="newExpenseRef.show()"
|
||||||
round
|
:name="actionIcon"
|
||||||
flat
|
size="xs"
|
||||||
icon="add_circle"
|
class="default-icon"
|
||||||
@click.stop="newExpenseRef.show()"
|
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Create expense') }}
|
{{ t('Create expense') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QIcon>
|
||||||
</template>
|
</template>
|
||||||
</VnSelectFilter>
|
</VnSelectFilter>
|
||||||
</QTd>
|
</QTd>
|
||||||
|
@ -470,6 +476,11 @@ async function addExpense() {
|
||||||
.q-item {
|
.q-item {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
.default-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 50px;
|
||||||
|
background-color: $primary;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe('VnSearchBar', () => {
|
||||||
const checkCardListAndUrl = (expectedLength) => {
|
const checkCardListAndUrl = (expectedLength) => {
|
||||||
cy.get(cardList).then(($cardList) => {
|
cy.get(cardList).then(($cardList) => {
|
||||||
expect($cardList.find('.q-card').length).to.equal(expectedLength);
|
expect($cardList.find('.q-card').length).to.equal(expectedLength);
|
||||||
cy.url().then((currentUrl) => expect(currentUrl).to.equal(url));
|
cy.url().then((currentUrl) => expect(currentUrl).to.contain(url));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -38,10 +38,10 @@ describe('VnLog', () => {
|
||||||
action: 'update',
|
action: 'update',
|
||||||
changedModel: 'Claim',
|
changedModel: 'Claim',
|
||||||
oldInstance: {
|
oldInstance: {
|
||||||
hasToPickUp: false,
|
pickup: null,
|
||||||
},
|
},
|
||||||
newInstance: {
|
newInstance: {
|
||||||
hasToPickUp: true,
|
pickup: 'agency',
|
||||||
},
|
},
|
||||||
creationDate: '2023-09-18T12:25:34.000Z',
|
creationDate: '2023-09-18T12:25:34.000Z',
|
||||||
changedModelId: '1',
|
changedModelId: '1',
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { describe, expect, it, beforeAll } from 'vitest';
|
||||||
|
import { axios } from 'app/test/vitest/helper';
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
|
||||||
|
describe('useArrayData', () => {
|
||||||
|
let arrayData;
|
||||||
|
beforeAll(() => {
|
||||||
|
axios.get.mockResolvedValue({ data: [] });
|
||||||
|
arrayData = useArrayData('InvoiceIn', { url: 'invoice-in/list' });
|
||||||
|
Object.defineProperty(window.location, 'href', {
|
||||||
|
writable: true,
|
||||||
|
value: 'localhost:9000/invoice-in/list',
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mock the window.history.pushState method within useArrayData
|
||||||
|
window.history.pushState = (data, title, url) => (window.location.href = url);
|
||||||
|
|
||||||
|
// Mock the URL constructor within useArrayData
|
||||||
|
global.URL = class URL {
|
||||||
|
constructor(url) {
|
||||||
|
this.hash = url.split('localhost:9000/')[1];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should add the params to the url', async () => {
|
||||||
|
arrayData.store.userParams = { supplierFk: 2 };
|
||||||
|
arrayData.updateStateParams();
|
||||||
|
expect(window.location.href).contain('params=%7B%22supplierFk%22%3A2%7D');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue