From 8d6d6fbf312557cba6074a30c683300d3bd37133 Mon Sep 17 00:00:00 2001 From: sa0ChunLuyu Date: Thu, 23 Jul 2026 16:37:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=A1=B9=E7=9B=AE=20=20?= =?UTF-8?q?=E6=B8=A9=E9=A6=A8=E6=8F=90=E7=A4=BA=20=E6=B3=A8=E6=84=8F?= =?UTF-8?q?=E4=BA=8B=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/YeWu/DeptCheckItemController.php | 10 +++ .../Admin/YeWu/DeptCheckItemService.php | 12 +++ Laravel/routes/api.php | 1 + YiJi-admin/src/api/api.js | 4 + .../src/views/YeWu/DeptCheckItemConfig.vue | 77 ++++++++++++++++++- 5 files changed, 100 insertions(+), 4 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/DeptCheckItemController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/DeptCheckItemController.php index f91b571..ca6b30a 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/DeptCheckItemController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/DeptCheckItemController.php @@ -37,6 +37,16 @@ public function BindDevice(Request $request) return $service->BindDevice($item_id, $device_ids, $userid); } + //批量更新检查须知/温馨提示 + public function BatchUpdateNotice() + { + $item_ids = request('item_ids'); + $field = request('field'); + $value = request('value'); + $service = new DeptCheckItemService(); + return $service->BatchUpdateNotice($item_ids, $field, $value); + } + //保存检查项目信息 public function Save() { diff --git a/Laravel/app/Services/Admin/YeWu/DeptCheckItemService.php b/Laravel/app/Services/Admin/YeWu/DeptCheckItemService.php index 72ef0b4..4e9fa47 100644 --- a/Laravel/app/Services/Admin/YeWu/DeptCheckItemService.php +++ b/Laravel/app/Services/Admin/YeWu/DeptCheckItemService.php @@ -156,6 +156,18 @@ public function BindDevice($item_id,$device_ids,$userid){ return \Yz::Return(false, '绑定失败'); } } + public function BatchUpdateNotice($item_ids, $field, $value) + { + if (empty($item_ids) || !in_array($field, ['check_notice', 'warm_tips'])) { + return \Yz::Return(false, '参数错误'); + } + $updated = DB::table('s_check_item') + ->whereIn('id', $item_ids) + ->where('is_del', 0) + ->update([$field => $value]); + return \Yz::Return(true, '批量更新成功,共更新' . $updated . '条'); + } + public function Save($Info){ if(!empty($Info['id'])){ $Info['reservation_method']=implode(',', $Info['reservation_method']); diff --git a/Laravel/routes/api.php b/Laravel/routes/api.php index 1a96f7a..dcbf3e1 100644 --- a/Laravel/routes/api.php +++ b/Laravel/routes/api.php @@ -59,6 +59,7 @@ Route::post('admin/GetDeptCheckItemList','App\Http\Controllers\API\Admin\YeWu\DeptCheckItemController@GetItemList');//获取当前科室权限的检查项目列表 Route::post('admin/DeptItemBindDevice','App\Http\Controllers\API\Admin\YeWu\DeptCheckItemController@BindDevice');//当前科室权限的检查项目绑定设备 Route::post('admin/DeptSaveItemInfo','App\Http\Controllers\API\Admin\YeWu\DeptCheckItemController@Save');//当前科室权限的保存检查项目信息 + Route::post('admin/DeptBatchUpdateNotice','App\Http\Controllers\API\Admin\YeWu\DeptCheckItemController@BatchUpdateNotice');//科室版本批量更新检查须知/温馨提示 Route::post('admin/GetDeptDeviceListPage','App\Http\Controllers\API\Admin\YeWu\DeptDeviceController@GetList');//获取当前科室下的设备列表(分页) Route::post('admin/SaveDeptDevice','App\Http\Controllers\API\Admin\YeWu\DeptDeviceController@Save');//保存当前科室下的设备 Route::post('admin/DelDeptDevice','App\Http\Controllers\API\Admin\YeWu\DeptDeviceController@Del');//删除当前科室下的设备 diff --git a/YiJi-admin/src/api/api.js b/YiJi-admin/src/api/api.js index 6441209..0a66de1 100644 --- a/YiJi-admin/src/api/api.js +++ b/YiJi-admin/src/api/api.js @@ -204,6 +204,10 @@ export const DeptItemBindDevice = (data = {}) => { export const DeptSaveItemInfo = (data = {}) => { return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/DeptSaveItemInfo', data: data }) } +//科室版本批量更新检查须知/温馨提示 +export const DeptBatchUpdateNotice = (data = {}) => { + return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/DeptBatchUpdateNotice', data: data }) +} //admin获取科室列表 export const GetDepartmentList = (data = {}) => { return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetDepartmentList', data: data }) diff --git a/YiJi-admin/src/views/YeWu/DeptCheckItemConfig.vue b/YiJi-admin/src/views/YeWu/DeptCheckItemConfig.vue index cda6a5b..ccf4298 100644 --- a/YiJi-admin/src/views/YeWu/DeptCheckItemConfig.vue +++ b/YiJi-admin/src/views/YeWu/DeptCheckItemConfig.vue @@ -32,6 +32,8 @@ 查询 批量关联排班 + 批量设置检查须知 + 批量设置温馨提示 @@ -45,7 +47,7 @@ - + @@ -118,7 +120,10 @@
检查须知:
+ type="textarea" placeholder="请输入检查须知" style="width: 500px;" :rows="8" /> + +
温馨提示:
+ + + + @@ -272,7 +285,8 @@ GetHuChiList, GetCheckItemList, GetCheckItemRules, - SaveCheckItemRules + SaveCheckItemRules, + DeptBatchUpdateNotice } from '@/api/api.js' import { ElMessage, @@ -300,7 +314,8 @@ reservation_method: '', check_time: '', check_begin_time: '', - check_notice: '' + check_notice: '', + warm_tips: '' }) //获取检查项目类别list let BigClassList = ref([]); @@ -382,6 +397,10 @@ let isBatchLink = ref(false) //是否批量关联模式 let selectedCheckItems = ref([]) //勾选的检查项目 let checkItemTableRef = ref(null) //表格ref + let batchNoticeDialogVisible = ref(false) + let batchNoticeField = ref('') + let batchNoticeTitle = ref('') + let batchNoticeValue = ref('') // 计算链接对话框标题 const linkDialogTitle = computed(() => { @@ -393,6 +412,55 @@ selectedCheckItems.value = rows } + // 打开批量设置弹窗 + const openBatchNotice = (field) => { + if (selectedCheckItems.value.length === 0) { + ElMessage.error('请先勾选要批量设置的检查项目') + return + } + batchNoticeField.value = field + batchNoticeTitle.value = field === 'check_notice' ? '批量设置检查须知' : '批量设置温馨提示' + + const valueMap = {} + selectedCheckItems.value.forEach(row => { + const val = (row[field] || '').trim() + if (val) { + valueMap[val] = (valueMap[val] || 0) + 1 + } + }) + + let maxCount = 0 + let mostValue = '' + Object.entries(valueMap).forEach(([val, count]) => { + if (count > maxCount) { + maxCount = count + mostValue = val + } + }) + + batchNoticeValue.value = mostValue + batchNoticeDialogVisible.value = true + } + + const saveBatchNotice = () => { + const ids = selectedCheckItems.value.map(row => row.id) + loading.value = true + DeptBatchUpdateNotice({ + item_ids: ids, + field: batchNoticeField.value, + value: batchNoticeValue.value + }).then(res => { + loading.value = false + if (res.status) { + batchNoticeDialogVisible.value = false + ElMessage.success(res.msg) + GetItemList() + } else { + ElMessage.error(res.msg) + } + }) + } + //点击打开设备穿梭框 const LinkDeviceClick = (row) => { isBatchLink.value = false @@ -524,6 +592,7 @@ } selectedItemInfo.value.check_begin_time = row.check_begin_time selectedItemInfo.value.check_notice = row.check_notice + selectedItemInfo.value.warm_tips = row.warm_tips } //获取预约方式类型 let yuyueType = ref('')