Преглед на файлове

Merge branch 'master' into dev

refactoring
Guillaume преди 3 години
родител
ревизия
a56380ac2f
променени са 2 файла, в които са добавени 13 реда и са изтрити 10 реда
  1. +12
    -2
      producer/controllers/OrderController.php
  2. +1
    -8
      producer/web/js/vuejs/order-order.js

+ 12
- 2
producer/controllers/OrderController.php Целия файл

@@ -183,7 +183,13 @@ class OrderController extends ProducerBaseController
])
->one();

if (!$order) {
if($order) {
if($order->id_point_sale != $posts['Order']['id_point_sale']) {
$order->id_point_sale = $posts['Order']['id_point_sale'] ;
$order->date_update = date('Y-m-d H:i:s') ;
}
}
else {
$order = new Order;
$order->load(Yii::$app->request->post());
$order->id_user = User::getCurrentId();
@@ -335,7 +341,11 @@ class OrderController extends ProducerBaseController
$productOrder->id_order = $order->id;
$productOrder->id_product = $product->id;

$productOrder->price = $product->price;
$productOrder->price = $product->getPrice([
'user' => User::getCurrent(),
'user_producer' => $userProducer,
'point_sale' => $pointSale
]);
$productOrder->id_tax_rate = $product->taxRate->id;

$unit = (!is_null($order) && isset($unitsArray[$product->id])) ? $unitsArray[$product->id] : $product->unit;

+ 1
- 8
producer/web/js/vuejs/order-order.js Целия файл

@@ -220,13 +220,7 @@ var app = new Vue({
},
dayClickList: function(event) {
var dateStr = event.currentTarget.getAttribute('data-distribution-date') ;
/*var arr = dateStr.split(/[- :]/),
dateObject = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]);*/

var dateObject = Date.parse(String(dateStr));

console.log(dateObject) ;
//var dateObject = new Date(dateStr) ;
var dateObject = new Date(dateStr.replace(/-/g, "/")) ;
if(this.isAvailableDate(dateObject)) {
this.dayClickEvent(dateObject) ;
}
@@ -288,7 +282,6 @@ var app = new Vue({
this.changeStep('products') ;
},
productQuantityClick: function(product, quantity) {
console.log(this.products[product.index].quantity_remaining) ;
if( this.products[product.index].quantity_form + quantity >= 0 &&
(this.products[product.index].quantity_form + quantity <= (this.products[product.index].quantity_remaining * this.products[product.index].coefficient_unit) ||
!this.products[product.index].quantity_max)

Loading…
Отказ
Запис