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.

111 lines
5.6 KiB

@extends("admin.layouts.layout")
@section("content")
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<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" id="data-table">
<thead>
<tr>
<th>订单编号</th>
<th>所属项目/医院</th>
<th>客户姓名</th>
<th>客户余额</th>
<th>联系电话</th>
<th>被护理人</th>
<th>开始服务日期</th>
<th>结束日期</th>
<th>状态</th>
<th>总计</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@foreach ($data as $row)
<tr data-id="{{$row->id}}">
<td>
{{ $row->serial }}
</td>
<td>{{ $row->project->name }}</td>
<td>{{ $row->customer->name ?: $row->patient->name }}</td>
<td>{{ $row->customer->balance }}</td>
<td>{{ $row->customer->mobile }}</td>
<td>{{ $row->patient->name }}</td>
<td>{{ $row->from_date }}</td>
<td>{!! $row->status == \App\Models\Orders::STATUS_FINISHED ? $row->to_date : "<label class='badge badge-danger'>未结</label> {$row->to_date}" !!}</td>
<td>{!! $row->getStatusLabelAttribute() !!} </td>
<td>{!! $row->status == \App\Models\Orders::STATUS_FINISHED ? "" : "<label class='badge badge-danger'>预计</label>" !!} {{ $row->total }} </td>
<td>
<a class="btn btn-sm btn-primary"
href="javascript:;" onclick="toggleItems(this)"><i
class="mdi mdi-arrow-down"></i> 查看</a>
</td>
</tr>
<tr style="display: none">
<td colspan="10" class="p-0">
<table class="table table-striped mb-0 border-0">
<thead>
<tr>
<th>所在床位</th>
<th>护理日期</th>
<th>护工</th>
<th>单价</th>
<th>扣款时间</th>
</tr>
</thead>
<tbody>
@foreach($row->orderItems as $item)
<tr>
<td>{{ $item->building->name }}-{{ $item->room->name }}
-{{ $item->bed->name }}床
</td>
<td>{{ $item->service_date }}</td>
<td>{{ $item->paramedic ? $item->paramedic->name : "" }}</td>
<td>{{ $item->total }}</td>
<td>{{ $item->paid_at }}</td>
</tr>
@endforeach
</tbody>
</table>
</td>
</tr>
@endforeach
</tbody>
</table>
@include("public._pages")
</div>
</div>
</div>
</div>
@include("public._delete")
@endsection
@push("footer")
<script>
function toggleItems(element) {
$(element).closest("tr").next("tr").toggle();
$(element).closest("tr").toggleClass("bg-warning");
$(element).find("i").toggleClass("mdi-arrow-up")
}
</script>
@endpush