Compare commits

..

No commits in common. "47f610eefcaffc03a7e92c4e40b7913b8419339f" and "1f9ff9ef5df3fe10b2d3f2a3ac121540ac18381d" have entirely different histories.

2 changed files with 13 additions and 35 deletions

View File

@ -15,7 +15,6 @@ class PrintController extends Controller
$sn = '';
//默认list最少N行最多N行
$list = [];
$total = 0;
$bigTotal = '';
$adminName = '';
$timeZone = '';
@ -28,27 +27,11 @@ class PrintController extends Controller
$time = $flow->created_at->format('Y-m-d H:i:s');
$sn = $flow->sn;
$ukeys = explode(',', $request->input('ukeys', ''));
$i = 0;
foreach($rows as $item){
if($i<4){
if(in_array($item['ukey'], $ukeys)){
$i++;
$list[] = $item;
}
}else{
break;
if(in_array($item['ukey'], $ukeys)){
$list[] = $item;
}
}
for($i; $i<4; $i++){
$list[] = [
'ukey' => '',
'name' => '',
'fee_name' => '',
'fee_value' => 0,
];
}
if(count($list) > 0){
$total = collect($list)->sum('fee_value');
if($total > 0){
@ -61,7 +44,7 @@ class PrintController extends Controller
$timeZone = substr($flow->start_at, 0, 10).'至'.substr($flow->end_at, 0, 10);
}
return view('print-const', compact('name', 'time', 'sn', 'list', 'total', 'bigTotal', 'timeZone', 'adminName'));
return view('print-const', compact('name', 'time', 'sn', 'list', 'bigTotal', 'timeZone', 'adminName'));
}

View File

@ -9,7 +9,7 @@
margin: 0;
}
body {
margin: 0.8cm;
margin: 1.6cm;
}
}
body {
@ -18,6 +18,7 @@
.container {
/* width: 800px; */
text-align: center;
height: 800px;
}
.tag {
overflow: hidden; /* 清除浮动 */
@ -42,8 +43,8 @@
margin: 0 auto;
table-layout: fixed;
}
td, th{
line-height: 30px;
td,th{
line-height: 35px;
border: 1px solid black;
}
</style>
@ -51,7 +52,7 @@
<body>
<button type="button" class="print-hide" onclick="this.style.display='none';window.print();this.style.display='inline';">打印</button>
<div class="container" id="print-content">
<p style="font-size:25px;margin-top: 10px">重庆市巴南区狮子山老年公寓收据</p>
<p style="font-size:30px;">重庆市巴南区狮子山老年公寓收据</p>
<p class="tag" style="font-size:20px;">
<span class="left">客户姓名 {{$name}}</span>
<span class="middle">日期 {{$time}}</span>
@ -62,14 +63,14 @@
<th style="width: 5%;">序号</th>
<th style="width: 25%;">费用类别</th>
<th style="width: 30%;">起止日期</th>
<th style="width: 15%;">金额(元)</th>
<th style="width: 15%;">金额</th>
<th style="width: 25%;">备注</th>
</tr>
@foreach($list as $item)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$item['name']}}-{{$item['fee_name']}}</td>
<td>@if(empty($item['name']))-@else{{$timeZone}}@endif</td>
<td>{{$item['fee_name']}}</td>
<td>{{$timeZone}}</td>
<td>{{$item['fee_value']}}</td>
<td>
<input type="text" style="border:none">
@ -77,9 +78,8 @@
</tr>
@endforeach
<tr>
<td colspan="3" style=" text-align: left;">合计大写:{{$bigTotal}}</td>
<td >{{$total}}</td>
<td ></td>
<td colspan="3">合计大写:</td>
<td colspan="2">{{$bigTotal}}</td>
</tr>
</table>
<p class="tag" style="font-size:20px;">
@ -87,11 +87,6 @@
<span class="middle"> </span>
<span class="right">收款人 {{$adminName}}</span>
</p>
<p class="tag" style="font-size:20px;">
<span class="left">白联:存根</span>
<span class="middle">红联:客户</span>
<span class="right">黄联:记账</span>
</p>
</div>
</body>
<script>