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

Fixed: issue of same package being added when clicking add box button multiple times(#198) #199

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const actions: ActionTree<OrderState, RootState> = {
picklistBinId: orderItem.picklistBinId,
items: order.doclist.docs,
shipmentMethodTypeId: orderItem.shipmentMethodTypeId,
shipmentMethodTypeDesc: orderItem.shipmentMethodTypeDesc,
shipmentMethodTypeDesc: orderItem.shipmentMethodTypeDesc
}
})
} else {
Expand Down
8 changes: 6 additions & 2 deletions src/views/InProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</div>
<!-- TODO: implement functionality to change the type of box -->
<div class="box-type desktop-only" v-else-if="order.shipmentPackages">
<ion-button @click="addShipmentBox(order)" fill="outline" shape="round" size="small"><ion-icon :icon="addOutline" />{{ $t("Add Box") }}</ion-button>
<ion-button :disabled="orderBoxes.includes(order.orderId)" @click="addShipmentBox(order)" fill="outline" shape="round" size="small"><ion-icon :icon="addOutline" />{{ $t("Add Box") }}</ion-button>
<ion-chip v-for="shipmentPackage in order.shipmentPackages" :key="shipmentPackage.shipmentId">{{ getShipmentPackageNameAndType(shipmentPackage, order) }}</ion-chip>
</div>

Expand Down Expand Up @@ -247,13 +247,14 @@ export default defineComponent({
rejectReasons: 'util/getRejectReasons',
currentEComStore: 'user/getCurrentEComStore',
userPreference: 'user/getUserPreference'
})
}),
},
data() {
return {
picklists: [] as any,
defaultShipmentBoxType: '',
itemsIssueSegmentSelected: [] as any,
orderBoxes: [] as any
}
},
methods: {
Expand Down Expand Up @@ -711,6 +712,8 @@ export default defineComponent({
return defaultBoxType;
},
async addShipmentBox(order: any) {
this.orderBoxes.push(order.orderId)

const { carrierPartyId, shipmentMethodTypeId } = await this.fetchShipmentRouteSegmentInformation(order.shipmentIds)

if(!this.defaultShipmentBoxType) {
Expand Down Expand Up @@ -739,6 +742,7 @@ export default defineComponent({
showToast(translate('Failed to add box'))
logger.error('Failed to add box', err)
}
this.orderBoxes.splice(this.orderBoxes.indexOf(order.orderId), 1)
},
getShipmentPackageNameAndType(shipmentPackage: any, order: any) {
// TODO
Expand Down
Loading