App.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template lang="pug">
  2. .pos
  3. form-wizard(title='' subtitle='' finishButtonText='Finalizar' :hideButtons='processing' color='#7c7bad' nextButtonText='Continuar' backButtonText='Volver' @on-complete='createSale' ref='wizard')
  4. tab-content(title="Qué productos necesita?" :beforeChange="checkCart")
  5. product-step
  6. tab-content(title="Quién es el cliente?" :beforeChange="checkCustomer")
  7. customer-step
  8. tab-content(v-if='isSale' title="Cómo quieres pagar?" :beforeChange="checkPaymentMethod")
  9. payment-method-step
  10. tab-content(v-if='isSale' title="Qué monto vas a entregar?" :beforeChange="checkAmountReceived")
  11. payment-amount-step
  12. </template>
  13. <script>
  14. import { mapGetters, mapActions } from 'vuex'
  15. import { FormWizard, TabContent } from 'vue-form-wizard'
  16. import 'vue-form-wizard/dist/vue-form-wizard.min.css'
  17. import ProductStep from '@@/steps/Product'
  18. import CustomerStep from '@@/steps/Customer'
  19. import PaymentMethodStep from '@@/steps/PaymentMethod'
  20. import PaymentAmountStep from '@@/steps/PaymentAmount'
  21. export default {
  22. components: {
  23. FormWizard,
  24. TabContent,
  25. ProductStep,
  26. CustomerStep,
  27. PaymentMethodStep,
  28. PaymentAmountStep
  29. },
  30. computed: mapGetters([
  31. 'isSale',
  32. 'selectedBank',
  33. 'processing',
  34. 'completed'
  35. ]),
  36. methods: mapActions([
  37. 'initSale',
  38. 'checkCart',
  39. 'checkCustomer',
  40. 'checkPaymentMethod',
  41. 'checkAmountReceived',
  42. 'createSale',
  43. 'resetSale'
  44. ]),
  45. watch: {
  46. selectedBank(value) {
  47. if (!value) {
  48. return
  49. }
  50. this.$refs.wizard.changeTab(2, 3, false)
  51. },
  52. completed(value) {
  53. if (!value) {
  54. return
  55. }
  56. this.$refs.wizard.changeTab(3, 0, false)
  57. this.resetSale()
  58. }
  59. },
  60. mounted() {
  61. this.initSale(this.$root.mode)
  62. }
  63. }
  64. </script>
  65. <style lang="sass">
  66. @import './assets/variables'
  67. .pos
  68. width: 100%
  69. height: 100%
  70. position: absolute
  71. .vue-form-wizard
  72. width: 100%
  73. height: 100%
  74. padding-bottom: 0
  75. .wizard-header
  76. display: none
  77. .wizard-navigation
  78. width: 100%
  79. height: 100%
  80. .wizard-progress-with-circle
  81. top: 35px
  82. .wizard-icon-circle
  83. width: 60px
  84. height: 60px
  85. .wizard-tab-content
  86. width: 100%
  87. height: calc(100% - 82px)
  88. padding: 0
  89. overflow: hidden
  90. .wizard-tab-container
  91. width: calc(100% - 20px)
  92. height: calc(100% - 20px)
  93. margin: 10px
  94. .pos-step
  95. width: 100%
  96. height: 100%
  97. background: $app-bg-color
  98. .wizard-card-footer
  99. width: 100%
  100. height: 50px
  101. position: absolute
  102. bottom: 10px
  103. .wizard-btn
  104. width: 160px
  105. height: 40px
  106. border-radius: 0
  107. box-shadow: none
  108. border: none
  109. &:hover, &:focus
  110. background: $app-main-color
  111. </style>