Browse Source

[Adminsitration] Distributions : info remboursement commandes lors de la désactivation d'une distribution #1058

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
ec917126e1
1 changed files with 27 additions and 2 deletions
  1. +27
    -2
      backend/web/js/vuejs/distribution-index.js

+ 27
- 2
backend/web/js/vuejs/distribution-index.js View File

}, },
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')) ;
}, },

Loading…
Cancel
Save