#6321 - Negative ticket #158
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
import { computed, onMounted, onUnmounted, ref, toRefs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { QBtn, QCheckbox } from 'quasar';
|
import { QBtn, QCheckbox } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -30,6 +30,13 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
filter: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: () => {
|
||||||
|
true;
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
onMounted(() => (stateStore.rightDrawer = false));
|
onMounted(() => (stateStore.rightDrawer = false));
|
||||||
onUnmounted(() => (stateStore.rightDrawer = true));
|
onUnmounted(() => (stateStore.rightDrawer = true));
|
||||||
|
@ -208,7 +215,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
||||||
|
const { filter } = toRefs($props);
|
||||||
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']);
|
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']);
|
||||||
function rowsHasSelected(selection) {
|
function rowsHasSelected(selection) {
|
||||||
emit(
|
emit(
|
||||||
|
@ -259,6 +266,10 @@ function freeFirst({ alertLevel: a }, { alertLevel: b }) {
|
||||||
// En cualquier otro caso, no se cambia el orden
|
// En cualquier otro caso, no se cambia el orden
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
const handleRows = (rows) => {
|
||||||
|
if (filter.value.showFree) return rows.filter(({ alertLevel }) => alertLevel === 0);
|
||||||
|
return rows.sort(freeFirst);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -282,7 +293,7 @@ function freeFirst({ alertLevel: a }, { alertLevel: b }) {
|
||||||
<QTable
|
<QTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows.sort(freeFirst)"
|
:rows="handleRows(rows)"
|
||||||
row-key="ticketFk"
|
row-key="ticketFk"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
|
|
|
@ -11,7 +11,6 @@ import NegativeOriginDialog from 'pages/Ticket/Negative/NegativeOriginDialog.vue
|
||||||
import TotalNegativeOriginDialog from 'pages/Ticket/Negative/TotalNegativeOriginDialog.vue';
|
import TotalNegativeOriginDialog from 'pages/Ticket/Negative/TotalNegativeOriginDialog.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.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 { useDialogPluginComponent } from 'quasar';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -19,8 +18,8 @@ const selectedRows = ref([]);
|
||||||
const showNegativeOriginDialog = ref(false);
|
const showNegativeOriginDialog = ref(false);
|
||||||
const showTotalNegativeOriginDialog = ref(false);
|
const showTotalNegativeOriginDialog = ref(false);
|
||||||
const showProposalDialog = ref(false);
|
const showProposalDialog = ref(false);
|
||||||
|
const showFree = ref(true);
|
||||||
jgallego marked this conversation as resolved
Outdated
|
|||||||
const currentRow = ref(null);
|
const currentRow = ref(null);
|
||||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
|
||||||
|
|
||||||
const viewSummary = (row) => {
|
const viewSummary = (row) => {
|
||||||
jgallego
commented
anota esto para cambiarlo en la proxima verison anota esto para cambiarlo en la proxima verison
jsegarra
commented
Lo mas simple para todos es que lo pongamos sin valor/ a 0 y que se lo pongan al gusto en marcadores, como hemos explicados a otros comerciales. que te parece? Y sino, las userConfigs Lo mas simple para todos es que lo pongamos sin valor/ a 0 y que se lo pongan al gusto en marcadores, como hemos explicados a otros comerciales. que te parece?
Y sino, las userConfigs
|
|||||||
currentRow.value = row;
|
currentRow.value = row;
|
||||||
|
@ -153,6 +152,7 @@ const columns = computed(() => [
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn></QBtnGroup
|
</QBtn></QBtnGroup
|
||||||
>
|
>
|
||||||
|
<QCheckbox v-model="showFree" :label="t('negative.detail.showFree')" />
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<div v-show="!currentRow" class="list">
|
<div v-show="!currentRow" class="list">
|
||||||
|
@ -230,7 +230,10 @@ const columns = computed(() => [
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="currentRow" class="list">
|
<div v-if="currentRow" class="list">
|
||||||
<TicketLackDetail :id="currentRow?.itemFk"></TicketLackDetail>
|
<TicketLackDetail
|
||||||
|
:id="currentRow?.itemFk"
|
||||||
|
:filter="{ showFree }"
|
||||||
|
></TicketLackDetail>
|
||||||
</div>
|
</div>
|
||||||
<ItemProposal
|
<ItemProposal
|
||||||
ref="proposalDialogRef"
|
ref="proposalDialogRef"
|
||||||
|
|
|
@ -41,3 +41,4 @@ negative:
|
||||||
peticionCompra: 'Petición compra'
|
peticionCompra: 'Petición compra'
|
||||||
isRookie: 'Cliente nuevo'
|
isRookie: 'Cliente nuevo'
|
||||||
turno: 'Linea turno'
|
turno: 'Linea turno'
|
||||||
|
showFree: Mostrar las lineas Free
|
||||||
|
|
Loading…
Reference in New Issue
estos numeros habria que replantearlo o simplificarlo a uno
Ok, en la version ^1.1