|
@@ -30,27 +30,26 @@ class VaccinesController extends AdminController
|
|
$grid = new Grid(new Vaccines());
|
|
$grid = new Grid(new Vaccines());
|
|
$grid->model()->orderBy('id','desc');
|
|
$grid->model()->orderBy('id','desc');
|
|
$grid->column('id', __('Id'));
|
|
$grid->column('id', __('Id'));
|
|
- $grid->column('type', '类型')->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
|
|
|
|
|
|
+// $grid->column('type', '类型')->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
|
|
$grid->column('name', __('名称'));
|
|
$grid->column('name', __('名称'));
|
|
$states = [
|
|
$states = [
|
|
'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],
|
|
'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],
|
|
'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
|
|
'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
|
|
];
|
|
];
|
|
|
|
|
|
- $grid->column('organizations', '机构库存')->display(function (){
|
|
|
|
|
|
+ $grid->column('organizations', '机构')->display(function (){
|
|
return '点击查看';
|
|
return '点击查看';
|
|
})->modal('机构库存', function ($model) {
|
|
})->modal('机构库存', function ($model) {
|
|
$org = $model->organizationvaccines()->get()->map(function ($comment) {
|
|
$org = $model->organizationvaccines()->get()->map(function ($comment) {
|
|
- return $comment->only(['org_id','vaccine_id','stock']);
|
|
|
|
|
|
+ return $comment->only(['org_id', 'stock']);
|
|
});
|
|
});
|
|
$org = $org->toArray();
|
|
$org = $org->toArray();
|
|
for($i=0;$i<count($org);$i++)
|
|
for($i=0;$i<count($org);$i++)
|
|
{
|
|
{
|
|
$id = $org[$i]['org_id'];
|
|
$id = $org[$i]['org_id'];
|
|
- $org[$i]['vaccine_id'] = $this->name;
|
|
|
|
$org[$i]['org_name'] = Organization::where('id',$id)->value('name');
|
|
$org[$i]['org_name'] = Organization::where('id',$id)->value('name');
|
|
}
|
|
}
|
|
- return new Table(['ID','疫苗','库存','机构名称'], $org);
|
|
|
|
|
|
+ return new Table(['ID', '库存' ,'机构名称'], $org);
|
|
});
|
|
});
|
|
|
|
|
|
$grid->column('kc','库存');
|
|
$grid->column('kc','库存');
|
|
@@ -110,12 +109,12 @@ class VaccinesController extends AdminController
|
|
$show = new Show(Vaccines::findOrFail($id));
|
|
$show = new Show(Vaccines::findOrFail($id));
|
|
|
|
|
|
$show->field('id', __('Id'));
|
|
$show->field('id', __('Id'));
|
|
- $show->field('type', __('分类'))->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
|
|
|
|
- $show->field('introduction','简介');
|
|
|
|
- $show->field('price', __('价钱'));
|
|
|
|
|
|
+// $show->field('type', __('分类'))->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
|
|
|
|
+// $show->field('introduction','简介');
|
|
|
|
+// $show->field('price', __('价钱'));
|
|
$show->field('name', __('名称'));
|
|
$show->field('name', __('名称'));
|
|
- $show->field('remark', __('备注'));
|
|
|
|
- $show->field('supplier', __('厂家'));
|
|
|
|
|
|
+// $show->field('remark', __('备注'));
|
|
|
|
+// $show->field('supplier', __('厂家'));
|
|
$show->field('created_at', __('创建时间'));
|
|
$show->field('created_at', __('创建时间'));
|
|
$show->field('updated_at', __('更新时间'));
|
|
$show->field('updated_at', __('更新时间'));
|
|
|
|
|
|
@@ -135,11 +134,11 @@ class VaccinesController extends AdminController
|
|
$f->model()->price /= 100;
|
|
$f->model()->price /= 100;
|
|
});
|
|
});
|
|
|
|
|
|
- $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
|
|
|
|
|
|
+// $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
|
|
$form->text('name', __('名称'))->rules('required|min:3|max:255',['required'=>'请填写名称','min'=>'名称不能少于3个字符!','max'=>'名称长度过长!']);
|
|
$form->text('name', __('名称'))->rules('required|min:3|max:255',['required'=>'请填写名称','min'=>'名称不能少于3个字符!','max'=>'名称长度过长!']);
|
|
- $form->text('price', __('价格'));
|
|
|
|
- $form->text('remark', __('备注'));
|
|
|
|
- $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
|
|
|
|
|
|
+// $form->text('price', __('价格'));
|
|
|
|
+// $form->text('remark', __('备注'));
|
|
|
|
+// $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
|
|
$states = [
|
|
$states = [
|
|
'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
|
|
'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
|
|
'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],
|
|
'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],
|