Ver código fonte

[backend] Impossible de modifier le point de vente d'une commande lorsqu'un point de vente est sélectionné

Pour corriger cela, on passe un clone de la commande au formulaire de modification.
prodstable
Guillaume Bourgeois 6 anos atrás
pai
commit
2d1144ebdf
2 arquivos alterados com 15 adições e 2 exclusões
  1. +1
    -1
      backend/views/distribution/index.php
  2. +14
    -1
      backend/web/js/vuejs/distribution-index.js

+ 1
- 1
backend/views/distribution/index.php Ver arquivo

@@ -302,7 +302,7 @@ $this->setPageTitle('Distributions') ;
:points-sale="pointsSale"
:users="users"
:products="products"
:order="order"
:order="order.clone"
@close="showModalFormOrderUpdate = false"
@ordercreatedupdated="orderCreatedUpdated"
></order-form>

+ 14
- 1
backend/web/js/vuejs/distribution-index.js Ver arquivo

@@ -123,6 +123,9 @@ var app = new Vue({
app.orders = response.data.orders ;
for(i=0 ; i < app.orders.length ; i++) {
app.orders[i].clone = app.cloneOrder(app.orders[i]) ;
if(!app.orders[i].date_delete) {
app.countOrders ++ ;
}
@@ -346,6 +349,16 @@ var app = new Vue({
closeModalProducts: function() {
this.showModalProducts = false ;
this.init(this.idActivePointSale) ;
},
cloneOrder: function(order) {
var clone = Object.assign({}, order) ;
clone.productOrder = {} ;
for(var key in order.productOrder) {
clone.productOrder[key] = order.productOrder[key] ;
}
return clone ;
}
},
});
@@ -437,7 +450,7 @@ Vue.component('order-form',{
idUser: this.order.id_user,
username: ''+this.order.username,
products: JSON.stringify(this.order.productOrder),
comment: this.comment,
comment: this.order.comment,
processCredit: processCredit
}})
.then(function(response) {

Carregando…
Cancelar
Salvar