Commit cbb6a44b by lujunyi

医师布局

parent 62c756e0
...@@ -106,33 +106,36 @@ protected function detail($id) ...@@ -106,33 +106,36 @@ protected function detail($id)
protected function form() protected function form()
{ {
return Form::make(new DoctorRepository(), function (Form $form) { return Form::make(new DoctorRepository(), function (Form $form) {
$form->display('id')->width(4); $form->column(6, function (Form $form) {
$form->text('name')->width(4)->required()->maxLength(32, '最多输入32个字符'); $form->display('id');
$form->text('id_card')->width(4)->required(); $form->text('name')->required()->maxLength(32, '最多输入32个字符');
$form->mobile('mobile')->width(4)->rules('required|regex:/^1[3456789]\d{9}$/')->required(); $form->mobile('mobile')->required()->rules(function (Form $form) {
$form->mobile('mobile')->width(4)->required()->rules(function (Form $form) { // 如果不是编辑状态,则添加字段唯一验证
// 如果不是编辑状态,则添加字段唯一验证 if (! $id = $form->model()->id) {
if (! $id = $form->model()->id) { return 'unique:App\Models\DoctorModel,mobile';
return 'unique:App\Models\DoctorModel,mobile'; }
} });
}); $form->text('id_card')->required();
$form->text('license_no')->width(4)->required()->maxLength(30, '最多输入30个字符'); $form->text('license_no')->required()->maxLength(30, '最多输入30个字符');
$form->image('license_no_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->text('license_no_period');
$form->text('license_no_period')->width(4); $form->text('online_hospital_name')->required()->maxLength(128, '最多输入128个字符');
$form->image('physician_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->text('department')->required()->required()->maxLength(128, '最多输入128个字符');
$form->image('id_card_front_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->text('doctor_title')->required()->maxLength(64, '最多输入64个字符');
$form->image('id_card_back_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->textarea('be_good_at')->required();
$form->text('online_hospital_name')->width(4)->required()->maxLength(128, '最多输入128个字符'); $form->textarea('introduction')->required();
$form->text('department')->width(4)->required()->required()->maxLength(128, '最多输入128个字符'); $form->display('user_id');
$form->text('doctor_title')->width(4)->required()->maxLength(64, '最多输入64个字符'); $form->switch('status');
$form->textarea('be_good_at')->width(4)->required();
$form->textarea('introduction')->width(4)->required();
$form->image('signed_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4);
$form->display('user_id')->width(4);
$form->switch('status')->width(4);
$form->display('created_at')->width(4); $form->display('created_at');
$form->display('updated_at')->width(4); $form->display('updated_at');
});
$form->column(6, function (Form $form) {
$form->image('license_no_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('physician_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('id_card_front_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('id_card_back_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('signed_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false);
});
// 右上角按钮控制 // 右上角按钮控制
$form->disableDeleteButton(); // 去掉删除按钮 $form->disableDeleteButton(); // 去掉删除按钮
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment