Ticket.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template lang="pug">
  2. .ticket
  3. .ticket-summary
  4. .ticket-summary-header
  5. h3 {{ companyName }}
  6. table
  7. tbody
  8. tr
  9. td Producto
  10. td Precio
  11. td Cant
  12. td Subtotal
  13. .ticket-items-wrapper
  14. table
  15. tbody
  16. tr(v-for='item in items' :key='item.id')
  17. td {{ item.name }}
  18. td {{ item.price }}
  19. td {{ item.quantity }}
  20. td {{ (item.price || 0) * (item.quantity || 0) }}
  21. .ticket-summary-footer
  22. table
  23. tbody
  24. tr
  25. td Total:
  26. td {{ total | currency(...defaultCurrency) }}
  27. tr
  28. td Cliente:
  29. td {{ customerName }}
  30. </template>
  31. <script>
  32. export default {
  33. props: {
  34. companyName: {
  35. type: String,
  36. default: ''
  37. },
  38. customerName: {
  39. type: String,
  40. default: ''
  41. },
  42. defaultCurrency: {
  43. type: Object,
  44. default: {
  45. symbol: '$',
  46. position: 'before',
  47. thousandsSeparator: '.',
  48. decimalPlaces: 2,
  49. decimalSeparator: ','
  50. }
  51. },
  52. total: {
  53. type: Number,
  54. default: 0
  55. },
  56. items: {
  57. type: [],
  58. default: []
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="sass">
  64. @import '../../assets/variables'
  65. .ticket
  66. width: 500px
  67. height: 100%
  68. .ticket-summary
  69. width: 350px
  70. height: 450px
  71. border: 1px solid $app-border-color
  72. margin: auto
  73. box-shadow: -2px 2px 5pc $app-border-color, 2px 2px 5px $app-border-color
  74. position: relative
  75. .ticket-summary-header, .ticket-summary-footer
  76. width: 100%
  77. position: absolute
  78. .ticket-summary-header
  79. height: 65px
  80. top: 0
  81. h3
  82. text-align: center
  83. font-size: 14pt
  84. margin: 0 15px
  85. padding: 30px 0 15px 0
  86. color: $app-dark-color
  87. table
  88. width: 308px
  89. height: 30px
  90. margin: 0 20px
  91. font-size: 7.5pt
  92. font-weight: bold
  93. tbody
  94. tr
  95. line-height: 30px
  96. border-top: 1px solid $app-border-color
  97. border-bottom: 1px solid $app-border-color
  98. td
  99. &:nth-child(1)
  100. width: 180px
  101. text-align: left
  102. &:nth-child(2)
  103. width: 50px
  104. text-align: right
  105. &:nth-child(3)
  106. width: 30px
  107. text-align: right
  108. &:nth-child(4)
  109. width: 50px
  110. text-align: right
  111. .ticket-items-wrapper
  112. width: 310px
  113. height: 280px
  114. margin: 95px 20px 75px 20px
  115. padding-top: 5px
  116. overflow-y: auto
  117. table
  118. width: 100%
  119. font-size: 7.5pt
  120. tbody
  121. tr
  122. height: 28px
  123. line-height: 30px
  124. td
  125. &:nth-child(1)
  126. width: 180px
  127. &:nth-child(2)
  128. width: 50px
  129. text-align: right
  130. &:nth-child(3)
  131. width: 30px
  132. text-align: right
  133. &:nth-child(4)
  134. width: 50px
  135. text-align: right
  136. .ticket-summary-footer
  137. width: 348px
  138. height: 75px
  139. bottom: 0
  140. padding: 15px 25px
  141. background: $app-bg-color
  142. table
  143. width: 100%
  144. tbody
  145. tr
  146. height: 25px
  147. line-height: 20px
  148. td
  149. &:nth-child(1)
  150. font-weight: bold
  151. &:nth-child(2)
  152. text-align: right
  153. </style>