PaymentStep.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template lang="pug">
  2. .purchase-step
  3. .payment-wrapper
  4. form.payment-form
  5. .form-separator
  6. h3 Detalles del Pago
  7. hr
  8. .cash-payment(v-if="selectedJournal.type === 'cash'")
  9. .form-item
  10. label.form-label Monto a pagar
  11. input.form-input(:value='cartTotal' readonly)
  12. .form-item
  13. label.form-label Total recibido
  14. input.form-input(:value='amount' v-model='amount' autofocus)
  15. hr
  16. .form-item
  17. label.form-label Total a devolver
  18. input.form-input(:value='amountResidual' readonly)
  19. </template>
  20. <script>
  21. import { mapGetters, mapActions } from 'vuex'
  22. export default {
  23. computed: {
  24. amount: {
  25. get() {
  26. return this.amountPaid
  27. },
  28. set(value) {
  29. this.changeAmountPaid(value)
  30. }
  31. },
  32. ...mapGetters([
  33. 'selectedJournal',
  34. 'cartTotal',
  35. 'amountPaid',
  36. 'amountResidual'
  37. ])
  38. },
  39. methods: mapActions([
  40. 'changeAmountPaid'
  41. ])
  42. }
  43. </script>
  44. <style lang="sass">
  45. .purchase-step
  46. .payment-wrapper
  47. width: 100%
  48. height: 100%
  49. display: flex
  50. align-items: center
  51. justify-content: center
  52. .payment-form
  53. width: 600px
  54. height: 100%
  55. background: #f5f5f5
  56. padding: 25px
  57. .form-separator
  58. h3
  59. color: #9e9e9e
  60. font-size: 8pt
  61. hr
  62. margin-top: 5px
  63. .form-item
  64. width: 100%
  65. height: 45px
  66. margin-bottom: 15px
  67. .form-label
  68. width: 200px
  69. height: 45px
  70. font-size: 14pt
  71. .form-input
  72. width: 350px
  73. height: 45px
  74. font-size: 14pt
  75. border-radius: 0
  76. </style>