Swdz-WangHaiJun 4 năm trước cách đây
mục cha
commit
28bdf6eda1

+ 3 - 4
app/Admin/Controllers/VaccinesManagement/VaccinesController.php

xqd xqd
@@ -58,7 +58,7 @@ class VaccinesController extends AdminController
             return new Table(['ID', '库存' ,'机构名称'], $org);
         });
 
-        $grid->column('stock','库存');
+        $grid->column('kc','库存');
         $grid->column('states','状态')->switch($states);
         $grid->column('created_at', __('创建时间'));
         $grid->column('updated_at', __('更新时间'));
@@ -140,13 +140,12 @@ class VaccinesController extends AdminController
         $form->editing(function ($f){
             $f->model()->price /= 100;
         });
+
         $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
         $form->text('name', __('名称'))->rules('required|min:3|max:255',['required'=>'请填写名称','min'=>'名称不能少于3个字符!','max'=>'名称长度过长!']);
-//        $form->text('introduction','简介')->rules('required',['require'=>'请填写疫苗简介!' ]);
         $form->text('price', __('价格'));
-        $form->text('remark', __('备注'))->rules('required',['required'=>'请填写备注!']);;
+        $form->text('remark', __('备注'));
         $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
-        $form->number('stock','库存');
         $states = [
             'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
             'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],

+ 4 - 20
app/Community/Controllers/ApiController.php

xqd xqd xqd xqd
@@ -428,7 +428,7 @@ class ApiController extends Controller
     }
 
     //获取月排班
-    public function get_month_schedule()
+    public function getMonthSchedule()
     {
         $date = request('date');
         $org_id = intval(request('org_id'));
@@ -460,10 +460,7 @@ class ApiController extends Controller
                 ['status' => false, 'type' => 3, 'start' => $serviceConfig[3]['nightStartTime'], 'end' => $serviceConfig[3]['nightEndTime']],
             ];
         }
-//
-//            self::baseMonthSchedule($month_day,$baseData);
-//            return [];
-//        }
+
 
         for ($i = 1; $i <= $month_day; $i++) {
             $week = date('N', $start_time + ($i - 1) * 86400);
@@ -499,14 +496,7 @@ class ApiController extends Controller
                     }
 //
                 }
-                //覆盖自定义排班
-//                echo '医生id '.$docter_id.' 机构id '.$org_id.' 周几'.$week.' 日期 '.$scheduleDate.'<br>';
-//                $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'schedule_type'=>$sType])->get()->GroupBy('type')->toArray();
-//                if(!empty($self)){
-//                    foreach($self as $k=>$sf){
-//                        $newBase[$k-1]['status'] = true;
-//                    }
-//                }
+
                 $scheduleList[$i - 1] = [
                     'schedulelingList' => $newBase,
                     'date' => $i,
@@ -532,13 +522,7 @@ class ApiController extends Controller
                         if ($org_id == $idSum) $newBase[$type - 1]['status'] = true;
                     }
                 }
-                //覆盖自定义排班
-//                $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'schedule_type'=>$sType,'organization_id'=>$org_id])->get(['type'])->GroupBy('type')->toArray();
-//                if(!empty($self)){
-//                    foreach($self as $k=>$sf){
-//                        $newBase[$k-1]['status'] = true;
-//                    }
-//                }
+
                 $scheduleList[$i - 1] = [
                     'schedulelingList' => $newBase,
                     'date' => $i,

+ 3 - 2
app/Community/Controllers/Vaccine/OrganizationVaccineController.php

xqd
@@ -37,8 +37,9 @@ class OrganizationVaccineController extends AdminController
 
 
         $grid->filter(function ($fliter){
-            $fliter->equal('organization.name','机构')->select(Organization::pluck('name','id'));
-            $fliter->euqal('vaccine.name','疫苗')->select(Vaccine::pluck('name','id'));
+//            $fliter->equal('organization.name','机构')->select(Organization::pluck('name','id'));
+//            $fliter->equal('organization.name','机构')->select(Organization::pluck('name','id'));
+            $fliter->equal('vaccine.name','疫苗')->select(Vaccine::pluck('name','id'));
         });
 
 

+ 1 - 4
app/Community/routes.php

xqd
@@ -55,17 +55,14 @@ Route::get('/api/set_week_schedule', 'ApiController@setWeekSchedule');
 Route::get('/api/set_day_schedule', 'ApiController@setDaySchedule');
 Route::get('/api/get_week_chedule', 'ApiController@getWeekSchedule');
 Route::get('/api/set_month_schedule', 'ApiController@setmonthScheduel');
-Route::get('/api/get_month_schedule', 'ApiController@get_month_schedule');
+Route::get('/api/get_month_schedule', 'ApiController@getMonthSchedule');
 Route::get('/api/get_docter_setting', 'ApiController@getDocterSetting');
 Route::get('/api/update_docter_setting', 'ApiController@updateDocterSetting');
 Route::get('/api/docter_setting', 'ApiController@updateDocterSetting');
 Route::get('/api/self_schedule', 'ApiController@setSelfSchedule');
 Route::get('/api/getScheduleInfo', 'ApiController@getScheduleInfo');
 
-Route::get('/getComSchedule', 'ApiController@getComSchedule');
 Route::get('/getChatOrder', 'ApiController@get_chat_order');
-Route::get('/setDocChedule', 'ApiController@setDocChedule');
-
 
 
 

+ 7 - 0
app/Models/Vaccines.php

xqd xqd
@@ -5,6 +5,7 @@ namespace App\Models;
 
 class Vaccines extends BaseModel
 {
+    protected $appends = ['kc'];
     //
     public static $_post_type = [
         1=>"Ⅰ类疫苗",
@@ -13,6 +14,12 @@ class Vaccines extends BaseModel
     //导入格式
     protected $fillable = ['type','price',"name","remark","supplier",'stock','states'];
 
+    public function getKcAttribute()
+    {
+        $id = $this->id;
+        return OrganizationVaccine::where(['vaccine_id'=>$id])->sum('stock');
+    }
+
     public function organization()
     {
         return $this->belongsToMany(Organization::class,'org_id');

+ 1 - 1
resources/views/cdms/schedule.blade.php

xqd
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>scheduling</title><link href="static/css/app.b0dfcc84.css" rel="preload" as="style"><link href="static/css/chunk-vendors.767f701c.css" rel="preload" as="style"><link href="static/js/app.d9e22020.js" rel="preload" as="script"><link href="static/js/chunk-vendors.feab90c7.js" rel="preload" as="script"><link href="static/css/chunk-vendors.767f701c.css" rel="stylesheet"><link href="static/css/app.b0dfcc84.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but scheduling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.feab90c7.js"></script><script src="static/js/app.d9e22020.js"></script></body></html>
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>scheduling</title><link href="static/css/app.b0dfcc84.css" rel="preload" as="style"><link href="static/css/chunk-vendors.767f701c.css" rel="preload" as="style"><link href="static/js/app.ae6b80a5.js" rel="preload" as="script"><link href="static/js/chunk-vendors.feab90c7.js" rel="preload" as="script"><link href="static/css/chunk-vendors.767f701c.css" rel="stylesheet"><link href="static/css/app.b0dfcc84.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but scheduling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.feab90c7.js"></script><script src="static/js/app.ae6b80a5.js"></script></body></html>