michealwoo 2 jaren geleden
bovenliggende
commit
6768856ad9

+ 3 - 4
app/Admin/Controllers/LeaveController.php

xqd xqd
@@ -24,7 +24,7 @@ class LeaveController extends AdminController
             $grid->column('reason');
             $grid->column('start_time');
             $grid->column('end_time');
-
+            $grid->disableEditButton();
             $grid->filter(function (Grid\Filter $filter) {
                 $filter->equal('id');
         
@@ -42,13 +42,12 @@ class LeaveController extends AdminController
     protected function detail($id)
     {
         return Show::make($id, new Leave(), function (Show $show) {
-            $show->field('id');
-            $show->field('student_id');
+            $show->field('student_id')->using(config('map.students'));
             $show->field('reason');
+            $show->field('leave_type')->using(config('map.leave_type'));
             $show->field('start_time');
             $show->field('end_time');
             $show->field('created_at');
-            $show->field('updated_at');
         });
     }
 

+ 18 - 10
app/Admin/Controllers/MedicationEntrustmentController.php

xqd
@@ -44,16 +44,24 @@ class MedicationEntrustmentController extends AdminController
     protected function detail($id)
     {
         return Show::make($id, new MedicationEntrustment(), function (Show $show) {
-            $show->field('id');
-            $show->field('student_id');
-            $show->field('reason');
-            $show->field('use_time');
-            $show->field('detail');
-            $show->field('desc');
-            $show->field('photos');
-            $show->field('sign');
-            $show->field('created_at');
-            $show->field('updated_at');
+            $show->row(function (Show\Row $show) {
+                $show->field('content','用药委托详情')
+                    ->width(8)
+                    ->unescape()
+                    ->as(function () {
+                    $html = '';
+                    $html .= '<div style="text-align:left">';
+                    $html .= '<div style="margin-top:5px">用药对象:' . config('map.students')[$this->student_id] . '</div>';
+                    $html .= '<div style="margin-top:5px">用药时间:' . $this->use_time . '</div>';
+                    $html .= '<div style="margin-top:5px">用药明细:' . $this->detail . '</div>';
+                    $html .= '<div style="margin-top:5px">用药说明:' . $this->desc . '</div>';
+                    $html .= '<div style="margin-top:5px">接回照片:</div>';
+                    $html .= '<img data-action="preview-img" src="' . $this->photos . '" style="height:50px;width:50px;cursor:pointer;margin-right:10px;" class="img img-thumbnail">';
+                    $html .= '<div style="margin-top:5px">签名:' . $this->sign . '</div>';
+                    $html .= '</div>';
+                    return $html;
+                });
+            });
         });
     }
 

+ 1 - 1
app/Admin/Controllers/NoticeController.php

xqd
@@ -39,7 +39,7 @@ class NoticeController extends AdminController
     protected function detail($id)
     {
         return Show::make($id, new Notice(), function (Show $show) {
-              $show->row(function (Show\Row $show) {
+            $show->row(function (Show\Row $show) {
                 $show->width(12)->field('content');
                 $show->width(12)->field('teacher_id','通知对象')->using(config('map.teachers'));
             });