From 0f32e71727ae5234dce9418c84d7523214d2ca60 Mon Sep 17 00:00:00 2001 From: Ravi Lodhi Date: Mon, 22 Jul 2024 19:33:23 +0530 Subject: [PATCH] Added: check to only move items to rejected parking for specific prodstore. --- src/views/order-popover.vue | 10 ++++++++-- src/views/orders.vue | 3 ++- src/views/product-details.vue | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/views/order-popover.vue b/src/views/order-popover.vue index da453599..04699a3b 100644 --- a/src/views/order-popover.vue +++ b/src/views/order-popover.vue @@ -18,21 +18,27 @@ import { alertController, modalController, } from "@ionic/vue"; -import { defineComponent } from "vue"; +import { computed, defineComponent } from "vue"; import WarehouseModal from "@/views/warehouse-modal.vue"; import { useStore } from "@/store"; import PromiseDateModal from "@/views/promise-date-modal.vue"; +import { mapGetters } from "vuex"; export default defineComponent({ name: "OrderPopover", props: ['item'], + computed: { + ...mapGetters({ + currentEComStore: 'user/getCurrentEComStore' + }) + }, methods: { async releaseItem (item: any) { return this.store.dispatch("order/releaseItem", { orderId: item.orderId, orderItemSeqId: item.orderItemSeqId, changeReasonEnumId: "RELEASED", - toFacilityId: "RELEASED_ORD_PARKING" // TODO Make it configurable, currently this is for SM only + toFacilityId: this.currentEComStore.productStoreId === "SM_STORE" ? "RELEASED_ORD_PARKING" : "_NA_" // TODO Make it configurable, currently this is for SM only }) }, async cancelItem (item: any) { diff --git a/src/views/orders.vue b/src/views/orders.vue index 0a016212..7f9cd238 100644 --- a/src/views/orders.vue +++ b/src/views/orders.vue @@ -278,6 +278,7 @@ export default defineComponent({ selectedItemsCount: 'order/getSelectedItemsCount', userProfile: 'user/getUserProfile', query: 'order/getQuery', + currentEComStore: 'user/getCurrentEComStore' }), }, methods: { @@ -294,7 +295,7 @@ export default defineComponent({ }, async releaseItems() { emitter.emit("presentLoader") - const selectedItems = this.getSelectedItemsToRelease("RELEASED_ORD_PARKING", "RELEASED"); // TODO Make it configurable, currently this is for SM only + const selectedItems = this.getSelectedItemsToRelease(this.currentEComStore.productStoreId === "SM_STORE" ? "RELEASED_ORD_PARKING" : "_NA_", "RELEASED"); // TODO Make it configurable, currently this is for SM only const json = JSON.stringify(selectedItems); const blob = new Blob([json], { type: 'application/json'}); const formData = new FormData(); diff --git a/src/views/product-details.vue b/src/views/product-details.vue index a65c5de9..efde4160 100644 --- a/src/views/product-details.vue +++ b/src/views/product-details.vue @@ -438,7 +438,7 @@ export default defineComponent({ orderId: item.orderId, orderItemSeqId: item.orderItemSeqId, changeReasonEnumId: "RELEASED", - toFacilityId: "RELEASED_ORD_PARKING" // TODO Make it configurable, this is for SM only as of now + toFacilityId: this.currentEComStore.productStoreId === "SM_STORE" ? "RELEASED_ORD_PARKING" : "_NA_" // TODO Make it configurable, this is for SM only as of now } }) selectedItems = [...selectedItems, ...items];