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.
39 lines
2.1 KiB
39 lines
2.1 KiB
<?php
|
|
|
|
namespace App\Forms;
|
|
|
|
use App\Models\Project;
|
|
use Kris\LaravelFormBuilder\Form;
|
|
use Kris\LaravelFormBuilder\Field;
|
|
|
|
class ParamedicForm extends Form
|
|
{
|
|
public function buildForm()
|
|
{
|
|
$this->add("name", Field::TEXT, ["label" => "姓名", "rules" => "required"]);
|
|
$this->add("mobile", Field::TEXT, ["label" => "电话", "rules" => "required"]);
|
|
$this->add("serial", Field::TEXT, ["label" => "编号", "rules" => "required"]);
|
|
$this->add("avatar", Field::TEXT, ["label" => "照片", "attr" => ["data-plugin" => "uploader"]]);
|
|
$this->add("health_certificate", Field::TEXT, ["label" => "健康证", "attr" => ["data-plugin" => "uploader"]]);
|
|
$this->add("work_certificate", Field::TEXT, ["label" => "护理员证", "attr" => ["data-plugin" => "uploader"]]);
|
|
$this->add("id_card_number", Field::TEXT, ["label" => "身份证号"]);
|
|
$this->add("sex", Field::SELECT, ["label" => "性别", "choices" => [
|
|
"男" => "男",
|
|
"女" => "女"
|
|
]]);
|
|
$this->add("birthday", Field::TEXT, ["label" => "生日", "attr" => ["data-plugin" => "date-picker"]]);
|
|
$this->add("hometown", Field::TEXT, ["label" => "籍贯"]);
|
|
$this->add("address", Field::TEXT, ["label" => "居住地"]);
|
|
$this->add("emergency_phone", Field::TEXT, ["label" => "紧急联系电话"]);
|
|
$this->add("project_id", Field::SELECT, ["label" => "所属项目/医院", "empty_value" => "请选择", "choices" => (new Project())->get()->pluck("name", "id")->toArray()]);
|
|
$this->add("paramedic_level_id", Field::SELECT, ["label" => "护工等级"]);
|
|
$this->add("join_at", Field::TEXT, ["label" => "加入日期", "attr" => ["data-plugin" => "date-picker"]]);
|
|
$this->add("leave_at", Field::TEXT, ["label" => "离职日期", "attr" => ["data-plugin" => "date-picker"]]);
|
|
|
|
$this->add('buttons', 'buttongroup', ["splitted" => true, "buttons" => [
|
|
["label" => "保存", "attr" => ["class" => "btn btn-primary mr-1", "type" => "submit"]],
|
|
["label" => "返回", "attr" => ["class" => "btn btn-light btn-back", "type" => "button"]]
|
|
]]);
|
|
}
|
|
}
|