From 98b318c10c9cca93a1addf209c1529b183e57a2e Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 20 Oct 2023 16:33:47 +0530 Subject: [PATCH] Improved: UI to add check on data, added static text to locale(#313) --- src/components/OrderActionsPopover.vue | 1 - src/locales/en.json | 2 ++ src/locales/es.json | 2 ++ src/store/modules/order/actions.ts | 20 +++++++++++----- src/views/OrderDetail.vue | 32 +++++++++++++++----------- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/components/OrderActionsPopover.vue b/src/components/OrderActionsPopover.vue index 54d324b5..bb2a764c 100644 --- a/src/components/OrderActionsPopover.vue +++ b/src/components/OrderActionsPopover.vue @@ -68,7 +68,6 @@ export default defineComponent({ return assignPickerModal.present(); }, async viewOrder() { - console.log(this.order) this.store.dispatch('order/updateCurrent', this.order).then(() => { this.closePopover(); this.$router.push({ path: `/order-detail/${this.order.orderId}` }) diff --git a/src/locales/en.json b/src/locales/en.json index 63705e8f..12425215 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -161,6 +161,7 @@ "Order ID": "Order ID", "Order packed successfully": "Order packed successfully", "Order packed successfully. Document generation in process": "Order packed successfully. Document generation in process", + "Other shipments in this order": "Other shipments in this order", "Order shipped successfully": "Order shipped successfully", "Order Shipment ID": "Order Shipment ID", "Order unpacked successfully": "Order unpacked successfully", @@ -176,6 +177,7 @@ "Pack using default packaging": "Pack using default packaging", "Packed Orders": "Packed Orders", "Password": "Password", + "Pending allocation": "Pending allocation", "Phone Number": "Phone Number", "Pick order": "Pick order", "Pickers successfully replaced in the picklist with the new selections.": "Pickers successfully replaced in the picklist with the new selections.", diff --git a/src/locales/es.json b/src/locales/es.json index c7d66aac..a82a4a0b 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -161,6 +161,7 @@ "Order ID": "ID del Pedido", "Order packed successfully": "Pedido empacado exitosamente", "Order packed successfully. Document generation in process": "Order packed successfully. Document generation in process", + "Other shipments in this order": "Other shipments in this order", "Order shipped successfully": "Pedido enviado exitosamente", "Order Shipment ID": "ID de Envío del Pedido", "Order unpacked successfully": "Pedido desempacado exitosamente", @@ -176,6 +177,7 @@ "Pack using default packaging": "Empacar utilizando el empaque predeterminado", "Packed Orders": "Pedidos Empacados", "Password": "Contraseña", + "Pending allocation": "Pending allocation", "Phone Number": "Phone Number", "Pickers successfully replaced in the picklist with the new selections.": "Pickers successfully replaced in the picklist with the new selections.", "picklists": "{count} picklists", diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 88f7af00..be27c1e8 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -8,6 +8,7 @@ import * as types from './mutation-types' import { prepareOrderQuery } from '@/utils/solrHelper' import { UtilService } from '@/services/UtilService' import logger from '@/logger' +import { getOrderCategory } from '@/utils/order' const actions: ActionTree = { @@ -541,12 +542,13 @@ const actions: ActionTree = { commit(types.ORDER_OPEN_QUERY_UPDATED, payload) }, - async fetchShipGroupForOrder({ dispatch }, orderId) { + async fetchShipGroupForOrder({ dispatch }, order) { const params = { groupBy: 'shipGroupSeqId', filters: { + '-shipGroupSeqId': { value: order.items[0].shipGroupSeqId }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, - orderId: { value: orderId } + orderId: { value: order.orderId } }, docType: 'ORDER' } @@ -590,19 +592,19 @@ const actions: ActionTree = { this.dispatch('util/fetchFacilityTypeInformation', facilityTypeIds) // fetching reservation information for shipGroup from OISGIR doc - // return dispatch('fetchAdditionalShipGroupForOrder', { shipGroups, orderId }); - return await dispatch('fetchAdditionalShipGroupForOrder', { shipGroups, orderId }); + await dispatch('fetchAdditionalShipGroupForOrder', { shipGroups, order }); }, async fetchAdditionalShipGroupForOrder({ commit }, payload) { const shipGroupSeqIds = payload.shipGroups.map((shipGroup: any) => shipGroup.shipGroupSeqId) - const orderId = payload.orderId + const orderId = payload.order.orderId const params = { groupBy: 'shipGroupSeqId', filters: { 'shipGroupSeqId': { value: shipGroupSeqIds }, '-shipmentMethodTypeId': { value: 'STOREPICKUP' }, + '-fulfillmentStatus': { value: ['Rejected', 'Cancelled'] }, orderId: { value: orderId } } } @@ -630,9 +632,10 @@ const actions: ActionTree = { return reservedShipGroup ? { ...shipGroup, + items: reservedShipGroupForOrder.doclist.docs, carrierPartyId: reservedShipGroup.carrierPartyId, shipmentId: reservedShipGroup.shipmentId, - groupCategory: '', // category defines that the order is in which state like open, inProgress or completed + groupCategory: getOrderCategory(payload.order), // category defines that the order is in which state like open, inProgress or completed } : { ...shipGroup } @@ -662,6 +665,10 @@ const actions: ActionTree = { logger.error('Failed to fetch information for ship groups', err) } + payload.order['shipGroups'] = shipGroups + + commit(types.ORDER_CURRENT_UPDATED, { order: payload.order }) + return shipGroups; }, @@ -669,6 +676,7 @@ const actions: ActionTree = { async updateCurrent ({ commit, dispatch }, payload) { commit(types.ORDER_CURRENT_UPDATED, { order: payload }) await dispatch('fetchShippingAddress', payload); + dispatch('fetchShipGroupForOrder', payload) }, } diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index aee8cf5e..c6b1b1a3 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -153,28 +153,28 @@ - {{ 'Other shipments in this order' }} - - + {{ translate('Other shipments in this order') }} + +
-

{{ getfacilityTypeDesc(shipGroup.facilityTypeId) }}

-

{{ shipGroup.facilityName }}

+ {{ getfacilityTypeDesc(shipGroup.facilityTypeId) }} + {{ shipGroup.facilityName }}
- {{ shipGroup.category ? shipGroup.category : 'Pending allocation' }} -
+ {{ shipGroup.category ? shipGroup.category : translate('Pending allocation') }} + - - {{ shipGroup.carrierPartyId ? getPartyName(shipGroup.carrierPartyId) : '_NA_' }} + + {{ getPartyName(shipGroup.carrierPartyId) }} {{ shipGroup.trackingCode }} - +

{{ translate("Handling Instructions") }}

-

{{ shipGroup.shippingInstructions ? shipGroup.shippingInstructions : 'Sample Handling instructions' }}

+

{{ shipGroup.shippingInstructions }}

@@ -214,6 +214,9 @@ import { IonBackButton, IonButton, IonCard, + IonCardHeader, + IonCardSubtitle, + IonCardTitle, IonChip, IonContent, IonHeader, @@ -279,6 +282,9 @@ export default defineComponent({ IonButton, IonCard, IonChip, + IonCardHeader, + IonCardSubtitle, + IonCardTitle, IonContent, IonHeader, IonIcon, @@ -318,13 +324,11 @@ export default defineComponent({ picklists: [] as any, addingBoxForOrderIds: [] as any, defaultShipmentBoxType: '', - itemsIssueSegmentSelected: [] as any, - shipGroups: [] as any + itemsIssueSegmentSelected: [] as any } }, async ionViewDidEnter() { this.orderCategory = getOrderCategory(this.order.items[0]) - this.shipGroups = await this.store.dispatch('order/fetchShipGroupForOrder', this.order.orderId) as any; }, methods: { async openShipmentBoxPopover(ev: Event, item: any, order: any) {