feat: refs #6321 updates requested

This commit is contained in:
Javier Segarra 2025-02-06 00:33:43 +01:00
parent d8bc37b627
commit b8f2df59cd
6 changed files with 35 additions and 26 deletions

View File

@ -30,6 +30,9 @@ const $props = defineProps({
},
});
const proposalSelected = ref([]);
const ticketConfig = ref({});
const proposalTableRef = ref(null);
const sale = computed(() => $props.sales[0]);
const saleFk = computed(() => sale.value.saleFk);
const filter = computed(() => ({
@ -37,11 +40,14 @@ const filter = computed(() => ({
sales: saleFk.value,
}));
const proposalTableRef = ref(null);
const defaultColumnAttrs = {
align: 'center',
sortable: false,
};
const emit = defineEmits(['onDialogClosed', 'itemReplaced']);
const conditionalValuePrice = (price) => (price > 1.3 ? 'match' : 'not-match');
const columns = computed(() => [
{
...defaultColumnAttrs,
@ -175,9 +181,17 @@ const statusConditionalValue = (row) => {
return 100 * (value / matches.length);
};
const emit = defineEmits(['onDialogClosed', 'itemReplaced']);
const conditionalValuePrice = (price) => (price > 1.3 ? 'match' : 'not-match');
const isSelectionAvailable = (itemProposal) => {
const { price2 } = itemProposal;
const salePrice = sale.value.price;
const byPrice = (100 * price2) / salePrice > ticketConfig.value.lackAlertPrice;
if (byPrice) {
return byPrice;
}
const byQuantity =
(100 * itemProposal.available) / Math.abs($props.itemLack.lack) < 30;
return byQuantity;
};
async function change({ itemFk: substitutionFk }) {
try {
@ -202,18 +216,7 @@ async function change({ itemFk: substitutionFk }) {
console.error(error);
}
}
const ticketConfig = ref({});
const isSelectionAvailable = (itemProposal) => {
const { price2 } = itemProposal;
const salePrice = sale.value.price;
const byPrice = (100 * price2) / salePrice > ticketConfig.value.lackAlertPrice;
if (byPrice) {
return byPrice;
}
const byQuantity =
(100 * itemProposal.available) / Math.abs($props.itemLack.lack) < 30;
return byQuantity;
};
async function handleTicketConfig(data) {
ticketConfig.value = data[0];
}

View File

@ -14,7 +14,7 @@ import TicketLackTable from './TicketLackTable.vue';
import VnPopupProxy from 'src/components/common/VnPopupProxy.vue';
import ItemProposalProxy from 'src/pages/Item/components/ItemProposalProxy.vue';
import { useQuasar } from 'quasar';
import { date, useQuasar } from 'quasar';
const quasar = useQuasar();
const { t } = useI18n();
const editableStates = ref([]);
@ -65,7 +65,13 @@ const showItemProposal = () => {
})
.onOk(itemProposalEvt);
};
const filterTable = { stateFk: 0, warehouseFk: useState().getUser().value.warehouseFk };
const filterTable = {
scopeDays: 2,
showType: true,
alertLevelCode: 'FREE',
date: Date.vnNew(),
warehouseFk: useState().getUser().value.warehouseFk,
};
</script>
<template>

View File

@ -95,13 +95,13 @@ const columns = computed(() => [
name: 'alertLevelCode',
label: t('negative.detail.state'),
columnFilter: {
name: 'stateFk',
name: 'alertLevelCode',
component: 'select',
attrs: {
url: 'AlertLevels',
fields: ['id', 'code'],
fields: ['name', 'code'],
optionLabel: 'code',
optionValue: 'id',
optionValue: 'code',
},
},
columnClass: 'expand',
@ -265,14 +265,14 @@ function onBuysFetched(data) {
<QTooltip>{{ t('negative.detail.hasToIgnore') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.hasSubstitution"
v-if="row.hasObservation"
name="change_circle"
color="primary"
class="cursor-pointer"
size="xs"
>
<QTooltip>{{
t('negative.detail.hasSubstitution')
t('negative.detail.hasObservation')
}}</QTooltip> </QIcon
><QIcon
v-if="row.isRookie"

View File

@ -239,7 +239,7 @@ negative:
isRookie: 'Is rookie'
turno: 'Turn line'
isBasket: 'Basket'
hasSubstitution: 'Has substitution'
hasObservation: 'Has substitution'
hasToIgnore: VIP
modal:
changeItem:

View File

@ -267,7 +267,7 @@ negative:
isRookie: 'Cliente nuevo'
turno: 'Linea turno'
isBasket: 'Cesta'
hasSubstitution: 'Tiene sustitución'
hasObservation: 'Tiene sustitución'
hasToIgnore: VIP
modal:
changeItem:

View File

@ -28,7 +28,7 @@ describe('Ticket Lack detail', () => {
isRookie: 1,
turno: 1,
peticionCompra: 1,
hasSubstitution: 1,
hasObservation: 1,
hasToIgnore: 1,
isBasket: 1,
minTimed: 0,