diff --git a/src/store/modules/orderLookup/actions.ts b/src/store/modules/orderLookup/actions.ts index e00dbf8b..b2c81b62 100644 --- a/src/store/modules/orderLookup/actions.ts +++ b/src/store/modules/orderLookup/actions.ts @@ -151,9 +151,16 @@ const actions: ActionTree = { }, viewSize: 50, entityName: "OrderItemShipGroupAndFacility" + }, { + inputFields: { + orderId + }, + fieldList: ["orderId", "shipGroupSeqId", "shipmentId", "trackingIdNumber"], + viewSize: 50, + entityName: "OrderShipmentAndRouteSegment" }] - const [orderHeader, orderContactMech, orderIdentifications, orderAttributes, orderBrokeringInfo, orderStatusInfo, orderPaymentPreference, orderShipGroups] = await Promise.allSettled(apiPayload.map((payload: any) => OrderLookupService.performFind(payload))) + const [orderHeader, orderContactMech, orderIdentifications, orderAttributes, orderBrokeringInfo, orderStatusInfo, orderPaymentPreference, orderShipGroups, orderRouteSegment] = await Promise.allSettled(apiPayload.map((payload: any) => OrderLookupService.performFind(payload))) if(orderHeader.status === "fulfilled" && !hasError(orderHeader.value) && orderHeader.value.data.count > 0) { order = orderHeader.value.data.docs[0] @@ -283,6 +290,11 @@ const actions: ActionTree = { const productIds: Array = [] const shipmentMethodIds: Array = [] + const orderRouteSegmentInfo = orderRouteSegment.status === "fulfilled" && orderRouteSegment.value.data.docs.length > 0 ? orderRouteSegment.value.data.docs.reduce((orderSegmentInfo: any, routeSegment: any) => { + orderSegmentInfo[routeSegment.shipGroupSeqId] = routeSegment + return orderSegmentInfo + }, {}) : [] + if(orderShipGroups.status === "fulfilled" && !hasError(orderShipGroups.value) && orderShipGroups.value.data.count > 0) { shipGroups = orderShipGroups.value.data.docs.reduce((shipGroups: any, shipGroup: any) => { productIds.push(shipGroup.productId) @@ -292,7 +304,10 @@ const actions: ActionTree = { if(shipGroups[shipGroup.shipGroupSeqId]) { shipGroups[shipGroup.shipGroupSeqId].push(shipGroup) } else { - shipGroups[shipGroup.shipGroupSeqId] = [shipGroup] + shipGroups[shipGroup.shipGroupSeqId] = [{ + ...shipGroup, + trackingIdNumber: orderRouteSegmentInfo[shipGroup.shipGroupSeqId] ? orderRouteSegmentInfo[shipGroup.shipGroupSeqId].trackingIdNumber : "" + }] } return shipGroups; }, {}) diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index af89673a..144ce210 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -190,6 +190,7 @@

{{ shipGroups[0].facilityName || shipGroups[0].facilityId }}

{{ getShipmentMethodDesc(shipGroups[0].shipmentMethodTypeId) || shipGroups[0].shipmentMethodTypeId }}

+ {{ translate("Tracking Code") }}{{ ":" }} {{ shipGroups[0].trackingIdNumber }}