Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: support to reject and cancel items from open and packed detail pages and revamped the detail page UI(#472) #477

Merged
merged 30 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
322a365
Implemented: support to fetch additional info for order and display t…
ymaheshwari1 Dec 31, 2024
fe566e9
Added: payment details card and moved the customer info card(#472)
ymaheshwari1 Dec 31, 2024
d55ff82
Improved: styling for the card and timeline components(#472)
ymaheshwari1 Dec 31, 2024
2f7465f
Implemented: support to reject order item from the details page(#472)
ymaheshwari1 Jan 2, 2025
8957dec
Fixed: print picklist button in header to call correct method(#472)
ymaheshwari1 Jan 2, 2025
05016fb
Implemented: order item cancel flow for packed orders(#472)
ymaheshwari1 Jan 3, 2025
9db8546
Implemented: supoprt to display order status once order is shipping/h…
ymaheshwari1 Jan 3, 2025
056e960
Improved: code to handle the case to not display reject/cancel button…
ymaheshwari1 Jan 3, 2025
c26f66c
Implemented: support to fetch job and shopify config details and disp…
ymaheshwari1 Jan 3, 2025
68b6865
Improved: timeline to show picker info as soon as picklist is created…
ymaheshwari1 Jan 6, 2025
e4cec4d
Implemented: support to display order status beside the timeline(#472)
ymaheshwari1 Jan 6, 2025
e1535e9
Improved: styling for the order line item on detail page(#472)
ymaheshwari1 Jan 7, 2025
f3f8cf5
Improved: code to handle the showKitComponents logic on item level, p…
ymaheshwari1 Jan 8, 2025
fcf3c8a
Improved: date formatting inside the cancel confirm modal(#472)
ymaheshwari1 Jan 8, 2025
b0f4944
Improved: code to pass reason map when cancelling order item(#472)
ymaheshwari1 Jan 8, 2025
920a3f1
Implemented: function to prepare the order timeline and fixed issue i…
ymaheshwari1 Jan 9, 2025
6be8f81
Imporved: logic to display correct picklist date and added support to…
ymaheshwari1 Jan 9, 2025
9915d29
Improved: code to sort the timeline once prepared()
ymaheshwari1 Jan 10, 2025
c70c1ee
Removed: unwanted variables, imports and methods those are not used a…
ymaheshwari1 Jan 10, 2025
c96d07d
Improved: logic to not handle the data on UI and update the timeline(…
ymaheshwari1 Jan 13, 2025
2e272fa
Fixed: typo when checking for order status(#472)
ymaheshwari1 Jan 13, 2025
3e07019
Removed: logic to use the state current/list to display the current o…
ymaheshwari1 Jan 13, 2025
41a193c
Improved: code to add some checks to remove console errors(#472)
ymaheshwari1 Jan 13, 2025
88875bf
Improved: deliverShipment method to display an alert before completin…
ymaheshwari1 Jan 13, 2025
bea0ed8
Removed: console statements(#472)
ymaheshwari1 Jan 13, 2025
7b54dd3
Removed: unused import components and added a loader on confirming ca…
ymaheshwari1 Jan 13, 2025
39ae51c
Added: static text in the locales file(#472)
ymaheshwari1 Jan 13, 2025
265b088
Improved: condition for fetching open orders by refering list page co…
ymaheshwari1 Jan 13, 2025
0784a3e
Removed: commented code(#472)
ymaheshwari1 Jan 13, 2025
406e612
Updated: static text in locale file(#472)
ymaheshwari1 Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved: deliverShipment method to display an alert before completin…
…g the action and updated the fab icon for mobile view(#472)
  • Loading branch information
ymaheshwari1 committed Jan 13, 2025
commit 88875bf40428b3358a4e87c1ea616e8e4917deb6
47 changes: 34 additions & 13 deletions src/views/OrderDetailUpdated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
</ion-label>
</ion-item>

<ion-item lines="none" v-for="item in shipGroup.items" :key="item">
<ion-item lines="none" v-for="item in shipGroup?.items" :key="item">
<ion-thumbnail slot="start">
<DxpShopifyImg :src="getProduct(item.productId).mainImageUrl" size="small"/>
</ion-thumbnail>
Expand Down Expand Up @@ -305,7 +305,7 @@
</ion-fab>
<ion-fab v-else-if="orderType === 'packed' && order?.orderId" class="ion-hide-md-up" vertical="bottom" horizontal="end" slot="fixed" >
<ion-fab-button :disabled="!hasPermission(Actions.APP_ORDER_UPDATE) || order.handovered || order.shipped || order.cancelled" @click="deliverShipment(order)">
<ion-icon :icon="order.part?.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP' ? accessibilityOutline : checkmarkOutline" />
<ion-icon :icon="checkmarkDoneOutline" />
</ion-fab-button>
</ion-fab>
</ion-content>
Expand Down Expand Up @@ -345,15 +345,13 @@ import {
import { computed, defineComponent } from "vue";
import { mapGetters, useStore } from "vuex";
import {
accessibilityOutline,
callOutline,
cashOutline,
copyOutline,
closeOutline,
closeCircleOutline,
checkmarkCircleOutline,
checkmarkDoneOutline,
checkmarkOutline,
cubeOutline,
giftOutline,
informationCircleOutline,
Expand Down Expand Up @@ -478,9 +476,31 @@ export default defineComponent({
return assignPickerModal.present();
},
async deliverShipment(order: any) {
await this.store.dispatch('order/deliverShipment', order)
// Update the order timeline once the order is delivered/handovered
this.prepareOrderTimeline();
const pickup = order.part?.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP';
const header = pickup ? translate("Handover") : translate("Ship");
const message = pickup ? translate("Verify that the items in the package are valid and the customer has received their order. Once the order is handed over to the customer it cannot be undone.", { space: '<br/><br/>' }) : '';

const alert = await alertController
.create({
header,
message,
buttons: [{
text: translate('Cancel'),
role: 'cancel'
}, {
text: translate(header),
handler: async () => {
await this.store.dispatch('order/deliverShipment', order).then((resp: any) => {
if(!hasError(resp)) {
// Update order timeline once the order is completed
// Sending statusId explicitly as we do not fetch the order info again on handover
this.prepareOrderTimeline({ statusId: "ORDER_COMPLETED" });
}
})
}
}]
});
return alert.present();
},
async openOrderItemRejHistoryModal() {
const orderItemRejHistoryModal = await modalController.create({
Expand Down Expand Up @@ -1005,13 +1025,16 @@ export default defineComponent({
return a[sortOnField] - b[sortOnField]
})
},
async prepareOrderTimeline() {
async prepareOrderTimeline(paramsToUpdate ?: any) {
const timeline = []

const {orderRouteSegment, shipmentStatusInfo} = await this.fetchOrderRouteSegmentInfo();

// Get order status using utility method
this.orderStatus = this.getOrderStatus(this.order, this.order.part, orderRouteSegment)
this.orderStatus = this.getOrderStatus({
...this.order,
...paramsToUpdate
}, this.order.part, orderRouteSegment)

let orderChangeHistory = await this.fetchOrderChangeHistory();
const orderPickupEmailCommnicationEvent = await this.fetchOrderCommunicationEvent();
Expand Down Expand Up @@ -1186,9 +1209,9 @@ export default defineComponent({

if(this.orderType === "packed") {
this.fetchJobs();
this.hasCancelledItems = this.order.part.items.some((item: any) => item.cancelReason);
this.hasCancelledItems = this.order.part?.items.some((item: any) => item.cancelReason);
} else if(this.orderType === "open") {
this.hasRejectedItems = this.order.part.items.some((item: any) => item.rejectReason);
this.hasRejectedItems = this.order.part?.items.some((item: any) => item.rejectReason);
}

await this.prepareOrderTimeline();
Expand All @@ -1205,7 +1228,6 @@ export default defineComponent({

return {
Actions,
accessibilityOutline,
bagCheckOutline,
bagHandleOutline,
bagRemoveOutline,
Expand All @@ -1218,7 +1240,6 @@ export default defineComponent({
closeOutline,
checkmarkCircleOutline,
checkmarkDoneOutline,
checkmarkOutline,
chevronUpOutline,
cubeOutline,
currentFacility,
Expand Down
Loading