App.vue 3.4 KB

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