<div class="info-box-content"> | <div class="info-box-content"> | ||||
<span class="info-box-text"> | <span class="info-box-text"> | ||||
{{ countOrders }} Commande<span v-if="countOrders > 1">s</span><br /><br /> | {{ countOrders }} Commande<span v-if="countOrders > 1">s</span><br /><br /> | ||||
<a :href="distribution.url_report" class="btn btn-default" v-if="orders.length">Télécharger (PDF)</a> | |||||
<a href="#" class="btn btn-default" disabled="disabled" v-if="countOrders == 0">Télécharger (PDF)</a> | |||||
<a :href="distribution.url_report" class="btn btn-default" v-else>Télécharger (PDF)</a> | |||||
</span> | </span> | ||||
</div> | </div> | ||||
</div> | </div> |
this.oneDistributionWeekActive = response.data.one_distribution_week_active ; | this.oneDistributionWeekActive = response.data.one_distribution_week_active ; | ||||
this.countOrders = 0 ; | |||||
if(response.data.orders) { | if(response.data.orders) { | ||||
this.orders = response.data.orders ; | this.orders = response.data.orders ; | ||||
this.countOrders = 0 ; | |||||
for(i=0 ; i < this.orders.length ; i++) { | for(i=0 ; i < this.orders.length ; i++) { | ||||
if(!this.orders[i].date_delete) { | if(!this.orders[i].date_delete) { | ||||
this.countOrders ++ ; | this.countOrders ++ ; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
this.orders = [] ; | this.orders = [] ; |