Create order summary

This commit is contained in:
Kevin Martinez 2023-12-14 21:57:53 -04:00
parent 17dd42dd5c
commit 0509c15001
2 changed files with 50 additions and 9 deletions

View File

@ -0,0 +1,29 @@
<script setup>
import { useDialogPluginComponent } from 'quasar';
import OrderSummary from "pages/Order/Card/OrderSummary.vue";
const $props = defineProps({
id: {
type: Number,
required: true,
},
});
defineEmits([...useDialogPluginComponent.emits]);
const { dialogRef, onDialogHide } = useDialogPluginComponent();
</script>
<template>
<QDialog ref="dialogRef" @hide="onDialogHide">
<OrderSummary v-if="$props.id" :id="$props.id" />
</QDialog>
</template>
<style lang="scss">
.q-dialog .summary .header {
position: sticky;
z-index: $z-max;
top: 0;
}
</style>

View File

@ -4,15 +4,18 @@ import { onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { toCurrency, toDate } from 'src/filters'; import { toCurrency, toDate } from 'src/filters';
import {useQuasar} from "quasar";
import CardList from 'components/ui/CardList.vue'; import CardList from 'components/ui/CardList.vue';
import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnPaginate from 'components/ui/VnPaginate.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import OrderSearchbar from 'pages/Order/Card/OrderSearchbar.vue'; import OrderSearchbar from 'pages/Order/Card/OrderSearchbar.vue';
import OrderFilter from "pages/Order/Card/OrderFilter.vue"; import OrderFilter from 'pages/Order/Card/OrderFilter.vue';
import OrderSummaryDialog from "pages/Order/Card/OrderSummaryDialog.vue";
const stateStore = useStateStore(); const stateStore = useStateStore();
const quasar = useQuasar();
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
@ -22,6 +25,15 @@ onUnmounted(() => (stateStore.rightDrawer = false));
function navigate(id) { function navigate(id) {
router.push({ path: `/order/${id}` }); router.push({ path: `/order/${id}` });
} }
function viewSummary(id) {
quasar.dialog({
component: OrderSummaryDialog,
componentProps: {
id,
},
});
}
</script> </script>
<template> <template>
@ -119,14 +131,14 @@ function navigate(id) {
:value="toCurrency(row?.total)" :value="toCurrency(row?.total)"
/> />
</template> </template>
<!-- <template #actions>--> <template #actions>
<!-- <QBtn--> <QBtn
<!-- :label="t('components.smartCard.openSummary')"--> :label="t('components.smartCard.openSummary')"
<!-- @click.stop="viewSummary(row.id)"--> @click.stop="viewSummary(row.id)"
<!-- color="primary"--> color="primary"
<!-- style="margin-top: 15px"--> style="margin-top: 15px"
<!-- />--> />
<!-- </template>--> </template>
</CardList> </CardList>
</template> </template>
</VnPaginate> </VnPaginate>