Browse Source

[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.
dev
Guillaume Bourgeois 5 years ago
parent
commit
2d1144ebdf
2 changed files with 15 additions and 2 deletions
  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 View File

:points-sale="pointsSale" :points-sale="pointsSale"
:users="users" :users="users"
:products="products" :products="products"
:order="order"
:order="order.clone"
@close="showModalFormOrderUpdate = false" @close="showModalFormOrderUpdate = false"
@ordercreatedupdated="orderCreatedUpdated" @ordercreatedupdated="orderCreatedUpdated"
></order-form> ></order-form>

+ 14
- 1
backend/web/js/vuejs/distribution-index.js View File

app.orders = response.data.orders ; app.orders = response.data.orders ;
for(i=0 ; i < app.orders.length ; i++) { for(i=0 ; i < app.orders.length ; i++) {
app.orders[i].clone = app.cloneOrder(app.orders[i]) ;
if(!app.orders[i].date_delete) { if(!app.orders[i].date_delete) {
app.countOrders ++ ; app.countOrders ++ ;
} }
closeModalProducts: function() { closeModalProducts: function() {
this.showModalProducts = false ; this.showModalProducts = false ;
this.init(this.idActivePointSale) ; 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 ;
} }
}, },
}); });
idUser: this.order.id_user, idUser: this.order.id_user,
username: ''+this.order.username, username: ''+this.order.username,
products: JSON.stringify(this.order.productOrder), products: JSON.stringify(this.order.productOrder),
comment: this.comment,
comment: this.order.comment,
processCredit: processCredit processCredit: processCredit
}}) }})
.then(function(response) { .then(function(response) {

Loading…
Cancel
Save