Skip to content

Commit

Permalink
Merge pull request #494 from R-Sourabh/#459-scan-toast
Browse files Browse the repository at this point in the history
Improvement : toast message to be shown in case of scanning success/failure item(#459)
  • Loading branch information
ravilodhi authored Apr 16, 2024
2 parents fcd06e3 + 100c2d8 commit b49f703
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@
"Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.": "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.",
"Settings": "Settings",
"Set Limit": "Set Limit",
"Scanned item is not present within the order:": "Scanned item is not present within the order: {itemName}",
"Scanned successfully.": "Scanned {itemName} successfully.",
"Selected TimeZone": "Selected TimeZone",
"Select a different time zone": "Select a different time zone",
"Ship": "Ship",
Expand Down
14 changes: 7 additions & 7 deletions src/store/modules/transferorder/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ const actions: ActionTree<TransferOrderState, RootState> = {
},

async updateOrderProductCount({ commit, state }, payload ) {

state.current.items.find((item: any) => {
if (item.internalName === payload) {
item.pickedQuantity = parseInt(item.pickedQuantity) + 1;
}
});
commit(types.ORDER_CURRENT_UPDATED, state.current )
const item = state.current.items.find((item: any) => item.internalName === payload);
if(item){
item.pickedQuantity = parseInt(item.pickedQuantity) + 1;
commit(types.ORDER_CURRENT_UPDATED, state.current )
return { isProductFound: true }
}
return { isProductFound: false }
},

async updateCurrentTransferOrder({ commit }, payload) {
Expand Down
16 changes: 13 additions & 3 deletions src/views/TransferOrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,20 @@
getShippedQuantity(item: any) {
return this.currentOrder?.shippedQuantityInfo?.[item.orderItemSeqId] ? this.currentOrder?.shippedQuantityInfo?.[item.orderItemSeqId] : 0;
},
updateProductCount(payload: any) {
if (this.queryString) payload = this.queryString
this.store.dispatch('transferorder/updateOrderProductCount', payload)
async updateProductCount(payload: any) {
if (this.queryString) {
payload = this.queryString;
}
const result = await this.store.dispatch('transferorder/updateOrderProductCount', payload);
if (result.isProductFound) {
showToast(translate("Scanned successfully.", { itemName: payload }));
} else {
showToast(translate("Scanned item is not present within the order:", { itemName: payload }));
}
},
async scanCode () {
const modal = await modalController
.create({
Expand Down

0 comments on commit b49f703

Please sign in to comment.