|
|
|
|
@ -12,6 +12,7 @@ use App\Admin;
|
|
|
|
|
use App\Events\ProjectSaved;
|
|
|
|
|
use App\Exports\CommonExport;
|
|
|
|
|
use App\Forms\ProjectForm;
|
|
|
|
|
use App\Models\AdminAreaLink;
|
|
|
|
|
use App\Models\Area;
|
|
|
|
|
use App\Models\Bed;
|
|
|
|
|
use App\Models\Building;
|
|
|
|
|
@ -88,12 +89,26 @@ class ProjectController extends CommonController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = $data->paginate(10);
|
|
|
|
|
return view($this->bladePath . ".beds", compact("project", "data"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getHeadList()
|
|
|
|
|
{
|
|
|
|
|
$areaId = \request('area_id', 0);
|
|
|
|
|
// 获取护士长
|
|
|
|
|
$roleId = Role::where('name','like','%护士长%')->where('guard_name','admin')->value('id');
|
|
|
|
|
$adminIds = DB::table('model_has_roles')->where('role_id',$roleId)->where('model_type','App\Admin')->pluck('model_id');
|
|
|
|
|
$head_list = Admin::whereIn('id',$adminIds)->get();
|
|
|
|
|
return view($this->bladePath . ".beds", compact("project", "data","head_list"));
|
|
|
|
|
$roleId = Role::where('name', 'like', '%护士长%')->where('guard_name', 'admin')->value('id');
|
|
|
|
|
$adminIds = DB::table('model_has_roles')->where('role_id', $roleId)->where('model_type', 'App\Admin')->pluck('model_id');
|
|
|
|
|
// 全量护工数据
|
|
|
|
|
$headList = Admin::whereIn('id', $adminIds)->get();
|
|
|
|
|
// 获取病区选中的护工
|
|
|
|
|
foreach ($headList as $item) {
|
|
|
|
|
$item->checked = '';
|
|
|
|
|
if ($areaId) {
|
|
|
|
|
$has = AdminAreaLink::where('area_id', $areaId)->where('admin_id', $item->id)->count();
|
|
|
|
|
if ($has) $item->checked = 'checked';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $this->ajaxResponse($headList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createSub(Request $request)
|
|
|
|
|
|