diff --git a/src/store/modules/count/actions.ts b/src/store/modules/count/actions.ts index 018c4983..61128669 100644 --- a/src/store/modules/count/actions.ts +++ b/src/store/modules/count/actions.ts @@ -17,7 +17,7 @@ const actions: ActionTree = { const params = { ...payload, - pageSize: 100 + pageSize: 200 } if(state.query.facilityIds.length) { @@ -176,9 +176,14 @@ const actions: ActionTree = { commit(types.COUNT_ITEMS_UPDATED, items) }, + async updateCycleCountItems ({ commit }, payload) { + commit(types.COUNT_ITEMS_UPDATED, { itemList: payload }) + }, + async clearCycleCountItems ({ commit }) { commit(types.COUNT_ITEMS_UPDATED, []) }, + async fetchCycleCountImportSystemMessages({commit} ,payload) { let systemMessages; try { diff --git a/src/views/CountDetail.vue b/src/views/CountDetail.vue index 74b1146f..e7ca1bbf 100644 --- a/src/views/CountDetail.vue +++ b/src/views/CountDetail.vue @@ -67,7 +67,7 @@ -
+

{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(product.productId)) }}

@@ -345,10 +345,11 @@ function updateFilteredItems() { }); } if (filteredItems.value.length > 0) { - store.dispatch("product/currentProduct", product.value); - updateNavigationState(filteredItems.value.indexOf(product.value)); + const updatedProduct = Object.keys(product.value)?.length ? product.value : filteredItems.value[0] + store.dispatch("product/currentProduct", updatedProduct); + updateNavigationState(filteredItems.value.indexOf(updatedProduct)); } else { - store.dispatch("product/currentProduct", null); + store.dispatch("product/currentProduct", {}); isFirstItem.value = true isLastItem.value = false } @@ -445,9 +446,18 @@ async function saveCount() { product.value.quantity = inputCount.value product.value.countedByGroupName = userProfile.value.userFullName product.value.countedByUserLoginId = userProfile.value.username - await store.dispatch('product/currentProduct', product.value); inputCount.value = ''; product.value.isRecounting = false; + const items = JSON.parse(JSON.stringify(itemsList.value)) + items.map((item) => { + if(item.importItemSeqId === product.value?.importItemSeqId) { + item.quantity = product.value.quantity + item.countedByGroupName = userProfile.value.userFullName + item.countedByUserLoginId = userProfile.value.username + } + }) + await store.dispatch('count/updateCycleCountItems', items); + await store.dispatch('product/currentProduct', product.value); } else { throw resp.data; }