Przeglądaj źródła

Merge branch 'dev'

master
Guillaume Bourgeois 5 lat temu
rodzic
commit
b5b57316f0
3 zmienionych plików z 11 dodań i 12 usunięć
  1. +1
    -1
      backend/controllers/OrderController.php
  2. +2
    -2
      backend/views/distribution/index.php
  3. +8
    -9
      backend/web/js/vuejs/distribution-index.js

+ 1
- 1
backend/controllers/OrderController.php Wyświetl plik

@@ -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;

+ 2
- 2
backend/views/distribution/index.php Wyświetl plik

@@ -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>

+ 8
- 9
backend/web/js/vuejs/distribution-index.js Wyświetl plik

@@ -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);
}
}
}

Ładowanie…
Anuluj
Zapisz