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 add picker for ready to pick orders(#85zrnzf31) #187

Merged
merged 20 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b456270
implemented: support to add picker for ready to pick orders(#85zrnzf31)
disha1202 Feb 23, 2023
1a1e49c
updated: variable name(#85zrnzf31)
disha1202 Feb 24, 2023
efd6cfb
updated: variable name(#85zrnzf31)
disha1202 Feb 24, 2023
a6dc371
implemented: infinite scroll in assignPickerModal
disha1202 Feb 27, 2023
28df18a
Updated: api for create picklist(#85zrnzf31)
disha1202 Mar 1, 2023
9157c9b
Moved configure picker card from oms settings to app settings(#85zrnz…
disha1202 Mar 1, 2023
7d7e128
fix: picker not selected(#85zrnzf31)
disha1202 Mar 1, 2023
7073c7b
improved: method name(#85zrnzf31)
disha1202 Mar 1, 2023
cd35473
reverted unwanted changes(#85zrnzf31)
disha1202 Mar 1, 2023
df169db
updated: label for assign picker modal(#85zrnzf31)
disha1202 Mar 2, 2023
a57d942
fix: search in assign picker modal(#85zrnzf31)
disha1202 Mar 2, 2023
21880ed
reverted unwanted changes(#85zrnzf31)
disha1202 Mar 2, 2023
aff934f
Added text in en.json and removed unwanted code(#85zrnzf31)
disha1202 Mar 2, 2023
a04dbbd
updated code(#85zrnzf31)
disha1202 Mar 2, 2023
3e9ea4d
removed picklist state and improved method names(#85zrnzf31)
disha1202 Mar 2, 2023
7086850
Updated orderService(#85zrnzf31)
disha1202 Mar 2, 2023
5386861
Merge branch 'main' of https://github.com/hotwax/bopis into #85zrnzf31
disha1202 Mar 2, 2023
640a6b2
Updated condition for packShipGroupItems(#85zrnzf31)
disha1202 Mar 2, 2023
7792412
improved code(#85zrnzf31)
disha1202 Mar 2, 2023
d3fde2e
improved code(#85zrnzf31)
disha1202 Mar 2, 2023
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
7 changes: 7 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"All items were canceled from the order": "All items were canceled from the order",
"An email notification will be sent to that their order is ready for pickup. This order will also be moved to the packed orders tab.": "An email notification will be sent to { customerName } that their order is ready for pickup.{ space } This order will also be moved to the packed orders tab.",
"Are you sure you want to change the time zone to?": "Are you sure you want to change the time zone to?",
"Assign Pickers": "Assign Pickers",
"Catalog": "Catalog",
"Cancel": "Cancel",
"canceled from the order": "canceled from the order",
Expand All @@ -12,6 +13,8 @@
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Color": "Color",
"Completed": "Completed",
"Configure Picker": "Configure Picker",
"Configuration to assign picker to orders.": "Configuration to assign picker to orders.",
"Confirm": "Confirm",
"Copied": "Copied { text }",
"Copy": "Copy",
Expand Down Expand Up @@ -40,6 +43,7 @@
"Not in stock": "Not in stock",
"Not in Stock": "Not in Stock",
"No reason": "No reason",
"No picker found": "No picker found",
"No time zone found": "No time zone found",
"Open": "Open",
"OMS": "OMS",
Expand Down Expand Up @@ -70,6 +74,7 @@
"Select time zone": "Select time zone",
"Select your preferred language.": "Select your preferred language.",
"Settings": "Settings",
"Select a picker": "Select a picker",
"Ship": "Ship",
"Shipping method": "Shipping method",
"Shipping orders": "Shipping orders",
Expand All @@ -79,8 +84,10 @@
"Show shipping orders": "Show shipping orders",
"Size": "Size",
"Something went wrong": "Something went wrong",
"Something went wrong. Picklist can not be created.": "Something went wrong. Picklist can not be created.",
"Specify which facility you want to operate from. Order, inventory and other configuration data will be specific to the facility you select.": "Specify which facility you want to operate from. Order, inventory and other configuration data will be specific to the facility you select.",
"State": "State",
"Staff": "Staff",
"Street": "Street",
"Store": "Store",
"Timezone": "Timezone",
Expand Down
18 changes: 16 additions & 2 deletions src/services/OrderService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { api } from '@/adapter';
import { api, client } from '@/adapter';
import store from '@/store';

const getOpenOrders = async (payload: any): Promise <any> => {
return api({
Expand Down Expand Up @@ -56,12 +57,25 @@ const rejectOrderItem = async (payload: any): Promise <any> => {
});
}

const createPicklist = async (query: any): Promise <any> => {
let baseURL = store.getters['user/getInstanceUrl'];
baseURL = baseURL && baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`;
return client({
url: 'createPicklist',
method: 'POST',
data: query,
baseURL,
headers: { "Content-Type": "multipart/form-data" },
})
}

export const OrderService = {
getOpenOrders,
getOrderDetails,
getCompletedOrders,
getPackedOrders,
quickShipEntireShipGroup,
rejectOrderItem,
updateShipment
updateShipment,
createPicklist
}
16 changes: 16 additions & 0 deletions src/services/PicklistService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { api } from '@/adapter';

const getAvailablePickers = async (query: any): Promise <any> => {
return api({
url: 'performFind',
method: 'POST',
data: query,
cache: true
})
}



export const PicklistService = {
getAvailablePickers
}
1 change: 0 additions & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import orderModule from './modules/order';
import stockModule from "./modules/stock"
import productModule from "./modules/product"


// TODO check how to register it from the components only
// Handle same module registering multiple time on page refresh
//store.registerModule('user', userModule);
Expand Down
46 changes: 43 additions & 3 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,24 @@ const actions: ActionTree<OrderState , RootState> ={
shipmentMethodEnumDesc: item.shipmentMethodTypeDesc
},
items: [{
shipGroupSeqId: item.shipGroupSeqId,
orderId: orderItem.orderId,
orderItemSeqId: item.orderItemSeqId,
productId: item.productId,
facilityId: item.facilityId,
quantity: item.itemQuantity
quantity: item.itemQuantity,
inventoryItemId: item.inventoryItemId
}]
})
} else {
currentOrderPart.items.push({
shipGroupSeqId: item.shipGroupSeqId,
orderId: orderItem.orderId,
orderItemSeqId: item.orderItemSeqId,
productId: item.productId,
facilityId: item.facilityId,
quantity: item.itemQuantity
quantity: item.itemQuantity,
inventoryItemId: item.inventoryItemId
})
}

Expand Down Expand Up @@ -364,9 +370,43 @@ const actions: ActionTree<OrderState , RootState> ={
return await OrderService.updateShipment(params)
},

async quickShipEntireShipGroup ({ state, dispatch, commit }, payload) {
async packShipGroupItems ({ state, dispatch, commit }, payload) {
emitter.emit("presentLoader")

if (store.state.user.preference.configurePicker) {
let resp;

const items = payload.order.parts[0].items;
const formData = new FormData();
formData.append("facilityId", items[0].facilityId);
items.map((item: any, index: number) => {
formData.append("itemStatusId_o_"+index, "PICKITEM_PENDING")
formData.append("pickerIds_o_"+index, payload.selectedPicker)
Object.keys(item).map((property) => {
if(property !== "facilityId") formData.append(property+'_o_'+index, item[property])
})
});

try {
resp = await OrderService.createPicklist(formData);
if (resp.status === 200 && !hasError(resp) && resp.data) {
if(!(resp.data.picklistId && resp.data.picklistBinId)) {
showToast(translate('Something went wrong. Picklist can not be created.'));
emitter.emit("dismissLoader");
return;
}
} else {
showToast(translate('Something went wrong. Picklist can not be created.'));
emitter.emit("dismissLoader");
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (resp.status === 200 && !hasError(resp) && resp.data) {
if(!(resp.data.picklistId && resp.data.picklistBinId)) {
showToast(translate('Something went wrong. Picklist can not be created.'));
emitter.emit("dismissLoader");
return;
}
} else {
showToast(translate('Something went wrong. Picklist can not be created.'));
emitter.emit("dismissLoader");
return;
}
if (resp.status !== 200 || hasError(resp) || !(resp.data.picklistId && resp.data.picklistBinId)) {
showToast(translate('Something went wrong. Picklist can not be created.'));
emitter.emit("dismissLoader");
return;
}

} catch (err) {
showToast(translate('Something went wrong. Picklist can not be created.'));
emitter.emit("dismissLoader");
return;
}
}

const params = {
orderId: payload.order.orderId,
setPackedOnly: 'Y',
Expand Down
3 changes: 3 additions & 0 deletions src/store/modules/user/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const getters: GetterTree <UserState, RootState> = {
showShippingOrders (state) {
return state.preference.showShippingOrders;
},
configurePicker (state) {
return state.preference.configurePicker;
},
showPackingSlip (state) {
return state.preference.showPackingSlip;
},
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const userModule: Module<UserState, RootState> = {
instanceUrl: '',
preference: {
showShippingOrders: true,
showPackingSlip: false
showPackingSlip: false,
configurePicker: false,
},
locale: 'en',
},
Expand Down
Loading