From 73fc0c7f35ff597a94feb597a41fce02b68a8a87 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 2 Jan 2025 16:23:21 +0530 Subject: [PATCH] Improved: sending additional field while cycleCount creation including uploaded by userlogin id and createdDate (#578) --- src/views/Draft.vue | 6 +++++- src/views/HardCount.vue | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/Draft.vue b/src/views/Draft.vue index ab1f1696..6f3d1085 100644 --- a/src/views/Draft.vue +++ b/src/views/Draft.vue @@ -84,11 +84,13 @@ import Filters from "@/components/Filters.vue" import store from "@/store"; import { showToast } from "@/utils"; import router from "@/router"; +import { DateTime } from "luxon"; const cycleCounts = computed(() => store.getters["count/getCounts"]) const cycleCountStats = computed(() => (id: string) => store.getters["count/getCycleCountStats"](id)) const isScrollable = computed(() => store.getters["count/isCycleCountListScrollable"]) const query = computed(() => store.getters["count/getQuery"]) +const userProfile = computed(() => store.getters["user/getUserProfile"]) const isScrollingEnabled = ref(false); const contentRef = ref({}) as any @@ -179,7 +181,9 @@ async function createCycleCount() { // When initially creating the cycleCount we are just assigning it a name, all the other params are updated from the details page await store.dispatch("count/createCycleCount", { countImportName: name, - statusId: "INV_COUNT_CREATED" + statusId: "INV_COUNT_CREATED", + uploadedByUserLogin: userProfile.value.username, + createdDate: DateTime.now().toMillis() }) } }) diff --git a/src/views/HardCount.vue b/src/views/HardCount.vue index 294b4e24..1807efe1 100644 --- a/src/views/HardCount.vue +++ b/src/views/HardCount.vue @@ -151,6 +151,7 @@ const countNameRef = ref("") as Ref; const infiniteScrollRef = ref(""); const facilityGroups = computed(() => store.getters["util/getFacilityGroups"]) +const userProfile = computed(() => store.getters["user/getUserProfile"]) onIonViewWillEnter(async () => { countName.value = `Hard count - ${DateTime.now().toFormat('dd-MM-yyyy hh:mm:ss')}`; @@ -178,7 +179,9 @@ async function saveCount() { let count = { countImportName: countName.value, statusId: isAutoAssignEnabled.value ? "INV_COUNT_ASSIGNED" : "INV_COUNT_CREATED", - countTypeEnumId: "HARD_COUNT" + countTypeEnumId: "HARD_COUNT", + uploadedByUserLogin: userProfile.value.username, + createdDate: DateTime.now().toMillis() } as any; if(dueDate.value) count["dueDate"] = dueDate.value;