inspection.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" href="../cdn/element-ui/2.13.2/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. }
  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. position: absolute;
  23. top: 0;
  24. bottom: 0;
  25. left: 0;
  26. right: 0;
  27. }
  28. table {
  29. width: 100%;
  30. text-align: center;
  31. border-collapse: collapse;
  32. border: 3px solid #333333;
  33. }
  34. .col-bgc {
  35. background: #f6f7fb;
  36. }
  37. .bottom-row1 {
  38. display: flex;
  39. justify-content: space-between;
  40. margin: 20px 0;
  41. }
  42. .bottom-row2 {
  43. display: flex;
  44. margin: 10px 0;
  45. }
  46. img,
  47. .left {
  48. width: 110px;
  49. height: 110px;
  50. /* margin-right: 118px; */
  51. position: absolute;
  52. right: 20px;
  53. top: 12px;
  54. }
  55. .config {
  56. margin-right: 240px;
  57. }
  58. .bottom-row3 {
  59. margin: 10px 0;
  60. }
  61. .title {
  62. text-align: center;
  63. font-size: 36px;
  64. font-weight: 500;
  65. }
  66. .number {
  67. text-align: right;
  68. /* margin-bottom: 10px; */
  69. margin: 10px 0;
  70. }
  71. .small-row {
  72. display: flex;
  73. }
  74. .small-content {
  75. width: 300px;
  76. /* margin: 0 auto;
  77. border: 1px solid #ccc;
  78. padding: 20px 20px 160px 20px;
  79. position: absolute;
  80. top: 0;
  81. bottom: 0;
  82. left: 0;
  83. right: 0;
  84. margin: auto;
  85. height: 650px; */
  86. }
  87. .small-title {
  88. text-align: center;
  89. font-size: 18px;
  90. display: flex;
  91. flex-direction: column;
  92. justify-content: space-between;
  93. align-items: center;
  94. }
  95. .numberNo {
  96. font-size: 36px;
  97. }
  98. .small-row {
  99. display: flex;
  100. justify-content: space-between;
  101. margin: 10px;
  102. }
  103. .small-img {
  104. margin-right: 0;
  105. }
  106. .sign {
  107. margin-right: 100px;
  108. }
  109. .small-code {
  110. position: relative;
  111. left: calc(50% - 55px)
  112. }
  113. </style>
  114. </head>
  115. <body>
  116. <div id="app">
  117. <div class="content" v-if="bigContent">
  118. <div>
  119. <div class="title">{{tableData.compName}}</div>
  120. <div class="title">粮食质检单</div>
  121. <div class="left">
  122. <img :src="tableData.codeUrl " alt="">
  123. </div>
  124. </div>
  125. <div class="number">{{tableData.qualityNo}}</div>
  126. <table class="table">
  127. <tr class="row">
  128. <td class="col col-bgc">客户姓名</td>
  129. <td class="col" colspan="2">{{tableData.customerName}}</td>
  130. <td class="col col-bgc">客户电话</td>
  131. <td class="col" colspan="2">{{tableData.customerPhone}}</td>
  132. <td class="col col-bgc">车牌号</td>
  133. <td class="col">{{tableData.carNumber}}</td>
  134. </tr>
  135. <tr class="row">
  136. <td class="col col-bgc">收货单位</td>
  137. <td class="col" colspan="2">{{tableData.compName}}</td>
  138. <td class="col col-bgc">联系人</td>
  139. <td class="col" colspan="2">{{tableData.person}}</td>
  140. <td class="col col-bgc">联系电话</td>
  141. <td class="col">{{tableData.personPhone}}</td>
  142. </tr>
  143. <tr class="row">
  144. <td class="col col-bgc">货名</td>
  145. <td class="col">{{tableData.goodsName}}</td>
  146. <td class="col col-bgc">类型</td>
  147. <td class="col">{{tableData.type}}</td>
  148. <td class="col col-bgc">容量(克/升)</td>
  149. <td class="col">{{tableData.bulkDensity}}</td>
  150. <td class="col col-bgc">不完善粒(%)</td>
  151. <td class="col">{{tableData.imperfectGrain}}</td>
  152. </tr>
  153. <tr class="row">
  154. <td class="col col-bgc">等级</td>
  155. <td class="col">{{tableData.grade}}</td>
  156. <td class="col col-bgc">水分(%)</td>
  157. <td class="col">{{tableData.waterContent}}</td>
  158. <td class="col col-bgc">热损伤(%)</td>
  159. <td class="col">{{tableData.jiaorenli}}</td>
  160. <td v-if="tableData.confirm == '1'" class="col col-bgc">单价(元/公斤)</td>
  161. <td v-else class="col col-bgc">待定单价(元/公斤)</td>
  162. <td class="col " v-if="tableData.type == '潮粮'">
  163. {{tableData.tidalGrainPrice}}
  164. </td>
  165. <td class="col " v-if="tableData.type == '干粮'">
  166. {{tableData.dryGrainPrice}}
  167. </td>
  168. </tr>
  169. <tr class="row">
  170. <td class="col col-bgc">杂质(%)</td>
  171. <td class="col">{{tableData.impurity}}</td>
  172. <td class="col col-bgc">霉变粒(%)</td>
  173. <td class="col">{{tableData.mildewGrain}}</td>
  174. <td v-if="tableData.paramType == '1'" class="col col-bgc">扣杂</td>
  175. <td v-if="tableData.paramType == '1'" class="col">{{tableData.buckleMiscellaneous}}</td>
  176. <td v-if="tableData.paramType == '1'" class="col col-bgc" colspan="1">购粮性质</td>
  177. <td v-else class="col col-bgc" colspan="2">购粮性质</td>
  178. <td v-if="tableData.paramType == '1'" class="col" colspan="1">{{ tableData.natureOfGrainPurchase }}</td>
  179. <td v-else class="col" colspan="2">{{ tableData.natureOfGrainPurchase }}</td>
  180. </tr>
  181. <tr class="row">
  182. <td class="col col-bgc">仓位号</td>
  183. <td class="col">{{ tableData.binNumber }}</td>
  184. <td class="col col-bgc">囤位号</td>
  185. <td class="col">{{ tableData.storageTagNo }}</td>
  186. <td class="col col-bgc" colspan="2">质检员</td>
  187. <td class="col" colspan="2">{{ tableData.qualityInspector }}</td>
  188. </tr>
  189. </table>
  190. <div class="bottom">
  191. <div class="bottom-row1">
  192. <div></div>
  193. <div>{{tableData.qualityDate}}</div>
  194. </div>
  195. <div class="bottom-row2">
  196. <!-- <div class="left">
  197. <img :src="tableData.codeUrl " alt="">
  198. </div> -->
  199. <div class="config">收货单位签名或盖章</div>
  200. <div class="">客户签名</div>
  201. </div>
  202. <!-- <div class="bottom-row3">扫一扫</div> -->
  203. </div>
  204. </div>
  205. <div class="small-content" v-if="smallContent">
  206. <div class="small-title">
  207. <div class="numberNo">{{tableData.qualityNo.substring(tableData.qualityNo.length - 3)}}</div>
  208. <div>粮食质检单</div>
  209. </div>
  210. <img :src="tableData.codeUrl " alt="" class="small-code">
  211. <div class="small-row">
  212. <div>编号:</div>
  213. <div>{{tableData.qualityNo}}</div>
  214. </div>
  215. <div class="small-row">
  216. <div>客户姓名:</div>
  217. <div>{{tableData.customerName}}</div>
  218. </div>
  219. <div class="small-row">
  220. <div>客户身份证:</div>
  221. <div>{{tableData.customerNumberCard}}</div>
  222. </div>
  223. <div class="small-row">
  224. <div>客户电话:</div>
  225. <div>{{tableData.customerPhone}}</div>
  226. </div>
  227. <div class="small-row">
  228. <div>车牌号:</div>
  229. <div>{{tableData.carNumber}}</div>
  230. </div>
  231. <div class="small-row">
  232. <div>仓位号:</div>
  233. <div>{{tableData.binNumber}}</div>
  234. </div>
  235. <div class="small-row">
  236. <div>收货单位:</div>
  237. <div>{{tableData.compName}}</div>
  238. </div>
  239. <div class="small-row">
  240. <div>联系人:</div>
  241. <div>{{tableData.person}}</div>
  242. </div>
  243. <div class="small-row">
  244. <div>联系电话:</div>
  245. <div>{{tableData.personPhone}}</div>
  246. </div>
  247. <div class="small-row">
  248. <div>货名:</div>
  249. <div>{{tableData.goodsName}}</div>
  250. </div>
  251. <div class="small-row">
  252. <div>类型:</div>
  253. <div>{{tableData.type}}</div>
  254. </div>
  255. <div class="small-row">
  256. <div>容量(克/升):</div>
  257. <div>{{tableData.bulkDensity}}</div>
  258. </div>
  259. <div class="small-row">
  260. <div>不完善粒(%):</div>
  261. <div>{{tableData.imperfectGrain}}</div>
  262. </div>
  263. <div class="small-row">
  264. <div>等级:</div>
  265. <div>{{tableData.grade}}</div>
  266. </div>
  267. <div class="small-row">
  268. <div>水分(%):</div>
  269. <div>{{tableData.waterContent}}</div>
  270. </div>
  271. <div class="small-row">
  272. <div>热损伤(%):</div>
  273. <div>{{tableData.jiaorenli}}</div>
  274. </div>
  275. <div class="small-row">
  276. <div v-if="tableData.confirm == '1'">单价(元/公斤):</div>
  277. <div v-else>待定单价(元/公斤):</div>
  278. <div v-if="tableData.type == '潮粮'">
  279. {{tableData.tidalGrainPrice}}
  280. </div>
  281. <div v-if="tableData.type == '干粮'">
  282. {{tableData.dryGrainPrice}}
  283. </div>
  284. <!-- <div>{{tableData.tidalGrainPrice}}</div> -->
  285. </div>
  286. <div class="small-row">
  287. <div>杂质(%):</div>
  288. <div>{{tableData.impurity}}</div>
  289. </div>
  290. <div class="small-row">
  291. <div>霉变粒(%):</div>
  292. <div>{{tableData.mildewGrain}}</div>
  293. </div>
  294. <div v-if="tableData.paramType == '1'" class="small-row">
  295. <div>扣杂:</div>
  296. <div>{{tableData.buckleMiscellaneous}}</div>
  297. </div>
  298. <div class="small-row">
  299. <div>购粮性质:</div>
  300. <div>{{tableData.natureOfGrainPurchase}}</div>
  301. </div>
  302. <div class="small-row">
  303. <div>质检:</div>
  304. <div>{{tableData.qualityInspector}}</div>
  305. </div>
  306. <div class="small-row">
  307. <div>时间:</div>
  308. <div>{{tableData.qualityDate}}</div>
  309. </div>
  310. <div class="small-row">
  311. <div>收货单位签名或盖章:</div>
  312. </div>
  313. </div>
  314. </div>
  315. </body>
  316. <script src="../cdn/vue/2.6.10/vue.min.js"></script>
  317. <script src="../cdn/element-ui/2.13.2/index.js"></script>
  318. <script type="text/javascript">
  319. new Vue({
  320. el: '#app',
  321. data: {
  322. tableData: "",
  323. name: "",
  324. bigContent: false,
  325. smallContent: false,
  326. printData: {},
  327. },
  328. computed: {},
  329. methods: {
  330. tableRowClassName({
  331. row,
  332. rowIndex
  333. }) {
  334. if (rowIndex === 1) {
  335. return 'warning-row';
  336. } else if (rowIndex === 3) {
  337. return 'success-row';
  338. }
  339. return '';
  340. },
  341. getQueryVariable(variable) {
  342. var query = window.location.search.substring(1);
  343. var vars = query.split("&");
  344. for (var i = 0; i < vars.length; i++) {
  345. var pair = vars[i].split("=");
  346. if (pair[0] == variable) {
  347. return pair[1];
  348. }
  349. }
  350. return (false);
  351. },
  352. printSmall() {},
  353. printBig() {},
  354. },
  355. mounted() {
  356. let _data = decodeURIComponent(this.getQueryVariable("dataList"))
  357. let _type = decodeURIComponent(this.getQueryVariable("type"))
  358. if (_type == 2) {
  359. this.bigContent = true
  360. this.smallContent = false
  361. } else {
  362. this.smallContent = true
  363. this.bigContent = false
  364. }
  365. console.log(_data)
  366. this.tableData = JSON.parse(_data)
  367. console.log(this.tableData)
  368. document.title = "粮食质检单"
  369. window.print()
  370. window.onafterprint = function(event) {
  371. window.history.back(-1)
  372. };
  373. },
  374. watch: {}
  375. })
  376. </script>
  377. </html>