#6321 - Negative ticket #158

Open
jsegarra wants to merge 197 commits from 6321_negative_tickets into dev
3 changed files with 33 additions and 29 deletions
Showing only changes of commit 0a4da26d3d - Show all commits

View File

@ -171,7 +171,8 @@ onMounted(() => {
});
Review

formato

formato
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]);
}
</script>

View File

@ -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();
};
</script>
@ -220,16 +211,16 @@ const showItemProposal = () => {
</QTooltip>
</QBtn>
</QBtnGroup>
<QCheckbox
<!-- <QCheckbox
v-model="showFree"
data-cy="showFree"
:label="t('negative.detail.showFree')"
/>
/> -->
</template>
</VnSubToolbar>
<TicketLackTable
ref="tableRef"
:filter="{ alertLevel: showFree }"
:filter="{ stateFk: 0 }"
@update:selection="({ value }, _) => (selectedRows = value)"
>
<template #top-left>

View File

@ -36,7 +36,7 @@ const filterLack = ref({
},
},
],
where: { alertLevel: 'FREE' },
where: { ...$props.filter },
order: 'ts.alertLevelCODE ASC',
});
@ -73,6 +73,7 @@ const saveChange = async (field, { rowIndex, row }) => {
notify('globals.dataSaved', 'positive');
} catch (err) {
console.error('Error saving changes', err);
f;
}
};
const entityId = computed(() => route.params.id);
@ -165,7 +166,17 @@ const columns = computed(() => [
{
name: 'alertLevelCode',
label: t('negative.detail.state'),
columnFilter: {
name: 'stateFk',
component: 'select',
attrs: {
url: 'AlertLevels',
fields: ['id', 'code'],
optionLabel: 'code',
optionValue: 'id',
},
},
columnClass: 'expand',
align: 'left',
sortable: true,
},
@ -246,7 +257,9 @@ function onBuysFetched(data) {
:is-editable="true"
:row-click="false"
:right-search="false"
:right-search-icon="false"
v-model:selected="selectedRows"
:disable-option="{ card: true }"
>
<template #top-left>
<slot name="top-left" />
@ -263,7 +276,6 @@ function onBuysFetched(data) {
>
<QTooltip>{{ t('negative.detail.isBasket') }}</QTooltip>
</QIcon>
<!-- -->
<QIcon
v-if="row.hasToIgnore"
name="star"