michealwoo 2 yıl önce
ebeveyn
işleme
d438318eeb

+ 116 - 17
app/Admin/Controllers/DailyCareReportController.php

@@ -7,6 +7,7 @@ use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
 use Dcat\Admin\Show;
 use Dcat\Admin\Http\Controllers\AdminController;
 use Dcat\Admin\Http\Controllers\AdminController;
+use Dcat\Admin\Form\NestedForm;
 
 
 class DailyCareReportController extends AdminController
 class DailyCareReportController extends AdminController
 {
 {
@@ -21,7 +22,7 @@ class DailyCareReportController extends AdminController
             $grid->column('student_id');
             $grid->column('student_id');
             $grid->column('log_type')->using(config('map.log_type'));
             $grid->column('log_type')->using(config('map.log_type'));
             $grid->column('situation');
             $grid->column('situation');
-            $grid->column('log_user_id');
+            $grid->column('log_user_id')->using(config('map.log_user_ids'));
             $grid->filter(function (Grid\Filter $filter) {
             $grid->filter(function (Grid\Filter $filter) {
                 $filter->equal('id');
                 $filter->equal('id');
         
         
@@ -68,25 +69,123 @@ class DailyCareReportController extends AdminController
     protected function form()
     protected function form()
     {
     {
         return Form::make(new DailyCareReport(), function (Form $form) {
         return Form::make(new DailyCareReport(), function (Form $form) {
-            $form->display('id');
-            $form->text('student_id');
+            $form->row(function (Form\Row $row) {
+                $row->width(6)->select('student_id')->options(config('map.students'))->required();
+            });
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('diet_json', function (NestedForm $table) {
+                    $table->text('eat','饮食');
+                    $table->datetime('time','时间');
+                    $table->text('volume','饮食量');
+                    $table->textarea('remark','特别说明');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('drink_json', function (NestedForm $table) {
+                    $table->text('drink','饮品')->required();
+                    $table->datetime('time','时间');
+                    $table->text('volume','饮用总量');
+                    $table->textarea('remark','特别说明');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('nurse_json', function (NestedForm $table) {
+                    $table->text('nurse','喂奶');
+                    $table->datetime('time','时间');
+                    $table->text('volume','饮用量');
+                    $table->textarea('remark','特别说明');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('defecation_json', function (NestedForm $table) {
+                    $table->text('defecation_type','排便类型');
+                    $table->datetime('time','时间');
+                    $table->text('status','状态');
+                    $table->text('color','颜色');
+                    $table->text('volume','量');
+                    $table->text('red_ass','红屁股');
+                    $table->radio('is_acerbity','是否发酸')->options([1=>'是',0=>'否']);
+                    $table->image('pic','照片');
+                    $table->radio('potty_training','如厕训练')
+                    ->when(1,function(NestedForm $table){
+                      $table->textarea('remark','如厕训练说明');
+                    })
+                    ->options([1=>'是',0=>'否']);
+                    //$table->textarea('remark','如厕训练说明');
+                });
+            });
             $form->text('log_type');
             $form->text('log_type');
             $form->text('situation');
             $form->text('situation');
             $form->text('log_user_id');
             $form->text('log_user_id');
-            $form->text('diet_json');
-            $form->text('drink_json');
-            $form->text('nurse_json');
-            $form->text('defecation_json');
-            $form->text('change_clothes_json');
-            $form->text('emotion_json');
-            $form->text('sleep_json');
-            $form->text('clean_json');
-            $form->text('health_json');
-            $form->text('medication_json');
-            $form->text('temperature_json');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('change_clothes_json', function (NestedForm $table) {
+                    $table->text('is_normal','是否正常');
+                    $table->datetime('time','时间');
+                    $table->textarea('red_ass','红屁股');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('emotion_json', function (NestedForm $table) {
+                    $table->text('emotion','情绪');
+                    $table->datetime('time','时间');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('sleep_json', function (NestedForm $table) {
+                    $table->text('sleep_status','睡眠状态');
+                    $table->datetime('time','时间');
+                });
+            });
+            
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('clean_json', function (NestedForm $table) {
+                    $table->text('mouth_clean','口腔清洁');
+                    $table->datetime('mouth_clean_time','口腔清洁时间');
+                    $table->devider();
+                    $table->text('nasal_clean_color','鼻涕清洁颜色');
+                    $table->text('nasal_clean_shape','鼻涕清洁形状');
+                    $table->text('nasal_clean_volume','鼻涕清洁量');
+                    $table->datetime('nasal_clean_time','鼻涕清洁时间');
+                    $table->datetime('time','时间');
+                    $table->devider();
+                    $table->radio('is_wash_head','是否洗头')->options([1=>'是',0=>'否']);
+                    $table->select('is_change_diapers','更换尿布')->options([1=>'是',0=>'否']);
+                    $table->select('is_change_clothes','更换衣物')->options([1=>'是',0=>'否']);
+                    $table->datetime('time','时间');
+                    $table->datetime('wash_ass_time','洗屁屁时间');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('health_json', function (NestedForm $table) {
+                    $table->datetime('time','时间');
+                    $table->select('symptom','症状')->options([1=>'是',0=>'否']);
+                    $table->textarea('remark','其他说明');
+                    
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('medication_json', function (NestedForm $table) {
+                    $table->datetime('time','时间');
+                    $table->textarea('remark','其他说明');
+                });
+            });
+
+            $form->row(function (Form\Row $row) {
+                $row->width(12)->table('temperature_json', function (NestedForm $table) {
+                    $table->datetime('time','时间');
+                    $table->text('temperature','温度');
+                    $table->select('temperature_type','体温种类')->options([1=>'摄氏度',0=>'华氏度']);
+                });
+            });
+
         });
         });
     }
     }
 }
 }

+ 1 - 1
config/admin.php

@@ -313,7 +313,7 @@ return [
     */
     */
     'layout' => [
     'layout' => [
         // default, blue, blue-light, green
         // default, blue, blue-light, green
-        'color' => 'deep_blue',
+        'color' => 'blue',
 
 
         // sidebar-separate
         // sidebar-separate
         'body_class' => [],
         'body_class' => [],

+ 6 - 1
config/map.php

@@ -30,6 +30,11 @@ return [
   ],
   ],
   'log_type'=>[
   'log_type'=>[
     1=>'日常观察'
     1=>'日常观察'
-  ]
+  ],
+  'log_user_ids'=>[
+    1=>'芳芳',
+    2=>'小爱',
+    3=>'小李'
+  ],
 
 
 ];
 ];