|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
activeDistribution: function(event) { |
|
|
activeDistribution: function(event) { |
|
|
var app = this ; |
|
|
var app = this ; |
|
|
|
|
|
var active = parseInt(event.currentTarget.getAttribute('data-active')); |
|
|
|
|
|
|
|
|
axios.get("ajax-process-active-distribution",{params: { |
|
|
axios.get("ajax-process-active-distribution",{params: { |
|
|
idDistribution: this.distribution.id, |
|
|
idDistribution: this.distribution.id, |
|
|
active: event.currentTarget.getAttribute('data-active') |
|
|
|
|
|
|
|
|
active: active |
|
|
}}) |
|
|
}}) |
|
|
.then(function(response) { |
|
|
.then(function(response) { |
|
|
app.init() ; |
|
|
app.init() ; |
|
|
|
|
|
app.alertsActiveDistribution(active, 'Distribution'); |
|
|
}) ; |
|
|
}) ; |
|
|
}, |
|
|
}, |
|
|
activeWeekDistribution: function(event) { |
|
|
activeWeekDistribution: function(event) { |
|
|
var app = this ; |
|
|
var app = this ; |
|
|
|
|
|
var active = parseInt(event.currentTarget.getAttribute('data-active')); |
|
|
|
|
|
|
|
|
axios.get("ajax-process-active-week-distribution",{params: { |
|
|
axios.get("ajax-process-active-week-distribution",{params: { |
|
|
date: this.date.getFullYear() + '-' |
|
|
date: this.date.getFullYear() + '-' |
|
|
+ ('0' + (this.date.getMonth() +1)).slice(-2) + '-' |
|
|
+ ('0' + (this.date.getMonth() +1)).slice(-2) + '-' |
|
|
+ ('0' + this.date.getDate()).slice(-2), |
|
|
+ ('0' + this.date.getDate()).slice(-2), |
|
|
active: event.currentTarget.getAttribute('data-active') |
|
|
|
|
|
|
|
|
active: active |
|
|
}}) |
|
|
}}) |
|
|
.then(function(response) { |
|
|
.then(function(response) { |
|
|
app.init() ; |
|
|
app.init() ; |
|
|
|
|
|
app.alertsActiveDistribution(active, 'Semaine de distribution'); |
|
|
}) ; |
|
|
}) ; |
|
|
}, |
|
|
}, |
|
|
|
|
|
alertsActiveDistribution: function(active, label) { |
|
|
|
|
|
if(!active) { |
|
|
|
|
|
appAlerts.alert( |
|
|
|
|
|
'success', |
|
|
|
|
|
label+' désactivée.', |
|
|
|
|
|
) ; |
|
|
|
|
|
appAlerts.alert( |
|
|
|
|
|
'info', |
|
|
|
|
|
'Pensez à bien rembourser les clients qui auraient passé commande en utilisant leur crédit.', |
|
|
|
|
|
6000 |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
appAlerts.alert( |
|
|
|
|
|
'success', |
|
|
|
|
|
label+' activée.', |
|
|
|
|
|
) ; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
pointSaleClick: function(event) { |
|
|
pointSaleClick: function(event) { |
|
|
this.setIdActivePointSale(event.currentTarget.getAttribute('data-id-point-sale')) ; |
|
|
this.setIdActivePointSale(event.currentTarget.getAttribute('data-id-point-sale')) ; |
|
|
}, |
|
|
}, |