Browse Source

Création des bons de livraison uniquement depuis la page des distributions

refactoring
Guillaume Bourgeois 4 years ago
parent
commit
03a5f9db53
4 changed files with 23 additions and 5 deletions
  1. +1
    -1
      backend/views/delivery-note/index.php
  2. +1
    -1
      backend/views/distribution/index.php
  3. +6
    -2
      backend/web/js/vuejs/alerts.js
  4. +15
    -1
      backend/web/js/vuejs/distribution-index.js

+ 1
- 1
backend/views/delivery-note/index.php View File



$this->setTitle('Bons de livraison'); $this->setTitle('Bons de livraison');
$this->addBreadcrumb($this->getTitle()); $this->addBreadcrumb($this->getTitle());
$this->addButton(['label' => 'Nouveau bon de livraison <span class="glyphicon glyphicon-plus"></span>', 'url' => 'delivery-note/create', 'class' => 'btn btn-primary']);
$this->addButton(['label' => 'Nouveau bon de livraison <span class="glyphicon glyphicon-plus"></span>', 'url' => ['distribution/index', 'message_generate_bl' => 1], 'class' => 'btn btn-primary']);


?> ?>



+ 1
- 1
backend/views/distribution/index.php View File

<thead> <thead>
<tr> <tr>
<th v-if="idActivePointSale > 0"> <th v-if="idActivePointSale > 0">
<input type="checkbox" v-model="checkboxSelectAllOrders" @change="selectAllOrders" />
<input type="checkbox" v-model="checkboxSelectAllOrders" @change="selectAllOrdersEvent" />
</th> </th>
<th>Origine</th> <th>Origine</th>
<th>État</th> <th>État</th>

+ 6
- 2
backend/web/js/vuejs/alerts.js View File

this.alert(response.data.alert.type, response.data.alert.message) ; this.alert(response.data.alert.type, response.data.alert.message) ;
} }
}, },
alert: function(type, message) {
alert: function(type, message, timeout) {
var app = this ; var app = this ;
var index = this.alerts.length ; var index = this.alerts.length ;
this.alerts.splice(index, 0, { this.alerts.splice(index, 0, {
app.alerts[index].display = display ; app.alerts[index].display = display ;
} ; } ;


if(!timeout) {
timeout = 3000 ;
}

setTimeout(functionDisplayAlert, 500, app, index, true) ; setTimeout(functionDisplayAlert, 500, app, index, true) ;
setTimeout(functionDisplayAlert, 3000, app, index, false) ;
setTimeout(functionDisplayAlert, timeout, app, index, false) ;


} }
} }

+ 15
- 1
backend/web/js/vuejs/distribution-index.js View File

showLoading: false, showLoading: false,
tillerIsSynchro: false, tillerIsSynchro: false,
checkboxSelectAllOrders: false, checkboxSelectAllOrders: false,
messageGenerateDeliveryNoteDisplayed: false,
calendar: { calendar: {
mode: 'single', mode: 'single',
attrs: [], attrs: [],
app.showLoading = false ; app.showLoading = false ;
app.checkboxSelectAllOrders = false ; app.checkboxSelectAllOrders = false ;

let searchParams = new URLSearchParams(window.location.search) ;
if(searchParams.has('message_generate_bl') && !app.messageGenerateDeliveryNoteDisplayed) {
appAlerts.alert('info','Pour générer un bon de livraison, sélectionnez tout d\'abord un jour et un lieu de distribution.', 6000) ;
app.messageGenerateDeliveryNoteDisplayed = true ;
}
}) ; }) ;
}, },
initCountActiveProducts: function() { initCountActiveProducts: function() {
app.init() ; app.init() ;
}) ; }) ;
}, },
selectAllOrders: function(event) {
selectAllOrdersEvent: function(event) {
var bool = event.currentTarget.checked ; var bool = event.currentTarget.checked ;
this.selectAllOrders(bool) ;
},
selectAllOrders: function(bool) {
for(var key in this.orders) { for(var key in this.orders) {
if(this.orders[key].id_point_sale == this.idActivePointSale) { if(this.orders[key].id_point_sale == this.idActivePointSale) {
this.orders[key].selected = bool ; this.orders[key].selected = bool ;
}, },
generateDeliveryNote: function() { generateDeliveryNote: function() {


if(!this.oneOrderSelected()) {
this.selectAllOrders(true) ;
}

if(this.oneOrderSelected()) { if(this.oneOrderSelected()) {
var app = this ; var app = this ;
var idOrders = {} ; var idOrders = {} ;

Loading…
Cancel
Save