App.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. 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. 'isSale',
  33. 'processing',
  34. 'completed'
  35. ]),
  36. methods: mapActions([
  37. INIT_SALE,
  38. CHECK_CART,
  39. CHECK_CUSTOMER,
  40. CHECK_AMOUNT_RECEIVED,
  41. CREATE_SALE,
  42. RESET_SALE
  43. ]),
  44. watch: {
  45. completed(value) {
  46. if (value) {
  47. this.$refs.wizard.changeTab(3, 0, false)
  48. this.resetSale()
  49. }
  50. }
  51. },
  52. mounted() {
  53. this.initSale(this.$root.mode)
  54. }
  55. }
  56. </script>
  57. <style lang="sass">
  58. @import './assets/variables'
  59. .pos
  60. width: 100%
  61. height: 100%
  62. position: absolute
  63. .vue-form-wizard
  64. width: 100%
  65. height: 100%
  66. padding-bottom: 0
  67. .wizard-header
  68. display: none
  69. .wizard-navigation
  70. width: 100%
  71. height: 100%
  72. .wizard-progress-with-circle
  73. top: 35px
  74. .wizard-icon-circle
  75. width: 60px
  76. height: 60px
  77. .wizard-tab-content
  78. width: 100%
  79. height: calc(100% - 82px)
  80. padding: 0
  81. overflow: hidden
  82. .wizard-tab-container
  83. width: calc(100% - 20px)
  84. height: calc(100% - 20px)
  85. margin: 10px
  86. .pos-step
  87. width: 100%
  88. height: 100%
  89. background: $app-bg-color
  90. .wizard-card-footer
  91. width: 100%
  92. height: 50px
  93. position: absolute
  94. bottom: 10px
  95. .wizard-btn
  96. width: 160px
  97. height: 40px
  98. border-radius: 0
  99. box-shadow: none
  100. border: none
  101. &:hover, &:focus
  102. background: $app-main-color
  103. </style>