|
|
|
|
|
|
|
|
productQuantityMaxChange: function (event) { |
|
|
productQuantityMaxChange: function (event) { |
|
|
var app = this; |
|
|
var app = this; |
|
|
var quantityMax = event.currentTarget.value; |
|
|
var quantityMax = event.currentTarget.value; |
|
|
|
|
|
var idProduct = event.currentTarget.getAttribute('data-id-product'); |
|
|
axios.get("ajax-process-product-quantity-max", { |
|
|
axios.get("ajax-process-product-quantity-max", { |
|
|
params: { |
|
|
params: { |
|
|
idDistribution: this.distribution.id, |
|
|
idDistribution: this.distribution.id, |
|
|
idProduct: event.currentTarget.getAttribute('data-id-product'), |
|
|
|
|
|
|
|
|
idProduct: idProduct, |
|
|
quantityMax: (!quantityMax || quantityMax.length === 0) ? -1 : quantityMax |
|
|
quantityMax: (!quantityMax || quantityMax.length === 0) ? -1 : quantityMax |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.then(function (response) { |
|
|
.then(function (response) { |
|
|
app.init(app.idActivePointSale); |
|
|
|
|
|
|
|
|
Vue.set(app.products[app.getProductIndex(idProduct)], 'quantity_remaining', response.data.quantity_remaining); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
productActiveClick: function (event) { |
|
|
productActiveClick: function (event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
return false; |
|
|
}, |
|
|
}, |
|
|
|
|
|
getProductIndex: function(idProduct) { |
|
|
|
|
|
for (var i = 0; i < this.products.length; i++) { |
|
|
|
|
|
if (this.products[i].id == idProduct) { |
|
|
|
|
|
return i; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
}, |
|
|
countDocuments: function (order) { |
|
|
countDocuments: function (order) { |
|
|
var count = 0; |
|
|
var count = 0; |
|
|
|
|
|
|