7729-devToTest_2430 #554

Merged
alexm merged 401 commits from 7729-devToTest_2430 into test 2024-07-16 07:17:04 +00:00
5 changed files with 45 additions and 25 deletions
Showing only changes of commit 44edccb905 - Show all commits

View File

@ -85,7 +85,9 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
} }
Object.assign(filter, store.userFilter, exprFilter); Object.assign(filter, store.userFilter, exprFilter);
const where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {}); let where;
if (filter?.where || store.filter?.where)
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
Object.assign(filter, store.filter); Object.assign(filter, store.filter);
filter.where = where; filter.where = where;
const params = { filter }; const params = { filter };

View File

@ -1,4 +1,5 @@
<script setup> <script setup>
import axios from 'axios';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters'; import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
@ -14,6 +15,7 @@ const { viewSummary } = useSummaryDialog();
const tableRef = ref(); const tableRef = ref();
const clientList = ref([]); const clientList = ref([]);
const agencyList = ref([]); const agencyList = ref([]);
const selectedAddress = ref();
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -31,7 +33,6 @@ const columns = computed(() => [
label: t('module.customer'), label: t('module.customer'),
isTitle: true, isTitle: true,
cardVisible: true, cardVisible: true,
create: true,
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Clients', url: 'Clients',
@ -123,6 +124,13 @@ const columns = computed(() => [
], ],
}, },
]); ]);
async function fetchClientAddress(id, data) {
console.log('data: ', data);
const clientData = await axios.get(`Clients/${id}`);
selectedAddress.value = clientData.data.defaultAddressFk;
data.addressId = selectedAddress.value;
}
</script> </script>
<template> <template>
<VnSearchbar <VnSearchbar
@ -142,6 +150,7 @@ const columns = computed(() => [
}, },
formInitialData: { formInitialData: {
active: true, active: true,
addressId: null,
}, },
}" }"
:columns="columns" :columns="columns"
@ -152,9 +161,18 @@ const columns = computed(() => [
<template #more-create-dialog="{ data }"> <template #more-create-dialog="{ data }">
<VnSelect <VnSelect
url="Clients" url="Clients"
v-model="data.addressId" v-model="data.id"
:label="t('module.address')" :label="t('module.customer')"
:options="clientList" :options="clientList"
option-value="id"
option-label="name"
@update:model-value="(id) => fetchClientAddress(id, data)"
/>
<VnSelect
url="Clients"
v-model="selectedAddress"
:label="t('module.address')"
:options="selectedAddress"
option-value="defaultAddressFk" option-value="defaultAddressFk"
option-label="street" option-label="street"
/> />

View File

@ -1,4 +1,4 @@
describe('WagonTypeCreate', () => { describe('EntryDms', () => {
const entryId = 1; const entryId = 1;
beforeEach(() => { beforeEach(() => {

View File

@ -1,20 +1,20 @@
describe('WagonTypeCreate', () => { // describe('WagonTypeCreate', () => {
beforeEach(() => { // beforeEach(() => {
cy.viewport(1920, 1080); // cy.viewport(1920, 1080);
cy.login('customer'); // cy.login('customer');
cy.visit(`/#/entry/my`, { // cy.visit(`/#/entry/my`, {
onBeforeLoad(win) { // onBeforeLoad(win) {
cy.stub(win, 'open'); // cy.stub(win, 'open');
}, // },
}); // });
cy.waitForElement('.q-page', 6000); // cy.waitForElement('.q-page', 6000);
}); // });
it('should create edit and remove new dms', () => { // it('should create edit and remove new dms', () => {
cy.get( // cy.get(
'[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' // '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
).click(); // ).click();
cy.get('.q-card__actions > .q-btn').click(); // cy.get('.q-card__actions > .q-btn').click();
cy.window().its('open').should('be.called'); // cy.window().its('open').should('be.called');
}); // });
}); // });

View File

@ -239,5 +239,5 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
}); });
Cypress.Commands.add('openActionsDescriptor', () => { Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.descriptor > .header > .q-btn').click(); cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
}); });