Commit 62c756e0 by lujunyi

药店手机验证

parent fb159970
......@@ -139,25 +139,28 @@ protected function detail($id)
protected function form()
{
return Form::make(new PharmacistRepository(), function (Form $form) {
$form->display('id')->width(4);
$form->text('name')->width(4)->required()->maxLength(32, '最多输入32个字符');
$form->text('id_card')->width(4)->required()->maxLength(18, '最多输入18个字符');
$form->text('license_number')->width(4)->required()->maxLength(32, '最多输入32个字符');
$form->mobile('mobile')->width(4)->required()->rules(function (Form $form) {
// 如果不是编辑状态,则添加字段唯一验证
if (! $id = $form->model()->id) {
return 'unique:App\Models\PharmacistModel,mobile';
}
$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\PharmacistModel,mobile';
}
});
$form->text('id_card')->required()->maxLength(18, '最多输入18个字符');
$form->text('license_number')->required()->maxLength(32, '最多输入32个字符');
$form->date('practicing_license_expired_time')->required();
$form->select('pharmacy_id')->options(PharmacyModel::all()->pluck('name', 'id'))->required();
$form->switch('status');
$form->display('created_at');
$form->display('updated_at');
});
$form->column(6, function (Form $form) {
$form->image('practicing_license')->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('signed_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false);
});
$form->image('practicing_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required();
$form->date('practicing_license_expired_time')->width(4)->required();
$form->image('physician_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required();
$form->image('signed_pic')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4);
$form->select('pharmacy_id')->options(PharmacyModel::all()->pluck('name', 'id'))->width(4)->required();
$form->switch('status')->width(4);
$form->display('created_at')->width(4);
$form->display('updated_at')->width(4);
// 右上角按钮控制
$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