|
|
|
|
@ -17,22 +17,27 @@
|
|
|
|
|
<div class="mb-2">
|
|
|
|
|
<form class="form-inline" id="search-form">
|
|
|
|
|
<div class="input-group mr-1">
|
|
|
|
|
<select class="form-control" name="building_id" id="building_id"
|
|
|
|
|
<select class="form-control" name="building_id" id="building_id" data-type="building"
|
|
|
|
|
onchange="changeBuilding()">
|
|
|
|
|
<option value="">请选择楼栋</option>
|
|
|
|
|
@foreach($project->buildings as $building)
|
|
|
|
|
<option
|
|
|
|
|
value="{{ $building->id }}" @if($building->id == request()->building_id){{ "selected" }}@endif>{{ $building->name }}</option>
|
|
|
|
|
<option data-index="{{ $building->myindex }}"
|
|
|
|
|
value="{{ $building->id }}" @if($building->id == request()->building_id){{ "selected" }}@endif>{{ $building->name }}</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
<div class="input-group-append">
|
|
|
|
|
<button class="btn btn-primary" type="button" onclick="createSub('project')"><i
|
|
|
|
|
class="mdi mdi-plus"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-group-append">
|
|
|
|
|
<button class="btn btn-light" type="button" onclick="edit(this)"><i
|
|
|
|
|
class="mdi mdi-pencil"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-group mr-1">
|
|
|
|
|
<select class="form-control" name="area_id" id="area_id" onchange="changeArea()">
|
|
|
|
|
<select class="form-control" name="area_id" id="area_id" onchange="changeArea()"
|
|
|
|
|
data-type="area">
|
|
|
|
|
<option value="">
|
|
|
|
|
请选择病区
|
|
|
|
|
</option>
|
|
|
|
|
@ -47,10 +52,14 @@
|
|
|
|
|
<button class="btn btn-primary" type="button" onclick="createSub('building')"><i
|
|
|
|
|
class="mdi mdi-plus"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-group-append">
|
|
|
|
|
<button class="btn btn-light" type="button" onclick="edit(this)"><i
|
|
|
|
|
class="mdi mdi-pencil"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="input-group mr-1">
|
|
|
|
|
<select class="form-control" name="room_id" id="room_id">
|
|
|
|
|
<select class="form-control" name="room_id" id="room_id" data-type="room">
|
|
|
|
|
<option value="">
|
|
|
|
|
请选择病房
|
|
|
|
|
</option>
|
|
|
|
|
@ -65,12 +74,16 @@
|
|
|
|
|
<button class="btn btn-primary" type="button" onclick="createSub('area')"><i
|
|
|
|
|
class="mdi mdi-plus"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-group-append">
|
|
|
|
|
<button class="btn btn-light" type="button" onclick="edit(this)"><i
|
|
|
|
|
class="mdi mdi-pencil"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button class="btn btn-primary mr-1" type="button" onclick="createSub('room')">新增病床 <i
|
|
|
|
|
<button class="btn btn-primary mr-3" type="button" onclick="createSub('room')">新增病床 <i
|
|
|
|
|
class="mdi mdi-plus"></i></button>
|
|
|
|
|
<button class="btn btn-primary" type="submit">搜索</button>
|
|
|
|
|
<a class="btn btn-primary ml-3" href="{{ url("admin/project") }}">返回</a>
|
|
|
|
|
<a class="btn btn-secondary ml-1" href="{{ url("admin/project") }}">返回</a>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -82,6 +95,7 @@
|
|
|
|
|
<th>医院/项目</th>
|
|
|
|
|
<th>楼栋</th>
|
|
|
|
|
<th>病区/楼层</th>
|
|
|
|
|
<th>排序</th>
|
|
|
|
|
<th>操作</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
@ -96,10 +110,10 @@
|
|
|
|
|
<td>{{ $row->project->name }}</td>
|
|
|
|
|
<td>{{ $row->building ? $row->building->name : "已删除" }}</td>
|
|
|
|
|
<td>{{ $row->area ? $row->area->name : "已删除" }}</td>
|
|
|
|
|
|
|
|
|
|
<td>{{ $row->myindex }}</td>
|
|
|
|
|
<td>
|
|
|
|
|
<a class="btn btn-sm btn-primary"
|
|
|
|
|
href="javascript:;" onclick="edit(this)">@lang("icons.action_edit")</a>
|
|
|
|
|
href="javascript:;" onclick="editBed(this)">@lang("icons.action_edit")</a>
|
|
|
|
|
<a class="btn btn-sm btn-danger" data-id="{{$row['id']}}"
|
|
|
|
|
href="javascript:;" onclick="del(this)">@lang("icons.action_delete")</a>
|
|
|
|
|
</td>
|
|
|
|
|
@ -160,18 +174,18 @@
|
|
|
|
|
</div><!-- /.modal-content -->
|
|
|
|
|
</div><!-- /.modal-dialog -->
|
|
|
|
|
</div><!-- /.modal -->
|
|
|
|
|
|
|
|
|
|
@include("plugins.treetable")
|
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
|
|
@push("footer")
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$(function () {
|
|
|
|
|
$("#tree-table tr").hover(function () {
|
|
|
|
|
$(this).find("button").removeClass("d-none");
|
|
|
|
|
}, function () {
|
|
|
|
|
$(this).find("button").addClass("d-none");
|
|
|
|
|
$("#pages a.page-link").each(function () {
|
|
|
|
|
if (!$(this).attr("href")) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var filters = $("#search-form").serialize();
|
|
|
|
|
$(this).attr("href", $(this).attr("href") + "&" + filters);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -183,7 +197,7 @@
|
|
|
|
|
var url = "{{ url($urlPrefix."/get-subs") }}";
|
|
|
|
|
$.get(url, {type: "building", id: building_id}, function (res) {
|
|
|
|
|
for (var i = 0; i < res.length; i++) {
|
|
|
|
|
$("#area_id").append('<option value="' + res[i].id + '">' + res[i].name + '</option>');
|
|
|
|
|
$("#area_id").append('<option data-index="' + res[i].myindex + '" value="' + res[i].id + '">' + res[i].name + '</option>');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -195,7 +209,7 @@
|
|
|
|
|
var url = "{{ url($urlPrefix."/get-subs") }}";
|
|
|
|
|
$.get(url, {type: "area", id: area_id}, function (res) {
|
|
|
|
|
for (var i = 0; i < res.length; i++) {
|
|
|
|
|
$("#room_id").append('<option value="' + res[i].id + '">' + res[i].name + '</option>');
|
|
|
|
|
$("#room_id").append('<option data-index="' + res[i].myindex + '" value="' + res[i].id + '">' + res[i].name + '</option>');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -257,12 +271,35 @@
|
|
|
|
|
$("#model-form").modal("show");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function edit(element) {
|
|
|
|
|
function editBed(element) {
|
|
|
|
|
var type = $(element).closest("tr").attr("data-type");
|
|
|
|
|
var id = $(element).closest("tr").attr("data-id");
|
|
|
|
|
var url = "{{ url($urlPrefix."/edit-department") }}";
|
|
|
|
|
var name = $(element).closest("tr").attr("data-name");
|
|
|
|
|
var myindex = $(element).closest("tr").attr("data-myindex");
|
|
|
|
|
var url = "{{ url($urlPrefix."/edit-department") }}";
|
|
|
|
|
|
|
|
|
|
$("#model-form form input[name=type]").val(type);
|
|
|
|
|
$("#model-form form input[name=id]").val(id);
|
|
|
|
|
$("#model-form form input[name=name]").val(name);
|
|
|
|
|
$("#model-form form input[name=myindex]").val(myindex);
|
|
|
|
|
$("#model-form form").attr("action", url);
|
|
|
|
|
|
|
|
|
|
$("#model-form .modal-title").html("修改病床");
|
|
|
|
|
$("#model-form").modal("show");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function edit(element) {
|
|
|
|
|
var target = $(element).parent().siblings("select");
|
|
|
|
|
var type = target.attr("data-type");
|
|
|
|
|
var id = target.val();
|
|
|
|
|
|
|
|
|
|
if (id == "") {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var url = "{{ url($urlPrefix."/edit-department") }}";
|
|
|
|
|
var name = target.find("option:selected").html();
|
|
|
|
|
var myindex = target.find("option:selected").attr("data-index");
|
|
|
|
|
|
|
|
|
|
$("#model-form form input[name=type]").val(type);
|
|
|
|
|
$("#model-form form input[name=id]").val(id);
|
|
|
|
|
|