aa1
This commit is contained in:
@@ -115,11 +115,15 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getSingleStorehouse() {
|
||||
const mystore = myproduct.value.storehouses[0]
|
||||
if (mystore)
|
||||
return mystore.name + ' (' + mystore.city + ')'
|
||||
else
|
||||
try {
|
||||
const mystore = myproduct.value.storehouses[0]
|
||||
if (mystore)
|
||||
return mystore.name + ' (' + mystore.city + ')'
|
||||
else
|
||||
return ''
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function getStorehouses() {
|
||||
@@ -145,6 +149,23 @@ export default defineComponent({
|
||||
return !myorder.value.idStorehouse
|
||||
}
|
||||
|
||||
function updateQtyAvailable() {
|
||||
myproduct.value.quantityAvailable = myproduct.value.stockQty - myorder.value.quantity
|
||||
}
|
||||
|
||||
function getQtyAvailable() {
|
||||
updateQtyAvailable()
|
||||
let qty = myproduct.value.quantityAvailable
|
||||
return qty
|
||||
}
|
||||
|
||||
function getQtyWarn() {
|
||||
if (myorder.value.quantity > 0){
|
||||
return t('ecomm.di_cui_x_in_carrello', {qty: myorder.value.quantity})
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
watch(() => props.code, (newval, oldval) => {
|
||||
console.log('change code')
|
||||
load()
|
||||
@@ -179,7 +200,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getmycardcl() {
|
||||
return (props.complete) ? 'my-card-big' : 'my-card'
|
||||
return (props.complete) ? 'my-card-big' : 'my-card-prod'
|
||||
}
|
||||
|
||||
function getclimg() {
|
||||
@@ -190,6 +211,10 @@ export default defineComponent({
|
||||
return myorder.value ? myorder.value.quantity > 0 : true
|
||||
}
|
||||
|
||||
function enableAddQty() {
|
||||
return getQtyAvailable() > 0
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
|
||||
return {
|
||||
@@ -209,6 +234,9 @@ export default defineComponent({
|
||||
t,
|
||||
storeSelected,
|
||||
enableSubQty,
|
||||
enableAddQty,
|
||||
getQtyAvailable,
|
||||
getQtyWarn,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user