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