问题描述
我使用的是laravel刀片,其中我将数据传递到html标签格式的打印机中,我在单个页面中打开多个发票并将所有标签发送给打印机以立即进行打印,但问题是它查看所有发票,但它仅先发送发票,不打印剩余的发票,这是我的代码,我会在最近的document.getElementById('prnt').innerHTML;
中将id =“ prnt”发送到
这是完整的代码
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Order Details</title>
<!-- Bootstrap core CSS-->
<link href="{{ asset('assets/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<!-- Custom fonts for this template-->
<link href="{{ asset('assets/font-awesome/css/font-awesome.min.css') }}" rel="stylesheet" type="text/css">
<!-- Latest compiled and minified JavaScript -->
<style>
.border-top{ border-top: 1px solid #eee; } .padding-20px{padding: 20px}
@media print {
.hidden-print { display:none !important; }
}
</style>
</head>
<body>
@foreach($data as $inv_row)
<section class="invoices-section">
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<!--<p class="text-center" align="1">{{ date('d/m/Y h:i:sa') }}</p>-->
<div id="prnt">
<img class="img-fluid" src="{{ asset('images/order DESIGN.bmp') }}" alt="Invoice Header Image" width="470px" height="200px"/>
<table class="table table-bordered table-custom-th" width="100%" cellspacing="0">
<p>Customer Name: {{ strtoupper($inv_row->customer->user->name) }}</p>
<!--@foreach($inv_row['ordertakers'] as $otd)-->
<!--<p>Customer Name: {{ strtoupper($otd->ordertaker->name) }}</p>-->
<!--@endforeach-->
<p>Address: {{ $inv_row->customer->address }}</p>
<p>Phone : {{ $inv_row->customer->phone }}</p>
<p>Date: {{ date('d/m/Y h:i:sa',strtotime($inv_row->created_at)) }} / Bill No: {{ $inv_row['bill_no'] }}</p>
<p class="text-center">*******************************</p>
@foreach($inv_row['order_details'] as $inv_detail)
<tr>
<td>
<p class="text-center" align="1"> --------------</p>
</td>
</tr>
<tr>
<td class="text-center" align="1"><?php echo $inv_detail->product->name; ?></td>
</tr>
<tr>
<td>
<p class="text-center" align="1"> --------------</p>
</td>
</tr>
<tr>
<td>Price :{{ $inv_detail->amount / $inv_detail->unit }}</td>
</tr>
<tr>
<td>Unit :{{ $inv_detail->unit }}</td>
</tr>
<tr>
<td>Amount:{{ $inv_detail->amount }} </td>
</tr>
<?php $is_c_benefit = App\CustomPrice::where(['customer_id' => $inv_detail->order->customer_id,'product_id' => $d->product_id])->first();?>
@endforeach
</table>
<p class="text-center">*******************************</p>
<table class="table">
<tbody>
<tr>
<td>
Sub Total: {{$inv_row->subtotal }}
</td>
</tr>
<tr>
<td>
Discount: {{ $inv_row->discount }}
</td>
</tr>
@if($inv_row['prev_invoices_details']->amount_left>0)
<tr>
<td>
Balance : {{ $inv_row['prev_invoices_details']->amount_left }}
</td>
</tr>
@elseif($inv_row['prev_invoices_details']->amount_left<0)
<tr>
<td>
Prev Advance : {{ $inv_row['prev_invoices_details']->amount_left*-1 }}
</td>
</tr>
@endif
@if($inv_row->amount>0)
<tr>
<td>
Total :{{ $inv_row->amount + $inv_row['prev_invoices_details']->amount_left - $inv_row->discount }}
</td>
</tr>
@if($inv_row->received_amount>0 && $inv_row->amount_left>=0)
<tr>
<td>
Received: {{ $inv_row->received_amount }}
</td>
</tr>
@if($inv_row->discount != 0)
<tr>
<td>
Discount: {{ $inv_row->discount }}
</td>
</tr>
@endif
<tr>
<td>
Remaining Balance: {{ $inv_row->amount_left }}
</td>
</tr>
@endif
@if($inv_row->received_amount>0 && $inv_row->amount_left<0)
<tr>
<td>
Received: {{ $inv_row->received_amount }}
</td>
</tr>
<tr>
<td>
Advance: {{ $inv_row->amount_left*-1 }}
</td>
</tr>
@endif
@else($inv_row->amount<0)
<tr>
<td>
Crrent Advance : {{ $inv_row->amount*-1 }}
</td>
</tr>
@endif
<tr>
<td>
Bit : {{ $inv_row->c_benefit }}
</td>
</tr>
<tr>
<td>
<b>Previous Bill History {{date('d/m/Y h:i:sa',strtotime( $inv_row['prev_invoices_details']->created_at))}}</b>
</td>
</tr>
<tr>
<td>
Subtotal: {{ $inv_row['prev_invoices_details']->subtotal}}
</td>
</tr>
<tr>
<td>
Total : {{ $inv_row['prev_invoices_details']->amount }}
</td>
</tr>
<tr>
<td>
Received: {{ $inv_row['prev_invoices_details']->received_amount }}
</td>
</tr>
@if( $inv_row['prev_invoices_details']->discount != 0)
<tr>
<td>
Discount: {{ $inv_row['prev_invoices_details']->discount }}
</td>
</tr>
@endif
@if($inv_row['prev_invoices_details']->amount_left>0)
<tr>
<td>
Remaining Balance: {{ $inv_row['prev_invoices_details']->amount_left }}
</td>
</tr>
@elseif($inv_row['prev_invoices_details']->amount_left <= -1 && $inv_row['prev_invoices_details']->amount_left != 0)
<tr>
<td>
Advance : {{ $inv_row['prev_invoices_details']->amount_left*-1 }}
</td>
</tr>
@endif
</tbody>
</table>
<div class="text-center"><img class="" align="1" src="{{asset('images/qr.bmp') }}" alt="Invoice Header Image" width="auto" height="auto"/></div>
<p class="text-center">--------Thank You--------</p>
</div>
</div>
<div class="col-md-3"></div>
</div>
@if($loop->last)
<br>
@else
<hr>
@endif
</div>
</section>
@endforeach
<div class="border-top ">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="text-center padding-20px">
<button id="btnStatus2" onclick="window.location='printerplus://send?text='+document.getElementById('prnt').innerHTML;" onclick="btnStatus2_Click">
Send to Printer+
</button>
</div>
</div>
</div>
</div>
</div>
@section('scripts')
<script type="text/javascript">
$("tr.statuscheck input,tr.statuscheck select,tr.statuscheck textarea").prop('disabled',true);
</script>
@endsection
</body>
</html>
即时通讯出现了什么错误,或者是否有其他方法可以立即发送所有标签,并希望使用php分享一件iam,以便将数据发送到蓝牙打印机,所以任何帮助都将是满满的
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)