0
0
Fork 0

feat: updates

This commit is contained in:
Javier Segarra 2024-09-17 11:41:29 +02:00
parent b5db786b06
commit 2c81ddb4aa
5 changed files with 54 additions and 47 deletions

View File

@ -404,9 +404,9 @@ function handleOnDataSaved(_) {
<slot name="top-left"></slot> <slot name="top-left"></slot>
</template> </template>
<template #body-selection="scope"> <template #body-selection="scope">
<pre>{{ scope }}</pre> <!-- <pre>{{ scope }}</pre> -->
<slot name="body-selection" :data="scope"></slot>
<!-- <slot name="body-selection" :data="scope"></slot> --> <!-- <QCheckbox class="q-ma-xs" v-if="scope"></QCheckbox> -->
</template> </template>
<template #top-right v-if="!$props.withoutHeader"> <template #top-right v-if="!$props.withoutHeader">
<VnVisibleColumn <VnVisibleColumn

View File

@ -94,7 +94,6 @@ const columns = computed(() => [
...defaultColumnAttrs, ...defaultColumnAttrs,
label: t('proposal.difference'), label: t('proposal.difference'),
name: 'difference', name: 'difference',
format: ({ id }) => (id % 2 === 0 ? 10 : -10),
columnFilter: { columnFilter: {
component: 'input', component: 'input',
type: 'number', type: 'number',
@ -103,7 +102,7 @@ const columns = computed(() => [
}, },
{ {
...defaultColumnAttrs, ...defaultColumnAttrs,
label: t('Compatibildiad'), label: t('proposal.compatibility'),
name: 'status', name: 'status',
field: statusConditionalValue, field: statusConditionalValue,
sortable: true, sortable: true,
@ -224,6 +223,12 @@ function onDialogClose() {
emit('dialogClosed', { data: true }); emit('dialogClosed', { data: true });
} }
onUnmounted(() => {}); onUnmounted(() => {});
function handleSelection(value, evt) {
quantity.value = value.available;
}
const isSelectionAvailable = ({ row }) => {
return $props.replaceAction && row.available >= $props.itemLack.lack * -1;
};
</script> </script>
<template> <template>
<!-- <QPopupProxy ref="popupProxyRef"> --> <!-- <QPopupProxy ref="popupProxyRef"> -->
@ -255,10 +260,11 @@ onUnmounted(() => {});
:disable-option="{ card: true, table: true }" :disable-option="{ card: true, table: true }"
:table="{ :table="{
'row-key': 'id', 'row-key': 'id',
selection: 'multiple', selection: 'single',
}" }"
> >
<template #top-left> <template #top-left>
{{ proposalSelected }}
<div v-if="$props.replaceAction" style="display: flex"> <div v-if="$props.replaceAction" style="display: flex">
<QBtn <QBtn
:label="t('globals.replace')" :label="t('globals.replace')"
@ -281,45 +287,26 @@ onUnmounted(() => {});
/></div /></div
></template> ></template>
<!-- <template #body="scope">{{ scope }}</template> --> <!-- <template #body="scope">{{ scope }}</template> -->
<template #body-selection> <template #body-selection="{ data }">
<QTd align="center" v-if="$props.replaceAction"> <!-- <QTd align="center"> -->
<!-- <pre> <!-- {{ data.row.available }}
{{ row.selected }} {{ $props.itemLack.lack * -1 }} -->
<!-- {{
</pre> $props.replaceAction &&
{{ itemLack }} --> data.row.available >= $props.itemLack.lack * -1
<!-- <QCheckbox }} -->
v-model="scope.selected" <QCheckbox
:disable="!(scope.row.available >= itemLack.lack * -1)" class="q-ma-xs"
> flat
<QTooltip v-if="!(scope.row.available >= itemLack.lack * -1)"> v-if="isSelectionAvailable(data)"
Nop</QTooltip v-model="data.selected"
> @update:model-value="(evt, _) => handleSelection(data.row, null)"
</QCheckbox> --> >
<!-- <div v-else class="q-ml-sm"> </QCheckbox>
<!-- <div v-else class="q-ml-sm">
<QIcon name="info" size="sm"></QIcon> <QIcon name="info" size="sm"></QIcon>
</div </div
>--></QTd >-->
>
</template>
<template #top-row>
<!-- <QTr>
<QTd />
<QTd
v-for="(col, index) in cols"
:key="index"
style="max-width: 100px"
>
<component
:is="col.columnFilter.component"
v-if="col.columnFilter"
v-model="col.columnFilter.filterValue"
v-bind="col.columnFilter.attrs"
v-on="col.columnFilter.event(col)"
dense
/>
</QTd>
</QTr> -->
</template> </template>
<template #column-longName="{ row }"> <template #column-longName="{ row }">
<!-- <QTd align="left" class="text-primary"> --> <!-- <QTd align="left" class="text-primary"> -->

View File

@ -1,5 +1,9 @@
<script setup> <script setup>
import ItemProposal from './ItemProposal.vue'; import ItemProposal from './ItemProposal.vue';
import VnImg from 'src/components/ui/VnImg.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
const $props = defineProps({ const $props = defineProps({
item: { item: {
type: Object, type: Object,
@ -25,6 +29,23 @@ const $props = defineProps({
</script> </script>
<template> <template>
<QPopupProxy> <QPopupProxy>
<ItemProposal v-bind="$props"></ItemProposal> <QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none">
<span class="text-h6 text-grey">{{ $t('Item proposal') }}</span>
<QSpace />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="row items-center">
<VnImg :id="item.id" class="rounded image-wrapper"></VnImg>
<QBtn flat class="link text-blue">
{{ item.longName }}
<ItemDescriptorProxy :id="item.id" />
</QBtn>
<FetchedTags :item="item" />
</QCardSection>
<QCardSection class="q-pt-none">
<ItemProposal v-bind="$props"></ItemProposal
></QCardSection>
</QCard>
</QPopupProxy> </QPopupProxy>
</template> </template>

View File

@ -6,12 +6,12 @@ import ChangeQuantityDialog from 'pages/Ticket/Negative/components/ChangeQuantit
import ChangeStateDialog from 'pages/Ticket/Negative/components/ChangeStateDialog.vue'; import ChangeStateDialog from 'pages/Ticket/Negative/components/ChangeStateDialog.vue';
import ItemProposal from 'pages/Item/components/ItemProposal.vue'; import ItemProposal from 'pages/Item/components/ItemProposal.vue';
import FetchedTags from 'components/ui/FetchedTags.vue'; import FetchedTags from 'components/ui/FetchedTags.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import TicketTransfer from '../Card/TicketTransfer.vue'; import TicketTransfer from '../Card/TicketTransfer.vue';
import TicketMassiveUpdate from '../Card/TicketMassiveUpdate.vue'; import TicketMassiveUpdate from '../Card/TicketMassiveUpdate.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';

View File

@ -58,11 +58,9 @@ export default {
{ {
path: 'negative', path: 'negative',
redirect: { name: 'TicketNegative' }, redirect: { name: 'TicketNegative' },
children: [ children: [
{ {
name: 'TicketNegative', name: 'TicketNegative',
path: '',
meta: { meta: {
title: 'negative', title: 'negative',
icon: 'view_list', icon: 'view_list',
@ -70,6 +68,7 @@ export default {
// redirect: { name: 'TicketNegative' }, // redirect: { name: 'TicketNegative' },
component: () => component: () =>
import('src/pages/Ticket/Negative/TicketLackList.vue'), import('src/pages/Ticket/Negative/TicketLackList.vue'),
path: '',
}, },
{ {
name: 'NegativeDetail', name: 'NegativeDetail',