forked from verdnatura/salix-front
refs #7283 refactor fix ItemDescriptor
This commit is contained in:
parent
1f9d1b79ab
commit
95b19b5cce
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue