0
0
Fork 0

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
confirm: Confirm
assign: Assign
replace: Replace
back: Back
yes: 'Yes'
no: 'No'

View File

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

View File

@ -13,6 +13,7 @@ const $props = defineProps({
},
});
const proposalSelected = ref([]);
const quantity = ref(-1);
const showProposalDialog = ref(false);
const defaultColumnAttrs = {
@ -115,6 +116,23 @@ const columns = computed(() => [
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>
<template>
<QDialog ref="dialogRef" @hide="onDialogHide" v-model="showProposalDialog" full-width>
@ -187,8 +205,28 @@ const columns = computed(() => [
</QTd>
</template>
</QTable>
</template> </VnPaginate
></QCardSection>
</template>
</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>
</QDialog>
</template>

View File

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