warehouseBatchPrint.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  6. <title></title>
  7. <style>
  8. table,
  9. table tr th,
  10. table tr td {
  11. border: 2px solid #333333;
  12. padding: 5px 0;
  13. height: 55px;
  14. }
  15. #app {
  16. /* height: 98vh; */
  17. position: relative;
  18. }
  19. .content {
  20. width: 1000px;
  21. padding: 70px 20px 20px 20px;
  22. font-size: 22px;
  23. height: calc(100vh - 7.5vh);
  24. top: 0;
  25. bottom: 0;
  26. left: 0;
  27. right: 0;
  28. }
  29. table {
  30. width: 100%;
  31. text-align: center;
  32. border-collapse: collapse;
  33. border: 3px solid #333333;
  34. }
  35. .col-bgc {
  36. background: #f6f7fb;
  37. }
  38. .bottom-row1 {
  39. display: flex;
  40. /* justify-content: space-between; */
  41. margin-top: 5px 0;
  42. }
  43. .bottom-row2 {
  44. display: flex;
  45. }
  46. .config {
  47. margin-top: 10px;
  48. margin-right: 240px;
  49. }
  50. .autograph {
  51. margin-top: 10px;
  52. }
  53. .title {
  54. text-align: center;
  55. font-size: 36px;
  56. font-weight: 500;
  57. margin-bottom: 20px;
  58. }
  59. </style>
  60. </head>
  61. <body>
  62. <div id="app">
  63. <div class="content" v-for="(item,index) in tableData">
  64. <div v-if="item.inOutFlag == '2'" class="title">{{item.companyName}}</div>
  65. <div v-else class="title">{{item.contractManagementInfo?item.contractManagementInfo.seller:item.companyName}}
  66. </div>
  67. <div v-if="item.inOutFlag == '2'" class="title">入库检斤单</div>
  68. <div v-else class="title">出库检斤单</div>
  69. <table class="table">
  70. <tr class="row">
  71. <td class="col col-bgc">送货单位</td>
  72. <td class="col" colspan="4">
  73. {{item.contractManagementInfo?item.contractManagementInfo.seller:item.warehouseName}}</td>
  74. <td class="col col-bgc">车牌号</td>
  75. <td class="col" colspan="1">{{item.carNo}}</td>
  76. <td class="col col-bgc">货名</td>
  77. <td class="col" colspan="1">{{item.goodsName}}</td>
  78. </tr>
  79. <tr class="row">
  80. <td class="col col-bgc">收货单位</td>
  81. <td class="col" colspan="4">
  82. {{item.contractManagementInfo?item.contractManagementInfo.buyer:item.receiveWarehouse}}</td>
  83. <td class="col col-bgc">类型</td>
  84. <td class="col" colspan="1">{{item.type}}</td>
  85. <td class="col col-bgc">检斤时间</td>
  86. <td class="col" colspan="1">{{item.updateDate}}</td>
  87. </tr>
  88. <tr class="row">
  89. <td class="col col-bgc">毛重(吨)</td>
  90. <td class="col" colspan="2">{{item.grossWeight}}</td>
  91. <td class="col col-bgc">皮重(吨)</td>
  92. <td class="col" colspan="2">{{item.tare}}</td>
  93. <td class="col col-bgc">净重(吨)</td>
  94. <td class="col" colspan="2">{{item.netWeight}}</td>
  95. </tr>
  96. </table>
  97. <div class="bottom">
  98. <div class="bottom-row1">
  99. <div>检斤员:{{item.backOffice}}</div>
  100. </div>
  101. <div class="bottom-row2">
  102. <div class="config">收货单位签名或盖章:</div>
  103. <div class="autograph">客户签名:</div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </body>
  109. <script src="../cdn/vue/2.6.10/vue.min.js"></script>
  110. <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  111. <script type="text/javascript">
  112. new Vue({
  113. el: '#app',
  114. data: {
  115. tableData: {},
  116. name: "",
  117. },
  118. computed: {},
  119. methods: {
  120. tableRowClassName({
  121. row,
  122. rowIndex
  123. }) {
  124. if (rowIndex === 1) {
  125. return 'warning-row';
  126. } else if (rowIndex === 3) {
  127. return 'success-row';
  128. }
  129. return '';
  130. },
  131. getQueryVariable(variable) {
  132. var query = window.location.search.substring(1);
  133. var vars = query.split("&");
  134. for (var i = 0; i < vars.length; i++) {
  135. var pair = vars[i].split("=");
  136. if (pair[0] == variable) {
  137. return pair[1];
  138. }
  139. }
  140. return (false);
  141. },
  142. printSmall() {},
  143. printBig() {},
  144. },
  145. mounted() {
  146. this.tableData = JSON.parse(localStorage.getItem("warehouseBatchPrint"))
  147. console.log("打印数据", this.tableData)
  148. document.title = "粮食检斤单"
  149. window.print()
  150. window.onafterprint = function(event) {
  151. window.history.back(-1)
  152. };
  153. },
  154. watch: {}
  155. })
  156. </script>
  157. </html>