hotfix: refs #8198 ensure warehouseFk is a number when set from query #1308

Merged
jorgep merged 2 commits from 8198-hotfix-parseQueryParam into master 2025-01-30 09:05:06 +00:00
1 changed files with 2 additions and 4 deletions

View File

@ -125,7 +125,7 @@ onMounted(async () => {
inventoriedDate.value = inventoriedDate.value =
(await axios.get('Configs/findOne')).data?.inventoried || today; (await axios.get('Configs/findOne')).data?.inventoried || today;
if (query.warehouseFk) ref.warehouseFk = query.warehouseFk; if (query.warehouseFk) ref.warehouseFk = +query.warehouseFk;
Review

Si no es del mismo tipo, no lo encuentra el desplegable

Si no es del mismo tipo, no lo encuentra el desplegable
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk; else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
if (ref.date) showWhatsBeforeInventory.value = true; if (ref.date) showWhatsBeforeInventory.value = true;
ref.itemFk = route.params.id; ref.itemFk = route.params.id;
@ -143,7 +143,7 @@ onMounted(async () => {
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({}); const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
const getBadgeAttrs = (_date) => { const getBadgeAttrs = (_date) => {
const isSameDate = date.isSameDate(today.value, _date); const isSameDate = date.isSameDate(today, _date);
Review

Es un valor estático que no cambia. Se me había olvidado quitar el .value

Es un valor estático que no cambia. Se me había olvidado quitar el .value
const attrs = { const attrs = {
'text-color': isSameDate ? 'black' : 'white', 'text-color': isSameDate ? 'black' : 'white',
color: isSameDate ? 'warning' : 'transparent', color: isSameDate ? 'warning' : 'transparent',
@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => {
const scrollToToday = async () => { const scrollToToday = async () => {
await nextTick(); await nextTick();
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`); const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`);
if (todayCell) { if (todayCell) {
todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' }); todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' });