Commit cbb6a44b by lujunyi

医师布局

parent 62c756e0
......@@ -106,33 +106,36 @@ protected function detail($id)
protected function form()
{
return Form::make(new DoctorRepository(), function (Form $form) {
$form->display('id')->width(4);
$form->text('name')->width(4)->required()->maxLength(32, '最多输入32个字符');
$form->text('id_card')->width(4)->required();
$form->mobile('mobile')->width(4)->rules('required|regex:/^1[3456789]\d{9}$/')->required();
$form->mobile('mobile')->width(4)->required()->rules(function (Form $form) {
// 如果不是编辑状态,则添加字段唯一验证
if (! $id = $form->model()->id) {
return 'unique:App\Models\DoctorModel,mobile';
}
});
$form->text('license_no')->width(4)->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')->width(4);
$form->image('physician_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required();
$form->image('id_card_front_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required();
$form->image('id_card_back_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required();
$form->text('online_hospital_name')->width(4)->required()->maxLength(128, '最多输入128个字符');
$form->text('department')->width(4)->required()->required()->maxLength(128, '最多输入128个字符');
$form->text('doctor_title')->width(4)->required()->maxLength(64, '最多输入64个字符');
$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->column(6, function (Form $form) {
$form->display('id');
$form->text('name')->required()->maxLength(32, '最多输入32个字符');
$form->mobile('mobile')->required()->rules(function (Form $form) {
// 如果不是编辑状态,则添加字段唯一验证
if (! $id = $form->model()->id) {
return 'unique:App\Models\DoctorModel,mobile';
}
});
$form->text('id_card')->required();
$form->text('license_no')->required()->maxLength(30, '最多输入30个字符');
$form->text('license_no_period');
$form->text('online_hospital_name')->required()->maxLength(128, '最多输入128个字符');
$form->text('department')->required()->required()->maxLength(128, '最多输入128个字符');
$form->text('doctor_title')->required()->maxLength(64, '最多输入64个字符');
$form->textarea('be_good_at')->required();
$form->textarea('introduction')->required();
$form->display('user_id');
$form->switch('status');
$form->display('created_at')->width(4);
$form->display('updated_at')->width(4);
$form->display('created_at');
$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(); // 去掉删除按钮
......
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