-
Notifications
You must be signed in to change notification settings - Fork 40
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
Improved: logic to show inventory computation of other shipment items in an order (#396) #397
Merged
ravilodhi
merged 3 commits into
hotwax:main
from
amansinghbais:396-other-shipment-inventory
Jun 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
0e62c48
Improved: logic to show inventory computation of other shipment items…
amansinghbais 6b2277e
Merge branch 'main' of https://github.com/hotwax/bopis into 396-other…
amansinghbais 13ad04f
Improved: product details to be shown for other shipment items (#396)
amansinghbais File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,19 +152,27 @@ | |
|
||
<ion-item lines="none" v-for="item in shipGroup.items" :key="item"> | ||
<ion-thumbnail slot="start"> | ||
<ShopifyImg :src="getProduct(item.productId).mainImageUrl" size="small"/> | ||
<DxpShopifyImg :src="getProduct(item.productId).mainImageUrl" size="small"/> | ||
</ion-thumbnail> | ||
<ion-label> | ||
<p class="overline">{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p> | ||
{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the same pattern as used in Product list item card |
||
<p>{{ translate("Color:", { color: getFeature(getProduct(item.productId).featureHierarchy, '1/COLOR') }) }}</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not display color and size, as we not displaying the same in product list item. |
||
<p>{{ translate("Size:", { size: getFeature(getProduct(item.productId).featureHierarchy, '1/SIZE') }) }}</p> | ||
</ion-label> | ||
<!-- TODO: add a spinner if the api takes too long to fetch the stock --> | ||
<ion-note slot="end" v-if="getProductStock(item.productId, item.facilityId).quantityOnHandTotal >= 0">{{ getProductStock(item.productId, item.facilityId).quantityOnHandTotal }} {{ translate('pieces in stock') }}</ion-note> | ||
<ion-button slot="end" fill="clear" v-else size="small" @click.stop="fetchProductStock(item.productId)"> | ||
<ion-icon color="medium" slot="icon-only" :icon="cubeOutline"/> | ||
</ion-button> | ||
|
||
<div slot="end"> | ||
<ion-spinner v-if="item.isFetchingStock" color="medium" name="crescent" /> | ||
<div v-else-if="getProductStock(item.productId).quantityOnHandTotal >= 0" class="atp-info"> | ||
<ion-note slot="end"> {{ translate("on hand", { count: getProductStock(item.productId).quantityOnHandTotal ?? '0' }) }} </ion-note> | ||
<ion-button fill="clear" @click.stop="openInventoryDetailPopover($event, item)"> | ||
<ion-icon slot="icon-only" :icon="informationCircleOutline" color="medium" /> | ||
</ion-button> | ||
</div> | ||
<ion-button v-else fill="clear" @click.stop="fetchProductStock(item.productId, shipGroup.shipGroupSeqId)"> | ||
<ion-icon color="medium" slot="icon-only" :icon="cubeOutline" /> | ||
</ion-button> | ||
</div> | ||
</ion-item> | ||
</ion-card> | ||
</div> | ||
|
@@ -210,12 +218,14 @@ import { | |
IonLabel, | ||
IonNote, | ||
IonRow, | ||
IonSpinner, | ||
IonThumbnail, | ||
IonTitle, | ||
IonToolbar, | ||
IonFab, | ||
IonFabButton, | ||
modalController | ||
modalController, | ||
popoverController | ||
} from "@ionic/vue"; | ||
import { computed, defineComponent } from "vue"; | ||
import { mapGetters, useStore } from "vuex"; | ||
|
@@ -229,6 +239,7 @@ import { | |
checkmarkOutline, | ||
cubeOutline, | ||
giftOutline, | ||
informationCircleOutline, | ||
locateOutline, | ||
mailOutline, | ||
printOutline, | ||
|
@@ -252,6 +263,7 @@ import { getProductIdentificationValue, translate, useProductIdentificationStore | |
import EditPickerModal from "@/components/EditPickerModal.vue"; | ||
import emitter from '@/event-bus' | ||
import logger from "@/logger"; | ||
import InventoryDetailsPopover from '@/components/InventoryDetailsPopover.vue' | ||
|
||
export default defineComponent({ | ||
name: "OrderDetail", | ||
|
@@ -276,6 +288,7 @@ export default defineComponent({ | |
IonLabel, | ||
IonNote, | ||
IonRow, | ||
IonSpinner, | ||
IonThumbnail, | ||
IonTitle, | ||
IonToolbar, | ||
|
@@ -315,8 +328,10 @@ export default defineComponent({ | |
}, | ||
props: ['orderType', 'orderId', 'orderPartSeqId'], | ||
methods: { | ||
async fetchProductStock(productId: string) { | ||
async fetchProductStock(productId: string, shipGroupSeqId: any) { | ||
this.store.dispatch('order/updateOrderItemFetchingStatus', { productId, shipGroupSeqId }) | ||
await this.store.dispatch('stock/fetchStock', { productId }) | ||
this.store.dispatch('order/updateOrderItemFetchingStatus', { productId, shipGroupSeqId }) | ||
}, | ||
async assignPicker(order: any, part: any, facilityId: any) { | ||
const assignPickerModal = await modalController.create({ | ||
|
@@ -477,7 +492,16 @@ export default defineComponent({ | |
}, | ||
async printShippingLabelAndPackingSlip(order: any) { | ||
await OrderService.printShippingLabelAndPackingSlip(order.shipmentId) | ||
} | ||
}, | ||
async openInventoryDetailPopover(Event: any, item: any){ | ||
const popover = await popoverController.create({ | ||
component: InventoryDetailsPopover, | ||
event: Event, | ||
showBackdrop: false, | ||
componentProps: { item } | ||
}); | ||
await popover.present(); | ||
}, | ||
}, | ||
async mounted() { | ||
emitter.emit("presentLoader") | ||
|
@@ -513,6 +537,7 @@ export default defineComponent({ | |
giftOutline, | ||
getFeature, | ||
hasPermission, | ||
informationCircleOutline, | ||
locateOutline, | ||
printOutline, | ||
productIdentificationPref, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding this whole logic, we can simply update the item.isFetchingStock in the component method directly and then directly update the current order.