print.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <style>
  7. table,
  8. table tr th,
  9. table tr td {
  10. border: 2px solid #333333;
  11. padding: 5px 0;
  12. height: 43px;
  13. }
  14. #app {
  15. /* height: 98vh;
  16. position: relative; */
  17. }
  18. .content {
  19. width: 1000px;
  20. padding: 30px 20px 20px 20px;
  21. font-size: 18px;
  22. height: 660px;
  23. }
  24. .a5-content {
  25. height: 130vh;
  26. }
  27. table {
  28. width: 100%;
  29. text-align: center;
  30. border-collapse: collapse;
  31. border: 3px solid #333333;
  32. }
  33. .col-bgc {
  34. background: #f6f7fb;
  35. }
  36. .bottom-row1 {
  37. display: flex;
  38. /* justify-content: space-between; */
  39. margin-top: 5px 0;
  40. }
  41. .bottom-row2 {
  42. display: flex;
  43. }
  44. img,
  45. .left {
  46. width: 120px;
  47. height: 120px;
  48. position: absolute;
  49. right: 20px;
  50. top: 12px;
  51. }
  52. .config {
  53. margin-top: 10px;
  54. margin-right: 240px;
  55. }
  56. .autograph {
  57. margin-top: 10px;
  58. margin-right: 180px;
  59. }
  60. .bottom-row3 {
  61. margin: 10px 0;
  62. }
  63. .title {
  64. text-align: center;
  65. font-size: 36px;
  66. font-weight: 500;
  67. position: relative;
  68. }
  69. .number {
  70. text-align: right;
  71. margin-bottom: 10px;
  72. margin-top: 30px;
  73. }
  74. .small-row {
  75. display: flex;
  76. }
  77. .small-content {
  78. width: 300px;
  79. /* margin: 0 auto;
  80. border: 1px solid #ccc;
  81. padding: 20px 20px 160px 20px;
  82. position: absolute;
  83. top: 0;
  84. bottom: 0;
  85. left: 0;
  86. right: 0;
  87. margin: auto; */
  88. }
  89. .small-title {
  90. text-align: center;
  91. font-size: 18px;
  92. /* display: flex; */
  93. justify-content: space-between;
  94. align-items: center;
  95. }
  96. .numberNo {
  97. font-size: 36px;
  98. margin: auto;
  99. }
  100. .small-row {
  101. display: flex;
  102. justify-content: space-between;
  103. margin: 10px;
  104. }
  105. .small-img {
  106. margin-right: 0;
  107. }
  108. .sign {
  109. margin-right: 100px;
  110. }
  111. .small-code {
  112. position: relative;
  113. left: calc(50% - 55px)
  114. }
  115. </style>
  116. </head>
  117. <body>
  118. <div id="app">
  119. <div v-if="selectPrint">
  120. <div v-for="(item,index) in tableData1" :key="index">
  121. <div class="content" :class="pageType=='A5'?'a5-content':''">
  122. <div class="title">入库检斤单</div>
  123. <div class="left">
  124. <img :src="item.codeUrl" alt="">
  125. </div>
  126. <div class="number">{{item.number}}</div>
  127. <table class="table">
  128. <tr class="row">
  129. <td class="col col-bgc" v-if="item.serviceManagementType == 3">客户姓名</td>
  130. <td class="col" colspan="2" v-if="item.serviceManagementType == 3">{{item.customer}}
  131. </td>
  132. <td class="col col-bgc" v-if="item.serviceManagementType == 1">发货单位</td>
  133. <td class="col" colspan="2" v-if="item.serviceManagementType == 1">
  134. {{item.contractManagement ? item.contractManagement.seller : ""}}
  135. </td>
  136. <td class="col col-bgc" v-if="item.serviceManagementType == 3">客户电话</td>
  137. <td class="col" v-if="item.serviceManagementType == 3">{{item.customerPhone}}</td>
  138. <td class="col col-bgc" v-if="item.serviceManagementType == 1">联系电话</td>
  139. <td class="col" v-if="item.serviceManagementType == 1">
  140. {{item.contractManagement ? item.contractManagement.sellerPhone : ""}}
  141. </td>
  142. <td class="col col-bgc">车牌号</td>
  143. <td class="col" colspan="2">{{item.carNumber}}</td>
  144. </tr>
  145. <tr class="row">
  146. <td class="col col-bgc">收货单位</td>
  147. <td class="col" colspan="2">{{item.compName}}</td>
  148. <td class="col col-bgc">联系人</td>
  149. <td class="col">{{item.person}}</td>
  150. <td class="col col-bgc">联系电话</td>
  151. <td class="col" colspan="2">{{item.personPhone}}</td>
  152. </tr>
  153. <tr class="row">
  154. <td class="col col-bgc">货名</td>
  155. <td class="col">{{item.goodsName}}</td>
  156. <td class="col col-bgc">类型</td>
  157. <td class="col">{{item.type}}</td>
  158. <td class="col col-bgc">容量(克/升)</td>
  159. <td class="col">
  160. {{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
  161. </td>
  162. <td class="col col-bgc">不完善粒(%)</td>
  163. <td class="col">
  164. {{item.qualityInspectionManagement?item.qualityInspectionManagement.imperfectGrain:''}}
  165. </td>
  166. </tr>
  167. <tr class="row">
  168. <td class="col col-bgc">等级</td>
  169. <td class="col">
  170. {{item.qualityInspectionManagement?item.qualityInspectionManagement.grade:''}}
  171. </td>
  172. <td class="col col-bgc">水分(%)</td>
  173. <td class="col">
  174. {{item.qualityInspectionManagement?item.qualityInspectionManagement.waterContent:''}}
  175. </td>
  176. <td class="col col-bgc">热损伤(%)</td>
  177. <td class="col">
  178. {{item.qualityInspectionManagement?item.qualityInspectionManagement.jiaorenli:''}}
  179. </td>
  180. <td class="col col-bgc">质检时间</td>
  181. <td class="col">
  182. {{item.qualityInspectionManagement?item.qualityInspectionManagement.qualityDate:''}}
  183. </td>
  184. </tr>
  185. <tr class="row">
  186. <td class="col col-bgc">杂质(%)</td>
  187. <td class="col">
  188. {{item.qualityInspectionManagement?item.qualityInspectionManagement.impurity:''}}
  189. </td>
  190. <td class="col col-bgc">霉变粒(%)</td>
  191. <td class="col">
  192. {{item.qualityInspectionManagement?item.qualityInspectionManagement.mildewGrain:''}}
  193. </td>
  194. <td class="col col-bgc">扣杂</td>
  195. <td class="col">
  196. {{item.qualityInspectionManagement?item.qualityInspectionManagement.buckleMiscellaneous:''}}
  197. </td>
  198. <td class="col " colspan="2"></td>
  199. </tr>
  200. <tr class="row">
  201. <td class="col col-bgc">毛重(公斤)</td>
  202. <td class="col">{{item.grossWeight}}</td>
  203. <td class="col col-bgc">皮重(公斤)</td>
  204. <td class="col">{{item.tare}}</td>
  205. <td class="col col-bgc">扣重(公斤)</td>
  206. <td class="col">{{item.buckleMiscellaneous}}</td>
  207. <td class="col col-bgc">净重(公斤)</td>
  208. <td class="col">{{item.netWeight}}</td>
  209. </tr>
  210. <tr class="row">
  211. <td class="col col-bgc" colspan="2">毛重检斤时间</td>
  212. <td class="col" colspan="2">{{item.grossDate}}</td>
  213. <td class="col col-bgc" colspan="2"> 皮重检斤时间</td>
  214. <td class="col" colspan="2">{{item.tareDate}}</td>
  215. </tr>
  216. </table>
  217. <div class="bottom">
  218. <div class="bottom-row1">
  219. <div>毛检:{{item.secretaryWeigher}}</div>
  220. <div style="margin-left:60px">皮检:{{item.skinInspector}}</div>
  221. </div>
  222. <div class="bottom-row2">
  223. <div class="config">收货单位签名或盖章:</div>
  224. <div class="autograph">客户签名:</div>
  225. <div class="autograph">司机签名:</div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. <div v-else>
  232. <div class="title">快递业务单</div>
  233. <div class="number">{{tableData.number}}</div>
  234. <table class="table">
  235. <tr class="row">
  236. <td class="col col-bgc">业务编号</td>
  237. <td class="col">20200501</td>
  238. <td class="col col-bgc">日期</td>
  239. <td class="col">2020-05-21</td>
  240. <td class="col col-bgc">快递公司</td>
  241. <td class="col">中国邮政EMS</td>
  242. </tr>
  243. <tr class="row">
  244. <td class="col col-bgc">发件人</td>
  245. <td class="col">小李</td>
  246. <td class="col col-bgc">收件人</td>
  247. <td class="col">小王</td>
  248. <td class="col col-bgc">客户编号</td>
  249. <td class="col">KH123</td>
  250. </tr>
  251. <tr class="row">
  252. <td class="col col-bgc">发件人电话</td>
  253. <td class="col">13333333333</td>
  254. <td class="col col-bgc">收件人电话</td>
  255. <td class="col">14444444444</td>
  256. <td class="col col-bgc">重量(KG)</td>
  257. <td class="col">100</td>
  258. </tr>
  259. <tr class="row">
  260. <td class="col col-bgc">货品</td>
  261. <td class="col">大米</td>
  262. <td class="col col-bgc">收件人地址</td>
  263. <td class="col">北京王府井</td>
  264. <td class="col col-bgc">体积(立方)</td>
  265. <td class="col">111</td>
  266. </tr>
  267. <tr class="row">
  268. <td class="col col-bgc">金额</td>
  269. <td class="col">1000</td>
  270. <td class="col col-bgc"></td>
  271. <td class="col"></td>
  272. <td class="col col-bgc"></td>
  273. <td class="col"></td>
  274. </tr>
  275. </div>
  276. </div>
  277. </body>
  278. <script src="cdn/vue/2.6.10/vue.min.js"></script>
  279. <script type="text/javascript">
  280. new Vue({
  281. el: '#app',
  282. data: {
  283. tableData: {},
  284. tableData1: [],
  285. selectPrint: false,
  286. name: "",
  287. bigContent: false,
  288. smallContent: false,
  289. pageType: ''
  290. },
  291. computed: {},
  292. methods: {
  293. tableRowClassName({
  294. row,
  295. rowIndex
  296. }) {
  297. if (rowIndex === 1) {
  298. return 'warning-row';
  299. } else if (rowIndex === 3) {
  300. return 'success-row';
  301. }
  302. return '';
  303. },
  304. getQueryVariable(variable) {
  305. var query = window.location.search.substring(1);
  306. var vars = query.split("&");
  307. for (var i = 0; i < vars.length; i++) {
  308. var pair = vars[i].split("=");
  309. if (pair[0] == variable) {
  310. return pair[1];
  311. }
  312. }
  313. return (false);
  314. },
  315. printSmall() {},
  316. printBig() {},
  317. },
  318. mounted() {
  319. // let _data = localStorage.getItem('inspect')
  320. // let _type = decodeURIComponent(this.getQueryVariable("type"))
  321. // this.pageType = decodeURIComponent(this.getQueryVariable("radioType"))
  322. // if (_type == 2) {
  323. // this.bigContent = true
  324. // this.smallContent = false
  325. // } else {
  326. // this.smallContent = true
  327. // this.bigContent = false
  328. // }
  329. // if (_data == 'false') {
  330. // this.selectPrint = true;
  331. // this.tableData1 = JSON.parse(localStorage.getItem('selectPrint_jjSelectPrintList'))
  332. // } else {
  333. // this.tableData = JSON.parse(_data)
  334. // console.log(this.tableData)
  335. // }
  336. // // sessionStorage.setItem('record_print', JSON.stringify(response))
  337. // // this.tableData = JSON.parse(sessionStorage.getItem("record_print"))
  338. // document.title = "粮食检斤单"
  339. // window.print()
  340. // window.onafterprint = function(event) {
  341. // window.history.back(-1)
  342. // };
  343. },
  344. watch: {}
  345. })
  346. </script>
  347. </html>