#6321 - Negative ticket #158
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { computed, onMounted, onUnmounted, ref, toRefs } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { QBtn, QCheckbox } from 'quasar';
|
||||
import axios from 'axios';
|
||||
|
@ -30,6 +30,13 @@ const $props = defineProps({
|
|||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
filter: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
true;
|
||||
},
|
||||
},
|
||||
});
|
||||
onMounted(() => (stateStore.rightDrawer = false));
|
||||
onUnmounted(() => (stateStore.rightDrawer = true));
|
||||
|
@ -208,7 +215,7 @@ const columns = computed(() => [
|
|||
},
|
||||
]);
|
||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
||||
|
||||
const { filter } = toRefs($props);
|
||||
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']);
|
||||
function rowsHasSelected(selection) {
|
||||
emit(
|
||||
|
@ -259,6 +266,10 @@ function freeFirst({ alertLevel: a }, { alertLevel: b }) {
|
|||
// En cualquier otro caso, no se cambia el orden
|
||||
return 0;
|
||||
}
|
||||
const handleRows = (rows) => {
|
||||
if (filter.value.showFree) return rows.filter(({ alertLevel }) => alertLevel === 0);
|
||||
return rows.sort(freeFirst);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -282,7 +293,7 @@ function freeFirst({ alertLevel: a }, { alertLevel: b }) {
|
|||
<QTable
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:rows="rows.sort(freeFirst)"
|
||||
:rows="handleRows(rows)"
|
||||
row-key="ticketFk"
|
||||
selection="multiple"
|
||||
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 ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
|
@ -19,8 +18,8 @@ const selectedRows = ref([]);
|
|||
const showNegativeOriginDialog = ref(false);
|
||||
const showTotalNegativeOriginDialog = ref(false);
|
||||
const showProposalDialog = ref(false);
|
||||
const showFree = ref(true);
|
||||
jgallego marked this conversation as resolved
Outdated
|
||||
const currentRow = ref(null);
|
||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
||||
|
||||
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;
|
||||
|
@ -153,6 +152,7 @@ const columns = computed(() => [
|
|||
</QTooltip>
|
||||
</QBtn></QBtnGroup
|
||||
>
|
||||
<QCheckbox v-model="showFree" :label="t('negative.detail.showFree')" />
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<div v-show="!currentRow" class="list">
|
||||
|
@ -230,7 +230,10 @@ const columns = computed(() => [
|
|||
</VnPaginate>
|
||||
</div>
|
||||
<div v-if="currentRow" class="list">
|
||||
<TicketLackDetail :id="currentRow?.itemFk"></TicketLackDetail>
|
||||
<TicketLackDetail
|
||||
:id="currentRow?.itemFk"
|
||||
:filter="{ showFree }"
|
||||
></TicketLackDetail>
|
||||
</div>
|
||||
<ItemProposal
|
||||
ref="proposalDialogRef"
|
||||
|
|
|
@ -41,3 +41,4 @@ negative:
|
|||
peticionCompra: 'Petición compra'
|
||||
isRookie: 'Cliente nuevo'
|
||||
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