0
0
Fork 0

refs #6157 test ui

This commit is contained in:
Carlos Satorres 2023-11-07 12:42:39 +01:00
parent 08060d276a
commit 6db52e00ea
4 changed files with 235 additions and 249 deletions

View File

@ -268,7 +268,7 @@ watch(formUrl, async () => {
</VnPaginate> </VnPaginate>
<SkeletonTable v-if="!formData" /> <SkeletonTable v-if="!formData" />
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()"> <Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()">
<QBtnGroup push class="q-gutter-x-sm"> <QBtnGroup push style="column-gap: 10px">
<slot name="moreBeforeActions" /> <slot name="moreBeforeActions" />
<QBtn <QBtn
:label="tMobile('globals.remove')" :label="tMobile('globals.remove')"

View File

@ -33,7 +33,7 @@ const dialogGreuge = ref(false);
const columns = computed(() => [ const columns = computed(() => [
{ {
name: 'Id', name: 'Id',
label: t('Id'), label: t('Id item'),
field: (row) => row.itemFk, field: (row) => row.itemFk,
}, },
{ {
@ -119,6 +119,7 @@ async function updateDestinations(claimDestinationFk) {
} }
async function updateDestination(claimDestinationFk, row) { async function updateDestination(claimDestinationFk, row) {
console.log(claimDestinationFk, row);
if (claimDestinationFk) { if (claimDestinationFk) {
await axios.post('Claims/updateClaimDestination', { await axios.post('Claims/updateClaimDestination', {
claimDestinationFk, claimDestinationFk,
@ -238,7 +239,6 @@ async function importToNewRefundTicket() {
show-if-above show-if-above
v-if="claim" v-if="claim"
> >
<QScrollArea class="fit text-grey-8 q-mt-lg">
<div class="totalClaim q-mb-md"> <div class="totalClaim q-mb-md">
{{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }} {{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }}
</div> </div>
@ -252,9 +252,7 @@ async function importToNewRefundTicket() {
class="responsibility { 'background-color:primary': quasar.platform.is.mobile }" class="responsibility { 'background-color:primary': quasar.platform.is.mobile }"
v-model="claim.responsibility" v-model="claim.responsibility"
:label-value="t('claim.summary.responsibility')" :label-value="t('claim.summary.responsibility')"
@update:model-value=" @update:model-value="(value) => save({ responsibility: value })"
(value) => save({ responsibility: value })
"
label-always label-always
color="primary" color="primary"
markers markers
@ -275,10 +273,8 @@ async function importToNewRefundTicket() {
/> />
<span>{{ t('mana') }}</span> <span>{{ t('mana') }}</span>
</QItemLabel> </QItemLabel>
</QScrollArea>
</QDrawer> </QDrawer>
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport> <Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport>
<div class="claim-action">
<CrudModel <CrudModel
v-if="claim" v-if="claim"
data-key="ClaimEnds" data-key="ClaimEnds"
@ -313,16 +309,18 @@ async function importToNewRefundTicket() {
</span> </span>
</QTd> </QTd>
</template> </template>
<template #body-cell-destination="{ rowIndex }"> <template #body-cell-destination="{ row }">
<QTd> <QTd>
<VnSelectFilter <VnSelectFilter
v-model="destinations[rowIndex]" v-model="row.claimDestinationFk"
:options="destinationTypes" :options="destinationTypes"
option-value="id"
option-label="description" option-label="description"
@update:model-value=" option-value="id"
(value) => updateDestination(value, rows[rowIndex]) :autofocus="true"
" dense
input-debounce="0"
hide-selected
@update:model-value="(value) => updateDestination(value, row)"
/> />
</QTd> </QTd>
</template> </template>
@ -336,22 +334,6 @@ async function importToNewRefundTicket() {
{{ toCurrency(value) }} {{ toCurrency(value) }}
</QTd> </QTd>
</template> </template>
<template #body-cell-delete="{ rowIndex }">
<QTd>
<QBtn
icon="delete"
color="primary"
padding="xs"
round
flat
@click="deleteSale(rows[rowIndex])"
>
<QTooltip>
{{ t('Remove line') }}
</QTooltip>
</QBtn>
</QTd>
</template>
<!-- View for grid mode --> <!-- View for grid mode -->
<template #item="props"> <template #item="props">
<div class="q-mb-md col-12 grid-style-transition"> <div class="q-mb-md col-12 grid-style-transition">
@ -363,19 +345,14 @@ async function importToNewRefundTicket() {
<QSeparator inset /> <QSeparator inset />
<QList dense> <QList dense>
<QItem <QItem v-for="column of props.cols" :key="column.name">
v-for="column of props.cols"
:key="column.name"
>
<QItemSection> <QItemSection>
<QItemLabel caption> <QItemLabel caption>
{{ column.label }} {{ column.label }}
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>
<QItemSection side> <QItemSection side>
<QItemLabel <QItemLabel v-if="column.name === 'destination'">
v-if="column.name === 'destination'"
>
{{ column.value.description }} {{ column.value.description }}
</QItemLabel> </QItemLabel>
<QItemLabel v-else> <QItemLabel v-else>
@ -433,21 +410,20 @@ async function importToNewRefundTicket() {
<QBtn icon="close" flat round dense v-close-popup /> <QBtn icon="close" flat round dense v-close-popup />
</QItem> </QItem>
</QCardSection> </QCardSection>
<QCardSection> <QItemSection>
<VnSelectFilter <VnSelectFilter
v-model="claimDestinationFk" v-model="claimDestinationFk"
:options="destinationTypes" :options="destinationTypes"
option-label="description" option-label="description"
option-value="id" option-value="id"
:autofocus="true"
dense
input-debounce="0"
hide-selected
/> />
</QCardSection> </QItemSection>
<QCardActions class="justify-end q-mr-sm"> <QCardActions class="justify-end q-mr-sm">
<QBtn <QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
flat
:label="t('globals.close')"
color="primary"
v-close-popup
/>
<QBtn <QBtn
:disable="!claimDestinationFk" :disable="!claimDestinationFk"
:label="t('globals.save')" :label="t('globals.save')"
@ -467,12 +443,7 @@ async function importToNewRefundTicket() {
<QBtn icon="close" flat round dense v-close-popup /> <QBtn icon="close" flat round dense v-close-popup />
</QItem> </QItem>
<QCardActions class="justify-end q-mr-sm"> <QCardActions class="justify-end q-mr-sm">
<QBtn <QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
flat
:label="t('globals.close')"
color="primary"
v-close-popup
/>
<QBtn <QBtn
:label="t('globals.save')" :label="t('globals.save')"
color="primary" color="primary"
@ -482,7 +453,6 @@ async function importToNewRefundTicket() {
</QCardActions> </QCardActions>
</QCardSection> </QCardSection>
</QDialog> </QDialog>
</div>
</template> </template>
<style lang="scss"> <style lang="scss">
.claim-action { .claim-action {
@ -514,10 +484,11 @@ async function importToNewRefundTicket() {
} }
} }
.totalClaim { .totalClaim {
border: 3px solid black; background-color: #313131;
color: white; color: white;
padding: 10px; padding: 10px;
margin: 5px; margin: 5px;
border-radius: 8px;
} }
.responsibility { .responsibility {
max-width: 100%; max-width: 100%;
@ -555,4 +526,5 @@ es:
Remove: Eliminar Remove: Eliminar
dialogGreuge title: Insertar greuges en la ficha del cliente dialogGreuge title: Insertar greuges en la ficha del cliente
ClaimGreugeDescription: Id reclamación ClaimGreugeDescription: Id reclamación
Id item: Id artículo
</i18n> </i18n>

View File

@ -43,17 +43,6 @@ onMounted(async () => {
<QSeparator /> <QSeparator />
<LeftMenu source="card" /> <LeftMenu source="card" />
<QSeparator /> <QSeparator />
<QList>
<QItem
active-class="text-primary"
clickable
v-ripple
:href="`${salixUrl}/action`"
>
<QItemSection avatar><QIcon name="vn:actions"></QIcon></QItemSection>
<QItemSection>{{ t('Action') }}</QItemSection>
</QItem>
</QList>
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPageContainer> <QPageContainer>

View File

@ -0,0 +1,25 @@
/// <reference types="cypress" />
describe('ClaimAction', () => {
const claimId = 2;
const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)';
const firstRow = 'tbody > :nth-child(1)';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/action`);
});
it('should import claim', () => {
cy.get('[title="Import claim"]').click();
});
it('should change destination', () => {
const rowData = [true, null, null, 'Bueno', null, null, null, null, null, null];
cy.fillRow(firstRow, rowData);
});
it('should regularize', () => {
cy.get('[title="Regularize"]').click();
});
});