PrintInRepairReportMttr.vue 4.8 KB

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