鹿和sa0ChunLuyu 2 weeks ago
parent 92eef83379
commit 1eb37e9c58

@ -43,6 +43,10 @@ public function GetList($searchInfo,$page,$pageSize,$userid=null,$group=null)
if(!empty($searchInfo['only_first_level'])){ if(!empty($searchInfo['only_first_level'])){
$list = $list->where('pid', 0); $list = $list->where('pid', 0);
} }
//只显示参与预约的科室
if(!empty($searchInfo['appointment_enabled'])){
$list = $list->where('appointment_enabled', 1);
}
$c=$list->count(); $c=$list->count();
$l=$list ->orderBy('id','desc')->skip(($page-1)*$pageSize) $l=$list ->orderBy('id','desc')->skip(($page-1)*$pageSize)
->take($pageSize)->get() ; ->take($pageSize)->get() ;

@ -18,7 +18,25 @@ public function GetList($searchInfo,$page,$pageSize){
} }
//获取启用的设备列表 //获取启用的设备列表
public function GetEnableList($hisExecDepts = null){ public function GetEnableList($hisExecDepts = null){
$list=DB::table('s_devices')->where(['is_del'=>0,'status'=>1]); $list = DB::table('s_devices')->where(['s_devices.is_del' => 0, 's_devices.status' => 1]);
// 反查关联诊室和科室状态:必须存在至少一条有效的关联链路
$list->whereExists(function ($query) {
$query->select(DB::raw(1))
->from('s_department_resources_device')
->join('s_department_resources', function ($join) {
$join->on('s_department_resources_device.rsourece_id', '=', 's_department_resources.id')
->where('s_department_resources.is_del', 0)
->where('s_department_resources.department_resources_status', 1);
})
->join('s_department', function ($join) {
$join->on('s_department_resources_device.department_id', '=', 's_department.id')
->where('s_department.is_del', 0)
->where('s_department.department_status', 1)
->where('s_department.appointment_enabled', 1);
})
->whereColumn('s_department_resources_device.device_id', 's_devices.id');
});
if (!empty($hisExecDepts)) { if (!empty($hisExecDepts)) {
$deptCodes = json_decode($hisExecDepts, true); $deptCodes = json_decode($hisExecDepts, true);
@ -27,6 +45,8 @@ public function GetEnableList($hisExecDepts = null){
$deptIds = DB::table('s_department') $deptIds = DB::table('s_department')
->whereIn('department_number', $deptCodes) ->whereIn('department_number', $deptCodes)
->where('is_del', 0) ->where('is_del', 0)
->where('department_status', 1)
->where('appointment_enabled', 1)
->pluck('id') ->pluck('id')
->toArray(); ->toArray();
@ -38,6 +58,8 @@ public function GetEnableList($hisExecDepts = null){
->where('pid', '>', 0); ->where('pid', '>', 0);
}) })
->where('is_del', 0) ->where('is_del', 0)
->where('department_status', 1)
->where('appointment_enabled', 1)
->pluck('id') ->pluck('id')
->toArray(); ->toArray();
@ -49,7 +71,7 @@ public function GetEnableList($hisExecDepts = null){
->pluck('device_id') ->pluck('device_id')
->toArray(); ->toArray();
$list->whereIn('id', $deviceIds); $list->whereIn('s_devices.id', $deviceIds);
} }
} }

@ -41,7 +41,7 @@
<el-table-column type="selection" width="50" /> <el-table-column type="selection" width="50" />
<el-table-column prop="item_code" label="检查项目编号" width="160" sortable="custom" /> <el-table-column prop="item_code" label="检查项目编号" width="160" sortable="custom" />
<el-table-column prop="item_name" label="检查项目名称" sortable="custom" /> <el-table-column prop="item_name" label="检查项目名称" sortable="custom" />
<el-table-column prop="his_exec_dept_names" label="原始科室" width="200"> <el-table-column prop="his_exec_dept_names" label="HIS绑定科室" width="200">
<template #default="scope"> <template #default="scope">
<el-tag v-for="(name, idx) in scope.row.his_exec_dept_names" :key="idx" <el-tag v-for="(name, idx) in scope.row.his_exec_dept_names" :key="idx"
class="ml-2" style="margin-bottom: 2px; margin-right: 4px;">{{ name }}</el-tag> class="ml-2" style="margin-bottom: 2px; margin-right: 4px;">{{ name }}</el-tag>

@ -15,11 +15,14 @@
<el-button @click="GetList()" style="margin-left: 10px;">查询</el-button> <el-button @click="GetList()" style="margin-left: 10px;">查询</el-button>
<el-button v-if="isAdmin" type="primary" @click="add()" style="margin-left: 10px;"></el-button> <el-button v-if="isAdmin" type="primary" @click="add()" style="margin-left: 10px;"></el-button>
<el-form-item> <el-form-item>
<el-checkbox v-model="searchInfo.only_execute" @change="GetList" style="margin-left: 15px;"></el-checkbox> <el-checkbox v-model="searchInfo.only_execute" @change="GetList" style="margin-left: 15px;"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-checkbox v-model="searchInfo.only_first_level" @change="GetList" style="margin-left: 15px;"></el-checkbox> <el-checkbox v-model="searchInfo.only_first_level" @change="GetList" style="margin-left: 15px;"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item>
<el-checkbox v-model="searchInfo.appointment_enabled" @change="GetList" style="margin-left: 15px;"></el-checkbox>
</el-form-item>
</el-row> </el-row>
</div> </div>
<el-table :data="tableData" style="width: 100%;" row-key="id" :row-style="{'height':'60px'}" <el-table :data="tableData" style="width: 100%;" row-key="id" :row-style="{'height':'60px'}"
@ -186,6 +189,7 @@
name: '', name: '',
only_execute: true, only_execute: true,
only_first_level: true, only_first_level: true,
appointment_enabled: true,
}) })
let tableData = ref([]) let tableData = ref([])
let currentPage = ref(1) // let currentPage = ref(1) //

Loading…
Cancel
Save