|
|
@@ -43,175 +43,196 @@ $this->setTitle('Commander') ; |
|
|
|
?> |
|
|
|
|
|
|
|
<div id="app-order-order"> |
|
|
|
<div :class="(producer != null && producer.order_infos.length) ? 'col-md-9' : 'col-md-12'"> |
|
|
|
<div id="steps"> |
|
|
|
<ul> |
|
|
|
<li id="step-date" :class="'col-md-3 '+((step == 'date') ? 'active' : '')"> |
|
|
|
<div class="info-step" v-if="dateFormat"> |
|
|
|
{{ dateFormat }} |
|
|
|
</div> |
|
|
|
<button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-default')"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
<li id="step-point-sale" :class="'col-md-3 '+((step == 'point-sale') ? 'active ' : '')"> |
|
|
|
<div class="info-step" v-if="pointSaleActive"> |
|
|
|
{{ pointSaleActive.name }} |
|
|
|
</div> |
|
|
|
<button @click="changeStep('point-sale')" :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')" :disabled="step == 'date'"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-map-marker"></span> Points de vente</span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
<li id="step-products" :class="'col-md-3 '+((step == 'products') ? 'active ' : '')"> |
|
|
|
<div class="info-step" v-if="oneProductOrdered()"> |
|
|
|
{{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }} |
|
|
|
</div> |
|
|
|
<button @click="changeStep('products')" :class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')" :disabled="step == 'date' || step == 'point-sale'"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-th-list"></span> Produits</span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
<li id="step-payment" :class="'col-md-3 '+((step == 'payment') ? 'active' : '')"> |
|
|
|
<button @click="changeStep('payment')" :class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-default')" :disabled="step == 'date' || step == 'point-sale' || step == 'products'"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-ok"></span> Paiement</span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<div class="clr"></div> |
|
|
|
</div> |
|
|
|
<div class="content"> |
|
|
|
<div id="content-step-date" v-if="step == 'date'"> |
|
|
|
<div id="calendar"> |
|
|
|
<v-date-picker |
|
|
|
is-inline |
|
|
|
is-expanded |
|
|
|
v-model="date" |
|
|
|
mode="single" |
|
|
|
:formats="calendar.formats" |
|
|
|
:theme-styles="calendar.themeStyles" |
|
|
|
:attributes="calendar.attrs" |
|
|
|
@dayclick='dayClick'> |
|
|
|
></v-date-picker> |
|
|
|
</div> |
|
|
|
<div v-if="orderSuccess" class="alert alert-success" id="order-success"> |
|
|
|
<span class="glyphicon glyphicon-ok"></span> Votre commande a bien été prise en compte. |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<div :class="(producer != null && producer.order_infos.length) ? 'col-md-9' : 'col-md-12'"> |
|
|
|
<div id="steps"> |
|
|
|
<ul> |
|
|
|
<li id="step-date" :class="'col-md-3 '+((step == 'date') ? 'active' : '')"> |
|
|
|
<div class="info-step" v-if="dateFormat"> |
|
|
|
{{ dateFormat }} |
|
|
|
</div> |
|
|
|
<button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-default')"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
<li id="step-point-sale" :class="'col-md-3 '+((step == 'point-sale') ? 'active ' : '')"> |
|
|
|
<div class="info-step" v-if="pointSaleActive"> |
|
|
|
{{ pointSaleActive.name }} |
|
|
|
</div> |
|
|
|
<button @click="changeStep('point-sale')" :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')" :disabled="step == 'date'"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-map-marker"></span> Points de vente</span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
<li id="step-products" :class="'col-md-3 '+((step == 'products') ? 'active ' : '')"> |
|
|
|
<div class="info-step" v-if="oneProductOrdered()"> |
|
|
|
{{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }} |
|
|
|
</div> |
|
|
|
<button @click="changeStep('products')" :class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')" :disabled="step == 'date' || step == 'point-sale'"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-th-list"></span> Produits</span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
<li id="step-payment" :class="'col-md-3 '+((step == 'payment') ? 'active' : '')"> |
|
|
|
<button @click="changeStep('payment')" :class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-default')" :disabled="step == 'date' || step == 'point-sale' || step == 'products'"> |
|
|
|
<span class="button-content"><span class="glyphicon glyphicon-ok"></span> Confirmation</span> |
|
|
|
</button> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<div class="clr"></div> |
|
|
|
</div> |
|
|
|
<div id="content-step-point-sale" v-if="step == 'point-sale'"> |
|
|
|
<table class="table table-bordered" v-if="pointsSale.length"> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<th>Nom</th> |
|
|
|
<th>Localité</th> |
|
|
|
<th></th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tr v-for="pointSale in pointsSale" v-if="pointSale.pointSaleDistribution.delivery"> |
|
|
|
<td class="name"> |
|
|
|
{{ pointSale.name }} |
|
|
|
<div class="comment" v-if="pointSale.userPointSale"> |
|
|
|
{{ pointSale.userPointSale.comment }} |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
<td>{{ pointSale.locality }}</td> |
|
|
|
<td> |
|
|
|
<button class="btn btn-default" @click="pointSaleClick" :data-id-point-sale="pointSale.id"> |
|
|
|
<span class="glyphicon glyphicon-map-marker"></span> |
|
|
|
Choisir |
|
|
|
</button> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
<div class="alert alert-warning" v-else> |
|
|
|
Aucun point de vente disponible pour ce jour de distribution. |
|
|
|
<div class="content"> |
|
|
|
<div id="content-step-date" v-if="step == 'date'"> |
|
|
|
<div id="calendar"> |
|
|
|
<v-date-picker |
|
|
|
is-inline |
|
|
|
is-expanded |
|
|
|
v-model="date" |
|
|
|
mode="single" |
|
|
|
:formats="calendar.formats" |
|
|
|
:theme-styles="calendar.themeStyles" |
|
|
|
:attributes="calendar.attrs" |
|
|
|
@dayclick='dayClick'> |
|
|
|
></v-date-picker> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="content-step-products" v-if="step == 'products'"> |
|
|
|
<div v-if="products.length"> |
|
|
|
<table id="products" class="table table-bordered" > |
|
|
|
<div id="content-step-point-sale" v-if="step == 'point-sale'"> |
|
|
|
<table class="table table-bordered" v-if="pointsSale.length"> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<th>Nom</th> |
|
|
|
<th>Prix unitaire</th> |
|
|
|
<th>Quantité</th> |
|
|
|
<th>Total</th> |
|
|
|
<th>Localité</th> |
|
|
|
<th></th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tr v-for="product in products" v-if="product.productDistribution[0].active == 1"> |
|
|
|
<tr v-for="pointSale in pointsSale" v-if="pointSale.pointSaleDistribution.delivery"> |
|
|
|
<td class="name"> |
|
|
|
<span class="name">{{ product.name }}</span> |
|
|
|
<span class="other"> |
|
|
|
<span v-if="product.description.length">/</span> |
|
|
|
<span class="description">{{ product.description }}</span> |
|
|
|
<span v-if="product.weight">({{ product.weight }}g)</span> |
|
|
|
</span> |
|
|
|
<span v-if="product.quantity_remaining - product.quantity_form == 0 && product.quantity_max > 0" class="label label-danger"> |
|
|
|
Épuisé |
|
|
|
</span> |
|
|
|
<div class="recipe" v-if="product.recipe.length">{{ product.recipe }}</div> |
|
|
|
</td> |
|
|
|
<td class="price-unit"> |
|
|
|
{{ formatPrice(product.price) }} |
|
|
|
</td> |
|
|
|
<td class="td-quantity"> |
|
|
|
<div class="input-group"> |
|
|
|
<span class="input-group-btn"> |
|
|
|
<button class="btn btn-default btn-moins" type="button" @click="productQuantityClick(product, -1)"><span class="glyphicon glyphicon-minus"></span></button> |
|
|
|
</span> |
|
|
|
<input type="text" v-model="product.quantity_form" class="form-control quantity" /> |
|
|
|
<span class="input-group-btn"> |
|
|
|
<button class="btn btn-default btn-plus" type="button" @click="productQuantityClick(product, 1)"><span class="glyphicon glyphicon-plus"></span></button> |
|
|
|
</span> |
|
|
|
<span class="glyphicon glyphicon-lock" v-if="pointSale.code.length > 0"></span> {{ pointSale.name }} |
|
|
|
<div class="comment" v-if="pointSale.userPointSale"> |
|
|
|
{{ pointSale.userPointSale.comment }} |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
<td class="price-total"> |
|
|
|
{{ formatPrice(product.price * product.quantity_form) }} |
|
|
|
<td>{{ pointSale.locality }}</td> |
|
|
|
<td> |
|
|
|
<input v-if="pointSale.code.length > 0" v-model="codePointSale" type="password" placeholder="Code" class="form-control input-code" /> |
|
|
|
<button class="btn btn-default" @click="pointSaleClick" :data-id-point-sale="pointSale.id"> |
|
|
|
<span class="glyphicon glyphicon-map-marker"></span> |
|
|
|
Choisir |
|
|
|
</button> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td colspan="3"></td> |
|
|
|
<td class="price-total">{{ priceTotal() }}</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
<div class="block-actions"> |
|
|
|
<button class="btn btn-primary" @click="changeStep('payment')">Valider</button> |
|
|
|
<div class="alert alert-warning" v-else> |
|
|
|
Aucun point de vente disponible pour ce jour de distribution. |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="alert alert-warning" v-else> |
|
|
|
Aucun produit disponible |
|
|
|
<div id="content-step-products" v-if="step == 'products'"> |
|
|
|
<div v-if="products.length"> |
|
|
|
<table id="products" class="table table-bordered" > |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<th>Nom</th> |
|
|
|
<th>Prix unitaire</th> |
|
|
|
<th>Quantité</th> |
|
|
|
<th>Total</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tr v-for="product in products" v-if="product.productDistribution[0].active == 1"> |
|
|
|
<td class="name"> |
|
|
|
<span class="name">{{ product.name }}</span> |
|
|
|
<span class="other"> |
|
|
|
<span v-if="product.description.length">/</span> |
|
|
|
<span class="description">{{ product.description }}</span> |
|
|
|
<span v-if="product.weight">({{ product.weight }}g)</span> |
|
|
|
</span> |
|
|
|
<span v-if="product.quantity_remaining - product.quantity_form == 0 && product.quantity_max > 0" class="label label-danger"> |
|
|
|
Épuisé |
|
|
|
</span> |
|
|
|
<div class="recipe" v-if="product.recipe.length">{{ product.recipe }}</div> |
|
|
|
</td> |
|
|
|
<td class="price-unit"> |
|
|
|
{{ formatPrice(product.price) }} |
|
|
|
</td> |
|
|
|
<td class="td-quantity"> |
|
|
|
<div class="input-group"> |
|
|
|
<span class="input-group-btn"> |
|
|
|
<button class="btn btn-default btn-moins" type="button" @click="productQuantityClick(product, -1)"><span class="glyphicon glyphicon-minus"></span></button> |
|
|
|
</span> |
|
|
|
<input type="text" v-model="product.quantity_form" class="form-control quantity" /> |
|
|
|
<span class="input-group-btn"> |
|
|
|
<button class="btn btn-default btn-plus" type="button" @click="productQuantityClick(product, 1)"><span class="glyphicon glyphicon-plus"></span></button> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
<td class="price-total"> |
|
|
|
{{ formatPrice(product.price * product.quantity_form) }} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td colspan="3"></td> |
|
|
|
<td class="price-total">{{ priceTotal() }}</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
<div class="block-actions"> |
|
|
|
<button class="btn btn-primary" @click="changeStep('payment')">Valider</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="alert alert-warning" v-else> |
|
|
|
Aucun produit disponible |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="content-step-payment" v-if="step == 'payment'"> |
|
|
|
<div class="comment"> |
|
|
|
<label for="order-comment">Commentaire</label> |
|
|
|
<textarea id="order-comment" v-model="comment" class="form-control"></textarea> |
|
|
|
</div> |
|
|
|
<div class="credit"> |
|
|
|
<input type="checkbox" id="checkbox-credit" v-model="creditCheckbox" /> |
|
|
|
<label for="checkbox-credit">Utiliser mon Crédit : {{ formatPrice(credit) }}</label> |
|
|
|
<div class="info"> |
|
|
|
<span v-if="creditCheckbox == true"> |
|
|
|
{{ priceTotal() }} seront débités |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="block-actions"> |
|
|
|
<button class="btn btn-primary" @click="confirmClick">Je confirme ma commande</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="content-step-payment" v-if="step == 'payment'"> |
|
|
|
Paiement |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id="infos" class="col-md-3" v-if="producer != null && producer.order_infos.length"> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
Informations |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
{{ producer.order_infos }} |
|
|
|
|
|
|
|
|
|
|
|
<!--<span class="glyphicon glyphicon-time"></span> {{ dateFormat }} |
|
|
|
<div v-if="pointSaleActive"> |
|
|
|
<span class="glyphicon glyphicon-map-marker"></span> |
|
|
|
{{ pointSaleActive.name }} |
|
|
|
<div id="infos" class="col-md-3" v-if="producer != null && producer.order_infos.length"> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
Informations |
|
|
|
</div> |
|
|
|
<div class="products" v-if="products.length && oneProductOrdered()"> |
|
|
|
<span class="glyphicon glyphicon-th-list"></span> |
|
|
|
<ul> |
|
|
|
<li v-for="product in products" v-if="product.quantity_form"> |
|
|
|
{{ product.quantity_form }} x {{ product.name }} |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<div class="panel-body"> |
|
|
|
{{ producer.order_infos }} |
|
|
|
|
|
|
|
|
|
|
|
<!--<span class="glyphicon glyphicon-time"></span> {{ dateFormat }} |
|
|
|
<div v-if="pointSaleActive"> |
|
|
|
<span class="glyphicon glyphicon-map-marker"></span> |
|
|
|
{{ pointSaleActive.name }} |
|
|
|
</div> |
|
|
|
<div class="products" v-if="products.length && oneProductOrdered()"> |
|
|
|
<span class="glyphicon glyphicon-th-list"></span> |
|
|
|
<ul> |
|
|
|
<li v-for="product in products" v-if="product.quantity_form"> |
|
|
|
{{ product.quantity_form }} x {{ product.name }} |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
<div class="products" v-if="products.length && oneProductOrdered()"> |
|
|
|
<span class="glyphicon glyphicon-euro"></span> |
|
|
|
{{ priceTotal() }} |
|
|
|
</div>--> |
|
|
|
</div> |
|
|
|
<div class="products" v-if="products.length && oneProductOrdered()"> |
|
|
|
<span class="glyphicon glyphicon-euro"></span> |
|
|
|
{{ priceTotal() }} |
|
|
|
</div>--> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |