From 27e88227b5214adbacad8f87e5554634244ab20b Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 22 Jul 2024 13:05:53 +0530 Subject: [PATCH] Improved: added support to mobile view of the completed page (#244) --- src/locales/en.json | 2 ++ src/views/Completed.vue | 28 +++++++++++++++++++++++----- src/views/ShippingPopover.vue | 35 ++++++++++++++++++++--------------- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 455f5db6..fd8b59d3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -373,6 +373,7 @@ "POS Channel": "POS Channel", "Price": "Price", "Primary": "Primary", + "Print customer letter": "Print customer letter", "Print Customer Letter": "Print Customer Letter", "Print Picklist": "Print Picklist", "Print Picksheet": "Print Picksheet", @@ -408,6 +409,7 @@ "Rejection reasons": "Rejection reasons", "Rejection reasons order has been change. Click save button to update them.": "Rejection reasons order has been change. Click save button to update them.", "Rejection reason name is required.": "Rejection reason name is required.", + "Regenerate shipping label": "Regenerate shipping label", "Regenerate Shipping Label": "Regenerate Shipping Label", "Remove from carrier": "Remove from carrier", "Remove reason": "Remove reason", diff --git a/src/views/Completed.vue b/src/views/Completed.vue index e48bd806..76929939 100644 --- a/src/views/Completed.vue +++ b/src/views/Completed.vue @@ -122,8 +122,9 @@
- {{ translate("Ship Now") }} - + {{ translate("Shipped") }} + {{ translate("Ship Now") }} + @@ -198,7 +199,7 @@ import { } from '@ionic/vue'; import { computed, defineComponent } from 'vue'; import { caretDownOutline, cubeOutline, printOutline, downloadOutline, listOutline, pricetagOutline, ellipsisVerticalOutline, checkmarkDoneOutline, optionsOutline } from 'ionicons/icons' -import Popover from '@/views/ShippingPopover.vue' +import ShippingPopover from '@/views/ShippingPopover.vue' import { useRouter } from 'vue-router'; import { mapGetters, useStore } from 'vuex' import { copyToClipboard, formatUtcDate, getFeature, showToast } from '@/utils' @@ -456,13 +457,30 @@ export default defineComponent({ return shipOrderAlert.present(); }, - async shippingPopover(ev: Event) { + async shippingPopover(ev: Event, order: any) { const popover = await popoverController.create({ - component: Popover, + component: ShippingPopover, + componentProps: { + hasPackedShipments: this.hasPackedShipments(order), + order + }, event: ev, translucent: true, showBackdrop: false, }); + + popover.onDidDismiss().then(async(result) => { + if(result.data?.dismissed) { + const selectedMethod = result.data?.selectedMethod + + // Retrieved the method name on popover dismissal and respective method is called. + if(typeof(this[selectedMethod]) === 'function') { + await (this as any)[selectedMethod](order); + } + } + + }) + return popover.present(); }, diff --git a/src/views/ShippingPopover.vue b/src/views/ShippingPopover.vue index 375da134..98c9f760 100644 --- a/src/views/ShippingPopover.vue +++ b/src/views/ShippingPopover.vue @@ -1,17 +1,16 @@