#69 feat(Reconciliation): show summary on modal.

This commit is contained in:
Mono Mono 2024-11-17 00:02:08 -05:00
parent bd6d4221b2
commit ef1a520838
2 changed files with 44 additions and 0 deletions

View File

@ -65,8 +65,12 @@
:headers="summary.headers" :headers="summary.headers"
:items="summary.purchases[payment_method]" :items="summary.purchases[payment_method]"
> >
<template v-slot:item.id="{ item }">
<v-btn @click="openSummaryModal(item.id)">{{ item.id }}</v-btn>
</template>
</v-data-table-virtual> </v-data-table-virtual>
</v-tabs-window-item> </v-tabs-window-item>
<SummaryPurchaseModal :id="selectedPurchaseId" ref="summaryModal" />
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-tabs-window> </v-tabs-window>
@ -74,13 +78,19 @@
</template> </template>
<script> <script>
import CurrencyText from './CurrencyText.vue'; import CurrencyText from './CurrencyText.vue';
import SummaryPurchaseModal from './SummaryPurchaseModal.vue';
export default { export default {
name: 'ReconciliationJar', name: 'ReconciliationJar',
props: { props: {
msg: String, msg: String,
}, },
components: {
SummaryPurchaseModal,
},
data () { data () {
return { return {
selectedPurchaseId: null,
selectedTab: null, selectedTab: null,
reconciliation: { reconciliation: {
datetime: '', datetime: '',
@ -141,6 +151,10 @@
const formattedDate = localDate.toISOString().slice(0,16); const formattedDate = localDate.toISOString().slice(0,16);
return formattedDate; return formattedDate;
}, },
openSummaryModal(id) {
this.selectedPurchaseId = id;
this.$refs.summaryModal.dialog = true;
},
}, },
} }
</script> </script>

View File

@ -0,0 +1,30 @@
<template>
<v-dialog v-model="dialog" max-width="400">
<v-card>
<v-card-text>
<SummaryPurchase :id="id"/>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text @click="dialog = false">Cerrar</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
name: 'SummaryPurchase Modal',
props: {
id: {
type: Number,
required: true,
}
},
data() {
return {
dialog: false,
}
},
}
</script>