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,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
warehouseFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -47,24 +51,14 @@ const user = state.getUser();
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
const regularizeStockFormDialog = ref(null);
|
const regularizeStockFormDialog = ref(null);
|
||||||
const available = ref(null);
|
const available = ref(null);
|
||||||
const visible = ref(null);
|
const visible = ref(null);
|
||||||
const _warehouseFk = ref(null);
|
|
||||||
const salixUrl = ref();
|
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 () => {
|
onMounted(async () => {
|
||||||
warehouseFk.value = user.value.warehouseFk;
|
updateStock();
|
||||||
salixUrl.value = await getUrl('');
|
salixUrl.value = await getUrl('');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -80,10 +74,12 @@ const updateStock = async () => {
|
||||||
visible.value = null;
|
visible.value = null;
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
warehouseFk: warehouseFk.value,
|
warehouseFk: $props.warehouseFk,
|
||||||
dated: $props.dated,
|
dated: $props.dated,
|
||||||
};
|
};
|
||||||
console.log('params', params);
|
if (!params.warehouseFk) {
|
||||||
|
params.warehouseFk = user.value.warehouseFk;
|
||||||
|
}
|
||||||
|
|
||||||
const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, {
|
const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, {
|
||||||
params,
|
params,
|
||||||
|
|
Loading…
Reference in New Issue