App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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(title="Cómo quieres pagar?" :beforeChange="checkPaymentMethod")
  9. payment-method-step
  10. tab-content(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. import { INIT_SALE, CHECK_CART, CHECK_CUSTOMER, CHECK_PAYMENT_METHOD, CHECK_AMOUNT_RECEIVED, CREATE_SALE, RESET_SALE } from '@/constants/actionTypes'
  22. export default {
  23. components: {
  24. FormWizard,
  25. TabContent,
  26. ProductStep,
  27. CustomerStep,
  28. PaymentMethodStep,
  29. PaymentAmountStep
  30. },
  31. computed: mapGetters([
  32. 'processing',
  33. 'completed'
  34. ]),
  35. methods: mapActions([
  36. INIT_SALE,
  37. CHECK_CART,
  38. CHECK_CUSTOMER,
  39. CHECK_AMOUNT_RECEIVED,
  40. CREATE_SALE,
  41. RESET_SALE
  42. ]),
  43. watch: {
  44. completed(value) {
  45. if (value) {
  46. this.$refs.wizard.changeTab(3, 0, false)
  47. this.resetSale()
  48. }
  49. }
  50. },
  51. mounted() {
  52. this.initSale()
  53. }
  54. }
  55. </script>
  56. <style lang="sass">
  57. @import './assets/variables'
  58. .pos
  59. width: 100%
  60. height: 100%
  61. position: absolute
  62. .vue-form-wizard
  63. width: 100%
  64. height: 100%
  65. padding-bottom: 0
  66. .wizard-header
  67. display: none
  68. .wizard-navigation
  69. width: 100%
  70. height: 100%
  71. .wizard-progress-with-circle
  72. top: 35px
  73. .wizard-icon-circle
  74. width: 60px
  75. height: 60px
  76. .wizard-tab-content
  77. width: 100%
  78. height: calc(100% - 82px)
  79. padding: 0
  80. overflow: hidden
  81. .wizard-tab-container
  82. width: calc(100% - 20px)
  83. height: calc(100% - 20px)
  84. margin: 10px
  85. .pos-step
  86. width: 100%
  87. height: 100%
  88. background: #fff
  89. .wizard-card-footer
  90. width: 100%
  91. height: 50px
  92. position: absolute
  93. bottom: 0
  94. .wizard-btn
  95. width: 160px
  96. height: 40px
  97. border-radius: 0
  98. box-shadow: none
  99. border: none
  100. &:hover, &:focus
  101. background: $app-main-color
  102. </style>