1. 科室增加上下级绑定关联。

2. 删除掉二级科室(如:CT一室)下的所有诊室
3. 科室列表增加只显示存在执行诊室的科室的开关。默认开启。
4. 主工作列表可以看到全部本身以及子诊室的预约信息
5. 主工作列表执行诊室顺序显示逻辑:距离当前开立检查医嘱时间最近,有可用的预约号源,数量多,排在最前,如果都有每次随机
main
鹿和sa0ChunLuyu 3 weeks ago
parent 99819b7e90
commit 44c6aac177

@ -44,7 +44,27 @@ public function Del()
$service = new DepartmentService(); $service = new DepartmentService();
return $service->Del($id); return $service->Del($id);
} }
//获取科室已关联的子科室ID列表
public function GetChildren()
{
$department_id = request('department_id');
$service = new DepartmentService();
return $service->GetChildren($department_id);
}
//获取可作为诊室的叶子节点科室列表
public function GetLeafList()
{
$department_id = request('department_id');
$service = new DepartmentService();
return $service->GetLeafList($department_id);
}
//保存科室关联诊室关系
public function SaveChildren()
{
$department_id = request('department_id');
$children_ids = request('children_ids', []);
$service = new DepartmentService();
return $service->SaveChildren($department_id, $children_ids);
}
} }

@ -136,10 +136,18 @@ public function GetList(Request $request)
$list=$list->where(['reservation_department'=>$department->department_name]); $list=$list->where(['reservation_department'=>$department->department_name]);
}else{ }else{
//获取当前科室及所有子科室的 department_number
$list = $list->where(function ($q) use($department) { $deptNumbers = DB::table('s_department')
$q->where(['RISRAcceptDeptCode'=>$department->department_number]) ->where('is_del', 0)
->orWhere('reservation_department_code', $department->department_number); ->where(function($q) use ($department_id) {
$q->where('id', $department_id)
->orWhere('pid', $department_id);
})
->pluck('department_number');
$list = $list->where(function ($q) use($deptNumbers) {
$q->whereIn('RISRAcceptDeptCode', $deptNumbers)
->orWhereIn('reservation_department_code', $deptNumbers);
}); });
} }
if ($searchInfo['dateRange']!=null and count($searchInfo['dateRange']) == 2) { if ($searchInfo['dateRange']!=null and count($searchInfo['dateRange']) == 2) {

@ -38,4 +38,58 @@ public function GetDepartmentList(){
} }
return \Yz::JsonError("调用His接口失败"); return \Yz::JsonError("调用His接口失败");
} }
//根据入参数据同步科室不调用HIS接口
public function SyncDepartmentFromData()
{
$data = request('data');
$password = request('password');
//调试输出
\Log::debug('SyncDepartmentFromData 入参', [
'password' => $password,
'data_type' => gettype($data),
'data' => $data
]);
//校验password
if ($password !== '324F883D-D501-40AD-8740-98536606906D') {
return \Yz::JsonError('密钥验证失败password: '.$password);
}
if (empty($data) || !is_array($data)) {
return \Yz::JsonError('数据不能为空data类型: '.gettype($data));
}
$up_count = 0;
foreach ($data as $i => $item) {
//调试输出每条数据
\Log::debug('SyncDepartmentFromData 处理第'.$i.'条', ['item' => $item]);
if (!isset($item['deptCode']) || !isset($item['deptName'])) {
\Log::error('SyncDepartmentFromData 字段缺失', ['index' => $i, 'item' => $item]);
continue;
}
$dpt = DB::table('s_department')
->where('department_number', $item['deptCode'])
->first();
if (!$dpt) {
DB::table('s_department')->insert([
'department_number' => $item['deptCode'],
'department_name' => $item['deptName'],
'department_status' => 1,
'is_del' => 0,
]);
$up_count++;
} else {
DB::table('s_department')
->where('department_number', $item['deptCode'])
->update(['department_name' => $item['deptName']]);
$up_count++;
}
}
return \Yz::JsonReturn(true, "同步完成,更新{$up_count}条数据", ['up_count' => $up_count]);
}
} }

