App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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, WizardButton } 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. WizardButton,
  32. CartStep,
  33. CustomerStep,
  34. PaymentMethodStep,
  35. PaymentCashStep,
  36. PaymentCreditStep,
  37. Loader,
  38. },
  39. computed: mapGetters([
  40. 'payment'
  41. ]),
  42. methods: mapActions([
  43. 'initSale',
  44. 'checkCart',
  45. 'checkCustomer',
  46. 'checkAmountPaid',
  47. 'completeSale'
  48. ]),
  49. mounted() {
  50. this.initSale(this.$root.pos_instance)
  51. }
  52. }
  53. </script>
  54. <style lang="sass">
  55. .pos
  56. width: 100%
  57. height: 100%
  58. position: absolute
  59. .vue-form-wizard
  60. width: 100%
  61. height: 100%
  62. padding-bottom: 0
  63. .wizard-header
  64. display: none
  65. .wizard-navigation
  66. width: 100%
  67. height: 100%
  68. .wizard-progress-with-circle
  69. top: 35px
  70. .wizard-icon-circle
  71. width: 60px
  72. height: 60px
  73. .wizard-tab-content
  74. width: 100%
  75. height: calc(100% - 82px)
  76. padding: 0
  77. overflow: hidden
  78. .wizard-tab-container
  79. width: calc(100% - 20px)
  80. height: calc(100% - 20px)
  81. margin: 10px
  82. .pos-step
  83. width: 100%
  84. height: 100%
  85. background: #fff
  86. .wizard-card-footer
  87. width: 100%
  88. height: 50px
  89. position: absolute
  90. bottom: 0
  91. .wizard-btn
  92. width: 160px
  93. height: 40px
  94. border-radius: 0
  95. box-shadow: none
  96. border: none
  97. &:hover, &:focus
  98. background: #7c7bad
  99. </style>