| | |
| | | } */ |
| | | |
| | | .print { |
| | | position: absolute; |
| | | position: relative; |
| | | left: 47%; |
| | | top: 58%; |
| | | margin-top: 30px; |
| | | width: 7%; |
| | | height: 30px; |
| | | border: 0px; |
| | |
| | | |
| | | <body> |
| | | <div> |
| | | <div class="print-header"> |
| | | <button onclick="preview(1)" class="print">打印</button> |
| | | </div> |
| | | |
| | | <!--startprint--> |
| | | <div id="table"> |
| | | <!-- <span class="title">准考证信息</span> |
| | |
| | | <td></td> |
| | | </tr> |
| | | |
| | | </table> |
| | | </div> --> |
| | | <!--endprint--> |
| | | |
| | | </table>--> |
| | | </div> |
| | | <script> |
| | | var getData = function(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | if (r != null) return unescape(r[2]); |
| | | return null; |
| | | }; |
| | | var id = JSON.parse(getData("data")).id; |
| | | var examType = JSON.parse(getData("data")).examType; |
| | | // console.log(JSON.parse(getData("data")), 111); |
| | | <!--endprint--> |
| | | |
| | | axios.get('http://223.82.109.183:2080/api/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) { |
| | | // axios.get('http://localhost:81/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) { |
| | | var data = res.data.data; |
| | | var str = `<span class="title">${data.examName}</span> |
| | | |
| | | <div class="print-header"> |
| | | <button onclick="preview(1)" class="print">打印</button> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | var getData = function(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | if (r != null) return unescape(r[2]); |
| | | return null; |
| | | }; |
| | | var id = JSON.parse(getData("data")).id; |
| | | var examType = JSON.parse(getData("data")).examType; |
| | | // console.log(JSON.parse(getData("data")), 111); |
| | | |
| | | axios.get('http://223.82.109.183:2080/api/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) { |
| | | // axios.get('http://localhost:81/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) { |
| | | var data = res.data.data; |
| | | var str = `<span class="title">${data.examName}</span> |
| | | <span class="title">准考证信息</span> |
| | | <table class="user-info-table" border="1px" align="center" cellspacing="0" cellpadding="10"> |
| | | <tr class="user-info-tr"> |
| | |
| | | <td></td> |
| | | </tr> |
| | | |
| | | </table> |
| | | </div>` |
| | | </table>` |
| | | |
| | | var dom = $('#table'); |
| | | dom.empty(); |
| | | dom.append(str); |
| | | }) |
| | | var dom = $('#table'); |
| | | dom.empty(); |
| | | dom.append(str); |
| | | }) |
| | | |
| | | function preview(oper) { |
| | | if (oper < 10) { |
| | | bdhtml = window.document.body.innerHTML; |
| | | // 打印开始的标志 |
| | | sprnstr = "<!--startprint-->"; |
| | | // 打印结束的标志 |
| | | eprnstr = "<!--endprint-->"; |
| | | // 从打印开始的位置截取到末尾 |
| | | prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr)); |
| | | // 从开始截取到打印结束的位置 |
| | | prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); |
| | | // 替换html |
| | | window.document.body.innerHTML = prnhtml; |
| | | // 打印 |
| | | window.print(); |
| | | window.document.body.innerHTML = bdhtml; |
| | | } else { |
| | | window.print(); |
| | | } |
| | | function preview(oper) { |
| | | if (oper < 10) { |
| | | bdhtml = window.document.body.innerHTML; |
| | | // 打印开始的标志 |
| | | sprnstr = "<!--startprint-->"; |
| | | // 打印结束的标志 |
| | | eprnstr = "<!--endprint-->"; |
| | | // 从打印开始的位置截取到末尾 |
| | | prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr)); |
| | | // 从开始截取到打印结束的位置 |
| | | prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); |
| | | // 替换html |
| | | window.document.body.innerHTML = prnhtml; |
| | | // 打印 |
| | | window.print(); |
| | | window.document.body.innerHTML = bdhtml; |
| | | } else { |
| | | window.print(); |
| | | } |
| | | </script> |
| | | } |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |