diff --git a/src/components/ProductListItem.vue b/src/components/ProductListItem.vue index 054703e82..630ba2a45 100644 --- a/src/components/ProductListItem.vue +++ b/src/components/ProductListItem.vue @@ -4,7 +4,7 @@ -

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}

+

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 73290ba64..0a60b44ae 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -312,6 +312,20 @@ const actions: ActionTree ={ await dispatch('fetchShipGroupForOrder'); }, + async updateOrderItemFetchingStatus ({ commit, state }, payload) { + const order = state.current ? JSON.parse(JSON.stringify(state.current)) : {}; + + order.shipGroups?.find((shipGroup: any) => { + if(shipGroup.shipGroupSeqId === payload.shipGroupSeqId){ + shipGroup.items?.find((item: any) => { + if(item.productId === payload.productId) item.isFetchingStock = !item.isFetchingStock + }); + } + }) + + commit(types.ORDER_CURRENT_UPDATED, { order }) + }, + async getPackedOrders ({ commit, state }, payload) { // Show loader only when new query and not the infinite scroll if (payload.viewIndex === 0) emitter.emit("presentLoader"); @@ -1123,6 +1137,8 @@ const actions: ActionTree ={ const reservedShipGroup = reservedShipGroupForOrder?.groupValue ? reservedShipGroupForOrder.doclist.docs[0] : '' + reservedShipGroupForOrder.doclist.docs.map((item: any) => item.isFetchingStock = false); + return reservedShipGroup ? { ...shipGroup, items: reservedShipGroupForOrder.doclist.docs, diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index 3e5ed925a..96c4a1a71 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -152,19 +152,25 @@ - + - -

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

- {{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }} -

{{ translate("Color:", { color: getFeature(getProduct(item.productId).featureHierarchy, '1/COLOR') }) }}

-

{{ translate("Size:", { size: getFeature(getProduct(item.productId).featureHierarchy, '1/SIZE') }) }}

+ +

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}

+

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

- - {{ getProductStock(item.productId, item.facilityId).quantityOnHandTotal }} {{ translate('pieces in stock') }} - - - + +
+ +
+ {{ translate("on hand", { count: getProductStock(item.productId).quantityOnHandTotal ?? '0' }) }} + + + +
+ + + +
@@ -210,12 +216,14 @@ import { IonLabel, IonNote, IonRow, + IonSpinner, IonThumbnail, IonTitle, IonToolbar, IonFab, IonFabButton, - modalController + modalController, + popoverController } from "@ionic/vue"; import { computed, defineComponent } from "vue"; import { mapGetters, useStore } from "vuex"; @@ -229,6 +237,7 @@ import { checkmarkOutline, cubeOutline, giftOutline, + informationCircleOutline, locateOutline, mailOutline, printOutline, @@ -252,6 +261,7 @@ import { getProductIdentificationValue, translate, useProductIdentificationStore import EditPickerModal from "@/components/EditPickerModal.vue"; import emitter from '@/event-bus' import logger from "@/logger"; +import InventoryDetailsPopover from '@/components/InventoryDetailsPopover.vue' export default defineComponent({ name: "OrderDetail", @@ -276,6 +286,7 @@ export default defineComponent({ IonLabel, IonNote, IonRow, + IonSpinner, IonThumbnail, IonTitle, IonToolbar, @@ -315,8 +326,10 @@ export default defineComponent({ }, props: ['orderType', 'orderId', 'orderPartSeqId'], methods: { - async fetchProductStock(productId: string) { + async fetchProductStock(productId: string, shipGroupSeqId: any) { + this.store.dispatch('order/updateOrderItemFetchingStatus', { productId, shipGroupSeqId }) await this.store.dispatch('stock/fetchStock', { productId }) + this.store.dispatch('order/updateOrderItemFetchingStatus', { productId, shipGroupSeqId }) }, async assignPicker(order: any, part: any, facilityId: any) { const assignPickerModal = await modalController.create({ @@ -477,7 +490,16 @@ export default defineComponent({ }, async printShippingLabelAndPackingSlip(order: any) { await OrderService.printShippingLabelAndPackingSlip(order.shipmentId) - } + }, + async openInventoryDetailPopover(Event: any, item: any){ + const popover = await popoverController.create({ + component: InventoryDetailsPopover, + event: Event, + showBackdrop: false, + componentProps: { item } + }); + await popover.present(); + }, }, async mounted() { emitter.emit("presentLoader") @@ -513,6 +535,7 @@ export default defineComponent({ giftOutline, getFeature, hasPermission, + informationCircleOutline, locateOutline, printOutline, productIdentificationPref,