调整打印预览

develop
vine_liutk 2023-06-16 11:53:20 +08:00
parent 1f9ff9ef5d
commit 1954065299
2 changed files with 13 additions and 8 deletions

View File

@ -15,6 +15,7 @@ class PrintController extends Controller
$sn = ''; $sn = '';
//默认list最少N行最多N行 //默认list最少N行最多N行
$list = []; $list = [];
$total = 0;
$bigTotal = ''; $bigTotal = '';
$adminName = ''; $adminName = '';
$timeZone = ''; $timeZone = '';
@ -44,7 +45,7 @@ class PrintController extends Controller
$timeZone = substr($flow->start_at, 0, 10).'至'.substr($flow->end_at, 0, 10); $timeZone = substr($flow->start_at, 0, 10).'至'.substr($flow->end_at, 0, 10);
} }
return view('print-const', compact('name', 'time', 'sn', 'list', 'bigTotal', 'timeZone', 'adminName')); return view('print-const', compact('name', 'time', 'sn', 'list', 'total', 'bigTotal', 'timeZone', 'adminName'));
} }

View File

@ -9,7 +9,7 @@
margin: 0; margin: 0;
} }
body { body {
margin: 1.6cm; margin: 0.8cm;
} }
} }
body { body {
@ -18,7 +18,6 @@
.container { .container {
/* width: 800px; */ /* width: 800px; */
text-align: center; text-align: center;
height: 800px;
} }
.tag { .tag {
overflow: hidden; /* 清除浮动 */ overflow: hidden; /* 清除浮动 */
@ -43,8 +42,8 @@
margin: 0 auto; margin: 0 auto;
table-layout: fixed; table-layout: fixed;
} }
td,th{ td, th{
line-height: 35px; line-height: 30px;
border: 1px solid black; border: 1px solid black;
} }
</style> </style>
@ -52,7 +51,7 @@
<body> <body>
<button type="button" class="print-hide" onclick="this.style.display='none';window.print();this.style.display='inline';">打印</button> <button type="button" class="print-hide" onclick="this.style.display='none';window.print();this.style.display='inline';">打印</button>
<div class="container" id="print-content"> <div class="container" id="print-content">
<p style="font-size:30px;">重庆市巴南区狮子山老年公寓收据</p> <p style="font-size:25px;margin-top: 10px">重庆市巴南区狮子山老年公寓收据</p>
<p class="tag" style="font-size:20px;"> <p class="tag" style="font-size:20px;">
<span class="left">客户姓名 {{$name}}</span> <span class="left">客户姓名 {{$name}}</span>
<span class="middle">日期 {{$time}}</span> <span class="middle">日期 {{$time}}</span>
@ -78,8 +77,8 @@
</tr> </tr>
@endforeach @endforeach
<tr> <tr>
<td colspan="3">合计大写:</td> <td colspan="3" style=" text-align: left;">合计大写:{{$bigTotal}}</td>
<td colspan="2">{{$bigTotal}}</td> <td colspan="2">{{$total}}</td>
</tr> </tr>
</table> </table>
<p class="tag" style="font-size:20px;"> <p class="tag" style="font-size:20px;">
@ -87,6 +86,11 @@
<span class="middle"> </span> <span class="middle"> </span>
<span class="right">收款人 {{$adminName}}</span> <span class="right">收款人 {{$adminName}}</span>
</p> </p>
<p class="tag" style="font-size:20px;">
<span class="left">白联:存根</span>
<span class="middle">红联:客户</span>
<span class="right">黄联:记账</span>
</p>
</div> </div>
</body> </body>
<script> <script>