PrintSparePartMonthReport.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div class="print-content" v-show="visible">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-button type="primary" v-print="'#print-container2'" :disabled="disabled">打印</a-button>
  7. <a-button style="margin-left: 8px" @click="handleCancel()">返回列表</a-button>
  8. </span>
  9. </a-col>
  10. </a-row>
  11. <div class="container" id="print-container2">
  12. <div class="text-center" style="position:relative;font-size:20px;font-weight:bold">
  13. Hitachi<br/> 备件月统计报表
  14. </div>
  15. <div>
  16. <div class="col-md-4 text-center" style="padding: 0">统计周期: {{ record.startMonth }} 至 {{ record.endMonth }}</div>
  17. </div>
  18. <table class="gridtable list">
  19. <tbody>
  20. <tr>
  21. <td class="text-center">月份</td>
  22. <td class="text-center">更换备件总数</td>
  23. <td class="text-center">更换备件总价值(元)</td>
  24. </tr>
  25. <tr :key="index" v-for="(item,index) in items">
  26. <td class="text-center">{{ item.month}}</td>
  27. <td class="text-center">{{ item.totalNum }}</td>
  28. <td class="text-center">{{ item.totalPrice }}</td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. <div class="row">
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import { formatDate } from '@/utils/util'
  39. export default {
  40. name: 'PrintSparePartMonthReport',
  41. components: { },
  42. data () {
  43. return {
  44. visible: false,
  45. disabled: true,
  46. record: {},
  47. count: 0,
  48. items: [],
  49. user: this.$store.getters.userInfo
  50. // 下拉框map
  51. }
  52. },
  53. props: {},
  54. created () {
  55. // 下拉框map
  56. },
  57. computed: {
  58. },
  59. methods: {
  60. base (record) {
  61. this.disabled = true
  62. this.visible = true
  63. this.record = record
  64. this.items = record.data
  65. this.disabled = false
  66. },
  67. formatDateEn (value) {
  68. return formatDate(new Date(value), 'yyyy-MM-dd')
  69. },
  70. handleCancel (values) {
  71. this.visible = false
  72. this.$emit('ok', values)
  73. }
  74. }
  75. }
  76. </script>
  77. <style media=print>
  78. /* 应用这个样式的在打印时隐藏 */
  79. .noPrint {
  80. display: none;
  81. }
  82. /* 应用这个样式的,从那个标签结束开始另算一页,之后在遇到再起一页,以此类推 */
  83. .page {
  84. page-break-after: always;
  85. }
  86. </style>
  87. <style>
  88. .print-content{
  89. width: 1123px;
  90. background-color: #fff;
  91. }
  92. #print-container2 * {
  93. font-family: SimHei !important;
  94. color: #333447;
  95. line-height: 1.5;
  96. }
  97. .container {
  98. width: 95%;
  99. padding-right: 15px;
  100. padding-left: 15px;
  101. margin-right: auto;
  102. margin-left: auto;
  103. }
  104. .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
  105. position: relative;
  106. min-height: 1px;
  107. padding-right: 15px;
  108. padding-left: 15px;
  109. }
  110. .text-left {
  111. text-align: left;
  112. }
  113. .text-right {
  114. text-align: right;
  115. }
  116. .text-center {
  117. text-align: center;
  118. }
  119. table.gridtable {
  120. width: 100%;
  121. font-family: verdana, arial, sans-serif;
  122. font-size: 11px;
  123. color: #333333;
  124. border-width: 1px;
  125. border-color: #666666;
  126. border-collapse: collapse;
  127. }
  128. table.gridtable th {
  129. border-width: 1px;
  130. padding: 8px;
  131. border-style: solid;
  132. border-color: #666666;
  133. background-color: #dedede;
  134. }
  135. table.gridtable td {
  136. border-width: 1px;
  137. padding: 8px;
  138. border-style: solid;
  139. border-color: #666666;
  140. background-color: #ffffff;
  141. }
  142. table.content td {
  143. height: 95px;
  144. }
  145. .row {
  146. margin-right: -15px;
  147. margin-left: -15px;
  148. }
  149. .container:before,
  150. .container:after,
  151. .row:before, .row:after {
  152. display: table;
  153. content: " ";
  154. }
  155. .container:after, .row:after {
  156. clear: both;
  157. }
  158. .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
  159. float: left;
  160. }
  161. .col-md-12 {
  162. width: 100%;
  163. }
  164. .col-md-11 {
  165. width: 91.66666667%;
  166. }
  167. .col-md-10 {
  168. width: 83.33333333%;
  169. }
  170. .col-md-9 {
  171. width: 75%;
  172. }
  173. .col-md-8 {
  174. width: 66.66666667%;
  175. }
  176. .col-md-7 {
  177. width: 58.33333333%;
  178. }
  179. .col-md-6 {
  180. width: 50%;
  181. }
  182. .col-md-5 {
  183. width: 41.66666667%;
  184. }
  185. .col-md-4 {
  186. width: 33.33333333%;
  187. }
  188. .col-md-3 {
  189. width: 25%;
  190. }
  191. .col-md-2 {
  192. width: 16.66666667%;
  193. }
  194. .col-md-1 {
  195. width: 8.33333333%;
  196. }
  197. </style>