Explorar el Código

[Espace producteur] Points de vente fantômes #924

prodstable
Guillaume Bourgeois hace 1 año
padre
commit
acddb78f27
Se han modificado 2 ficheros con 13 adiciones y 13 borrados
  1. +1
    -1
      backend/views/distribution/index.php
  2. +12
    -12
      backend/web/js/vuejs/distribution-index.js

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

@@ -256,7 +256,7 @@ $this->setPageTitle('Distributions') ;
<a class="btn btn-default btn-primary" v-if="idActivePointSale == 0">Tous <span class="label label-default">{{ orders.length }}</span> <span class="glyphicon glyphicon-triangle-bottom"></span></a>
<a class="btn btn-default" v-else>Tous <span class="label label-default">{{ orders.length }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
</li>
<li v-for="pointSale in pointsSale" :data-id-point-sale="pointSale.id" v-if="pointSale.pointSaleDistribution[0].delivery == 1" @click="pointSaleClick">
<li v-for="pointSale in pointsSale" :data-id-point-sale="pointSale.id" v-if="pointSale.pointSaleDistribution[0].delivery == 1 && (pointSale.status == 1 || countOrdersByPointSale[pointSale.id] > 0)" @click="pointSaleClick">
<a class="btn btn-default btn-primary" v-if="idActivePointSale == pointSale.id">{{ pointSale.name }} <span class="label label-default">{{ countOrdersByPointSale[pointSale.id] }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
<a class="btn btn-default" v-else>{{ pointSale.name }} <span class="label label-default">{{ countOrdersByPointSale[pointSale.id] }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
</li>

+ 12
- 12
backend/web/js/vuejs/distribution-index.js Ver fichero

@@ -240,13 +240,21 @@ var app = new Vue({
}
},
initPointsSale: function(idActivePointSale) {
this.countOrdersByPointSale = [] ;
for(var i = 0; i < this.pointsSale.length ; i++) {
this.countOrdersByPointSale[this.pointsSale[i].id] = 0 ;
}
for(var i = 0; i < this.orders.length ; i++) {
this.countOrdersByPointSale[this.orders[i].id_point_sale] ++ ;
}

this.countActivePointsSale = 0 ;
this.setIdActivePointSale(0) ;
for(var i= 0; i < this.pointsSale.length; i++) {
if(this.pointsSale[i].pointSaleDistribution[0].delivery == 1) {
this.countActivePointsSale ++ ;
this.setIdActivePointSale(this.pointsSale[i].id) ;
}
if(this.pointsSale[i].pointSaleDistribution[0].delivery == 1 && (this.pointsSale[i].status == 1 || this.countOrdersByPointSale[this.pointsSale[i].id] > 0)) {
this.countActivePointsSale ++ ;
this.setIdActivePointSale(this.pointsSale[i].id) ;
}
}
if(this.countActivePointsSale > 1) {
this.setIdActivePointSale(0) ;
@@ -254,14 +262,6 @@ var app = new Vue({
if(idActivePointSale) {
this.setIdActivePointSale(idActivePointSale) ;
}
this.countOrdersByPointSale = [] ;
for(var i = 0; i < this.pointsSale.length ; i++) {
this.countOrdersByPointSale[this.pointsSale[i].id] = 0 ;
}
for(var i = 0; i < this.orders.length ; i++) {
this.countOrdersByPointSale[this.orders[i].id_point_sale] ++ ;
}
},
dayClicked: function(day) {
this.date = day.date ;

Cargando…
Cancelar
Guardar