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.
62 lines
2.3 KiB
62 lines
2.3 KiB
<?php
|
|
|
|
namespace App\Forms;
|
|
|
|
use App\Models\Project;
|
|
use Kris\LaravelFormBuilder\Form;
|
|
use Kris\LaravelFormBuilder\Field;
|
|
|
|
class ProductForm extends Form
|
|
{
|
|
public function buildForm()
|
|
{
|
|
$this->add("name", Field::TEXT, ["label" => "名称", "rules" => "required"]);
|
|
$this->add("project_id", Field::HIDDEN, ["label" => "所属项目/医院", "rules" => "required"]);
|
|
$this->add("poster", Field::TEXT, ["label" => "产品图标", "attr" => ["data-plugin" => "uploader"]]);
|
|
// $this->add("profile", Field::TEXT, ["label" => "简介"]);
|
|
$this->add("fee_type", Field::SELECT, ["label" => "管理费模式", "choices" => [
|
|
"factor" => "按产品型号",
|
|
"patient_quantity" => "按陪护数量",
|
|
"price_level" => "按价格阶梯"
|
|
]]);
|
|
$this->add('productItems', 'collection', [
|
|
'type' => 'form',
|
|
'label' => "产品定价",
|
|
'options' => [
|
|
'class' => 'App\Forms\ProductItemForm',
|
|
'label' => false
|
|
]
|
|
]);
|
|
$this->add('productParamedicLevels', 'collection', [
|
|
'type' => 'form',
|
|
'label' => "护工级别价格因素",
|
|
'options' => [
|
|
'class' => 'App\Forms\ProductParamedicLevelForm',
|
|
'label' => false
|
|
]
|
|
]);
|
|
$this->add("factors", Field::STATIC, ["label" => "产品型号"]);
|
|
$this->add('productFeeLevels', 'collection', [
|
|
'type' => 'form',
|
|
'label' => "管理费阶梯",
|
|
'options' => [
|
|
'class' => 'App\Forms\ProductFeeLevelForm',
|
|
'label' => false
|
|
]
|
|
]);
|
|
$this->add('lastdayCheckoutRules', 'collection', [
|
|
'type' => 'form',
|
|
'label' => "出院日结算规则",
|
|
'options' => [
|
|
'class' => 'App\Forms\LastdayCheckoutRuleForm',
|
|
'label' => false
|
|
]
|
|
]);
|
|
|
|
$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"]]
|
|
]]);
|
|
}
|
|
}
|