feat(doctorstation): 添加取消接诊功能
- 在医生工作站界面添加取消接诊按钮 - 实现取消接诊的前端处理逻辑和确认对话框 - 添加计算属性控制取消接诊按钮的禁用状态 - 完善后端取消接诊服务的安全性检查和异常处理 - 优化取消接诊时的业务数据验证流程 - 添加详细的错误提示和用户反馈机制
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
</el-radio-group>
|
||||
<el-button type="primary" plain @click.stop="handleFinish(patientInfo.encounterId)" size="small">完诊</el-button>
|
||||
<el-button type="primary" plain @click.stop="handleLeave(patientInfo.encounterId)" size="small">暂离</el-button>
|
||||
<el-button type="warning" plain :disabled="isCancelButtonDisabled" @click.stop="handleCancel(patientInfo.encounterId)" size="small">取消接诊</el-button>
|
||||
<el-button type="primary" plain :disabled="isRefundButtonDisabled" @click.stop="handleRefund(patientInfo.encounterId)" size="small">退费</el-button>
|
||||
<el-button type="primary" plain class="top-layer-btn" @click.stop="getEnPrescription(patientInfo.encounterId)" size="small">处方单</el-button>
|
||||
<el-button type="primary" plain class="top-layer-btn" :disabled="isHospitalizationButtonDisabled" @click.stop="handleHospitalizationClick()" size="small">办理住院</el-button>
|
||||
@@ -193,6 +194,7 @@ import {
|
||||
getList,
|
||||
isHospitalization,
|
||||
leaveEncounter,
|
||||
cancelEncounter,
|
||||
} from './components/api.js';
|
||||
import prescriptionlist from './components/prescription/prescriptionlist.vue';
|
||||
import RefundListDialog from './components/prescription/refundListDialog.vue';
|
||||
@@ -282,6 +284,16 @@ const isHospitalizationButtonDisabled = computed(() => {
|
||||
patientInfo.value.encounterId === undefined;
|
||||
});
|
||||
|
||||
// 计算属性:确定取消接诊按钮是否应被禁用
|
||||
const isCancelButtonDisabled = computed(() => {
|
||||
return !patientInfo.value ||
|
||||
typeof patientInfo.value !== 'object' ||
|
||||
!patientInfo.value.encounterId ||
|
||||
patientInfo.value.encounterId === '' ||
|
||||
patientInfo.value.encounterId === null ||
|
||||
patientInfo.value.encounterId === undefined;
|
||||
});
|
||||
|
||||
// 计算属性:确定退费按钮是否应被禁用(与住院按钮使用相同的逻辑)
|
||||
const isRefundButtonDisabled = computed(() => {
|
||||
return !patientInfo.value ||
|
||||
@@ -628,6 +640,34 @@ function handleLeave(encounterId) {
|
||||
});
|
||||
}
|
||||
|
||||
function handleCancel(encounterId) {
|
||||
if (!encounterId) {
|
||||
ElMessage.warning('请先选择患者后再进行取消接诊操作');
|
||||
return;
|
||||
}
|
||||
ElMessageBox.confirm('确定要取消接诊该患者吗?取消后患者将回到待诊状态。', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
cancelEncounter(encounterId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('取消接诊成功');
|
||||
patientInfo.value = {};
|
||||
getPatientList();
|
||||
getWaitPatient();
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '取消接诊失败');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('取消接诊失败:', error);
|
||||
proxy.$modal.msgError('取消接诊失败');
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消操作,不做处理
|
||||
});
|
||||
}
|
||||
|
||||
async function handleFinish(encounterId) {
|
||||
// 完诊前验证诊断信息
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user