PaymentMethod.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template lang="pug">
  2. .pos-step
  3. ticket(:customerName='selectedCustomer && selectedCustomer.name' :total='cartTotal' :items='cartItems')
  4. form.payment-method
  5. .form-separator
  6. h3 Detalles del Cliente
  7. hr
  8. .form-item
  9. label.form-label Cliente
  10. input.form-input(:value='selectedCustomer && selectedCustomer.name' readonly)
  11. transition(name='fade')
  12. .form-item(v-if="payment === 'credit'")
  13. label.form-label Crédito
  14. input.form-input(:value='customerCredit' readonly)
  15. .form-separator
  16. h3 Detalles del Pago
  17. hr
  18. .form-item
  19. label.form-label Forma de Pago
  20. .form-item-option
  21. input.form-input(type='radio' id='cash' value='cash' v-model='payment')
  22. label(for='cash') Contado
  23. .form-item-option
  24. input.form-input(type='radio' id='credit' value='credit' v-model='payment')
  25. label(for='credit') Crédito
  26. transition(name='fade')
  27. .form-item(v-if="payment === 'credit'")
  28. select.form-input.input-only
  29. option(v-for='term in paymentTerms' :value='term' v-if="term.lines.length > 0 && (term.lines[0].days !== 0 || term.lines[0].value !== 'balance')") {{ term.displayName }}
  30. .form-item(v-else)
  31. label.form-label Método de Pago
  32. select.form-input
  33. option(v-for='journal in journals') {{ journal.displayName }}
  34. </template>
  35. <script>
  36. import { mapGetters, mapActions } from 'vuex'
  37. import Ticket from '@@/common/Ticket'
  38. import { CHANGE_PAYMENT_TYPE } from '@/constants/actionTypes'
  39. export default {
  40. components: {
  41. Ticket
  42. },
  43. watch: {
  44. payment(value) {
  45. this.changePaymentType(value)
  46. }
  47. },
  48. computed: mapGetters([
  49. 'selectedCustomer',
  50. 'cartItems',
  51. 'cartTotal',
  52. 'customerCredit',
  53. 'paymentTerms',
  54. 'journals'
  55. ]),
  56. methods: mapActions([
  57. CHANGE_PAYMENT_TYPE
  58. ]),
  59. data() {
  60. return {
  61. payment: 'cash'
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="sass">
  67. @import '../../assets/variables'
  68. .pos-step
  69. width: 100%
  70. height: calc(100% - 50px)
  71. padding-bottom: 50px
  72. display: flex
  73. .payment-method
  74. width: calc(100% - 450px)
  75. height: 100%
  76. margin-right: 50px
  77. padding: 35px
  78. background: $app-light-color
  79. .form-separator
  80. h3
  81. color: $app-separator-color
  82. font-size: 8pt
  83. margin: 0
  84. hr
  85. margin-top: 15px
  86. .form-item
  87. width: 100%px
  88. height: 45px
  89. margin-bottom: 15px
  90. .form-label
  91. width: 250px
  92. height: 45px
  93. font-size: 14pt
  94. .form-input
  95. width: 350px
  96. height: 45px
  97. font-size: 14pt
  98. border-radius: 0
  99. &.input-only
  100. margin-left: 250px
  101. margin-bottom: 15px
  102. .form-item-option
  103. display: inline-block
  104. input
  105. width: 20px
  106. height: 20px
  107. label
  108. font-size: 12pt
  109. margin: 0 45px 15px 5px
  110. </style>