From daee11eba6b1514aec7d45c481903f3d21068210 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 3 Jan 2025 11:22:24 +0530 Subject: [PATCH 1/5] Implemented: logic to persist the unmatched items in the cycle count (#559) --- src/components/Menu.vue | 2 +- src/store/index.ts | 2 +- src/store/modules/count/CountState.ts | 1 + src/store/modules/count/actions.ts | 14 +++++- src/store/modules/count/getters.ts | 3 ++ src/store/modules/count/index.ts | 3 +- src/store/modules/count/mutation-types.ts | 3 +- src/store/modules/count/mutations.ts | 3 ++ src/views/HardCountDetail.vue | 56 ++++++++++------------- 9 files changed, 49 insertions(+), 38 deletions(-) diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 0bbd41b9..2b3bfa86 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -68,7 +68,7 @@ export default defineComponent({ url: "/draft", iosIcon: createOutline, mdIcon: createOutline, - childRoutes: ["/draft/", "/bulkUpload", "/hard-count", "/hard-count-detail"], + childRoutes: ["/draft/", "/bulkUpload", "/hard-count"], meta: { permissionId: "APP_DRAFT_VIEW" } diff --git a/src/store/index.ts b/src/store/index.ts index 0ef093e6..27b4dce1 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -18,7 +18,7 @@ import { setPermissions } from "@/authorization" const state: any = {} const persistState = createPersistedState({ - paths: ["user", "product.cached"], + paths: ["user", "product.cached", "count.cachedUnmatchedProducts"], fetchBeforeUse: true }) diff --git a/src/store/modules/count/CountState.ts b/src/store/modules/count/CountState.ts index bb420bd5..7e6c758b 100644 --- a/src/store/modules/count/CountState.ts +++ b/src/store/modules/count/CountState.ts @@ -13,4 +13,5 @@ export default interface CountState { cycleCountItems: any; cycleCountImportSystemMessages: Array; defaultRecountUpdateBehaviour: String; + cachedUnmatchedProducts: any; } \ No newline at end of file diff --git a/src/store/modules/count/actions.ts b/src/store/modules/count/actions.ts index 978e2373..15cd883d 100644 --- a/src/store/modules/count/actions.ts +++ b/src/store/modules/count/actions.ts @@ -66,7 +66,8 @@ const actions: ActionTree = { commit(types.COUNT_LIST_UPDATED, { counts, total , isScrollable }) }, - async fetchCycleCountStats({ commit }, inventoryCountImportIds) { + async fetchCycleCountStats({ commit, state }, inventoryCountImportIds) { + const cachedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)) try { const resp = await CountService.fetchCycleCountStats({ inventoryCountImportIds }); @@ -74,6 +75,7 @@ const actions: ActionTree = { // Sorting the statusHistory based on statusDate, as in response we are getting this information sorted on statusId resp.data.importStats.map((stats: any) => { + stats["totalItems"] = stats["totalItems"] + (cachedProducts[stats.inventoryCountImportId]?.length || 0) stats.statusHistory.sort((a: any, b: any) => { if(a["statusDate"] === b["statusDate"]) return 0; @@ -177,7 +179,8 @@ const actions: ActionTree = { commit(types.COUNT_UPDATED, {}) }, - async fetchCycleCountItems({commit} ,payload) { + async fetchCycleCountItems({commit, state} ,payload) { + const cachedProducts = state.cachedUnmatchedProducts[payload.inventoryCountImportId]?.length ? JSON.parse(JSON.stringify(state.cachedUnmatchedProducts[payload.inventoryCountImportId])) : []; let items = [] as any, resp, pageIndex = 0; try { @@ -194,6 +197,7 @@ const actions: ActionTree = { logger.error(err) } this.dispatch("product/fetchProducts", { productIds: [...new Set(items.map((item: any) => item.productId))] }) + if(cachedProducts?.length) items = items.concat(cachedProducts) commit(types.COUNT_ITEMS_UPDATED, { itemList: items }) }, @@ -225,6 +229,12 @@ const actions: ActionTree = { } commit(types.COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED, systemMessages) }, + + async updateCachedUnmatchedProducts({commit, state}, payload) { + const cachedUnmatchedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)); + cachedUnmatchedProducts[payload.id] = payload.updatedProducts; + commit(types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED, cachedUnmatchedProducts) + }, } export default actions; diff --git a/src/store/modules/count/getters.ts b/src/store/modules/count/getters.ts index 03c5a73c..6ab04e5c 100644 --- a/src/store/modules/count/getters.ts +++ b/src/store/modules/count/getters.ts @@ -29,6 +29,9 @@ const getters: GetterTree = { }, getDefaultRecountUpdateBehaviour(state) { return state.defaultRecountUpdateBehaviour + }, + getCachedUnmatchedProducts: (state) => (id: string) => { + return state.cachedUnmatchedProducts[id] } }; diff --git a/src/store/modules/count/index.ts b/src/store/modules/count/index.ts index bcb226c4..779f26c6 100644 --- a/src/store/modules/count/index.ts +++ b/src/store/modules/count/index.ts @@ -24,7 +24,8 @@ const countModule: Module = { isScrollable: true }, cycleCountItems: {}, - defaultRecountUpdateBehaviour: "add" + defaultRecountUpdateBehaviour: "add", + cachedUnmatchedProducts: {} }, getters, actions, diff --git a/src/store/modules/count/mutation-types.ts b/src/store/modules/count/mutation-types.ts index 24c90187..471f33ba 100644 --- a/src/store/modules/count/mutation-types.ts +++ b/src/store/modules/count/mutation-types.ts @@ -5,4 +5,5 @@ export const COUNT_QUERY_CLEARED = SN_COUNT + "/QUERY_CLEARED" export const COUNT_STATS_UPDATED = SN_COUNT + "/STATS_UPDATED" export const COUNT_UPDATED = SN_COUNT + '/UPDATED' export const COUNT_ITEMS_UPDATED = SN_COUNT + '/ITEMS_UPDATED' -export const COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED = SN_COUNT + 'IMPORT_SYSTEM_MESSAGES_UPDATED' \ No newline at end of file +export const COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED = SN_COUNT + 'IMPORT_SYSTEM_MESSAGES_UPDATED' +export const COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED = SN_COUNT + 'CACHED_UNMATCHED_PRODUCTS_UPDATED' \ No newline at end of file diff --git a/src/store/modules/count/mutations.ts b/src/store/modules/count/mutations.ts index 1f49894c..89f0956f 100644 --- a/src/store/modules/count/mutations.ts +++ b/src/store/modules/count/mutations.ts @@ -34,6 +34,9 @@ const mutations: MutationTree = { }, [types.COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED] (state, payload) { state.cycleCountImportSystemMessages = payload + }, + [types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED] (state, payload) { + state.cachedUnmatchedProducts = payload } } diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index fabe6b80..5f121fc6 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -212,7 +212,6 @@ import { CountService } from "@/services/CountService"; import Image from "@/components/Image.vue"; import router from "@/router"; import MatchProductModal from "@/components/MatchProductModal.vue"; -import { onBeforeRouteLeave } from 'vue-router'; const store = useStore(); @@ -253,46 +252,39 @@ onIonViewDidEnter(async() => { await store.dispatch("product/currentProduct", itemsList.value?.length ? itemsList.value[0] : {}) barcodeInputRef.value?.$el?.setFocus(); selectedCountUpdateType.value = defaultRecountUpdateBehaviour.value + window.addEventListener('beforeunload', handleBeforeUnload); }) onIonViewDidLeave(async() => { + window.removeEventListener('beforeunload', handleBeforeUnload); + await handleBeforeUnload(); await store.dispatch('count/updateCycleCountItems', []); store.dispatch("product/currentProduct", {}); }) -onBeforeRouteLeave(async (to) => { - if(to.path === "/login") return; - if(!hasUnsavedChanges()) return true; - let leavePage = false; +async function handleBeforeUnload() { + if(inputCount.value && isItemAlreadyAdded(currentProduct.value)) { + await saveCount(currentProduct.value); + inputCount.value = ""; + } - const alert = await alertController.create({ - header: translate("Leave page"), - message: translate("There are some unmatched or unsaved changes in this count. Any edits made in the counted quantity on this page will be lost."), - buttons: [ - { - text: translate("STAY"), - handler: () => { - leavePage = false - } - }, - { - text: translate("LEAVE"), - handler: () => { - leavePage = true - }, - }, - ], - }); + const updatedProducts = [] as any; + cycleCountItems.value.itemList.map((item: any) => { + let newItem = {} as any; - alert.present(); - const data = await alert.onDidDismiss() - // If clicking backdrop just close the modal and do not redirect the user to previous page - if(data?.role === "backdrop") { - return false; - } + if(item.isMatchNotFound || item.isMatching) { + newItem = { ...item, isMatching: false, isMatchNotFound: true } + if(newItem.scannedId === currentProduct.value.scannedId) { + newItem = { ...newItem, scannedCount: inputCount.value } + inputCount.value = "" + } + } - return leavePage -}) + if(Object.keys(newItem)?.length) updatedProducts.push(newItem) + }) + + store.dispatch("count/updateCachedUnmatchedProducts", { id: cycleCount.value.inventoryCountImportId, updatedProducts }); +} async function fetchCycleCount() { emitter.emit("presentLoader"); @@ -455,7 +447,7 @@ async function addProductToCount(productId: any) { return newProduct; } -async function updateCurrentItemInList(newItem: any, scannedValue: string) { +async function updateCurrentItemInList(newItem: any, scannedValue: string) { const items = JSON.parse(JSON.stringify(cycleCountItems.value.itemList)); const updatedProduct = JSON.parse(JSON.stringify(currentProduct.value)) From 697e8328e543a6fd6941511dce1dc0d7a5ff888d Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 6 Jan 2025 11:23:43 +0530 Subject: [PATCH 2/5] Improved: handling for recount unmatched item on page unload auto save(#559-persist) --- src/views/HardCountDetail.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index 109ff0ee..e947c19b 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -281,7 +281,11 @@ async function handleBeforeUnload() { if(item.isMatchNotFound || item.isMatching) { newItem = { ...item, isMatching: false, isMatchNotFound: true } if(newItem.scannedId === currentProduct.value.scannedId) { - newItem = { ...newItem, scannedCount: inputCount.value } + if(newItem?.scannedCount) { + newItem = { ...newItem, scannedCount: selectedCountUpdateType.value === "replace" ? inputCount.value : (Number(inputCount.value) + Number(newItem.scannedCount)) } + } else { + newItem = { ...newItem, scannedCount: inputCount.value } + } inputCount.value = "" } } From 462c713e6a055a432b912e84d1fe0a0993407a2f Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 6 Jan 2025 12:26:05 +0530 Subject: [PATCH 3/5] Improved: clearing the current cycle count form the cached count items from the state (#559) --- src/store/modules/count/actions.ts | 6 ++++++ src/views/HardCountDetail.vue | 1 + 2 files changed, 7 insertions(+) diff --git a/src/store/modules/count/actions.ts b/src/store/modules/count/actions.ts index 15cd883d..ff37761e 100644 --- a/src/store/modules/count/actions.ts +++ b/src/store/modules/count/actions.ts @@ -235,6 +235,12 @@ const actions: ActionTree = { cachedUnmatchedProducts[payload.id] = payload.updatedProducts; commit(types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED, cachedUnmatchedProducts) }, + + async clearCurrentCountFromCachedUnmatchedProducts({commit, state}, id) { + const cachedUnmatchedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)); + delete cachedUnmatchedProducts[id] + commit(types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED, cachedUnmatchedProducts) + }, } export default actions; diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index e947c19b..b2c04008 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -530,6 +530,7 @@ async function readyForReview() { statusId: "INV_COUNT_REVIEW" }) router.push("/tabs/count") + store.dispatch('count/clearCurrentCountFromCachedUnmatchedProducts', props.id); showToast(translate("Count has been submitted for review")) } catch(err) { showToast(translate("Failed to submit cycle count for review")) From 2507ffc162a10adea29fc79a7184e98bcae855fa Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 7 Jan 2025 18:51:00 +0530 Subject: [PATCH 4/5] Improved: variable names and removed unused method (#559) --- src/store/modules/count/actions.ts | 2 +- src/views/HardCountDetail.vue | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/store/modules/count/actions.ts b/src/store/modules/count/actions.ts index ff37761e..85c341cf 100644 --- a/src/store/modules/count/actions.ts +++ b/src/store/modules/count/actions.ts @@ -232,7 +232,7 @@ const actions: ActionTree = { async updateCachedUnmatchedProducts({commit, state}, payload) { const cachedUnmatchedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)); - cachedUnmatchedProducts[payload.id] = payload.updatedProducts; + cachedUnmatchedProducts[payload.id] = payload.unmatchedProducts; commit(types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED, cachedUnmatchedProducts) }, diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index b2e4bd4d..e476a41a 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -274,26 +274,26 @@ async function handleBeforeUnload() { inputCount.value = ""; } - const updatedProducts = [] as any; + const unmatchedProducts = [] as any; cycleCountItems.value.itemList.map((item: any) => { - let newItem = {} as any; + let unmatchedItem = {} as any; if(item.isMatchNotFound || item.isMatching) { - newItem = { ...item, isMatching: false, isMatchNotFound: true } - if(newItem.scannedId === currentProduct.value.scannedId) { - if(newItem?.scannedCount) { - newItem = { ...newItem, scannedCount: selectedCountUpdateType.value === "replace" ? inputCount.value : (Number(inputCount.value) + Number(newItem.scannedCount)) } + unmatchedItem = { ...item, isMatching: false, isMatchNotFound: true } + if(unmatchedItem.scannedId === currentProduct.value.scannedId) { + if(unmatchedItem?.scannedCount) { + unmatchedItem = { ...unmatchedItem, scannedCount: selectedCountUpdateType.value === "replace" ? inputCount.value : (Number(inputCount.value) + Number(unmatchedItem.scannedCount)) } } else { - newItem = { ...newItem, scannedCount: inputCount.value } + unmatchedItem = { ...unmatchedItem, scannedCount: inputCount.value } } inputCount.value = "" } } - if(Object.keys(newItem)?.length) updatedProducts.push(newItem) + if(Object.keys(unmatchedItem)?.length) unmatchedProducts.push(unmatchedItem) }) - store.dispatch("count/updateCachedUnmatchedProducts", { id: cycleCount.value.inventoryCountImportId, updatedProducts }); + store.dispatch("count/updateCachedUnmatchedProducts", { id: cycleCount.value.inventoryCountImportId, unmatchedProducts }); } async function fetchCycleCount() { @@ -670,10 +670,6 @@ function getVariance(item: any , isRecounting: boolean) { return item.itemStatusId === "INV_COUNT_REJECTED" ? 0 : parseInt(isRecounting ? inputCount.value : qty) - parseInt(item.qoh) } -function hasUnsavedChanges() { - return (inputCount.value && inputCount.value >= 0) || cycleCountItems.value.itemList.some((item: any) => item.scannedCount); -} - function isItemAlreadyAdded(product: any) { return product.productId && product.importItemSeqId; } From 929f67455606a1c9653faa651bb84034e5bbd13f Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 7 Jan 2025 19:01:01 +0530 Subject: [PATCH 5/5] Improved: variable naming convention for the cached unmatch products (#559) --- src/store/index.ts | 2 +- src/store/modules/count/CountState.ts | 2 +- src/store/modules/count/actions.ts | 20 ++++++++++---------- src/store/modules/count/getters.ts | 4 ++-- src/store/modules/count/index.ts | 2 +- src/store/modules/count/mutation-types.ts | 2 +- src/store/modules/count/mutations.ts | 4 ++-- src/views/HardCountDetail.vue | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/store/index.ts b/src/store/index.ts index 27b4dce1..4cb9d0b6 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -18,7 +18,7 @@ import { setPermissions } from "@/authorization" const state: any = {} const persistState = createPersistedState({ - paths: ["user", "product.cached", "count.cachedUnmatchedProducts"], + paths: ["user", "product.cached", "count.cachedUnmatchProducts"], fetchBeforeUse: true }) diff --git a/src/store/modules/count/CountState.ts b/src/store/modules/count/CountState.ts index 7e6c758b..82fb2737 100644 --- a/src/store/modules/count/CountState.ts +++ b/src/store/modules/count/CountState.ts @@ -13,5 +13,5 @@ export default interface CountState { cycleCountItems: any; cycleCountImportSystemMessages: Array; defaultRecountUpdateBehaviour: String; - cachedUnmatchedProducts: any; + cachedUnmatchProducts: any; } \ No newline at end of file diff --git a/src/store/modules/count/actions.ts b/src/store/modules/count/actions.ts index 85c341cf..b57c8b15 100644 --- a/src/store/modules/count/actions.ts +++ b/src/store/modules/count/actions.ts @@ -67,7 +67,7 @@ const actions: ActionTree = { }, async fetchCycleCountStats({ commit, state }, inventoryCountImportIds) { - const cachedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)) + const cachedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchProducts)) try { const resp = await CountService.fetchCycleCountStats({ inventoryCountImportIds }); @@ -180,7 +180,7 @@ const actions: ActionTree = { }, async fetchCycleCountItems({commit, state} ,payload) { - const cachedProducts = state.cachedUnmatchedProducts[payload.inventoryCountImportId]?.length ? JSON.parse(JSON.stringify(state.cachedUnmatchedProducts[payload.inventoryCountImportId])) : []; + const cachedProducts = state.cachedUnmatchProducts[payload.inventoryCountImportId]?.length ? JSON.parse(JSON.stringify(state.cachedUnmatchProducts[payload.inventoryCountImportId])) : []; let items = [] as any, resp, pageIndex = 0; try { @@ -230,16 +230,16 @@ const actions: ActionTree = { commit(types.COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED, systemMessages) }, - async updateCachedUnmatchedProducts({commit, state}, payload) { - const cachedUnmatchedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)); - cachedUnmatchedProducts[payload.id] = payload.unmatchedProducts; - commit(types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED, cachedUnmatchedProducts) + async updateCachedUnmatchProducts({commit, state}, payload) { + const cachedUnmatchProducts = JSON.parse(JSON.stringify(state.cachedUnmatchProducts)); + cachedUnmatchProducts[payload.id] = payload.unmatchedProducts; + commit(types.COUNT_CACHED_UNMATCH_PRODUCTS_UPDATED, cachedUnmatchProducts) }, - async clearCurrentCountFromCachedUnmatchedProducts({commit, state}, id) { - const cachedUnmatchedProducts = JSON.parse(JSON.stringify(state.cachedUnmatchedProducts)); - delete cachedUnmatchedProducts[id] - commit(types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED, cachedUnmatchedProducts) + async clearCurrentCountFromCachedUnmatchProducts({commit, state}, id) { + const cachedUnmatchProducts = JSON.parse(JSON.stringify(state.cachedUnmatchProducts)); + delete cachedUnmatchProducts[id] + commit(types.COUNT_CACHED_UNMATCH_PRODUCTS_UPDATED, cachedUnmatchProducts) }, } diff --git a/src/store/modules/count/getters.ts b/src/store/modules/count/getters.ts index 6ab04e5c..960d6bf0 100644 --- a/src/store/modules/count/getters.ts +++ b/src/store/modules/count/getters.ts @@ -30,8 +30,8 @@ const getters: GetterTree = { getDefaultRecountUpdateBehaviour(state) { return state.defaultRecountUpdateBehaviour }, - getCachedUnmatchedProducts: (state) => (id: string) => { - return state.cachedUnmatchedProducts[id] + getCachedUnmatchProducts: (state) => (id: string) => { + return state.cachedUnmatchProducts[id] } }; diff --git a/src/store/modules/count/index.ts b/src/store/modules/count/index.ts index 779f26c6..8884396b 100644 --- a/src/store/modules/count/index.ts +++ b/src/store/modules/count/index.ts @@ -25,7 +25,7 @@ const countModule: Module = { }, cycleCountItems: {}, defaultRecountUpdateBehaviour: "add", - cachedUnmatchedProducts: {} + cachedUnmatchProducts: {} }, getters, actions, diff --git a/src/store/modules/count/mutation-types.ts b/src/store/modules/count/mutation-types.ts index 471f33ba..35110189 100644 --- a/src/store/modules/count/mutation-types.ts +++ b/src/store/modules/count/mutation-types.ts @@ -6,4 +6,4 @@ export const COUNT_STATS_UPDATED = SN_COUNT + "/STATS_UPDATED" export const COUNT_UPDATED = SN_COUNT + '/UPDATED' export const COUNT_ITEMS_UPDATED = SN_COUNT + '/ITEMS_UPDATED' export const COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED = SN_COUNT + 'IMPORT_SYSTEM_MESSAGES_UPDATED' -export const COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED = SN_COUNT + 'CACHED_UNMATCHED_PRODUCTS_UPDATED' \ No newline at end of file +export const COUNT_CACHED_UNMATCH_PRODUCTS_UPDATED = SN_COUNT + 'CACHED_UNMATCHED_PRODUCTS_UPDATED' \ No newline at end of file diff --git a/src/store/modules/count/mutations.ts b/src/store/modules/count/mutations.ts index 89f0956f..44a75fe3 100644 --- a/src/store/modules/count/mutations.ts +++ b/src/store/modules/count/mutations.ts @@ -35,8 +35,8 @@ const mutations: MutationTree = { [types.COUNT_IMPORT_SYSTEM_MESSAGES_UPDATED] (state, payload) { state.cycleCountImportSystemMessages = payload }, - [types.COUNT_CACHED_UNMATCHED_PRODUCTS_UPDATED] (state, payload) { - state.cachedUnmatchedProducts = payload + [types.COUNT_CACHED_UNMATCH_PRODUCTS_UPDATED] (state, payload) { + state.cachedUnmatchProducts = payload } } diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index e476a41a..7799cd5a 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -293,7 +293,7 @@ async function handleBeforeUnload() { if(Object.keys(unmatchedItem)?.length) unmatchedProducts.push(unmatchedItem) }) - store.dispatch("count/updateCachedUnmatchedProducts", { id: cycleCount.value.inventoryCountImportId, unmatchedProducts }); + store.dispatch("count/updateCachedUnmatchProducts", { id: cycleCount.value.inventoryCountImportId, unmatchedProducts }); } async function fetchCycleCount() { @@ -531,7 +531,7 @@ async function readyForReview() { statusId: "INV_COUNT_REVIEW" }) router.push("/tabs/count") - store.dispatch('count/clearCurrentCountFromCachedUnmatchedProducts', props.id); + store.dispatch('count/clearCurrentCountFromCachedUnmatchProducts', props.id); showToast(translate("Count has been submitted for review")) } catch(err) { showToast(translate("Failed to submit cycle count for review"))