fix(#593): 请修复 Bug #593:【住院医生工作站-临床医嘱】长期医嘱模块缺失取消停嘱功能

根因:
- Bug #请修复 Bug #593 存在的问题

修复:
- ## 变更摘要
- ### Bug #593:长期医嘱缺失"恢复"功能
- #### 修改的文件(5个)
- 前端 (Vue 3)**
- `src/views/inpatientDoctor/home/components/api.js`
- 新增 `cancelStopAdvice()` API(`POST /reg-doctorstation/advice-manage/cancel-stop-reg-advice`)
- `src/views/inpatientDoctor/home/components/order/index.vue`
- 模板**:在【停嘱】按钮后新增绿色【恢复】按钮
- 导入**:新增 `cancelStopAdvice` 导入
- 逻辑**:新增 `handleResumeAdvice()` 函数,包含:
- 空选校验
- 状态校验(只有 `statusEnum == 6`(停止)的医嘱可选)
- 混选拦截(只能全选"停止"状态的医嘱)
- 确认弹窗
- 调用 `cancelStopAdvice` API
- 成功后刷新数据
- 后端 (Java/Spring Boot)**
- `AdviceManageController.java`
- 新增 `POST /cancel-stop-reg-advice` 端点
- `IAdviceManageAppService.java`
- 新增 `cancelStopRegAdvice()` 接口方法
- `AdviceManageAppServiceImpl.java`
- 护士站校验**:查询 `MedicationDispense` 记录,若 dispense 状态 >= COMPLETED(4) 则拦截提示"护士站已确认停止该医嘱,无法取消停嘱!"
- 药房端校验**:若 dispense 状态为 RETURNED/REFUNDED/PART_REFUND 则拦截提示"药房已完成退药处理,无法取消停嘱!"
- 执行恢复**:将 `MedicationRequest.statusEnum` 恢复为 ACTIVE(2),清空 `effectiveDoseEnd`,将待退药/停止的 dispense 记录恢复为草稿/待配药状态
- 诊疗类医嘱同理恢复 `ServiceRequest` 状态
- #### 验证结果
-  后端编译通过
-  前端 lint 通过(无新增错误)
This commit is contained in:
2026-05-29 00:53:02 +08:00
parent 11618e3d6c
commit fab178b2fb
5 changed files with 189 additions and 1 deletions

View File

@@ -226,6 +226,17 @@ export function stopAdvice(data) {
data: data,
});
}
/**
* 取消停嘱(恢复)
*/
export function cancelStopAdvice(data) {
return request({
url: '/reg-doctorstation/advice-manage/cancel-stop-reg-advice',
method: 'post',
data: data,
});
}
/**
* 获取患者本次就诊处方
*/

View File

@@ -31,6 +31,9 @@
<el-button type="danger" plain @click="handleStopAdvice()" :disabled="false">
停嘱
</el-button>
<el-button type="success" plain @click="handleResumeAdvice()" :disabled="false">
恢复
</el-button>
<el-button type="danger" plain @click="handleDelete()" :disabled="false"> 删除 </el-button>
<span class="descriptions-item-label"> 诊断 </span>
<el-select v-model="conditionDefinitionId" placeholder="诊断" style="width: 180px">
@@ -402,6 +405,7 @@ import {
savePrescriptionSign,
singOut,
stopAdvice,
cancelStopAdvice,
updateGroupId,
getConfiguredCategories,
} from '../api';
@@ -2071,10 +2075,71 @@ function confirmStopAdvice() {
getListInfo(false);
}
});
}
// 恢复(取消停嘱)
function handleResumeAdvice() {
let selectRows = prescriptionRef.value.getSelectionRows();
console.log('handleResumeAdvice selectRows======>', JSON.stringify(selectRows));
if ((selectRows || []).length <= 0) {
ElMessage({
type: 'error',
message: '请选择数据',
});
return;
}
// 校验:只有状态为"停止"(statusEnum=6)的医嘱才能恢复
let hasStopOrder = false;
for (let index = 0; index < selectRows.length; index++) {
const item = selectRows[index];
if (item.statusEnum == 6) {
hasStopOrder = true;
break;
}
}
if (!hasStopOrder) {
ElMessage({
type: 'error',
message: '请选择已停止的医嘱进行恢复',
});
return;
}
// 校验:选择的医嘱中不能包含非停止状态的医嘱
let allStop = true;
for (let index = 0; index < selectRows.length; index++) {
const item = selectRows[index];
if (item.statusEnum != 6) {
allStop = false;
break;
}
}
if (!allStop) {
ElMessage({
type: 'error',
message: '恢复操作只能选择已停止的医嘱,请重新选择',
});
return;
}
ElMessageBox.confirm('确定要恢复选中的已停止医嘱吗?', '恢复确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const requestIdList = selectRows.map((item) => ({
requestId: item.requestId,
adviceType: item.adviceType,
}));
cancelStopAdvice(requestIdList).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
getListInfo(false);
}
});
prescriptionRef.value.clearSelection();
}).catch(() => {});
}
function handleGroupId(paramList) {
updateGroupId(paramList);
}
}
// 组合
function combination() {