您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2 个月前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. <?php
  2. /**
  3. Copyright Guillaume Bourgeois (2018)
  4. contact@souke.fr
  5. Ce logiciel est un programme informatique servant à aider les producteurs
  6. à distribuer leur production en circuits courts.
  7. Ce logiciel est régi par la licence CeCILL soumise au droit français et
  8. respectant les principes de diffusion des logiciels libres. Vous pouvez
  9. utiliser, modifier et/ou redistribuer ce programme sous les conditions
  10. de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
  11. sur le site "http://www.cecill.info".
  12. En contrepartie de l'accessibilité au code source et des droits de copie,
  13. de modification et de redistribution accordés par cette licence, il n'est
  14. offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
  15. seule une responsabilité restreinte pèse sur l'auteur du programme, le
  16. titulaire des de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
  17. droits patrimoniaux et les concédants successifs.
  18. A cet égard l'attention de l'utilisateur est attirée sur les risques
  19. associés au chargement, à l'utilisation, à la modification et/ou au
  20. développement et à la reproduction du logiciel par l'utilisateur étant
  21. donné sa spécificité de logiciel libre, qui peut le rendre complexe à
  22. manipuler et qui le réserve donc à des développeurs et des professionnels
  23. avertis possédant des connaissances informatiques approfondies. Les
  24. utilisateurs sont donc invités à charger et tester l'adéquation du
  25. logiciel à leurs besoins dans des conditions permettant d'assurer la
  26. sécurité de leurs systèmes et ou de leurs données et, plus généralement,
  27. à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
  28. Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
  29. pris connaissance de la licence CeCILL, et que vous en avez accepté les
  30. termes.
  31. */
  32. $this->setTitle('Distributions') ;
  33. $this->setPageTitle('Distributions') ;
  34. ?>
  35. <?php if($orderUpdate):
  36. $orderUpdateDistributionTimestamp = strtotime($orderUpdate->distribution->date);
  37. ?>
  38. <script>
  39. window.vueValues = {
  40. date: new Date(<?= date('Y', $orderUpdateDistributionTimestamp) ?>, <?= date('m', $orderUpdateDistributionTimestamp) - 1 ?>, <?= date('d', $orderUpdateDistributionTimestamp) ?>),
  41. dateFormat: '<?= date('d/m/Y', $orderUpdateDistributionTimestamp) ?>',
  42. showModalFormOrderUpdate: true,
  43. idOrderUpdate: <?= $orderUpdate->id ?>
  44. };
  45. </script>
  46. <?php endif; ?>
  47. <div id="app-distribution-index" class="app-vuejs">
  48. <?php if(strlen($date)): ?>
  49. <span id="distribution-date"><?= $date; ?></span>
  50. <?php endif; ?>
  51. <div id="loading" v-if="showLoading">
  52. <img src="<?= Yii::$app->urlManagerBackend->getBaseUrl(); ?>/img/loader.gif" alt="Chargement ..." />
  53. </div>
  54. <div id="wrapper-app-distribution-index" :class="'wrapper-app-vuejs '+(loading ? '' : 'loaded')">
  55. <div class="col-md-4">
  56. <div id="calendar">
  57. <v-calendar
  58. is-inline
  59. is-expanded
  60. v-model="date"
  61. popover-visibility="hidden"
  62. color="green"
  63. :mode="calendar.mode"
  64. :formats="calendar.formats"
  65. :theme-styles="calendar.themeStyles"
  66. :attributes="calendar.attrs"
  67. @dayclick='dayClicked'>
  68. ></v-calendar>
  69. </div>
  70. <div class="clr"></div>
  71. </div>
  72. <div class="col-md-8">
  73. <div v-if="date">
  74. <div id="infos-top">
  75. <div class="col-md-12">
  76. <div class="info-box" id="info-box-distribution">
  77. <span :class="'info-box-icon '+(distribution.active ? 'bg-green' : 'bg-red')"><i :class="'fa '+(distribution.active ? 'fa-check' : 'fa-remove')"></i></span>
  78. <div class="info-box-content">
  79. <span class="info-box-text">
  80. <h4>
  81. Distribution du <strong>{{ dateFormat }}</strong>
  82. <a v-if="distribution.active" class="btn btn-default" :href="distribution.url_order" @click="copyLinkOrder($event, distribution.url_order)"><span class="glyphicon glyphicon-link"></span></a>
  83. <span v-if="distribution.is_leave_period" class="label label-default">
  84. <span class="glyphicon glyphicon-info-sign"></span>
  85. Congés
  86. </span>
  87. </h4>
  88. <a @click="activeWeekDistribution" data-active="0" class="btn btn-default btn-active-week" v-if="oneDistributionWeekActive">Désactiver cette semaine</a>
  89. <a @click="activeWeekDistribution" data-active="1" class="btn btn-default btn-active-week" v-else>Activer cette semaine</a>
  90. <a @click="activeDistribution" data-active="0" class="btn btn-default" v-if="distribution.active">Désactiver ce jour</a>
  91. <a @click="activeDistribution" data-active="1" class="btn btn-default" v-else>Activer ce jour</a>
  92. </span>
  93. </div>
  94. </div>
  95. </div>
  96. <!-- produits -->
  97. <div class="col-md-6">
  98. <div class="info-box col-md-4">
  99. <span class="info-box-icon bg-yellow"><i class="fa fa-clone"></i></span>
  100. <div class="info-box-content">
  101. <span class="info-box-text">
  102. {{ countActiveProducts }} Produits<br />
  103. <template v-if="isOneProductMaximumQuantityExceeded()"><span class="glyphicon glyphicon-alert"></span> Quantités max dépassées<br /></template>
  104. <br />
  105. <button class="btn btn-default" @click="showModalProducts = true">Configurer</button>
  106. </span>
  107. </div>
  108. </div>
  109. </div>
  110. <modal v-if="showModalProducts" id="modal-products" @close="showModalProducts = false">
  111. <h3 slot="header">Produits</h3>
  112. <div slot="body">
  113. <table class="table table-condensed table-bordered table-hover">
  114. <thead>
  115. <tr>
  116. <td>Actif</td>
  117. <td>Nom</td>
  118. <td class="quantity-ordered">Commandé</td>
  119. <td class="quantity-remaining">Reste</td>
  120. <td class="quantity-max">Maximum</td>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. <tr v-for="product in products" v-if="getProductDistribution(product)">
  125. <td>
  126. <button class="btn btn-success" v-if="getProductDistribution(product).active == 1"><span class="glyphicon glyphicon-ok"></span></button>
  127. <button class="btn btn-default" v-else data-active-product="1" :data-id-product="product.id" @click="productActiveClick"><span class="glyphicon glyphicon-ok"></span></button>
  128. <button class="btn btn-danger" v-if="getProductDistribution(product).active == 0"><span class="glyphicon glyphicon-remove"></span></button>
  129. <button class="btn btn-default" v-else data-active-product="0" :data-id-product="product.id" @click="productActiveClick"><span class="glyphicon glyphicon-remove"></span></button>
  130. </td>
  131. <td>{{ product.name }}</td>
  132. <td class="quantity-ordered">
  133. {{ product.quantity_ordered ? product.quantity_ordered + ' '+ ((product.unit == 'piece') ? ' p.' : ' '+(product.unit == 'g' || product.unit == 'kg') ? 'kg' : 'litre(s)') : '&empty;' }}
  134. </td>
  135. <td class="quantity-remaining">
  136. <span class="infinite" v-if="(getProductQuantityRemainingGlobal(product) === null)">&infin;</span>
  137. <span class="negative" v-else-if="getProductQuantityRemainingGlobal(product) <= 0">
  138. {{ getProductQuantityRemainingGlobal(product) }} {{ product.unit == 'piece' ? ' p.' : ' '+(product.unit == 'g' || product.unit == 'kg') ? 'kg' : 'litre(s)' }}
  139. <span class="glyphicon glyphicon-alert" v-if="getProductQuantityRemainingGlobal(product) < 0"></span>
  140. </span>
  141. <span class="has-quantity" v-else>{{ getProductQuantityRemainingGlobal(product) }} {{ product.unit == 'piece' ? ' p.' : ' '+(product.unit == 'g' || product.unit == 'kg') ? 'kg' : 'litre(s)' }}</span>
  142. </td>
  143. <td class="quantity-max">
  144. <div class="input-group">
  145. <input type="text" class="form-control quantity-max" placeholder="&infin;" :data-id-product="product.id" v-model="getProductDistribution(product).quantity_max" @keyup="productQuantityMaxChange" />
  146. <span class="input-group-addon">{{ labelUnitReference(product.unit) }}</span>
  147. </div>
  148. <div class="limit-quantity-accessories" v-if="producer.feature_product_accessory_enabled && !showLoading && product.quantity_max && (getProductDistribution(product).quantity_max > product.quantity_max || !getProductDistribution(product).quantity_max)">
  149. <span class="glyphicon glyphicon-warning-sign"></span> Limitation accessoires :
  150. <strong>{{ product.quantity_max }} {{ labelUnitReference(product.unit) }}</strong>
  151. </div>
  152. </td>
  153. </tr>
  154. </tbody>
  155. </table>
  156. </div>
  157. <div slot="footer">
  158. <div class="actions-form">
  159. <button class="modal-default-button btn btn-default" @click="closeModalProducts">Fermer</button>
  160. </div>
  161. </div>
  162. </modal>
  163. <div class="col-md-6">
  164. <div class="info-box col-md-4">
  165. <span class="info-box-icon bg-yellow"><i class="fa fa-map-marker"></i></span>
  166. <div class="info-box-content">
  167. <span class="info-box-text">
  168. {{ countActivePointsSale }} Points de vente<br /><br />
  169. <button class="btn btn-default" @click="showModalPointsSale = true">Configurer</button>
  170. </span>
  171. </div>
  172. </div>
  173. </div>
  174. <modal v-if="showModalPointsSale" id="modal-points-sale" @close="showModalPointsSale = false">
  175. <h3 slot="header">Points de vente</h3>
  176. <div slot="body">
  177. <table class="table table-condensed table-bordered table-hover">
  178. <thead>
  179. <tr>
  180. <td>Actif</td>
  181. <td>Nom</td>
  182. </tr>
  183. </thead>
  184. <tbody>
  185. <tr v-for="pointSale in pointsSale" v-if="pointSale.status == 1">
  186. <td>
  187. <button class="btn btn-success" v-if="pointSale.pointSaleDistribution[0].delivery == 1"><span class="glyphicon glyphicon-ok"></span></button>
  188. <button class="btn btn-default" v-else data-delivery-point-sale="1" :data-id-point-sale="pointSale.id" @click="pointSaleActiveClick"><span class="glyphicon glyphicon-ok"></span></button>
  189. <button class="btn btn-danger" v-if="pointSale.pointSaleDistribution[0].delivery == 0"><span class="glyphicon glyphicon-remove"></span></button>
  190. <button class="btn btn-default" v-else data-delivery-point-sale="0" :data-id-point-sale="pointSale.id" @click="pointSaleActiveClick"><span class="glyphicon glyphicon-remove"></span></button>
  191. </td>
  192. <td>{{ pointSale.name }}</td>
  193. </tr>
  194. </tbody>
  195. </table>
  196. </div>
  197. </modal>
  198. <div class="col-md-6">
  199. <div id="summary-ca-weight" class="info-box col-md-4">
  200. <span class="info-box-icon bg-yellow"><i class="fa fa-euro"></i></span>
  201. <div class="info-box-content">
  202. <span class="info-box-text">CA réel / potentiel (HT)</span>
  203. <span class="info-box-number">
  204. <span data-toggle="tooltip" data-placement="bottom" :data-original-title="distribution.revenues_with_tax+' TTC'">{{ distribution.revenues }}</span>
  205. <span class="normal" v-if="distribution.potential_revenues != '0,00 €'">/ <span data-toggle="tooltip" data-placement="bottom" :data-original-title="distribution.potential_revenues_with_tax+' TTC'">{{ distribution.potential_revenues }}</span></span>
  206. </span>
  207. <span class="info-box-text">Poids</span>
  208. <span class="info-box-number">{{ distribution.weight }} kg <span class="normal" v-if="distribution.potential_weight > 0">/ {{ distribution.potential_weight }} kg</span></span>
  209. </div>
  210. </div>
  211. </div>
  212. <div class="col-md-6">
  213. <div class="info-box col-md-4">
  214. <span class="info-box-icon bg-yellow"><i class="fa fa-download"></i></span>
  215. <div class="info-box-content">
  216. <span class="info-box-text">
  217. {{ countOrders }} Commande<span v-if="countOrders > 1">s</span><br />
  218. <template v-for="distributionExport in distribution.exports">
  219. <a v-if="countOrders > 0" :href="distributionExport.url" target="_blank" class="btn btn-xs btn-default">{{ distributionExport.label }}</a><br />
  220. </template>
  221. <!--<a :href="distribution.url_report+'&type=csv'" class="btn btn-xs btn-default" v-if="countOrders > 0">Tableau (CSV)</a>
  222. <a :href="distribution.url_report_csv2" class="btn btn-xs btn-default" v-if="countOrders > 0">Tableau 2 (CSV)</a>
  223. <br />
  224. <a :href="distribution.url_report_grid" class="btn btn-xs btn-default" v-if="producer && producer.option_distribution_export_orders_grid_pdf && countOrders > 0">Grille (PDF)</a>
  225. <a :href="distribution.url_export_shopping_cart_labels" class="btn btn-xs btn-default" v-if="countOrders > 0">Étiquettes (PDF)</a>
  226. <a :href="distribution.url_report_total_products" class="btn btn-xs btn-default" v-if="countOrders > 0">Total produits (CSV)</a>-->
  227. </span>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. <div class="callout callout-info" v-else>
  234. <h4><i class="fa fa-info"></i> Pour commencer</h4>
  235. <p>Veuillez choisir une date de distribution.</p>
  236. </div>
  237. </div>
  238. <div class="clr"></div>
  239. <div id="orders" class="panel panel-default" v-if="date">
  240. <div class="panel-heading">
  241. <h3 class="panel-title">Commandes <label class="label label-success" v-if="orders.length">{{ orders.length }}</label><label class="label label-danger" v-else>0</label></h3>
  242. <div class="buttons">
  243. </div>
  244. </div>
  245. <div class="panel-body">
  246. <order-form
  247. v-if="showModalFormOrderCreate"
  248. create="1"
  249. :date="date"
  250. :distribution="distribution"
  251. :order="orderCreate"
  252. :points-sale="pointsSale"
  253. :id-active-point-sale="idActivePointSale"
  254. :means-payment="meansPayment"
  255. :users="users"
  256. :products="products"
  257. :producer="producer"
  258. :orders="ordersUpdate"
  259. :loading-update-product-order="loadingUpdateProductOrder"
  260. :units="units"
  261. @close="closeModalOrderForm(true)"
  262. @ordercreatedupdated="orderCreatedUpdated"
  263. @updateproductorders="updateProductOrders"
  264. ></order-form>
  265. <div id="wrapper-nav-points-sale">
  266. <ul id="nav-points-sale">
  267. <li data-id-point-sale="0" data-id-point-sale="0" v-if="countActivePointsSale > 1" @click="pointSaleClick">
  268. <a class="btn btn-default btn-primary" v-if="idActivePointSale == 0">Tous <span class="label label-default">{{ orders.length }}</span> <span class="glyphicon glyphicon-triangle-bottom"></span></a>
  269. <a class="btn btn-default" v-else>Tous <span class="label label-default">{{ orders.length }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
  270. </li>
  271. <li v-for="pointSale in pointsSale" :data-id-point-sale="pointSale.id" v-if="pointSale.pointSaleDistribution[0].delivery == 1 && (pointSale.status == 1 || countOrdersByPointSale[pointSale.id] > 0)" @click="pointSaleClick">
  272. <a class="btn btn-default btn-primary" v-if="idActivePointSale == pointSale.id">{{ pointSale.name }} <span class="label label-default">{{ countOrdersByPointSale[pointSale.id] }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
  273. <a class="btn btn-default" v-else>{{ pointSale.name }} <span class="label label-default">{{ countOrdersByPointSale[pointSale.id] }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
  274. </li>
  275. </ul>
  276. <div class="clr"></div>
  277. </div>
  278. <div id="buttons-top-orders">
  279. <div class="right">
  280. <div class="dropdown">
  281. <button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
  282. <span class="glyphicon glyphicon-file"></span> Documents
  283. <span class="caret"></span>
  284. </button>
  285. <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
  286. <li><a v-if="idActivePointSale > 0 && pointSaleActive.button_generate_delivery_note_point_sale == 1" @click="generateDeliveryNotePointSale" href="javascript:void(0);" >Générer un bon de livraison pour ce point de vente</a></li>
  287. <li><a v-if="idActivePointSale > 0 && pointSaleActive.button_generate_delivery_note_each_user == 1" @click="generateDeliveryNoteEachUser" href="javascript:void(0);">Générer un bon de livraison pour chaque client</a></li>
  288. <li><a @click="validateDeliveryNotes" href="javascript:void(0);">Valider les bons de livraisons</a></li>
  289. </ul>
  290. </div>
  291. <button id="btn-add-subscriptions" @click="addSubscriptions" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span> Importer les abonnements</button>
  292. <template v-if="producer && producer.tiller == true">
  293. <template v-if="tillerIsAuthenticated">
  294. <button v-if="tillerIsSynchro" id="btn-tiller" class="btn btn-success btn-xs" disabled><span class="glyphicon glyphicon-refresh"></span> Synchronisé avec Tiller</button>
  295. <template v-else-if="!isDistributionToday()">
  296. <span data-toggle="tooltip" data-placement="top" data-original-title="Synchronisation possible uniquement le jour de la distribution">
  297. <button id="btn-tiller" class="btn btn-xs btn-default" disabled><span class="glyphicon glyphicon-refresh"></span> Synchroniser avec Tiller</button>
  298. </span>
  299. </template>
  300. <button v-else id="btn-tiller" class="btn btn-xs btn-default" @click="synchroTiller">
  301. <span class="glyphicon glyphicon-refresh"></span>
  302. Synchroniser avec Tiller
  303. </button>
  304. </template>
  305. <template v-else>
  306. <a :href="tillerUrlAuthorizeCode" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-refresh"></span> Connexion Tiller</a>
  307. </template>
  308. </template>
  309. <button v-if="producer && producer.credit" id="btn-pay-orders" class="btn btn-default btn-xs" @click="payOrders"><span class="glyphicon glyphicon-euro"></span> Débiter les commandes</button>
  310. <button id="btn-add-order" @click="openModalFormOrderCreate" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button>
  311. </div>
  312. <div class="left">
  313. <a v-if="false && deliveryNoteExist(idActivePointSale)" :href="UrlManager.getBaseUrl()+'delivery-note/update?id='+deliveryNotes[idActivePointSale].id" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-file"></span> Bon de livraison</a>
  314. </div>
  315. <div class="clr"></div>
  316. </div>
  317. <div class="alert alert-info" v-if="missingSubscriptions && missingSubscriptions.length > 0">
  318. <span class="glyphicon glyphicon-info-sign"></span>
  319. {{ missingSubscriptions.length }} abonnement<template v-if="missingSubscriptions.length > 1">s</template> manquant<template v-if="missingSubscriptions.length > 1">s</template> :
  320. <span v-for="(subscription, index) in missingSubscriptions">
  321. {{ subscription.username }}<template v-if="index != missingSubscriptions.length - 1">, </template><template v-else>.</template>
  322. </span>
  323. </div>
  324. <div class="alert alert-info" v-if="producer && producer.tiller == true && orders.length > 0 && tillerTotalAmountOrders">
  325. Montant total commandes Tiller : {{ tillerTotalAmountOrders }}
  326. </div>
  327. <div class="alert alert-danger" v-if="distribution && !distribution.active && orders && orders.length > 0">
  328. Attention, ce jour de distribution n'est pas activé et vous avez quand même des commandes enregistrées.
  329. </div>
  330. <div v-if="idActivePointSale > 0 && (totalActivePointSale() > 0 || weightActivePointSale() > 0 || pointSaleActive.producers_sharing_point_sale_as_string)" class="point-sale-totals">
  331. <div v-if="totalActivePointSale() > 0 || weightActivePointSale() > 0">
  332. <span class="title">Totaux</span>
  333. CA TTC : <strong>{{ totalActivePointSale() }} €</strong> / Poids : <strong>{{ weightActivePointSale() }} kg</strong>
  334. </div>
  335. <div v-if="producer.credit && pointSaleActive">
  336. <span class="title">Cagnotte</span>
  337. <template v-if="pointSaleActive.payment_method_credit && pointSaleActive.payment_method_credit == 1">
  338. <template v-if="pointSaleActive.credit_functioning == 'mandatory'">Obligatoire</template>
  339. <template v-else-if="pointSaleActive.credit_functioning == 'user'">Basé sur l'utilisateur</template>
  340. <template v-else-if="pointSaleActive.credit_functioning == 'optional'">Optionnel</template>
  341. </template>
  342. <template v-else>Désactivé</template>
  343. </div>
  344. <div v-if="pointSaleActive.producers_sharing_point_sale_as_string">
  345. <span class="title">Point de vente partagé</span>
  346. <i class="fa fa-share-alt"></i> {{ pointSaleActive.producers_sharing_point_sale_as_string }}
  347. </div>
  348. </div>
  349. <table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)">
  350. <thead>
  351. <tr>
  352. <th class="column-checkbox" v-if="idActivePointSale > 0">
  353. <input type="checkbox" v-model="checkboxSelectAllOrders" @change="selectAllOrdersEvent" />
  354. </th>
  355. <th class="column-state">Statut</th>
  356. <th class="column-origin">Origine</th>
  357. <th class="column-user">Utilisateur</th>
  358. <th class="column-point-sale" v-if="idActivePointSale == 0">Point de vente</th>
  359. <th class="column-amount">Montant</th>
  360. <th class="column-state-payment">Paiement</th>
  361. <th class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.payment_method_credit == 1)">Cagnotte</th>
  362. <th class="column-actions">Actions</th>
  363. <th class="column-tiller" v-if="producer && producer.tiller">Tiller</th>
  364. </tr>
  365. </thead>
  366. <tbody>
  367. <template v-for="(order, key, index) in orders" v-if="idActivePointSale == 0 || idActivePointSale == order.id_point_sale">
  368. <tr>
  369. <td class="column-checkbox" v-if="idActivePointSale > 0">
  370. <input type="checkbox" v-model="order.selected" />
  371. </td>
  372. <td class="column-state">
  373. <span v-if="order.order_status_alias == 'canceled'" class="label label-danger" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-trash"></span></span>
  374. <span v-if="order.order_status_alias == 'updated'" class="label label-warning" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-pencil"></span></span>
  375. <span v-if="order.order_status_alias == 'ordered'" class="label label-success" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-check"></span></span>
  376. <span v-if="containUnactiveProduct(order)" class="glyphicon glyphicon-warning-sign" title="Cette commande contient un produit qui n'est pas activé"></span>
  377. </td>
  378. <td class="column-origin" v-html="order.labelOrigin"></td>
  379. <td class="column-user">
  380. <a v-if="order.user" :href="baseUrl+'/user/view?id='+order.id_user" target="_blank" :class="order.user.trust_alert ? 'user-trust-alert' : ''" :title="order.user.trust_alert ? order.user.trust_alert_comment : ''">
  381. {{ order.username_user }}
  382. </a>
  383. <span v-else class="user-without-account">{{ order.username }}</span>
  384. <span v-if="order.comment && order.comment.length > 0" class="glyphicon glyphicon-comment"></span>
  385. <span v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="glyphicon glyphicon-home"></span>
  386. </td>
  387. <td class="column-point-sale" v-if="idActivePointSale == 0">
  388. <template v-if="order.pointSale">
  389. {{ order.pointSale.name }}
  390. </template>
  391. </td>
  392. <td class="column-amount">
  393. {{ order.amount.toFixed(2)+'&nbsp;€' }}
  394. <div class="state-payment-mobile">
  395. <order-state-payment :order="order" :producer="producer"></order-state-payment>
  396. </div>
  397. </td>
  398. <td class="column-state-payment">
  399. <template v-if="order.order_status_alias == 'ordered' || order.order_status_alias == 'updated'">
  400. <a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id">
  401. <order-state-payment :order="order" :producer="producer"></order-state-payment>
  402. </a>
  403. <span class="glyphicon glyphicon-time" title="Débit automatique de la cagnotte la veille de la distribution" v-if="order.amount != 0 && order.isCreditAutoPayment && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
  404. </template>
  405. </td>
  406. <td class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.payment_method_credit == 1)">
  407. <template v-if="order.isCreditContext">
  408. <a :href="baseUrl+'/user/credit?id='+order.id_user" target="_blank" :class="order.user.credit >= 0 ? 'positive' : 'negative'">
  409. {{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}
  410. </a>
  411. </template>
  412. </td>
  413. <td class="column-actions">
  414. <span v-if="false && order.oneProductUnactivated" class="glyphicon glyphicon-warning-sign" title="Contient un produit non activé"></span>
  415. <a href="javascript:void(0);" class="btn btn-default btn-xs" :data-id-order="order.id" @click="orderViewClick"><span :class="'glyphicon ' + ((showViewProduct && idOrderView == order.id) ? 'glyphicon-eye-close' : 'glyphicon-eye-open')"></span></a>
  416. <a href="javascript:void(0);" class="btn btn-default btn-xs" :data-id-order="order.id" @click="updateOrderClick"><span class="glyphicon glyphicon-pencil"></span></a>
  417. <div class="wrapper-button-dropdown">
  418. <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  419. € <span class="caret"></span>
  420. </button>
  421. <ul class="dropdown-menu">
  422. <template v-if="!order.isPaidViaInvoice">
  423. <li v-if="order.isCreditContext">
  424. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="credit">
  425. <span class="glyphicon glyphicon-piggy-bank"></span> {{ getLabelPaymentRefund(order, 'Débiter', 'Recréditer', 'la cagnotte') }}
  426. </a>
  427. </li>
  428. <template v-if="(!order.isCreditFunctioningMandatory && !order.isCreditFunctioningUser) || !order.id_user">
  429. <li>
  430. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="money">
  431. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'en espèce') }}
  432. </a>
  433. </li>
  434. <li>
  435. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="cheque">
  436. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'par chèque') }}
  437. </a>
  438. </li>
  439. <li>
  440. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="transfer">
  441. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'par virement') }}
  442. </a>
  443. </li>
  444. <li>
  445. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="credit-card">
  446. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'par carte bancaire') }}
  447. </a>
  448. </li>
  449. </template>
  450. </template>
  451. <li>
  452. <a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id">
  453. <span class="glyphicon glyphicon-th-list"></span> Historique
  454. </a>
  455. </li>
  456. </ul>
  457. </div>
  458. <div class="wrapper-button-dropdown">
  459. <button type="button" :class="'btn btn-xs dropdown-toggle ' + (countDocuments(order) ? 'btn-success' : 'btn-default')" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  460. <span class="glyphicon glyphicon-file"></span> <template v-if="countDocuments(order)">{{ countDocuments(order) }}</template> <span class="caret"></span>
  461. </button>
  462. <ul class="dropdown-menu">
  463. <li v-if="!order.id_delivery_note">
  464. <a href="javascript:void(0);" :data-id-order="order.id" @click="generateDeliveryNote">
  465. <span class="glyphicon glyphicon-plus"></span> Générer un bon de livraison
  466. </a>
  467. </li>
  468. <li v-if="order.id_quotation">
  469. <a :href="UrlManager.getBaseUrl()+'quotation/update?id='+order.id_quotation">
  470. <span class="glyphicon glyphicon-file"></span> Modifier le devis
  471. </a>
  472. </li>
  473. <li v-if="order.id_delivery_note && order.deliveryNote">
  474. <a :href="UrlManager.getBaseUrl()+'delivery-note/update?id='+order.id_delivery_note">
  475. <span class="glyphicon glyphicon-file"></span> Modifier le bon de livraison
  476. </a>
  477. <template v-if="order.deliveryNote.status == 'valid'">
  478. <a v-if="!order.deliveryNote.is_sent" href="javascript:void(0);" :data-id-order="order.id" @click="sendDeliveryNote">
  479. <span class="glyphicon glyphicon-send"></span> Envoyer le bon de livraison
  480. </a>
  481. <a v-else class="text-success disable" href="#">
  482. <span class="glyphicon glyphicon-ok"></span> Bon de livraison envoyé
  483. </a>
  484. </template>
  485. </li>
  486. <li v-if="order.id_invoice">
  487. <a :href="UrlManager.getBaseUrl()+'invoice/update?id='+order.id_invoice">
  488. <span class="glyphicon glyphicon-file"></span> Modifier la facture
  489. </a>
  490. </li>
  491. </ul>
  492. </div>
  493. <div class="wrapper-button-dropdown">
  494. <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  495. <span class="caret"></span>
  496. </button>
  497. <ul class="dropdown-menu">
  498. <li><a href="javascript:void(0);" class="" :data-id-order="order.id" @click="deleteOrderClick"><span class="glyphicon glyphicon-trash"></span> {{ order.labelDeleteAction }}</a></li>
  499. <li v-if="producer && producer.tiller"><a href="javascript:void(0);" @click="forceSynchronizeOrderTiller(order.id)"><span class="glyphicon glyphicon-transfer"></span> Synchroniser avec Tiller</a></li>
  500. <li v-if="order.id_subscription > 0"><a class="" :href="baseUrl+'/subscription/update?id='+order.id_subscription"><span class="glyphicon glyphicon-repeat"></span> Modifier l'abonnement lié</a></li>
  501. <li v-else><a class="add-subscription" :href="baseUrl+'/subscription/create?idOrder='+order.id"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-repeat"></span>Créer un abonnement</a></li>
  502. </ul>
  503. </div>
  504. <order-form
  505. v-if="showModalFormOrderUpdate && idOrderUpdate == order.id"
  506. create="0"
  507. :distribution="distribution"
  508. :date="date"
  509. :date-format="dateFormat"
  510. :points-sale="pointsSale"
  511. :id-active-point-sale="idActivePointSale"
  512. :means-payment="meansPayment"
  513. :users="users"
  514. :products="products"
  515. :order="ordersUpdate[key]"
  516. :orders="ordersUpdate"
  517. :producer="producer"
  518. :loading-update-product-order="loadingUpdateProductOrder"
  519. :units="units"
  520. @close="closeModalOrderForm(false)"
  521. @ordercreatedupdated="orderCreatedUpdated"
  522. @updateproductorders="updateProductOrders"
  523. @updateinvoiceprices="updateInvoicePrices"
  524. ></order-form>
  525. <modal v-if="showModalPayment && idOrderPayment == order.id" class="modal-payment" @close="showModalPayment = false">
  526. <h3 slot="header">
  527. Commande du <strong>{{ dateFormat }}</strong> &gt;
  528. <strong><span v-if="order.user">{{ order.username_user }}</span>
  529. <span v-else>{{ order.username }}</span></strong>
  530. </h3>
  531. <div slot="body">
  532. <div class="row">
  533. <div class="col-md-6">
  534. <div class="info-box">
  535. <span :class="'info-box-icon ' +((order.isPaid) ? 'bg-green' : 'bg-red')"><i class="fa fa-check"></i></span>
  536. <div class="info-box-content">
  537. <span class="info-box-text">Montant</span>
  538. <span class="info-box-number">
  539. {{ order.amount.toFixed(2)+' €' }}
  540. </span>
  541. </div>
  542. </div>
  543. </div>
  544. <div class="col-md-6" v-if="order.isCreditContext">
  545. <div class="info-box">
  546. <span :class="'info-box-icon ' +((order.user.credit > 0) ? 'bg-green' : 'bg-red')"><i class="fa fa-user"></i></span>
  547. <div class="info-box-content">
  548. <span class="info-box-text">Cagnotte</span>
  549. <span class="info-box-number">
  550. {{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
  551. </span>
  552. </div>
  553. </div>
  554. </div>
  555. </div>
  556. <div class="row">
  557. <div class="col-md-12">
  558. <h4>Historique paiements</h4>
  559. <table class="table table-condensed table-bordered table-hover" v-if="order.paymentsArray && order.paymentsArray.length > 0">
  560. <thead>
  561. <tr>
  562. <td>Date</td>
  563. <td>Origine action</td>
  564. <td>Type</td>
  565. <td>Moyen</td>
  566. <td>Montant</td>
  567. </tr>
  568. </thead>
  569. <tbody>
  570. <tr v-for="payment in order.paymentsArray">
  571. <td>{{ payment.date }}</td>
  572. <td>{{ payment.user_action }}</td>
  573. <td>{{ payment.wording_type }}</td>
  574. <td>{{ payment.wording_mean_payment }}</td>
  575. <td v-html="payment.amount"></td>
  576. </tr>
  577. </tbody>
  578. </table>
  579. <div class="alert alert-info" v-else>
  580. Aucun paiement rattaché à commande.
  581. </div>
  582. <div class="alert alert-success" v-if="order.isPaidViaInvoice">
  583. La commande est payée via la <a :href="UrlManager.getBaseUrl()+'invoice/update?id='+order.id_invoice">facture</a> à laquelle elle est rattachée.
  584. </div>
  585. </div>
  586. </div>
  587. </div>
  588. </modal>
  589. </td>
  590. <td v-if="producer && producer.tiller" class="tiller column-tiller">
  591. <input v-if="order.tiller_synchronization == true" type="checkbox" checked="checked" :id="'checkbox-tiller-synchronization-'+order.id" :data-id-order="order.id" @change="changeSynchroTiller" />
  592. <input v-else type="checkbox" :id="'checkbox-tiller-synchronization-'+order.id" :data-id-order="order.id" @change="changeSynchroTiller" />
  593. <label :for="'checkbox-tiller-synchronization-'+order.id">Tiller</label>
  594. </td>
  595. </tr>
  596. <tr class="view" v-if="showViewProduct && idOrderView == order.id">
  597. <td colspan="6">
  598. <strong><span class="glyphicon glyphicon-menu-right"></span> Produits</strong>
  599. <ul>
  600. <li v-for="product in products" v-if="getProductDistribution(product) && order.productOrder[product.id].quantity > 0">
  601. {{ product.name }} : {{ order.productOrder[product.id].quantity }} {{ order.productOrder[product.id].unit == 'piece' ? ' pièce(s)' : ' '+order.productOrder[product.id].unit }}
  602. <span v-if="getProductDistribution(product).active == 0" class="glyphicon glyphicon-warning-sign" title="Ce produit n'est pas activé"></span>
  603. </li>
  604. </ul>
  605. <div v-if="order.comment && order.comment.length > 0" class="comment">
  606. <strong><span class="glyphicon glyphicon-menu-right"></span> Commentaire</strong><br />
  607. {{ order.comment }}
  608. </div>
  609. <div v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="delivery">
  610. <strong><span class="glyphicon glyphicon-menu-right"></span> Livraison à domicile</strong><br />
  611. {{ order.delivery_address }}
  612. </div>
  613. </td>
  614. </tr>
  615. </template>
  616. </tbody>
  617. </table>
  618. <div class="alert alert-warning" v-else>
  619. Aucune commande
  620. </div>
  621. </div>
  622. </div>
  623. </div>
  624. </div>
  625. <script type="text/x-template" id="order-state-payment">
  626. <span v-html="order.paymentLabelShort"></span>
  627. </script>
  628. <!-- template for the order-form component -->
  629. <script type="text/x-template" id="order-form-template">
  630. <modal class="modal-form-order" @close="$emit('close')">
  631. <h3 v-if="order.id" slot="header">
  632. <template v-if="order.id">Modifier</template>
  633. <template v-else>Ajouter</template>
  634. une commande - {{ dateFormat }}
  635. </h3>
  636. <div slot="body">
  637. <div class="callout callout-warning" v-if="errors.length">
  638. <ul>
  639. <li v-for="error in errors">{{ error }}</li>
  640. </ul>
  641. </div>
  642. <div class="col-md-4">
  643. <div class="form-group">
  644. <a v-if="producer && producer.credit && order.id_user > 0 && user.id_user == order.id_user" class="btn btn-xs btn-primary btn-credit" :href="baseUrl+'/user/credit?id='+user.id_user" v-for="user in users">{{ parseFloat(user.credit).toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}</a>
  645. <label class="control-label" for="select-id-user">
  646. Utilisateur
  647. <a v-if="!order.id_user || order.id_user == 0" class="btn btn-default btn-xs" :href="distribution.user_create_href">
  648. <span class="glyphicon glyphicon-plus"></span>
  649. Créer un utilisateur
  650. </a>
  651. </label>
  652. <select class="form-control select2-order-form" v-model="order.id_user" @change="userChange">
  653. <option value="0">--</option>
  654. <option v-for="user in users" :value="user.id_user">
  655. {{ user.username }}
  656. </option>
  657. </select>
  658. <input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" />
  659. </div>
  660. <div class="form-group">
  661. <label class="control-label" for="select-id-point-sale">Point de vente</label>
  662. <select class="form-control" id="select-id-point-sale" v-model="order.id_point_sale" @change="pointSaleChange">
  663. <option value="0">--</option>
  664. <option v-for="pointSale in pointsSale" v-if="pointSale.pointSaleDistribution[0].delivery == 1" :value="pointSale.id"">{{ pointSale.name }}</option>
  665. </select>
  666. </div>
  667. <div class="form-group">
  668. <label class="control-label" for="textarea-comment">Commentaire</label>
  669. <textarea class="form-control" id="textarea-comment" v-model="order.comment"></textarea>
  670. </div>
  671. <div class="form-group" v-if="isPointSaleCreditFunctioningOptional(order.id_point_sale)">
  672. <input type="checkbox" id="debit-credit" v-model="order.debitCredit" />
  673. <label class="control-label" for="debit-credit">Débiter la cagnotte</label>
  674. </div>
  675. </div>
  676. <div class="col-md-8">
  677. <label class="control-label">Produits</label>
  678. <table class="table table-condensed table-bordered table-hover table-products">
  679. <thead>
  680. <tr>
  681. <th></th>
  682. <th>Nom</th>
  683. <th>Prix unitaire</th>
  684. <th>Quantité</th>
  685. <th>Reste</th>
  686. </tr>
  687. </thead>
  688. <tbody>
  689. <tr v-for="product in products" v-if="product.status >= 0 || order.productOrder[product.id].quantity > 0" :class="(order.productOrder[product.id].quantity > 0) ? 'product-ordered' : ''">
  690. <td>
  691. <span class="label label-success" v-if="order.productOrder[product.id].active">Actif</span>
  692. <span class="label label-danger" v-else>Inactif</span>
  693. </td>
  694. <td>
  695. {{ product.name }}
  696. </td>
  697. <td class="price">
  698. <div v-show="vatMode == 'all'" class="input-group">
  699. <input type="text" v-model="order.productOrder[product.id].price" class="form-control input-sm" @change="productPriceChange" :data-with-tax="false" :data-id-product="product.id" />
  700. <span class="input-group-addon" id="basic-addon2">€ HT&nbsp;&nbsp;</span>
  701. </div>
  702. <div class="input-group">
  703. <input type="text" v-model="order.productOrder[product.id].price_with_tax" class="form-control input-sm" @change="productPriceChange" :data-with-tax="true" :data-id-product="product.id" />
  704. <span class="input-group-addon" id="basic-addon2">€ TTC</span>
  705. </div>
  706. <div class="invoice-price" v-show="vatMode == 'all'" v-if="(order.id_invoice || order.id_delivery_note || order.id_quotation) && order.productOrder[product.id].quantity > 0">
  707. <span class="label-invoice-price">Prix facturé</span><br />
  708. <div class="input-group">
  709. <input v-if="order.isLinkedToValidInvoice" type="text" v-model="order.productOrder[product.id].invoice_price" class="form-control input-sm" :data-id-product="product.id" disabled="disabled" title="La commande est liée à une facture validée, le prix facturé n'est donc plus modifiable" />
  710. <input v-else type="text" v-model="order.productOrder[product.id].invoice_price" class="form-control input-sm" :data-id-product="product.id" />
  711. <span class="input-group-addon" id="basic-addon2">€ HT</span>
  712. </div>
  713. </div>
  714. </td>
  715. <td class="quantity">
  716. <div class="input-group">
  717. <span class="input-group-btn">
  718. <button class="btn btn-default btn-moins" type="button" @click="productQuantityClick(product.id, order.productOrder[product.id].unit == 'piece' ? -1 : -parseFloat(product.step))"><span class="glyphicon glyphicon-minus"></span></button>
  719. </span>
  720. <input type="text" v-model="order.productOrder[product.id].quantity" class="form-control input-quantity" />
  721. <span class="input-group-addon">{{ order.productOrder[product.id].unit == 'piece' ? 'p.' : order.productOrder[product.id].unit }}</span>
  722. <span class="input-group-btn">
  723. <button class="btn btn-default btn-plus" type="button" @click="productQuantityClick(product.id, order.productOrder[product.id].unit == 'piece' ? 1 : parseFloat(product.step))"><span class="glyphicon glyphicon-plus"></span></button>
  724. </span>
  725. </div>
  726. </td>
  727. <td class="quantity-remaining">
  728. <template v-if="loadingUpdateProductOrder">
  729. --
  730. </template>
  731. <template v-else>
  732. <span class="infinite" v-if="(getProductQuantityRemaining(order, product) === null) || order.productOrder[product.id].unit != product.unit">&infin;</span>
  733. <span class="negative" v-else-if="getProductQuantityRemaining(order, product) <= 0">
  734. {{ getProductQuantityRemaining(order, product) }} {{ labelUnitReference(order.productOrder[product.id].unit) }}
  735. <span class="glyphicon glyphicon-alert" v-if="getProductQuantityRemaining(order, product) < 0"></span>
  736. </span>
  737. <span class="has-quantity" v-else>{{ getProductQuantityRemaining(order, product) }} {{ labelUnitReference(order.productOrder[product.id].unit) }}</span>
  738. </template>
  739. </td>
  740. </tr>
  741. </tbody>
  742. </table>
  743. </div>
  744. </div>
  745. <div slot="footer">
  746. <div class="actions-form">
  747. <button class="modal-default-button btn btn-danger" @click="$emit('close')">Fermer</button>
  748. <button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button>
  749. <button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id">Créer</button>
  750. <div class="right">
  751. <button class="modal-default-button btn btn-info btn-update-prices" @click="updateProductOrders(true)">Recharger les prix</button>
  752. <button v-if="order.id" class="modal-default-button btn btn-info btn-update-prices" @click="updateInvoicePrices(true)">
  753. Réinitialiser les prix facturés
  754. </button>
  755. <button class="modal-default-button btn btn-info btn-display-prices-without-tax" @click="toggleVatMode()">
  756. <template v-if="vatMode == 'all'">Cacher</template>
  757. <template v-else>Afficher</template>
  758. les prix HT
  759. </button>
  760. </div>
  761. </div>
  762. </div>
  763. </modal>
  764. </script>
  765. <!-- template for the modal component -->
  766. <script type="text/x-template" id="modal-template">
  767. <transition name="modal">
  768. <div class="modal-mask">
  769. <div class="modal-wrapper">
  770. <div class="modal-container">
  771. <div class="modal-header">
  772. <slot name="header"></slot>
  773. </div>
  774. <div class="modal-body">
  775. <slot name="body"></slot>
  776. </div>
  777. <div class="modal-footer">
  778. <slot name="footer">
  779. <button class="modal-default-button btn btn-default" @click="$emit('close')">Fermer</button>
  780. </slot>
  781. </div>
  782. </div>
  783. </div>
  784. </div>
  785. </transition>
  786. </script>