warehouseBatchPrint.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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 tr th,
  9. table tr td {
  10. border: 2px solid #333333;
  11. padding: 5px;
  12. height: 37px;
  13. box-sizing: border-box;
  14. }
  15. #app {
  16. /* height: 98vh; */
  17. position: relative;
  18. }
  19. .content {
  20. width: 1000px;
  21. padding: 70px 20px 20px 20px;
  22. font-size: 18px;
  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: 10px;
  42. }
  43. .bottom-row2 {
  44. display: flex;
  45. }
  46. .number {
  47. text-align: right;
  48. margin-bottom: 10px;
  49. margin-top: 20px;
  50. }
  51. .config {
  52. margin-top: 10px;
  53. margin-right: 240px;
  54. }
  55. .autograph {
  56. margin-top: 10px;
  57. }
  58. .title {
  59. text-align: center;
  60. font-size: 36px;
  61. font-weight: 500;
  62. margin-bottom: 20px;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <div id="app">
  68. <div class="content" v-for="(item,index) in tableData" v-if="!isDDPrint||isEWPrint">
  69. <!-- <div v-if="item.inOutFlag == '2'" class="title">{{item.companyName}}</div>
  70. <div v-else class="title">{{item.contractManagementInfo?item.contractManagementInfo.seller:item.companyName}}
  71. </div> -->
  72. <div></div>
  73. <div v-if="item.inOutFlag == '2'" class="title">入库检斤单</div>
  74. <div v-else class="title">出库检斤单</div>
  75. <div class="number">{{item.contractManagementInfo?item.contractManagementInfo.contractNo:''}}</div>
  76. <table class="table">
  77. <tr class="row">
  78. <td class="col col-bgc">出货单位</td>
  79. <td class="col" colspan="">
  80. {{item.contractManagementInfo?item.contractManagementInfo.seller:item.warehouseName}}
  81. <!-- {{item.companyName}} -->
  82. </td>
  83. <td class="col col-bgc">车牌号</td>
  84. <td class="col" colspan="">{{item.carNo}}</td>
  85. <td class="col col-bgc">货名</td>
  86. <td class="col" colspan="3">{{item.goodsName}}</td>
  87. </tr>
  88. <tr class="row">
  89. <td class="col col-bgc">收货单位</td>
  90. <td class="col" colspan="">
  91. <!-- {{item.contractManagementInfo?item.contractManagementInfo.buyer:item.receiveWarehouse}} -->
  92. {{item.companyName}}
  93. </td>
  94. <td class="col col-bgc">类型</td>
  95. <td class="col" colspan="">{{item.type}}</td>
  96. <td class="col col-bgc">等级</td>
  97. <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}</td>
  98. </tr>
  99. <tr class="row">
  100. <td class="col col-bgc">检斤时间</td>
  101. <td class="col" colspan="">{{item.updateDate}}</td>
  102. <td class="col col-bgc">水分(%)</td>
  103. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.waterContent:''}}
  104. </td>
  105. <td class="col col-bgc">热损伤(%)</td>
  106. <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}</td>
  107. </tr>
  108. <tr class="row">
  109. <td class="col col-bgc">杂质(%)</td>
  110. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.impurity:''}}</td>
  111. <td class="col col-bgc">霉变粒(%)</td>
  112. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.mildewGrain:''}}
  113. </td>
  114. <td class="col col-bgc">容量</td>
  115. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
  116. </td>
  117. <td class="col col-bgc">不完善粒(%)</td>
  118. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.imperfectGrain:''}}
  119. </td>
  120. </tr>
  121. <tr class="row">
  122. <td class="col col-bgc" colspan="">毛重(吨)</td>
  123. <td class="col" colspan="">{{item.grossWeight}}</td>
  124. <td class="col col-bgc" colspan="">皮重(吨)</td>
  125. <td class="col" colspan="">{{item.tare}}</td>
  126. <td class="col col-bgc" colspan="">扣重(吨)</td>
  127. <td class="col" colspan="">{{item.deductionWeight ? item.deductionWeight : '0'}}</td>
  128. <td class="col col-bgc" colspan="">净重(吨)</td>
  129. <td class="col" colspan="">{{item.netWeight}}</td>
  130. </tr>
  131. </table>
  132. <div class="bottom">
  133. <div class="bottom-row1">
  134. <div>检斤员:{{item.backOffice}}</div>
  135. </div>
  136. <div class="bottom-row2">
  137. <div class="config">收货单位签名或盖章:</div>
  138. <div class="config">客户签名:</div>
  139. <div class="autograph">司机签名:</div>
  140. </div>
  141. </div>
  142. </div>
  143. <!-- 打印额外 -->
  144. <div class="content" v-for="(item,index) in tableDataEW" v-if="isDDPrint||isEWPrint">
  145. <!-- <div v-if="item.inOutFlag == '2'" class="title">{{item.companyName}}</div>
  146. <div v-else class="title">{{item.contractManagementInfo?item.contractManagementInfo.seller:item.companyName}}
  147. </div> -->
  148. <div></div>
  149. <div v-if="item.inOutFlag == '2'" class="title">入库检斤单</div>
  150. <div v-else class="title">出库检斤单</div>
  151. <div class="number">{{item.contractManagementInfo?item.contractManagementInfo.contractNo:''}}</div>
  152. <table class="table">
  153. <tr class="row">
  154. <td class="col col-bgc">出货单位</td>
  155. <td class="col" colspan="">
  156. <!-- {{item.contractManagementInfo?item.contractManagementInfo.seller:item.warehouseName}} -->
  157. {{item.customer}}
  158. </td>
  159. <td class="col col-bgc">车牌号</td>
  160. <td class="col" colspan="">{{item.carNo}}</td>
  161. <td class="col col-bgc">货名</td>
  162. <td class="col" colspan="3">{{item.goodsName}}</td>
  163. </tr>
  164. <tr class="row">
  165. <td class="col col-bgc">收货单位</td>
  166. <td class="col" colspan="">
  167. <!-- {{item.contractManagementInfo?item.contractManagementInfo.buyer:item.receiveWarehouse}} -->
  168. {{item.companyName}}
  169. </td>
  170. <td class="col col-bgc">类型</td>
  171. <td class="col" colspan="">{{item.type}}</td>
  172. <td class="col col-bgc">等级</td>
  173. <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}</td>
  174. </tr>
  175. <tr class="row">
  176. <td class="col col-bgc">检斤时间</td>
  177. <td class="col" colspan="">{{item.updateDate}}</td>
  178. <td class="col col-bgc">水分(%)</td>
  179. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.waterContent:''}}
  180. </td>
  181. <td class="col col-bgc">热损伤(%)</td>
  182. <td class="col" colspan="3">{{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}</td>
  183. </tr>
  184. <tr class="row">
  185. <td class="col col-bgc">杂质(%)</td>
  186. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.impurity:''}}</td>
  187. <td class="col col-bgc">霉变粒(%)</td>
  188. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.mildewGrain:''}}
  189. </td>
  190. <td class="col col-bgc">容量</td>
  191. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
  192. </td>
  193. <td class="col col-bgc">不完善粒(%)</td>
  194. <td class="col">{{item.qualityInspectionManagement?item.qualityInspectionManagement.imperfectGrain:''}}
  195. </td>
  196. </tr>
  197. <tr class="row">
  198. <td class="col col-bgc" colspan="">毛重(吨)</td>
  199. <td class="col" colspan="">{{item.grossWeight}}</td>
  200. <td class="col col-bgc" colspan="">皮重(吨)</td>
  201. <td class="col" colspan="">{{item.tare}}</td>
  202. <td class="col col-bgc" colspan="">扣重(吨)</td>
  203. <td class="col" colspan="">{{item.deductionWeight ? item.deductionWeight : '0'}}</td>
  204. <td class="col col-bgc" colspan="">净重(吨)</td>
  205. <td class="col" colspan="">{{item.netWeight}}</td>
  206. </tr>
  207. </table>
  208. <div class="bottom">
  209. <div class="bottom-row1">
  210. <div>检斤员:{{item.backOffice}}</div>
  211. </div>
  212. <div class="bottom-row2">
  213. <div class="config">收货单位签名或盖章:</div>
  214. <div class="config">客户签名:</div>
  215. <div class="autograph">司机签名:</div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </body>
  221. <script src="../cdn/vue/2.6.10/vue.min.js"></script>
  222. <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  223. <script type="text/javascript">
  224. new Vue({
  225. el: '#app',
  226. data: {
  227. tableData: {},
  228. tableDataEW: [],
  229. name: "",
  230. isDDPrint :false,
  231. isEWPrint:false,
  232. },
  233. computed: {},
  234. methods: {
  235. tableRowClassName({
  236. row,
  237. rowIndex
  238. }) {
  239. if (rowIndex === 1) {
  240. return 'warning-row';
  241. } else if (rowIndex === 3) {
  242. return 'success-row';
  243. }
  244. return '';
  245. },
  246. getQueryVariable(variable) {
  247. var query = window.location.search.substring(1);
  248. var vars = query.split("&");
  249. for (var i = 0; i < vars.length; i++) {
  250. var pair = vars[i].split("=");
  251. if (pair[0] == variable) {
  252. return pair[1];
  253. }
  254. }
  255. return (false);
  256. },
  257. printSmall() {},
  258. printBig() {},
  259. },
  260. mounted() {debugger
  261. let _ew = decodeURIComponent(this.getQueryVariable("selectEW"))
  262. let _ewdd = decodeURIComponent(this.getQueryVariable("selectEWDD"))
  263. if(_ew== 'true'){
  264. this.tableDataEW = JSON.parse(localStorage.getItem('ewWarehouseBatchPrint'))
  265. this.isEWPrint = true
  266. }
  267. if(_ewdd== 'true'){
  268. this.tableDataEW = JSON.parse(localStorage.getItem('ewWarehouseBatchPrint'))
  269. this.isDDPrint = true
  270. }
  271. this.tableData = JSON.parse(localStorage.getItem("warehouseBatchPrint"))
  272. console.log("打印数据", this.tableData)
  273. document.title = "粮食检斤单"
  274. // window.print()
  275. // window.onafterprint = function(event) {
  276. // window.history.back(-1)
  277. // };
  278. },
  279. watch: {}
  280. })
  281. </script>
  282. </html>