@ -31,13 +31,26 @@ public function GetList($searchInfo,$page,$pageSize,$userid=null,$group=null)
if(!empty($searchInfo['name'])){ if(!empty($searchInfo['name'])){
$list= $list->where('department_name','like','%'.$searchInfo['name'].'%'); $list= $list->where('department_name','like','%'.$searchInfo['name'].'%');
} }
//只显示执行科室(有科室资源的科室)
if(!empty($searchInfo['only_execute'])){
$hasResourceDeptIds = DB::table('s_department_resources')
->where('is_del', 0)
->distinct()
->pluck('department_id');
$list = $list->whereIn('id', $hasResourceDeptIds);
}
//只显示一级科室pid=0的顶级科室
if(!empty($searchInfo['only_first_level'])){
$list = $list->where('pid', 0);
}
$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() ;
//查询科室下的资源总数 //查询科室下的资源总数和子科室数量
foreach ($l as $k=>$v){ foreach ($l as $k=>$v){
$l[$k]->user_list=DB::table('users')->where(['department_id'=>$v->id,'status'=>1])->get(); $l[$k]->user_list=DB::table('users')->where(['department_id'=>$v->id,'status'=>1])->get();
$l[$k]->resource_count=DB::table('s_department_resources')->where(['department_id'=>$v->id,'is_del'=>0])->count(); $l[$k]->resource_count=DB::table('s_department_resources')->where(['department_id'=>$v->id,'is_del'=>0])->count();
$l[$k]->children_count=DB::table('s_department')->where(['pid'=>$v->id,'is_del'=>0])->count();
} }
return \Yz::Return(true, '查询成功', ['list'=>$l,'count'=>$c]); return \Yz::Return(true, '查询成功', ['list'=>$l,'count'=>$c]);
} }
@ -80,6 +93,8 @@ public function Save($info)
} }
public function Del($id) public function Del($id)
{ {
//将子科室的pid置0
DB::table('s_department')->where('pid',$id)->where('is_del',0)->update(['pid'=>0]);
$c= DB::table('s_department')->where('id',$id)->update(['is_del'=>1]); $c= DB::table('s_department')->where('id',$id)->update(['is_del'=>1]);
if(!$c){ if(!$c){
return \Yz::Return(false, '删除失败', []); return \Yz::Return(false, '删除失败', []);
@ -87,4 +102,56 @@ public function Del($id)
return \Yz::Return(true, '删除成功', []); return \Yz::Return(true, '删除成功', []);
} }
} }
//获取科室已关联的子科室ID列表
public function GetChildren($department_id)
{
$ids = DB::table('s_department')
->where('pid', $department_id)
->where('is_del', 0)
->pluck('id');
return \Yz::Return(true, '查询成功', ['ids' => $ids]);
}
//获取可作为诊室的叶子节点科室列表空闲的叶子节点pid=0且无子科室
public function GetLeafList($department_id)
{
$subIds = DB::table('s_department')
->where('pid', '>', 0)
->where('is_del', 0)
->pluck('pid');
//已关联的子科室IDs供右侧显示
$childrenIds = DB::table('s_department')
->where('pid', $department_id)
->where('is_del', 0)
->pluck('id');
$list = DB::table('s_department')
->where('is_del', 0)
->where('id', '!=', $department_id)
->where(function($query) use ($subIds, $childrenIds) {
$query->where(function($q) use ($subIds) {
$q->where('pid', 0)->whereNotIn('id', $subIds);
})->orWhereIn('id', $childrenIds);
})
->select('id', 'department_name')
->get();
return \Yz::Return(true, '查询成功', ['list' => $list]);
}
//保存科室关联诊室关系
public function SaveChildren($department_id, $children_ids)
{
//先清空旧关联
DB::table('s_department')
->where('pid', $department_id)
->where('is_del', 0)
->update(['pid' => 0]);
//设置新关联
if (!empty($children_ids)) {
DB::table('s_department')
->whereIn('id', $children_ids)
->update(['pid' => $department_id]);
}
return \Yz::Return(true, '保存成功', []);
}
} }

