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);
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);
filter.where = where;
const params = { filter };

View File

@ -1,4 +1,5 @@
<script setup>
import axios from 'axios';
import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
@ -14,6 +15,7 @@ const { viewSummary } = useSummaryDialog();
const tableRef = ref();
const clientList = ref([]);
const agencyList = ref([]);
const selectedAddress = ref();
const columns = computed(() => [
{
@ -31,7 +33,6 @@ const columns = computed(() => [
label: t('module.customer'),
isTitle: true,
cardVisible: true,
create: true,
component: 'select',
attrs: {
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>
<template>
<VnSearchbar
@ -142,6 +150,7 @@ const columns = computed(() => [
},
formInitialData: {
active: true,
addressId: null,
},
}"
:columns="columns"
@ -152,9 +161,18 @@ const columns = computed(() => [
<template #more-create-dialog="{ data }">
<VnSelect
url="Clients"
v-model="data.addressId"
:label="t('module.address')"
v-model="data.id"
:label="t('module.customer')"
: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-label="street"
/>

View File

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

View File

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

View File

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