Merge pull request 'hotfix: refs #8198 ensure warehouseFk is a number when set from query' (!1308) from 8198-hotfix-parseQueryParam into master
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1308
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jorge Penadés 2025-01-30 09:05:04 +00:00
commit 2b474cab67
1 changed files with 2 additions and 4 deletions

View File

@ -125,7 +125,7 @@ onMounted(async () => {
inventoriedDate.value =
(await axios.get('Configs/findOne')).data?.inventoried || today;
if (query.warehouseFk) ref.warehouseFk = query.warehouseFk;
if (query.warehouseFk) ref.warehouseFk = +query.warehouseFk;
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
if (ref.date) showWhatsBeforeInventory.value = true;
ref.itemFk = route.params.id;
@ -143,7 +143,7 @@ onMounted(async () => {
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
const getBadgeAttrs = (_date) => {
const isSameDate = date.isSameDate(today.value, _date);
const isSameDate = date.isSameDate(today, _date);
const attrs = {
'text-color': isSameDate ? 'black' : 'white',
color: isSameDate ? 'warning' : 'transparent',
@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => {
const scrollToToday = async () => {
await nextTick();
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
if (todayCell) {
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });