Parcourir la source

[backend] Modification commande : correctif urls trop longues

dev
Guillaume il y a 4 ans
Parent
révision
c7611853c5
2 fichiers modifiés avec 30 ajouts et 18 suppressions
  1. +12
    -2
      backend/controllers/OrderController.php
  2. +18
    -16
      backend/web/js/vuejs/distribution-index.js

+ 12
- 2
backend/controllers/OrderController.php Voir le fichier

@@ -899,9 +899,19 @@ class OrderController extends BackendController
* @param string $date
* @param string $comment
*/
public function actionAjaxUpdate(
$date, $idOrder, $idPointSale, $idUser, $username, $meanPayment = '', $products, $comment = '', $processCredit = 0)
public function actionAjaxUpdate()
{
$request = Yii::$app->request ;

$date = $request->post('date') ;
$idOrder = $request->post('idOrder') ;
$idPointSale = $request->post('idPointSale') ;
$idUser = $request->post('idUser') ;
$username = $request->post('username') ;
$meanPayment = $request->post('meanPayment') ;
$products = $request->post('products') ;
$comment = $request->post('comment') ;
$processCredit = $request->post('processCredit') ;

\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;


+ 18
- 16
backend/web/js/vuejs/distribution-index.js Voir le fichier

@@ -599,22 +599,24 @@ Vue.component('order-form',{
var app = this ;
if(this.checkForm()) {
var processCredit = event.currentTarget.getAttribute('data-process-credit') ;
axios.get(UrlManager.getBaseUrlAbsolute()+"order/ajax-update",{params: {
date: this.date.getFullYear() + '-'
+ ('0' + (this.date.getMonth() +1)).slice(-2) + '-'
+ ('0' + this.date.getDate()).slice(-2),
idOrder: this.order.id,
idPointSale: this.order.id_point_sale,
meanPayment: this.order.mean_payment,
idUser: this.order.id_user,
username: ''+this.order.username,
products: JSON.stringify(this.order.productOrder),
comment: this.order.comment,
processCredit: processCredit
}})
.then(function(response) {
app.$emit('ordercreatedupdated') ;
}) ;

var data = new FormData();
data.append('date', this.date.getFullYear() + '-'
+ ('0' + (this.date.getMonth() +1)).slice(-2) + '-'
+ ('0' + this.date.getDate()).slice(-2));
data.append('idOrder', this.order.id) ;
data.append('idPointSale', this.order.id_point_sale) ;
data.append('meanPayment', this.order.mean_payment) ;
data.append('idUser', this.order.id_user) ;
data.append('username', ''+this.order.username) ;
data.append('products', JSON.stringify(this.order.productOrder)) ;
data.append('comment', this.order.comment) ;
data.append('processCredit', processCredit) ;

axios.post(UrlManager.getBaseUrlAbsolute()+"order/ajax-update",data)
.then(function(response) {
app.$emit('ordercreatedupdated') ;
}) ;
}
},
productQuantityClick: function(id_product, quantity) {

Chargement…
Annuler
Enregistrer