0
0
Fork 0

feat: show bad dates

This commit is contained in:
Javier Segarra 2024-07-11 06:16:51 +02:00
parent e23a30c693
commit a9bab6ab2c
1 changed files with 18 additions and 2 deletions

View File

@ -69,7 +69,7 @@ const onFixedPricesFetched = (data) => {
console.log(item.hasMinPrice);
item.hasMinPrice = `${item.hasMinPrice !== 0}`;
});
fixedPrices.value = data;
fixedPrices.value = Array(200).fill(...data);
// el objetivo de guardar una copia de las rows es evitar guardar cambios si la data no cambió al disparar los eventos
fixedPricesOriginalData.value = JSON.parse(JSON.stringify(data));
};
@ -323,7 +323,17 @@ const addRow = () => {
const openEditTableCellDialog = () => {
editTableCellDialogRef.value.show();
};
async function showBadDates() {
try {
const { data } = await axios.get('FixedPrices/filter', {
params: {
showBadDates: true,
},
});
} catch (error) {
console.error(error);
}
}
const onEditCellDataSaved = async () => {
rowsSelected.value = [];
await fetchFixedPrices();
@ -583,6 +593,12 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QTd>
</template>
</QTable>
<QPageSticky :offset="[20, 20]">
<QBtn @click="showBadDates()" color="primary" fab icon="edit" />
<QTooltip>
{{ t('Edit fixed price(s)') }}
</QTooltip>
</QPageSticky>
<QPageSticky v-if="rowsSelected.length" :offset="[20, 20]">
<QBtn @click="openEditTableCellDialog()" color="primary" fab icon="edit" />
<QTooltip>