123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>打印报表</title>
- <style type="text/css">
- /* @page {
- size: A4 portrait;
- margin: 1.9cm 2.5cm 1.5cm 2.5cm;
- } */
- .print-btn {
- color: white;
- background: #2D8CF0;
- border: none;
- border-radius: 3px;
- padding: 5px 10px;
- font-size: 10px;
- margin: 10px 20px;
- cursor: pointer;
- }
- .content-box {
- text-align: center;
- height: 500px;
- /* width: 794px; */
- margin: 0 auto;
- font-family: 黑体;
- }
- h1{
- font-weight: bold;
- font-size: 32px;
- }
- table {
- border-collapse: collapse;
- border-spacing: 0;
- border-left: 1px solid #888;
- border-top: 1px solid #888;
- font-size: 18px;
- }
-
- table td{ padding: 10px; border: 1px solid #000;}
-
- .title-top {
- margin-top: 248px;
- }
- </style>
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
- <script src="../../static/print/print2.js" type="text/javascript"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- </head>
- <body>
- <div>
- <div class="box">
- <button class="print-btn" @click="printFn">打印3</button>
- <div id="myPrintArea">
- <div class="content-box" style="position: relative;">
- <div class="header-title" style="text-align: center;">
- <h1 style="font-size: 30px;">东兴口岸(二桥)跨境物流中心B区</h1>
- <h1 style="font-size: 30px;margin-top: 20px;">过磅单</h1>
- </div>
- <table style="margin: 0 auto;margin-top: 20px;text-align: center;width: 900px;">
- <tr style="padding: 0 0.5px;height: 50px;">
- <td style="width: 21%">时间</td>
- <td style="width: 29%">{{sa.forDate(nowDay,'yyyy-MM-dd HH:mm')}}</td>
- <td style="width: 21%">编号</td>
- <td >{{m.no}}</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td style="width: 21%">货名</td>
- <td style="width: 29%">{{m.goodsName}}</td>
- <td style="width: 21%">结算公司</td>
- <td style="width: 29%">{{m.companyName}}</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td colspan="2">进场</td>
- <td colspan="2">出场</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td >过磅时间</td>
- <td >{{sa.forDate(m.inTime,'HH:mm')}}</td>
- <td >过磅时间</td>
- <td >{{sa.forDate(m.outTime,'HH:mm')}}</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td >车号</td>
- <td >{{m.carNo}}</td>
- <td >车号</td>
- <td >{{m.carNo}}</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td >车身重量(吨)</td>
- <td >{{m.carWeight}}</td>
- <td >总重量 (吨)</td>
- <td >{{m.totalWeight}}</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td rowspan="2">货物重量 (吨)</td>
- <td rowspan="2">{{m.goodsWeight}}</td>
- <td >司磅员</td>
- <td>{{m.weightPerson}}</td>
- </tr>
- <tr style="padding: 0 0.5px;height: 50px;">
- <td >司机</td>
- <td ></td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- var app = new Vue({
- el: '.box',
- data: {
- nowDay:new Date(),
- id: sa.p('id', ''),
- dataList: [],
- m:{}
- },
- methods: {
- getDataList() {
- sa.ajax('/TbCarWeight/getById?id=' + this.id, function(resp) {
- this.m=resp.data;
- console.log(this.m)
- sa.loading("准备打印...");
- setTimeout(() => {
- sa.hideLoading();
- this.printFn();
- }, 1000)
- }.bind(this))
- },
- printFn() {
- // window.print()
- Print('#myPrintArea', {
- noPrint: '.noPrint'
- });
- }
- },
- mounted() {
- this.getDataList();
- }
- })
- </script>
- </body>
- </html>
|