refs #6697 fix changes
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
jcasado 2024-04-24 12:01:55 +02:00
parent 5103b5b365
commit c9ab98471e
1 changed files with 129 additions and 156 deletions

View File

@ -20,6 +20,7 @@ const { t } = useI18n();
const stateStore = useStateStore(); const stateStore = useStateStore();
const arrayData = useArrayData('ClaimLines'); const arrayData = useArrayData('ClaimLines');
const store = arrayData.store; const store = arrayData.store;
const claimFilter = { const claimFilter = {
fields: ['ticketFk'], fields: ['ticketFk'],
}; };
@ -179,163 +180,135 @@ function saveWhenHasChanges() {
@on-fetch="onFetchClaim" @on-fetch="onFetchClaim"
auto-load auto-load
/> />
<div class="column items-center"> <div class="q-pa-md">
<div class="list"> <CrudModel
<CrudModel data-key="ClaimLines"
data-key="ClaimLines" ref="claimLinesForm"
ref="claimLinesForm" :url="`Claims/${route.params.id}/lines`"
:url="`Claims/${route.params.id}/lines`" save-url="ClaimBeginnings/crud"
save-url="ClaimBeginnings/crud" :filter="linesFilter"
:filter="linesFilter" @on-fetch="onFetch"
@on-fetch="onFetch" @save-changes="onFetch"
@save-changes="onFetch" v-model:selected="selected"
v-model:selected="selected" :default-save="false"
:default-save="false" :default-reset="false"
:default-reset="false" auto-load
auto-load :limit="0"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QTable <QTable
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:dense="$q.screen.lt.md" :dense="$q.screen.lt.md"
:pagination="{ rowsPerPage: 0 }" row-key="id"
row-key="id" selection="multiple"
selection="multiple" v-model:selected="selected"
v-model:selected="selected" :grid="$q.screen.lt.md"
hide-pagination >
:grid="$q.screen.lt.md" <template #body-cell-claimed="{ row }">
> <QTd auto-width align="right" class="text-primary">
<template #body-cell-claimed="{ row, value }"> <QInput
<QTd auto-width align="right" class="text-primary"> v-model="row.quantity"
<span>{{ value }}</span> type="number"
dense
<QPopupEdit @keyup.enter="saveWhenHasChanges()"
v-model="row.quantity" @blur="saveWhenHasChanges()"
v-slot="scope" />
:title="t('Claimed quantity')" </QTd>
@update:model-value="updateQuantity(row)" </template>
buttons <template #body-cell-description="{ row, value }">
> <QTd auto-width align="right" class="text-primary">
<QInput {{ value }}
v-model="scope.value" <ItemDescriptorProxy
type="number" :id="row.sale.itemFk"
dense ></ItemDescriptorProxy>
autofocus </QTd>
@keyup.enter="scope.set" </template>
@focus="($event) => $event.target.select()" <template #body-cell-discount="{ row, value, rowIndex }">
/> <QTd auto-width align="right" class="text-primary">
</QPopupEdit> {{ value }}
</QTd> <VnDiscount
</template> :quantity="row.quantity"
<template #body-cell-description="{ row, value }"> :price="row.sale.price"
<QTd auto-width align="right" class="text-primary"> :discount="row.sale.discount"
{{ value }} :mana="mana"
<ItemDescriptorProxy :promise="updateDiscount"
:id="row.sale.itemFk" :data="{ saleFk: row.sale.id, rowIndex: rowIndex }"
></ItemDescriptorProxy> @on-update="onUpdateDiscount"
</QTd> />
</template> </QTd>
<template #body-cell-discount="{ row, value, rowIndex }"> </template>
<QTd auto-width align="right" class="text-primary"> <!-- View for grid mode -->
{{ value }} <template #item="props">
<VnDiscount <div
:quantity="row.quantity" class="q-mb-md col-12 grid-style-transition"
:price="row.sale.price" :style="props.selected ? 'transform: scale(0.95);' : ''"
:discount="row.sale.discount" >
:mana="mana" <QCard>
:promise="updateDiscount" <QCardSection>
:data="{ saleFk: row.sale.id, rowIndex: rowIndex }" <QCheckbox v-model="props.selected" />
@on-update="onUpdateDiscount" </QCardSection>
/> <QSeparator inset />
</QTd> <QList dense>
</template> <QItem
<!-- View for grid mode --> v-for="column of props.cols"
<template #item="props"> :key="column.name"
<div >
class="q-mb-md col-12 grid-style-transition" <QItemSection>
:style="props.selected ? 'transform: scale(0.95);' : ''" <QItemLabel caption>
> {{ column.label }}
<QCard> </QItemLabel>
<QCardSection> </QItemSection>
<QCheckbox v-model="props.selected" /> <QItemSection side>
</QCardSection> <template v-if="column.name === 'claimed'">
<QSeparator inset /> <QItemLabel class="text-primary">
<QList dense> <QInput
<QItem v-model="props.row.quantity"
v-for="column of props.cols" type="number"
:key="column.name" dense
> autofocus
<QItemSection> @keyup.enter="
<QItemLabel caption> saveWhenHasChanges()
{{ column.label }} "
@blur="saveWhenHasChanges()"
/>
</QItemLabel> </QItemLabel>
</QItemSection> </template>
<QItemSection side> <template
<template v-else-if="column.name === 'discount'"
v-if="column.name === 'claimed'" >
> <QItemLabel class="text-primary">
<QItemLabel class="text-primary"> {{ column.value }}
{{ column.value }} <VnDiscount
<QPopupEdit :quantity="props.row.quantity"
v-model="props.row.quantity" :price="props.row.sale.price"
v-slot="scope" :discount="
:title="t('Claimed quantity')" props.row.sale.discount
@update:model-value=" "
updateQuantity(props.row) :mana="mana"
" :promise="updateDiscount"
buttons :data="{
> saleFk: props.row.sale.id,
<QInput rowIndex: props.rowIndex,
v-model="scope.value" }"
type="number" @on-update="onUpdateDiscount"
dense />
autofocus </QItemLabel>
@keyup.enter="scope.set" </template>
@focus=" <template v-else>
($event) => <QItemLabel>
$event.target.select() {{ column.value }}
" </QItemLabel>
/> </template>
</QPopupEdit> </QItemSection>
</QItemLabel> </QItem>
</template> </QList>
<template </QCard>
v-else-if="column.name === 'discount'" </div>
> </template>
<QItemLabel class="text-primary"> </QTable>
{{ column.value }} </template>
<VnDiscount </CrudModel>
:quantity="props.row.quantity"
:price="props.row.sale.price"
:discount="
props.row.sale.discount
"
:mana="mana"
:promise="updateDiscount"
:data="{
saleFk: props.row.sale.id,
rowIndex: props.rowIndex,
}"
@on-update="onUpdateDiscount"
/>
</QItemLabel>
</template>
<template v-else>
<QItemLabel>
{{ column.value }}
</QItemLabel>
</template>
</QItemSection>
</QItem>
</QList>
</QCard>
</div>
</template>
</QTable>
</template>
</CrudModel>
</div>
</div> </div>
<QPageSticky position="bottom-right" :offset="[25, 25]"> <QPageSticky position="bottom-right" :offset="[25, 25]">