@@ -906,7 +906,7 @@ class OrderController extends BackendController | |||
* @param string $comment | |||
*/ | |||
public function actionAjaxUpdate( | |||
$date, $idOrder, $idPointSale, $idUser, $username, $products, $comment, $processCredit = 0) | |||
$date, $idOrder, $idPointSale, $idUser, $username, $products, $comment = '', $processCredit = 0) | |||
{ | |||
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
@@ -234,7 +234,7 @@ $this->setPageTitle('Distributions') ; | |||
</div> | |||
<table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)"> | |||
<tbody> | |||
<template v-for="order in orders" v-if="idActivePointSale == 0 || idActivePointSale == order.id_point_sale"> | |||
<template v-for="(order, key, index) in orders" v-if="idActivePointSale == 0 || idActivePointSale == order.id_point_sale"> | |||
<tr> | |||
<td> | |||
<label class="label label-success" v-if="order.origin == 'user'">client</label> | |||
@@ -302,7 +302,7 @@ $this->setPageTitle('Distributions') ; | |||
:points-sale="pointsSale" | |||
:users="users" | |||
:products="products" | |||
:order="order.clone" | |||
:order="ordersUpdate[key]" | |||
@close="showModalFormOrderUpdate = false" | |||
@ordercreatedupdated="orderCreatedUpdated" | |||
></order-form> |
@@ -19,6 +19,7 @@ var app = new Vue({ | |||
countActivePointsSale: 0, | |||
countOrdersByPointSale: [], | |||
orders: [], | |||
ordersUpdate: [], | |||
countOrders: 0, | |||
users: [], | |||
showModalProducts: false, | |||
@@ -120,17 +121,14 @@ var app = new Vue({ | |||
app.countOrders = 0 ; | |||
if(response.data.orders) { | |||
app.orders = response.data.orders ; | |||
app.orders = JSON.parse(JSON.stringify(response.data.orders)) ; | |||
app.ordersUpdate = JSON.parse(JSON.stringify(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 ++ ; | |||
} | |||
} | |||
} | |||
} | |||
else { | |||
app.orders = [] ; | |||
@@ -357,7 +355,7 @@ var app = new Vue({ | |||
for(var key in order.productOrder) { | |||
clone.productOrder[key] = order.productOrder[key] ; | |||
} | |||
return clone ; | |||
} | |||
}, | |||
@@ -460,7 +458,8 @@ Vue.component('order-form',{ | |||
}, | |||
productQuantityClick: function(id_product, quantity) { | |||
if(this.order.productOrder[id_product] + quantity >= 0) { | |||
this.order.productOrder[id_product] += quantity ; | |||
var theQuantity = this.order.productOrder[id_product] + quantity ; | |||
Vue.set(this.order.productOrder, id_product, theQuantity); | |||
} | |||
} | |||
} |