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>
</template>
<template #body-selection="scope">
<pre>{{ scope }}</pre>
<!-- <slot name="body-selection" :data="scope"></slot> -->
<!-- <pre>{{ scope }}</pre> -->
<slot name="body-selection" :data="scope"></slot>
<!-- <QCheckbox class="q-ma-xs" v-if="scope"></QCheckbox> -->
</template>
<template #top-right v-if="!$props.withoutHeader">
<VnVisibleColumn

View File

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

View File

@ -1,5 +1,9 @@
<script setup>
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({
item: {
type: Object,
@ -25,6 +29,23 @@ const $props = defineProps({
</script>
<template>
<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>
</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 ItemProposal from 'pages/Item/components/ItemProposal.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 TicketTransfer from '../Card/TicketTransfer.vue';
import TicketMassiveUpdate from '../Card/TicketMassiveUpdate.vue';
import VnPaginate from 'src/components/ui/VnPaginate.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 { useStateStore } from 'stores/useStateStore';
import { useRoute } from 'vue-router';

View File

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