Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
6 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
5 anos atrás
6 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. <?php
  2. /**
  3. Copyright distrib (2018)
  4. contact@opendistrib.net
  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. \backend\assets\VuejsDistributionIndexAsset::register($this);
  33. $this->setTitle('Distributions') ;
  34. $this->setPageTitle('Distributions') ;
  35. ?>
  36. <?php if($orderUpdate):
  37. $orderUpdateDistributionTimestamp = strtotime($orderUpdate->distribution->date);
  38. ?>
  39. <script>
  40. window.vueValues = {
  41. date: new Date(<?= date('Y', $orderUpdateDistributionTimestamp) ?>, <?= date('m', $orderUpdateDistributionTimestamp) - 1 ?>, <?= date('d', $orderUpdateDistributionTimestamp) ?>),
  42. dateFormat: '<?= date('d/m/Y', $orderUpdateDistributionTimestamp) ?>',
  43. showModalFormOrderUpdate: true,
  44. idOrderUpdate: <?= $orderUpdate->id ?>
  45. };
  46. </script>
  47. <?php endif; ?>
  48. <div id="app-distribution-index" class="app-vuejs">
  49. <?php if(strlen($date)): ?>
  50. <span id="distribution-date"><?= $date; ?></span>
  51. <?php endif; ?>
  52. <div id="loading" v-if="showLoading">
  53. <img src="<?= Yii::$app->urlManagerBackend->getBaseUrl(); ?>/img/loader.gif" alt="Chargement ..." />
  54. </div>
  55. <div id="wrapper-app-distribution-index" :class="'wrapper-app-vuejs '+(loading ? '' : 'loaded')">
  56. <div class="col-md-4">
  57. <div id="calendar">
  58. <v-calendar
  59. is-inline
  60. is-expanded
  61. v-model="date"
  62. popover-visibility="hidden"
  63. color="green"
  64. :mode="calendar.mode"
  65. :formats="calendar.formats"
  66. :theme-styles="calendar.themeStyles"
  67. :attributes="calendar.attrs"
  68. @dayclick='dayClicked'>
  69. ></v-calendar>
  70. </div>
  71. <div class="clr"></div>
  72. </div>
  73. <div class="col-md-8">
  74. <div v-if="date">
  75. <div id="infos-top">
  76. <div class="col-md-12">
  77. <div class="info-box" id="info-box-distribution">
  78. <span :class="'info-box-icon '+(distribution.active ? 'bg-green' : 'bg-red')"><i :class="'fa '+(distribution.active ? 'fa-check' : 'fa-remove')"></i></span>
  79. <div class="info-box-content">
  80. <span class="info-box-text">
  81. <h4>Distribution du <strong>{{ dateFormat }}</strong></h4>
  82. <a @click="activeWeekDistribution" data-active="0" class="btn btn-default btn-active-week" v-if="oneDistributionWeekActive">Désactiver cette semaine</a>
  83. <a @click="activeWeekDistribution" data-active="1" class="btn btn-default btn-active-week" v-else>Activer cette semaine</a>
  84. <a @click="activeDistribution" data-active="0" class="btn btn-default" v-if="distribution.active">Désactiver ce jour</a>
  85. <a @click="activeDistribution" data-active="1" class="btn btn-default" v-else>Activer ce jour</a>
  86. </span>
  87. </div>
  88. </div>
  89. </div>
  90. <!-- produits -->
  91. <div class="col-md-6">
  92. <div class="info-box col-md-4">
  93. <span class="info-box-icon bg-yellow"><i class="fa fa-clone"></i></span>
  94. <div class="info-box-content">
  95. <span class="info-box-text">
  96. {{ countActiveProducts }} Produits<br />
  97. <template v-if="isOneProductMaximumQuantityExceeded()"><span class="glyphicon glyphicon-alert"></span> Quantités max dépassées<br /></template>
  98. <br />
  99. <button class="btn btn-default" @click="showModalProducts = true">Configurer</button>
  100. </span>
  101. </div>
  102. </div>
  103. </div>
  104. <modal v-if="showModalProducts" id="modal-products" @close="showModalProducts = false">
  105. <h3 slot="header">Produits</h3>
  106. <div slot="body">
  107. <table class="table table-condensed table-bordered table-hover">
  108. <thead>
  109. <tr>
  110. <td>Actif</td>
  111. <td>Nom</td>
  112. <td class="quantity-ordered">Commandé</td>
  113. <td class="quantity-max">Maximum</td>
  114. </tr>
  115. </thead>
  116. <tbody>
  117. <tr v-for="product in products" v-if="getProductDistribution(product)">
  118. <td>
  119. <button class="btn btn-success" v-if="getProductDistribution(product).active == 1"><span class="glyphicon glyphicon-ok"></span></button>
  120. <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>
  121. <button class="btn btn-danger" v-if="getProductDistribution(product).active == 0"><span class="glyphicon glyphicon-remove"></span></button>
  122. <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>
  123. </td>
  124. <td>{{ product.name }}</td>
  125. <td class="quantity-ordered">
  126. <span v-if="isProductMaximumQuantityExceeded(product)" class="glyphicon glyphicon-alert"></span>
  127. {{ product.quantity_ordered ? product.quantity_ordered + ' '+ ((product.unit == 'piece') ? ' p.' : ' '+(product.unit == 'g' || product.unit == 'kg') ? 'kg' : 'litre(s)') : '&empty;' }}
  128. </td>
  129. <td class="quantity-max">
  130. <div class="input-group">
  131. <input type="text" class="form-control quantity-max" placeholder="&infin;" :data-id-product="product.id" v-model="getProductDistribution(product).quantity_max" @keyup="productQuantityMaxChange" />
  132. <span class="input-group-addon">{{ (product.unit == 'piece') ? 'p.' : ' '+((product.unit == 'g' || product.unit == 'kg') ? 'kg' : 'litre(s)') }}</span>
  133. </div>
  134. </td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. </div>
  139. <div slot="footer">
  140. <div class="actions-form">
  141. <button class="modal-default-button btn btn-default" @click="closeModalProducts">Fermer</button>
  142. </div>
  143. </div>
  144. </modal>
  145. <div class="col-md-6">
  146. <div class="info-box col-md-4">
  147. <span class="info-box-icon bg-yellow"><i class="fa fa-map-marker"></i></span>
  148. <div class="info-box-content">
  149. <span class="info-box-text">
  150. {{ countActivePointsSale }} Points de vente<br /><br />
  151. <button class="btn btn-default" @click="showModalPointsSale = true">Configurer</button>
  152. </span>
  153. </div>
  154. </div>
  155. </div>
  156. <modal v-if="showModalPointsSale" id="modal-points-sale" @close="showModalPointsSale = false">
  157. <h3 slot="header">Points de vente</h3>
  158. <div slot="body">
  159. <table class="table table-condensed table-bordered table-hover">
  160. <thead>
  161. <tr>
  162. <td>Actif</td>
  163. <td>Nom</td>
  164. </tr>
  165. </thead>
  166. <tbody>
  167. <tr v-for="pointSale in pointsSale" v-if="pointSale.status == 1">
  168. <td>
  169. <button class="btn btn-success" v-if="pointSale.pointSaleDistribution[0].delivery == 1"><span class="glyphicon glyphicon-ok"></span></button>
  170. <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>
  171. <button class="btn btn-danger" v-if="pointSale.pointSaleDistribution[0].delivery == 0"><span class="glyphicon glyphicon-remove"></span></button>
  172. <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>
  173. </td>
  174. <td>{{ pointSale.name }}</td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. </div>
  179. </modal>
  180. <div class="col-md-6">
  181. <div id="summary-ca-weight" class="info-box col-md-4">
  182. <span class="info-box-icon bg-yellow"><i class="fa fa-euro"></i></span>
  183. <div class="info-box-content">
  184. <span class="info-box-text">CA (TTC)</span>
  185. <span class="info-box-number">{{ distribution.revenues }} <span class="normal" v-if="distribution.potential_revenues != '0,00 €'">/ {{ distribution.potential_revenues }}</span></span>
  186. <span class="info-box-text">Poids</span>
  187. <span class="info-box-number">{{ distribution.weight }} kg <span class="normal" v-if="distribution.potential_weight > 0">/ {{ distribution.potential_weight }} kg</span></span>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="col-md-6">
  192. <div class="info-box col-md-4">
  193. <span class="info-box-icon bg-yellow"><i class="fa fa-download"></i></span>
  194. <div class="info-box-content">
  195. <span class="info-box-text">
  196. {{ countOrders }} Commande<span v-if="countOrders > 1">s</span><br />
  197. <a :href="distribution.url_report" class="btn btn-xs btn-default" v-if="countOrders > 0">Liste (PDF)</a>
  198. <a :href="distribution.url_report+'&type=csv'" class="btn btn-xs btn-default" v-if="countOrders > 0">Tableau (CSV)</a>
  199. <br v-if="producer && producer.option_display_export_grid && countOrders > 0" />
  200. <a :href="distribution.url_report_grid" class="btn btn-xs btn-default" v-if="producer && producer.option_display_export_grid && countOrders > 0">Grille (PDF)</a>
  201. </span>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="callout callout-info" v-else>
  208. <h4><i class="fa fa-info"></i> Pour commencer</h4>
  209. <p>Veuillez choisir une date de distribution.</p>
  210. </div>
  211. </div>
  212. <div class="clr"></div>
  213. <div id="orders" class="panel panel-default" v-if="date">
  214. <div class="panel-heading">
  215. <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>
  216. <div class="buttons">
  217. </div>
  218. </div>
  219. <div class="panel-body">
  220. <order-form
  221. v-if="showModalFormOrderCreate"
  222. create="1"
  223. :date="date"
  224. :order="orderCreate"
  225. :points-sale="pointsSale"
  226. :id-active-point-sale="idActivePointSale"
  227. :means-payment="meansPayment"
  228. :users="users"
  229. :products="products"
  230. :producer="producer"
  231. :orders="ordersUpdate"
  232. :loading-update-product-order="loadingUpdateProductOrder"
  233. :units="units"
  234. @close="closeModalOrderForm(true)"
  235. @ordercreatedupdated="orderCreatedUpdated"
  236. @updateproductorderprices="updateProductOrderPrices"
  237. ></order-form>
  238. <div id="wrapper-nav-points-sale">
  239. <ul id="nav-points-sale">
  240. <li data-id-point-sale="0" data-id-point-sale="0" v-if="countActivePointsSale > 1" @click="pointSaleClick">
  241. <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>
  242. <a class="btn btn-default" v-else>Tous <span class="label label-default">{{ orders.length }}</span><span class="glyphicon glyphicon-triangle-bottom"></span></a>
  243. </li>
  244. <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">
  245. <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>
  246. <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>
  247. </li>
  248. </ul>
  249. <div class="clr"></div>
  250. </div>
  251. <div id="buttons-top-orders">
  252. <div class="right">
  253. <div class="dropdown">
  254. <button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
  255. <span class="glyphicon glyphicon-file"></span> Documents
  256. <span class="caret"></span>
  257. </button>
  258. <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
  259. <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>
  260. <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>
  261. <li><a @click="validateDeliveryNotes" href="javascript:void(0);">Valider les bons de livraisons</a></li>
  262. </ul>
  263. </div>
  264. <button id="btn-add-subscriptions" @click="addSubscriptions" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span> Importer les abonnements</button>
  265. <template v-if="producer && producer.tiller == true">
  266. <button v-if="tillerIsSynchro" id="btn-tiller" class="btn btn-success btn-xs" disabled><span class="glyphicon glyphicon-refresh"></span> Synchronisé avec Tiller</button>
  267. <button v-else id="btn-tiller" class="btn btn-xs btn-default" @click="synchroTiller"><span class="glyphicon glyphicon-refresh"></span> Synchroniser avec Tiller</button>
  268. </template>
  269. <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>
  270. <button id="btn-add-order" @click="openModalFormOrderCreate" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button>
  271. </div>
  272. <div class="left">
  273. <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>
  274. </div>
  275. <div class="clr"></div>
  276. </div>
  277. <div class="alert alert-info" v-if="missingSubscriptions && missingSubscriptions.length > 0">
  278. <span class="glyphicon glyphicon-info-sign"></span>
  279. {{ missingSubscriptions.length }} abonnement<template v-if="missingSubscriptions.length > 1">s</template> manquant<template v-if="missingSubscriptions.length > 1">s</template> :
  280. <span v-for="(subscription, index) in missingSubscriptions">
  281. {{ subscription.username }}<template v-if="index != missingSubscriptions.length - 1">, </template><template v-else>.</template>
  282. </span>
  283. </div>
  284. <div class="alert alert-danger" v-if="distribution && !distribution.active && orders && orders.length > 0">
  285. Attention, ce jour de distribution n'est pas activé et vous avez quand même des commandes enregistrées.
  286. </div>
  287. <div v-if="idActivePointSale > 0 && (totalActivePointSale() > 0 || weightActivePointSale() > 0)" class="point-sale-totals">
  288. <div>
  289. <span class="title">Totaux</span>
  290. CA TTC : <strong>{{ totalActivePointSale() }} €</strong> / Poids : <strong>{{ weightActivePointSale() }} kg</strong>
  291. </div>
  292. <div v-if="producer.credit && pointSaleActive">
  293. <span class="title">Crédit</span>
  294. <template v-if="pointSaleActive.credit && pointSaleActive.credit == 1">
  295. <template v-if="pointSaleActive.credit_functioning == 'mandatory'">Obligatoire</template>
  296. <template v-else-if="pointSaleActive.credit_functioning == 'user'">Basé sur l'utilisateur</template>
  297. <template v-else-if="pointSaleActive.credit_functioning == 'optional'">Optionnel</template>
  298. </template>
  299. <template v-else>Désactivé</template>
  300. </div>
  301. </div>
  302. <table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)">
  303. <thead>
  304. <tr>
  305. <th class="column-checkbox" v-if="idActivePointSale > 0">
  306. <input type="checkbox" v-model="checkboxSelectAllOrders" @change="selectAllOrdersEvent" />
  307. </th>
  308. <th class="column-origin">Origine</th>
  309. <th class="column-state">État</th>
  310. <th class="column-user">Utilisateur</th>
  311. <th class="column-point-sale" v-if="idActivePointSale == 0">Point de vente</th>
  312. <th class="column-amount">Montant</th>
  313. <th class="column-state-payment">Paiement</th>
  314. <th class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.credit == 1)">Crédit</th>
  315. <th class="column-actions">Actions</th>
  316. <th class="column-tiller" v-if="producer && producer.tiller">Tiller</th>
  317. </tr>
  318. </thead>
  319. <tbody>
  320. <template v-for="(order, key, index) in orders" v-if="idActivePointSale == 0 || idActivePointSale == order.id_point_sale">
  321. <tr>
  322. <td class="column-checkbox" v-if="idActivePointSale > 0">
  323. <input type="checkbox" v-model="order.selected" />
  324. </td>
  325. <td class="column-origin">
  326. <label class="label label-success" v-if="order.origin == 'user'">client</label>
  327. <label class="label label-default" v-else-if="order.origin == 'auto'">auto</label>
  328. <label class="label label-warning" v-else>admin</label>
  329. </td>
  330. <td class="column-state">
  331. <span class="label label-danger" v-if="order.date_delete"><span class="glyphicon glyphicon-trash"></span></span>
  332. <span class="label label-warning" v-if="order.date_update"><span class="glyphicon glyphicon-pencil"></span></span>
  333. <span class="label label-success" v-if="!order.date_update && !order.date_delete"><span class="glyphicon glyphicon-check"></span></span>
  334. </td>
  335. <td class="column-user">
  336. <span v-if="order.user">
  337. <template v-if="order.user.name_legal_person && order.user.name_legal_person.length">
  338. {{ order.user.name_legal_person }}
  339. </template>
  340. <template v-else>
  341. {{ order.user.lastname+' '+order.user.name }}
  342. </template>
  343. <span class="shortcuts btn-group" role="group">
  344. <a :class="order.user.credit_active ? 'btn btn-success btn-sm' : 'btn btn-default btn-sm'" :href="baseUrl+'/user/credit?id='+order.id_user" data-toggle="popover" data-trigger="hover" data-placement="bottom" :data-content="order.user.credit.toFixed(2)+' €'"><span class="glyphicon glyphicon-euro"></span></a>
  345. <a class="btn btn-default btn-sm" :href="baseUrl+'/user/update?id='+order.id_user" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="Modifier"><span class="glyphicon glyphicon-user"></span></a>
  346. <a class="btn btn-default btn-sm" :href="baseUrl+'/user/orders?id='+order.id_user" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="Voir les commandes"><span class="glyphicon glyphicon-eye-open"></span></a>
  347. </span>
  348. </span>
  349. <span v-else class="no-user">{{ order.username }}</span>
  350. <span v-if="order.comment && order.comment.length > 0" class="glyphicon glyphicon-comment"></span>
  351. <span v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="glyphicon glyphicon-home"></span>
  352. </td>
  353. <td class="column-point-sale" v-if="idActivePointSale == 0">
  354. <template v-if="order.pointSale">
  355. {{ order.pointSale.name }}
  356. </template>
  357. </td>
  358. <td class="column-amount">
  359. {{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}
  360. <div class="state-payment-mobile">
  361. <order-state-payment :order="order" :producer="producer"></order-state-payment>
  362. </div>
  363. </td>
  364. <td class="column-state-payment">
  365. <a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id">
  366. <order-state-payment :order="order" :producer="producer"></order-state-payment>
  367. </a>
  368. <span class="glyphicon glyphicon-time" title="Débit automatique du crédit la veille de la distribution" v-if="order.amount != 0 && order.auto_payment && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
  369. </td>
  370. <td class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.credit == 1)">
  371. <template v-if="order.isCreditContext">
  372. <a :href="baseUrl+'/user/credit?id='+order.id_user" :class="order.user.credit >= 0 ? 'positive' : 'negative'">
  373. {{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}
  374. </a>
  375. </template>
  376. </td>
  377. <td class="column-payment" v-if="false && producer && producer.credit">
  378. <!--<div class="btn-group" v-if="order.user && !order.date_delete">
  379. <button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount">
  380. <span class="glyphicon glyphicon-euro"></span> Recréditer
  381. </button>
  382. <button class="btn btn-xs btn-default" v-else-if="order.amount_paid == 0" @click="orderPaymentClick" :data-id-order="order.id" data-type="payment" :data-amount="order.amount">
  383. <span class="glyphicon glyphicon-euro"></span> Débiter
  384. </button>
  385. <button class="btn btn-xs btn-default" v-else-if="order.amount_paid < order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="payment" :data-amount="order.amount_remaining">
  386. <span class="glyphicon glyphicon-euro"></span> Débiter
  387. </button>
  388. <button class="btn btn-xs btn-default" v-else-if="order.amount_paid > order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount_surplus">
  389. <span class="glyphicon glyphicon-euro"></span> Recréditer
  390. </button>
  391. <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  392. <span class="caret"></span>
  393. <span class="sr-only">Toggle Dropdown</span>
  394. </button>
  395. <ul class="dropdown-menu">
  396. <li><a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id">Historique</a></li>
  397. </ul>
  398. </div>-->
  399. </td>
  400. <td class="column-actions">
  401. <span v-if="false && order.oneProductUnactivated" class="glyphicon glyphicon-warning-sign" title="Contient un produit non activé"></span>
  402. <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>
  403. <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>
  404. <div class="wrapper-button-dropdown">
  405. <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  406. € <span class="caret"></span>
  407. </button>
  408. <ul class="dropdown-menu">
  409. <template v-if="!order.isPaidViaInvoice">
  410. <li v-if="order.isCreditContext">
  411. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="credit">
  412. <span class="glyphicon glyphicon-piggy-bank"></span> {{ getLabelPaymentRefund(order, 'Débiter', 'Recréditer', 'le crédit') }}
  413. </a>
  414. </li>
  415. <template v-if="(!order.isCreditFunctioningMandatory && !order.isCreditFunctioningUser) || !order.id_user">
  416. <li>
  417. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="money">
  418. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'en espèce') }}
  419. </a>
  420. </li>
  421. <li>
  422. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="cheque">
  423. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'par chèque') }}
  424. </a>
  425. </li>
  426. <li>
  427. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="transfer">
  428. <span class="glyphicon glyphicon-euro"></span> {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'par virement') }}
  429. </a>
  430. </li>
  431. </template>
  432. </template>
  433. <!--<li>
  434. <a href="javascript:void(0);" @click="orderPaymentClick" :data-id-order="order.id" :data-type="getTypePayment(order)" data-mean-payment="credit-card">
  435. {{ getLabelPaymentRefund(order, 'Payer', 'Rembourser', 'par carte bancaire') }}
  436. </a>
  437. </li>-->
  438. <li>
  439. <a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id">
  440. <span class="glyphicon glyphicon-th-list"></span> Historique
  441. </a>
  442. </li>
  443. </ul>
  444. </div>
  445. <div class="wrapper-button-dropdown">
  446. <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  447. <span class="glyphicon glyphicon-file"></span> <template v-if="countDocuments(order)">{{ countDocuments(order) }}</template> <span class="caret"></span>
  448. </button>
  449. <ul class="dropdown-menu">
  450. <li v-if="!order.id_delivery_note">
  451. <a href="javascript:void(0);" class="" :data-id-order="order.id" @click="generateDeliveryNote">
  452. <span class="glyphicon glyphicon-plus"></span> Générer un bon de livraison
  453. </a>
  454. </li>
  455. <li v-if="order.id_quotation">
  456. <a :href="UrlManager.getBaseUrl()+'quotation/update?id='+order.id_quotation">
  457. <span class="glyphicon glyphicon-file"></span> Devis
  458. </a>
  459. </li>
  460. <li v-if="order.id_delivery_note">
  461. <a :href="UrlManager.getBaseUrl()+'delivery-note/update?id='+order.id_delivery_note">
  462. <span class="glyphicon glyphicon-file"></span> Bon de livraison
  463. </a>
  464. </li>
  465. <li v-if="order.id_invoice">
  466. <a :href="UrlManager.getBaseUrl()+'invoice/update?id='+order.id_invoice">
  467. <span class="glyphicon glyphicon-file"></span> Facture
  468. </a>
  469. </li>
  470. </ul>
  471. </div>
  472. <div class="wrapper-button-dropdown">
  473. <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  474. <span class="caret"></span>
  475. </button>
  476. <ul class="dropdown-menu">
  477. <!--<li><a href="javascript:void(0);" class="" :data-id-order="order.id" @click="orderViewClick"><span :class="'glyphicon ' + ((showViewProduct && idOrderView == order.id) ? 'glyphicon-eye-close' : 'glyphicon-eye-open')"></span> Voir</a></li>
  478. <li><a href="javascript:void(0);" class="" :data-id-order="order.id" @click="updateOrderClick"><span class="glyphicon glyphicon-pencil"></span> Modifier</a></li>-->
  479. <li><a href="javascript:void(0);" class="" :data-id-order="order.id" @click="deleteOrderClick"><span class="glyphicon glyphicon-trash"></span> Supprimer</a></li>
  480. <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>
  481. <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>
  482. </ul>
  483. </div>
  484. <order-form
  485. v-if="showModalFormOrderUpdate && idOrderUpdate == order.id"
  486. create="0"
  487. :date="date"
  488. :date-format="dateFormat"
  489. :points-sale="pointsSale"
  490. :id-active-point-sale="idActivePointSale"
  491. :means-payment="meansPayment"
  492. :users="users"
  493. :products="products"
  494. :order="ordersUpdate[key]"
  495. :orders="ordersUpdate"
  496. :producer="producer"
  497. :loading-update-product-order="loadingUpdateProductOrder"
  498. :units="units"
  499. @close="closeModalOrderForm(false)"
  500. @ordercreatedupdated="orderCreatedUpdated"
  501. @updateproductorderprices="updateProductOrderPrices"
  502. @updateinvoiceprices="updateInvoicePrices"
  503. ></order-form>
  504. <modal v-if="showModalPayment && idOrderPayment == order.id" class="modal-payment" @close="showModalPayment = false">
  505. <h3 slot="header">
  506. Commande du <strong>{{ dateFormat }}</strong> &gt;
  507. <strong><span v-if="order.user">{{ order.user.name +' '+order.user.lastname }}</span>
  508. <span v-else>{{ order.username }}</span></strong>
  509. </h3>
  510. <div slot="body">
  511. <div class="row">
  512. <div class="col-md-6">
  513. <div class="info-box">
  514. <span :class="'info-box-icon ' +((order.isPaid) ? 'bg-green' : 'bg-red')"><i class="fa fa-check"></i></span>
  515. <div class="info-box-content">
  516. <span class="info-box-text">Montant</span>
  517. <span class="info-box-number">
  518. {{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
  519. </span>
  520. </div>
  521. </div>
  522. </div>
  523. <div class="col-md-6" v-if="order.isCreditContext">
  524. <div class="info-box">
  525. <span :class="'info-box-icon ' +((order.user.credit > 0) ? 'bg-green' : 'bg-red')"><i class="fa fa-user"></i></span>
  526. <div class="info-box-content">
  527. <span class="info-box-text">Crédit utilisateur</span>
  528. <span class="info-box-number">
  529. {{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
  530. </span>
  531. </div>
  532. </div>
  533. </div>
  534. </div>
  535. <div class="row">
  536. <div class="col-md-12">
  537. <h4>Historique paiements</h4>
  538. <table class="table table-condensed table-bordered table-hover" v-if="order.paymentsArray && order.paymentsArray.length > 0">
  539. <thead>
  540. <tr>
  541. <td>Date</td>
  542. <td>Origine action</td>
  543. <td>Type</td>
  544. <td>Moyen</td>
  545. <td>Montant</td>
  546. </tr>
  547. </thead>
  548. <tbody>
  549. <tr v-for="payment in order.paymentsArray">
  550. <td>{{ payment.date }}</td>
  551. <td>{{ payment.user_action }}</td>
  552. <td>{{ payment.wording_type }}</td>
  553. <td>{{ payment.wording_mean_payment }}</td>
  554. <td v-html="payment.amount"></td>
  555. </tr>
  556. </tbody>
  557. </table>
  558. <div class="alert alert-info" v-else>
  559. Aucun paiement rattaché à commande.
  560. </div>
  561. <div class="alert alert-success" v-if="order.isPaidViaInvoice">
  562. La commande est payée via la <a :href="UrlManager.getBaseUrl()+'invoice/update?id='+order.id_invoice">facture</a> à laquelle elle est rattachée.
  563. </div>
  564. </div>
  565. </div>
  566. </div>
  567. </modal>
  568. </td>
  569. <td v-if="producer && producer.tiller" class="tiller column-tiller">
  570. <input v-if="order.tiller_synchronization == true" type="checkbox" checked="checked" :id="'checkbox-tiller-synchronization-'+order.id" :data-id-order="order.id" @change="changeSynchroTiller" />
  571. <input v-else type="checkbox" :id="'checkbox-tiller-synchronization-'+order.id" :data-id-order="order.id" @change="changeSynchroTiller" />
  572. <label :for="'checkbox-tiller-synchronization-'+order.id">Tiller</label>
  573. </td>
  574. </tr>
  575. <tr class="view" v-if="showViewProduct && idOrderView == order.id">
  576. <td colspan="6">
  577. <strong><span class="glyphicon glyphicon-menu-right"></span> Produits</strong>
  578. <ul>
  579. <li v-for="product in products" v-if="getProductDistribution(product) && order.productOrder[product.id].quantity > 0">
  580. {{ product.name }} : {{ order.productOrder[product.id].quantity }} {{ order.productOrder[product.id].unit == 'piece' ? ' pièce(s)' : ' '+order.productOrder[product.id].unit }} <span v-if="getProductDistribution(product).active == 0" class="glyphicon glyphicon-warning-sign" title="Ce produit n'est pas activé"></span>
  581. </li>
  582. </ul>
  583. <div v-if="order.comment && order.comment.length > 0" class="comment">
  584. <strong><span class="glyphicon glyphicon-menu-right"></span> Commentaire</strong><br />
  585. {{ order.comment }}
  586. </div>
  587. <div v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="delivery">
  588. <strong><span class="glyphicon glyphicon-menu-right"></span> Livraison à domicile</strong><br />
  589. {{ order.delivery_address }}
  590. </div>
  591. </td>
  592. </tr>
  593. </template>
  594. </tbody>
  595. </table>
  596. <div class="alert alert-warning" v-else>
  597. Aucune commande
  598. </div>
  599. </div>
  600. </div>
  601. </div>
  602. </div>
  603. <script type="text/x-template" id="order-state-payment">
  604. <span v-html="order.paymentLabelShort"></span>
  605. <!--<span class="glyphicon glyphicon-signal" title="Paiement partiel ou surplus" v-if="order.amount_paid > order.amount || order.amount_paid < order.amount"></span>-->
  606. <!--<span class="label label-success" v-if="order.amount_paid == order.amount">&nbsp;</span>
  607. <span class="label label-default" v-else-if="order.amount_paid == 0">&nbsp;</span>-->
  608. <!--<span class="label label-success input-group-addon" v-if="order.amount_paid == order.amount">débité</span>
  609. <span class="label label-default input-group-addon" v-else-if="order.amount_paid == 0">non débité</span>
  610. <span class="label label-default input-group-addon" v-else-if="order.amount_paid > order.amount">surplus</span>
  611. <span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à débiter</span>-->
  612. </script>
  613. <!-- template for the order-form component -->
  614. <script type="text/x-template" id="order-form-template">
  615. <modal class="modal-form-order" @close="$emit('close')">
  616. <h3 v-if="order.id" slot="header">
  617. <template v-if="order.id">Modifier</template>
  618. <template v-else>Ajouter</template>
  619. une commande - {{ dateFormat }}
  620. </h3>
  621. <div slot="body">
  622. <div class="callout callout-warning" v-if="errors.length">
  623. <ul>
  624. <li v-for="error in errors">{{ error }}</li>
  625. </ul>
  626. </div>
  627. <div class="col-md-4">
  628. <div class="form-group">
  629. <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>
  630. <label class="control-label" for="select-id-user">
  631. Utilisateur
  632. </label>
  633. <select class="form-control select2-order-form" v-model="order.id_user" @change="userChange">
  634. <option value="0">--</option>
  635. <option v-for="user in users" :value="user.id_user">
  636. <template v-if="user.name_legal_person && user.name_legal_person.length">
  637. {{ user.name_legal_person }} (personne morale)
  638. </template>
  639. <template v-else>
  640. {{ user.lastname +' '+ user.name }}
  641. </template>
  642. </option>
  643. </select>
  644. <input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" />
  645. </div>
  646. <div class="form-group">
  647. <label class="control-label" for="select-id-point-sale">Point de vente</label>
  648. <select class="form-control" id="select-id-point-sale" v-model="order.id_point_sale" @change="pointSaleChange">
  649. <option value="0">--</option>
  650. <option v-for="pointSale in pointsSale" v-if="pointSale.pointSaleDistribution[0].delivery == 1" :value="pointSale.id"">{{ pointSale.name }}</option>
  651. </select>
  652. </div>
  653. <div class="form-group">
  654. <!--<label class="control-label" for="select-mean-payment">Moyen de paiement</label>
  655. <select class="form-control" id="select-mean-payment" v-model="order.mean_payment">
  656. <option value="0">--</option>
  657. <option v-for="(wordingMeanPayment, keyMeanPayment) in meansPayment" :value="keyMeanPayment">{{ wordingMeanPayment }}</option>
  658. </select>-->
  659. </div>
  660. <div class="form-group">
  661. <label class="control-label" for="textarea-comment">Commentaire</label>
  662. <textarea class="form-control" id="textarea-comment" v-model="order.comment"></textarea>
  663. </div>
  664. </div>
  665. <div class="col-md-8">
  666. <label class="control-label">Produits</label>
  667. <table class="table table-condensed table-bordered table-hover table-products">
  668. <thead>
  669. <tr>
  670. <th></th>
  671. <th>Nom</th>
  672. <th>Prix unitaire</th>
  673. <th>Quantité</th>
  674. <th>Reste</th>
  675. </tr>
  676. </thead>
  677. <tbody>
  678. <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' : ''">
  679. <td>
  680. <span class="label label-success" v-if="loadingUpdateProductOrder || order.productOrder[product.id].active">Actif</span>
  681. <span class="label label-danger" v-else>Inactif</span>
  682. </td>
  683. <td>{{ product.name }}</td>
  684. <td class="price">
  685. <div v-show="vatMode == 'all'" class="input-group">
  686. <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" />
  687. <span class="input-group-addon" id="basic-addon2">€ HT&nbsp;&nbsp;</span>
  688. </div>
  689. <div class="input-group">
  690. <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" />
  691. <span class="input-group-addon" id="basic-addon2">€ TTC</span>
  692. </div>
  693. <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">
  694. <span class="label-invoice-price">Prix facturé</span><br />
  695. <div class="input-group">
  696. <input type="text" v-model="order.productOrder[product.id].invoice_price" class="form-control input-sm" :data-id-product="product.id" />
  697. <span class="input-group-addon" id="basic-addon2">€ HT</span>
  698. </div>
  699. </div>
  700. </td>
  701. <td class="quantity">
  702. <div class="input-group">
  703. <span class="input-group-btn">
  704. <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>
  705. </span>
  706. <input type="text" v-model="order.productOrder[product.id].quantity" class="form-control input-quantity" />
  707. <span class="input-group-addon">{{ order.productOrder[product.id].unit == 'piece' ? 'p.' : order.productOrder[product.id].unit }}</span>
  708. <span class="input-group-btn">
  709. <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>
  710. </span>
  711. </div>
  712. </td>
  713. <td class="quantity-remaining infinite" v-if="product.quantity_remaining === null || order.productOrder[product.id].unit != product.unit">&infin;</td>
  714. <td class="quantity-remaining negative" v-else-if="getProductQuantityRemaining(product) <= 0">
  715. {{ getProductQuantityRemaining(product) }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}
  716. <span class="glyphicon glyphicon-alert" v-if="getProductQuantityRemaining(product) < 0"></span>
  717. </td>
  718. <td class="quantity-remaining has-quantity" v-else>{{ getProductQuantityRemaining(product) }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
  719. </tr>
  720. </tbody>
  721. </table>
  722. </div>
  723. </div>
  724. <div slot="footer">
  725. <div class="actions-form">
  726. <button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button>
  727. <button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id">Créer</button>
  728. <button class="modal-default-button btn btn-danger" @click="$emit('close')">Fermer</button>
  729. <div class="right">
  730. <button class="modal-default-button btn btn-info btn-update-prices" @click="updateProductOrderPrices(true)">Recharger les prix</button>
  731. <button v-if="order.id" class="modal-default-button btn btn-info btn-update-prices" @click="updateInvoicePrices(true)">
  732. Réinitialiser les prix facturés
  733. </button>
  734. <button class="modal-default-button btn btn-info btn-display-prices-without-tax" @click="toggleVatMode()">
  735. <template v-if="vatMode == 'all'">Cacher</template>
  736. <template v-else>Afficher</template>
  737. les prix HT
  738. </button>
  739. </div>
  740. </div>
  741. </div>
  742. </modal>
  743. </script>
  744. <script type="text/x-template" id="order-state-payment">
  745. <div class="input-group">
  746. <span class="label label-success input-group-addon" v-if="order.amount_paid == order.amount">payé</span>
  747. <span class="label label-default input-group-addon" v-else-if="order.amount_paid == 0">non réglé</span>
  748. <span class="label label-default input-group-addon" v-else-if="order.amount_paid > order.amount">surplus</span>
  749. <span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à débiter</span>
  750. </div>
  751. </script>
  752. <!-- template for the modal component -->
  753. <script type="text/x-template" id="modal-template">
  754. <transition name="modal">
  755. <div class="modal-mask">
  756. <div class="modal-wrapper">
  757. <div class="modal-container">
  758. <div class="modal-header">
  759. <slot name="header"></slot>
  760. </div>
  761. <div class="modal-body">
  762. <slot name="body"></slot>
  763. </div>
  764. <div class="modal-footer">
  765. <slot name="footer">
  766. <button class="modal-default-button btn btn-default" @click="$emit('close')">Fermer</button>
  767. </slot>
  768. </div>
  769. </div>
  770. </div>
  771. </div>
  772. </transition>
  773. </script>