From e8f3708572831b156e71345a844d311ec4caca94 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Wed, 26 Jul 2023 18:55:09 +0530 Subject: [PATCH 01/14] Implemented: Ion select for box type selection --- src/views/BoxTypePopover.vue | 56 ++++++++++++++++++++++++++++++++++++ src/views/InProgress.vue | 17 +++++++++-- 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 src/views/BoxTypePopover.vue diff --git a/src/views/BoxTypePopover.vue b/src/views/BoxTypePopover.vue new file mode 100644 index 00000000..a224c525 --- /dev/null +++ b/src/views/BoxTypePopover.vue @@ -0,0 +1,56 @@ + + + \ No newline at end of file diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 851ed8c6..a2edcc0f 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -68,7 +68,11 @@
{{ $t("Add Box") }} - {{ getShipmentPackageNameAndType(shipmentPackage, order) }} + {{ getShipmentPackageName(shipmentPackage, order) }} | + + {{ boxType }} + +
@@ -759,9 +763,16 @@ export default defineComponent({ } this.addingBoxForOrderIds.splice(this.addingBoxForOrderIds.indexOf(order.orderId), 1) }, - getShipmentPackageNameAndType(shipmentPackage: any, order: any) { + getShipmentPackageType(shipmentPackage: any, order: any) { // TODO - return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `Box ${shipmentPackage.packageName} | ${order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]}` : '' + return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `${order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]}` : '' + }, + getShipmentPackageName(shipmentPackage: any, order: any) { + // TODO + return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `Box ${shipmentPackage.packageName}` : '' + }, + getShipmentBoxTypes(shipmentPackage: any, order: any){ + return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] : [] }, async updateQueryString(queryString: string) { const inProgressOrdersQuery = JSON.parse(JSON.stringify(this.inProgressOrders.query)) From a3b777828a2a4266accaae6ccfb956894df53fe2 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Thu, 27 Jul 2023 14:34:00 +0530 Subject: [PATCH 02/14] Implemented: box type change functionalty in progress tab --- src/views/InProgress.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index a2edcc0f..43401801 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -65,11 +65,11 @@
- +
{{ $t("Add Box") }} {{ getShipmentPackageName(shipmentPackage, order) }} | - + {{ boxType }} @@ -506,9 +506,11 @@ export default defineComponent({ form.append(`${prefix}_newShipmentId_${index}`, shipmentPackage.shipmentId) } + const shipmentBoxTypeId = shipmentPackage.newBoxType ? shipmentPackage.newBoxType : order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]; + form.append(`box_shipmentId_${index}`, item.shipmentId) form.append(`${index}_box_rowSubmit`, ''+index) - form.append(`box_shipmentBoxTypeId_${index}`, order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]) + form.append(`box_shipmentBoxTypeId_${index}`, shipmentBoxTypeId) form.append(`${prefix}_shipmentId_${index}`, item.shipmentId) form.append(`${prefix}_shipmentItemSeqId_${index}`, item.shipmentItemSeqId) form.append(`${index}_${prefix}_rowSubmit_`, ''+index) @@ -764,11 +766,12 @@ export default defineComponent({ this.addingBoxForOrderIds.splice(this.addingBoxForOrderIds.indexOf(order.orderId), 1) }, getShipmentPackageType(shipmentPackage: any, order: any) { - // TODO + if(shipmentPackage.newBoxType){ + return shipmentPackage.newBoxType; + } return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `${order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]}` : '' }, getShipmentPackageName(shipmentPackage: any, order: any) { - // TODO return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `Box ${shipmentPackage.packageName}` : '' }, getShipmentBoxTypes(shipmentPackage: any, order: any){ @@ -796,6 +799,11 @@ export default defineComponent({ picklist.isGeneratingPicklist = true; await OrderService.printPicklist(picklist.id) picklist.isGeneratingPicklist = false; + }, + onBoxTypeChange(value: string, shipmentPackage: any, order: any){ + shipmentPackage.newBoxType = value; + order.isModified = true; + this.store.dispatch('order/updateInProgressOrder', order) } }, async mounted () { From 3387f7a5b0038e613bea9a51923c2294313ac569 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Thu, 27 Jul 2023 14:40:21 +0530 Subject: [PATCH 03/14] Improved: deleted unnecessary file --- src/views/BoxTypePopover.vue | 56 ------------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 src/views/BoxTypePopover.vue diff --git a/src/views/BoxTypePopover.vue b/src/views/BoxTypePopover.vue deleted file mode 100644 index a224c525..00000000 --- a/src/views/BoxTypePopover.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - \ No newline at end of file From ce8b2387f7c100fe02c248332eef7c6b2bc7f9b9 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Mon, 31 Jul 2023 16:21:54 +0530 Subject: [PATCH 04/14] Implemented: chnaged boxtype to show using shipmentBoxtypeId property in shipment pacakges instead of 0th index of boxtypes and improved the boxtype change functionality --- src/views/InProgress.vue | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 44d281c0..f2ecf192 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -489,7 +489,7 @@ export default defineComponent({ this.itemsIssueSegmentSelected = [] await this.store.dispatch('order/findInProgressOrders') }, - async updateOrder(order: any) { + async updateOrder(order: any) { const form = new FormData() form.append('facilityId', this.currentFacility.facilityId) @@ -507,11 +507,9 @@ export default defineComponent({ form.append(`${prefix}_newShipmentId_${index}`, shipmentPackage.shipmentId) } - const shipmentBoxTypeId = shipmentPackage.newBoxType ? shipmentPackage.newBoxType : order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]; - form.append(`box_shipmentId_${index}`, item.shipmentId) form.append(`${index}_box_rowSubmit`, ''+index) - form.append(`box_shipmentBoxTypeId_${index}`, shipmentBoxTypeId) + form.append(`box_shipmentBoxTypeId_${index}`, shipmentPackage.shipmentBoxTypeId) form.append(`${prefix}_shipmentId_${index}`, item.shipmentId) form.append(`${prefix}_shipmentItemSeqId_${index}`, item.shipmentItemSeqId) form.append(`${index}_${prefix}_rowSubmit_`, ''+index) @@ -767,10 +765,11 @@ export default defineComponent({ this.addingBoxForOrderIds.splice(this.addingBoxForOrderIds.indexOf(order.orderId), 1) }, getShipmentPackageType(shipmentPackage: any, order: any) { - if(shipmentPackage.newBoxType){ - return shipmentPackage.newBoxType; + const packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) : ''; + if(packageType === undefined){ + return ''; } - return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0] : '' + return packageType; }, getShipmentPackageName(shipmentPackage: any, order: any) { return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `Box ${shipmentPackage.packageName}` : '' @@ -802,9 +801,9 @@ export default defineComponent({ picklist.isGeneratingPicklist = false; }, onBoxTypeChange(value: string, shipmentPackage: any, order: any){ - shipmentPackage.newBoxType = value; + shipmentPackage.shipmentBoxTypeId = value; order.isModified = true; - this.store.dispatch('order/updateInProgressOrder', order) + this.store.dispatch('order/updateInProgressOrder', order); } }, async mounted () { From d7a0fee79bc62a83b2d301d91fb7676610e008a2 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Wed, 9 Aug 2023 11:49:36 +0530 Subject: [PATCH 05/14] Implemented: used ion-no-padding instead of inline style --- src/views/InProgress.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index f2ecf192..15e848a4 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -65,11 +65,11 @@
- +
{{ $t("Add Box") }} {{ getShipmentPackageName(shipmentPackage, order) }} | - + {{ boxTypeDesc(boxType) }} @@ -489,7 +489,7 @@ export default defineComponent({ this.itemsIssueSegmentSelected = [] await this.store.dispatch('order/findInProgressOrders') }, - async updateOrder(order: any) { + async updateOrder(order: any) { const form = new FormData() form.append('facilityId', this.currentFacility.facilityId) From c793de2a0734e9fa787ce0786ecb1c9b270b7f09 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Thu, 10 Aug 2023 10:48:47 +0530 Subject: [PATCH 06/14] Implemented: added a check if there is no boxtype then don't show box chip --- src/views/InProgress.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 1be83ff1..1750d306 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -72,7 +72,7 @@
{{ $t("Add Box") }} - {{ getShipmentPackageName(shipmentPackage, order) }} | + {{ `Box ${shipmentPackage?.packageName}` }} | {{ boxTypeDesc(boxType) }} @@ -806,15 +806,15 @@ export default defineComponent({ this.addingBoxForOrderIds.splice(this.addingBoxForOrderIds.indexOf(order.orderId), 1) }, getShipmentPackageType(shipmentPackage: any, order: any) { - const packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) : ''; - if(packageType === undefined){ - return ''; + let packageType = ''; + if(order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId]){ + packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId); + if(!packageType){ + packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]; + } } return packageType; }, - getShipmentPackageName(shipmentPackage: any, order: any) { - return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? `Box ${shipmentPackage.packageName}` : '' - }, getShipmentBoxTypes(shipmentPackage: any, order: any){ return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] : [] }, From 878d97f6ed998b4b5d2445ed0d0b6cda8dd703fa Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Mon, 14 Aug 2023 18:45:01 +0530 Subject: [PATCH 07/14] Improved: box type change function name --- src/views/InProgress.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 1750d306..d33f54d7 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -73,7 +73,7 @@ {{ $t("Add Box") }} {{ `Box ${shipmentPackage?.packageName}` }} | - + {{ boxTypeDesc(boxType) }} @@ -807,11 +807,8 @@ export default defineComponent({ }, getShipmentPackageType(shipmentPackage: any, order: any) { let packageType = ''; - if(order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId]){ - packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId); - if(!packageType){ - packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]; - } + if(order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].length){ + packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) : order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]; } return packageType; }, @@ -842,7 +839,7 @@ export default defineComponent({ await OrderService.printPicklist(picklist.id) picklist.isGeneratingPicklist = false; }, - onBoxTypeChange(value: string, shipmentPackage: any, order: any){ + updateShipmentBoxType(value: string, shipmentPackage: any, order: any){ shipmentPackage.shipmentBoxTypeId = value; order.isModified = true; this.store.dispatch('order/updateInProgressOrder', order); From c53376fe9f008cb964325322f1c65318be95a0eb Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Wed, 16 Aug 2023 11:03:33 +0530 Subject: [PATCH 08/14] Implemented: logic to get shipment box types in order actions instead of in progress view --- src/store/modules/order/actions.ts | 31 +++++++++++++++++++----------- src/views/InProgress.vue | 15 ++++++--------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 3979b881..9f289d58 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -90,22 +90,31 @@ const actions: ActionTree = { }) const orderItem = order.items[0]; - const carrierPartyIds = [...new Set(orderShipmentIds.map((id: any) => carrierPartyIdsByShipment[id]?.map((carrierParty: any) => carrierParty.carrierPartyId)).flat())] + const carrierPartyIds = [...new Set(orderShipmentIds.map((id: any) => carrierPartyIdsByShipment[id]?.map((carrierParty: any) => carrierParty.carrierPartyId)).flat())]; + + const shipmentBoxTypeByCarrierParty = carrierPartyIds.reduce((shipmentBoxType: any, carrierPartyId: any) => { + if(shipmentBoxType[carrierPartyId]) { + shipmentBoxType[carrierPartyId].push(carrierShipmentBoxType[carrierPartyId]) + } else { + shipmentBoxType[carrierPartyId] = carrierShipmentBoxType[carrierPartyId] + } + + return shipmentBoxType + }, {}); + + const shipmentPackages = shipmentPackagesByOrderAndPicklistBin[`${orderItem.orderId}_${orderItem.picklistBinId}`].map((shipmentPackage: any) => { + return { + ...shipmentPackage, + shipmentBoxTypes: shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] : [] + } + }); return { ...order, shipmentIds: shipmentIdsForOrderAndPicklistBin[`${orderItem.orderId}_${orderItem.picklistBinId}`], - shipmentPackages: shipmentPackagesByOrderAndPicklistBin[`${orderItem.orderId}_${orderItem.picklistBinId}`], + shipmentPackages: shipmentPackages, carrierPartyIds, - shipmentBoxTypeByCarrierParty: carrierPartyIds.reduce((shipmentBoxType: any, carrierPartyId: any) => { - if(shipmentBoxType[carrierPartyId]) { - shipmentBoxType[carrierPartyId].push(carrierShipmentBoxType[carrierPartyId]) - } else { - shipmentBoxType[carrierPartyId] = carrierShipmentBoxType[carrierPartyId] - } - - return shipmentBoxType - }, {}) + shipmentBoxTypeByCarrierParty: shipmentBoxTypeByCarrierParty } }) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index d33f54d7..f22c53eb 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -72,9 +72,9 @@
{{ $t("Add Box") }} - {{ `Box ${shipmentPackage?.packageName}` }} | - - {{ boxTypeDesc(boxType) }} + {{ `Box ${shipmentPackage?.packageName}` }} | + + {{ boxTypeDesc(boxType) }} @@ -805,16 +805,13 @@ export default defineComponent({ } this.addingBoxForOrderIds.splice(this.addingBoxForOrderIds.indexOf(order.orderId), 1) }, - getShipmentPackageType(shipmentPackage: any, order: any) { + getShipmentPackageType(shipmentPackage: any) { let packageType = ''; - if(order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].length){ - packageType = order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId].find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) : order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId][0]; + if(shipmentPackage.shipmentBoxTypes.length){ + packageType = shipmentPackage.shipmentBoxTypes.find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) ? shipmentPackage.shipmentBoxTypes.find((boxType: string) => boxType === shipmentPackage.shipmentBoxTypeId) : shipmentPackage.shipmentBoxTypes[0]; } return packageType; }, - getShipmentBoxTypes(shipmentPackage: any, order: any){ - return order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] ? order.shipmentBoxTypeByCarrierParty[shipmentPackage.carrierPartyId] : [] - }, async updateQueryString(queryString: string) { const inProgressOrdersQuery = JSON.parse(JSON.stringify(this.inProgressOrders.query)) From 35a00a577a5e443829fda7a5c4fd66559a39d186 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 11 Oct 2023 14:55:08 +0530 Subject: [PATCH 09/14] Improved: formatting and removed unwanted todo(#221) --- src/views/InProgress.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 57ac7320..5f1f332a 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -74,13 +74,12 @@
-
{{ $t("Add Box") }} {{ `Box ${shipmentPackage?.packageName}` }} | - {{ boxTypeDesc(boxType) }} + {{ boxTypeDesc(boxType) }} @@ -898,7 +897,7 @@ export default defineComponent({ await OrderService.printPicklist(picklist.id) picklist.isGeneratingPicklist = false; }, - updateShipmentBoxType(value: string, shipmentPackage: any, order: any){ + updateShipmentBoxType(value: string, shipmentPackage: any, order: any) { shipmentPackage.shipmentBoxTypeId = value; order.isModified = true; this.store.dispatch('order/updateInProgressOrder', order); From 240c0521d6ae07b71d09cb248539693b2beee013 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 11 Oct 2023 16:48:04 +0530 Subject: [PATCH 10/14] Improved: UI to add a popover for box type and updated the logic to change the box type(#221) --- src/components/ShipmentBoxTypePopover.vue | 43 +++++++++++++++++++++++ src/views/InProgress.vue | 43 +++++++++++++++++------ 2 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 src/components/ShipmentBoxTypePopover.vue diff --git a/src/components/ShipmentBoxTypePopover.vue b/src/components/ShipmentBoxTypePopover.vue new file mode 100644 index 00000000..cb2e81ae --- /dev/null +++ b/src/components/ShipmentBoxTypePopover.vue @@ -0,0 +1,43 @@ + + + \ No newline at end of file diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 5f1f332a..6d5b7069 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -77,10 +77,9 @@
{{ $t("Add Box") }} - {{ `Box ${shipmentPackage?.packageName}` }} | - - {{ boxTypeDesc(boxType) }} - + + {{ `Box ${shipmentPackage?.packageName}` }} | {{ boxTypeDesc(getShipmentPackageType(shipmentPackage)) }} +
@@ -237,6 +236,7 @@ import { import { defineComponent } from 'vue'; import { addOutline, + caretDownOutline, checkmarkDoneOutline, cubeOutline, ellipsisVerticalOutline, @@ -261,6 +261,7 @@ import logger from '@/logger'; import { UserService } from '@/services/UserService'; import { Actions, hasPermission } from '@/authorization' import EditPickersModal from '@/components/EditPickersModal.vue'; +import ShipmentBoxTypePopover from '@/components/ShipmentBoxTypePopover.vue' export default defineComponent({ name: 'InProgress', @@ -598,6 +599,14 @@ export default defineComponent({ const items = JSON.parse(JSON.stringify(order.items)); + // creating updated data for shipment packages + order.shipmentPackages.map((shipmentPackage: any, index: number) => { + form.append(`box_shipmentId_${index}`, shipmentPackage.shipmentId) + form.append(`${index}_box_rowSubmit`, ''+index) + form.append(`box_shipmentBoxTypeId_${index}`, shipmentPackage.shipmentBoxTypeId) + }) + + // creating updated data for items items.map((item: any, index: number) => { const shipmentPackage = order.shipmentPackages.find((shipmentPackage: any) => shipmentPackage.packageName === item.selectedBox) @@ -609,9 +618,6 @@ export default defineComponent({ form.append(`${prefix}_newShipmentId_${index}`, shipmentPackage.shipmentId) } - form.append(`box_shipmentId_${index}`, item.shipmentId) - form.append(`${index}_box_rowSubmit`, ''+index) - form.append(`box_shipmentBoxTypeId_${index}`, shipmentPackage.shipmentBoxTypeId) form.append(`${prefix}_shipmentId_${index}`, item.shipmentId) form.append(`${prefix}_shipmentItemSeqId_${index}`, item.shipmentItemSeqId) form.append(`${index}_${prefix}_rowSubmit_`, ''+index) @@ -897,10 +903,24 @@ export default defineComponent({ await OrderService.printPicklist(picklist.id) picklist.isGeneratingPicklist = false; }, - updateShipmentBoxType(value: string, shipmentPackage: any, order: any) { - shipmentPackage.shipmentBoxTypeId = value; - order.isModified = true; - this.store.dispatch('order/updateInProgressOrder', order); + async updateShipmentBoxType(shipmentPackage: any, order: any, ev: CustomEvent) { + + const popover = await popoverController.create({ + component: ShipmentBoxTypePopover, + event: ev, + showBackdrop: false, + componentProps: { shipmentPackage } + }); + + popover.present(); + + const result = await popover.onDidDismiss(); + + if(result.data) { + shipmentPackage.shipmentBoxTypeId = result.data; + order.isModified = true; + this.store.dispatch('order/updateInProgressOrder', order); + } }, async recycleInProgressOrders() { const alert = await alertController.create({ @@ -973,6 +993,7 @@ export default defineComponent({ return { Actions, + caretDownOutline, copyToClipboard, cubeOutline, addOutline, From 8465b883b3782a1a70e35720f0bdab02ba479372 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 11 Oct 2023 18:06:12 +0530 Subject: [PATCH 11/14] Improved: form data to be passed in updateOrder api(#221) --- src/views/InProgress.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 6d5b7069..1746dc21 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -596,6 +596,11 @@ export default defineComponent({ const form = new FormData() form.append('facilityId', this.currentFacility.facilityId) + form.append('orderId', order.orderId) + + order.shipmentIds.map((shipmentId: string) => { + form.append('shipmentIds', shipmentId) + }) const items = JSON.parse(JSON.stringify(order.items)); @@ -623,6 +628,8 @@ export default defineComponent({ form.append(`${index}_${prefix}_rowSubmit_`, ''+index) }) + form.append('picklistBinId', order.picklistBinId) + try { const resp = await OrderService.updateOrder({ headers: { From ccee56a01492fd99e4aa83562d8f20d58ee555c0 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Thu, 12 Oct 2023 12:07:35 +0530 Subject: [PATCH 12/14] Fixed: issue of box type not being updated(#221) --- src/views/InProgress.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 1746dc21..8a6ff022 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -607,7 +607,7 @@ export default defineComponent({ // creating updated data for shipment packages order.shipmentPackages.map((shipmentPackage: any, index: number) => { form.append(`box_shipmentId_${index}`, shipmentPackage.shipmentId) - form.append(`${index}_box_rowSubmit`, ''+index) + form.append(`${index}_box_rowSubmit_`, ''+index) form.append(`box_shipmentBoxTypeId_${index}`, shipmentPackage.shipmentBoxTypeId) }) From a1dd6d0925ff0e8aead1ed54e1faf1e426d6e299 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Thu, 12 Oct 2023 12:22:33 +0530 Subject: [PATCH 13/14] Improved: support to not show box type change popover when types are not available(#221) --- src/views/InProgress.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 8a6ff022..239c461f 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -77,8 +77,8 @@
{{ $t("Add Box") }} - - {{ `Box ${shipmentPackage?.packageName}` }} | {{ boxTypeDesc(getShipmentPackageType(shipmentPackage)) }} + + {{ `Box ${shipmentPackage?.packageName}` }} {{ shipmentPackage.shipmentBoxTypes.length ? `| ${boxTypeDesc(getShipmentPackageType(shipmentPackage))}` : '' }} @@ -912,6 +912,12 @@ export default defineComponent({ }, async updateShipmentBoxType(shipmentPackage: any, order: any, ev: CustomEvent) { + // Don't open popover when not having shipmentBoxTypes available + if(!shipmentPackage.shipmentBoxTypes.length) { + console.error('Failed to fetch shipment box types') + return; + } + const popover = await popoverController.create({ component: ShipmentBoxTypePopover, event: ev, From 0e0d03191622f80f9fbd04d94f3955504cfdab5b Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Thu, 12 Oct 2023 12:25:11 +0530 Subject: [PATCH 14/14] Replaced: console statement with logger(#221) --- src/views/InProgress.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 239c461f..59ca3363 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -914,7 +914,7 @@ export default defineComponent({ // Don't open popover when not having shipmentBoxTypes available if(!shipmentPackage.shipmentBoxTypes.length) { - console.error('Failed to fetch shipment box types') + logger.error('Failed to fetch shipment box types') return; }