diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentController.php index 6f459ed..dddaee3 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentController.php @@ -23,8 +23,10 @@ class DepartmentController extends Controller { $userid = $request->get('userid');//中间件产生的参数 $group = $request->get('role');//中间件产生的参数 + $is_all = $request->get('is_all'); + $is_all=isset($is_all)?$is_all:false; $service = new DepartmentService(); - return $service->GetEnableList(['userid'=>$userid,'group'=>$group]); + return $service->GetEnableList(['userid'=>$userid,'group'=>$group],$is_all); } //保存科室信息 diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentResourceController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentResourceController.php index 817e774..cda7aa8 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentResourceController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/DepartmentResourceController.php @@ -27,11 +27,15 @@ class DepartmentResourceController extends Controller public function GetEnableList(Request $request) { $userid = $request->get('userid');//中间件产生的参数 + $res_department_id=$request->get('department_id'); $userInfo = DB::table('users')->where(['id' => $userid])->first(); - if(!isset($userInfo->department_id)){ + if(!isset($userInfo->department_id) and !isset($res_department_id)){ return \Yz::echoError1('科室信息不存在'); } - $resource=DB::table('s_department_resources')->where(['department_id'=>$userInfo->department_id,'department_resources_status'=>1,'is_del'=>0])->get(); + + if(isset($userInfo->department_id)) $department_id=$userInfo->department_id; + if(isset($res_department_id)) $department_id=$res_department_id; + $resource=DB::table('s_department_resources')->where(['department_id'=>$department_id,'department_resources_status'=>1,'is_del'=>0])->get(); if(count($resource)>0){ return \Yz::Return(true, '操作成功',$resource); }else{ diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/EntrustController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/EntrustController.php new file mode 100644 index 0000000..477516a --- /dev/null +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/EntrustController.php @@ -0,0 +1,74 @@ +leftJoin('s_period','s_list.reservation_time','=','s_period.id') + ->leftJoin('s_department_resources','s_list.reservation_sources','=','s_department_resources.id') + ->select('s_list.*','s_period.period_begin_time','s_period.period_end_time','s_department_resources.department_resources_name'); + if ($searchInfo['dateRange']!=null and count($searchInfo['dateRange']) == 2) { + $list = $list->where(function ($q) use($searchInfo) { + $q->whereBetween('s_list.entrust_date', $searchInfo['dateRange']) + ->orWhereBetween('s_list.reservation_date', $searchInfo['dateRange']); + }); + } + if(isset($searchInfo['department_id'])){ + $department = DB::table('s_department')->where(['id' => $searchInfo['department_id'],'is_del'=>0])->first(); + $list=$list->where(['RISRAcceptDeptCode'=>$department->department_number]); + } + if (isset($searchInfo['list_status'])) { + $list = $list->where('s_list.list_status', $searchInfo['list_status']); + } + if (isset($searchInfo['patient_type'])) { + $list = $list->where('s_list.patient_type', $searchInfo['patient_type']); + } + if (!empty($searchInfo['resources'])) { + $list = $list->whereIn('s_list.reservation_sources', $searchInfo['resources']); + } + if (isset($searchInfo['services_group'])) { + $list = $list->whereRaw("FIND_IN_SET({$searchInfo['services_group']}, s_list.services_group)"); + } + if (isset($searchInfo['reg_num'])) { + $list = $list->where('s_list.reg_num', $searchInfo['reg_num']); + } + if (isset($searchInfo['user_name'])) { + $list = $list->where('s_list.user_name', 'like','%'.$searchInfo['user_name'].'%'); + } + if (isset($searchInfo['doctor'])) { + $list = $list->where('s_list.docotr', 'like','%'.$searchInfo['doctor'].'%'); + } + if (isset($searchInfo['apply_department'])) { + $list = $list->where('s_list.reservation_department', 'like','%'.$searchInfo['apply_department'].'%'); + } + + $count = $list; + $count = $count->count(); + $list=$list->where(['s_list.is_del'=>0,'s_list.is_nullify'=>0])->orderBy('id', 'desc')->limit($pageSize)->skip(($page - 1) * $pageSize) // 跳过前9999条记录 + ->take($pageSize)->get(); + + //匹配设备(服务组) + $devices = DB::table('s_devices')->get(); + foreach ($list as $key => $value) { + $list[$key]->age = Tools::calculateAgeText($value->user_brithday); + $list[$key]->devices = []; + $array_device_id = explode(",", $value->services_group); + foreach ($devices as $k => $v) { + if (in_array($v->id, $array_device_id)) { + $list[$key]->devices[] = $v; + } + } + } + return \Yz::Return(true,'查询完成',['list'=>$list,'count'=>$count]); + } +} diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php index ef32112..1aabc20 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php @@ -173,20 +173,23 @@ class PlanListController extends Controller $page = request('page'); $pageSize = request('pageSize'); $department_id = 0; + $department_info=false; $list = DB::table('s_source_roster_detail') ->leftJoin('s_department_resources', 's_source_roster_detail.resources_id', '=', 's_department_resources.id') // ->leftJoin('s_devices', 's_source_roster_detail.device_id', '=', 's_devices.id') ->leftJoin('s_period', 's_source_roster_detail.period_id', '=', 's_period.id') ->select('s_source_roster_detail.*', 's_department_resources.department_resources_name', 's_period.period_name') ->where(['s_source_roster_detail.is_del' => 0]); - if ($group == 1) {//如果是管理员 + if (!empty($searchInfo['department_id'])) {//以前判断的是管理员group==1 改为 (任何角色都能查看了) if (!empty($searchInfo['department_id'])) { + $department_info=DB::table('s_department')->where(['id' => $searchInfo['department_id']])->first(); $list = $list->where('s_source_roster_detail.department_id', $searchInfo['department_id']); } } else { $userInfo = DB::table('users')->where(['id' => $userid])->get(); $department_id = $userInfo[0]->department_id; + $department_info=DB::table('s_department')->where(['id' => $department_id])->first(); $list = $list->where(['s_source_roster_detail.department_id' => $department_id]); } if (!empty($searchInfo['resources_id'])) { @@ -212,6 +215,7 @@ class PlanListController extends Controller ->take($pageSize)->get(); $ids = []; foreach ($list as $key => $value) { + $list[$key]->department_name = !!$department_info?$department_info->department_name:'' ; $list[$key]->countsInfo = []; $ids[] = $value->id; } diff --git a/Laravel/app/Services/Admin/YeWu/DepartmentService.php b/Laravel/app/Services/Admin/YeWu/DepartmentService.php index 3f5c38a..5aacda5 100644 --- a/Laravel/app/Services/Admin/YeWu/DepartmentService.php +++ b/Laravel/app/Services/Admin/YeWu/DepartmentService.php @@ -25,10 +25,10 @@ class DepartmentService } return \Yz::Return(true, '查询成功', ['list'=>$l,'count'=>$c]); } - public function GetEnableList($arr) + public function GetEnableList($arr,$is_all=false) { $list=DB::table('s_department'); - if($arr['group']!=1){ + if(!in_array($arr['group'],[1,5]) and $is_all===false){ $userInfo = DB::table('users')->where(['id'=>$arr['userid']])->get(); $department_id=$userInfo[0]->department_id; $list= $list->where(['id'=>$department_id]); diff --git a/Laravel/routes/api.php b/Laravel/routes/api.php index 2f7309a..df88aa7 100644 --- a/Laravel/routes/api.php +++ b/Laravel/routes/api.php @@ -114,6 +114,7 @@ Route::group(['middleware'=>['log']],function () { Route::post('admin/NearestEnablePlanDate','App\Http\Controllers\API\Admin\YeWu\PlanListController@NearestEnablePlanDate');//获取最近可用日期 Route::post('testSendMsg','App\Http\Controllers\TestSendMsgController@SendMsg');//测试发送短信 Route::post('admin/GetPersonYuYueList','App\Http\Controllers\API\Admin\YeWu\WorkMainController@GetPersonYuYueList');//医生获取某人全部预约记录 + Route::post('admin/EntrustGetList','App\Http\Controllers\API\Admin\YeWu\EntrustController@GetList');//获取医嘱列表,非主工作列表 }); diff --git a/YiJi-admin/src/api/api.js b/YiJi-admin/src/api/api.js index 3ad5034..c26d245 100644 --- a/YiJi-admin/src/api/api.js +++ b/YiJi-admin/src/api/api.js @@ -321,4 +321,8 @@ export const SignIn = (data = {}) => { //取消签到 export const CancelSign = (data = {}) => { return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/CancelSign', data: data }) +} +//获取医嘱列表,非主工作列表 +export const EntrustGetList = (data = {}) => { + return axios({ url: import.meta.env.VITE_APP_API + 'admin/EntrustGetList', data: data }) } \ No newline at end of file diff --git a/YiJi-admin/src/router/index.js b/YiJi-admin/src/router/index.js index ab9f29a..f82eeb2 100644 --- a/YiJi-admin/src/router/index.js +++ b/YiJi-admin/src/router/index.js @@ -164,12 +164,19 @@ const router = createRouter({ title: '病区管理' } },{ - path: '/yewu/EntrustList', + path: '/info/EntrustList', name: 'EntrustList', - component: () => import('../views/YeWu/EntrustList.vue'), + component: () => import('../views/Info/EntrustList.vue'), meta: { title: '医嘱信息列表' } + },{ + path: '/info/PlanList', + name: 'InfoPlanList', + component: () => import('../views/Info/PlanList.vue'), + meta: { + title: '资源信息列表' + } }] }, diff --git a/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue b/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue index f652f06..9ed51cc 100644 --- a/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue +++ b/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue @@ -703,13 +703,13 @@ } } - if (columnIndex === 3) { - if(bb_countRowspan>1){ - return {rowspan:bb_countRowspan,colspan:1} - }else{ - return {rowspan:0,colspan:0} - } - } + // if (columnIndex === 3) { + // if(bb_countRowspan>1){ + // return {rowspan:bb_countRowspan,colspan:1} + // }else{ + // return {rowspan:0,colspan:0} + // } + // } } onMounted(() => { GetList() diff --git a/YiJi-admin/src/views/YeWu/EntrustList.vue b/YiJi-admin/src/views/Info/EntrustList.vue similarity index 65% rename from YiJi-admin/src/views/YeWu/EntrustList.vue rename to YiJi-admin/src/views/Info/EntrustList.vue index 6cbf656..02b8482 100644 --- a/YiJi-admin/src/views/YeWu/EntrustList.vue +++ b/YiJi-admin/src/views/Info/EntrustList.vue @@ -16,32 +16,39 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,17 +61,16 @@ style="width: 200px;margin-left: 8px;" /> - + 查询 - + - - - + + + @@ -109,6 +115,18 @@ v-if="scope.row.period_begin_time && scope.row.period_end_time ">{{scope.row.period_begin_time.substring(0, 5)}}~{{scope.row.period_end_time.substring(0, 5)}} + + + + + - - - - +