fix(inhospitalnurse): 优化住院护士站患者管理和床位分配功能
- 移除住院参与者更新失败时的异常返回,改为静默处理 - 更新床位分配提示信息,为用户提供更清晰的操作指导 - 实现实施科室下拉选择器的远程搜索功能,提升大数据量下的用户体验 - 添加节点切换时的未保存数据确认提醒,防止数据丢失 - 优化实施科室管理页面的选项过滤和加载状态管理
This commit is contained in:
@@ -293,11 +293,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
if (admissionPatientInfoDto.getPriorityEnum() != null) {
|
||||
// 更新患者病情
|
||||
encounterService.updatePriorityEnumById(encounterId, admissionPatientInfoDto.getPriorityEnum());
|
||||
// 将之前的住院参与者更新为已完成
|
||||
Integer result = encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
|
||||
if (result == 0) {
|
||||
return R.fail("患者信息更新失败,请联系管理员");
|
||||
}
|
||||
// 将之前的住院参与者更新为已完成(如果存在的话)
|
||||
encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
|
||||
// 更新住院参与者
|
||||
// 住院医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
|
||||
@@ -81,15 +81,15 @@
|
||||
v-model="scope.row.activityDefinitionId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请选择"
|
||||
remote-show-suffix
|
||||
:remote-method="(query) => handleRemoteQuery(query, scope.row)"
|
||||
:loading="scope.row.loading"
|
||||
placeholder="请输入并搜索项目"
|
||||
style="width: 400px; max-width: 500px"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allImplementDepartmentList"
|
||||
v-for="item in scope.row.filteredOptions || []"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -243,6 +243,15 @@ function getAllImplementDepartment() {
|
||||
value: item.activityDefinitionId,
|
||||
label: item.activityDefinitionName,
|
||||
}));
|
||||
|
||||
// 为所有现有行初始化过滤选项
|
||||
catagoryList.value.forEach(row => {
|
||||
if (!row.hasOwnProperty('filteredOptions')) {
|
||||
row.filteredOptions = allImplementDepartmentList.value.slice(0, 100); // 限制为前100个
|
||||
row.loading = false;
|
||||
}
|
||||
});
|
||||
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
@@ -253,6 +262,26 @@ function handleSelectionChange(selection) {
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
// 远程搜索处理函数
|
||||
function handleRemoteQuery(query, row) {
|
||||
if (query !== '') {
|
||||
// 设置加载状态
|
||||
row.loading = true;
|
||||
// 模拟异步延迟
|
||||
setTimeout(() => {
|
||||
// 过滤选项
|
||||
row.filteredOptions = allImplementDepartmentList.value.filter(item => {
|
||||
return item.label.toLowerCase().includes(query.toLowerCase()) ||
|
||||
item.value.toLowerCase().includes(query.toLowerCase());
|
||||
});
|
||||
row.loading = false;
|
||||
}, 300); // 300ms 延迟,模拟网络请求
|
||||
} else {
|
||||
// 如果查询为空,显示所有选项(但限制数量以提高性能)
|
||||
row.filteredOptions = allImplementDepartmentList.value.slice(0, 100); // 限制为前100个
|
||||
}
|
||||
}
|
||||
|
||||
// 新增项目
|
||||
function handleAddItem() {
|
||||
if (data.isAdding) {
|
||||
@@ -262,9 +291,11 @@ function handleAddItem() {
|
||||
const newRow = {
|
||||
startTime: '00:00:00',
|
||||
endTime: '23:59:59',
|
||||
loading: false, // 添加加载状态
|
||||
filteredOptions: allImplementDepartmentList.value.slice(0, 100), // 初始化过滤选项,限制数量
|
||||
};
|
||||
catagoryList.value.push(newRow);
|
||||
total.value = organization.value.length;
|
||||
total.value = catagoryList.value.length; // 修正:使用实际数据列表长度,而不是组织结构长度
|
||||
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
||||
}
|
||||
// 批量添加
|
||||
@@ -272,6 +303,7 @@ function handleBacthAddItem() {
|
||||
// 批量添加显示对话框
|
||||
bacthAddItemDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 检验 编辑或 保存数据
|
||||
function handleBlur(row, index) {
|
||||
let hasError = false;
|
||||
@@ -344,9 +376,23 @@ function deleteSelectedRows(row) {
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(res, node) {
|
||||
// 新增按钮是否 disable
|
||||
data.isAdding = false;
|
||||
// 检查是否有未保存的数据
|
||||
if (data.isAdding) {
|
||||
proxy.$modal.confirm('当前有未保存的数据,切换节点将丢失未保存的数据,是否继续?').then(() => {
|
||||
// 确认切换,重置状态
|
||||
data.isAdding = false;
|
||||
continueHandleNodeClick(node);
|
||||
}).catch(() => {
|
||||
// 取消切换,保持当前状态
|
||||
return;
|
||||
});
|
||||
} else {
|
||||
continueHandleNodeClick(node);
|
||||
}
|
||||
}
|
||||
|
||||
// 实际的节点点击处理逻辑
|
||||
function continueHandleNodeClick(node) {
|
||||
// 新增按钮是否 disable
|
||||
if (node.parent === null || node.level === 1) {
|
||||
isAddDisable.value = true;
|
||||
|
||||
@@ -371,8 +371,9 @@ const handleTransferInOk = async () => {
|
||||
// 单击患者卡片事件 - 直接触发入科选床界面
|
||||
function handleCardClick(item: any, index: number) {
|
||||
if (item.encounterStatus == 2) {
|
||||
// 显示提示信息,指导用户如何分配床位
|
||||
ElMessage({
|
||||
message: '请分配病床!',
|
||||
message: '该患者尚未分配病床,请通过拖拽操作将患者分配到右侧床位',
|
||||
type: 'warning',
|
||||
grouping: true,
|
||||
showClose: true,
|
||||
@@ -390,8 +391,9 @@ function handleCardClick(item: any, index: number) {
|
||||
// 双击患者卡片事件 - 保持原有逻辑
|
||||
function handleCardDblClick(item: any) {
|
||||
if (item.encounterStatus == 2) {
|
||||
// 显示提示信息,指导用户如何分配床位
|
||||
ElMessage({
|
||||
message: '请分配病床!',
|
||||
message: '该患者尚未分配病床,请通过拖拽操作将患者分配到右侧床位',
|
||||
type: 'warning',
|
||||
grouping: true,
|
||||
showClose: true,
|
||||
|
||||
Reference in New Issue
Block a user