diff --git a/src/components/common/VnSummaryDialog.vue b/src/components/common/VnSummaryDialog.vue
new file mode 100644
index 000000000..08fc8870d
--- /dev/null
+++ b/src/components/common/VnSummaryDialog.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
diff --git a/src/composables/useSummaryDialog.js b/src/composables/useSummaryDialog.js
new file mode 100644
index 000000000..7d431129b
--- /dev/null
+++ b/src/composables/useSummaryDialog.js
@@ -0,0 +1,15 @@
+import VnSummaryDialog from 'src/components/common/VnSummaryDialog.vue';
+import { useQuasar } from 'quasar';
+
+export function useSummaryDialog() {
+ const quasar = useQuasar();
+
+ function viewSummary(id, summary) {
+ quasar.dialog({
+ component: VnSummaryDialog,
+ componentProps: { id, summary },
+ });
+ }
+
+ return { viewSummary };
+}
diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue
index 1b5979f5a..492963399 100644
--- a/src/pages/Claim/ClaimList.vue
+++ b/src/pages/Claim/ClaimList.vue
@@ -1,7 +1,6 @@
@@ -135,7 +135,7 @@ function viewSummary(id) {
diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue
index a78720d03..56c3749d4 100644
--- a/src/pages/Customer/CustomerList.vue
+++ b/src/pages/Customer/CustomerList.vue
@@ -1,34 +1,25 @@
@@ -51,7 +40,7 @@ const viewSummary = () => {
{
router.push({ name: 'EntryCreate' });
};
-function viewSummary(id) {
- quasar.dialog({
- component: EntrySummaryDialog,
- componentProps: {
- id,
- },
- });
-}
-
onMounted(async () => {
stateStore.rightDrawer = true;
});
@@ -121,7 +110,7 @@ onMounted(async () => {
diff --git a/src/pages/InvoiceIn/InvoiceInList.vue b/src/pages/InvoiceIn/InvoiceInList.vue
index ea26e8162..f1ebad81a 100644
--- a/src/pages/InvoiceIn/InvoiceInList.vue
+++ b/src/pages/InvoiceIn/InvoiceInList.vue
@@ -2,7 +2,6 @@
import { ref, onMounted, onUnmounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
-import { useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore';
import { downloadFile } from 'src/composables/downloadFile';
import { toDate, toCurrency } from 'src/filters/index';
@@ -11,12 +10,13 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
import InvoiceInFilter from './InvoiceInFilter.vue';
-import InvoiceInSummaryDialog from './Card/InvoiceInSummaryDialog.vue';
import { getUrl } from 'src/composables/getUrl';
+import InvoiceInSummary from './Card/InvoiceInSummary.vue';
+import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const stateStore = useStateStore();
const router = useRouter();
-const quasar = useQuasar();
+const { viewSummary } = useSummaryDialog();
let url = ref();
const { t } = useI18n();
@@ -29,15 +29,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
function navigate(id) {
router.push({ path: `/invoice-in/${id}` });
}
-
-function viewSummary(id) {
- quasar.dialog({
- component: InvoiceInSummaryDialog,
- componentProps: {
- id,
- },
- });
-}
@@ -127,7 +118,7 @@ function viewSummary(id) {
-import { onMounted, onUnmounted, ref, watch } from 'vue';
+import { onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { exportFile, useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
-import InvoiceOutSummaryDialog from './Card/InvoiceOutSummaryDialog.vue';
+import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
import { toDate, toCurrency } from 'src/filters/index';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const { t } = useI18n();
const selectedCards = ref(new Map());
const quasar = useQuasar();
const router = useRouter();
const stateStore = useStateStore();
+const { viewSummary } = useSummaryDialog();
onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false));
@@ -26,15 +28,6 @@ function navigate(id) {
router.push({ path: `/invoice-out/${id}` });
}
-function viewSummary(id) {
- quasar.dialog({
- component: InvoiceOutSummaryDialog,
- componentProps: {
- id,
- },
- });
-}
-
const toggleIndividualCard = (cardData) => {
if (selectedCards.value.has(cardData.id)) {
selectedCards.value.delete(cardData.id);
@@ -233,7 +226,7 @@ const downloadCsv = () => {
/>
(stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false));
@@ -25,15 +25,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
function navigate(id) {
router.push({ path: `/order/${id}` });
}
-
-function viewSummary(id) {
- quasar.dialog({
- component: OrderSummaryDialog,
- componentProps: {
- id,
- },
- });
-}
@@ -134,7 +125,7 @@ function viewSummary(id) {
diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue
index c884dc5f4..b4ff24007 100644
--- a/src/pages/Shelving/ShelvingList.vue
+++ b/src/pages/Shelving/ShelvingList.vue
@@ -5,16 +5,16 @@ import { useI18n } from 'vue-i18n';
import { onMounted, onUnmounted } from 'vue';
import CardList from 'components/ui/CardList.vue';
import VnLv from 'components/ui/VnLv.vue';
-import { useQuasar } from 'quasar';
import { useRouter } from 'vue-router';
import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
-import ShelvingSummaryDialog from 'pages/Shelving/Card/ShelvingSummaryDialog.vue';
+import ShelvingSummary from 'pages/Shelving/Card/ShelvingSummary.vue';
import ShelvingSearchbar from 'pages/Shelving/Card/ShelvingSearchbar.vue';
+import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const stateStore = useStateStore();
const router = useRouter();
-const quasar = useQuasar();
const { t } = useI18n();
+const { viewSummary } = useSummaryDialog();
const filter = {
include: [{ relation: 'parking' }],
};
@@ -26,15 +26,6 @@ function navigate(id) {
router.push({ path: `/shelving/${id}` });
}
-function viewSummary(id) {
- quasar.dialog({
- component: ShelvingSummaryDialog,
- componentProps: {
- id,
- },
- });
-}
-
function exprBuilder(param, value) {
switch (param) {
case 'search':
@@ -110,7 +101,7 @@ function exprBuilder(param, value) {
/>
diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue
index f4875fc99..e8668fa08 100644
--- a/src/pages/Supplier/SupplierList.vue
+++ b/src/pages/Supplier/SupplierList.vue
@@ -1,21 +1,19 @@
@@ -86,7 +75,7 @@ const viewSummary = (id) => {
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 6f57ad0b9..72c2da57c 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -1,21 +1,21 @@
@@ -123,7 +114,7 @@ function viewSummary(id) {
diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue
index dbbdaca93..85caf85f1 100644
--- a/src/pages/Travel/TravelList.vue
+++ b/src/pages/Travel/TravelList.vue
@@ -2,21 +2,19 @@
import { onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
-import { useQuasar } from 'quasar';
-
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import CardList from 'src/components/ui/CardList.vue';
import VnLv from 'src/components/ui/VnLv.vue';
-import TravelSummaryDialog from './Card/TravelSummaryDialog.vue';
+import TravelSummary from './Card/TravelSummary.vue';
import TravelFilter from './TravelFilter.vue';
-
import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters/index';
+import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const router = useRouter();
-const quasar = useQuasar();
const { t } = useI18n();
const stateStore = useStateStore();
+const { viewSummary } = useSummaryDialog();
const navigateToTravelId = (id) => {
router.push({ path: `/travel/${id}` });
@@ -35,15 +33,6 @@ const redirectCreateEntryView = (travelData) => {
router.push({ name: 'EntryCreate', query: { travelFk: travelData.id } });
};
-const viewSummary = (id) => {
- quasar.dialog({
- component: TravelSummaryDialog,
- componentProps: {
- id,
- },
- });
-};
-
onMounted(async () => {
stateStore.rightDrawer = true;
});
@@ -114,7 +103,7 @@ onMounted(async () => {
/>
diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue
index 0e9868a04..5214a9066 100644
--- a/src/pages/Worker/WorkerList.vue
+++ b/src/pages/Worker/WorkerList.vue
@@ -1,33 +1,24 @@