diff --git a/src/filters/dateRange.js b/src/filters/dateRange.js index 4c0cfe654..d014f57fc 100644 --- a/src/filters/dateRange.js +++ b/src/filters/dateRange.js @@ -2,7 +2,7 @@ export default function dateRange(value) { const minHour = new Date(value); minHour.setHours(0, 0, 0, 0); const maxHour = new Date(value); - maxHour.setHours(23, 59, 59, 59); + maxHour.setHours(22, 59, 59, 59); return [minHour, maxHour]; } diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue index 5200db239..9071cc6eb 100644 --- a/src/pages/Item/Card/ItemLastEntries.vue +++ b/src/pages/Item/Card/ItemLastEntries.vue @@ -2,7 +2,7 @@ import { onMounted, computed, onUnmounted, reactive, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; - +import { dateRange } from 'src/filters'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; @@ -29,28 +29,19 @@ const exprBuilder = (param, value) => { case 'landed': return { 'tr.landed': { - between: getDateRange(value), + between: dateRange(value), }, }; } }; -const dateRange = reactive({ +const datedRange = reactive({ from: null, to: null, }); -const getDateRange = (val) => { - const minHour = new Date(val); - minHour.setHours(0, 0, 0, 0); - const maxHour = new Date(val); - maxHour.setHours(23, 59, 59, 59); - - return [minHour, maxHour]; -}; - const from = computed({ - get: () => dateRange.from, + get: () => datedRange.from, set: (val) => { updateFrom(val); updateFilter(); @@ -58,7 +49,7 @@ const from = computed({ }); const to = computed({ - get: () => dateRange.to, + get: () => datedRange.to, set: (val) => { updateTo(val); updateFilter(); @@ -173,17 +164,17 @@ const fetchItemLastEntries = async () => { const updateFrom = async (date) => { date.setHours(0, 0, 0, 0); - dateRange.from = date.toISOString(); + datedRange.from = date.toISOString(); }; const updateTo = async (date) => { date.setHours(23, 59, 59, 59); - dateRange.to = date.toISOString(); + datedRange.to = date.toISOString(); }; const updateFilter = async () => { arrayData.store.userFilter.where.landed = { - between: [dateRange.from, dateRange.to], + between: [datedRange.from, datedRange.to], }; await fetchItemLastEntries(); }; diff --git a/src/pages/Item/ItemRequest.vue b/src/pages/Item/ItemRequest.vue index fac77c693..9ce8ac370 100644 --- a/src/pages/Item/ItemRequest.vue +++ b/src/pages/Item/ItemRequest.vue @@ -147,6 +147,7 @@ const confirmRequest = async (request) => { const params = { itemFk: request.itemFk, quantity: request.saleQuantity, + attenderFk: request.attenderFk, }; const { data } = await axios.post( @@ -293,7 +294,7 @@ onBeforeMount(() => { option-label="firstName" option-value="id" dense - @update:model-value="row.attenderFk" + @update:model-value="(event) => (row.attenderFk = event)" /> diff --git a/src/pages/Item/ItemRequestFilter.vue b/src/pages/Item/ItemRequestFilter.vue index e142c28d3..2fbe849d1 100644 --- a/src/pages/Item/ItemRequestFilter.vue +++ b/src/pages/Item/ItemRequestFilter.vue @@ -1,7 +1,7 @@