1. 管理员增加HIS执行诊室是否为空的筛选项

2. 给执行诊室绑定检查项目时,也需要增加看到全部本身以及子诊室的相关联的检查项目
main
鹿和sa0ChunLuyu 3 weeks ago
parent 44c6aac177
commit ee0e6febef

@ -20,8 +20,9 @@ public function GetList()
//获取启用的设备列表 //获取启用的设备列表
public function GetEnableList() public function GetEnableList()
{ {
$hisExecDepts = request('hisExecDepts');
$service = new DevicesService(); $service = new DevicesService();
return $service->GetEnableList(); return $service->GetEnableList($hisExecDepts);
} }
public function Save(Request $request) public function Save(Request $request)

@ -45,6 +45,16 @@ public function GetItemList($searchInfo,$page,$pageSize){
}); });
} }
} }
//执行科室筛选
if (isset($searchInfo['hisExecDepts']) && $searchInfo['hisExecDepts'] !== '') {
if ($searchInfo['hisExecDepts'] == 1) {
$list->whereNotNull('hisExecDepts')->where('hisExecDepts', '!=', '');
} elseif ($searchInfo['hisExecDepts'] == 0) {
$list->where(function($q) {
$q->whereNull('hisExecDepts')->orWhere('hisExecDepts', '');
});
}
}
$count = $list->count(); $count = $list->count();
$list= $list $list= $list
->leftJoin('s_appointment_type', 's_check_item.reservation_method', '=', 's_appointment_type.id') ->leftJoin('s_appointment_type', 's_check_item.reservation_method', '=', 's_appointment_type.id')

