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