feat: replace item

This commit is contained in:
Javier Segarra 2024-05-15 08:54:22 +02:00
parent fffd662cee
commit 1ca7420207
4 changed files with 43 additions and 2 deletions

View File

@ -32,6 +32,7 @@ globals:
clone: Clone clone: Clone
confirm: Confirm confirm: Confirm
assign: Assign assign: Assign
replace: Replace
back: Back back: Back
yes: 'Yes' yes: 'Yes'
no: 'No' no: 'No'

View File

@ -32,6 +32,7 @@ globals:
clone: Clonar clone: Clonar
confirm: Confirmar confirm: Confirmar
assign: Asignar assign: Asignar
replace: Sustituir
back: Volver back: Volver
yes: Si yes: Si
no: No no: No

View File

@ -13,6 +13,7 @@ const $props = defineProps({
}, },
}); });
const proposalSelected = ref([]); const proposalSelected = ref([]);
const quantity = ref(-1);
const showProposalDialog = ref(false); const showProposalDialog = ref(false);
const defaultColumnAttrs = { const defaultColumnAttrs = {
@ -115,6 +116,23 @@ const columns = computed(() => [
field: 'located', field: 'located',
}, },
]); ]);
async function confirm() {
quantity.value = 0;
// const response = { address: address.value };
// if (props.promise) {
// isLoading.value = true;
// // eslint-disable-next-line no-unused-vars
// const { address: _address, ...restData } = props.data;
// try {
// Object.assign(response, restData);
// await props.promise(response);
// } finally {
// isLoading.value = false;
// }
// }
// onDialogOK(response);
}
</script> </script>
<template> <template>
<QDialog ref="dialogRef" @hide="onDialogHide" v-model="showProposalDialog" full-width> <QDialog ref="dialogRef" @hide="onDialogHide" v-model="showProposalDialog" full-width>
@ -187,8 +205,28 @@ const columns = computed(() => [
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
</template> </VnPaginate </template>
></QCardSection> </VnPaginate>
</QCardSection>
<QCardActions align="right">
<QBtn :label="t('globals.cancel')" color="primary" flat v-close-popup />
<QBtn
:label="t('globals.replace')"
color="primary"
:loading="isLoading"
@click="confirm"
:disable="proposalSelected.length < 1 || quantity === 0"
unelevated
/>
<QInput
v-model="quantity"
v-if="quantity > -1"
type="number"
min="0"
:label="t('Quantity to replace')"
class="q-ml-lg"
/>
</QCardActions>
</QCard> </QCard>
</QDialog> </QDialog>
</template> </template>

View File

@ -190,6 +190,7 @@ const onDetailDialogHide = (evt) => {
<QBtn <QBtn
color="primary" color="primary"
@click="showProposalDialog = true" @click="showProposalDialog = true"
:disable="selectedRowsDetail.length < 1"
icon="vn:splitline" icon="vn:splitline"
> >
<QTooltip bottom anchor="bottom right"> <QTooltip bottom anchor="bottom right">