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.

131 lines
7.1 KiB

@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">
<div class="mb-3">
<form class="form-inline">
<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>
<select class="form-control" name="month" onchange="$(this).closest('form').submit()">
@foreach($months as $mm)
<option value="{{$mm}}" @if($mm == $month) {{ "selected" }}@endif>{{$mm}}</option>
@endforeach
</select>
</form>
</div>
<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>
<th class="p-1" style="white-space: nowrap">护工姓名</th>
@foreach($dates as $d)
<th class="p-1 text-center">{{$d}}</th>
@endforeach
<th class="p-1" style="white-space: nowrap">全部总计</th>
<th class="p-1" style="white-space: nowrap">当月已扣款的总计</th>
</tr>
</thead>
<tbody>
@foreach($paramedics as $paramedic)
<tr>
<td class="p-1">{{ $loop->iteration }}</td>
<td class="p-1">{{ $paramedic->name }}</td>
@foreach($dates as $d)
<?php
$dd = $d == \App\Models\OrderItems::PREV_MONTH ? \App\Models\OrderItems::PREV_MONTH : ($month . "-" . $d);
?>
@if(isset($paramedic->orderItems[$dd]))
<td class='p-1 bg-success text-white text-center'>
{{ collect($paramedic->orderItems[$dd])->sum("paramedic_total") }}
</td>
@else
<td class="p-1 text-center">
-
</td>
@endif
@endforeach
<td class="p-1">{{$paramedic->originalOrderItems->sum("paramedic_total")}}</td>
<td class="p-1">{{$paramedic->originalOrderItems->filter(function($item) { return $item->paid_at_this_month; })->sum("paramedic_total")}}</td>
</tr>
@endforeach
</tbody>
</table>
<h5>明细</h5>
<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>
<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">{{ \App\Models\OrderItems::PREV_MONTH }}</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>
<th class="p-1" style="white-space: nowrap">当月扣款时间</th>
</tr>
</thead>
<tbody>
@foreach($allItems as $item)
<tr>
<td class="p-1">{{ $loop->iteration }}</td>
<td class="p-1">{{ $item->id }}</td>
<td class="p-1">{{ $item->order ? $item->order->serial : $item->order_id }}</td>
<td class="p-1">{{ $item->paramedic ? $item->paramedic->name : "已删除护工" }}</td>
<td class="p-1">{{ $item->service_date }}</td>
<td class="p-1">{{ $item->service_date_in_this_month == \App\Models\OrderItems::PREV_MONTH ? "是" : "" }}</td>
<td class="p-1">{{ $item->order ? $item->order->contact."/".$item->order->mobile : "" }}</td>
<td class="p-1">{{ $item->building ? $item->building->name : "" }}</td>
<td class="p-1">{{ $item->area ? $item->area->name : "" }}</td>
<td class="p-1">{{ ($item->room ? $item->room->name : "")."_".($item->bed ? $item->bed->name : "") }}</td>
<td class="p-1">{!! implode("<br>",$item->factor_texts) !!}</td>
<td class="p-1">{{ $item->total }}</td>
<td class="p-1">{{ $item->paramedic_total }}</td>
<td class="p-1">{{ $item->paid_at_this_month ? $item->paid_at : "当月未扣款" }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@include("plugins.datatable")
@endsection
@push("footer")
<script>
</script>
@endpush