App.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template lang="pug">
  2. .purchases
  3. form-wizard(title='' subtitle='' finishButtonText='Finalizar' :hideButtons='isProcessing' color='#7c7bad' nextButtonText='Continuar' backButtonText='Volver' @on-complete='createPurchase' ref='wizard')
  4. tab-content(title='Cuál es su proveedor?' :before-change='checkSupplier')
  5. supplier-step
  6. tab-content(title='Qué productos comprarás?' :before-change='checkCart')
  7. product-step
  8. tab-content(title='Cómo quieres pagar?')
  9. payment-method-step
  10. tab-content(title='Qué monto vas a pagar?')
  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 SupplierStep from '@/components/steps/Supplier'
  18. import ProductStep from '@/components/steps/Product'
  19. import PaymentMethodStep from '@/components/steps/PaymentMethod'
  20. import PaymentAmountStep from '@/components/steps/PaymentAmount'
  21. export default {
  22. components: {
  23. FormWizard,
  24. TabContent,
  25. SupplierStep,
  26. ProductStep,
  27. PaymentMethodStep,
  28. PaymentAmountStep
  29. },
  30. computed: mapGetters([
  31. 'isProcessing',
  32. 'state'
  33. ]),
  34. methods: mapActions([
  35. 'initPurchase',
  36. 'createPurchase'
  37. ]),
  38. watch: {
  39. state(value) {
  40. if (value === 'done') {
  41. this.$refs.wizard.changeTab(3, 0, false)
  42. }
  43. }
  44. },
  45. mounted() {
  46. this.initPurchase(this.$root.mode)
  47. }
  48. }
  49. </script>
  50. <style lang="sass">
  51. @import './assets/variables'
  52. .purchases
  53. width: 100%
  54. height: 100%
  55. position: absolute
  56. .vue-form-wizard
  57. width: 100%
  58. height: 100%
  59. padding-bottom: 0
  60. .wizard-header
  61. display: none
  62. .wizard-navigation
  63. width: 100%
  64. height: 100%
  65. .wizard-progress-with-circle
  66. top: 35px
  67. .wizard-icon-circle
  68. width: 60px
  69. height: 60px
  70. .wizard-tab-content
  71. width: 100%
  72. height: calc(100% - 82px)
  73. padding: 0
  74. overflow: hidden
  75. .wizard-tab-container
  76. width: calc(100% - 20px)
  77. height: calc(100% - 20px)
  78. margin: 10px
  79. .purchase-step
  80. width: 100%
  81. height: 100%
  82. background: $app-bg-color
  83. .wizard-card-footer
  84. width: 100%
  85. height: 50px
  86. position: absolute
  87. bottom: 0
  88. .wizard-btn
  89. width: 160px
  90. height: 40px
  91. border-radius: 0
  92. box-shadow: none
  93. border: none
  94. &:hover, &:focus
  95. background: $app-main-color
  96. </style>