@ -17,9 +17,43 @@ public function GetList($searchInfo,$page,$pageSize){
return \Yz::Return(true, '查询成功', ['list'=>$list,'count'=>$count]); return \Yz::Return(true, '查询成功', ['list'=>$list,'count'=>$count]);
} }
//获取启用的设备列表 //获取启用的设备列表
public function GetEnableList(){ public function GetEnableList($hisExecDepts = null){
$list=DB::table('s_devices')->where(['is_del'=>0,'status'=>1])->get(); $list=DB::table('s_devices')->where(['is_del'=>0,'status'=>1]);
return \Yz::Return(true, '查询成功', $list);
if (!empty($hisExecDepts)) {
$deptCodes = json_decode($hisExecDepts, true);
if (!empty($deptCodes) && is_array($deptCodes)) {
//找到对应科室
$deptIds = DB::table('s_department')
->whereIn('department_number', $deptCodes)
->where('is_del', 0)
->pluck('id')
->toArray();
//找到这些科室的父级科室IDs
$parentIds = DB::table('s_department')
->whereIn('id', function($q) use ($deptIds) {
$q->select('pid')->from('s_department')
->whereIn('id', $deptIds)
->where('pid', '>', 0);
})
->where('is_del', 0)
->pluck('id')
->toArray();
$allDeptIds = array_merge($deptIds, $parentIds);
//找到这些科室下的设备
$deviceIds = DB::table('s_department_resources_device')
->whereIn('department_id', $allDeptIds)
->pluck('device_id')
->toArray();
$list->whereIn('id', $deviceIds);
}
}
return \Yz::Return(true, '查询成功', $list->get());
} }
public function Save($data,$userid){ public function Save($data,$userid){
if(empty($data['id'])){ if(empty($data['id'])){

@ -16,10 +16,16 @@
:value="item.id" /> :value="item.id" />
</el-select> </el-select>
<el-select clearable v-model="searchInfo.deviceBind" placeholder="关联检查室" style="margin-left: 10px;"> <el-select clearable v-model="searchInfo.deviceBind" placeholder="关联排班" style="margin-left: 10px;">
<el-option label="全部" value="" /> <el-option label="全部" value="" />
<el-option label="已关联检查室" :value="1" /> <el-option label="已关联排班" :value="1" />
<el-option label="未关联检查室" :value="0" /> <el-option label="未关联排班" :value="0" />
</el-select>
<el-select clearable v-model="searchInfo.hisExecDepts" placeholder="执行科室" style="margin-left: 10px;">
<el-option label="全部" value="" />
<el-option label="有执行科室" value="1" />
<el-option label="无执行科室" value="0" />
</el-select> </el-select>
<el-input v-model="searchInfo.name" placeholder="请输入项目编号/名称" style="margin-left: 10px;" /> <el-input v-model="searchInfo.name" placeholder="请输入项目编号/名称" style="margin-left: 10px;" />
@ -27,7 +33,7 @@
<el-button type="primary" @click="GetItemList()" style="margin-left: 10px;">查询</el-button> <el-button type="primary" @click="GetItemList()" style="margin-left: 10px;">查询</el-button>
<el-button type="warning" @click="GetHisItemClass()" style="margin-left: 10px; margin-left: 40px;">同步分类</el-button> <el-button type="warning" @click="GetHisItemClass()" style="margin-left: 10px; margin-left: 40px;">同步分类</el-button>
<el-button type="warning" @click="GetHisCheckItem()" style="margin-left: 10px;">同步检查项目</el-button> <el-button type="warning" @click="GetHisCheckItem()" style="margin-left: 10px;">同步检查项目</el-button>
<el-button type="primary" @click="BatchLinkDevice()" style="margin-left: 10px;">批量关联检查室</el-button> <el-button type="primary" @click="BatchLinkDevice()" style="margin-left: 10px;">批量关联排班</el-button>
</el-row> </el-row>
</div> </div>
<el-table ref="checkItemTableRef" :data="tableData" style="width: 100%; margin-top: 10px;" row-key="id" @sort-change="onSortChange" @selection-change="onSelectionChange"> <el-table ref="checkItemTableRef" :data="tableData" style="width: 100%; margin-top: 10px;" row-key="id" @sort-change="onSortChange" @selection-change="onSelectionChange">
@ -44,7 +50,7 @@
<el-table-column prop="check_notice" label="检查须知" /> <el-table-column prop="check_notice" label="检查须知" />
<el-table-column prop="check_time" label="检查时间" width="100" /> <el-table-column prop="check_time" label="检查时间" width="100" />
<el-table-column prop="check_begin_time" label="开始预约时间" width="120" /> <el-table-column prop="check_begin_time" label="开始预约时间" width="120" />
<el-table-column prop="devicesInfo" label="关联检查室"> <el-table-column prop="devicesInfo" label="关联排班">
<template #default="scope"> <template #default="scope">
<span v-for="(item,index) in scope.row.devicesInfo " :key="index"> <span v-for="(item,index) in scope.row.devicesInfo " :key="index">
<el-tag v-if="item.status==1 && item.is_del==0" class="ml-2" <el-tag v-if="item.status==1 && item.is_del==0" class="ml-2"
@ -54,9 +60,9 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="医嘱关联检查室" width="150"> <el-table-column prop="" label="医嘱关联排班" width="150">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="LinkDeviceClick(scope.row)"></el-button> <el-button size="small" @click="LinkDeviceClick(scope.row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="操作" width="220"> <el-table-column prop="" label="操作" width="220">
@ -75,7 +81,7 @@
<el-dialog v-model="DevicedialogVisible" :title="linkDialogTitle" width="40%"> <el-dialog v-model="DevicedialogVisible" :title="linkDialogTitle" width="40%">
<div class="chuansuokuang"> <div class="chuansuokuang">
<el-transfer v-model="selectedDevice" :titles="['可选检查室', '已关联检查室']" <el-transfer v-model="selectedDevice" :titles="['可选排班', '已关联排班']"
:props="{ key: 'id',label: 'device_name'}" :data="deviceList" /> :props="{ key: 'id',label: 'device_name'}" :data="deviceList" />
</div> </div>
<div v-if="isBatchLink && batchProgressShow" style="padding: 0 20px 12px; margin-top: 10px;"> <div v-if="isBatchLink && batchProgressShow" style="padding: 0 20px 12px; margin-top: 10px;">
@ -299,7 +305,9 @@
smallClass: '', smallClass: '',
name: '', name: '',
orderField: '', orderField: '',
orderDirection: '' orderDirection: '',
hisExecDepts: '1',
deviceBind: ''
}) })
// //
let selectedItemInfo = ref({ let selectedItemInfo = ref({
@ -399,7 +407,7 @@
// //
const linkDialogTitle = computed(() => { const linkDialogTitle = computed(() => {
return isBatchLink.value ? '批量关联检查室' : '关联检查室' return isBatchLink.value ? '批量关联排班' : '关联排班'
}) })
// //
@ -413,24 +421,36 @@
selectedDevice.value = [] selectedDevice.value = []
DevicedialogVisible.value = true DevicedialogVisible.value = true
selectedItemInfo.value.id = row.id selectedItemInfo.value.id = row.id
row.devicesInfo.forEach(function(v, i) { // hisExecDepts
deviceList.value.forEach(function(v2, i2) { GetEnableDeviceList({ hisExecDepts: row.hisExecDepts }).then(res => {
if (v.id == v2.id) { if (res.status) {
deviceList.value = res.data
}
//
if (row.devicesInfo && row.devicesInfo.length > 0) {
row.devicesInfo.forEach(function(v) {
if (deviceList.value.find(function(d) { return d.id == v.id })) {
selectedDevice.value.push(v.id) selectedDevice.value.push(v.id)
} }
}) })
}
}) })
} }
// //
const BatchLinkDevice = () => { const BatchLinkDevice = () => {
if (selectedCheckItems.value.length === 0) { if (selectedCheckItems.value.length === 0) {
ElMessage.error('请先勾选要批量关联的检查项目') ElMessage.error('请先勾选要批量关联的检查项目')
return return
} }
isBatchLink.value = true isBatchLink.value = true
// // hisExecDepts
const hisExecDepts = selectedCheckItems.value[0].hisExecDepts
GetEnableDeviceList({ hisExecDepts: hisExecDepts }).then(res => {
if (res.status) {
deviceList.value = res.data
}
//
let common = [] let common = []
if (selectedCheckItems.value.length > 0) { if (selectedCheckItems.value.length > 0) {
common = selectedCheckItems.value[0].devicesInfo.map(d => d.id) common = selectedCheckItems.value[0].devicesInfo.map(d => d.id)
@ -441,6 +461,7 @@
} }
selectedDevice.value = common selectedDevice.value = common
DevicedialogVisible.value = true DevicedialogVisible.value = true
})
} }
let selectedDevice = ref([]) // let selectedDevice = ref([]) //

Loading…
Cancel
Save