@ -243,7 +243,13 @@ public function GetEnablePlan($regnum, $entrustids, $episodeid, $appointment_typ
usort($pl1, function($a, $b) { usort($pl1, function($a, $b) {
$timeA = $a->date . ' ' . ($a->start_time ?? $a->end_time); // 兼容性处理 $timeA = $a->date . ' ' . ($a->start_time ?? $a->end_time); // 兼容性处理
$timeB = $b->date . ' ' . ($b->start_time ?? $b->end_time); $timeB = $b->date . ' ' . ($b->start_time ?? $b->end_time);
if ($timeA !== $timeB) {
return $timeA <=> $timeB; return $timeA <=> $timeB;
}
// 相同时间,按可用号源数量降序
$availableA = ($a->count - $a->used_count);
$availableB = ($b->count - $b->used_count);
return $availableB <=> $availableA;
}); });
// 取出时间最早的那一个(未过期) // 取出时间最早的那一个(未过期)

@ -69,6 +69,9 @@
Route::post('admin/SaveDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Save');//保存科室信息 Route::post('admin/SaveDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Save');//保存科室信息
Route::post('admin/DelDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Del');//删除科室信息 Route::post('admin/DelDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Del');//删除科室信息
Route::post('admin/GetEnableDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetEnableList');//获取启用的科室列表 Route::post('admin/GetEnableDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetEnableList');//获取启用的科室列表
Route::post('admin/GetDepartmentChildren','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetChildren');//获取科室已关联的子科室列表
Route::post('admin/GetLeafDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetLeafList');//获取可作为诊室的叶子节点科室列表
Route::post('admin/SaveDepartmentChildren','App\Http\Controllers\API\Admin\YeWu\DepartmentController@SaveChildren');//保存科室关联诊室关系
Route::post('admin/SaveDepartmentResource','App\Http\Controllers\API\Admin\YeWu\DepartmentResourceController@Save');//保存科室资源信息 Route::post('admin/SaveDepartmentResource','App\Http\Controllers\API\Admin\YeWu\DepartmentResourceController@Save');//保存科室资源信息
Route::post('admin/DepartmentResourceGetList','App\Http\Controllers\API\Admin\YeWu\DepartmentResourceController@GetList');//获取科室资源list Route::post('admin/DepartmentResourceGetList','App\Http\Controllers\API\Admin\YeWu\DepartmentResourceController@GetList');//获取科室资源list
Route::post('admin/DepartmentResourceGetEnableList','App\Http\Controllers\API\Admin\YeWu\DepartmentResourceController@GetEnableList');//获取可用科室资源 Route::post('admin/DepartmentResourceGetEnableList','App\Http\Controllers\API\Admin\YeWu\DepartmentResourceController@GetEnableList');//获取可用科室资源
@ -140,6 +143,7 @@
Route::post('admin/updateCheckItem','App\Http\Controllers\API\His\CheckItemController@UpdateCheckItem');//调用his更新检查项目 Route::post('admin/updateCheckItem','App\Http\Controllers\API\His\CheckItemController@UpdateCheckItem');//调用his更新检查项目
Route::post('admin/UpdateItemClass','App\Http\Controllers\API\His\CheckItemController@UpdateItemClass');//调用his更新检查项目分类 Route::post('admin/UpdateItemClass','App\Http\Controllers\API\His\CheckItemController@UpdateItemClass');//调用his更新检查项目分类
Route::post('admin/HisGetDepartmentList','App\Http\Controllers\API\His\DepartmentController@GetDepartmentList');//获取his科室列表 Route::post('admin/HisGetDepartmentList','App\Http\Controllers\API\His\DepartmentController@GetDepartmentList');//获取his科室列表
Route::post('admin/SyncDepartmentFromData','App\Http\Controllers\API\His\DepartmentController@SyncDepartmentFromData');//根据入参数据同步科室
Route::post('admin/HisGetUserList','App\Http\Controllers\API\His\UserController@GetUserList');//获取his用户列表 Route::post('admin/HisGetUserList','App\Http\Controllers\API\His\UserController@GetUserList');//获取his用户列表
Route::post('admin/SyncDrugList','App\Http\Controllers\API\His\DrugController@SyncDrugList');//同步药品列表 Route::post('admin/SyncDrugList','App\Http\Controllers\API\His\DrugController@SyncDrugList');//同步药品列表
Route::post('admin/SyncUndrugList','App\Http\Controllers\API\His\DrugController@SyncUndrugList');//同步非药品列表 Route::post('admin/SyncUndrugList','App\Http\Controllers\API\His\DrugController@SyncUndrugList');//同步非药品列表

@ -181,6 +181,18 @@ export const SaveDepartment = (data = {}) => {
export const GetEnableDepartmentList = (data = {}) => { export const GetEnableDepartmentList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetEnableDepartmentList', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetEnableDepartmentList', data: data })
} }
//admin获取科室已关联的子科室ID列表
export const GetDepartmentChildren = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetDepartmentChildren', data: data })
}
//admin获取可作为诊室的叶子节点科室列表
export const GetLeafDepartmentList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetLeafDepartmentList', data: data })
}
//admin保存科室关联诊室关系
export const SaveDepartmentChildren = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/SaveDepartmentChildren', data: data })
}
//admin保存科室资源信息 //admin保存科室资源信息
export const SaveDepartmentResource = (data = {}) => { export const SaveDepartmentResource = (data = {}) => {

@ -1,19 +1,19 @@
<template> <template>
<div> <div>
<el-dialog v-model="dialogVisible" title="诊室信息" width="30%" @close="close()"> <el-dialog v-model="dialogVisible" title="排班信息" width="30%" @close="close()">
<el-form :model="ResourcesInfo" label-width="110px" v-loading="loading" style="padding-right: 40px;"> <el-form :model="ResourcesInfo" label-width="110px" v-loading="loading" style="padding-right: 40px;">
<el-form-item label="所属科室:"> <el-form-item label="所属科室:">
<el-select :filterable="true" clearable v-model="ResourcesInfo.department_id" placeholder="选择科室"> <el-select :filterable="true" clearable v-model="ResourcesInfo.department_id" placeholder="选择科室">
<el-option v-for="(item,index) in EnableDepartmentList" :key="index" :label="item.department_name" :value="item.id" /> <el-option v-for="(item,index) in EnableDepartmentList" :key="index" :label="item.department_name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="诊室名称:"> <el-form-item label="排班名称:">
<el-input v-model="ResourcesInfo.department_resources_name" /> <el-input v-model="ResourcesInfo.department_resources_name" />
</el-form-item> </el-form-item>
<el-form-item label="诊室位置:"> <el-form-item label="资源位置:">
<el-input v-model="ResourcesInfo.department_resources_addr" /> <el-input v-model="ResourcesInfo.department_resources_addr" />
</el-form-item> </el-form-item>
<el-form-item label="诊室状态:"> <el-form-item label="状态:">
<el-switch v-model="ResourcesInfo.department_resources_status" active-text="" inactive-text="" <el-switch v-model="ResourcesInfo.department_resources_status" active-text="" inactive-text=""
:active-value="1" :inactive-value="0" /> :active-value="1" :inactive-value="0" />
</el-form-item> </el-form-item>

@ -2,18 +2,18 @@
<div class="YuYue202506"> <div class="YuYue202506">
<div class="patientInfo" v-if="patientInfo"> <div class="patientInfo" v-if="patientInfo">
<div class="item"><span class="name">{{patientInfo.user_name}}</span>{{patientInfo.user_sex_label}} {{patientInfo.age}}</div> <div class="item"><span class="name">{{patientInfo.user_name}}</span>({{patientInfo.user_sex_label}} {{patientInfo.age}})</div>
<div class="item">登记号<span class="value">{{patientInfo.reg_num}} </span></div> <div class="item">登记号:<span class="value">{{patientInfo.reg_num}} </span></div>
<div class="item">电话<span class="value">{{patientInfo.user_phone}}</span></div> <div class="item">电话:<span class="value">{{patientInfo.user_phone}}</span></div>
<div class="item" v-if="patientInfo.warddesc"><span class="value">{{patientInfo.warddesc}}</span></div> <div class="item" v-if="patientInfo.warddesc">:<span class="value">{{patientInfo.warddesc}}</span></div>
<div class="item" v-if="patientInfo.bedname"><span class="value">{{patientInfo.bedname}}</span></div> <div class="item" v-if="patientInfo.bedname">:<span class="value">{{patientInfo.bedname}}</span></div>
<div class="item">诊断<span class="value">{{patientInfo.diagnosisName}}</span></div> <div class="item">诊断:<span class="value">{{patientInfo.diagnosisName}}</span></div>
</div> </div>
<div v-else> <div v-else>
获取患者信息失败 获取患者信息失败
</div> </div>
<div class="entrustList"> <div class="entrustList">
<el-alert v-if="hasDifferentBookedDates" title="患者所有检查项目未预约至同一天请注意是否需手动调整预约" type="danger" :closable="false" show-icon style="margin-bottom: 8px;" /> <el-alert v-if="hasDifferentBookedDates" title="患者所有检查项目未预约至同一天,请注意是否需手动调整预约" type="danger" :closable="false" show-icon style="margin-bottom: 8px;" />
<el-table :data="entrustTableDate" style="width: 100%;" height="300" row-key="id" v-loading="loading" <el-table :data="entrustTableDate" style="width: 100%;" height="300" row-key="id" v-loading="loading"
ref="entrustTableRef" :row-class-name="setRowClassName" @selection-change="handleSelectionChange"> ref="entrustTableRef" :row-class-name="setRowClassName" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" :selectable="selectable" /> <el-table-column type="selection" width="50" :selectable="selectable" />
@ -210,7 +210,7 @@
let TanChuangMsgDialogVisible=ref(false) let TanChuangMsgDialogVisible=ref(false)
const getWeekday = (date1) => { const getWeekday = (date1) => {
let days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; let days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const date = new Date(date1); // const date = new Date(date1); // :
const dayOfWeek = date.getDay(); const dayOfWeek = date.getDay();
return days[dayOfWeek] return days[dayOfWeek]
} }
@ -263,7 +263,7 @@
handleType.value = 'cancel' handleType.value = 'cancel'
} }
}); });
if(selectedRows.value.length==0){// if(selectedRows.value.length==0){//,
handleType.value = 'add' handleType.value = 'add'
lastSelection.value=[] lastSelection.value=[]
} }
@ -356,7 +356,7 @@
} }
} }
if(onMountedStatus.value){// if(onMountedStatus.value){//,
onMountedStatus.value=false; onMountedStatus.value=false;
if(TanChuangMsg.value.length>0){ if(TanChuangMsg.value.length>0){
console.log('22222222222222',TanChuangMsg.value) console.log('22222222222222',TanChuangMsg.value)
@ -489,9 +489,6 @@
if (matchingPlan) { if (matchingPlan) {
if (matchingPlan.count - matchingPlan.used_count >= zhanWeiCount && matchingPlan.plan_enable===true) { if (matchingPlan.count - matchingPlan.used_count >= zhanWeiCount && matchingPlan.plan_enable===true) {
plan_enable = true plan_enable = true
if(selectedPlanId.value == 0 || selectedPlanId.value == '' || selectedPlanId.value==null && matchingPlan.id==res.data.earliestPlan){
selectedPlanId.value=matchingPlan.id
}
} }
if(is_emergency===true && matchingPlan.plan_enable===true && canEmergency.value==true){ if(is_emergency===true && matchingPlan.plan_enable===true && canEmergency.value==true){
plan_enable = true plan_enable = true
@ -513,6 +510,17 @@
planTableData.value.push(row); planTableData.value.push(row);
}); });
// plan
selectedPlanId.value = 0
const firstAvailable = plans.find(v =>
v.department_resources_name == activeZhenShi.value &&
(v.count - v.used_count) >= zhanWeiCount &&
v.plan_enable === true
);
if (firstAvailable) {
selectedPlanId.value = firstAvailable.id
}
} }
} else { } else {
ElMessage.error(res.msg) ElMessage.error(res.msg)
@ -547,7 +555,7 @@
end_time: record.end_time, end_time: record.end_time,
remaining_count: record.remaining_count, remaining_count: record.remaining_count,
status: record.status status: record.status
// // ,
}); });
}); });
@ -555,6 +563,7 @@
} }
const zhenshiClick = (zhenshi) => { const zhenshiClick = (zhenshi) => {
activeZhenShi.value = zhenshi activeZhenShi.value = zhenshi
selectedPlanId.value = 0
GetEnablePlanFunc() GetEnablePlanFunc()
} }
const PlanClick = (planid) => { const PlanClick = (planid) => {
@ -602,9 +611,9 @@
return false; return false;
} }
let msg='确定预约此时间吗' let msg='确定预约此时间吗?'
if(type==2){ if(type==2){
msg='确定改约至此时间吗' msg='确定改约至此时间吗?'
} }
ElMessageBox.confirm( ElMessageBox.confirm(
msg, msg,
@ -663,11 +672,11 @@
} }
}) })
} }
// //(,)
const CancelYuYueFunc = () => { const CancelYuYueFunc = () => {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定取消预约吗', '确定取消预约吗?',
'提示', { '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -742,7 +751,7 @@
shenqingdan_list.value = res.data.info shenqingdan_list.value = res.data.info
shenqingdan_list.value.forEach((v, i) => { shenqingdan_list.value.forEach((v, i) => {
if (v.maininfo.list_status != 1) { if (v.maininfo.list_status != 1) {
ElMessage.error(v.maininfo.entrust + " 不可打印请重新选择") ElMessage.error(v.maininfo.entrust + " 不可打印,请重新选择")
enable = false enable = false
} }
}) })
@ -806,14 +815,14 @@
function checkDateDifference15Day(date1, date2) { function checkDateDifference15Day(date1, date2) {
// //
if (!isValidDate(date1) || !isValidDate(date2)) { if (!isValidDate(date1) || !isValidDate(date2)) {
console.error("日期格式不正确请使用 YYYY-MM-DD"); console.error("日期格式不正确,请使用 YYYY-MM-DD");
return false; // return false; //
} }
const startDate = new Date(date1); const startDate = new Date(date1);
const endDate = new Date(date2); const endDate = new Date(date2);
// // ()
const diffInMs = endDate - startDate; const diffInMs = endDate - startDate;
// //
@ -824,8 +833,8 @@
function getTodayDate() { function getTodayDate() {
const today = new Date(); const today = new Date();
const year = today.getFullYear(); // 2025 const year = today.getFullYear(); // , 2025
const month = String(today.getMonth() + 1).padStart(2, '0'); // 0 +1 const month = String(today.getMonth() + 1).padStart(2, '0'); // 0 , +1
const day = String(today.getDate()).padStart(2, '0'); // const day = String(today.getDate()).padStart(2, '0'); //
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;

@ -150,7 +150,7 @@ const router = createRouter({
name: 'YewuDepartmentResources', name: 'YewuDepartmentResources',
component: () => import('../views/YeWu/DepartmentResources.vue'), component: () => import('../views/YeWu/DepartmentResources.vue'),
meta: { meta: {
title: '诊室管理' title: '排班管理'
} }
},{ },{
path: '/yewu/deviceCheckItemBind', path: '/yewu/deviceCheckItemBind',

@ -14,6 +14,12 @@
</el-form-item> </el-form-item>
<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-checkbox v-model="searchInfo.only_execute" @change="GetList" style="margin-left: 15px;"></el-checkbox>
</el-form-item>
<el-form-item>
<el-checkbox v-model="searchInfo.only_first_level" @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'}"
@ -41,11 +47,19 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="科室资源" v-if="isAdmin"> <el-table-column label="排班资源" v-if="isAdmin">
<template #default="scope"> <template #default="scope">
<div class="zi_button" @click="goto1(scope.row.id)"> ( <span <div class="zi_button" @click="goto1(scope.row.id)"> ( <span
style="color: #dd377f;">{{scope.row.resource_count}}</span> )</div> style="color: #dd377f;">{{scope.row.resource_count}}</span> )</div>
<div v-if="scope.row.department_status==1" class="zi_button2" @click="addResource(scope.row)"> <div v-if="scope.row.department_status==1" class="zi_button2" @click="addResource(scope.row)">
</div>
</template>
</el-table-column>
<el-table-column label="关联诊室" width="200" v-if="isAdmin">
<template #default="scope">
<div style="display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 0;">
<el-button size="small" @click="openLinkDialog(scope.row)"></el-button>
<span style="color: #00aaff; font-size: 12px;">已关联 {{scope.row.children_count}} </span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -113,6 +127,24 @@
</el-dialog> </el-dialog>
<DepartmentResourcesSave :departmentId="departmentInfo.id" v-if="AddResourcesShow" <DepartmentResourcesSave :departmentId="departmentInfo.id" v-if="AddResourcesShow"
@closeAddResources="closeAddResources"></DepartmentResourcesSave> @closeAddResources="closeAddResources"></DepartmentResourcesSave>
<el-dialog v-model="linkDialogVisible" title="关联诊室" width="60%">
<el-transfer
class="dept-transfer"
v-model="selectedChildren"
:data="leafDepartmentList"
:props="{ key: 'id', label: 'department_name' }"
filterable
filter-placeholder="输入科室名称搜索"
:titles="['可选诊室', '已关联诊室']"
style="display: flex; justify-content: center;"
/>
<template #footer>
<span class="dialog-footer">
<el-button @click="linkDialogVisible = false">取消</el-button>
<el-button type="primary" @click="saveChildren"></el-button>
</span>
</template>
</el-dialog>
</div> </div>
</template> </template>
@ -126,7 +158,10 @@
SaveDepartment, SaveDepartment,
DelDepartmentInfo, DelDepartmentInfo,
SaveSystemUserInfo, SaveSystemUserInfo,
getGroupList getGroupList,
GetDepartmentChildren,
GetLeafDepartmentList,
SaveDepartmentChildren
} from '@/api/api.js' } from '@/api/api.js'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import DepartmentResourcesSave from '@/components/Yewu/DepartmentResourcesSave.vue' import DepartmentResourcesSave from '@/components/Yewu/DepartmentResourcesSave.vue'
@ -145,6 +180,8 @@
let searchInfo = ref({ let searchInfo = ref({
status: null, status: null,
name: '', name: '',
only_execute: true,
only_first_level: true,
}) })
let tableData = ref([]) let tableData = ref([])
let currentPage = ref(1) // let currentPage = ref(1) //
@ -310,6 +347,57 @@
const gotoUserList=(row)=>{ const gotoUserList=(row)=>{
window.location.href = "./#/adminUserList?departmentId=" + row.id window.location.href = "./#/adminUserList?departmentId=" + row.id
} }
//
let linkDialogVisible = ref(false);
let currentLinkDepartment = ref(null);
let leafDepartmentList = ref([]);
let selectedChildren = ref([]);
const openLinkDialog = (row) => {
currentLinkDepartment.value = row
selectedChildren.value = []
linkDialogVisible.value = true
//
GetLeafDepartmentList({
department_id: row.id
}).then(res => {
if (res.status) {
leafDepartmentList.value = res.data.list
} else {
ElMessage.error(res.msg)
}
})
//
GetDepartmentChildren({
department_id: row.id
}).then(res => {
if (res.status) {
selectedChildren.value = res.data.ids.map(Number)
} else {
ElMessage.error(res.msg)
}
})
}
const saveChildren = () => {
loading.value = true
SaveDepartmentChildren({
department_id: currentLinkDepartment.value.id,
children_ids: selectedChildren.value
}).then(res => {
loading.value = false
if (res.status) {
linkDialogVisible.value = false
ElMessage({
message: '关联成功',
type: 'success',
})
GetList()
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => { onMounted(() => {
getGroup() getGroup()
GetList() GetList()
@ -339,4 +427,11 @@
.adduser{ .adduser{
} }
:deep(.dept-transfer .el-transfer-panel) {
width: 280px;
}
:deep(.dept-transfer .el-transfer__buttons) {
display: flex;
align-items: center;
}
</style> </style>

@ -17,10 +17,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input v-model="searchInfo.name" placeholder="请输入资源名称" style="margin-left: 10px;" /> <el-input v-model="searchInfo.name" placeholder="请输入排班名称" style="margin-left: 10px;" />
</el-form-item> </el-form-item>
<el-button style="margin-left: 10px;" @click="GetList"></el-button> <el-button style="margin-left: 10px;" @click="GetList"></el-button>
<el-button type="primary" style="margin-left: 10px;" @click="addResource()"></el-button> <el-button type="primary" style="margin-left: 10px;" @click="addResource()"></el-button>
</el-row> </el-row>
</div> </div>
<el-table :data="tableData" style="width: 100%;" row-key="id" <el-table :data="tableData" style="width: 100%;" row-key="id"
@ -28,7 +28,7 @@
<el-table-column prop="id" label="Id" width="100" /> <el-table-column prop="id" label="Id" width="100" />
<el-table-column prop="department_name" label="所属科室" /> <el-table-column prop="department_name" label="所属科室" />
<el-table-column prop="department_id" label="科室id" v-if="false" /> <el-table-column prop="department_id" label="科室id" v-if="false" />
<el-table-column prop="department_resources_name" label="资源名称" /> <el-table-column prop="department_resources_name" label="排班名称" />
<el-table-column prop="department_resources_addr" label="资源位置" /> <el-table-column prop="department_resources_addr" label="资源位置" />
<el-table-column prop="department_resources_status" label="状态" width="100"> <el-table-column prop="department_resources_status" label="状态" width="100">
<template #default="scope"> <template #default="scope">

Loading…
Cancel
Save