diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue index e08b5ac8..f13a4f17 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue @@ -103,8 +103,15 @@ - + @@ -181,7 +188,7 @@ import {computed, getCurrentInstance, ref, watch} from 'vue'; import {Refresh, Search} from '@element-plus/icons-vue'; import {patientInfo} from '../../store/patient.js'; -import {getInspection} from './api'; +import {getInspection, deleteRequestForm, withdrawRequestForm} from './api'; import {getOrgList} from '@/views/doctorstation/components/api.js'; const { proxy } = getCurrentInstance(); @@ -399,6 +406,61 @@ const handleViewDetail = async (row) => { detailDialogVisible.value = true; }; +/** + * 修改检验申请单(待签发状态) + */ +const handleEdit = (row) => { + // 复用详情查看逻辑,后续可扩展为打开编辑弹窗 + handleViewDetail(row); + proxy.$modal?.msgInfo?.('修改功能待接入,请通过详情弹窗查看后重新开立'); +}; + +/** + * 删除检验申请单(仅待签发状态可删除) + */ +const handleDelete = async (row) => { + try { + await proxy.$modal?.confirm?.(`确定要删除申请单 "${row.prescriptionNo}" 吗?此操作不可恢复。`); + } catch { + return; // 用户取消 + } + + try { + const res = await deleteRequestForm({ prescriptionNo: row.prescriptionNo }); + if (res?.code === 200) { + proxy.$modal?.msgSuccess?.('删除成功'); + await fetchData(); + } else { + proxy.$modal?.msgError?.(res?.msg || '删除失败'); + } + } catch (e) { + proxy.$modal?.msgError?.(e.message || '删除异常'); + } +}; + +/** + * 撤回检验申请单(已签发状态撤回至待签发) + */ +const handleWithdraw = async (row) => { + try { + await proxy.$modal?.confirm?.(`确定要撤回申请单 "${row.prescriptionNo}" 吗?撤回后将恢复为待签发状态。`); + } catch { + return; // 用户取消 + } + + try { + const res = await withdrawRequestForm({ prescriptionNo: row.prescriptionNo }); + if (res?.code === 200) { + proxy.$modal?.msgSuccess?.('撤回成功'); + await fetchData(); + } else { + proxy.$modal?.msgError?.(res?.msg || '撤回失败'); + } + } catch (e) { + proxy.$modal?.msgError?.(e.message || '撤回异常'); + } +}; + watch( () => patientInfo.value?.encounterId, async (val) => {