Skip to content

Commit

Permalink
Merge pull request #509 from amansinghbais/#507
Browse files Browse the repository at this point in the history
Improved: showing alert on scanning counted items and autofocusing input on confirming for recount (#507)
  • Loading branch information
ravilodhi authored Nov 12, 2024
2 parents 6575704 + 4a71209 commit 901cc7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/views/CountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<aside class="filters">
<div class="fixed-section">
<ion-item lines="full">
<ion-input :label="translate('Scan items')" :placeholder="translate('Scan or search products')" @ionFocus="selectSearchBarText($event)" v-model="queryString" @keyup.enter="scanProduct()"/>
<ion-input :label="translate('Scan items')" :placeholder="translate('Scan or search products')" ref="barcodeInput" @ionFocus="selectSearchBarText($event)" v-model="queryString" @keyup.enter="scanProduct()"/>
</ion-item>
<ion-segment v-model="selectedSegment" @ionChange="updateFilteredItems()">
<template v-if="cycleCount?.statusId === 'INV_COUNT_ASSIGNED'">
Expand Down Expand Up @@ -292,6 +292,7 @@ const isLastItem = ref(false);
const isScrolling = ref(false);
let previousItem = {};
let hasUnsavedChanges = ref(false);
const barcodeInput = ref();
onIonViewDidEnter(async() => {
await fetchCycleCount();
Expand Down Expand Up @@ -426,6 +427,8 @@ async function scanProduct() {
if((!selectedItem.quantity && selectedItem.quantity !== 0) || product.value.isRecounting) {
hasUnsavedChanges.value = true;
inputCount.value++
} else if(selectedItem.quantity >= 0 && selectedItem.itemStatusId !== "INV_COUNT_REJECTED" && selectedItem.itemStatusId !== "INV_COUNT_COMPLETED") {
this.openRecountAlert()
}
}
queryString.value = ""
Expand Down Expand Up @@ -581,6 +584,9 @@ async function openRecountAlert() {
}]
});
await alert.present();
alert.onDidDismiss().then(() => {
barcodeInput.value.$el.setFocus();
})
}
async function openRecountSaveAlert() {
Expand Down

0 comments on commit 901cc7b

Please sign in to comment.