From 0a4da26d3d1254528f8f7661060422c566848b00 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sun, 26 Jan 2025 02:35:13 +0100 Subject: [PATCH] feat: refs #6321 remove checkbox isFree --- src/components/common/VnSelect.vue | 19 +++++++------- .../Ticket/Negative/TicketLackDetail.vue | 25 ++++++------------- src/pages/Ticket/Negative/TicketLackTable.vue | 18 ++++++++++--- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index c850f2e53..c8187eba0 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -171,7 +171,8 @@ onMounted(() => { }); const arrayDataKey = - $props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label); + $props.dataKey ?? + ($props.url?.length > 0 ? $props.url : ($attrs.name ?? $attrs.label)); const arrayData = useArrayData(arrayDataKey, { url: $props.url, @@ -220,7 +221,7 @@ async function fetchFilter(val) { optionFilterValue.value ?? (new RegExp(/\d/g).test(val) ? optionValue.value - : optionFilter.value ?? optionLabel.value); + : (optionFilter.value ?? optionLabel.value)); let defaultWhere = {}; if ($props.filterOptions.length) { @@ -239,7 +240,7 @@ async function fetchFilter(val) { const { data } = await arrayData.applyFilter( { filter: filterOptions }, - { updateRouter: false } + { updateRouter: false }, ); setOptions(data); return data; @@ -272,7 +273,7 @@ async function filterHandler(val, update) { ref.setOptionIndex(-1); ref.moveOptionSelection(1, true); } - } + }, ); } @@ -308,7 +309,7 @@ function handleKeyDown(event) { if (inputValue) { const matchingOption = myOptions.value.find( (option) => - option[optionLabel.value].toLowerCase() === inputValue.toLowerCase() + option[optionLabel.value].toLowerCase() === inputValue.toLowerCase(), ); if (matchingOption) { @@ -320,11 +321,11 @@ function handleKeyDown(event) { } const focusableElements = document.querySelectorAll( - 'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])' + 'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])', ); const currentIndex = Array.prototype.indexOf.call( focusableElements, - event.target + event.target, ); if (currentIndex >= 0 && currentIndex < focusableElements.length - 1) { focusableElements[currentIndex + 1].focus(); @@ -333,8 +334,8 @@ function handleKeyDown(event) { } function getCaption(opt) { - if (optionCaption.value === false) return; - return opt[optionCaption.value] || opt[optionValue.value]; + if (optionCaption.value === false && typeof optionCaption.value !== 'string') return; + return '' + (opt[optionCaption.value] || opt[optionValue.value]); } diff --git a/src/pages/Ticket/Negative/TicketLackDetail.vue b/src/pages/Ticket/Negative/TicketLackDetail.vue index c744cb1f4..c1643c308 100644 --- a/src/pages/Ticket/Negative/TicketLackDetail.vue +++ b/src/pages/Ticket/Negative/TicketLackDetail.vue @@ -11,12 +11,10 @@ import { useStateStore } from 'stores/useStateStore'; import { useRoute } from 'vue-router'; import TicketLackTable from './TicketLackTable.vue'; import VnPopupProxy from 'src/components/common/VnPopupProxy.vue'; -import { useQuasar } from 'quasar'; - +import ItemProposalProxy from 'src/pages/Item/components/ItemProposalProxy.vue'; import FetchedTags from 'components/ui/FetchedTags.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import VnImg from 'src/components/ui/VnImg.vue'; -const quasar = useQuasar(); const { t } = useI18n(); const editableStates = ref([]); @@ -100,17 +98,10 @@ function onBuysFetched(data) { Object.assign(item.value, data[0]); } -const showItemProposal = () => { - quasar - .dialog({ - component: ItemProposalProxy, - componentProps: { - itemLack: itemLack.value, - replaceAction: true, - sales: selectedRows.value, - }, - }) - .onOk(itemProposalEvt); +const closeDialogs = (refs, evt) => { + changeItemDialogRef.value.hide(); + changeQuantityDialogRef.value.hide(); + changeStateDialogRef.value.hide(); }; @@ -220,16 +211,16 @@ const showItemProposal = () => { - + /> -->