瀏覽代碼

Merge branch 'develop'

prodstable
Guillaume Bourgeois 1 年之前
父節點
當前提交
13653e013d
共有 2 個文件被更改,包括 13 次插入13 次删除
  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 查看文件

@@ -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 查看文件

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

Loading…
取消
儲存