liyinglin 2 years ago
parent 5add2ac4d4
commit b8a5526352

@ -52,7 +52,7 @@ class ProductForm extends Form
'label' => false
]
]);
$this->add("factor_item_ids", Field::SELECT, ["label" => "统计价格因素", "rules" => "required", "attr" => ["multiple" => true, "data-plugin" => "select2"]]);
$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"]]

@ -91,7 +91,7 @@ class ProductController extends CommonController
"model" => $vo
]);
$form->add("_previous", "hidden", ["value" => (url()->previous())]);
$form->add("factor_item_ids", 'select', ["label" => "统计价格因素", "attr" => ["multiple" => true, "data-plugin" => "select2"],
$form->modify("factor_item_ids", 'select', ["label" => "统计价格因素", "attr" => ["multiple" => true, "data-plugin" => "select2"],
"choices" => (new Factor())->where('product_id', $request->id)->get()->pluck("name", "id")->toArray()
]);
return view($this->bladePath . ".create", compact("form", "project", "vo"));

Loading…
Cancel
Save