diff --git a/src/views/EditPackagingModal.vue b/src/views/EditPackagingModal.vue index 2365d1e6..d26e626c 100644 --- a/src/views/EditPackagingModal.vue +++ b/src/views/EditPackagingModal.vue @@ -74,10 +74,8 @@ {{ shipmentPackage.packageName }} - - Type 1 - Type 2 - Type 3 + + {{ boxTypeDesc(boxType) }} @@ -105,7 +103,7 @@ import { modalController } from "@ionic/vue"; import { defineComponent } from "vue"; import { addCircleOutline, closeOutline, pricetag } from "ionicons/icons"; -import { mapGetters } from 'vuex'; +import { mapGetters, useStore } from 'vuex'; import { copyToClipboard, formatUtcDate, getFeature } from '@/utils'; import { ShopifyImg, translate } from '@hotwax/dxp-components'; @@ -132,16 +130,33 @@ export default defineComponent({ }, computed: { ...mapGetters({ - getProduct: 'product/getProduct' + getProduct: 'product/getProduct', + boxTypeDesc: 'util/getShipmentBoxDesc', }), }, methods: { closeModal() { modalController.dismiss({ dismissed: true }); + }, + getShipmentPackageType(shipmentPackage) { + let packageType = ''; + if(shipmentPackage.shipmentBoxTypes.length){ + packageType = shipmentPackage.shipmentBoxTypes.find((boxType) => boxType === shipmentPackage.shipmentBoxTypeId) ? shipmentPackage.shipmentBoxTypes.find((boxType) => boxType === shipmentPackage.shipmentBoxTypeId) : shipmentPackage.shipmentBoxTypes[0]; + } + return packageType; + }, + async updateShipmentBoxType(shipmentPackage, order, event) { + if(event.detail.value){ + shipmentPackage.shipmentBoxTypeId = event.detail.value; + order.isModified = true; + this.store.dispatch('order/updateInProgressOrder', order); + } } }, props: ['addingBoxForOrderIds', 'addShipmentBox', 'order', 'save', 'updateBox'], setup() { + const store = useStore() + return { addCircleOutline, closeOutline, @@ -149,6 +164,7 @@ export default defineComponent({ formatUtcDate, getFeature, pricetag, + store, translate }; }, diff --git a/src/views/ReportIssueModal.vue b/src/views/ReportIssueModal.vue index 5f79913b..c67ac756 100644 --- a/src/views/ReportIssueModal.vue +++ b/src/views/ReportIssueModal.vue @@ -8,8 +8,7 @@ {{ translate("Report an issue") }} - {{ $t("Save") }} - {{ translate("Save") }} + {{ translate("Save") }}