<div id="wrapper-app-distribution-index" :class="'wrapper-app-vuejs '+(loading ? '' : 'loaded')"> | <div id="wrapper-app-distribution-index" :class="'wrapper-app-vuejs '+(loading ? '' : 'loaded')"> | ||||
<div class="col-md-4"> | <div class="col-md-4"> | ||||
<div id="calendar"> | <div id="calendar"> | ||||
<v-date-picker | |||||
<v-calendar | |||||
is-inline | is-inline | ||||
is-expanded | is-expanded | ||||
v-model="date" | v-model="date" | ||||
popover-visibility="hidden" | popover-visibility="hidden" | ||||
firstDayOfWeek="1" | |||||
color="green" | |||||
:mode="calendar.mode" | :mode="calendar.mode" | ||||
:formats="calendar.formats" | :formats="calendar.formats" | ||||
:theme-styles="calendar.themeStyles" | :theme-styles="calendar.themeStyles" | ||||
:attributes="calendar.attrs" | :attributes="calendar.attrs" | ||||
@dayclick='dayClicked'> | @dayclick='dayClicked'> | ||||
></v-date-picker> | |||||
></v-calendar> | |||||
</div> | </div> | ||||
<div class="clr"></div> | <div class="clr"></div> | ||||
</div> | </div> |
if(distributions.length) { | if(distributions.length) { | ||||
for(var i= 0; i < distributions.length; i++) { | for(var i= 0; i < distributions.length; i++) { | ||||
app.calendar.attrs.push({ | app.calendar.attrs.push({ | ||||
highlight: { | |||||
backgroundColor: '#5cb85c', | |||||
}, | |||||
contentStyle: { | |||||
color: 'white', | |||||
}, | |||||
highlight: true, | |||||
dates: distributions[i].date | dates: distributions[i].date | ||||
}) ; | }) ; | ||||
} | } |
$this->addAsset('js','js/promise-polyfill/promise.min.js'); | $this->addAsset('js','js/promise-polyfill/promise.min.js'); | ||||
$this->addAsset('js','js/axios/axios.min.js'); | $this->addAsset('js','js/axios/axios.min.js'); | ||||
$this->addAsset('js','js/vuejs/vue.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') ; | $this->addAsset('js','js/utils.js') ; | ||||
} | } | ||||
} | } |
if (is_array($ordersUserArray) && count($ordersUserArray)) { | if (is_array($ordersUserArray) && count($ordersUserArray)) { | ||||
foreach ($ordersUserArray as &$order) { | foreach ($ordersUserArray as &$order) { | ||||
$orderManager->initOrder($order); | |||||
$order = array_merge($order->getAttributes(), [ | $order = array_merge($order->getAttributes(), [ | ||||
'amount_total' => $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL), | 'amount_total' => $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL), | ||||
'date_distribution' => $order->distribution->date, | 'date_distribution' => $order->distribution->date, | ||||
} | } | ||||
} | } | ||||
if($orderUser) { | |||||
$orderManager->initOrder($orderUser); | |||||
} | |||||
return $orderUser; | return $orderUser; | ||||
} | } | ||||
} | } |
<div id="calendar"> | <div id="calendar"> | ||||
<v-calendar | <v-calendar | ||||
is-inline | is-inline | ||||
is-double-paned | |||||
is-expanded | is-expanded | ||||
v-model="date" | v-model="date" | ||||
mode="single" | mode="single" | ||||
locale="fr" | |||||
:locale="{ id: 'fr', firstDayOfWeek: 1, masks: { weekdays: 'WW' } }" | |||||
:first-day-of-week="1" | |||||
columns="2" | |||||
color="green" | |||||
:formats="calendar.formats" | :formats="calendar.formats" | ||||
:theme-styles="calendar.themeStyles" | :theme-styles="calendar.themeStyles" | ||||
:attributes="calendar.attrs" | :attributes="calendar.attrs" | ||||
<div class="comment" v-if="pointSale.userPointSale"> | <div class="comment" v-if="pointSale.userPointSale"> | ||||
{{ pointSale.userPointSale.comment }} | {{ pointSale.userPointSale.comment }} | ||||
</div> | </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> | ||||
<td class="locality">{{ pointSale.locality }}</td> | <td class="locality">{{ pointSale.locality }}</td> | ||||
<td class="actions"> | <td class="actions"> |
var arrayDate; | var arrayDate; | ||||
for (var i = 0; i < distributions.length; i++) { | for (var i = 0; i < distributions.length; i++) { | ||||
app.calendar.attrs.push({ | 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('-'); | arrayDate = distributions[i].date.split('-'); | ||||
if (app.isAvailableDate(dateOrder)) { | if (app.isAvailableDate(dateOrder)) { | ||||
app.calendar.attrs.push({ | 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' | backgroundColor: '#FF7F00' | ||||
}, | }, | ||||
contentStyle: { | contentStyle: { | ||||
label: orders[i].pointSale.name + ' / ' + app.formatPrice(orders[i].amount_total), | label: orders[i].pointSale.name + ' / ' + app.formatPrice(orders[i].amount_total), | ||||
hideIndicator: true | hideIndicator: true | ||||
}, | }, | ||||
dates: orders[i].date_distribution, | |||||
dates: orders[i].date_distribution,*/ | |||||
}); | }); | ||||
} | } | ||||
} | } |