Explorar el Código

[Administration et Espace producteur] Calendrier pour le choix du jour de distribution : lundi en premier #166

feature/souke
Guillaume hace 1 año
padre
commit
ee78b907b0
Se han modificado 7 ficheros con 30 adiciones y 26 borrados
  1. +3
    -3
      backend/views/distribution/index.php
  2. +1
    -6
      backend/web/js/vuejs/distribution-index.js
  3. +4
    -1
      common/assets/CommonAsset.php
  4. +2
    -0
      common/web/js/vuejs/vcalendar/v-calendar.umd.min.js
  5. +5
    -0
      producer/controllers/OrderController.php
  6. +3
    -7
      producer/views/order/order.php
  7. +12
    -9
      producer/web/js/vuejs/order-order.js

+ 3
- 3
backend/views/distribution/index.php Ver fichero

@@ -67,18 +67,18 @@ $this->setPageTitle('Distributions') ;
<div id="wrapper-app-distribution-index" :class="'wrapper-app-vuejs '+(loading ? '' : 'loaded')">
<div class="col-md-4">
<div id="calendar">
<v-date-picker
<v-calendar
is-inline
is-expanded
v-model="date"
popover-visibility="hidden"
firstDayOfWeek="1"
color="green"
:mode="calendar.mode"
:formats="calendar.formats"
:theme-styles="calendar.themeStyles"
:attributes="calendar.attrs"
@dayclick='dayClicked'>
></v-date-picker>
></v-calendar>
</div>
<div class="clr"></div>
</div>

+ 1
- 6
backend/web/js/vuejs/distribution-index.js Ver fichero

@@ -206,12 +206,7 @@ var app = new Vue({
if(distributions.length) {
for(var i= 0; i < distributions.length; i++) {
app.calendar.attrs.push({
highlight: {
backgroundColor: '#5cb85c',
},
contentStyle: {
color: 'white',
},
highlight: true,
dates: distributions[i].date
}) ;
}

+ 4
- 1
common/assets/CommonAsset.php Ver fichero

@@ -69,7 +69,10 @@ class CommonAsset extends \common\components\MyAssetBundle
$this->addAsset('js','js/promise-polyfill/promise.min.js');
$this->addAsset('js','js/axios/axios.min.js');
$this->addAsset('js','js/vuejs/vue.js');
$this->addAsset('js','js/vuejs/vcalendar/vcalendar.min.js') ;

// Documentation : https://vcalendar.io/
$this->addAsset('js','js/vuejs/vcalendar/v-calendar.umd.min.js') ;

$this->addAsset('js','js/utils.js') ;
}
}

+ 2
- 0
common/web/js/vuejs/vcalendar/v-calendar.umd.min.js
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 5
- 0
producer/controllers/OrderController.php Ver fichero

@@ -752,6 +752,7 @@ class OrderController extends ProducerBaseController

if (is_array($ordersUserArray) && count($ordersUserArray)) {
foreach ($ordersUserArray as &$order) {
$orderManager->initOrder($order);
$order = array_merge($order->getAttributes(), [
'amount_total' => $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL),
'date_distribution' => $order->distribution->date,
@@ -1016,6 +1017,10 @@ class OrderController extends ProducerBaseController
}
}

if($orderUser) {
$orderManager->initOrder($orderUser);
}

return $orderUser;
}
}

+ 3
- 7
producer/views/order/order.php Ver fichero

@@ -150,13 +150,11 @@ $this->setTitle('Commander') ;
<div id="calendar">
<v-calendar
is-inline
is-double-paned
is-expanded
v-model="date"
mode="single"
locale="fr"
:locale="{ id: 'fr', firstDayOfWeek: 1, masks: { weekdays: 'WW' } }"
:first-day-of-week="1"
columns="2"
color="green"
:formats="calendar.formats"
:theme-styles="calendar.themeStyles"
:attributes="calendar.attrs"
@@ -231,9 +229,7 @@ $this->setTitle('Commander') ;
<div class="comment" v-if="pointSale.userPointSale">
{{ pointSale.userPointSale.comment }}
</div>
<div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0">
{{ pointSale.infos }}
</div>
<div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0" v-html="pointSale.infos"></div>
</td>
<td class="locality">{{ pointSale.locality }}</td>
<td class="actions">

+ 12
- 9
producer/web/js/vuejs/order-order.js Ver fichero

@@ -150,13 +150,8 @@ var app = new Vue({
var arrayDate;
for (var i = 0; i < distributions.length; i++) {
app.calendar.attrs.push({
highlight: {
backgroundColor: '#5cb85c',
},
contentStyle: {
color: 'white',
},
dates: distributions[i].date,
highlight: true,
dates: distributions[i].date
});

arrayDate = distributions[i].date.split('-');
@@ -185,7 +180,15 @@ var app = new Vue({
if (app.isAvailableDate(dateOrder)) {

app.calendar.attrs.push({
highlight: {
highlight: true,
popover: {
label: orders[i].pointSale.name + ' / ' + app.formatPrice(orders[i].amount_total),
hideIndicator: true
},
dates: orders[i].date_distribution


/*highlight: {
backgroundColor: '#FF7F00'
},
contentStyle: {
@@ -195,7 +198,7 @@ var app = new Vue({
label: orders[i].pointSale.name + ' / ' + app.formatPrice(orders[i].amount_total),
hideIndicator: true
},
dates: orders[i].date_distribution,
dates: orders[i].date_distribution,*/
});
}
}

Cargando…
Cancelar
Guardar