App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template lang="pug">
  2. .pos
  3. form-wizard(title="" subtitle="" finishButtonText="Finalizar" color="#7c7bad" nextButtonText="Continuar" backButtonText="Volver" transition="fade" @on-complete="completeSale()")
  4. tab-content(title="Agregue productos al carrito" :before-change="checkCart")
  5. cart-step
  6. tab-content(title="Seleccione un cliente" :before-change="checkCustomer")
  7. customer-step
  8. tab-content(title="Vea un resumen de su operación")
  9. payment-step
  10. loader
  11. </template>
  12. <script>
  13. import { FormWizard, TabContent } from 'vue-form-wizard'
  14. import 'vue-form-wizard/dist/vue-form-wizard.min.css'
  15. import CartStep from '@/components/cart/CartStep'
  16. import CustomerStep from '@/components/customer/CustomerStep'
  17. import PaymentStep from '@/components/payment/PaymentStep'
  18. import Loader from '@/components/Loader'
  19. import { mapActions, mapGetters } from 'vuex'
  20. import Vuex from 'vuex'
  21. export default {
  22. components: {
  23. TabContent,
  24. FormWizard,
  25. CartStep,
  26. CustomerStep,
  27. PaymentStep,
  28. Loader,
  29. },
  30. computed: mapGetters([
  31. 'cartIsEmpty',
  32. 'hasSelectedCustomer'
  33. ]),
  34. methods: {
  35. checkCart() {
  36. if (!this.cartIsEmpty) {
  37. this.notify('Necesitas agregar productos al carrito para continuar')
  38. }
  39. return this.cartIsEmpty
  40. },
  41. checkCustomer() {
  42. if (!this.hasSelectedCustomer) {
  43. this.notify('Necesitas seleccionar un cliente para continuar')
  44. }
  45. return this.hasSelectedCustomer
  46. },
  47. ...mapActions([
  48. 'initSale',
  49. 'notify',
  50. 'completeSale'
  51. ])
  52. },
  53. mounted() {
  54. this.initSale(this.$root.pos_instance)
  55. }
  56. }
  57. </script>
  58. <style lang="sass">
  59. .pos
  60. width: 100%
  61. height: 100%
  62. position: absolute
  63. .vue-form-wizard
  64. width: 100%
  65. height: 100%
  66. padding-bottom: 0
  67. .wizard-header
  68. display: none
  69. .wizard-navigation
  70. width: 100%
  71. height: 100%
  72. .wizard-progress-with-circle
  73. top: 35px
  74. .wizard-icon-circle
  75. width: 60px
  76. height: 60px
  77. .wizard-tab-content
  78. width: 100%
  79. height: calc(100% - 82px)
  80. padding: 0
  81. overflow: hidden
  82. .wizard-tab-container
  83. width: calc(100% - 20px)
  84. height: calc(100% - 20px)
  85. margin: 10px
  86. .pos-step
  87. width: 100%
  88. height: 100%
  89. background: #fff
  90. .wizard-card-footer
  91. width: 100%
  92. height: 50px
  93. position: absolute
  94. bottom: 0
  95. .wizard-btn
  96. width: 160px
  97. height: 40px
  98. border-radius: 0
  99. box-shadow: none
  100. border: none
  101. &:hover, &:focus
  102. background: #7c7bad
  103. </style>