weizong song 4 years ago
parent 1db84238de
commit ae114f3c87

BIN
.DS_Store vendored

Binary file not shown.

@ -30,12 +30,20 @@ class ParamedicController extends CommonController
public function index(Request $request)
{
$data = $this->model->with("project")->paginate(10);
$data = $this->model->with("project");
if (request()->keyword) {
$data->where(function ($query) {
$query->where("name", "like", "%" . request()->keyword . "%")
->orWhere("id_card_number", "like", "%" . request()->keyword . "%");
});
}
$data = $data->paginate(10);
return view($this->bladePath . ".index", compact("data"));
}
public function getLevels(Request $request) {
$levels = (new ParamedicLevel())->where("project_id",$request->project_id)->get();
public function getLevels(Request $request)
{
$levels = (new ParamedicLevel())->where("project_id", $request->project_id)->get();
return $this->ajaxResponse($levels);
}
@ -50,7 +58,7 @@ class ParamedicController extends CommonController
"class" => "form form-horizontal validate-form",
"model" => $vo
]);
$form->modify("paramedic_level_id", "select", ["label" => "护工等级","value"=>$vo->paramedic_level_id,"choices"=>(new ParamedicLevel())->where("project_id",$vo->project_id)->get()->pluck("name","id")->toArray()]);
$form->modify("paramedic_level_id", "select", ["label" => "护工等级", "value" => $vo->paramedic_level_id, "choices" => (new ParamedicLevel())->where("project_id", $vo->project_id)->get()->pluck("name", "id")->toArray()]);
$form->add("_previous", "hidden", ["value" => (url()->previous())]);
return view($this->bladePath . ".create", compact("form"));
@ -89,7 +97,8 @@ class ParamedicController extends CommonController
}
}
public function export() {
return Excel::download(new ParamedicExport(),"paramedics.xlsx");
public function export()
{
return Excel::download(new ParamedicExport(), "paramedics.xlsx");
}
}

BIN
public/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -6,9 +6,14 @@
<div class="card">
<div class="card-body">
<div class="mb-3">
<a class="btn btn-primary" href="{{url($urlPrefix.'/create')}}">
@lang("icons.action_create") @lang('actions.create'){{$modelName}}
</a>
<form class="form-inline" id="search-form" autocomplete="off">
<a class="btn btn-primary mr-1" href="{{url($urlPrefix.'/create')}}">
@lang("icons.action_create") @lang('actions.create'){{$modelName}}
</a>
<input class="form-control" type="text" name="keyword" value="{{ request()->keyword }}"
placeholder="姓名/身份证">
</form>
</div>
<table class="table table-bordered" id="data-table">

Loading…
Cancel
Save