Commit a3f1ccc5 by 赵增煜
parents 4b0146c2 b0d2080f
......@@ -4,10 +4,8 @@
use App\Admin\Repositories\DoctorCorrectionRepository;
use App\Models\DoctorCorrectionModel;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Show;
// 医师纠错
class DoctorCorrectionController extends AdminController
......@@ -46,50 +44,4 @@ protected function grid()
$grid->disableBatchActions(); // 禁用批量操作
});
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new DoctorCorrectionRepository(), function (Show $show) {
$show->field('id');
$show->field('doctor_id');
$show->field('doctor_name');
$show->field('is_handle');
$show->field('content');
$show->field('created_at');
$show->field('updated_at');
$show->panel()->tools(function ($tools) {
$tools->disableDelete(); // 禁止删除按钮
});
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new DoctorCorrectionRepository(), function (Form $form) {
$form->display('id')->width(4);
// $form->text('doctor_id')->readonly()->width(4);
$form->text('doctor_name')->readonly()->width(4);
$form->textarea('content')->readonly()->width(4);
$form->switch('is_handle')->width(4);
$form->display('created_at')->width(4);
$form->display('updated_at')->width(4);
// 右上角按钮控制
$form->disableDeleteButton(); // 去掉删除按钮
$form->disableViewButton(); // 去掉跳转详情页按钮
});
}
}
......@@ -129,7 +129,7 @@ protected function form()
$form->text('approval_no')->width(4)->required()->maxLength(64, '最多输入64个字符');
$array = range(1, 10);
$limitOption = array_combine($array, $array);
$form->select('limit_buy_7')->placeholder('请选择限购数量')->width(4)->options($limitOption)->help('限购数量');
$form->select('limit_buy_7')->placeholder('请选择限购数量')->width(4)->options($limitOption)->help('限购数量')->required();
$form->switch('is_rx')->width(4);
$form->text('standard_code')->width(4)->required()->rules(function (Form $form) {
// 如果不是编辑状态,则添加字段唯一验证
......
......@@ -4,10 +4,8 @@
use App\Admin\Repositories\PharmacyCorrectionRepository;
use App\Models\PharmacyCorrectionModel;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Show;
// 药店-纠错
class PharmacyCorrectionController extends AdminController
......@@ -46,50 +44,4 @@ protected function grid()
$grid->disableBatchActions(); // 禁用批量操作
});
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new PharmacyCorrectionRepository(), function (Show $show) {
$show->field('id');
$show->field('pharmacy_id');
$show->field('pharmacy_name');
$show->field('is_handle');
$show->field('content');
$show->field('created_at');
$show->field('updated_at');
$show->panel()->tools(function ($tools) {
$tools->disableDelete(); // 禁止删除按钮
});
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new PharmacyCorrectionRepository(), function (Form $form) {
$form->display('id')->width(4);
// $form->text('pharmacy_id')->width(4);
$form->text('pharmacy_name')->readonly()->width(4);
$form->text('content')->readonly()->width(4);
$form->switch('is_handle')->width(4);
$form->display('created_at')->width(4);
$form->display('updated_at')->width(4);
// 右上角按钮控制
$form->disableDeleteButton(); // 去掉删除按钮
$form->disableViewButton(); // 去掉跳转详情页按钮
});
}
}
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