App.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template lang="pug">
  2. .app
  3. form-wizard(title="" subtitle="" nextButtonText="Continuar" backButtonText="Volver" finishButtonText="Finalizar" color="#7c7bad")
  4. tab-content(title="Agregue productos al carrito" :before-change="checkCart")
  5. .pos
  6. .products-container
  7. products-searcher
  8. products-grid(:symbol="currency.symbol")
  9. .cart-container
  10. cart-total(:total="total" :symbol="currency.symbol")
  11. cart-items(:symbol="currency.symbol")
  12. tab-content(title="Seleccione un cliente" :before-change="checkCustomer")
  13. customer-searcher
  14. customers-grid
  15. tab-content(title="Vea un resumen de su operación")
  16. summary-display
  17. loader
  18. </template>
  19. <script>
  20. import { FormWizard, TabContent } from 'vue-form-wizard'
  21. import 'vue-form-wizard/dist/vue-form-wizard.min.css'
  22. import Loader from '@/components/Loader'
  23. import ProductsSearcher from '@/components/ProductsSearcher'
  24. import ProductsGrid from '@/components/ProductsGrid'
  25. import CartTotal from '@/components/CartTotal'
  26. import CartItems from '@/components/CartItems'
  27. import CartItem from '@/components/CartItem'
  28. import CustomerSearcher from '@/components/CustomerSearcher'
  29. import CustomersGrid from '@/components/CustomersGrid'
  30. import SummaryDisplay from '@/components/SummaryDisplay'
  31. import { mapActions, mapGetters } from 'vuex'
  32. import Vuex from 'vuex'
  33. export default {
  34. components: {
  35. 'form-wizard': FormWizard,
  36. 'tab-content': TabContent,
  37. 'loader': Loader,
  38. 'products-searcher': ProductsSearcher,
  39. 'products-grid': ProductsGrid,
  40. 'cart-total': CartTotal,
  41. 'cart-items': CartItems,
  42. 'cart-item': CartItem,
  43. 'customer-searcher': CustomerSearcher,
  44. 'customers-grid': CustomersGrid,
  45. 'summary-display': SummaryDisplay
  46. },
  47. computed: mapGetters({
  48. total: 'getTotal',
  49. currency: 'getCurrency',
  50. cartIsEmpty: 'cartIsEmpty',
  51. hasSelectedCustomer: 'hasSelectedCustomer'
  52. }),
  53. methods: {
  54. checkCart() {
  55. if (!this.cartIsEmpty) {
  56. this.notify('Necesitas agregar productos al carrito para continuar')
  57. }
  58. return this.cartIsEmpty
  59. },
  60. checkCustomer() {
  61. if (!this.hasSelectedCustomer) {
  62. this.notify('Necesitas seleccionar un cliente para continuar')
  63. }
  64. return this.hasSelectedCustomer
  65. },
  66. ...mapActions([
  67. 'fetchData',
  68. 'notify'
  69. ])
  70. },
  71. mounted() {
  72. this.fetchData()
  73. }
  74. }
  75. </script>
  76. <style lang="sass">
  77. .vue-form-wizard
  78. width: 100%
  79. height: 100%
  80. padding-bottom: 0
  81. display: flex
  82. flex-direction: column
  83. .wizard-header
  84. display: none
  85. .wizard-navigation
  86. width: 100%
  87. flex-grow: 1
  88. .wizard-progress-with-circle
  89. top: 35px
  90. .wizard-icon-circle
  91. width: 60px
  92. height: 60px
  93. .wizard-tab-content
  94. padding: 0
  95. .pos
  96. width: 100%
  97. height: 100%
  98. padding: 10px
  99. display: block
  100. background: #fff
  101. .products-container
  102. width: calc(100% - 300px)
  103. height: 100%
  104. padding-right: 5px
  105. display: inline-block
  106. .cart-container
  107. width: 300px
  108. height: 100%
  109. border-left: 1px solid #d3d3d3
  110. padding-left: 10px
  111. display: inline-block
  112. vertical-align: top
  113. .wizard-card-footer
  114. padding-bottom: 15px
  115. .wizard-btn
  116. width: 160px
  117. height: 40px
  118. border-radius: 0
  119. box-shadow: none
  120. border: none
  121. &:hover, &:focus
  122. background: #7c7bad
  123. </style>