0
0
Fork 0

refs #7283 fix ItemDescriptor warehouse

This commit is contained in:
Carlos Satorres 2024-09-09 12:05:08 +02:00
parent 27f25f611f
commit 3004d77d34
1 changed files with 15 additions and 7 deletions

View File

@ -65,15 +65,23 @@ onMounted(async () => {
const data = ref(useCardDescription());
const setData = async (entity) => {
if (!entity) return;
data.value = useCardDescription(entity.name, entity.id);
await updateStock();
try {
if (!entity) return;
data.value = useCardDescription(entity.name, entity.id);
await updateStock();
} catch (err) {
console.error('Error item');
}
};
const getItemConfigs = async () => {
const { data } = await axios.get('ItemConfigs/findOne');
if (!data) return;
return (warehouseConfig.value = data.warehouseFk);
try {
const { data } = await axios.get('ItemConfigs/findOne');
if (!data) return;
return (warehouseConfig.value = data.warehouseFk);
} catch (err) {
console.error('Error item');
}
};
const updateStock = async () => {
try {
@ -85,13 +93,13 @@ const updateStock = async () => {
dated: $props.dated,
};
await getItemConfigs();
if (!params.warehouseFk) {
params.warehouseFk = warehouseConfig.value;
}
const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, {
params,
});
available.value = data.available;
visible.value = data.visible;
} catch (err) {