Ticket.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template lang="pug">
  2. .ticket
  3. .ticket-summary
  4. .ticket-summary-header
  5. h3 {{ companyName || 'No company' }}
  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 || 'no data' }}
  18. td {{ item.price || 'no data' }}
  19. td {{ item.quantity || 'no data' }}
  20. td {{ ((item.price || 0) * (item.quantity || 0)) || 'no data' }}
  21. .ticket-summary-footer
  22. table
  23. tbody
  24. tr
  25. td Total:
  26. td {{ total || 'no data' }}
  27. tr
  28. td Cliente:
  29. td {{ customerName || 'no data' }}
  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. total: {
  43. type: Number,
  44. default: 0
  45. },
  46. items: {
  47. type: [],
  48. default: []
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="sass">
  54. @import '../../assets/variables'
  55. .ticket
  56. width: 500px
  57. height: 100%
  58. .ticket-summary
  59. width: 350px
  60. height: 450px
  61. border: 1px solid $app-border-color
  62. margin: auto
  63. box-shadow: -2px 2px 5pc $app-border-color, 2px 2px 5px $app-border-color
  64. position: relative
  65. .ticket-summary-header, .ticket-summary-footer
  66. width: 100%
  67. position: absolute
  68. .ticket-summary-header
  69. height: 65px
  70. top: 0
  71. h3
  72. text-align: center
  73. font-size: 14pt
  74. margin: 0 15px
  75. padding: 30px 0 15px 0
  76. color: $app-dark-color
  77. table
  78. width: 308px
  79. height: 30px
  80. margin: 0 20px
  81. font-size: 7.5pt
  82. font-weight: bold
  83. tbody
  84. tr
  85. line-height: 30px
  86. border-top: 1px solid $app-border-color
  87. border-bottom: 1px solid $app-border-color
  88. td
  89. &:nth-child(1)
  90. width: 180px
  91. text-align: left
  92. &:nth-child(2)
  93. width: 50px
  94. text-align: right
  95. &:nth-child(3)
  96. width: 30px
  97. text-align: right
  98. &:nth-child(4)
  99. width: 50px
  100. text-align: right
  101. .ticket-items-wrapper
  102. width: 310px
  103. height: 280px
  104. margin: 95px 20px 75px 20px
  105. padding-top: 5px
  106. overflow-y: auto
  107. table
  108. width: 100%
  109. font-size: 7.5pt
  110. tbody
  111. tr
  112. height: 28px
  113. line-height: 30px
  114. td
  115. &:nth-child(1)
  116. width: 180px
  117. &:nth-child(2)
  118. width: 50px
  119. text-align: right
  120. &:nth-child(3)
  121. width: 30px
  122. text-align: right
  123. &:nth-child(4)
  124. width: 50px
  125. text-align: right
  126. .ticket-summary-footer
  127. width: 348px
  128. height: 75px
  129. bottom: 0
  130. padding: 15px 25px
  131. background: $app-bg-color
  132. table
  133. width: 100%
  134. tbody
  135. tr
  136. height: 25px
  137. line-height: 20px
  138. td
  139. &:nth-child(1)
  140. font-weight: bold
  141. &:nth-child(2)
  142. text-align: right
  143. </style>