You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
7.5 KiB

5 years ago
@extends("admin.layouts.layout")
@push("header")
<style>
table.dataTable thead .sorting:before, table.dataTable thead .sorting:after {
display: none !important;
}
</style>
<script>
var datatable_configs = {
sorting: false,
paging: true,
};
</script>
@endpush
@section("content")
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body" style="overflow: auto">
1 month ago
<ul class="nav nav-tabs nav-bordered mb-3">
<li class="nav-item">
<a href="{{ url()->current() . '?' . http_build_query(array_merge(request()->query(), ['mode' => 'customer'])) }}"
class="nav-link @if(($mode ?? 'customer') == 'customer') active @endif">
客户余额
</a>
</li>
<li class="nav-item">
<a href="{{ url()->current() . '?' . http_build_query(array_merge(request()->query(), ['mode' => 'order'])) }}"
class="nav-link @if(($mode ?? 'customer') == 'order') active @endif">
订单时点余额
</a>
</li>
</ul>
5 years ago
<div class="mb-3">
<form class="form-inline">
1 month ago
<input type="hidden" name="mode" value="{{ $mode ?? 'customer' }}">
3 years ago
<select class="form-control mr-1" name="project_id"
onchange="$(this).closest('form').submit()">
@foreach($projects as $pp)
<option
value="{{$pp->id}}" @if($pp->id == $project_id) {{ "selected" }}@endif>{{$pp->name}}</option>
@endforeach
</select>
1 month ago
@if(($mode ?? 'customer') == 'order')
<label class="control-label mr-1">截止日期</label><input
value="{{ $before_date }}" class="form-control mr-1" name="before_date"
data-plugin="date-picker">
1 month ago
<button class="btn btn-primary ml-1" type="button" onclick="exportOrderBalanceExcel()">导出Excel</button>
1 month ago
@endif
5 years ago
<button type="submit" class="btn btn-primary ml-1">查询</button>
</form>
</div>
1 month ago
@if(($mode ?? 'customer') == 'order')
<h5>订单时点余额表</h5>
<p class="text-muted mb-2">统计时点:{{ $before_datetime_text }}</p>
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">序号</th>
1 month ago
<th class="p-1" style="white-space: nowrap">项目名称</th>
<th class="p-1" style="white-space: nowrap">时点</th>
1 month ago
<th class="p-1" style="white-space: nowrap">订单号</th>
<th class="p-1" style="white-space: nowrap">客户手机号</th>
<th class="p-1" style="white-space: nowrap">联系人</th>
<th class="p-1" style="white-space: nowrap">联系电话</th>
<th class="p-1" style="white-space: nowrap">被陪护人</th>
<th class="p-1" style="white-space: nowrap">服务开始</th>
<th class="p-1" style="white-space: nowrap">服务结束</th>
<th class="p-1" style="white-space: nowrap">时点余额</th>
</tr>
</thead>
<tbody>
@foreach($orderBalances as $item)
<tr>
<td class="p-1">{{ $loop->iteration }}</td>
1 month ago
<td class="p-1">{{ $item->project_name }}</td>
<td class="p-1">{{ $item->point_time }}</td>
1 month ago
<td class="p-1">{{ $item->serial }}</td>
<td class="p-1">{{ $item->customer_mobile }}</td>
<td class="p-1">{{ $item->contact }}</td>
<td class="p-1">{{ $item->contact_mobile }}</td>
<td class="p-1">{{ $item->patient_name ?: "无" }}</td>
<td class="p-1">{{ $item->from_date }}</td>
<td class="p-1">{{ $item->to_date }}</td>
<td class="p-1">{{ $item->balance }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<h5>客户余额表</h5>
<p class="text-muted mb-2">统计时点:{{ $before_datetime_text }}</p>
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
5 years ago
<tr>
1 month ago
<th class="p-1" style="white-space: nowrap">序号</th>
<th class="p-1" style="white-space: nowrap">客户手机号</th>
<th class="p-1" style="white-space: nowrap">客户家属</th>
<th class="p-1" style="white-space: nowrap">截止日期</th>
<th class="p-1" style="white-space: nowrap">未结算余额</th>
5 years ago
</tr>
1 month ago
</thead>
<tbody>
@foreach($customers as $item)
@if(!$item->oneBalance)
@continue
@elseif (!($item->oneBalance->balance > 0))
@continue
@endif
<tr>
<td class="p-1">{{ $loop->iteration }}</td>
<td class="p-1">{{ $item->mobile }}</td>
<td class="p-1">{{ $item->patients->count() ? $item->patients->last()->name : "无" }}</td>
<td class="p-1">{{ $before_date }}</td>
<td class="p-1">{{ $item->balance }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
5 years ago
</div>
</div>
</div>
</div>
@include("plugins.datatable")
1 month ago
<script>
function exportOrderBalanceExcel() {
1 month ago
var url = "{{ url('admin/statistics/member-balance-by-date') }}";
var params = $('form.form-inline').serialize();
window.open(url + '?is_export=1&' + params);
1 month ago
}
</script>
5 years ago
@endsection