From 062567bc8b1e0333c20f02a47ed7add12a074289 Mon Sep 17 00:00:00 2001 From: Ravi Lodhi Date: Fri, 11 Oct 2024 11:51:02 +0530 Subject: [PATCH] Improved: Fetched shipment attribute while fetching shipment detail (#347). --- src/store/modules/shipment/actions.ts | 3 +++ src/views/Shipments.vue | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store/modules/shipment/actions.ts b/src/store/modules/shipment/actions.ts index 5b761523..efbbcd49 100644 --- a/src/store/modules/shipment/actions.ts +++ b/src/store/modules/shipment/actions.ts @@ -20,11 +20,14 @@ const actions: ActionTree = { const statuses = await this.dispatch('util/fetchStatus', statusIds); const shipmentIds = shipments.map((shipment: any) => shipment.shipmentId); + const shipmentAttributes = await ShipmentService.fetchShipmentAttributes(shipmentIds) const trackingCodes = await ShipmentService.fetchTrackingCodes(shipmentIds) shipments.map(async (shipment: any) => { shipment.statusDesc = statuses[shipment.statusId] shipment.trackingIdNumber = trackingCodes?.[shipment.shipmentId]; + shipment.externalOrderId = shipmentAttributes[shipment.shipmentId]?.['EXTERNAL_ORDER_ID'] + shipment.externalOrderName = shipmentAttributes[shipment.shipmentId]?.['EXTERNAL_ORDER_NAME'] }); if (payload.viewIndex && payload.viewIndex > 0) shipments = state.shipments.list.concat(shipments); diff --git a/src/views/Shipments.vue b/src/views/Shipments.vue index 08d708fc..85d3c0cc 100644 --- a/src/views/Shipments.vue +++ b/src/views/Shipments.vue @@ -115,7 +115,7 @@ export default defineComponent({ "grp_op_1": "OR" }, "entityName": "ShipmentAndTypeAndItemCount", - "fieldList" : [ "shipmentId","primaryShipGroupSeqId","partyIdFrom","partyIdTo","estimatedArrivalDate","destinationFacilityId","statusId", "shipmentItemCount", "externalId", "externalOrderId", "externalOrderName", "shipmentTypeId" ], + "fieldList" : [ "shipmentId","primaryShipGroupSeqId","partyIdFrom","partyIdTo","estimatedArrivalDate","destinationFacilityId","statusId", "shipmentItemCount", "externalId", "externalOrderId", "shipmentTypeId" ], "noConditionFind": "Y", "viewSize": viewSize, "viewIndex": viewIndex,