Browse Source

[Backend] Prix dégressifs > Distribution : correctif mise à jour des prix

refactoring
Guillaume 2 years ago
parent
commit
8c71709d4c
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      backend/web/js/vuejs/distribution-index.js

+ 9
- 5
backend/web/js/vuejs/distribution-index.js View File

this.idOrderUpdate = idOrder ; this.idOrderUpdate = idOrder ;
this.showModalFormOrderUpdate = true ; this.showModalFormOrderUpdate = true ;
this.initModalFormOrder() ; this.initModalFormOrder() ;
this.updateProductOrderPrices();
this.updateProductOrderPrices(false);
}, },
openModalFormOrderCreate: function() { openModalFormOrderCreate: function() {
this.showModalFormOrderCreate = true ; this.showModalFormOrderCreate = true ;
this.initModalFormOrder() ; this.initModalFormOrder() ;
this.updateProductOrderPrices() ;
this.updateProductOrderPrices(false) ;
}, },
initModalFormOrder: function() { initModalFormOrder: function() {
setTimeout(function() { setTimeout(function() {
}) ; }) ;
}, },


updateProductOrderPrices: function() {
updateProductOrderPrices: function(updatePricesOnUpdateOrder) {
var app = this ; var app = this ;
app.loadingUpdateProductOrder = true; app.loadingUpdateProductOrder = true;
var order = null ; var order = null ;
Vue.set(app.ordersUpdate[keyOrderUpdate].productOrder[idProduct], 'prices', response.data[idProduct].prices); Vue.set(app.ordersUpdate[keyOrderUpdate].productOrder[idProduct], 'prices', response.data[idProduct].prices);
Vue.set(app.ordersUpdate[keyOrderUpdate].productOrder[idProduct], 'active', response.data[idProduct].active); Vue.set(app.ordersUpdate[keyOrderUpdate].productOrder[idProduct], 'active', response.data[idProduct].active);
Vue.set(app.ordersUpdate[keyOrderUpdate].productOrder[idProduct], 'unit_coefficient', response.data[idProduct].unit_coefficient); Vue.set(app.ordersUpdate[keyOrderUpdate].productOrder[idProduct], 'unit_coefficient', response.data[idProduct].unit_coefficient);

if(updatePricesOnUpdateOrder) {
Vue.set(app.orderCreate.productOrder[idProduct], 'price', app.getBestProductPrice(app.orderCreate, idProduct, app.orderCreate.productOrder[idProduct].quantity));
}
} }
} }
} }
}}) }})
.then(function(response) { .then(function(response) {
app.order.id_point_sale = response.data.id_favorite_point_sale ; app.order.id_point_sale = response.data.id_favorite_point_sale ;
app.updateProductOrderPrices() ;
app.updateProductOrderPrices(true) ;
}) ; }) ;
}, },
pointSaleChange: function(event) { pointSaleChange: function(event) {
this.updateProductOrderPrices() ;
this.updateProductOrderPrices(true) ;
}, },
updateProductOrderPrices: function() { updateProductOrderPrices: function() {
this.$emit('updateproductorderprices') ; this.$emit('updateproductorderprices') ;

Loading…
Cancel
Save