From 95b19b5cce6939e655193213ddff9574e7a60303 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 5 Sep 2024 10:04:58 +0200 Subject: [PATCH] refs #7283 refactor fix ItemDescriptor --- src/pages/Item/Card/ItemDescriptor.vue | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue index e649b8c45..5d7f1481f 100644 --- a/src/pages/Item/Card/ItemDescriptor.vue +++ b/src/pages/Item/Card/ItemDescriptor.vue @@ -35,6 +35,10 @@ const $props = defineProps({ type: Number, default: null, }, + warehouseFk: { + type: Number, + default: null, + }, }); const quasar = useQuasar(); @@ -47,24 +51,14 @@ const user = state.getUser(); const entityId = computed(() => { return $props.id || route.params.id; }); + const regularizeStockFormDialog = ref(null); const available = ref(null); const visible = ref(null); -const _warehouseFk = ref(null); const salixUrl = ref(); -console.log('warehouseItemDescriptor', _warehouseFk.value); -const warehouseFk = computed({ - get() { - return _warehouseFk.value; - }, - set(val) { - _warehouseFk.value = val; - if (val) updateStock(); - }, -}); onMounted(async () => { - warehouseFk.value = user.value.warehouseFk; + updateStock(); salixUrl.value = await getUrl(''); }); @@ -80,10 +74,12 @@ const updateStock = async () => { visible.value = null; const params = { - warehouseFk: warehouseFk.value, + warehouseFk: $props.warehouseFk, dated: $props.dated, }; - console.log('params', params); + if (!params.warehouseFk) { + params.warehouseFk = user.value.warehouseFk; + } const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, { params,