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.
79 lines
2.4 KiB
79 lines
2.4 KiB
<?php
|
|
|
|
namespace App\Forms;
|
|
|
|
use App\Models\Project;
|
|
use App\Models\Adverse;
|
|
use App\Models\Orders;
|
|
use Kris\LaravelFormBuilder\Form;
|
|
use Kris\LaravelFormBuilder\Field;
|
|
|
|
class AdverseForm extends Form
|
|
{
|
|
public function buildForm()
|
|
{
|
|
$this->add("project_id", Field::SELECT, [
|
|
"label" => "所属项目/医院",
|
|
"empty_value" => "请选择",
|
|
"choices" => (new Project())->get()->pluck("name", "id")->toArray(),
|
|
"attr" => ["class" => "form-control"]
|
|
]);
|
|
|
|
$this->add("order_id", Field::SELECT, [
|
|
"label" => "相关订单",
|
|
"empty_value" => "请选择",
|
|
"attr" => ["class" => "form-control"]
|
|
]);
|
|
|
|
$this->add("type", Field::SELECT, [
|
|
"label" => "不良事件类型",
|
|
"empty_value" => "请选择",
|
|
"choices" => Adverse::getTypeList(),
|
|
"attr" => ["class" => "form-control"]
|
|
]);
|
|
|
|
$this->add("description", Field::TEXTAREA, [
|
|
"label" => "事件描述",
|
|
"attr" => [
|
|
"class" => "form-control",
|
|
"rows" => 4,
|
|
"placeholder" => "请详细描述不良事件的具体情况..."
|
|
]
|
|
]);
|
|
|
|
$this->add("solved_status", Field::SELECT, [
|
|
"label" => "解决状态",
|
|
"empty_value" => "请选择",
|
|
"choices" => Adverse::getStatusList(),
|
|
"attr" => ["class" => "form-control"]
|
|
]);
|
|
|
|
$this->add("solved_result", Field::TEXTAREA, [
|
|
"label" => "解决结果描述",
|
|
"attr" => [
|
|
"class" => "form-control",
|
|
"rows" => 3,
|
|
"placeholder" => "请描述解决方案和结果..."
|
|
]
|
|
]);
|
|
|
|
$this->add("solved_at", Field::DATE, [
|
|
"label" => "解决时间",
|
|
"attr" => ["class" => "form-control"]
|
|
]);
|
|
|
|
$this->add("solved_by", Field::TEXT, [
|
|
"label" => "经办人",
|
|
"attr" => ["class" => "form-control"]
|
|
]);
|
|
|
|
$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"]]
|
|
]
|
|
]);
|
|
}
|
|
}
|