PrintInStoreInAndOutReport.vue 4.9 KB

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