warehouseBatchPrint.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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}}</div>
  66. <div v-if="item.inOutFlag == '2'" class="title">入库检斤单</div>
  67. <div v-else class="title">出库检斤单</div>
  68. <table class="table">
  69. <tr class="row">
  70. <td class="col col-bgc">送货单位</td>
  71. <td class="col" colspan="4">{{item.contractManagementInfo?item.contractManagementInfo.seller:item.warehouseName}}</td>
  72. <td class="col col-bgc">车牌号</td>
  73. <td class="col" colspan="1">{{item.carNo}}</td>
  74. <td class="col col-bgc">货名</td>
  75. <td class="col" colspan="1">{{item.goodsName}}</td>
  76. </tr>
  77. <tr class="row">
  78. <td class="col col-bgc">收货单位</td>
  79. <td class="col" colspan="4">{{item.contractManagementInfo?item.contractManagementInfo.buyer:item.receiveWarehouse}}</td>
  80. <td class="col col-bgc">类型</td>
  81. <td class="col"colspan="1">{{item.type}}</td>
  82. <td class="col col-bgc">检斤时间</td>
  83. <td class="col" colspan="1">{{item.updateDate}}</td>
  84. </tr>
  85. <tr class="row">
  86. <td class="col col-bgc">毛重(吨)</td>
  87. <td class="col" colspan="2">{{item.grossWeight}}</td>
  88. <td class="col col-bgc">皮重(吨)</td>
  89. <td class="col" colspan="2">{{item.tare}}</td>
  90. <td class="col col-bgc">净重(吨)</td>
  91. <td class="col" colspan="2">{{item.netWeight}}</td>
  92. </tr>
  93. </table>
  94. <div class="bottom">
  95. <div class="bottom-row1">
  96. <div>检斤员:{{item.backOffice}}</div>
  97. </div>
  98. <div class="bottom-row2">
  99. <div class="config">收货单位签名或盖章:</div>
  100. <div class="autograph">客户签名:</div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </body>
  106. <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
  107. <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  108. <script type="text/javascript">
  109. new Vue({
  110. el: '#app',
  111. data: {
  112. tableData: {
  113. },
  114. name: "",
  115. },
  116. computed: {},
  117. methods: {
  118. tableRowClassName({
  119. row,
  120. rowIndex
  121. }) {
  122. if (rowIndex === 1) {
  123. return 'warning-row';
  124. } else if (rowIndex === 3) {
  125. return 'success-row';
  126. }
  127. return '';
  128. },
  129. getQueryVariable(variable) {
  130. var query = window.location.search.substring(1);
  131. var vars = query.split("&");
  132. for (var i = 0; i < vars.length; i++) {
  133. var pair = vars[i].split("=");
  134. if (pair[0] == variable) {
  135. return pair[1];
  136. }
  137. }
  138. return (false);
  139. },
  140. printSmall() {},
  141. printBig() {},
  142. },
  143. mounted() {
  144. this.tableData = JSON.parse(localStorage.getItem("warehouseBatchPrint"))
  145. console.log("打印数据", this.tableData)
  146. document.title = "粮食检斤单"
  147. window.print()
  148. window.onafterprint = function(event) {
  149. window.history.back(-1)
  150. };
  151. },
  152. watch: {}
  153. })
  154. </script>
  155. </html>