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.

25 lines
1.0 KiB

5 years ago
<?php
namespace App\Forms;
use Kris\LaravelFormBuilder\Form;
use Kris\LaravelFormBuilder\Field;
class FactorItemForm extends Form
{
public function buildForm()
{
$this->add("id", Field::HIDDEN);
$this->add("factor_id", Field::HIDDEN);
$this->add("name", Field::TEXT, ["label" => "选项", "rules" => "required"]);
$this->add("price", Field::NUMBER, ["label" => "加价", "rules" => "required"]);
$this->add("fee_percent", Field::NUMBER, ["label" => "管理费百分比", "rules" => "required"]);
$this->add("fee", Field::NUMBER, ["label" => "固定管理费", "rules" => "required"]);
$this->add("myindex", Field::NUMBER, ["label" => "排序", "rules" => "required", "default_value" => 0]);
$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"]]
]]);
}
}