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); console.log(item.hasMinPrice);
item.hasMinPrice = `${item.hasMinPrice !== 0}`; 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 // 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)); fixedPricesOriginalData.value = JSON.parse(JSON.stringify(data));
}; };
@ -323,7 +323,17 @@ const addRow = () => {
const openEditTableCellDialog = () => { const openEditTableCellDialog = () => {
editTableCellDialogRef.value.show(); 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 () => { const onEditCellDataSaved = async () => {
rowsSelected.value = []; rowsSelected.value = [];
await fetchFixedPrices(); await fetchFixedPrices();
@ -583,6 +593,12 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QTd> </QTd>
</template> </template>
</QTable> </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]"> <QPageSticky v-if="rowsSelected.length" :offset="[20, 20]">
<QBtn @click="openEditTableCellDialog()" color="primary" fab icon="edit" /> <QBtn @click="openEditTableCellDialog()" color="primary" fab icon="edit" />
<QTooltip> <QTooltip>